diff --git a/website/dist/website.zip b/website/dist/website.zip new file mode 100644 index 000000000..9e7f3c411 Binary files /dev/null and b/website/dist/website.zip differ diff --git a/website/node_modules/.vite/deps/@cloudscape-design_components.js b/website/node_modules/.vite/deps/@cloudscape-design_components.js deleted file mode 100644 index 8c4986f41..000000000 --- a/website/node_modules/.vite/deps/@cloudscape-design_components.js +++ /dev/null @@ -1,45759 +0,0 @@ -import { - require_react_dom -} from "./chunk-3AYKYWEJ.js"; -import { - require_react -} from "./chunk-5ULDFCBR.js"; -import { - __commonJS, - __toESM -} from "./chunk-5WRI5ZAA.js"; - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports, module) { - "use strict"; - module.exports = balanced2; - function balanced2(a2, b, str) { - if (a2 instanceof RegExp) a2 = maybeMatch(a2, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - var r2 = range3(a2, b, str); - return r2 && { - start: r2[0], - end: r2[1], - pre: str.slice(0, r2[0]), - body: str.slice(r2[0] + a2.length, r2[1]), - post: str.slice(r2[1] + b.length) - }; - } - function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; - } - balanced2.range = range3; - function range3(a2, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a2); - var bi = str.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - if (a2 === b) { - return [ai, bi]; - } - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a2, i + 1); - } else if (begs.length == 1) { - result = [begs.pop(), bi]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } - } - return result; - } - } -}); - -// node_modules/react-is/cjs/react-is.development.js -var require_react_is_development = __commonJS({ - "node_modules/react-is/cjs/react-is.development.js"(exports) { - "use strict"; - if (true) { - (function() { - "use strict"; - var hasSymbol = typeof Symbol === "function" && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; - var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; - function isValidElementType(type) { - return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); - } - function typeOf(object2) { - if (typeof object2 === "object" && object2 !== null) { - var $$typeof = object2.$$typeof; - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object2.type; - switch (type) { - case REACT_ASYNC_MODE_TYPE: - case REACT_CONCURRENT_MODE_TYPE: - case REACT_FRAGMENT_TYPE: - case REACT_PROFILER_TYPE: - case REACT_STRICT_MODE_TYPE: - case REACT_SUSPENSE_TYPE: - return type; - default: - var $$typeofType = type && type.$$typeof; - switch ($$typeofType) { - case REACT_CONTEXT_TYPE: - case REACT_FORWARD_REF_TYPE: - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType; - default: - return $$typeof; - } - } - case REACT_PORTAL_TYPE: - return $$typeof; - } - } - return void 0; - } - var AsyncMode = REACT_ASYNC_MODE_TYPE; - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; - var ContextConsumer = REACT_CONTEXT_TYPE; - var ContextProvider = REACT_PROVIDER_TYPE; - var Element2 = REACT_ELEMENT_TYPE; - var ForwardRef = REACT_FORWARD_REF_TYPE; - var Fragment2 = REACT_FRAGMENT_TYPE; - var Lazy = REACT_LAZY_TYPE; - var Memo = REACT_MEMO_TYPE; - var Portal2 = REACT_PORTAL_TYPE; - var Profiler = REACT_PROFILER_TYPE; - var StrictMode = REACT_STRICT_MODE_TYPE; - var Suspense = REACT_SUSPENSE_TYPE; - var hasWarnedAboutDeprecatedIsAsyncMode = false; - function isAsyncMode(object2) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); - } - } - return isConcurrentMode(object2) || typeOf(object2) === REACT_ASYNC_MODE_TYPE; - } - function isConcurrentMode(object2) { - return typeOf(object2) === REACT_CONCURRENT_MODE_TYPE; - } - function isContextConsumer(object2) { - return typeOf(object2) === REACT_CONTEXT_TYPE; - } - function isContextProvider(object2) { - return typeOf(object2) === REACT_PROVIDER_TYPE; - } - function isElement2(object2) { - return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE; - } - function isForwardRef(object2) { - return typeOf(object2) === REACT_FORWARD_REF_TYPE; - } - function isFragment(object2) { - return typeOf(object2) === REACT_FRAGMENT_TYPE; - } - function isLazy(object2) { - return typeOf(object2) === REACT_LAZY_TYPE; - } - function isMemo(object2) { - return typeOf(object2) === REACT_MEMO_TYPE; - } - function isPortal(object2) { - return typeOf(object2) === REACT_PORTAL_TYPE; - } - function isProfiler(object2) { - return typeOf(object2) === REACT_PROFILER_TYPE; - } - function isStrictMode(object2) { - return typeOf(object2) === REACT_STRICT_MODE_TYPE; - } - function isSuspense(object2) { - return typeOf(object2) === REACT_SUSPENSE_TYPE; - } - exports.AsyncMode = AsyncMode; - exports.ConcurrentMode = ConcurrentMode; - exports.ContextConsumer = ContextConsumer; - exports.ContextProvider = ContextProvider; - exports.Element = Element2; - exports.ForwardRef = ForwardRef; - exports.Fragment = Fragment2; - exports.Lazy = Lazy; - exports.Memo = Memo; - exports.Portal = Portal2; - exports.Profiler = Profiler; - exports.StrictMode = StrictMode; - exports.Suspense = Suspense; - exports.isAsyncMode = isAsyncMode; - exports.isConcurrentMode = isConcurrentMode; - exports.isContextConsumer = isContextConsumer; - exports.isContextProvider = isContextProvider; - exports.isElement = isElement2; - exports.isForwardRef = isForwardRef; - exports.isFragment = isFragment; - exports.isLazy = isLazy; - exports.isMemo = isMemo; - exports.isPortal = isPortal; - exports.isProfiler = isProfiler; - exports.isStrictMode = isStrictMode; - exports.isSuspense = isSuspense; - exports.isValidElementType = isValidElementType; - exports.typeOf = typeOf; - })(); - } - } -}); - -// node_modules/react-is/index.js -var require_react_is = __commonJS({ - "node_modules/react-is/index.js"(exports, module) { - "use strict"; - if (false) { - module.exports = null; - } else { - module.exports = require_react_is_development(); - } - } -}); - -// node_modules/react-keyed-flatten-children/index.js -var require_react_keyed_flatten_children = __commonJS({ - "node_modules/react-keyed-flatten-children/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var react_1 = require_react(); - var react_is_1 = require_react_is(); - function flattenChildren5(children2, depth, keys) { - if (depth === void 0) { - depth = 0; - } - if (keys === void 0) { - keys = []; - } - return react_1.Children.toArray(children2).reduce(function(acc, node, nodeIndex) { - if (react_is_1.isFragment(node)) { - acc.push.apply(acc, flattenChildren5(node.props.children, depth + 1, keys.concat(node.key || nodeIndex))); - } else { - if (react_1.isValidElement(node)) { - acc.push(react_1.cloneElement(node, { - key: keys.concat(String(node.key)).join(".") - })); - } else if (typeof node === "string" || typeof node === "number") { - acc.push(node); - } - } - return acc; - }, []); - } - exports.default = flattenChildren5; - } -}); - -// node_modules/object-assign/index.js -var require_object_assign = __commonJS({ - "node_modules/object-assign/index.js"(exports, module) { - "use strict"; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - function toObject(val) { - if (val === null || val === void 0) { - throw new TypeError("Object.assign cannot be called with null or undefined"); - } - return Object(val); - } - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - var test1 = new String("abc"); - test1[5] = "de"; - if (Object.getOwnPropertyNames(test1)[0] === "5") { - return false; - } - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2["_" + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function(n) { - return test2[n]; - }); - if (order2.join("") !== "0123456789") { - return false; - } - var test3 = {}; - "abcdefghijklmnopqrst".split("").forEach(function(letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { - return false; - } - return true; - } catch (err) { - return false; - } - } - module.exports = shouldUseNative() ? Object.assign : function(target, source) { - var from; - var to = toObject(target); - var symbols2; - for (var s2 = 1; s2 < arguments.length; s2++) { - from = Object(arguments[s2]); - for (var key2 in from) { - if (hasOwnProperty.call(from, key2)) { - to[key2] = from[key2]; - } - } - if (getOwnPropertySymbols) { - symbols2 = getOwnPropertySymbols(from); - for (var i = 0; i < symbols2.length; i++) { - if (propIsEnumerable.call(from, symbols2[i])) { - to[symbols2[i]] = from[symbols2[i]]; - } - } - } - } - return to; - }; - } -}); - -// node_modules/prop-types/lib/ReactPropTypesSecret.js -var require_ReactPropTypesSecret = __commonJS({ - "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { - "use strict"; - var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - module.exports = ReactPropTypesSecret; - } -}); - -// node_modules/prop-types/lib/has.js -var require_has = __commonJS({ - "node_modules/prop-types/lib/has.js"(exports, module) { - module.exports = Function.call.bind(Object.prototype.hasOwnProperty); - } -}); - -// node_modules/prop-types/checkPropTypes.js -var require_checkPropTypes = __commonJS({ - "node_modules/prop-types/checkPropTypes.js"(exports, module) { - "use strict"; - var printWarning = function() { - }; - if (true) { - ReactPropTypesSecret = require_ReactPropTypesSecret(); - loggedTypeFailures = {}; - has = require_has(); - printWarning = function(text) { - var message = "Warning: " + text; - if (typeof console !== "undefined") { - console.error(message); - } - try { - throw new Error(message); - } catch (x2) { - } - }; - } - var ReactPropTypesSecret; - var loggedTypeFailures; - var has; - function checkPropTypes(typeSpecs, values2, location, componentName3, getStack) { - if (true) { - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error; - try { - if (typeof typeSpecs[typeSpecName] !== "function") { - var err = Error( - (componentName3 || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." - ); - err.name = "Invariant Violation"; - throw err; - } - error = typeSpecs[typeSpecName](values2, typeSpecName, componentName3, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - if (error && !(error instanceof Error)) { - printWarning( - (componentName3 || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." - ); - } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - loggedTypeFailures[error.message] = true; - var stack = getStack ? getStack() : ""; - printWarning( - "Failed " + location + " type: " + error.message + (stack != null ? stack : "") - ); - } - } - } - } - } - checkPropTypes.resetWarningCache = function() { - if (true) { - loggedTypeFailures = {}; - } - }; - module.exports = checkPropTypes; - } -}); - -// node_modules/prop-types/factoryWithTypeCheckers.js -var require_factoryWithTypeCheckers = __commonJS({ - "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { - "use strict"; - var ReactIs = require_react_is(); - var assign2 = require_object_assign(); - var ReactPropTypesSecret = require_ReactPropTypesSecret(); - var has = require_has(); - var checkPropTypes = require_checkPropTypes(); - var printWarning = function() { - }; - if (true) { - printWarning = function(text) { - var message = "Warning: " + text; - if (typeof console !== "undefined") { - console.error(message); - } - try { - throw new Error(message); - } catch (x2) { - } - }; - } - function emptyFunctionThatReturnsNull() { - return null; - } - module.exports = function(isValidElement2, throwOnDirectAccess) { - var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === "function") { - return iteratorFn; - } - } - var ANONYMOUS = "<>"; - var ReactPropTypes = { - array: createPrimitiveTypeChecker("array"), - bigint: createPrimitiveTypeChecker("bigint"), - bool: createPrimitiveTypeChecker("boolean"), - func: createPrimitiveTypeChecker("function"), - number: createPrimitiveTypeChecker("number"), - object: createPrimitiveTypeChecker("object"), - string: createPrimitiveTypeChecker("string"), - symbol: createPrimitiveTypeChecker("symbol"), - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - elementType: createElementTypeTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker - }; - function is(x2, y2) { - if (x2 === y2) { - return x2 !== 0 || 1 / x2 === 1 / y2; - } else { - return x2 !== x2 && y2 !== y2; - } - } - function PropTypeError(message, data) { - this.message = message; - this.data = data && typeof data === "object" ? data : {}; - this.stack = ""; - } - PropTypeError.prototype = Error.prototype; - function createChainableTypeChecker(validate3) { - if (true) { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props2, propName, componentName3, location, propFullName, secret) { - componentName3 = componentName3 || ANONYMOUS; - propFullName = propFullName || propName; - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - var err = new Error( - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" - ); - err.name = "Invariant Violation"; - throw err; - } else if (typeof console !== "undefined") { - var cacheKey = componentName3 + ":" + propName; - if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3) { - printWarning( - "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName3 + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props2[propName] == null) { - if (isRequired) { - if (props2[propName] === null) { - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName3 + "`, but its value is `null`.")); - } - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName3 + "`, but its value is `undefined`.")); - } - return null; - } else { - return validate3(props2, propName, componentName3, location, propFullName); - } - } - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - return chainedCheckType; - } - function createPrimitiveTypeChecker(expectedType) { - function validate3(props2, propName, componentName3, location, propFullName, secret) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - var preciseType = getPreciseType(propValue); - return new PropTypeError( - "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName3 + "`, expected ") + ("`" + expectedType + "`."), - { expectedType } - ); - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunctionThatReturnsNull); - } - function createArrayOfTypeChecker(typeChecker) { - function validate3(props2, propName, componentName3, location, propFullName) { - if (typeof typeChecker !== "function") { - return new PropTypeError("Property `" + propFullName + "` of component `" + componentName3 + "` has invalid PropType notation inside arrayOf."); - } - var propValue = props2[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName3 + "`, expected an array.")); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName3, location, propFullName + "[" + i + "]", ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createElementTypeChecker() { - function validate3(props2, propName, componentName3, location, propFullName) { - var propValue = props2[propName]; - if (!isValidElement2(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName3 + "`, expected a single ReactElement.")); - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createElementTypeTypeChecker() { - function validate3(props2, propName, componentName3, location, propFullName) { - var propValue = props2[propName]; - if (!ReactIs.isValidElementType(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName3 + "`, expected a single ReactElement type.")); - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createInstanceTypeChecker(expectedClass) { - function validate3(props2, propName, componentName3, location, propFullName) { - if (!(props2[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName4(props2[propName]); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName3 + "`, expected ") + ("instance of `" + expectedClassName + "`.")); - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - if (true) { - if (arguments.length > 1) { - printWarning( - "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." - ); - } else { - printWarning("Invalid argument supplied to oneOf, expected an array."); - } - } - return emptyFunctionThatReturnsNull; - } - function validate3(props2, propName, componentName3, location, propFullName) { - var propValue = props2[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - var valuesString = JSON.stringify(expectedValues, function replacer(key2, value) { - var type = getPreciseType(value); - if (type === "symbol") { - return String(value); - } - return value; - }); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName3 + "`, expected one of " + valuesString + ".")); - } - return createChainableTypeChecker(validate3); - } - function createObjectOfTypeChecker(typeChecker) { - function validate3(props2, propName, componentName3, location, propFullName) { - if (typeof typeChecker !== "function") { - return new PropTypeError("Property `" + propFullName + "` of component `" + componentName3 + "` has invalid PropType notation inside objectOf."); - } - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName3 + "`, expected an object.")); - } - for (var key2 in propValue) { - if (has(propValue, key2)) { - var error = typeChecker(propValue, key2, componentName3, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; - return emptyFunctionThatReturnsNull; - } - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== "function") { - printWarning( - "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "." - ); - return emptyFunctionThatReturnsNull; - } - } - function validate3(props2, propName, componentName3, location, propFullName) { - var expectedTypes = []; - for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { - var checker2 = arrayOfTypeCheckers[i2]; - var checkerResult = checker2(props2, propName, componentName3, location, propFullName, ReactPropTypesSecret); - if (checkerResult == null) { - return null; - } - if (checkerResult.data && has(checkerResult.data, "expectedType")) { - expectedTypes.push(checkerResult.data.expectedType); - } - } - var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName3 + "`" + expectedTypesMessage + ".")); - } - return createChainableTypeChecker(validate3); - } - function createNodeChecker() { - function validate3(props2, propName, componentName3, location, propFullName) { - if (!isNode2(props2[propName])) { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName3 + "`, expected a ReactNode.")); - } - return null; - } - return createChainableTypeChecker(validate3); - } - function invalidValidatorError(componentName3, location, propFullName, key2, type) { - return new PropTypeError( - (componentName3 || "React class") + ": " + location + " type `" + propFullName + "." + key2 + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." - ); - } - function createShapeTypeChecker(shapeTypes) { - function validate3(props2, propName, componentName3, location, propFullName) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName3 + "`, expected `object`.")); - } - for (var key2 in shapeTypes) { - var checker = shapeTypes[key2]; - if (typeof checker !== "function") { - return invalidValidatorError(componentName3, location, propFullName, key2, getPreciseType(checker)); - } - var error = checker(propValue, key2, componentName3, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate3); - } - function createStrictShapeTypeChecker(shapeTypes) { - function validate3(props2, propName, componentName3, location, propFullName) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName3 + "`, expected `object`.")); - } - var allKeys = assign2({}, props2[propName], shapeTypes); - for (var key2 in allKeys) { - var checker = shapeTypes[key2]; - if (has(shapeTypes, key2) && typeof checker !== "function") { - return invalidValidatorError(componentName3, location, propFullName, key2, getPreciseType(checker)); - } - if (!checker) { - return new PropTypeError( - "Invalid " + location + " `" + propFullName + "` key `" + key2 + "` supplied to `" + componentName3 + "`.\nBad object: " + JSON.stringify(props2[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") - ); - } - var error = checker(propValue, key2, componentName3, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate3); - } - function isNode2(propValue) { - switch (typeof propValue) { - case "number": - case "string": - case "undefined": - return true; - case "boolean": - return !propValue; - case "object": - if (Array.isArray(propValue)) { - return propValue.every(isNode2); - } - if (propValue === null || isValidElement2(propValue)) { - return true; - } - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step2; - if (iteratorFn !== propValue.entries) { - while (!(step2 = iterator.next()).done) { - if (!isNode2(step2.value)) { - return false; - } - } - } else { - while (!(step2 = iterator.next()).done) { - var entry = step2.value; - if (entry) { - if (!isNode2(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - return true; - default: - return false; - } - } - function isSymbol(propType, propValue) { - if (propType === "symbol") { - return true; - } - if (!propValue) { - return false; - } - if (propValue["@@toStringTag"] === "Symbol") { - return true; - } - if (typeof Symbol === "function" && propValue instanceof Symbol) { - return true; - } - return false; - } - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return "array"; - } - if (propValue instanceof RegExp) { - return "object"; - } - if (isSymbol(propType, propValue)) { - return "symbol"; - } - return propType; - } - function getPreciseType(propValue) { - if (typeof propValue === "undefined" || propValue === null) { - return "" + propValue; - } - var propType = getPropType(propValue); - if (propType === "object") { - if (propValue instanceof Date) { - return "date"; - } else if (propValue instanceof RegExp) { - return "regexp"; - } - } - return propType; - } - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case "array": - case "object": - return "an " + type; - case "boolean": - case "date": - case "regexp": - return "a " + type; - default: - return type; - } - } - function getClassName4(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; - ReactPropTypes.PropTypes = ReactPropTypes; - return ReactPropTypes; - }; - } -}); - -// node_modules/prop-types/index.js -var require_prop_types = __commonJS({ - "node_modules/prop-types/index.js"(exports, module) { - if (true) { - ReactIs = require_react_is(); - throwOnDirectAccess = true; - module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); - } else { - module.exports = null(); - } - var ReactIs; - var throwOnDirectAccess; - } -}); - -// node_modules/tslib/tslib.es6.mjs -var __assign = function() { - __assign = Object.assign || function __assign4(t) { - for (var s2, i = 1, n = arguments.length; i < n; i++) { - s2 = arguments[i]; - for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p)) t[p] = s2[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -function __rest(s2, e) { - var t = {}; - for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p) && e.indexOf(p) < 0) - t[p] = s2[p]; - if (s2 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s2); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i])) - t[p[i]] = s2[p[i]]; - } - return t; -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step2(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step2(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step2(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step2((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -// node_modules/@cloudscape-design/components/alert/index.js -var import_react31 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/utils/apply-display-name.js -function applyDisplayName(component, displayName) { - component.displayName = displayName; -} - -// node_modules/@cloudscape-design/components/alert/internal.js -var import_react29 = __toESM(require_react()); - -// node_modules/clsx/dist/clsx.m.js -function r(e) { - var t, f, n = ""; - if ("string" == typeof e || "number" == typeof e) n += e; - else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); - else for (t in e) e[t] && (n && (n += " "), n += t); - return n; -} -function clsx() { - for (var e, t, f = 0, n = ""; f < arguments.length; ) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t); - return n; -} -var clsx_m_default = clsx; - -// node_modules/@cloudscape-design/components/button/internal.js -var import_react20 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/events/index.js -var CustomEventStub = class { - constructor(cancelable = false, detail = null) { - this.cancelable = cancelable; - this.detail = detail; - this.defaultPrevented = false; - this.cancelBubble = false; - } - preventDefault() { - this.defaultPrevented = true; - } - stopPropagation() { - this.cancelBubble = true; - } -}; -function createCustomEvent({ cancelable, detail }) { - return new CustomEventStub(cancelable, detail); -} -function fireNonCancelableEvent(handler, detail) { - if (!handler) { - return; - } - const event = createCustomEvent({ cancelable: false, detail }); - handler(event); -} -function fireCancelableEvent(handler, detail, sourceEvent) { - if (!handler) { - return false; - } - const event = createCustomEvent({ cancelable: true, detail }); - handler(event); - if (event.defaultPrevented && sourceEvent) { - sourceEvent.preventDefault(); - } - if (event.cancelBubble && sourceEvent) { - sourceEvent.stopPropagation(); - } - return event.defaultPrevented; -} -function fireKeyboardEvent(handler, reactEvent) { - return fireCancelableEvent(handler, { - keyCode: reactEvent.keyCode, - key: reactEvent.key, - ctrlKey: reactEvent.ctrlKey, - shiftKey: reactEvent.shiftKey, - altKey: reactEvent.altKey, - metaKey: reactEvent.metaKey - }, reactEvent); -} -var isMouseEvent = (e) => { - return e.button !== void 0; -}; -function hasModifierKeys(event) { - return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey; -} -function isPlainLeftClick(event) { - return event && (!isMouseEvent(event) || event.button === 0) && !hasModifierKeys(event); -} - -// node_modules/@cloudscape-design/components/internal/hooks/forward-focus/index.js -var import_react = __toESM(require_react()); -function useForwardFocus(mainRef, controlRef) { - (0, import_react.useImperativeHandle)(mainRef, () => ({ - focus(...args) { - var _a2; - (_a2 = controlRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(...args); - } - }), [controlRef]); -} - -// node_modules/@cloudscape-design/components/button/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/button/styles.scoped.css"; -var styles_css_default = { - "content": "awsui_content_vjswe_12tek_103", - "button": "awsui_button_vjswe_12tek_107", - "variant-normal": "awsui_variant-normal_vjswe_12tek_158", - "variant-icon": "awsui_variant-icon_vjswe_12tek_201", - "variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_12tek_201", - "variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_12tek_201", - "variant-inline-icon": "awsui_variant-inline-icon_vjswe_12tek_222", - "disabled": "awsui_disabled_vjswe_12tek_243", - "variant-primary": "awsui_variant-primary_vjswe_12tek_251", - "variant-link": "awsui_variant-link_vjswe_12tek_344", - "variant-inline-link": "awsui_variant-inline-link_vjswe_12tek_623", - "variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_12tek_906", - "variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_12tek_1004", - "button-no-text": "awsui_button-no-text_vjswe_12tek_1097", - "button-no-wrap": "awsui_button-no-wrap_vjswe_12tek_1101", - "full-width": "awsui_full-width_vjswe_12tek_1104", - "icon-left": "awsui_icon-left_vjswe_12tek_1123", - "icon-right": "awsui_icon-right_vjswe_12tek_1128", - "icon": "awsui_icon_vjswe_12tek_1123" -}; - -// node_modules/@cloudscape-design/components/button/icon-helper.js -var React3 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/icon/internal.js -var import_react9 = __toESM(require_react()); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/component-metadata.js -var import_react2 = __toESM(require_react()); -var COMPONENT_METADATA_KEY = "__awsuiMetadata__"; -function useComponentMetadata(componentName3, packageVersion) { - var elementRef = (0, import_react2.useRef)(null); - (0, import_react2.useEffect)(function() { - if (elementRef.current) { - var node = elementRef.current; - var metadata = { name: componentName3, version: packageVersion }; - Object.freeze(metadata); - Object.defineProperty(node, COMPONENT_METADATA_KEY, { value: metadata, writable: false, configurable: true }); - } - }); - return elementRef; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/component-metrics.js -var import_react3 = __toESM(require_react()); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/log-clients.js -function validateLength(value, maxLength) { - return !value || value.length <= maxLength; -} -var CLogClient = ( - /** @class */ - function() { - function CLogClient2() { - } - CLogClient2.prototype.sendMetric = function(metricName, value, detail) { - if (!metricName || !/^[a-zA-Z0-9_-]+$/.test(metricName)) { - console.error("Invalid metric name: ".concat(metricName)); - return; - } - if (!validateLength(metricName, 1e3)) { - console.error("Metric name ".concat(metricName, " is too long")); - return; - } - if (!validateLength(detail, 4e3)) { - console.error("Detail for metric ".concat(metricName, " is too long: ").concat(detail)); - return; - } - var AWSC = this.findAWSC(window); - if (typeof AWSC === "object" && typeof AWSC.Clog === "object" && typeof AWSC.Clog.log === "function") { - AWSC.Clog.log(metricName, value, detail); - } - }; - CLogClient2.prototype.findAWSC = function(currentWindow) { - try { - if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC) === "object") { - return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC; - } - if (!currentWindow || currentWindow.parent === currentWindow) { - return void 0; - } - return this.findAWSC(currentWindow.parent); - } catch (ex) { - return void 0; - } - }; - return CLogClient2; - }() -); -var PanoramaClient = ( - /** @class */ - function() { - function PanoramaClient2() { - } - PanoramaClient2.prototype.sendMetric = function(metric) { - if (typeof metric.eventDetail === "object") { - metric.eventDetail = JSON.stringify(metric.eventDetail); - } - if (typeof metric.eventValue === "object") { - metric.eventValue = JSON.stringify(metric.eventValue); - } - if (!validateLength(metric.eventDetail, 4e3)) { - console.error("Event detail for metric is too long: ".concat(metric.eventDetail)); - return; - } - if (!validateLength(metric.eventValue, 4e3)) { - console.error("Event value for metric is too long: ".concat(metric.eventValue)); - return; - } - if (!validateLength(metric.eventContext, 4e3)) { - console.error("Event context for metric is too long: ".concat(metric.eventContext)); - return; - } - if (!validateLength(metric.eventType, 50)) { - console.error("Event type for metric is too long: ".concat(metric.eventType)); - return; - } - var panorama = this.findPanorama(window); - if (typeof panorama === "function") { - panorama("trackCustomEvent", __assign(__assign({}, metric), { timestamp: Date.now() })); - } - }; - PanoramaClient2.prototype.findPanorama = function(currentWindow) { - try { - if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama) === "function") { - return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama; - } - if (!currentWindow || currentWindow.parent === currentWindow) { - return void 0; - } - return this.findPanorama(currentWindow.parent); - } catch (ex) { - return void 0; - } - }; - return PanoramaClient2; - }() -); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/formatters.js -var framework = "react"; -function buildMetricHash(_a2) { - var source = _a2.source, action = _a2.action; - return ["src".concat(source), "action".concat(action)].join("_"); -} -function buildMetricDetail(_a2, theme2) { - var source = _a2.source, action = _a2.action, version = _a2.version; - var metricOrigin = typeof AWSUI_METRIC_ORIGIN !== "undefined" ? AWSUI_METRIC_ORIGIN : "main"; - var detailObject = { - o: metricOrigin, - s: source, - t: theme2, - a: action, - f: framework, - v: formatMajorVersionForMetricDetail(version) - }; - return JSON.stringify(detailObject); -} -function buildMetricName(_a2, theme2) { - var source = _a2.source, version = _a2.version; - return ["awsui", source, "".concat(formatVersionForMetricName(theme2, version))].join("_"); -} -function formatMajorVersionForMetricDetail(version) { - return version.replace(/\s/g, ""); -} -function formatVersionForMetricName(theme2, version) { - return "".concat(theme2.charAt(0)).concat(getMajorVersion(version).replace(".", "")); -} -function getMajorVersion(versionString) { - var majorVersionMatch = versionString.match(/^(\d+\.\d+)/); - return majorVersionMatch ? majorVersionMatch[1] : ""; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/metrics.js -var oneTimeMetrics = /* @__PURE__ */ new Set(); -var theme = ""; -function setTheme(newTheme) { - theme = newTheme; -} -var Metrics = ( - /** @class */ - function() { - function Metrics2(source, packageVersion) { - this.clog = new CLogClient(); - this.panorama = new PanoramaClient(); - this.source = source; - this.packageVersion = packageVersion; - } - Metrics2.prototype.initMetrics = function(theme2) { - setTheme(theme2); - }; - Metrics2.prototype.sendMetric = function(metricName, value, detail) { - if (!theme) { - console.error("Metrics need to be initialized first."); - return; - } - this.clog.sendMetric(metricName, value, detail); - }; - Metrics2.prototype.sendPanoramaMetric = function(metric) { - this.panorama.sendMetric(metric); - }; - Metrics2.prototype.sendMetricObject = function(metric, value) { - this.sendMetric(buildMetricName(metric, theme), value, buildMetricDetail(metric, theme)); - }; - Metrics2.prototype.sendMetricObjectOnce = function(metric, value) { - var metricHash = buildMetricHash(metric); - if (!oneTimeMetrics.has(metricHash)) { - this.sendMetricObject(metric, value); - oneTimeMetrics.add(metricHash); - } - }; - Metrics2.prototype.sendMetricOnce = function(metricName, value, detail) { - if (!oneTimeMetrics.has(metricName)) { - this.sendMetric(metricName, value, detail); - oneTimeMetrics.add(metricName); - } - }; - Metrics2.prototype.logComponentLoaded = function() { - this.sendMetricObjectOnce({ source: this.source, action: "loaded", version: this.packageVersion }, 1); - }; - Metrics2.prototype.logComponentUsed = function(componentName3) { - this.sendMetricObjectOnce({ - source: componentName3, - action: "used", - version: this.packageVersion - }, 1); - }; - return Metrics2; - }() -); -var MetricsTestHelper = ( - /** @class */ - function() { - function MetricsTestHelper2() { - } - MetricsTestHelper2.prototype.resetOneTimeMetricsCache = function() { - oneTimeMetrics.clear(); - }; - return MetricsTestHelper2; - }() -); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/component-metrics.js -function useComponentMetrics(componentName3, _a2) { - var packageSource = _a2.packageSource, packageVersion = _a2.packageVersion, theme2 = _a2.theme; - (0, import_react3.useEffect)(function() { - var metrics2 = new Metrics(packageSource, packageVersion); - metrics2.initMetrics(theme2); - if (typeof window !== "undefined") { - metrics2.sendMetricOnce("awsui-viewport-width", window.innerWidth || 0); - metrics2.sendMetricOnce("awsui-viewport-height", window.innerHeight || 0); - } - metrics2.logComponentLoaded(); - metrics2.logComponentUsed(componentName3.toLowerCase()); - }, []); -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/base-component/init-awsui-versions.js -function initAwsUiVersions(source, packageVersion) { - if (typeof window !== "undefined") { - if (!window.awsuiVersions) { - window.awsuiVersions = {}; - } - if (!window.awsuiVersions[source]) { - window.awsuiVersions[source] = []; - } - window.awsuiVersions[source].push(packageVersion); - } -} - -// node_modules/@juggle/resize-observer/lib/utils/resizeObservers.js -var resizeObservers = []; - -// node_modules/@juggle/resize-observer/lib/algorithms/hasActiveObservations.js -var hasActiveObservations = function() { - return resizeObservers.some(function(ro) { - return ro.activeTargets.length > 0; - }); -}; - -// node_modules/@juggle/resize-observer/lib/algorithms/hasSkippedObservations.js -var hasSkippedObservations = function() { - return resizeObservers.some(function(ro) { - return ro.skippedTargets.length > 0; - }); -}; - -// node_modules/@juggle/resize-observer/lib/algorithms/deliverResizeLoopError.js -var msg = "ResizeObserver loop completed with undelivered notifications."; -var deliverResizeLoopError = function() { - var event; - if (typeof ErrorEvent === "function") { - event = new ErrorEvent("error", { - message: msg - }); - } else { - event = document.createEvent("Event"); - event.initEvent("error", false, false); - event.message = msg; - } - window.dispatchEvent(event); -}; - -// node_modules/@juggle/resize-observer/lib/ResizeObserverBoxOptions.js -var ResizeObserverBoxOptions; -(function(ResizeObserverBoxOptions2) { - ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box"; - ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box"; - ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box"; -})(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {})); - -// node_modules/@juggle/resize-observer/lib/utils/freeze.js -var freeze = function(obj) { - return Object.freeze(obj); -}; - -// node_modules/@juggle/resize-observer/lib/ResizeObserverSize.js -var ResizeObserverSize = /* @__PURE__ */ function() { - function ResizeObserverSize2(inlineSize, blockSize) { - this.inlineSize = inlineSize; - this.blockSize = blockSize; - freeze(this); - } - return ResizeObserverSize2; -}(); - -// node_modules/@juggle/resize-observer/lib/DOMRectReadOnly.js -var DOMRectReadOnly = function() { - function DOMRectReadOnly2(x2, y2, width, height) { - this.x = x2; - this.y = y2; - this.width = width; - this.height = height; - this.top = this.y; - this.left = this.x; - this.bottom = this.top + this.height; - this.right = this.left + this.width; - return freeze(this); - } - DOMRectReadOnly2.prototype.toJSON = function() { - var _a2 = this, x2 = _a2.x, y2 = _a2.y, top = _a2.top, right = _a2.right, bottom = _a2.bottom, left = _a2.left, width = _a2.width, height = _a2.height; - return { x: x2, y: y2, top, right, bottom, left, width, height }; - }; - DOMRectReadOnly2.fromRect = function(rectangle) { - return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height); - }; - return DOMRectReadOnly2; -}(); - -// node_modules/@juggle/resize-observer/lib/utils/element.js -var isSVG = function(target) { - return target instanceof SVGElement && "getBBox" in target; -}; -var isHidden = function(target) { - if (isSVG(target)) { - var _a2 = target.getBBox(), width = _a2.width, height = _a2.height; - return !width && !height; - } - var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight; - return !(offsetWidth || offsetHeight || target.getClientRects().length); -}; -var isElement = function(obj) { - var _a2; - if (obj instanceof Element) { - return true; - } - var scope = (_a2 = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a2 === void 0 ? void 0 : _a2.defaultView; - return !!(scope && obj instanceof scope.Element); -}; -var isReplacedElement = function(target) { - switch (target.tagName) { - case "INPUT": - if (target.type !== "image") { - break; - } - case "VIDEO": - case "AUDIO": - case "EMBED": - case "OBJECT": - case "CANVAS": - case "IFRAME": - case "IMG": - return true; - } - return false; -}; - -// node_modules/@juggle/resize-observer/lib/utils/global.js -var global = typeof window !== "undefined" ? window : {}; - -// node_modules/@juggle/resize-observer/lib/algorithms/calculateBoxSize.js -var cache = /* @__PURE__ */ new WeakMap(); -var scrollRegexp = /auto|scroll/; -var verticalRegexp = /^tb|vertical/; -var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent); -var parseDimension = function(pixel) { - return parseFloat(pixel || "0"); -}; -var size = function(inlineSize, blockSize, switchSizes) { - if (inlineSize === void 0) { - inlineSize = 0; - } - if (blockSize === void 0) { - blockSize = 0; - } - if (switchSizes === void 0) { - switchSizes = false; - } - return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0); -}; -var zeroBoxes = freeze({ - devicePixelContentBoxSize: size(), - borderBoxSize: size(), - contentBoxSize: size(), - contentRect: new DOMRectReadOnly(0, 0, 0, 0) -}); -var calculateBoxSizes = function(target, forceRecalculation) { - if (forceRecalculation === void 0) { - forceRecalculation = false; - } - if (cache.has(target) && !forceRecalculation) { - return cache.get(target); - } - if (isHidden(target)) { - cache.set(target, zeroBoxes); - return zeroBoxes; - } - var cs = getComputedStyle(target); - var svg = isSVG(target) && target.ownerSVGElement && target.getBBox(); - var removePadding = !IE && cs.boxSizing === "border-box"; - var switchSizes = verticalRegexp.test(cs.writingMode || ""); - var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""); - var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""); - var paddingTop = svg ? 0 : parseDimension(cs.paddingTop); - var paddingRight = svg ? 0 : parseDimension(cs.paddingRight); - var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); - var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); - var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); - var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); - var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); - var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); - var horizontalPadding = paddingLeft + paddingRight; - var verticalPadding = paddingTop + paddingBottom; - var horizontalBorderArea = borderLeft + borderRight; - var verticalBorderArea = borderTop + borderBottom; - var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight; - var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth; - var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0; - var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; - var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness; - var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness; - var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea; - var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea; - var boxes = freeze({ - devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes), - borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes), - contentBoxSize: size(contentWidth, contentHeight, switchSizes), - contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight) - }); - cache.set(target, boxes); - return boxes; -}; -var calculateBoxSize = function(target, observedBox, forceRecalculation) { - var _a2 = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a2.borderBoxSize, contentBoxSize = _a2.contentBoxSize, devicePixelContentBoxSize = _a2.devicePixelContentBoxSize; - switch (observedBox) { - case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX: - return devicePixelContentBoxSize; - case ResizeObserverBoxOptions.BORDER_BOX: - return borderBoxSize; - default: - return contentBoxSize; - } -}; - -// node_modules/@juggle/resize-observer/lib/ResizeObserverEntry.js -var ResizeObserverEntry = /* @__PURE__ */ function() { - function ResizeObserverEntry2(target) { - var boxes = calculateBoxSizes(target); - this.target = target; - this.contentRect = boxes.contentRect; - this.borderBoxSize = freeze([boxes.borderBoxSize]); - this.contentBoxSize = freeze([boxes.contentBoxSize]); - this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]); - } - return ResizeObserverEntry2; -}(); - -// node_modules/@juggle/resize-observer/lib/algorithms/calculateDepthForNode.js -var calculateDepthForNode = function(node) { - if (isHidden(node)) { - return Infinity; - } - var depth = 0; - var parent = node.parentNode; - while (parent) { - depth += 1; - parent = parent.parentNode; - } - return depth; -}; - -// node_modules/@juggle/resize-observer/lib/algorithms/broadcastActiveObservations.js -var broadcastActiveObservations = function() { - var shallowestDepth = Infinity; - var callbacks2 = []; - resizeObservers.forEach(function processObserver(ro) { - if (ro.activeTargets.length === 0) { - return; - } - var entries = []; - ro.activeTargets.forEach(function processTarget(ot) { - var entry = new ResizeObserverEntry(ot.target); - var targetDepth = calculateDepthForNode(ot.target); - entries.push(entry); - ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox); - if (targetDepth < shallowestDepth) { - shallowestDepth = targetDepth; - } - }); - callbacks2.push(function resizeObserverCallback() { - ro.callback.call(ro.observer, entries, ro.observer); - }); - ro.activeTargets.splice(0, ro.activeTargets.length); - }); - for (var _i = 0, callbacks_1 = callbacks2; _i < callbacks_1.length; _i++) { - var callback = callbacks_1[_i]; - callback(); - } - return shallowestDepth; -}; - -// node_modules/@juggle/resize-observer/lib/algorithms/gatherActiveObservationsAtDepth.js -var gatherActiveObservationsAtDepth = function(depth) { - resizeObservers.forEach(function processObserver(ro) { - ro.activeTargets.splice(0, ro.activeTargets.length); - ro.skippedTargets.splice(0, ro.skippedTargets.length); - ro.observationTargets.forEach(function processTarget(ot) { - if (ot.isActive()) { - if (calculateDepthForNode(ot.target) > depth) { - ro.activeTargets.push(ot); - } else { - ro.skippedTargets.push(ot); - } - } - }); - }); -}; - -// node_modules/@juggle/resize-observer/lib/utils/process.js -var process2 = function() { - var depth = 0; - gatherActiveObservationsAtDepth(depth); - while (hasActiveObservations()) { - depth = broadcastActiveObservations(); - gatherActiveObservationsAtDepth(depth); - } - if (hasSkippedObservations()) { - deliverResizeLoopError(); - } - return depth > 0; -}; - -// node_modules/@juggle/resize-observer/lib/utils/queueMicroTask.js -var trigger; -var callbacks = []; -var notify = function() { - return callbacks.splice(0).forEach(function(cb) { - return cb(); - }); -}; -var queueMicroTask = function(callback) { - if (!trigger) { - var toggle_1 = 0; - var el_1 = document.createTextNode(""); - var config = { characterData: true }; - new MutationObserver(function() { - return notify(); - }).observe(el_1, config); - trigger = function() { - el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++); - }; - } - callbacks.push(callback); - trigger(); -}; - -// node_modules/@juggle/resize-observer/lib/utils/queueResizeObserver.js -var queueResizeObserver = function(cb) { - queueMicroTask(function ResizeObserver2() { - requestAnimationFrame(cb); - }); -}; - -// node_modules/@juggle/resize-observer/lib/utils/scheduler.js -var watching = 0; -var isWatching = function() { - return !!watching; -}; -var CATCH_PERIOD = 250; -var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; -var events = [ - "resize", - "load", - "transitionend", - "animationend", - "animationstart", - "animationiteration", - "keyup", - "keydown", - "mouseup", - "mousedown", - "mouseover", - "mouseout", - "blur", - "focus" -]; -var time = function(timeout2) { - if (timeout2 === void 0) { - timeout2 = 0; - } - return Date.now() + timeout2; -}; -var scheduled = false; -var Scheduler = function() { - function Scheduler2() { - var _this = this; - this.stopped = true; - this.listener = function() { - return _this.schedule(); - }; - } - Scheduler2.prototype.run = function(timeout2) { - var _this = this; - if (timeout2 === void 0) { - timeout2 = CATCH_PERIOD; - } - if (scheduled) { - return; - } - scheduled = true; - var until = time(timeout2); - queueResizeObserver(function() { - var elementsHaveResized = false; - try { - elementsHaveResized = process2(); - } finally { - scheduled = false; - timeout2 = until - time(); - if (!isWatching()) { - return; - } - if (elementsHaveResized) { - _this.run(1e3); - } else if (timeout2 > 0) { - _this.run(timeout2); - } else { - _this.start(); - } - } - }); - }; - Scheduler2.prototype.schedule = function() { - this.stop(); - this.run(); - }; - Scheduler2.prototype.observe = function() { - var _this = this; - var cb = function() { - return _this.observer && _this.observer.observe(document.body, observerConfig); - }; - document.body ? cb() : global.addEventListener("DOMContentLoaded", cb); - }; - Scheduler2.prototype.start = function() { - var _this = this; - if (this.stopped) { - this.stopped = false; - this.observer = new MutationObserver(this.listener); - this.observe(); - events.forEach(function(name) { - return global.addEventListener(name, _this.listener, true); - }); - } - }; - Scheduler2.prototype.stop = function() { - var _this = this; - if (!this.stopped) { - this.observer && this.observer.disconnect(); - events.forEach(function(name) { - return global.removeEventListener(name, _this.listener, true); - }); - this.stopped = true; - } - }; - return Scheduler2; -}(); -var scheduler = new Scheduler(); -var updateCount = function(n) { - !watching && n > 0 && scheduler.start(); - watching += n; - !watching && scheduler.stop(); -}; - -// node_modules/@juggle/resize-observer/lib/ResizeObservation.js -var skipNotifyOnElement = function(target) { - return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline"; -}; -var ResizeObservation = function() { - function ResizeObservation2(target, observedBox) { - this.target = target; - this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX; - this.lastReportedSize = { - inlineSize: 0, - blockSize: 0 - }; - } - ResizeObservation2.prototype.isActive = function() { - var size2 = calculateBoxSize(this.target, this.observedBox, true); - if (skipNotifyOnElement(this.target)) { - this.lastReportedSize = size2; - } - if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) { - return true; - } - return false; - }; - return ResizeObservation2; -}(); - -// node_modules/@juggle/resize-observer/lib/ResizeObserverDetail.js -var ResizeObserverDetail = /* @__PURE__ */ function() { - function ResizeObserverDetail2(resizeObserver, callback) { - this.activeTargets = []; - this.skippedTargets = []; - this.observationTargets = []; - this.observer = resizeObserver; - this.callback = callback; - } - return ResizeObserverDetail2; -}(); - -// node_modules/@juggle/resize-observer/lib/ResizeObserverController.js -var observerMap = /* @__PURE__ */ new WeakMap(); -var getObservationIndex = function(observationTargets, target) { - for (var i = 0; i < observationTargets.length; i += 1) { - if (observationTargets[i].target === target) { - return i; - } - } - return -1; -}; -var ResizeObserverController = function() { - function ResizeObserverController2() { - } - ResizeObserverController2.connect = function(resizeObserver, callback) { - var detail = new ResizeObserverDetail(resizeObserver, callback); - observerMap.set(resizeObserver, detail); - }; - ResizeObserverController2.observe = function(resizeObserver, target, options) { - var detail = observerMap.get(resizeObserver); - var firstObservation = detail.observationTargets.length === 0; - if (getObservationIndex(detail.observationTargets, target) < 0) { - firstObservation && resizeObservers.push(detail); - detail.observationTargets.push(new ResizeObservation(target, options && options.box)); - updateCount(1); - scheduler.schedule(); - } - }; - ResizeObserverController2.unobserve = function(resizeObserver, target) { - var detail = observerMap.get(resizeObserver); - var index = getObservationIndex(detail.observationTargets, target); - var lastObservation = detail.observationTargets.length === 1; - if (index >= 0) { - lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1); - detail.observationTargets.splice(index, 1); - updateCount(-1); - } - }; - ResizeObserverController2.disconnect = function(resizeObserver) { - var _this = this; - var detail = observerMap.get(resizeObserver); - detail.observationTargets.slice().forEach(function(ot) { - return _this.unobserve(resizeObserver, ot.target); - }); - detail.activeTargets.splice(0, detail.activeTargets.length); - }; - return ResizeObserverController2; -}(); - -// node_modules/@juggle/resize-observer/lib/ResizeObserver.js -var ResizeObserver = function() { - function ResizeObserver2(callback) { - if (arguments.length === 0) { - throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); - } - if (typeof callback !== "function") { - throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."); - } - ResizeObserverController.connect(this, callback); - } - ResizeObserver2.prototype.observe = function(target, options) { - if (arguments.length === 0) { - throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present."); - } - if (!isElement(target)) { - throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); - } - ResizeObserverController.observe(this, target, options); - }; - ResizeObserver2.prototype.unobserve = function(target) { - if (arguments.length === 0) { - throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); - } - if (!isElement(target)) { - throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element"); - } - ResizeObserverController.unobserve(this, target); - }; - ResizeObserver2.prototype.disconnect = function() { - ResizeObserverController.disconnect(this); - }; - ResizeObserver2.toString = function() { - return "function ResizeObserver () { [polyfill code] }"; - }; - return ResizeObserver2; -}(); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/container-queries/use-resize-observer.js -var import_react5 = __toESM(require_react()); - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/stable-callback/index.js -var import_react4 = __toESM(require_react()); -function useStableCallback(fn) { - var ref = (0, import_react4.useRef)(); - (0, import_react4.useEffect)(function() { - ref.current = fn; - }); - return (0, import_react4.useCallback)(function() { - var _a2; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return (_a2 = ref.current) === null || _a2 === void 0 ? void 0 : _a2.apply(void 0, args); - }, []); -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/container-queries/use-resize-observer.js -function useResizeObserver(elementRef, onObserve) { - var stableOnObserve = useStableCallback(onObserve); - (0, import_react5.useLayoutEffect)( - function() { - var element = typeof elementRef === "function" ? elementRef() : elementRef === null || elementRef === void 0 ? void 0 : elementRef.current; - if (element) { - onObserve(convertResizeObserverEntry(new ResizeObserverEntry(element))); - } - }, - // This effect is only needed for the first render to provide a synchronous update. - // eslint-disable-next-line react-hooks/exhaustive-deps - [] - ); - (0, import_react5.useEffect)(function() { - var element = typeof elementRef === "function" ? elementRef() : elementRef === null || elementRef === void 0 ? void 0 : elementRef.current; - if (element) { - var connected_1 = true; - var observer_1 = new ResizeObserver(function(entries) { - if (connected_1) { - stableOnObserve(convertResizeObserverEntry(entries[0])); - } - }); - observer_1.observe(element); - return function() { - connected_1 = false; - observer_1.disconnect(); - }; - } - }, [elementRef, stableOnObserve]); -} -function convertResizeObserverEntry(entry) { - return { - target: entry.target, - contentBoxWidth: entry.contentBoxSize[0].inlineSize, - contentBoxHeight: entry.contentBoxSize[0].blockSize, - borderBoxWidth: entry.borderBoxSize[0].inlineSize, - borderBoxHeight: entry.borderBoxSize[0].blockSize - }; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/singleton-handler/index.js -var import_react6 = __toESM(require_react()); -var import_react_dom = __toESM(require_react_dom()); -function createSingletonHandler(factory) { - var listeners = []; - var callback = function(value) { - (0, import_react_dom.unstable_batchedUpdates)(function() { - for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) { - var listener = listeners_1[_i]; - listener(value); - } - }); - }; - var cleanup; - return function useSingleton(listener) { - (0, import_react6.useEffect)(function() { - if (listeners.length === 0) { - cleanup = factory(callback); - } - listeners.push(listener); - return function() { - listeners.splice(listeners.indexOf(listener), 1); - if (listeners.length === 0) { - cleanup(); - cleanup = void 0; - } - }; - }, []); - }; -} -function createSingletonState(_a2) { - var factory = _a2.factory, initialState2 = _a2.initialState; - var useSingleton = createSingletonHandler(factory); - var value = initialState2; - return function useSingletonState() { - var _a3 = (0, import_react6.useState)(value), state = _a3[0], setState = _a3[1]; - useSingleton(function(newValue) { - value = newValue; - setState(newValue); - }); - return state; - }; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/visual-mode/index.js -var import_react7 = __toESM(require_react()); - -// node_modules/@cloudscape-design/component-toolkit/lib/dom/find-up-until.js -function findUpUntil(from, test) { - var current = from; - while (current && !test(current)) { - current = current.parentElement; - while (current && !(current instanceof HTMLElement)) { - current = current.parentElement; - } - } - return current; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/dom/node-contains.js -function nodeContains(parent, descendant) { - if (!parent || !descendant || !("nodeType" in descendant)) { - return false; - } - return parent.contains(descendant); -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/is-development.js -var isDevelopment = true; - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/logging.js -var messageCache = /* @__PURE__ */ new Set(); -function warnOnce(component, message) { - if (isDevelopment) { - var warning = "[AwsUi] [".concat(component, "] ").concat(message); - if (!messageCache.has(warning)) { - messageCache.add(warning); - console.warn(warning); - } - } -} - -// node_modules/@cloudscape-design/component-toolkit/lib/internal/visual-mode/index.js -var awsuiVisualRefreshFlag = Symbol["for"]("awsui-visual-refresh-flag"); -function isMotionDisabled(element) { - var _a2, _b; - return !!findUpUntil(element, function(node) { - return node.classList.contains("awsui-motion-disabled"); - }) || ((_b = (_a2 = window.matchMedia) === null || _a2 === void 0 ? void 0 : _a2.call(window, "(prefers-reduced-motion: reduce)").matches) !== null && _b !== void 0 ? _b : false); -} -function useCurrentMode(elementRef) { - var _a2 = (0, import_react7.useState)("light"), value = _a2[0], setValue = _a2[1]; - useMutationObserver(elementRef, function(node) { - var darkModeParent = findUpUntil(node, function(node2) { - return node2.classList.contains("awsui-polaris-dark-mode") || node2.classList.contains("awsui-dark-mode"); - }); - setValue(darkModeParent ? "dark" : "light"); - }); - return value; -} -function useDensityMode(elementRef) { - var _a2 = (0, import_react7.useState)("comfortable"), value = _a2[0], setValue = _a2[1]; - useMutationObserver(elementRef, function(node) { - var compactModeParent = findUpUntil(node, function(node2) { - return node2.classList.contains("awsui-polaris-compact-mode") || node2.classList.contains("awsui-compact-mode"); - }); - setValue(compactModeParent ? "compact" : "comfortable"); - }); - return value; -} -function useReducedMotion(elementRef) { - var _a2 = (0, import_react7.useState)(false), value = _a2[0], setValue = _a2[1]; - useMutationObserver(elementRef, function(node) { - setValue(isMotionDisabled(node)); - }); - return value; -} -var useMutationSingleton = createSingletonHandler(function(handler) { - var observer = new MutationObserver(function() { - return handler(); - }); - observer.observe(document.body, { attributes: true, subtree: true }); - return function() { - return observer.disconnect(); - }; -}); -function useMutationObserver(elementRef, onChange) { - var handler = useStableCallback(function() { - if (elementRef.current) { - onChange(elementRef.current); - } - }); - useMutationSingleton(handler); - (0, import_react7.useEffect)(function() { - handler(); - }, [handler]); -} -var visualRefreshState = void 0; -function detectVisualRefresh() { - return typeof document !== "undefined" && !!document.querySelector(".awsui-visual-refresh"); -} -function useRuntimeVisualRefresh() { - var _a2; - if (visualRefreshState === void 0) { - visualRefreshState = detectVisualRefresh(); - if (!visualRefreshState && typeof window !== "undefined" && ((_a2 = window[awsuiVisualRefreshFlag]) === null || _a2 === void 0 ? void 0 : _a2.call(window))) { - document.body.classList.add("awsui-visual-refresh"); - visualRefreshState = true; - } - } - if (isDevelopment) { - var newVisualRefreshState = detectVisualRefresh(); - if (newVisualRefreshState !== visualRefreshState) { - warnOnce("Visual Refresh", "Dynamic visual refresh change detected. This is not supported. Make sure `awsui-visual-refresh` is attached to the `` element before initial React render"); - } - } - return visualRefreshState; -} - -// node_modules/@cloudscape-design/components/internal/environment.js -var PACKAGE_SOURCE = "components"; -var PACKAGE_VERSION = "3.0.0 (171737fc)"; -var THEME = "open-source-visual-refresh"; -var ALWAYS_VISUAL_REFRESH = true; - -// node_modules/@cloudscape-design/components/internal/base-component/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/base-component/styles.scoped.css"; - -// node_modules/@cloudscape-design/components/internal/base-component/index.js -initAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION); -function getBaseProps(props2) { - const baseProps = {}; - Object.keys(props2).forEach((prop) => { - if (prop === "id" || prop === "className" || prop.match(/^data-/)) { - baseProps[prop] = props2[prop]; - } - }); - return baseProps; -} -function getAnalyticsMetadataProps(props2) { - return props2.__analyticsMetadata; -} - -// node_modules/@cloudscape-design/components/icon/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/icon/styles.scoped.css"; -var styles_css_default2 = { - "icon": "awsui_icon_h11ix_1l964_104", - "icon-flex-height": "awsui_icon-flex-height_h11ix_1l964_110", - "size-small": "awsui_size-small_h11ix_1l964_135", - "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_1l964_139", - "size-normal": "awsui_size-normal_h11ix_1l964_154", - "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_1l964_158", - "size-medium": "awsui_size-medium_h11ix_1l964_173", - "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_1l964_177", - "size-big": "awsui_size-big_h11ix_1l964_192", - "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_1l964_196", - "size-large": "awsui_size-large_h11ix_1l964_211", - "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_1l964_215", - "variant-normal": "awsui_variant-normal_h11ix_1l964_230", - "variant-disabled": "awsui_variant-disabled_h11ix_1l964_233", - "variant-inverted": "awsui_variant-inverted_h11ix_1l964_236", - "variant-subtle": "awsui_variant-subtle_h11ix_1l964_239", - "variant-warning": "awsui_variant-warning_h11ix_1l964_242", - "variant-error": "awsui_variant-error_h11ix_1l964_245", - "variant-success": "awsui_variant-success_h11ix_1l964_248", - "variant-link": "awsui_variant-link_h11ix_1l964_251", - "name-angle-left-double": "awsui_name-angle-left-double_h11ix_1l964_254", - "name-angle-left": "awsui_name-angle-left_h11ix_1l964_254", - "name-angle-right-double": "awsui_name-angle-right-double_h11ix_1l964_256", - "name-angle-right": "awsui_name-angle-right_h11ix_1l964_256", - "name-arrow-left": "awsui_name-arrow-left_h11ix_1l964_258", - "name-caret-left-filled": "awsui_name-caret-left-filled_h11ix_1l964_259", - "name-caret-right-filled": "awsui_name-caret-right-filled_h11ix_1l964_260", - "name-audio-full": "awsui_name-audio-full_h11ix_1l964_261", - "name-audio-half": "awsui_name-audio-half_h11ix_1l964_262", - "name-audio-off": "awsui_name-audio-off_h11ix_1l964_263", - "name-external": "awsui_name-external_h11ix_1l964_264", - "name-redo": "awsui_name-redo_h11ix_1l964_265", - "name-shrink": "awsui_name-shrink_h11ix_1l964_266", - "name-undo": "awsui_name-undo_h11ix_1l964_267", - "name-view-vertical": "awsui_name-view-vertical_h11ix_1l964_268", - "badge": "awsui_badge_h11ix_1l964_272" -}; - -// node_modules/@cloudscape-design/components/icon/icons.js -var icons_default = { - "add-plus": '', - "anchor-link": '', - "angle-down": '', - "angle-left-double": '', - "angle-left": '', - "angle-right-double": '', - "angle-right": '', - "angle-up": '', - "arrow-left": '', - "audio-full": '', - "audio-half": '', - "audio-off": '', - "bug": '', - "calendar": '', - "call": '', - "caret-down-filled": '', - "caret-down": '', - "caret-left-filled": '', - "caret-right-filled": '', - "caret-up-filled": '', - "caret-up": '', - "check": '', - "close": '', - "contact": '', - "copy": '', - "delete-marker": '', - "download": '', - "drag-indicator": '', - "edit": '', - "ellipsis": '', - "envelope": '', - "expand": '', - "external": '', - "file-open": '', - "file": '', - "filter": '', - "flag": '', - "folder-open": '', - "folder": '', - "gen-ai": '', - "group-active": '', - "group": '', - "heart": '', - "insert-row": '', - "key": '', - "keyboard": '', - "lock-private": '', - "menu": '', - "microphone-off": '', - "microphone": '', - "multiscreen": '', - "notification": '', - "redo": '', - "refresh": '', - "remove": '', - "resize-area": '', - "script": '', - "search": '', - "security": '', - "settings": '', - "share": '', - "shrink": '', - "star-filled": '', - "star-half": '', - "star": '', - "status-in-progress": '', - "status-info": '', - "status-negative": '', - "status-pending": '', - "status-positive": '', - "status-stopped": '', - "status-warning": '', - "suggestions": '', - "thumbs-down-filled": '', - "thumbs-down": '', - "thumbs-up-filled": '', - "thumbs-up": '', - "ticket": '', - "treeview-collapse": '', - "treeview-expand": '', - "undo": '', - "unlocked": '', - "upload-download": '', - "upload": '', - "user-profile-active": '', - "user-profile": '', - "video-off": '', - "video-on": '', - "video-unavailable": '', - "view-full": '', - "view-horizontal": '', - "view-vertical": '', - "zoom-in": '', - "zoom-out": '', - "zoom-to-fit": '' -}; - -// node_modules/@cloudscape-design/components/internal/hooks/use-merge-refs/index.js -var import_react8 = __toESM(require_react()); -function useMergeRefs(...refs) { - return (0, import_react8.useMemo)(() => { - if (refs.every((ref) => ref === null || ref === void 0)) { - return null; - } - return (value) => { - refs.forEach((ref) => { - if (typeof ref === "function") { - ref(value); - } else if (ref !== null && ref !== void 0) { - ref.current = value; - } - }); - }; - }, refs); -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-visual-mode/index.js -var useVisualRefresh = ALWAYS_VISUAL_REFRESH ? () => true : useRuntimeVisualRefresh; - -// node_modules/@cloudscape-design/components/icon/internal.js -function iconSizeMap(height) { - if (height === null) { - return "normal"; - } - if (height >= 50) { - return "large"; - } else if (height >= 36) { - return "big"; - } else if (height >= 24) { - return "medium"; - } else if (height <= 16) { - return "small"; - } else { - return "normal"; - } -} -var InternalIcon = (_a2) => { - var { name, size: size2 = "normal", variant = "normal", url, alt, svg, badge, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["name", "size", "variant", "url", "alt", "svg", "badge", "__internalRootRef"]); - const iconRef = (0, import_react9.useRef)(null); - useVisualRefresh(); - const [parentHeight, setParentHeight] = (0, import_react9.useState)(null); - const contextualSize = size2 === "inherit"; - const iconSize = contextualSize ? iconSizeMap(parentHeight) : size2; - const inlineStyles = contextualSize && parentHeight !== null ? { height: `${parentHeight}px` } : {}; - const baseProps = getBaseProps(props2); - baseProps.className = clsx_m_default(baseProps.className, styles_css_default2.icon, contextualSize && styles_css_default2["icon-flex-height"], badge && styles_css_default2.badge, !contextualSize && styles_css_default2[`size-${iconSize}-mapped-height`], styles_css_default2[`size-${iconSize}`], styles_css_default2[`variant-${variant}`], styles_css_default2[`name-${name}`]); - (0, import_react9.useLayoutEffect)(() => { - if (!contextualSize || !iconRef.current) { - return; - } - const { lineHeight } = getComputedStyle(iconRef.current); - const newParentHeight = parseInt(lineHeight, 10); - setParentHeight(newParentHeight); - }); - const mergedRef = useMergeRefs(iconRef, __internalRootRef); - if (svg) { - if (url) { - warnOnce("Icon", "You have specified both `url` and `svg`. `svg` will take precedence and `url` will be ignored."); - } - return import_react9.default.createElement("span", Object.assign({}, baseProps, { ref: mergedRef, "aria-hidden": "true", style: inlineStyles }), svg); - } - if (url) { - return import_react9.default.createElement( - "span", - Object.assign({}, baseProps, { ref: mergedRef, style: inlineStyles }), - import_react9.default.createElement("img", { src: url, alt }) - ); - } - const validIcon = name && Object.prototype.hasOwnProperty.call(icons_default, name); - function iconMap(name2) { - const genAiFilledIcon = ``; - if (name2 === "gen-ai" && iconSize === "small") { - return genAiFilledIcon; - } else { - return icons_default[name2]; - } - } - return import_react9.default.createElement("span", Object.assign({}, baseProps, { - // dangerouslySetInnerHTML is safe here, as we control the content coming from `icons` - // eslint-disable-next-line react/no-danger - dangerouslySetInnerHTML: validIcon ? { __html: iconMap(name) } : void 0, - ref: mergedRef, - style: inlineStyles - })); -}; -var internal_default = InternalIcon; - -// node_modules/@cloudscape-design/components/spinner/internal.js -var import_react10 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/spinner/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/spinner/styles.scoped.css"; -var styles_css_default3 = { - "root": "awsui_root_1612d_wzftr_133", - "spinner-rotator": "awsui_spinner-rotator_1612d_wzftr_1", - "size-normal": "awsui_size-normal_1612d_wzftr_147", - "size-big": "awsui_size-big_1612d_wzftr_155", - "size-large": "awsui_size-large_1612d_wzftr_163", - "variant-normal": "awsui_variant-normal_1612d_wzftr_171", - "variant-disabled": "awsui_variant-disabled_1612d_wzftr_174", - "variant-inverted": "awsui_variant-inverted_1612d_wzftr_177", - "circle": "awsui_circle_1612d_wzftr_189", - "circle-left": "awsui_circle-left_1612d_wzftr_217", - "spinner-line-left": "awsui_spinner-line-left_1612d_wzftr_1", - "circle-right": "awsui_circle-right_1612d_wzftr_222", - "spinner-line-right": "awsui_spinner-line-right_1612d_wzftr_1" -}; - -// node_modules/@cloudscape-design/components/spinner/internal.js -function InternalSpinner(_a2) { - var { size: size2 = "normal", variant = "normal", __internalRootRef } = _a2, props2 = __rest(_a2, ["size", "variant", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - return import_react10.default.createElement( - "span", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default3.root, styles_css_default3[`size-${size2}`], styles_css_default3[`variant-${variant}`]), ref: __internalRootRef }), - import_react10.default.createElement("span", { className: clsx_m_default(styles_css_default3.circle, styles_css_default3["circle-left"]) }), - import_react10.default.createElement("span", { className: clsx_m_default(styles_css_default3.circle, styles_css_default3["circle-right"]) }) - ); -} - -// node_modules/@cloudscape-design/components/button/icon-helper.js -function getIconAlign(props2) { - const standalone = props2.variant === "icon" || props2.variant === "inline-icon"; - return standalone ? "left" : props2.iconAlign; -} -function IconWrapper(_a2) { - var { iconName, iconUrl, iconAlt, iconSvg, iconSize, badge } = _a2, props2 = __rest(_a2, ["iconName", "iconUrl", "iconAlt", "iconSvg", "iconSize", "badge"]); - if (!iconName && !iconUrl && !iconSvg) { - return null; - } - return React3.createElement(internal_default, { className: clsx_m_default(styles_css_default.icon, styles_css_default[`icon-${getIconAlign(props2)}`], props2.iconClass), name: iconName, url: iconUrl, svg: iconSvg, alt: iconAlt, size: iconSize, badge }); -} -function LeftIcon(props2) { - if (props2.loading) { - return React3.createElement(InternalSpinner, { className: clsx_m_default(styles_css_default.icon, styles_css_default["icon-left"]) }); - } else if (getIconAlign(props2) === "left") { - return React3.createElement(IconWrapper, Object.assign({}, props2)); - } - return null; -} -function RightIcon(props2) { - if (getIconAlign(props2) === "right") { - return React3.createElement(IconWrapper, Object.assign({}, props2)); - } - return null; -} - -// node_modules/@cloudscape-design/components/internal/utils/check-safe-url.js -var allowedJavascriptUrls = ["javascript:void(0)", "javascript:void(0);", "javascript:;"]; -function checkSafeUrl(component, url) { - if (!url) { - return; - } - if (allowedJavascriptUrls.indexOf(url.toLowerCase()) !== -1) { - return; - } - let parsedUrl; - try { - parsedUrl = new URL(url); - } catch (e) { - return; - } - if (parsedUrl.protocol === "javascript:") { - warnOnce(component, `A javascript: URL was blocked as a security precaution. The URL was "${url}".`); - throw new Error(`A javascript: URL was blocked as a security precaution.`); - } - return; -} - -// node_modules/@cloudscape-design/components/internal/components/live-region/index.js -var import_react12 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/screenreader-only/index.js -var import_react11 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/screenreader-only/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/screenreader-only/styles.scoped.css"; -var styles_css_default4 = { - "root": "awsui_root_xttbq_pgwjg_99" -}; - -// node_modules/@cloudscape-design/components/internal/components/screenreader-only/index.js -function ScreenreaderOnly(props2) { - return import_react11.default.createElement("span", Object.assign({}, props2, { className: clsx_m_default(styles_css_default4.root, props2.className) })); -} - -// node_modules/@cloudscape-design/components/internal/components/live-region/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/live-region/styles.scoped.css"; -var styles_css_default5 = { - "root": "awsui_root_3bgfn_im8v7_5" -}; - -// node_modules/@cloudscape-design/components/internal/components/live-region/index.js -var live_region_default = (0, import_react12.memo)(LiveRegion); -function LiveRegion(_a2) { - var { assertive = false, delay = 10, visible = false, tagName: TagName = "span", children: children2, id, source } = _a2, restProps = __rest(_a2, ["assertive", "delay", "visible", "tagName", "children", "id", "source"]); - const sourceRef = (0, import_react12.useRef)(null); - const targetRef = (0, import_react12.useRef)(null); - (0, import_react12.useEffect)(() => { - function getSourceContent() { - if (source) { - return source.map((item) => { - if (!item) { - return void 0; - } - if (typeof item === "string") { - return item; - } - if (item.current) { - return extractInnerText(item.current); - } - }).filter(Boolean).join(" "); - } - if (sourceRef.current) { - return extractInnerText(sourceRef.current); - } - } - function updateLiveRegion() { - const sourceContent = getSourceContent(); - if (targetRef.current && sourceContent) { - const targetContent = extractInnerText(targetRef.current); - if (targetContent !== sourceContent) { - targetRef.current.innerText = sourceContent; - } - } - } - let timeoutId; - if (delay) { - timeoutId = setTimeout(updateLiveRegion, delay); - } else { - updateLiveRegion(); - } - return () => { - if (timeoutId) { - clearTimeout(timeoutId); - } - }; - }); - return import_react12.default.createElement( - import_react12.default.Fragment, - null, - visible && !source && import_react12.default.createElement(TagName, { ref: sourceRef, id }, children2), - import_react12.default.createElement( - ScreenreaderOnly, - Object.assign({}, restProps, { className: clsx_m_default(styles_css_default5.root, restProps.className) }), - !visible && !source && import_react12.default.createElement(TagName, { ref: sourceRef, "aria-hidden": "true" }, children2), - import_react12.default.createElement("span", { ref: targetRef, "aria-atomic": "true", "aria-live": assertive ? "assertive" : "polite" }) - ) - ); -} -function extractInnerText(node) { - return (node.innerText || "").replace(/\s+/g, " ").trim(); -} - -// node_modules/@cloudscape-design/components/internal/context/button-context.js -var import_react13 = __toESM(require_react()); -var ButtonContext = (0, import_react13.createContext)({ - onClick: () => { - } -}); -function useButtonContext() { - return (0, import_react13.useContext)(ButtonContext); -} - -// node_modules/@cloudscape-design/components/internal/analytics/hooks/use-funnel.js -var import_react15 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/analytics/context/analytics-context.js -var import_react14 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/analytics/selectors.js -var DATA_ATTR_FUNNEL = "data-analytics-funnel"; -var DATA_ATTR_FUNNEL_INTERACTION_ID = `${DATA_ATTR_FUNNEL}-interaction-id`; -var DATA_ATTR_FUNNEL_KEY = `${DATA_ATTR_FUNNEL}-key`; -var DATA_ATTR_FUNNEL_VALUE = `${DATA_ATTR_FUNNEL}-value`; -var DATA_ATTR_FUNNEL_STEP = `${DATA_ATTR_FUNNEL}-step`; -var DATA_ATTR_FUNNEL_SUBSTEP = `${DATA_ATTR_FUNNEL}-substep`; -var DATA_ATTR_FIELD_LABEL = "data-analytics-field-label"; -var DATA_ATTR_FIELD_ERROR = "data-analytics-field-error"; -var DATA_ATTR_ANALYTICS_ALERT = "data-analytics-alert"; -var DATA_ATTR_ANALYTICS_FLASHBAR = "data-analytics-flashbar"; -var FUNNEL_KEY_FUNNEL_NAME = "funnel-name"; -var FUNNEL_KEY_STEP_NAME = "step-name"; -var FUNNEL_KEY_SUBSTEP_NAME = "substep-name"; -var getFunnelNameSelector = () => `[${DATA_ATTR_FUNNEL_KEY}="${FUNNEL_KEY_FUNNEL_NAME}"]`; -var getFunnelValueSelector = (value) => `[${DATA_ATTR_FUNNEL_VALUE}="${value}"]`; -var getSubStepAllSelector = () => `[${DATA_ATTR_FUNNEL_SUBSTEP}]`; -var getSubStepSelector = (subStepId) => `[${DATA_ATTR_FUNNEL_SUBSTEP}="${subStepId}"]`; -var getSubStepNameSelector = (subStepId) => [subStepId ? getSubStepSelector(subStepId) : "", `[${DATA_ATTR_FUNNEL_KEY}="${FUNNEL_KEY_SUBSTEP_NAME}"]`].join(" "); -var getFieldSlotSeletor = (id) => id ? `[id="${id}"]` : void 0; -var getNameFromSelector = (selector) => { - var _a2, _b; - return selector ? (_b = (_a2 = document.querySelector(selector)) === null || _a2 === void 0 ? void 0 : _a2.innerText) === null || _b === void 0 ? void 0 : _b.trim() : void 0; -}; - -// node_modules/@cloudscape-design/components/internal/analytics/context/analytics-context.js -var FunnelContext = (0, import_react14.createContext)({ - funnelInteractionId: void 0, - funnelNameSelector: getFunnelNameSelector(), - setFunnelInteractionId: () => { - }, - funnelType: "single-page", - optionalStepNumbers: [], - totalFunnelSteps: 0, - funnelSubmit: () => { - }, - funnelCancel: () => { - }, - submissionAttempt: 0, - funnelNextOrSubmitAttempt: () => { - }, - funnelState: { current: "default" }, - errorCount: { current: 0 }, - loadingButtonCount: { current: 0 }, - latestFocusCleanupFunction: { current: void 0 }, - isInFunnel: false, - wizardCount: { current: 0 } -}); -var FunnelStepContext = (0, import_react14.createContext)({ - stepNameSelector: "", - stepNumber: 0, - subStepCount: { current: 0 }, - isInStep: false, - funnelInteractionId: void 0, - onStepChange: () => { - }, - subStepConfiguration: { current: /* @__PURE__ */ new Map() } -}); -var FunnelSubStepContext = (0, import_react14.createContext)({ - subStepId: "", - subStepSelector: "", - subStepNameSelector: "", - subStepRef: { current: null }, - isNestedSubStep: false, - mousePressed: { current: false }, - isFocusedSubStep: { current: false }, - focusCleanupFunction: { current: void 0 } -}); -var FunnelNameSelectorContext = (0, import_react14.createContext)(void 0); - -// node_modules/@cloudscape-design/components/internal/analytics/index.js -var FunnelMetrics = { - funnelStart() { - return ""; - }, - funnelError() { - }, - funnelComplete() { - }, - funnelSuccessful() { - }, - funnelCancelled() { - }, - funnelChange() { - }, - funnelStepStart() { - }, - funnelStepComplete() { - }, - funnelStepNavigation() { - }, - funnelStepError() { - }, - funnelStepChange() { - }, - funnelSubStepStart() { - }, - funnelSubStepComplete() { - }, - funnelSubStepError() { - }, - helpPanelInteracted() { - }, - externalLinkInteracted() { - } -}; - -// node_modules/@cloudscape-design/components/internal/utils/dom.js -var import_balanced_match = __toESM(require_balanced_match()); - -// node_modules/@cloudscape-design/components/internal/utils/calculate-once.js -function calculateOnce(callback) { - let result = void 0; - return () => { - if (result === void 0) { - result = callback(); - } - return result; - }; -} - -// node_modules/@cloudscape-design/components/internal/utils/dom.js -function findUpUntil2(node, callback) { - let current = node; - while (current && !callback(current)) { - current = current.parentElement; - while (current && !(current instanceof HTMLElement)) { - current = current.parentElement; - } - } - return current; -} -function supportsStickyPosition() { - var _a2, _b, _c; - if (typeof window === "undefined") { - return false; - } - return (_c = (_b = (_a2 = window.CSS) === null || _a2 === void 0 ? void 0 : _a2.supports) === null || _b === void 0 ? void 0 : _b.call(_a2, "position", "sticky")) !== null && _c !== void 0 ? _c : false; -} -var supportsContainingBlockPositioning = calculateOnce(() => { - const parent = document.createElement("div"); - parent.style.transform = "translateY(5px)"; - document.body.appendChild(parent); - const child = document.createElement("div"); - child.style.position = "fixed"; - child.style.top = "0"; - parent.appendChild(child); - const result = parent.getBoundingClientRect().top === child.getBoundingClientRect().top; - document.body.removeChild(parent); - return result; -}); -function getContainingBlock(startElement) { - if (!startElement.parentElement) { - return null; - } - return supportsContainingBlockPositioning() ? findUpUntil2(startElement.parentElement, (element) => { - const computedStyle = getComputedStyle(element); - return !!computedStyle.transform && computedStyle.transform !== "none" || !!computedStyle.perspective && computedStyle.perspective !== "none"; - }) : null; -} -var cssVariableExpression = /--.+?\s*,\s*(.+)/; -function parseCssVariable(value) { - var _a2, _b, _c; - if ((_c = (_b = (_a2 = window.CSS) === null || _a2 === void 0 ? void 0 : _a2.supports) === null || _b === void 0 ? void 0 : _b.call(_a2, "color", "var(--dummy, #000)")) !== null && _c !== void 0 ? _c : false) { - return value; - } - const varIndex = value.lastIndexOf("var("); - if (varIndex === -1) { - return value; - } - const expr = (0, import_balanced_match.default)("(", ")", value.substr(varIndex)); - if (!expr) { - return value; - } - const match2 = expr.body.match(cssVariableExpression); - return match2 ? match2[1] : value; -} - -// node_modules/@cloudscape-design/components/internal/utils/node-belongs.js -function nodeBelongs(container, target) { - var _a2; - if (!(target instanceof Node)) { - return false; - } - const portal = findUpUntil2(target, (node) => node === container || node instanceof HTMLElement && !!node.dataset.awsuiReferrerId); - if (portal && portal === container) { - return true; - } - const referrer = portal instanceof HTMLElement ? document.getElementById((_a2 = portal.dataset.awsuiReferrerId) !== null && _a2 !== void 0 ? _a2 : "") : null; - return referrer ? nodeContains(container, referrer) : nodeContains(container, target); -} - -// node_modules/@cloudscape-design/components/internal/analytics/hooks/use-funnel.js -var useFunnelSubStep = () => { - const context = (0, import_react15.useContext)(FunnelSubStepContext); - const { funnelInteractionId, funnelState, latestFocusCleanupFunction } = useFunnel(); - const { stepNumber, stepNameSelector, subStepConfiguration } = useFunnelStep(); - const { instanceIdentifier, subStepId, subStepSelector, subStepNameSelector, subStepRef, isNestedSubStep, mousePressed, isFocusedSubStep, focusCleanupFunction } = context; - if (isNestedSubStep) { - return context; - } - const onFocus = (event) => __awaiter(void 0, void 0, void 0, function* () { - var _a2, _b, _c, _d; - const element = event.target; - yield new Promise((r2) => setTimeout(r2, 1)); - if (document.activeElement !== element) { - return; - } - if (isFocusedSubStep.current) { - return; - } - isFocusedSubStep.current = true; - if (funnelInteractionId && subStepId) { - (_a2 = latestFocusCleanupFunction.current) === null || _a2 === void 0 ? void 0 : _a2.call(latestFocusCleanupFunction); - const subStepName = getNameFromSelector(subStepNameSelector); - const stepName = getNameFromSelector(stepNameSelector); - const subStepNumber = (_d = (_c = (_b = subStepConfiguration.current) === null || _b === void 0 ? void 0 : _b.get(stepNumber)) === null || _c === void 0 ? void 0 : _c.find((step2) => step2.name === subStepName)) === null || _d === void 0 ? void 0 : _d.number; - FunnelMetrics.funnelSubStepStart({ - instanceIdentifier, - funnelInteractionId, - subStepSelector, - subStepNameSelector, - subStepName, - subStepNumber, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector() - }); - let cleanupFunctionHasBeenRun = false; - focusCleanupFunction.current = () => { - var _a3, _b2, _c2; - if (cleanupFunctionHasBeenRun) { - return; - } - cleanupFunctionHasBeenRun = true; - const subStepNumber2 = (_c2 = (_b2 = (_a3 = subStepConfiguration.current) === null || _a3 === void 0 ? void 0 : _a3.get(stepNumber)) === null || _b2 === void 0 ? void 0 : _b2.find((s2) => s2.name === subStepName)) === null || _c2 === void 0 ? void 0 : _c2.number; - if (funnelState.current !== "cancelled") { - FunnelMetrics.funnelSubStepComplete({ - instanceIdentifier, - funnelInteractionId, - subStepSelector, - subStepNameSelector, - subStepName, - subStepNumber: subStepNumber2, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector() - }); - } - }; - latestFocusCleanupFunction.current = focusCleanupFunction.current; - } - }); - const onBlur = (event) => { - var _a2; - if (mousePressed.current) { - return; - } - if (!subStepRef.current || !event.relatedTarget || !nodeBelongs(subStepRef.current, event.relatedTarget)) { - isFocusedSubStep.current = false; - if (funnelInteractionId && subStepId && funnelState.current !== "cancelled") { - (_a2 = focusCleanupFunction.current) === null || _a2 === void 0 ? void 0 : _a2.call(focusCleanupFunction); - } - } - }; - const funnelSubStepProps = funnelInteractionId ? { - [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId, - onFocus, - onBlur - } : {}; - return Object.assign({ funnelSubStepProps }, context); -}; -var useFunnelStep = () => { - const context = (0, import_react15.useContext)(FunnelStepContext); - return context; -}; -var useFunnel = () => { - const context = (0, import_react15.useContext)(FunnelContext); - const funnelProps = context.funnelInteractionId ? { - [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId - } : {}; - return Object.assign({ funnelProps }, context); -}; -var useFunnelNameSelector = () => { - const context = (0, import_react15.useContext)(FunnelNameSelectorContext); - return context; -}; - -// node_modules/@cloudscape-design/components/internal/hooks/use-unique-id/index.js -var import_react16 = __toESM(require_react()); -var _a; -var counter = 0; -var useIdFallback = () => { - const idRef = (0, import_react16.useRef)(null); - if (!idRef.current) { - idRef.current = `${counter++}-${Date.now()}-${Math.round(Math.random() * 1e4)}`; - } - return idRef.current; -}; -var useId = (_a = import_react16.default.useId) !== null && _a !== void 0 ? _a : useIdFallback; -function useUniqueId(prefix) { - return `${prefix ? prefix : ""}` + useId(); -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-performance-marks.js -var import_react18 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/use-effect-on-update.js -var import_react17 = __toESM(require_react()); -function useEffectOnUpdate(callback, deps) { - const isFirstRender = (0, import_react17.useRef)(true); - (0, import_react17.useEffect)(() => { - if (isFirstRender.current) { - isFirstRender.current = false; - } else { - return callback(); - } - }, deps); -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-performance-marks.js -function usePerformanceMarks(name, enabled, elementRef, getDetails, dependencies) { - const id = useUniqueId(); - (0, import_react18.useEffect)(() => { - if (!enabled || !elementRef.current) { - return; - } - const elementVisible = elementRef.current.offsetWidth > 0 && elementRef.current.offsetHeight > 0 && getComputedStyle(elementRef.current).visibility !== "hidden"; - if (!elementVisible) { - return; - } - const renderedMarkName = `${name}Rendered`; - performance.mark(renderedMarkName, { - detail: Object.assign({ source: "awsui", instanceIdentifier: id }, getDetails()) - }); - }, []); - useEffectOnUpdate(() => { - if (!enabled || !elementRef.current) { - return; - } - const elementVisible = elementRef.current.offsetWidth > 0 && elementRef.current.offsetHeight > 0 && getComputedStyle(elementRef.current).visibility !== "hidden"; - if (!elementVisible) { - return; - } - const updatedMarkName = `${name}Updated`; - performance.mark(updatedMarkName, { - detail: Object.assign({ source: "awsui", instanceIdentifier: id }, getDetails()) - }); - }, dependencies); -} - -// node_modules/@cloudscape-design/components/internal/context/single-tab-stop-navigation-context.js -var import_react19 = __toESM(require_react()); -var defaultValue = { - navigationActive: false, - registerFocusable: () => () => { - } -}; -var SingleTabStopNavigationContext = (0, import_react19.createContext)(defaultValue); -function useSingleTabStopNavigation(focusable, options) { - var _a2; - const { navigationActive: contextNavigationActive, registerFocusable } = (0, import_react19.useContext)(SingleTabStopNavigationContext); - const [focusTargetActive, setFocusTargetActive] = (0, import_react19.useState)(false); - const navigationDisabled = (options === null || options === void 0 ? void 0 : options.tabIndex) && (options === null || options === void 0 ? void 0 : options.tabIndex) < 0; - const navigationActive = contextNavigationActive && !navigationDisabled; - (0, import_react19.useEffect)(() => { - if (navigationActive && focusable && focusable.current) { - const unregister = registerFocusable(focusable.current, (isFocusable) => setFocusTargetActive(isFocusable)); - return () => unregister(); - } - }); - let tabIndex = options === null || options === void 0 ? void 0 : options.tabIndex; - if (navigationActive) { - tabIndex = !focusTargetActive ? -1 : (_a2 = options === null || options === void 0 ? void 0 : options.tabIndex) !== null && _a2 !== void 0 ? _a2 : 0; - } - return { navigationActive, tabIndex }; -} - -// node_modules/@cloudscape-design/components/button/internal.js -var InternalButton = import_react20.default.forwardRef((_a2, ref) => { - var { children: children2, iconName, __iconClass, onClick, onFollow, iconAlign = "left", iconUrl, iconSvg, iconAlt, variant = "normal", loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = "submit", ariaLabel, ariaDescribedby, ariaExpanded, ariaControls, fullWidth, badge, __nativeAttributes, __internalRootRef = null, __focusable = false } = _a2, props2 = __rest(_a2, ["children", "iconName", "__iconClass", "onClick", "onFollow", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "ariaExpanded", "ariaControls", "fullWidth", "badge", "__nativeAttributes", "__internalRootRef", "__focusable"]); - checkSafeUrl("Button", href); - const isAnchor = Boolean(href); - const isNotInteractive = loading || disabled; - const hasAriaDisabled = loading && !disabled || disabled && __focusable; - const shouldHaveContent = children2 && ["icon", "inline-icon", "flashbar-icon", "modal-dismiss"].indexOf(variant) === -1; - const buttonRef = (0, import_react20.useRef)(null); - useForwardFocus(ref, buttonRef); - const buttonContext = useButtonContext(); - const uniqueId = useUniqueId("button"); - const { funnelInteractionId } = useFunnel(); - const { stepNumber, stepNameSelector } = useFunnelStep(); - const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); - usePerformanceMarks("primaryButton", variant === "primary", buttonRef, () => { - var _a3; - return { - loading, - disabled, - text: (_a3 = buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.innerText - }; - }, [loading, disabled]); - const handleClick = (event) => { - if (isNotInteractive) { - return event.preventDefault(); - } - if (isAnchor && isPlainLeftClick(event)) { - fireCancelableEvent(onFollow, { href, target }, event); - if ((iconName === "external" || target === "_blank") && funnelInteractionId) { - const stepName = getNameFromSelector(stepNameSelector); - const subStepName = getNameFromSelector(subStepNameSelector); - FunnelMetrics.externalLinkInteracted({ - funnelInteractionId, - stepNumber, - stepName, - stepNameSelector, - subStepSelector, - subStepName, - subStepNameSelector, - elementSelector: getFunnelValueSelector(uniqueId), - subStepAllSelector: getSubStepAllSelector() - }); - } - } - const { altKey, button, ctrlKey, metaKey, shiftKey } = event; - fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event); - buttonContext.onClick({ variant }); - }; - const buttonClass = clsx_m_default(props2.className, styles_css_default.button, styles_css_default[`variant-${variant}`], { - [styles_css_default.disabled]: isNotInteractive, - [styles_css_default["button-no-wrap"]]: !wrapText, - [styles_css_default["button-no-text"]]: !shouldHaveContent, - [styles_css_default["full-width"]]: shouldHaveContent && fullWidth - }); - const explicitTabIndex = __nativeAttributes && "tabIndex" in __nativeAttributes ? __nativeAttributes.tabIndex : void 0; - const { tabIndex } = useSingleTabStopNavigation(buttonRef, { - tabIndex: isAnchor && isNotInteractive ? -1 : explicitTabIndex - }); - const buttonProps = Object.assign(Object.assign(Object.assign({}, props2), __nativeAttributes), { - tabIndex, - // https://github.com/microsoft/TypeScript/issues/36659 - ref: useMergeRefs(buttonRef, __internalRootRef), - "aria-label": ariaLabel, - "aria-describedby": ariaDescribedby, - "aria-expanded": ariaExpanded, - "aria-controls": ariaControls, - // add ariaLabel as `title` as visible hint text - title: ariaLabel, - className: buttonClass, - onClick: handleClick, - [DATA_ATTR_FUNNEL_VALUE]: uniqueId - }); - const iconProps = { - loading, - iconName, - iconAlign, - iconUrl, - iconSvg, - iconAlt, - variant, - badge, - iconClass: __iconClass, - iconSize: variant === "modal-dismiss" ? "medium" : "normal" - }; - const buttonContent = import_react20.default.createElement( - import_react20.default.Fragment, - null, - import_react20.default.createElement(LeftIcon, Object.assign({}, iconProps)), - shouldHaveContent && import_react20.default.createElement("span", { className: styles_css_default.content }, children2), - import_react20.default.createElement(RightIcon, Object.assign({}, iconProps)) - ); - const { loadingButtonCount } = useFunnel(); - (0, import_react20.useEffect)(() => { - if (loading) { - loadingButtonCount.current++; - return () => { - loadingButtonCount.current--; - }; - } - }, [loading, loadingButtonCount]); - if (isAnchor) { - return ( - // https://github.com/yannickcr/eslint-plugin-react/issues/2962 - // eslint-disable-next-line react/jsx-no-target-blank - import_react20.default.createElement( - import_react20.default.Fragment, - null, - import_react20.default.createElement("a", Object.assign({}, buttonProps, { - href, - target, - // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target - rel: rel !== null && rel !== void 0 ? rel : target === "_blank" ? "noopener noreferrer" : void 0, - "aria-disabled": isNotInteractive ? true : void 0, - download - }), buttonContent), - loading && loadingText && import_react20.default.createElement(live_region_default, null, loadingText) - ) - ); - } - return import_react20.default.createElement( - import_react20.default.Fragment, - null, - import_react20.default.createElement("button", Object.assign({}, buttonProps, { type: formAction === "none" ? "button" : "submit", disabled: disabled && !__focusable, "aria-disabled": hasAriaDisabled ? true : void 0 }), buttonContent), - loading && loadingText && import_react20.default.createElement(live_region_default, null, loadingText) - ); -}); -var internal_default2 = InternalButton; - -// node_modules/@cloudscape-design/components/internal/components/visual-context/index.js -var import_react21 = __toESM(require_react()); -var contextMatch = /awsui-context-([\w-]+)/; -function useVisualContext(elementRef) { - const [value, setValue] = (0, import_react21.useState)(""); - (0, import_react21.useLayoutEffect)(() => { - var _a2; - if (elementRef.current) { - const contextParent = findUpUntil2(elementRef.current, (node) => !!node.className.match(contextMatch)); - setValue((_a2 = contextParent === null || contextParent === void 0 ? void 0 : contextParent.className.match(contextMatch)[1]) !== null && _a2 !== void 0 ? _a2 : ""); - } - }, [elementRef]); - return value; -} -function getVisualContextClassname(contextName) { - return `awsui-context-${contextName}`; -} -function VisualContext({ contextName, className: className2, children: children2 }) { - return import_react21.default.createElement("div", { className: clsx_m_default(getVisualContextClassname(contextName), className2) }, children2); -} - -// node_modules/@cloudscape-design/components/alert/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/alert/styles.scoped.css"; -var styles_css_default6 = { - "alert": "awsui_alert_mx3cw_ipfn3_99", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_ipfn3_1", - "root": "awsui_root_mx3cw_ipfn3_125", - "hidden": "awsui_hidden_mx3cw_ipfn3_163", - "with-dismiss": "awsui_with-dismiss_mx3cw_ipfn3_213", - "with-action": "awsui_with-action_mx3cw_ipfn3_213", - "breakpoint-default": "awsui_breakpoint-default_mx3cw_ipfn3_219", - "header": "awsui_header_mx3cw_ipfn3_226", - "action": "awsui_action_mx3cw_ipfn3_230", - "action-slot": "awsui_action-slot_mx3cw_ipfn3_235", - "action-button": "awsui_action-button_mx3cw_ipfn3_236", - "alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_ipfn3_240", - "text": "awsui_text_mx3cw_ipfn3_269", - "icon": "awsui_icon_mx3cw_ipfn3_276", - "message": "awsui_message_mx3cw_ipfn3_279", - "icon-size-medium": "awsui_icon-size-medium_mx3cw_ipfn3_287", - "icon-size-big": "awsui_icon-size-big_mx3cw_ipfn3_290", - "icon-size-normal": "awsui_icon-size-normal_mx3cw_ipfn3_293", - "content": "awsui_content_mx3cw_ipfn3_297", - "dismiss": "awsui_dismiss_mx3cw_ipfn3_301", - "dismiss-button": "awsui_dismiss-button_mx3cw_ipfn3_306", - "type-error": "awsui_type-error_mx3cw_ipfn3_310", - "type-warning": "awsui_type-warning_mx3cw_ipfn3_318", - "type-success": "awsui_type-success_mx3cw_ipfn3_326", - "type-info": "awsui_type-info_mx3cw_ipfn3_334" -}; - -// node_modules/@cloudscape-design/components/internal/breakpoints.js -var BREAKPOINT_MAPPING = [ - ["xl", 1840], - ["l", 1320], - ["m", 1120], - ["s", 912], - ["xs", 688], - ["xxs", 465], - ["default", -1] -]; -var mobileBreakpoint = BREAKPOINT_MAPPING.filter((b) => b[0] === "xs")[0][1]; -var BREAKPOINTS_DESCENDING = BREAKPOINT_MAPPING.map(([bp]) => bp); -function matchBreakpointMapping(subset, actual) { - const qualifyingBreakpoints = BREAKPOINT_MAPPING.slice(BREAKPOINTS_DESCENDING.indexOf(actual)); - for (const [breakpoint] of qualifyingBreakpoints) { - const breakpointValue = subset[breakpoint]; - if (breakpointValue !== void 0) { - return breakpointValue; - } - } - return null; -} -function getMatchingBreakpoint(width, breakpointFilter) { - for (const [breakpoint, breakpointWidth] of BREAKPOINT_MAPPING) { - if (width > breakpointWidth && (!breakpointFilter || breakpointFilter.indexOf(breakpoint) !== -1)) { - return breakpoint; - } - } - return "default"; -} -function getBreakpointValue(breakpoint) { - return BREAKPOINT_MAPPING.find((bp) => bp[0] === breakpoint)[1]; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/container-queries/use-container-query.js -var import_react22 = __toESM(require_react()); -function useContainerQuery(mapFn, deps) { - if (deps === void 0) { - deps = []; - } - var elementRef = (0, import_react22.useRef)(null); - var _a2 = (0, import_react22.useState)(null), state = _a2[0], setState = _a2[1]; - var getElement = (0, import_react22.useCallback)(function() { - return elementRef.current; - }, deps); - useResizeObserver(getElement, function(entry) { - return setState(function(prevState) { - return mapFn(entry, prevState); - }); - }); - return [state, elementRef]; -} - -// node_modules/@cloudscape-design/component-toolkit/lib/use-controllable-state/use-controllable-state.js -var import_react23 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/container-queries/use-container-breakpoints.js -function useContainerBreakpoints(triggers) { - const triggersDep = triggers === null || triggers === void 0 ? void 0 : triggers.join(); - return useContainerQuery((rect) => getMatchingBreakpoint(rect.contentBoxWidth, triggers), [triggersDep]); -} - -// node_modules/@cloudscape-design/components/i18n/context.js -var import_react24 = __toESM(require_react()); -var InternalI18nContext = import_react24.default.createContext({ - locale: null, - format: (_namespace, _component, _key, provided) => provided -}); -function useLocale() { - return (0, import_react24.useContext)(InternalI18nContext).locale; -} -function useInternalI18n(componentName3) { - const { format: format3 } = (0, import_react24.useContext)(InternalI18nContext); - return (key2, provided, customHandler) => { - return format3("@cloudscape-design/components", componentName3, key2, provided, customHandler); - }; -} - -// node_modules/@cloudscape-design/components/internal/context/link-default-variant-context.js -var import_react25 = __toESM(require_react()); -var defaultValue2 = { - defaultVariant: "secondary" -}; -var LinkDefaultVariantContext = (0, import_react25.createContext)(defaultValue2); - -// node_modules/@cloudscape-design/components/internal/plugins/helpers/runtime-content-wrapper.js -var import_react26 = __toESM(require_react()); -function RuntimeContentWrapper({ mountContent, unmountContent }) { - const ref = (0, import_react26.useRef)(null); - (0, import_react26.useEffect)(() => { - const container = ref.current; - mountContent(container); - return () => unmountContent(container); - }, []); - return import_react26.default.createElement("div", { ref }); -} - -// node_modules/@cloudscape-design/components/internal/plugins/helpers/use-discovered-action.js -var import_react27 = __toESM(require_react()); -function convertRuntimeAction(action, context) { - if (!action) { - return null; - } - return import_react27.default.createElement(RuntimeContentWrapper, { key: action.id + "-" + context.type, mountContent: (container) => action.mountContent(container, context), unmountContent: (container) => action.unmountContent(container) }); -} -function createUseDiscoveredAction(onActionRegistered) { - return function useDiscoveredAction3(type) { - const [discoveredActions, setDiscoveredActions] = (0, import_react27.useState)([]); - const headerRef = (0, import_react27.useRef)(null); - const contentRef = (0, import_react27.useRef)(null); - (0, import_react27.useEffect)(() => { - return onActionRegistered((actions) => { - setDiscoveredActions(actions.map((action) => convertRuntimeAction(action, { type, headerRef, contentRef }))); - }); - }, [type]); - return { discoveredActions, headerRef, contentRef }; - }; -} - -// node_modules/@cloudscape-design/components/internal/debounce.js -var DEBOUNCE_DEFAULT_DELAY = 200; -function debounce(func, delay = DEBOUNCE_DEFAULT_DELAY) { - let timeout2; - return function(...args) { - if (timeout2) { - clearTimeout(timeout2); - } - timeout2 = setTimeout(() => { - timeout2 = null; - func(...args); - }, delay); - }; -} - -// node_modules/@cloudscape-design/components/internal/plugins/controllers/drawers.js -var DrawersController = class { - constructor() { - this.drawers = []; - this.drawersRegistrationListener = null; - this.scheduleUpdate = debounce(() => { - var _a2; - (_a2 = this.drawersRegistrationListener) === null || _a2 === void 0 ? void 0 : _a2.call(this, this.drawers); - }, 0); - this.registerDrawer = (config) => { - this.drawers = this.drawers.concat(config); - this.scheduleUpdate(); - }; - this.onDrawersRegistered = (listener) => { - if (this.drawersRegistrationListener !== null) { - console.warn("[AwsUi] [runtime drawers] multiple app layout instances detected"); - } - this.drawersRegistrationListener = listener; - this.scheduleUpdate(); - return () => { - this.drawersRegistrationListener = null; - }; - }; - this.clearRegisteredDrawers = () => { - this.drawers = []; - }; - } - installPublic(api = {}) { - var _a2; - (_a2 = api.registerDrawer) !== null && _a2 !== void 0 ? _a2 : api.registerDrawer = this.registerDrawer; - return api; - } - installInternal(internalApi = {}) { - var _a2, _b; - (_a2 = internalApi.clearRegisteredDrawers) !== null && _a2 !== void 0 ? _a2 : internalApi.clearRegisteredDrawers = this.clearRegisteredDrawers; - (_b = internalApi.onDrawersRegistered) !== null && _b !== void 0 ? _b : internalApi.onDrawersRegistered = this.onDrawersRegistered; - return internalApi; - } -}; - -// node_modules/@cloudscape-design/components/internal/plugins/helpers/utils.js -function sortByPriority(items) { - return items.slice().sort((a2, b) => { - var _a2, _b; - if (b.orderPriority !== a2.orderPriority) { - return Math.sign(((_a2 = b.orderPriority) !== null && _a2 !== void 0 ? _a2 : 0) - ((_b = a2.orderPriority) !== null && _b !== void 0 ? _b : 0)); - } - return b.id < a2.id ? 1 : -1; - }); -} - -// node_modules/@cloudscape-design/components/internal/plugins/controllers/action-buttons.js -var ActionButtonsController = class { - constructor() { - this.listeners = []; - this.actions = []; - this.scheduleUpdate = debounce(() => { - this.listeners.forEach((listener) => listener(this.actions)); - }, 0); - this.registerAction = (action) => { - this.actions.push(action); - this.actions = sortByPriority(this.actions); - this.scheduleUpdate(); - }; - this.clearRegisteredActions = () => { - this.actions = []; - }; - this.onActionRegistered = (listener) => { - this.listeners.push(listener); - this.scheduleUpdate(); - return () => { - this.listeners = this.listeners.filter((item) => item !== listener); - }; - }; - } - installPublic(api = {}) { - var _a2; - (_a2 = api.registerAction) !== null && _a2 !== void 0 ? _a2 : api.registerAction = this.registerAction; - return api; - } - installInternal(internalApi = {}) { - var _a2, _b; - (_a2 = internalApi.clearRegisteredActions) !== null && _a2 !== void 0 ? _a2 : internalApi.clearRegisteredActions = this.clearRegisteredActions; - (_b = internalApi.onActionRegistered) !== null && _b !== void 0 ? _b : internalApi.onActionRegistered = this.onActionRegistered; - return internalApi; - } -}; - -// node_modules/@cloudscape-design/components/internal/plugins/api.js -var storageKey = Symbol.for("awsui-plugin-api"); -function findUpApi(currentWindow) { - try { - if (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow[storageKey]) { - return currentWindow[storageKey]; - } - if (!currentWindow || currentWindow.parent === currentWindow) { - return void 0; - } - return findUpApi(currentWindow.parent); - } catch (ex) { - return void 0; - } -} -function loadApi() { - if (typeof window === "undefined") { - return installApi({}); - } - const win = window; - const existingApi = findUpApi(win); - win[storageKey] = installApi(existingApi !== null && existingApi !== void 0 ? existingApi : {}); - return win[storageKey]; -} -var { awsuiPlugins, awsuiPluginsInternal } = loadApi(); -function installApi(api) { - var _a2, _b; - (_a2 = api.awsuiPlugins) !== null && _a2 !== void 0 ? _a2 : api.awsuiPlugins = {}; - (_b = api.awsuiPluginsInternal) !== null && _b !== void 0 ? _b : api.awsuiPluginsInternal = {}; - const appLayoutDrawers = new DrawersController(); - api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout); - api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout); - const alertActions = new ActionButtonsController(); - api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert); - api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert); - const flashbarActions = new ActionButtonsController(); - api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar); - api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar); - return api; -} - -// node_modules/@cloudscape-design/components/alert/actions-wrapper/index.js -var import_react28 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/alert/actions-wrapper/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/alert/actions-wrapper/styles.scoped.css"; -var styles_css_default7 = { - "root": "awsui_root_37gf8_14wux_9" -}; - -// node_modules/@cloudscape-design/components/alert/actions-wrapper/index.js -function createActionButton(testUtilClasses, action, buttonText, onButtonClick) { - if (!action && buttonText) { - action = import_react28.default.createElement(internal_default2, { className: testUtilClasses.actionButton, onClick: onButtonClick, formAction: "none" }, buttonText); - } - return action ? import_react28.default.createElement("div", { className: testUtilClasses.actionSlot }, action) : null; -} -function ActionsWrapper({ className: className2, testUtilClasses, action, discoveredActions, buttonText, onButtonClick }) { - const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick); - if (!actionButton && discoveredActions.length === 0) { - return null; - } - return import_react28.default.createElement( - "div", - { className: clsx_m_default(styles_css_default7.root, className2) }, - actionButton, - discoveredActions - ); -} - -// node_modules/@cloudscape-design/components/alert/internal.js -var typeToIcon = { - error: "status-negative", - warning: "status-warning", - success: "status-positive", - info: "status-info" -}; -var useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered); -var InternalAlert = import_react29.default.forwardRef((_a2, ref) => { - var { type, statusIconAriaLabel, visible = true, dismissible, dismissAriaLabel, children: children2, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null } = _a2, rest = __rest(_a2, ["type", "statusIconAriaLabel", "visible", "dismissible", "dismissAriaLabel", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const i18n = useInternalI18n("alert"); - const focusRef = (0, import_react29.useRef)(null); - useForwardFocus(ref, focusRef); - const [breakpoint, breakpointRef] = useContainerBreakpoints(["xs"]); - const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); - const isRefresh = useVisualRefresh(); - const size2 = isRefresh ? "normal" : header && children2 ? "big" : "normal"; - const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type); - const hasAction = Boolean(action || buttonText || discoveredActions.length); - const analyticsAttributes = { - [DATA_ATTR_ANALYTICS_ALERT]: type - }; - return import_react29.default.createElement( - "div", - Object.assign({}, baseProps, analyticsAttributes, { "aria-hidden": !visible, className: clsx_m_default(styles_css_default6.root, { [styles_css_default6.hidden]: !visible }, baseProps.className), ref: mergedRef }), - import_react29.default.createElement( - LinkDefaultVariantContext.Provider, - { value: { defaultVariant: "primary" } }, - import_react29.default.createElement( - VisualContext, - { contextName: "alert" }, - import_react29.default.createElement( - "div", - { className: clsx_m_default(styles_css_default6.alert, styles_css_default6[`type-${type}`], styles_css_default6[`icon-size-${size2}`], hasAction && styles_css_default6["with-action"], dismissible && styles_css_default6["with-dismiss"], styles_css_default6[`breakpoint-${breakpoint}`]) }, - import_react29.default.createElement( - "div", - { className: styles_css_default6["alert-focus-wrapper"], tabIndex: -1, ref: focusRef }, - import_react29.default.createElement( - "div", - { className: clsx_m_default(styles_css_default6.icon, styles_css_default6.text), role: "img", "aria-label": statusIconAriaLabel }, - import_react29.default.createElement(internal_default, { name: typeToIcon[type], size: size2 }) - ), - import_react29.default.createElement( - "div", - { className: clsx_m_default(styles_css_default6.message, styles_css_default6.text) }, - header && import_react29.default.createElement("div", { className: styles_css_default6.header, ref: headerRef }, header), - import_react29.default.createElement("div", { className: styles_css_default6.content, ref: contentRef }, children2) - ) - ), - import_react29.default.createElement(ActionsWrapper, { className: styles_css_default6.action, testUtilClasses: { - actionSlot: styles_css_default6["action-slot"], - actionButton: styles_css_default6["action-button"] - }, action, discoveredActions, buttonText, onButtonClick: () => fireNonCancelableEvent(onButtonClick) }), - dismissible && import_react29.default.createElement( - "div", - { className: styles_css_default6.dismiss }, - import_react29.default.createElement(InternalButton, { className: styles_css_default6["dismiss-button"], variant: "icon", iconName: "close", formAction: "none", ariaLabel: i18n("dismissAriaLabel", dismissAriaLabel), onClick: () => fireNonCancelableEvent(onDismiss) }) - ) - ) - ) - ) - ); -}); -var internal_default3 = InternalAlert; - -// node_modules/@cloudscape-design/components/internal/hooks/use-telemetry/index.js -function useTelemetry(componentName3, config) { - const theme2 = useVisualRefresh() ? "vr" : THEME; - useComponentMetrics(componentName3, { packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme: theme2 }, config); -} - -// node_modules/@cloudscape-design/components/internal/hooks/focus-visible/index.js -var import_react30 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/keycode.js -var KeyCode; -(function(KeyCode2) { - KeyCode2[KeyCode2["pageUp"] = 33] = "pageUp"; - KeyCode2[KeyCode2["pageDown"] = 34] = "pageDown"; - KeyCode2[KeyCode2["end"] = 35] = "end"; - KeyCode2[KeyCode2["home"] = 36] = "home"; - KeyCode2[KeyCode2["backspace"] = 8] = "backspace"; - KeyCode2[KeyCode2["space"] = 32] = "space"; - KeyCode2[KeyCode2["down"] = 40] = "down"; - KeyCode2[KeyCode2["left"] = 37] = "left"; - KeyCode2[KeyCode2["right"] = 39] = "right"; - KeyCode2[KeyCode2["up"] = 38] = "up"; - KeyCode2[KeyCode2["escape"] = 27] = "escape"; - KeyCode2[KeyCode2["enter"] = 13] = "enter"; - KeyCode2[KeyCode2["tab"] = 9] = "tab"; - KeyCode2[KeyCode2["shift"] = 16] = "shift"; - KeyCode2[KeyCode2["control"] = 17] = "control"; - KeyCode2[KeyCode2["alt"] = 18] = "alt"; - KeyCode2[KeyCode2["meta"] = 91] = "meta"; -})(KeyCode || (KeyCode = {})); - -// node_modules/@cloudscape-design/components/internal/hooks/focus-visible/index.js -function isModifierKey(event) { - return [KeyCode.shift, KeyCode.alt, KeyCode.control, KeyCode.meta].indexOf(event.keyCode) > -1; -} -function setIsKeyboard(active) { - if (active) { - document.body.setAttribute("data-awsui-focus-visible", "true"); - } else { - document.body.removeAttribute("data-awsui-focus-visible"); - } -} -function handleMousedown() { - return setIsKeyboard(false); -} -function handleKeydown(event) { - if (!isModifierKey(event)) { - setIsKeyboard(true); - } -} -var componentsCount = 0; -function addListeners() { - document.addEventListener("mousedown", handleMousedown); - document.addEventListener("keydown", handleKeydown); -} -function removeListeners() { - document.removeEventListener("mousedown", handleMousedown); - document.removeEventListener("keydown", handleKeydown); -} -function useFocusVisible() { - (0, import_react30.useEffect)(() => { - if (componentsCount === 0) { - addListeners(); - } - componentsCount++; - return () => { - componentsCount--; - if (componentsCount === 0) { - removeListeners(); - } - }; - }, []); -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-base-component/index.js -function useBaseComponent(componentName3, config, analyticsMetadata) { - useTelemetry(componentName3, config); - useFocusVisible(); - const elementRef = useComponentMetadata(componentName3, PACKAGE_VERSION, Object.assign({}, analyticsMetadata)); - return { __internalRootRef: elementRef }; -} - -// node_modules/@cloudscape-design/components/alert/index.js -var Alert = import_react31.default.forwardRef((_a2, ref) => { - var { type = "info", visible = true } = _a2, props2 = __rest(_a2, ["type", "visible"]); - const analyticsMetadata = getAnalyticsMetadataProps(props2); - const baseComponentProps = useBaseComponent("Alert", { - props: { type, visible, dismissible: props2.dismissible } - }, analyticsMetadata); - const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel(); - const { stepNumber, stepNameSelector } = useFunnelStep(); - const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); - (0, import_react31.useEffect)(() => { - var _a3, _b, _c; - if (funnelInteractionId && visible && type === "error" && funnelState.current !== "complete") { - const stepName = getNameFromSelector(stepNameSelector); - const subStepName = getNameFromSelector(subStepNameSelector); - errorCount.current++; - const errorIsVisible = ((_c = (_b = (_a3 = baseComponentProps.__internalRootRef.current) === null || _a3 === void 0 ? void 0 : _a3.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 0) > 0; - if (errorIsVisible) { - if (subStepSelector) { - FunnelMetrics.funnelSubStepError({ - funnelInteractionId, - subStepSelector, - subStepName, - subStepNameSelector, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector(), - instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, - errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext - }); - } else { - FunnelMetrics.funnelError({ - funnelInteractionId - }); - } - } - return () => { - errorCount.current--; - }; - } - }, [funnelInteractionId, visible, submissionAttempt, errorCount]); - return import_react31.default.createElement(internal_default3, Object.assign({ type, visible }, props2, baseComponentProps, { ref })); -}); -applyDisplayName(Alert, "Alert"); -var alert_default = Alert; - -// node_modules/@cloudscape-design/components/anchor-navigation/index.js -var import_react34 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/anchor-navigation/internal.js -var import_react33 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/anchor-navigation/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/anchor-navigation/styles.scoped.css"; -var styles_css_default8 = { - "root": "awsui_root_swimc_yjm0c_99", - "anchor-list": "awsui_anchor-list_swimc_yjm0c_134", - "anchor-item": "awsui_anchor-item_swimc_yjm0c_157", - "anchor-item--active": "awsui_anchor-item--active_swimc_yjm0c_177", - "anchor-link": "awsui_anchor-link_swimc_yjm0c_194", - "anchor-link--active": "awsui_anchor-link--active_swimc_yjm0c_236", - "anchor-link-text": "awsui_anchor-link-text_swimc_yjm0c_243", - "anchor-link-info": "awsui_anchor-link-info_swimc_yjm0c_247" -}; - -// node_modules/@cloudscape-design/components/anchor-navigation/test-classes/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/anchor-navigation/test-classes/styles.scoped.css"; -var styles_css_default9 = { - "root": "awsui_root_17oho_5eh15_5", - "anchor-list": "awsui_anchor-list_17oho_5eh15_9", - "anchor-item--active": "awsui_anchor-item--active_17oho_5eh15_13", - "anchor-link": "awsui_anchor-link_17oho_5eh15_17", - "anchor-link-text": "awsui_anchor-link-text_17oho_5eh15_21", - "anchor-link-info": "awsui_anchor-link-info_17oho_5eh15_25" -}; - -// node_modules/@cloudscape-design/components/anchor-navigation/use-scroll-spy.js -var import_react32 = __toESM(require_react()); -var isBrowser = typeof window !== "undefined"; -function useScrollSpy({ hrefs, scrollSpyOffset, activeHref }) { - const [currentHref, setCurrentHref] = (0, import_react32.useState)(activeHref); - const [lastAnchorExists, setLastAnchorExists] = (0, import_react32.useState)(false); - (0, import_react32.useEffect)(() => { - setCurrentHref(activeHref); - }, [activeHref]); - (0, import_react32.useEffect)(() => { - var _a2; - setLastAnchorExists(isBrowser && !!document.getElementById((_a2 = hrefs[hrefs.length - 1]) === null || _a2 === void 0 ? void 0 : _a2.slice(1))); - }, [hrefs]); - const getRectByHref = (0, import_react32.useCallback)((href) => { - var _a2; - return (_a2 = document.getElementById(href.slice(1))) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect(); - }, []); - const isPageBottom = (0, import_react32.useCallback)(() => { - return lastAnchorExists && Math.ceil(window.scrollY) >= Math.floor(document.body.scrollHeight - window.innerHeight); - }, [lastAnchorExists]); - const findHrefInView = (0, import_react32.useCallback)(() => { - return hrefs.find((href) => { - const rect = getRectByHref(href); - return rect && rect.bottom <= window.innerHeight && rect.top >= scrollSpyOffset; - }); - }, [getRectByHref, scrollSpyOffset, hrefs]); - const findLastHrefInView = (0, import_react32.useCallback)(() => { - return [...hrefs].reverse().find((href) => { - const rect = getRectByHref(href); - return rect && rect.bottom <= window.innerHeight; - }); - }, [getRectByHref, hrefs]); - const handleScroll = (0, import_react32.useCallback)(() => { - if (activeHref || !isBrowser) { - return; - } - const { scrollY } = window; - if (document.body.scrollHeight > window.innerHeight && isPageBottom()) { - setCurrentHref(hrefs[hrefs.length - 1]); - } else { - setCurrentHref(findHrefInView() || (scrollY > 0 ? findLastHrefInView() : void 0)); - } - }, [activeHref, isPageBottom, findHrefInView, findLastHrefInView, hrefs]); - (0, import_react32.useEffect)(() => { - if (isBrowser) { - handleScroll(); - window.addEventListener("scroll", handleScroll, { passive: true }); - return () => { - window.removeEventListener("scroll", handleScroll); - }; - } - }, [handleScroll]); - return currentHref; -} - -// node_modules/@cloudscape-design/components/anchor-navigation/internal.js -function InternalAnchorNavigation(_a2) { - var { anchors, ariaLabelledby, onFollow, onActiveHrefChange, activeHref = "", __internalRootRef = null, scrollSpyOffset = 0 } = _a2, props2 = __rest(_a2, ["anchors", "ariaLabelledby", "onFollow", "onActiveHrefChange", "activeHref", "__internalRootRef", "scrollSpyOffset"]); - const baseProps = getBaseProps(props2); - const hrefs = (0, import_react33.useMemo)(() => anchors.map((anchor) => anchor.href), [anchors]); - const onFollowHandler = (0, import_react33.useCallback)((anchor, sourceEvent) => { - fireCancelableEvent(onFollow, anchor, sourceEvent); - }, [onFollow]); - const currentActiveHref = useScrollSpy({ - hrefs, - scrollSpyOffset, - activeHref - }); - (0, import_react33.useEffect)(() => { - if (currentActiveHref) { - const newActiveAnchor = anchors.find((anchor) => anchor.href === currentActiveHref); - fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor); - } - }, [onActiveHrefChange, anchors, currentActiveHref]); - return import_react33.default.createElement( - "nav", - Object.assign({}, baseProps, { ref: __internalRootRef, "aria-labelledby": ariaLabelledby, className: clsx_m_default(baseProps.className, styles_css_default8.root, styles_css_default9.root) }), - import_react33.default.createElement("ol", { className: clsx_m_default(styles_css_default8["anchor-list"], styles_css_default9["anchor-list"]) }, anchors.map((anchor, index) => { - return import_react33.default.createElement(Anchor, { onFollow: onFollowHandler, isActive: anchor.href === currentActiveHref, key: index, index, anchor }); - })) - ); -} -var Anchor = ({ anchor, onFollow, isActive, index }) => { - checkSafeUrl("AnchorNavigation", anchor.href); - const onClick = (0, import_react33.useCallback)((event) => { - if (isPlainLeftClick(event)) { - onFollow(anchor, event); - } - }, [onFollow, anchor]); - const activeItemClasses = clsx_m_default(styles_css_default8["anchor-item--active"], styles_css_default9["anchor-item--active"]); - return import_react33.default.createElement( - "li", - { "data-itemid": `anchor-item-${index + 1}`, className: clsx_m_default(styles_css_default8["anchor-item"], isActive && activeItemClasses) }, - import_react33.default.createElement( - "a", - Object.assign({ onClick, className: clsx_m_default(styles_css_default8["anchor-link"], styles_css_default9["anchor-link"], isActive && styles_css_default8["anchor-link--active"]) }, isActive ? { "aria-current": true } : {}, { href: anchor.href }), - import_react33.default.createElement("span", { className: clsx_m_default(styles_css_default8["anchor-link-text"], styles_css_default9["anchor-link-text"]), style: { paddingInlineStart: `${anchor.level * 16 + 2}px` } }, anchor.text), - anchor.info && import_react33.default.createElement("span", { className: clsx_m_default(styles_css_default8["anchor-link-info"], styles_css_default9["anchor-link-info"]) }, anchor.info) - ) - ); -}; - -// node_modules/@cloudscape-design/components/anchor-navigation/index.js -function AnchorNavigation(_a2) { - var { scrollSpyOffset = 0 } = _a2, props2 = __rest(_a2, ["scrollSpyOffset"]); - const baseComponentProps = useBaseComponent("AnchorNavigation"); - return import_react34.default.createElement(InternalAnchorNavigation, Object.assign({ scrollSpyOffset }, props2, baseComponentProps)); -} -applyDisplayName(AnchorNavigation, "AnchorNavigation"); - -// node_modules/@cloudscape-design/components/annotation-context/index.js -var import_react48 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/annotation-context/annotation/open-annotation.js -var import_react45 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-trigger.js -var import_react36 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/annotation-context/annotation/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/annotation-context/annotation/styles.scoped.css"; -var styles_css_default10 = { - "arrow": "awsui_arrow_1hpp3_10w1c_99", - "arrow-outer": "awsui_arrow-outer_1hpp3_10w1c_103", - "arrow-inner": "awsui_arrow-inner_1hpp3_10w1c_103", - "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_10w1c_144", - "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_10w1c_144", - "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_10w1c_147", - "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_10w1c_147", - "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_10w1c_150", - "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_10w1c_150", - "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_10w1c_153", - "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_10w1c_153", - "annotation": "awsui_annotation_1hpp3_10w1c_161", - "next-button": "awsui_next-button_1hpp3_10w1c_162", - "previous-button": "awsui_previous-button_1hpp3_10w1c_163", - "finish-button": "awsui_finish-button_1hpp3_10w1c_164", - "header": "awsui_header_1hpp3_10w1c_165", - "step-counter-content": "awsui_step-counter-content_1hpp3_10w1c_166", - "content": "awsui_content_1hpp3_10w1c_167", - "description": "awsui_description_1hpp3_10w1c_171", - "actionBar": "awsui_actionBar_1hpp3_10w1c_176", - "stepCounter": "awsui_stepCounter_1hpp3_10w1c_183", - "divider": "awsui_divider_1hpp3_10w1c_187", - "hotspot": "awsui_hotspot_1hpp3_10w1c_191", - "icon": "awsui_icon_1hpp3_10w1c_258" -}; - -// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-icon.js -var import_react35 = __toESM(require_react()); -var AnnotationIcon = ({ open }) => { - if (open) { - return import_react35.default.createElement( - "svg", - { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", focusable: "false", "aria-hidden": "true", className: styles_css_default10.icon }, - import_react35.default.createElement( - "g", - { fill: "none", fillRule: "evenodd", transform: "translate(1 1)" }, - import_react35.default.createElement("circle", { cx: "7", cy: "7", r: "7", strokeWidth: "2" }), - import_react35.default.createElement("path", { strokeLinecap: "square", strokeWidth: "2.2", d: "M2.5,-1 L2.5,3", transform: "rotate(90 1.75 6.25)" }) - ) - ); - } else { - return import_react35.default.createElement( - "svg", - { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", focusable: "false", "aria-hidden": "true", className: styles_css_default10.icon }, - import_react35.default.createElement( - "g", - { fill: "none", fillRule: "evenodd", transform: "translate(1 1)" }, - import_react35.default.createElement("circle", { cx: "7", cy: "7", r: "7", strokeWidth: "2" }), - import_react35.default.createElement( - "g", - { strokeLinecap: "square", strokeWidth: "2.2", transform: "translate(4.5 5)" }, - import_react35.default.createElement("path", { d: "M2.5,0 L2.5,4", transform: "rotate(90 2.5 2)" }), - import_react35.default.createElement("path", { d: "M2.5,0 L2.5,4" }) - ) - ) - ); - } -}; - -// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-trigger.js -var annotation_trigger_default = import_react36.default.forwardRef(function AnnotationTrigger({ open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }, ref) { - const onClick = (0, import_react36.useCallback)((event) => { - event.preventDefault(); - onClickHandler(); - }, [onClickHandler]); - return import_react36.default.createElement( - "button", - { ref, className: styles_css_default10.hotspot, "aria-haspopup": "dialog", "aria-label": i18nStrings.labelHotspot(open, taskLocalStepIndex !== null && taskLocalStepIndex !== void 0 ? taskLocalStepIndex : 0, totalLocalSteps !== null && totalLocalSteps !== void 0 ? totalLocalSteps : 0), onClick }, - import_react36.default.createElement(AnnotationIcon, { open }) - ); -}); - -// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-popover.js -var import_react44 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/box/internal.js -var import_react37 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/box/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/box/styles.scoped.css"; -var styles_css_default11 = { - "root": "awsui_root_18wu0_1elzt_99", - "box": "awsui_box_18wu0_1elzt_219", - "p-variant": "awsui_p-variant_18wu0_1elzt_219", - "color-default": "awsui_color-default_18wu0_1elzt_219", - "b-variant": "awsui_b-variant_18wu0_1elzt_219", - "strong-variant": "awsui_strong-variant_18wu0_1elzt_219", - "code-variant": "awsui_code-variant_18wu0_1elzt_219", - "pre-variant": "awsui_pre-variant_18wu0_1elzt_219", - "samp-variant": "awsui_samp-variant_18wu0_1elzt_219", - "h1-variant": "awsui_h1-variant_18wu0_1elzt_223", - "h2-variant": "awsui_h2-variant_18wu0_1elzt_223", - "h3-variant": "awsui_h3-variant_18wu0_1elzt_223", - "h4-variant": "awsui_h4-variant_18wu0_1elzt_223", - "h5-variant": "awsui_h5-variant_18wu0_1elzt_223", - "small-variant": "awsui_small-variant_18wu0_1elzt_227", - "a-variant": "awsui_a-variant_18wu0_1elzt_231", - "font-size-default": "awsui_font-size-default_18wu0_1elzt_235", - "font-weight-default": "awsui_font-weight-default_18wu0_1elzt_275", - "key-label-variant": "awsui_key-label-variant_18wu0_1elzt_317", - "gen-ai-label-variant": "awsui_gen-ai-label-variant_18wu0_1elzt_324", - "value-large-variant": "awsui_value-large-variant_18wu0_1elzt_331", - "font-weight-heavy": "awsui_font-weight-heavy_18wu0_1elzt_338", - "color-inverted": "awsui_color-inverted_18wu0_1elzt_343", - "color-text-label": "awsui_color-text-label_18wu0_1elzt_346", - "color-text-body-secondary": "awsui_color-text-body-secondary_18wu0_1elzt_349", - "color-text-status-error": "awsui_color-text-status-error_18wu0_1elzt_352", - "color-text-status-success": "awsui_color-text-status-success_18wu0_1elzt_355", - "color-text-status-info": "awsui_color-text-status-info_18wu0_1elzt_358", - "color-text-status-inactive": "awsui_color-text-status-inactive_18wu0_1elzt_361", - "color-text-status-warning": "awsui_color-text-status-warning_18wu0_1elzt_364", - "color-inherit": "awsui_color-inherit_18wu0_1elzt_367", - "font-size-body-s": "awsui_font-size-body-s_18wu0_1elzt_370", - "font-size-body-m": "awsui_font-size-body-m_18wu0_1elzt_375", - "font-size-heading-xs": "awsui_font-size-heading-xs_18wu0_1elzt_379", - "font-size-heading-s": "awsui_font-size-heading-s_18wu0_1elzt_383", - "font-size-heading-m": "awsui_font-size-heading-m_18wu0_1elzt_388", - "font-size-heading-l": "awsui_font-size-heading-l_18wu0_1elzt_393", - "font-size-heading-xl": "awsui_font-size-heading-xl_18wu0_1elzt_398", - "font-size-display-l": "awsui_font-size-display-l_18wu0_1elzt_403", - "font-weight-light": "awsui_font-weight-light_18wu0_1elzt_408", - "font-weight-normal": "awsui_font-weight-normal_18wu0_1elzt_411", - "font-weight-bold": "awsui_font-weight-bold_18wu0_1elzt_414", - "t-left": "awsui_t-left_18wu0_1elzt_421", - "t-right": "awsui_t-right_18wu0_1elzt_425", - "t-center": "awsui_t-center_18wu0_1elzt_429", - "p-n": "awsui_p-n_18wu0_1elzt_536", - "p-top-n": "awsui_p-top-n_18wu0_1elzt_541", - "p-vertical-n": "awsui_p-vertical-n_18wu0_1elzt_542", - "p-right-n": "awsui_p-right-n_18wu0_1elzt_546", - "p-horizontal-n": "awsui_p-horizontal-n_18wu0_1elzt_547", - "p-bottom-n": "awsui_p-bottom-n_18wu0_1elzt_551", - "p-left-n": "awsui_p-left-n_18wu0_1elzt_556", - "p-xxxs": "awsui_p-xxxs_18wu0_1elzt_561", - "p-top-xxxs": "awsui_p-top-xxxs_18wu0_1elzt_566", - "p-vertical-xxxs": "awsui_p-vertical-xxxs_18wu0_1elzt_567", - "p-right-xxxs": "awsui_p-right-xxxs_18wu0_1elzt_571", - "p-horizontal-xxxs": "awsui_p-horizontal-xxxs_18wu0_1elzt_572", - "p-bottom-xxxs": "awsui_p-bottom-xxxs_18wu0_1elzt_576", - "p-left-xxxs": "awsui_p-left-xxxs_18wu0_1elzt_581", - "p-xxs": "awsui_p-xxs_18wu0_1elzt_586", - "p-top-xxs": "awsui_p-top-xxs_18wu0_1elzt_591", - "p-vertical-xxs": "awsui_p-vertical-xxs_18wu0_1elzt_592", - "p-right-xxs": "awsui_p-right-xxs_18wu0_1elzt_596", - "p-horizontal-xxs": "awsui_p-horizontal-xxs_18wu0_1elzt_597", - "p-bottom-xxs": "awsui_p-bottom-xxs_18wu0_1elzt_601", - "p-left-xxs": "awsui_p-left-xxs_18wu0_1elzt_606", - "p-xs": "awsui_p-xs_18wu0_1elzt_611", - "p-top-xs": "awsui_p-top-xs_18wu0_1elzt_616", - "p-vertical-xs": "awsui_p-vertical-xs_18wu0_1elzt_617", - "p-right-xs": "awsui_p-right-xs_18wu0_1elzt_621", - "p-horizontal-xs": "awsui_p-horizontal-xs_18wu0_1elzt_622", - "p-bottom-xs": "awsui_p-bottom-xs_18wu0_1elzt_626", - "p-left-xs": "awsui_p-left-xs_18wu0_1elzt_631", - "p-s": "awsui_p-s_18wu0_1elzt_636", - "p-top-s": "awsui_p-top-s_18wu0_1elzt_641", - "p-vertical-s": "awsui_p-vertical-s_18wu0_1elzt_642", - "p-right-s": "awsui_p-right-s_18wu0_1elzt_646", - "p-horizontal-s": "awsui_p-horizontal-s_18wu0_1elzt_647", - "p-bottom-s": "awsui_p-bottom-s_18wu0_1elzt_651", - "p-left-s": "awsui_p-left-s_18wu0_1elzt_656", - "p-m": "awsui_p-m_18wu0_1elzt_661", - "p-top-m": "awsui_p-top-m_18wu0_1elzt_666", - "p-vertical-m": "awsui_p-vertical-m_18wu0_1elzt_667", - "p-right-m": "awsui_p-right-m_18wu0_1elzt_671", - "p-horizontal-m": "awsui_p-horizontal-m_18wu0_1elzt_672", - "p-bottom-m": "awsui_p-bottom-m_18wu0_1elzt_676", - "p-left-m": "awsui_p-left-m_18wu0_1elzt_681", - "p-l": "awsui_p-l_18wu0_1elzt_556", - "p-top-l": "awsui_p-top-l_18wu0_1elzt_691", - "p-vertical-l": "awsui_p-vertical-l_18wu0_1elzt_692", - "p-right-l": "awsui_p-right-l_18wu0_1elzt_696", - "p-horizontal-l": "awsui_p-horizontal-l_18wu0_1elzt_697", - "p-bottom-l": "awsui_p-bottom-l_18wu0_1elzt_701", - "p-left-l": "awsui_p-left-l_18wu0_1elzt_706", - "p-xl": "awsui_p-xl_18wu0_1elzt_711", - "p-top-xl": "awsui_p-top-xl_18wu0_1elzt_716", - "p-vertical-xl": "awsui_p-vertical-xl_18wu0_1elzt_717", - "p-right-xl": "awsui_p-right-xl_18wu0_1elzt_721", - "p-horizontal-xl": "awsui_p-horizontal-xl_18wu0_1elzt_722", - "p-bottom-xl": "awsui_p-bottom-xl_18wu0_1elzt_726", - "p-left-xl": "awsui_p-left-xl_18wu0_1elzt_731", - "p-xxl": "awsui_p-xxl_18wu0_1elzt_736", - "p-top-xxl": "awsui_p-top-xxl_18wu0_1elzt_741", - "p-vertical-xxl": "awsui_p-vertical-xxl_18wu0_1elzt_742", - "p-right-xxl": "awsui_p-right-xxl_18wu0_1elzt_746", - "p-horizontal-xxl": "awsui_p-horizontal-xxl_18wu0_1elzt_747", - "p-bottom-xxl": "awsui_p-bottom-xxl_18wu0_1elzt_751", - "p-left-xxl": "awsui_p-left-xxl_18wu0_1elzt_756", - "p-xxxl": "awsui_p-xxxl_18wu0_1elzt_761", - "p-top-xxxl": "awsui_p-top-xxxl_18wu0_1elzt_766", - "p-vertical-xxxl": "awsui_p-vertical-xxxl_18wu0_1elzt_767", - "p-right-xxxl": "awsui_p-right-xxxl_18wu0_1elzt_771", - "p-horizontal-xxxl": "awsui_p-horizontal-xxxl_18wu0_1elzt_772", - "p-bottom-xxxl": "awsui_p-bottom-xxxl_18wu0_1elzt_776", - "p-left-xxxl": "awsui_p-left-xxxl_18wu0_1elzt_781", - "m-n": "awsui_m-n_18wu0_1elzt_786", - "m-top-n": "awsui_m-top-n_18wu0_1elzt_791", - "m-vertical-n": "awsui_m-vertical-n_18wu0_1elzt_792", - "m-right-n": "awsui_m-right-n_18wu0_1elzt_796", - "m-horizontal-n": "awsui_m-horizontal-n_18wu0_1elzt_797", - "m-bottom-n": "awsui_m-bottom-n_18wu0_1elzt_801", - "m-left-n": "awsui_m-left-n_18wu0_1elzt_806", - "m-xxxs": "awsui_m-xxxs_18wu0_1elzt_811", - "m-top-xxxs": "awsui_m-top-xxxs_18wu0_1elzt_816", - "m-vertical-xxxs": "awsui_m-vertical-xxxs_18wu0_1elzt_817", - "m-right-xxxs": "awsui_m-right-xxxs_18wu0_1elzt_821", - "m-horizontal-xxxs": "awsui_m-horizontal-xxxs_18wu0_1elzt_822", - "m-bottom-xxxs": "awsui_m-bottom-xxxs_18wu0_1elzt_826", - "m-left-xxxs": "awsui_m-left-xxxs_18wu0_1elzt_831", - "m-xxs": "awsui_m-xxs_18wu0_1elzt_836", - "m-top-xxs": "awsui_m-top-xxs_18wu0_1elzt_841", - "m-vertical-xxs": "awsui_m-vertical-xxs_18wu0_1elzt_842", - "m-right-xxs": "awsui_m-right-xxs_18wu0_1elzt_846", - "m-horizontal-xxs": "awsui_m-horizontal-xxs_18wu0_1elzt_847", - "m-bottom-xxs": "awsui_m-bottom-xxs_18wu0_1elzt_851", - "m-left-xxs": "awsui_m-left-xxs_18wu0_1elzt_856", - "m-xs": "awsui_m-xs_18wu0_1elzt_861", - "m-top-xs": "awsui_m-top-xs_18wu0_1elzt_866", - "m-vertical-xs": "awsui_m-vertical-xs_18wu0_1elzt_867", - "m-right-xs": "awsui_m-right-xs_18wu0_1elzt_871", - "m-horizontal-xs": "awsui_m-horizontal-xs_18wu0_1elzt_872", - "m-bottom-xs": "awsui_m-bottom-xs_18wu0_1elzt_876", - "m-left-xs": "awsui_m-left-xs_18wu0_1elzt_881", - "m-s": "awsui_m-s_18wu0_1elzt_886", - "m-top-s": "awsui_m-top-s_18wu0_1elzt_891", - "m-vertical-s": "awsui_m-vertical-s_18wu0_1elzt_892", - "m-right-s": "awsui_m-right-s_18wu0_1elzt_896", - "m-horizontal-s": "awsui_m-horizontal-s_18wu0_1elzt_897", - "m-bottom-s": "awsui_m-bottom-s_18wu0_1elzt_901", - "m-left-s": "awsui_m-left-s_18wu0_1elzt_906", - "m-m": "awsui_m-m_18wu0_1elzt_911", - "m-top-m": "awsui_m-top-m_18wu0_1elzt_916", - "m-vertical-m": "awsui_m-vertical-m_18wu0_1elzt_917", - "m-right-m": "awsui_m-right-m_18wu0_1elzt_921", - "m-horizontal-m": "awsui_m-horizontal-m_18wu0_1elzt_922", - "m-bottom-m": "awsui_m-bottom-m_18wu0_1elzt_926", - "m-left-m": "awsui_m-left-m_18wu0_1elzt_931", - "m-l": "awsui_m-l_18wu0_1elzt_806", - "m-top-l": "awsui_m-top-l_18wu0_1elzt_941", - "m-vertical-l": "awsui_m-vertical-l_18wu0_1elzt_942", - "m-right-l": "awsui_m-right-l_18wu0_1elzt_946", - "m-horizontal-l": "awsui_m-horizontal-l_18wu0_1elzt_947", - "m-bottom-l": "awsui_m-bottom-l_18wu0_1elzt_951", - "m-left-l": "awsui_m-left-l_18wu0_1elzt_956", - "m-xl": "awsui_m-xl_18wu0_1elzt_961", - "m-top-xl": "awsui_m-top-xl_18wu0_1elzt_966", - "m-vertical-xl": "awsui_m-vertical-xl_18wu0_1elzt_967", - "m-right-xl": "awsui_m-right-xl_18wu0_1elzt_971", - "m-horizontal-xl": "awsui_m-horizontal-xl_18wu0_1elzt_972", - "m-bottom-xl": "awsui_m-bottom-xl_18wu0_1elzt_976", - "m-left-xl": "awsui_m-left-xl_18wu0_1elzt_981", - "m-xxl": "awsui_m-xxl_18wu0_1elzt_986", - "m-top-xxl": "awsui_m-top-xxl_18wu0_1elzt_991", - "m-vertical-xxl": "awsui_m-vertical-xxl_18wu0_1elzt_992", - "m-right-xxl": "awsui_m-right-xxl_18wu0_1elzt_996", - "m-horizontal-xxl": "awsui_m-horizontal-xxl_18wu0_1elzt_997", - "m-bottom-xxl": "awsui_m-bottom-xxl_18wu0_1elzt_1001", - "m-left-xxl": "awsui_m-left-xxl_18wu0_1elzt_1006", - "m-xxxl": "awsui_m-xxxl_18wu0_1elzt_1011", - "m-top-xxxl": "awsui_m-top-xxxl_18wu0_1elzt_1016", - "m-vertical-xxxl": "awsui_m-vertical-xxxl_18wu0_1elzt_1017", - "m-right-xxxl": "awsui_m-right-xxxl_18wu0_1elzt_1021", - "m-horizontal-xxxl": "awsui_m-horizontal-xxxl_18wu0_1elzt_1022", - "m-bottom-xxxl": "awsui_m-bottom-xxxl_18wu0_1elzt_1026", - "m-left-xxxl": "awsui_m-left-xxxl_18wu0_1elzt_1031", - "d-block": "awsui_d-block_18wu0_1elzt_1036", - "d-inline": "awsui_d-inline_18wu0_1elzt_1039", - "d-inline-block": "awsui_d-inline-block_18wu0_1elzt_1042", - "d-none": "awsui_d-none_18wu0_1elzt_1045", - "f-left": "awsui_f-left_18wu0_1elzt_1049", - "f-right": "awsui_f-right_18wu0_1elzt_1053" -}; - -// node_modules/@cloudscape-design/components/box/internal.js -function InternalBox(_a2) { - var { variant = "div", tagOverride, margin = {}, padding = {}, display, textAlign, float, fontSize, fontWeight, color: color2, children: children2, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["variant", "tagOverride", "margin", "padding", "display", "textAlign", "float", "fontSize", "fontWeight", "color", "children", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const marginsClassNamesSuffices = getClassNamesSuffixes(margin); - const paddingsClassNamesSuffices = getClassNamesSuffixes(padding); - const Tag = getTag(variant, tagOverride); - const className2 = clsx_m_default(baseProps.className, styles_css_default11.root, styles_css_default11.box, styles_css_default11[`${variant.replace(/^awsui-/, "")}-variant`], marginsClassNamesSuffices.map((suffix) => styles_css_default11[`m-${suffix}`]), paddingsClassNamesSuffices.map((suffix) => styles_css_default11[`p-${suffix}`]), styles_css_default11[`d-${display}`], styles_css_default11[`f-${float}`], styles_css_default11[`color-${color2 || "default"}`], styles_css_default11[`font-size-${fontSize || "default"}`], styles_css_default11[`font-weight-${fontWeight || "default"}`], styles_css_default11[`t-${textAlign}`]); - return import_react37.default.createElement(Tag, Object.assign({}, baseProps, { className: className2, ref: __internalRootRef }), children2); -} -var getClassNamesSuffixes = (value) => { - if (typeof value === "string") { - return [value]; - } - const sides = ["top", "right", "bottom", "left", "horizontal", "vertical"]; - return sides.filter((side) => !!value[side]).map((side) => `${side}-${value[side]}`); -}; -var getTag = (variant, tagOverride) => { - if (tagOverride) { - return tagOverride; - } - if (variant === "awsui-value-large") { - return "span"; - } - if (variant === "awsui-key-label" || variant === "awsui-gen-ai-label") { - return "div"; - } - return variant; -}; - -// node_modules/@cloudscape-design/components/space-between/internal.js -var import_react38 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/space-between/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/space-between/styles.scoped.css"; -var styles_css_default12 = { - "root": "awsui_root_18582_z63vw_99", - "child": "awsui_child_18582_z63vw_103", - "horizontal": "awsui_horizontal_18582_z63vw_114", - "horizontal-xxxs": "awsui_horizontal-xxxs_18582_z63vw_118", - "horizontal-xxs": "awsui_horizontal-xxs_18582_z63vw_121", - "horizontal-xs": "awsui_horizontal-xs_18582_z63vw_124", - "horizontal-s": "awsui_horizontal-s_18582_z63vw_127", - "horizontal-m": "awsui_horizontal-m_18582_z63vw_130", - "horizontal-l": "awsui_horizontal-l_18582_z63vw_133", - "horizontal-xl": "awsui_horizontal-xl_18582_z63vw_136", - "horizontal-xxl": "awsui_horizontal-xxl_18582_z63vw_139", - "vertical": "awsui_vertical_18582_z63vw_146", - "vertical-xxxs": "awsui_vertical-xxxs_18582_z63vw_149", - "vertical-xxs": "awsui_vertical-xxs_18582_z63vw_152", - "vertical-xs": "awsui_vertical-xs_18582_z63vw_155", - "vertical-s": "awsui_vertical-s_18582_z63vw_158", - "vertical-m": "awsui_vertical-m_18582_z63vw_161", - "vertical-l": "awsui_vertical-l_18582_z63vw_164", - "vertical-xl": "awsui_vertical-xl_18582_z63vw_167", - "vertical-xxl": "awsui_vertical-xxl_18582_z63vw_170", - "align-center": "awsui_align-center_18582_z63vw_174", - "align-start": "awsui_align-start_18582_z63vw_178", - "align-end": "awsui_align-end_18582_z63vw_182" -}; - -// node_modules/@cloudscape-design/components/space-between/internal.js -var import_react_keyed_flatten_children = __toESM(require_react_keyed_flatten_children()); -function InternalSpaceBetween(_a2) { - var { direction = "vertical", size: size2, children: children2, alignItems, __internalRootRef } = _a2, props2 = __rest(_a2, ["direction", "size", "children", "alignItems", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const flattenedChildren = (0, import_react_keyed_flatten_children.default)(children2); - return import_react38.default.createElement("div", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default12.root, styles_css_default12[direction], styles_css_default12[`${direction}-${size2}`], alignItems && styles_css_default12[`align-${alignItems}`]), ref: __internalRootRef }), flattenedChildren.map((child) => { - const key2 = typeof child === "object" ? child.key : void 0; - return import_react38.default.createElement("div", { key: key2, className: styles_css_default12.child }, child); - })); -} - -// node_modules/@cloudscape-design/components/popover/container.js -var import_react40 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/popover/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/popover/styles.scoped.css"; -var styles_css_default13 = { - "arrow": "awsui_arrow_xjuzf_ov8et_197", - "arrow-outer": "awsui_arrow-outer_xjuzf_ov8et_201", - "arrow-inner": "awsui_arrow-inner_xjuzf_ov8et_201", - "refresh": "awsui_refresh_xjuzf_ov8et_235", - "arrow-position-right-top": "awsui_arrow-position-right-top_xjuzf_ov8et_245", - "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_xjuzf_ov8et_245", - "arrow-position-left-top": "awsui_arrow-position-left-top_xjuzf_ov8et_248", - "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_xjuzf_ov8et_248", - "arrow-position-top-center": "awsui_arrow-position-top-center_xjuzf_ov8et_251", - "arrow-position-top-right": "awsui_arrow-position-top-right_xjuzf_ov8et_251", - "arrow-position-top-left": "awsui_arrow-position-top-left_xjuzf_ov8et_251", - "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_xjuzf_ov8et_251", - "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_xjuzf_ov8et_254", - "arrow-position-bottom-right": "awsui_arrow-position-bottom-right_xjuzf_ov8et_254", - "arrow-position-bottom-left": "awsui_arrow-position-bottom-left_xjuzf_ov8et_254", - "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_xjuzf_ov8et_254", - "body": "awsui_body_xjuzf_ov8et_356", - "body-overflow-visible": "awsui_body-overflow-visible_xjuzf_ov8et_395", - "has-dismiss": "awsui_has-dismiss_xjuzf_ov8et_399", - "dismiss": "awsui_dismiss_xjuzf_ov8et_404", - "dismiss-control": "awsui_dismiss-control_xjuzf_ov8et_412", - "header-row": "awsui_header-row_xjuzf_ov8et_416", - "header": "awsui_header_xjuzf_ov8et_416", - "content": "awsui_content_xjuzf_ov8et_442", - "content-overflow-visible": "awsui_content-overflow-visible_xjuzf_ov8et_450", - "container": "awsui_container_xjuzf_ov8et_552", - "container-body": "awsui_container-body_xjuzf_ov8et_560", - "container-body-variant-annotation": "awsui_container-body-variant-annotation_xjuzf_ov8et_603", - "container-body-size-small": "awsui_container-body-size-small_xjuzf_ov8et_608", - "fixed-width": "awsui_fixed-width_xjuzf_ov8et_611", - "container-body-size-medium": "awsui_container-body-size-medium_xjuzf_ov8et_615", - "container-body-size-large": "awsui_container-body-size-large_xjuzf_ov8et_622", - "container-arrow": "awsui_container-arrow_xjuzf_ov8et_634", - "container-arrow-position-right-top": "awsui_container-arrow-position-right-top_xjuzf_ov8et_638", - "container-arrow-position-right-bottom": "awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638", - "container-arrow-position-left-top": "awsui_container-arrow-position-left-top_xjuzf_ov8et_654", - "container-arrow-position-left-bottom": "awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654", - "container-arrow-position-top-center": "awsui_container-arrow-position-top-center_xjuzf_ov8et_670", - "container-arrow-position-top-right": "awsui_container-arrow-position-top-right_xjuzf_ov8et_670", - "container-arrow-position-top-left": "awsui_container-arrow-position-top-left_xjuzf_ov8et_670", - "container-arrow-position-top-responsive": "awsui_container-arrow-position-top-responsive_xjuzf_ov8et_670", - "container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-center_xjuzf_ov8et_686", - "container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-right_xjuzf_ov8et_690", - "container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-left_xjuzf_ov8et_694", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_xjuzf_ov8et_1", - "root": "awsui_root_xjuzf_ov8et_840", - "trigger": "awsui_trigger_xjuzf_ov8et_876", - "trigger-type-text": "awsui_trigger-type-text_xjuzf_ov8et_883", - "trigger-inner-text": "awsui_trigger-inner-text_xjuzf_ov8et_918", - "popover-inline-content": "awsui_popover-inline-content_xjuzf_ov8et_922" -}; - -// node_modules/@cloudscape-design/components/popover/use-popover-position.js -var import_react39 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/popover/utils/positions.js -var ARROW_OFFSET = 12; -var PRIORITY_MAPPING = { - top: [ - "top-center", - "top-right", - "top-left", - "bottom-center", - "bottom-right", - "bottom-left", - "right-top", - "right-bottom", - "left-top", - "left-bottom" - ], - bottom: [ - "bottom-center", - "bottom-right", - "bottom-left", - "top-center", - "top-right", - "top-left", - "right-top", - "right-bottom", - "left-top", - "left-bottom" - ], - left: [ - "left-top", - "left-bottom", - "right-top", - "right-bottom", - "bottom-center", - "top-center", - "bottom-left", - "top-left", - "bottom-right", - "top-right" - ], - right: [ - "right-top", - "right-bottom", - "left-top", - "left-bottom", - "bottom-center", - "top-center", - "bottom-right", - "top-right", - "bottom-left", - "top-left" - ] -}; -var RECTANGLE_CALCULATIONS = { - "top-center": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart - body.blockSize - arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 - body.inlineSize / 2, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "top-right": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart - body.blockSize - arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 - ARROW_OFFSET - arrow2.inlineSize / 2, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "top-left": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart - body.blockSize - arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 + ARROW_OFFSET + arrow2.inlineSize / 2 - body.inlineSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "bottom-center": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize + arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 - body.inlineSize / 2, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "bottom-right": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize + arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 - ARROW_OFFSET - arrow2.inlineSize / 2, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "bottom-left": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize + arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize / 2 + ARROW_OFFSET + arrow2.inlineSize / 2 - body.inlineSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "right-top": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize / 2 - ARROW_OFFSET - arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize + arrow2.blockSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "right-bottom": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart + trigger2.inlineSize + arrow2.blockSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "left-top": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize / 2 - ARROW_OFFSET - arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart - body.inlineSize - arrow2.blockSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - }, - "left-bottom": ({ body, trigger: trigger2, arrow: arrow2 }) => { - return { - insetBlockStart: trigger2.insetBlockStart + trigger2.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow2.blockSize, - insetInlineStart: trigger2.insetInlineStart - body.inlineSize - arrow2.blockSize, - inlineSize: body.inlineSize, - blockSize: body.blockSize - }; - } -}; -function fitIntoContainer(inner, outer) { - let { insetInlineStart, inlineSize, insetBlockStart, blockSize } = inner; - if (insetInlineStart < outer.insetInlineStart) { - inlineSize = insetInlineStart + inlineSize - outer.insetInlineStart; - insetInlineStart = outer.insetInlineStart; - } else if (insetInlineStart + inlineSize > outer.insetInlineStart + outer.inlineSize) { - inlineSize = outer.insetInlineStart + outer.inlineSize - insetInlineStart; - } - if (insetBlockStart < outer.insetBlockStart) { - blockSize = insetBlockStart + blockSize - outer.insetBlockStart; - insetBlockStart = outer.insetBlockStart; - } else if (insetBlockStart + blockSize > outer.insetBlockStart + outer.blockSize) { - blockSize = outer.insetBlockStart + outer.blockSize - insetBlockStart; - } - return { insetInlineStart, inlineSize, insetBlockStart, blockSize }; -} -function getTallestRect(rect1, rect2) { - return rect1.blockSize >= rect2.blockSize ? rect1 : rect2; -} -function getIntersection(rectangles) { - let boundingBox = null; - for (const currentRect of rectangles) { - if (!boundingBox) { - boundingBox = currentRect; - continue; - } - const insetInlineStart = Math.max(boundingBox.insetInlineStart, currentRect.insetInlineStart); - const insetBlockStart = Math.max(boundingBox.insetBlockStart, currentRect.insetBlockStart); - const insetInlineEnd = Math.min(boundingBox.insetInlineStart + boundingBox.inlineSize, currentRect.insetInlineStart + currentRect.inlineSize); - const insetBlockEnd = Math.min(boundingBox.insetBlockStart + boundingBox.blockSize, currentRect.insetBlockStart + currentRect.blockSize); - if (insetInlineEnd < insetInlineStart || insetBlockEnd < insetBlockStart) { - return null; - } - boundingBox = { - insetInlineStart, - insetBlockStart, - inlineSize: insetInlineEnd - insetInlineStart, - blockSize: insetBlockEnd - insetBlockStart - }; - } - return boundingBox; -} -function calculatePosition({ - preferredPosition, - fixedInternalPosition, - trigger: trigger2, - arrow: arrow2, - body, - container, - viewport, - // the popover is only bound by the viewport if it is rendered in a portal - renderWithPortal, - allowVerticalOverflow -}) { - let bestOption = null; - const preferredInternalPositions = fixedInternalPosition ? [fixedInternalPosition] : PRIORITY_MAPPING[preferredPosition]; - for (const internalPosition2 of preferredInternalPositions) { - const rect2 = RECTANGLE_CALCULATIONS[internalPosition2]({ body, trigger: trigger2, arrow: arrow2 }); - const visibleArea = renderWithPortal ? getIntersection([rect2, viewport]) : getIntersection([rect2, viewport, container]); - const fitsWithoutOverflow = visibleArea && visibleArea.inlineSize === body.inlineSize && visibleArea.blockSize === body.blockSize; - if (fitsWithoutOverflow) { - return { internalPosition: internalPosition2, rect: rect2 }; - } - const newOption = { rect: rect2, internalPosition: internalPosition2, visibleArea }; - bestOption = getBestOption(newOption, bestOption); - } - const internalPosition = (bestOption === null || bestOption === void 0 ? void 0 : bestOption.internalPosition) || "right-top"; - const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger: trigger2, arrow: arrow2 }); - const tallestBoundingContainer = getTallestRect(viewport, container); - const boundingContainer = allowVerticalOverflow && isTopOrBottom(internalPosition) ? { - insetBlockStart: tallestBoundingContainer.insetBlockStart, - blockSize: tallestBoundingContainer.blockSize, - insetInlineStart: viewport.insetInlineStart, - inlineSize: viewport.inlineSize - } : viewport; - const optimizedRect = fitIntoContainer(rect, boundingContainer); - const scrollable = optimizedRect.blockSize < rect.blockSize; - return { internalPosition, rect: optimizedRect, scrollable }; -} -function getBestOption(option1, option2) { - if (!(option2 === null || option2 === void 0 ? void 0 : option2.visibleArea)) { - return option1; - } - if (!option1.visibleArea) { - return option2; - } - if (option1.visibleArea.inlineSize === option2.visibleArea.inlineSize) { - return option1.visibleArea.blockSize > option2.visibleArea.blockSize ? option1 : option2; - } - return option1.visibleArea.inlineSize > option2.visibleArea.inlineSize ? option1 : option2; -} -function getOffsetDimensions(element) { - return { offsetHeight: element.offsetHeight, offsetWidth: element.offsetWidth }; -} -function getDimensions(element) { - const computedStyle = getComputedStyle(element); - return { - inlineSize: parseFloat(computedStyle.inlineSize), - blockSize: parseFloat(computedStyle.blockSize) - }; -} -function isTopOrBottom(internalPosition) { - return ["top", "bottom"].includes(internalPosition.split("-")[0]); -} - -// node_modules/@cloudscape-design/components/internal/utils/scrollable-containers.js -var getOverflowParents = (element) => { - const parents = []; - let node = element; - while ((node = node.parentElement) && node !== document.body) { - getComputedStyle(node).overflow !== "visible" && parents.push(node); - } - return parents; -}; -var getOverflowParentDimensions = ({ element, excludeClosestParent = false, expandToViewport = false, canExpandOutsideViewport = false }) => { - const parents = expandToViewport ? [] : getOverflowParents(element).map((el) => { - const { height, width, top, left } = el.getBoundingClientRect(); - return { - // Treat the whole scrollable area as the available height - // if we're allowed to expand past the viewport. - blockSize: canExpandOutsideViewport ? el.scrollHeight : height, - inlineSize: width, - insetBlockStart: top, - insetInlineStart: left - }; - }); - if (canExpandOutsideViewport && !expandToViewport) { - const documentDimensions = document.documentElement.getBoundingClientRect(); - parents.push({ - inlineSize: Math.max(documentDimensions.width, document.documentElement.clientWidth), - blockSize: Math.max(documentDimensions.height, document.documentElement.clientHeight), - insetBlockStart: documentDimensions.top, - insetInlineStart: documentDimensions.left - }); - } else { - parents.push({ - blockSize: window.innerHeight, - inlineSize: window.innerWidth, - insetBlockStart: 0, - insetInlineStart: 0 - }); - } - if (excludeClosestParent && !expandToViewport) { - parents.shift(); - } - return parents; -}; -function scrollElementIntoView(element, options = { block: "nearest", inline: "nearest" }) { - var _a2; - (_a2 = element === null || element === void 0 ? void 0 : element.scrollIntoView) === null || _a2 === void 0 ? void 0 : _a2.call(element, options); -} -function calculateScroll({ insetBlockStart, blockSize }) { - if (insetBlockStart < 0) { - return insetBlockStart; - } else if (insetBlockStart + blockSize > window.innerHeight) { - if (blockSize > window.innerHeight) { - return insetBlockStart; - } else { - return insetBlockStart + blockSize - window.innerHeight; - } - } - return 0; -} -function scrollRectangleIntoView(box, scrollableParent) { - const scrollAmount = calculateScroll(box); - if (scrollAmount) { - (scrollableParent || window).scrollBy(0, scrollAmount); - } -} -function getFirstScrollableParent(element) { - return findUpUntil2(element, (el) => { - const overflows = el.scrollHeight > el.clientHeight; - return overflows && ["scroll", "auto"].includes(getComputedStyle(el).overflowY); - }) || void 0; -} - -// node_modules/@cloudscape-design/components/internal/direction.js -function isRtl(element) { - return getComputedStyle(element).direction === "rtl"; -} -function getScrollInlineStart(element) { - return isRtl(element) ? Math.floor(element.scrollLeft) * -1 : Math.ceil(element.scrollLeft); -} -function getLogicalBoundingClientRect(element) { - const boundingClientRect = element.getBoundingClientRect(); - const blockSize = boundingClientRect.height; - const inlineSize = boundingClientRect.width; - const insetBlockStart = boundingClientRect.top; - const insetBlockEnd = boundingClientRect.bottom; - const insetInlineStart = isRtl(element) ? document.documentElement.clientWidth - boundingClientRect.right : boundingClientRect.left; - const insetInlineEnd = insetInlineStart + inlineSize; - return { - blockSize, - inlineSize, - insetBlockStart, - insetBlockEnd, - insetInlineStart, - insetInlineEnd - }; -} - -// node_modules/@cloudscape-design/components/popover/use-popover-position.js -function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trackRef, contentRef, allowScrollToFit, allowVerticalOverflow, preferredPosition, renderWithPortal, keepPosition }) { - const previousInternalPositionRef = (0, import_react39.useRef)(null); - const [popoverStyle, setPopoverStyle] = (0, import_react39.useState)({}); - const [internalPosition, setInternalPosition] = (0, import_react39.useState)(null); - const positionHandlerRef = (0, import_react39.useRef)(() => { - }); - const updatePositionHandler = (0, import_react39.useCallback)((onContentResize = false) => { - var _a2; - if (!trackRef.current || !popoverRef.current || !bodyRef.current || !contentRef.current || !arrowRef.current) { - return; - } - const popover = popoverRef.current; - const body = bodyRef.current; - const arrow2 = arrowRef.current; - const document2 = popover.ownerDocument; - const track = trackRef.current; - const { offsetWidth, offsetHeight } = getOffsetDimensions(popover); - if (offsetWidth === 0 || offsetHeight === 0 || !nodeContains(document2.body, track)) { - return; - } - const prevInsetBlockStart = popover.style.insetBlockStart; - const prevInsetInlineStart = popover.style.insetInlineStart; - popover.style.insetBlockStart = "0"; - popover.style.insetInlineStart = "0"; - body.style.maxBlockSize = ""; - body.style.overflowX = ""; - body.style.overflowY = ""; - const viewportRect = getViewportRect(document2.defaultView); - const trackRect = getLogicalBoundingClientRect(track); - const arrowRect = getDimensions(arrow2); - const containingBlock = getContainingBlock(popover); - const containingBlockRect = containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect; - const bodyBorderWidth = getBorderWidth(body); - const contentRect = getLogicalBoundingClientRect(contentRef.current); - const contentBoundingBox = { - inlineSize: contentRect.inlineSize + 2 * bodyBorderWidth, - blockSize: contentRect.blockSize + 2 * bodyBorderWidth - }; - const shouldKeepPosition = keepPosition && onContentResize && !!previousInternalPositionRef.current; - const fixedInternalPosition = (_a2 = shouldKeepPosition && previousInternalPositionRef.current) !== null && _a2 !== void 0 ? _a2 : void 0; - const { scrollable, internalPosition: newInternalPosition, rect } = calculatePosition({ - preferredPosition, - fixedInternalPosition, - trigger: trackRect, - arrow: arrowRect, - body: contentBoundingBox, - container: containingBlock ? containingBlockRect : getDocumentRect(document2), - viewport: viewportRect, - renderWithPortal, - allowVerticalOverflow - }); - const popoverOffset = toRelativePosition(rect, containingBlockRect); - const trackRelativeOffset = toRelativePosition(popoverOffset, toRelativePosition(trackRect, containingBlockRect)); - popover.style.insetBlockStart = prevInsetBlockStart; - popover.style.insetInlineStart = prevInsetInlineStart; - if (scrollable) { - body.style.maxBlockSize = rect.blockSize + "px"; - body.style.overflowX = "hidden"; - body.style.overflowY = "auto"; - } - previousInternalPositionRef.current = newInternalPosition; - setInternalPosition(newInternalPosition); - const shouldScroll = allowScrollToFit && !shouldKeepPosition; - const insetBlockStart = shouldScroll ? popoverOffset.insetBlockStart + calculateScroll(rect) : popoverOffset.insetBlockStart; - setPopoverStyle({ insetBlockStart, insetInlineStart: popoverOffset.insetInlineStart }); - if (shouldScroll) { - const scrollableParent = getFirstScrollableParent(popover); - scrollRectangleIntoView(rect, scrollableParent); - } - positionHandlerRef.current = () => { - const newTrackOffset = toRelativePosition(getLogicalBoundingClientRect(track), containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect); - setPopoverStyle({ - insetBlockStart: newTrackOffset.insetBlockStart + trackRelativeOffset.insetBlockStart, - insetInlineStart: newTrackOffset.insetInlineStart + trackRelativeOffset.insetInlineStart - }); - }; - }, [ - trackRef, - popoverRef, - bodyRef, - contentRef, - arrowRef, - keepPosition, - allowScrollToFit, - preferredPosition, - renderWithPortal, - allowVerticalOverflow - ]); - return { updatePositionHandler, popoverStyle, internalPosition, positionHandlerRef }; -} -function getBorderWidth(element) { - return parseInt(getComputedStyle(element).borderWidth) || 0; -} -function toRelativePosition(element, parent) { - return { - insetBlockStart: element.insetBlockStart - parent.insetBlockStart, - insetInlineStart: element.insetInlineStart - parent.insetInlineStart - }; -} -function getViewportRect(window2) { - return { - insetBlockStart: 0, - insetInlineStart: 0, - inlineSize: window2.innerWidth, - blockSize: window2.innerHeight - }; -} -function getDocumentRect(document2) { - const { insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(document2.documentElement); - return { - insetBlockStart, - insetInlineStart, - inlineSize: document2.documentElement.scrollWidth, - blockSize: document2.documentElement.scrollHeight - }; -} - -// node_modules/@cloudscape-design/components/popover/container.js -function PopoverContainer({ position, trackRef, trackKey, arrow: arrow2, children: children2, zIndex, renderWithPortal, size: size2, fixedWidth, variant, keepPosition, allowScrollToFit, allowVerticalOverflow }) { - const bodyRef = (0, import_react40.useRef)(null); - const contentRef = (0, import_react40.useRef)(null); - const popoverRef = (0, import_react40.useRef)(null); - const arrowRef = (0, import_react40.useRef)(null); - const isRefresh = useVisualRefresh(); - const { updatePositionHandler, popoverStyle, internalPosition, positionHandlerRef } = usePopoverPosition({ - popoverRef, - bodyRef, - arrowRef, - trackRef, - contentRef, - allowScrollToFit, - allowVerticalOverflow, - preferredPosition: position, - renderWithPortal, - keepPosition - }); - (0, import_react40.useLayoutEffect)(() => { - updatePositionHandler(); - }, [updatePositionHandler, trackKey]); - useResizeObserver(contentRef, () => { - updatePositionHandler(true); - }); - (0, import_react40.useLayoutEffect)(() => { - const onClick = (event) => { - if ( - // Do not update position if keepPosition is true. - keepPosition || // If the click was on the trigger, this will make the popover appear or disappear, - // so no need to update its position either in this case. - nodeContains(trackRef.current, event.target) - ) { - return; - } - requestAnimationFrame(() => { - updatePositionHandler(); - }); - }; - const updatePositionOnResize = () => requestAnimationFrame(() => updatePositionHandler()); - const refreshPosition = () => requestAnimationFrame(() => positionHandlerRef.current()); - window.addEventListener("click", onClick); - window.addEventListener("resize", updatePositionOnResize); - window.addEventListener("scroll", refreshPosition, true); - return () => { - window.removeEventListener("click", onClick); - window.removeEventListener("resize", updatePositionOnResize); - window.removeEventListener("scroll", refreshPosition, true); - }; - }, [keepPosition, positionHandlerRef, trackRef, updatePositionHandler]); - return import_react40.default.createElement( - "div", - { ref: popoverRef, style: Object.assign(Object.assign({}, popoverStyle), { zIndex }), className: clsx_m_default(styles_css_default13.container, isRefresh && styles_css_default13.refresh) }, - import_react40.default.createElement("div", { ref: arrowRef, className: clsx_m_default(styles_css_default13[`container-arrow`], styles_css_default13[`container-arrow-position-${internalPosition}`]), "aria-hidden": true }, arrow2(internalPosition)), - import_react40.default.createElement( - "div", - { ref: bodyRef, className: clsx_m_default(styles_css_default13["container-body"], styles_css_default13[`container-body-size-${size2}`], { - [styles_css_default13["fixed-width"]]: fixedWidth, - [styles_css_default13[`container-body-variant-${variant}`]]: variant - }) }, - import_react40.default.createElement("div", { ref: contentRef }, children2) - ) - ); -} - -// node_modules/@cloudscape-design/components/popover/body.js -var import_react43 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/focus-lock/index.js -var import_react42 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/tab-trap/index.js -var import_react41 = __toESM(require_react()); -function TabTrap({ focusNextCallback, disabled = false }) { - return import_react41.default.createElement("div", { tabIndex: disabled ? -1 : 0, onFocus: focusNextCallback }); -} - -// node_modules/@cloudscape-design/components/internal/components/focus-lock/utils.js -var tabbables = [ - "button:enabled", - "select:enabled", - "textarea:enabled", - "input:enabled", - "a[href]", - "area[href]", - "summary", - "iframe", - "object", - "embed", - "audio[controls]", - "video[controls]", - "[tabindex]", - "[contenteditable]", - "[autofocus]" -].join(","); -function getAllFocusables(container) { - return Array.prototype.slice.call(container.querySelectorAll(tabbables)); -} -function getFocusables(container) { - return getAllFocusables(container).filter((element) => element.tabIndex !== -1); -} -function getFirstFocusable(container) { - var _a2; - const focusables = getFocusables(container); - return (_a2 = focusables[0]) !== null && _a2 !== void 0 ? _a2 : null; -} -function getLastFocusable(container) { - var _a2; - const focusables = getFocusables(container); - return (_a2 = focusables[focusables.length - 1]) !== null && _a2 !== void 0 ? _a2 : null; -} - -// node_modules/@cloudscape-design/components/internal/components/focus-lock/index.js -function FocusLock({ className: className2, disabled, autoFocus, restoreFocus, children: children2 }, ref) { - const returnFocusToRef = (0, import_react42.useRef)(null); - const containerRef = (0, import_react42.useRef)(null); - const focusFirst = () => { - var _a2; - if (containerRef.current) { - (_a2 = getFirstFocusable(containerRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - }; - const focusLast = () => { - var _a2; - if (containerRef.current) { - (_a2 = getLastFocusable(containerRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - }; - (0, import_react42.useEffect)(() => { - if (autoFocus && !disabled) { - returnFocusToRef.current = document.activeElement; - focusFirst(); - } - }, [autoFocus, disabled]); - const [previouslyDisabled, setPreviouslyDisabled] = (0, import_react42.useState)(!!disabled); - (0, import_react42.useEffect)(() => { - var _a2; - if (previouslyDisabled !== !!disabled) { - setPreviouslyDisabled(!!disabled); - if (restoreFocus && disabled) { - (_a2 = returnFocusToRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - returnFocusToRef.current = null; - } - } - }, [previouslyDisabled, disabled, restoreFocus]); - const restoreFocusHandler = (0, import_react42.useCallback)((elem) => { - var _a2; - if (elem === null && restoreFocus) { - (_a2 = returnFocusToRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - returnFocusToRef.current = null; - } - }, [restoreFocus]); - (0, import_react42.useImperativeHandle)(ref, () => ({ focusFirst })); - const mergedRef = useMergeRefs(containerRef, restoreFocusHandler); - return import_react42.default.createElement( - import_react42.default.Fragment, - null, - import_react42.default.createElement(TabTrap, { disabled, focusNextCallback: focusLast }), - import_react42.default.createElement("div", { className: className2, ref: mergedRef }, children2), - import_react42.default.createElement(TabTrap, { disabled, focusNextCallback: focusFirst }) - ); -} -var focus_lock_default = import_react42.default.forwardRef(FocusLock); - -// node_modules/@cloudscape-design/components/popover/body.js -function PopoverBody({ dismissButton: showDismissButton, dismissAriaLabel, header, children: children2, onDismiss, variant, overflowVisible, className: className2, ariaLabelledby }) { - const i18n = useInternalI18n("popover"); - const labelledById = useUniqueId("awsui-popover-"); - const dismissButtonFocused = (0, import_react43.useRef)(false); - const dismissButtonRef = (0, import_react43.useRef)(null); - const onKeyDown = (0, import_react43.useCallback)((event) => { - if (event.keyCode === KeyCode.escape) { - event.stopPropagation(); - onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(); - } - }, [onDismiss]); - (0, import_react43.useEffect)(() => { - var _a2; - if (showDismissButton && !dismissButtonFocused.current) { - (_a2 = dismissButtonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventScroll: true }); - } - dismissButtonFocused.current = showDismissButton; - }, [showDismissButton]); - const dismissButton2 = (showDismissButton !== null && showDismissButton !== void 0 ? showDismissButton : null) && import_react43.default.createElement( - "div", - { className: styles_css_default13.dismiss }, - import_react43.default.createElement(InternalButton, { variant: "icon", formAction: "none", iconName: "close", className: styles_css_default13["dismiss-control"], ariaLabel: i18n("dismissAriaLabel", dismissAriaLabel), onClick: () => onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(), ref: dismissButtonRef }) - ); - const isDialog = showDismissButton; - const shouldTrapFocus = showDismissButton && variant !== "annotation"; - const dialogProps = isDialog ? { - role: "dialog", - "aria-modal": shouldTrapFocus ? true : void 0, - "aria-labelledby": ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : header ? labelledById : void 0 - } : {}; - return import_react43.default.createElement( - "div", - Object.assign({ className: clsx_m_default(styles_css_default13.body, className2, { - [styles_css_default13["body-overflow-visible"]]: overflowVisible === "both" - }), onKeyDown }, dialogProps), - import_react43.default.createElement( - focus_lock_default, - { disabled: !shouldTrapFocus, autoFocus: false }, - header && import_react43.default.createElement( - "div", - { className: clsx_m_default(styles_css_default13["header-row"], showDismissButton && styles_css_default13["has-dismiss"]) }, - dismissButton2, - import_react43.default.createElement( - "div", - { className: styles_css_default13.header, id: labelledById }, - import_react43.default.createElement("h2", null, header) - ) - ), - import_react43.default.createElement( - "div", - { className: !header && showDismissButton ? styles_css_default13["has-dismiss"] : void 0 }, - !header && dismissButton2, - import_react43.default.createElement("div", { className: clsx_m_default(styles_css_default13.content, { [styles_css_default13["content-overflow-visible"]]: !!overflowVisible }) }, children2) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/internal/utils/strings/join-strings.js -function joinStrings(...strings) { - return strings.filter(Boolean).join(" ") || void 0; -} - -// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-popover.js -var arrow = (position) => import_react44.default.createElement( - "div", - { className: clsx_m_default(styles_css_default10.arrow, styles_css_default10[`arrow-position-${position}`]) }, - import_react44.default.createElement("div", { className: styles_css_default10["arrow-outer"] }), - import_react44.default.createElement("div", { className: styles_css_default10["arrow-inner"] }) -); -function AnnotationPopover({ title, content, alert, direction = "top", taskLocalStepIndex, totalLocalSteps, showPreviousButton, showFinishButton, onDismiss, nextButtonEnabled, onNextButtonClick, onFinish, trackRef, previousButtonEnabled, onPreviousButtonClick, i18nStrings }) { - (0, import_react44.useEffect)(() => { - var _a2; - scrollElementIntoView((_a2 = trackRef.current) !== null && _a2 !== void 0 ? _a2 : void 0); - }, [trackRef]); - const popoverHeaderId = useUniqueId("poppver-header-"); - const stepCounterId = useUniqueId("step-counter-"); - return import_react44.default.createElement( - PopoverContainer, - { size: "medium", fixedWidth: false, position: direction, trackRef, trackKey: taskLocalStepIndex, variant: "annotation", arrow, zIndex: 1e3 }, - import_react44.default.createElement( - PopoverBody, - { - dismissButton: true, - dismissAriaLabel: i18nStrings.labelDismissAnnotation, - header: import_react44.default.createElement(InternalBox, { id: popoverHeaderId, color: "text-body-secondary", fontSize: "body-s", margin: { top: "xxxs" }, className: styles_css_default10.header }, title), - onDismiss, - className: styles_css_default10.annotation, - variant: "annotation", - overflowVisible: "content", - // create new dialog to have the native dialog behavior of the screen readers - key: taskLocalStepIndex, - ariaLabelledby: joinStrings(popoverHeaderId, stepCounterId) - }, - import_react44.default.createElement( - InternalSpaceBetween, - { size: "s" }, - import_react44.default.createElement( - "div", - { className: styles_css_default10.description }, - import_react44.default.createElement(InternalBox, { className: styles_css_default10.content }, content) - ), - alert && import_react44.default.createElement(internal_default3, { type: "warning" }, alert), - import_react44.default.createElement( - InternalSpaceBetween, - { size: "s" }, - import_react44.default.createElement("div", { className: styles_css_default10.divider }), - import_react44.default.createElement( - "div", - { className: styles_css_default10.actionBar }, - import_react44.default.createElement( - "div", - { className: styles_css_default10.stepCounter }, - import_react44.default.createElement(InternalBox, { id: stepCounterId, className: styles_css_default10["step-counter-content"], color: "text-body-secondary", fontSize: "body-s" }, i18nStrings.stepCounterText(taskLocalStepIndex !== null && taskLocalStepIndex !== void 0 ? taskLocalStepIndex : 0, totalLocalSteps !== null && totalLocalSteps !== void 0 ? totalLocalSteps : 0)) - ), - import_react44.default.createElement( - InternalSpaceBetween, - { size: "xs", direction: "horizontal" }, - showPreviousButton && import_react44.default.createElement(InternalButton, { variant: "link", onClick: onPreviousButtonClick, disabled: !previousButtonEnabled, formAction: "none", ariaLabel: i18nStrings.previousButtonText, className: styles_css_default10["previous-button"] }, i18nStrings.previousButtonText), - showFinishButton ? import_react44.default.createElement(InternalButton, { onClick: onFinish, formAction: "none", ariaLabel: i18nStrings.finishButtonText, className: styles_css_default10["finish-button"] }, i18nStrings.finishButtonText) : import_react44.default.createElement(InternalButton, { onClick: onNextButtonClick, disabled: !nextButtonEnabled, formAction: "none", ariaLabel: i18nStrings.nextButtonText, className: styles_css_default10["next-button"] }, i18nStrings.nextButtonText) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/annotation-context/annotation/open-annotation.js -function OpenAnnotation({ title, content, alert, direction, showPreviousButton, showFinishButton, taskLocalStepIndex, totalLocalSteps, onDismiss, nextButtonEnabled, onNextButtonClick, onFinish, previousButtonEnabled, onPreviousButtonClick, i18nStrings }) { - const trackRef = (0, import_react45.useRef)(null); - return import_react45.default.createElement( - import_react45.default.Fragment, - null, - import_react45.default.createElement(annotation_trigger_default, { open: true, onClick: onDismiss, i18nStrings, ref: trackRef, totalLocalSteps, taskLocalStepIndex }), - import_react45.default.createElement(AnnotationPopover, { trackRef, previousButtonEnabled, showPreviousButton, showFinishButton, totalLocalSteps, i18nStrings, nextButtonEnabled, onDismiss, onFinish, onNextButtonClick, onPreviousButtonClick, taskLocalStepIndex, direction, title, content, alert }) - ); -} - -// node_modules/@cloudscape-design/components/annotation-context/annotation/closed-annotation.js -var import_react46 = __toESM(require_react()); -function ClosedAnnotation({ globalStepIndex, onOpen, i18nStrings, focusOnRender, totalLocalSteps, taskLocalStepIndex }) { - const [hotspotRef, setHotspotRef] = (0, import_react46.useState)(null); - const onClick = (0, import_react46.useCallback)(() => { - onOpen(globalStepIndex); - }, [globalStepIndex, onOpen]); - (0, import_react46.useEffect)(() => { - if (focusOnRender && hotspotRef) { - hotspotRef.focus(); - } - }, [focusOnRender, hotspotRef]); - return import_react46.default.createElement(annotation_trigger_default, { open: false, onClick, i18nStrings, ref: setHotspotRef, totalLocalSteps, taskLocalStepIndex }); -} - -// node_modules/@cloudscape-design/components/annotation-context/context.js -var import_react47 = __toESM(require_react()); -var defaultContext = { - getContentForId: () => null, - registerHotspot() { - }, - unregisterHotspot() { - }, - currentStepIndex: 0, - currentTutorial: null, - onStartTutorial() { - }, - onExitTutorial() { - } -}; -var hotspotContext = import_react47.default.createContext(defaultContext); - -// node_modules/@cloudscape-design/components/annotation-context/utils.js -function getStepInfo(annotations, index) { - if (index >= 0) { - let taskIndex = 0; - for (const task of annotations) { - if (task.steps.length <= index) { - index -= task.steps.length; - taskIndex++; - continue; - } - return { task, step: task.steps[index], localIndex: index, taskIndex }; - } - } - return { task: void 0, step: void 0, localIndex: 0, taskIndex: 0 }; -} - -// node_modules/@cloudscape-design/components/annotation-context/index.js -var emptyTasks = []; -function AnnotationContext({ currentTutorial, children: children2, onStepChange, onFinish: onFinishHandler, onStartTutorial, onExitTutorial, i18nStrings }) { - var _a2, _b, _c, _d; - useTelemetry("AnnotationContext"); - const [open, setOpen] = (0, import_react48.useState)(true); - const [currentStepIndex, setCurrentStepIndex] = (0, import_react48.useState)(0); - (0, import_react48.useEffect)(() => { - setCurrentStepIndex(0); - setOpen(true); - }, [currentTutorial, setOpen]); - const [availableHotspots, setAvailableHotspots] = (0, import_react48.useState)({}); - const availableHotspotsRef = (0, import_react48.useRef)(availableHotspots); - const annotations = currentTutorial ? currentTutorial.tasks : emptyTasks; - const { task, step: step2, localIndex, taskIndex } = getStepInfo(annotations, currentStepIndex); - const currentId = step2 === null || step2 === void 0 ? void 0 : step2.hotspotId; - const totalStepCount = annotations.map((a2) => a2.steps.length).reduce((a2, b) => a2 + b, 0); - const id2index = (0, import_react48.useMemo)(() => { - const mapping = {}; - let counter2 = 0; - for (const annotation of annotations) { - for (const step3 of annotation.steps) { - if (mapping[step3.hotspotId] === void 0) { - mapping[step3.hotspotId] = counter2; - } - counter2++; - } - } - return mapping; - }, [annotations]); - const openNextStep = (0, import_react48.useCallback)(() => { - const newStepIndex = Math.min(currentStepIndex + 1, totalStepCount); - setCurrentStepIndex(newStepIndex); - fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "next" }); - }, [currentStepIndex, onStepChange, totalStepCount]); - const openPreviousStep = (0, import_react48.useCallback)(() => { - const newStepIndex = Math.max(currentStepIndex - 1, 0); - setCurrentStepIndex(newStepIndex); - fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "previous" }); - }, [onStepChange, currentStepIndex]); - const onFinish = (0, import_react48.useCallback)(() => fireNonCancelableEvent(onFinishHandler), [onFinishHandler]); - const isCurrentHotspotAvailable = currentId ? availableHotspots[currentId] : null; - (0, import_react48.useEffect)(() => { - if (!currentId || availableHotspotsRef.current[currentId]) { - return; - } - const findNearestHotspot = () => { - let nearestHotspot2 = void 0; - let nearestDistance = Infinity; - for (const hotspotId of Object.keys(availableHotspotsRef.current)) { - const distanceFromCurrentHotspot = Math.abs(id2index[hotspotId] - currentStepIndex); - if (distanceFromCurrentHotspot < nearestDistance) { - nearestDistance = distanceFromCurrentHotspot; - nearestHotspot2 = hotspotId; - } - } - return nearestHotspot2; - }; - const nearestHotspot = findNearestHotspot(); - if (nearestHotspot) { - const newStepIndex = id2index[nearestHotspot]; - setCurrentStepIndex(newStepIndex); - setOpen(true); - fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "auto-fallback" }); - } - }, [annotations, isCurrentHotspotAvailable, currentId, currentStepIndex, id2index, onStepChange]); - const onDismiss = (0, import_react48.useCallback)(() => { - setOpen(false); - }, [setOpen]); - const onOpen = (0, import_react48.useCallback)((stepIndex) => { - setCurrentStepIndex(stepIndex); - fireNonCancelableEvent(onStepChange, { step: stepIndex, reason: "open" }); - setOpen(true); - }, [onStepChange, setOpen]); - const idOfPreviousHotspot = (_a2 = getStepInfo(annotations, currentStepIndex - 1).step) === null || _a2 === void 0 ? void 0 : _a2.hotspotId; - const idOfNextHotspot = (_b = getStepInfo(annotations, currentStepIndex + 1).step) === null || _b === void 0 ? void 0 : _b.hotspotId; - const previousHotspotIsAvailable = (_c = idOfPreviousHotspot !== void 0 && availableHotspots[idOfPreviousHotspot]) !== null && _c !== void 0 ? _c : false; - const nextHotspotIsAvailable = (_d = idOfNextHotspot !== void 0 && availableHotspots[idOfNextHotspot]) !== null && _d !== void 0 ? _d : false; - const getContentForId = (0, import_react48.useCallback)((id, direction) => { - if (currentTutorial === null || currentTutorial === void 0 ? void 0 : currentTutorial.completed) { - return null; - } - const globalStepIndex = id2index[id]; - if (globalStepIndex === void 0) { - return null; - } - if (!task || !step2 || !open || id !== currentId) { - const { task: currentTask, localIndex: currentStepIndex2 } = getStepInfo(annotations, globalStepIndex); - return import_react48.default.createElement(ClosedAnnotation, { globalStepIndex, i18nStrings, onOpen, focusOnRender: id === currentId, totalLocalSteps: currentTask ? currentTask.steps.length : 0, taskLocalStepIndex: currentStepIndex2 }); - } - return import_react48.default.createElement(OpenAnnotation, { i18nStrings, direction, title: i18nStrings.taskTitle(taskIndex, task.title), content: step2.content, alert: step2.warningAlert, showPreviousButton: currentStepIndex !== 0, showFinishButton: currentStepIndex + 1 === totalStepCount, taskLocalStepIndex: localIndex, totalLocalSteps: task.steps.length, nextButtonEnabled: nextHotspotIsAvailable, onNextButtonClick: openNextStep, onFinish, previousButtonEnabled: previousHotspotIsAvailable, onPreviousButtonClick: openPreviousStep, onDismiss }); - }, [ - id2index, - currentTutorial, - task, - step2, - open, - currentId, - currentStepIndex, - i18nStrings, - taskIndex, - localIndex, - totalStepCount, - nextHotspotIsAvailable, - openNextStep, - onFinish, - previousHotspotIsAvailable, - openPreviousStep, - onDismiss, - onOpen, - annotations - ]); - const registerHotspot = (0, import_react48.useCallback)( - (id) => { - if (!id2index || id2index[id] === void 0) { - return; - } - availableHotspotsRef.current = Object.assign(Object.assign({}, availableHotspotsRef.current), { [id]: true }); - setAvailableHotspots((availableHotspots2) => { - if (availableHotspots2[id]) { - return availableHotspots2; - } - return Object.assign(Object.assign({}, availableHotspots2), { [id]: true }); - }); - }, - // We need to react on id2index changes for registering new hotspots when the map changes. - // eslint-disable-next-line react-hooks/exhaustive-deps - [id2index] - ); - const unregisterHotspot = (0, import_react48.useCallback)((id) => { - if (!availableHotspotsRef.current[id]) { - return; - } - availableHotspotsRef.current = removeKey(id, availableHotspotsRef.current); - setAvailableHotspots((availableHotspots2) => { - if (!availableHotspots2[id]) { - return availableHotspots2; - } - return removeKey(id, availableHotspots2); - }); - }, []); - const context = { - getContentForId, - registerHotspot, - unregisterHotspot, - onStartTutorial, - onExitTutorial, - currentStepIndex, - currentTutorial - }; - return import_react48.default.createElement(hotspotContext.Provider, { value: context }, children2); -} -applyDisplayName(AnnotationContext, "AnnotationContext"); -function removeKey(key2, object2) { - const _a2 = object2, _b = key2, _ = _a2[_b], remainingObject = __rest(_a2, [typeof _b === "symbol" ? _b : _b + ""]); - return remainingObject; -} - -// node_modules/@cloudscape-design/components/app-layout/index.js -var import_react113 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/widget.js -var import_react110 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/utils/global-flags.js -var awsuiGlobalFlagsSymbol = Symbol.for("awsui-global-flags"); -var getTopWindow = () => { - return window.top; -}; -function getGlobal() { - return typeof window !== "undefined" ? window : globalThis; -} -function readFlag(window2, flagName) { - var _a2; - const holder = window2; - return (_a2 = holder === null || holder === void 0 ? void 0 : holder[awsuiGlobalFlagsSymbol]) === null || _a2 === void 0 ? void 0 : _a2[flagName]; -} -var getGlobalFlag = (flagName) => { - try { - const ownFlag = readFlag(getGlobal(), flagName); - if (ownFlag !== void 0) { - return ownFlag; - } - return readFlag(getTopWindow(), flagName); - } catch (e) { - return void 0; - } -}; - -// node_modules/@cloudscape-design/components/app-layout/implementation.js -var import_react109 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/classic.js -var import_react91 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/use-controllable/index.js -var React30 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/is-development.js -var isDevelopment2 = true; - -// node_modules/@cloudscape-design/components/internal/hooks/use-controllable/index.js -function useControllable2(controlledValue, handler, defaultValue5, { componentName: componentName3, changeHandler, controlledProp }) { - const isControlled = React30.useState(controlledValue !== void 0)[0]; - if (isDevelopment2) { - React30.useEffect(() => { - if (isControlled && handler === void 0) { - warnOnce(componentName3, `You provided a \`${controlledProp}\` prop without an \`${changeHandler}\` handler. This will render a non-interactive component.`); - } - }, [handler, isControlled, componentName3, changeHandler, controlledProp]); - React30.useEffect(() => { - const isControlledNow = controlledValue !== void 0; - if (isControlled !== isControlledNow) { - const initialMode = isControlled ? "controlled" : "uncontrolled"; - const modeNow = isControlledNow ? "controlled" : "uncontrolled"; - warnOnce(componentName3, `A component tried to change ${initialMode} '${controlledProp}' property to be ${modeNow}. This is not supported. Properties should not switch from ${initialMode} to ${modeNow} (or vice versa). Decide between using a controlled or uncontrolled mode for the lifetime of the component. More info: https://fb.me/react-controlled-components`); - } - }, [isControlled, controlledProp, componentName3, controlledValue]); - } - const [valueState, setValue] = React30.useState(defaultValue5); - const [valueHasBeenSet, setValueHasBeenSet] = React30.useState(false); - const currentUncontrolledValue = valueHasBeenSet ? valueState : defaultValue5; - const setUncontrolledValue = React30.useCallback((newValue) => { - setValue(newValue); - setValueHasBeenSet(true); - }, [setValue, setValueHasBeenSet]); - if (isControlled) { - return [controlledValue, defaultCallback]; - } else { - return [currentUncontrolledValue, setUncontrolledValue]; - } -} -function defaultCallback() { - return void 0; -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-mobile/index.js -function getIsMobile() { - if (typeof window === "undefined") { - return false; - } - if (window.matchMedia) { - return window.matchMedia(`(max-width: ${mobileBreakpoint}px)`).matches; - } - return getMatchingBreakpoint(window.innerWidth, ["xs"]) !== "xs"; -} -var useMobile = createSingletonState({ - initialState: () => getIsMobile(), - factory: (handler) => { - const listener = () => handler(getIsMobile()); - window.addEventListener("resize", listener); - return () => { - window.removeEventListener("resize", listener); - }; - } -}); - -// node_modules/@cloudscape-design/components/app-layout/notifications/index.js -var import_react49 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/notifications/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/notifications/styles.scoped.css"; -var styles_css_default14 = { - "notifications": "awsui_notifications_1hmm4_1xs0q_9", - "notifications-sticky": "awsui_notifications-sticky_1hmm4_1xs0q_10", - "no-content-paddings": "awsui_no-content-paddings_1hmm4_1xs0q_25" -}; - -// node_modules/@cloudscape-design/components/app-layout/notifications/index.js -var Notifications = import_react49.default.forwardRef((_a2, ref) => { - var _b, _c; - var { sticky, disableContentPaddings } = _a2, props2 = __rest(_a2, ["sticky", "disableContentPaddings"]); - return sticky ? import_react49.default.createElement( - "div", - { ref, className: styles_css_default14["notifications-sticky"], style: { top: props2.topOffset } }, - import_react49.default.createElement("div", { role: "region", className: clsx_m_default(props2.testUtilsClassName, disableContentPaddings && styles_css_default14["no-content-paddings"]), "aria-label": (_b = props2.labels) === null || _b === void 0 ? void 0 : _b.notifications }, props2.children) - ) : import_react49.default.createElement("div", { role: "region", ref, className: clsx_m_default(props2.testUtilsClassName, styles_css_default14.notifications, disableContentPaddings && styles_css_default14["no-content-paddings"]), "aria-label": (_c = props2.labels) === null || _c === void 0 ? void 0 : _c.notifications }, props2.children); -}); - -// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/index.js -var import_react79 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/toggles/index.js -var import_react50 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/toggles/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/toggles/styles.scoped.css"; -var styles_css_default15 = { - "toggle-button": "awsui_toggle-button_16w0h_1lkgf_99", - "close-button": "awsui_close-button_16w0h_1lkgf_134" -}; - -// node_modules/@cloudscape-design/components/app-layout/toggles/index.js -var togglesConfig = { - navigation: { - TagName: "nav", - iconName: "menu", - getLabels: (labels = {}) => ({ - mainLabel: labels.navigation, - openLabel: labels.navigationToggle, - closeLabel: labels.navigationClose - }) - }, - tools: { - TagName: "aside", - iconName: "status-info", - getLabels: (labels = {}) => ({ - mainLabel: labels.tools, - openLabel: labels.toolsToggle, - closeLabel: labels.toolsClose - }) - } -}; -var ToggleButton = import_react50.default.forwardRef(({ className: className2, ariaLabel, ariaExpanded, ariaControls, iconName, iconSvg, disabled, testId, onClick, badge }, ref) => { - return import_react50.default.createElement( - "button", - { ref, className: clsx_m_default(className2, styles_css_default15["toggle-button"]), "aria-label": ariaLabel, type: "button", onClick, disabled, "aria-expanded": ariaExpanded, "aria-haspopup": ariaExpanded ? void 0 : true, "aria-controls": ariaControls, "data-testid": testId }, - import_react50.default.createElement(internal_default, { svg: iconSvg, name: iconName, badge }) - ); -}); -var CloseButton = import_react50.default.forwardRef(({ className: className2, ariaLabel, onClick }, ref) => { - return import_react50.default.createElement( - "span", - { className: styles_css_default15["close-button"] }, - import_react50.default.createElement(InternalButton, { ref, className: className2, ariaLabel, variant: "icon", formAction: "none", iconName: "close", onClick }) - ); -}); - -// node_modules/@cloudscape-design/components/app-layout/drawer/overflow-menu.js -var import_react76 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/internal.js -var import_react75 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/button-dropdown/styles.scoped.css"; -var styles_css_default16 = { - "button-dropdown": "awsui_button-dropdown_sne0l_17rq9_99", - "items-list-container": "awsui_items-list-container_sne0l_17rq9_103", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_17rq9_1", - "rotate-up": "awsui_rotate-up_sne0l_17rq9_122", - "rotate-down": "awsui_rotate-down_sne0l_17rq9_137", - "header": "awsui_header_sne0l_17rq9_152", - "title": "awsui_title_sne0l_17rq9_163", - "description": "awsui_description_sne0l_17rq9_164", - "split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_17rq9_168", - "trigger-item": "awsui_trigger-item_sne0l_17rq9_171", - "trigger-button": "awsui_trigger-button_sne0l_17rq9_174", - "visual-refresh": "awsui_visual-refresh_sne0l_17rq9_185", - "split-trigger": "awsui_split-trigger_sne0l_17rq9_168", - "dropdown-trigger": "awsui_dropdown-trigger_sne0l_17rq9_193", - "test-utils-button-trigger": "awsui_test-utils-button-trigger_sne0l_17rq9_197" -}; - -// node_modules/@cloudscape-design/components/internal/components/dropdown/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/dropdown/styles.scoped.css"; -var styles_css_default17 = { - "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_3gt2b_99", - "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_3gt2b_1", - "refresh": "awsui_refresh_qwoo0_3gt2b_120", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_3gt2b_1", - "root": "awsui_root_qwoo0_3gt2b_149", - "interior": "awsui_interior_qwoo0_3gt2b_185", - "dropdown": "awsui_dropdown_qwoo0_3gt2b_99", - "use-portal": "awsui_use-portal_qwoo0_3gt2b_196", - "is-empty": "awsui_is-empty_qwoo0_3gt2b_248", - "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_3gt2b_255", - "with-limited-width": "awsui_with-limited-width_qwoo0_3gt2b_259", - "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_3gt2b_262", - "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_3gt2b_268", - "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_3gt2b_274", - "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_3gt2b_277", - "hide-block-border": "awsui_hide-block-border_qwoo0_3gt2b_281", - "open": "awsui_open_qwoo0_3gt2b_287", - "nowrap": "awsui_nowrap_qwoo0_3gt2b_296", - "dropdown-content": "awsui_dropdown-content_qwoo0_3gt2b_99", - "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_3gt2b_307" -}; - -// node_modules/@cloudscape-design/components/internal/components/dropdown/index.js -var import_react61 = __toESM(require_react()); -var import_react_dom4 = __toESM(require_react_dom()); - -// node_modules/@cloudscape-design/components/internal/components/dropdown/dropdown-fit-handler.js -var AVAILABLE_SPACE_RESERVE_DEFAULT = 50; -var AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; -var AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20; -var getClosestParentDimensions = (element) => { - const parents = getOverflowParents(element).map((element2) => { - const { blockSize, inlineSize, insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(element2); - return { - blockSize, - inlineSize, - insetBlockStart, - insetInlineStart - }; - }); - return parents.shift(); -}; -var defaultMaxDropdownWidth = getBreakpointValue("xxs"); -var getAvailableSpace = ({ trigger: trigger2, overflowParents, stretchWidth = false, stretchHeight = false, isMobile }) => { - const availableSpaceReserveVertical = stretchHeight ? 0 : isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL : AVAILABLE_SPACE_RESERVE_DEFAULT; - const availableSpaceReserveHorizontal = stretchWidth ? 0 : isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL : AVAILABLE_SPACE_RESERVE_DEFAULT; - const { insetBlockEnd: triggerBlockEnd, insetInlineStart: triggerInlineStart, insetInlineEnd: triggerInlineEnd } = getLogicalBoundingClientRect(trigger2); - return overflowParents.reduce(({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => { - const offsetTop = triggerBlockEnd - overflowParent.insetBlockStart; - const currentBlockStart = offsetTop - trigger2.offsetHeight - availableSpaceReserveVertical; - const currentBlockEnd = overflowParent.blockSize - offsetTop - availableSpaceReserveVertical; - const currentInlineStart = triggerInlineEnd - overflowParent.insetInlineStart - availableSpaceReserveHorizontal; - const currentInlineEnd = overflowParent.insetInlineStart + overflowParent.inlineSize - triggerInlineStart - availableSpaceReserveHorizontal; - return { - blockStart: Math.min(blockStart, currentBlockStart), - blockEnd: Math.min(blockEnd, currentBlockEnd), - inlineStart: Math.min(inlineStart, currentInlineStart), - inlineEnd: Math.min(inlineEnd, currentInlineEnd) - }; - }, { - blockStart: Number.MAX_VALUE, - blockEnd: Number.MAX_VALUE, - inlineStart: Number.MAX_VALUE, - inlineEnd: Number.MAX_VALUE - }); -}; -var getInteriorAvailableSpace = ({ trigger: trigger2, overflowParents, isMobile }) => { - const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL : AVAILABLE_SPACE_RESERVE_DEFAULT; - const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL : AVAILABLE_SPACE_RESERVE_DEFAULT; - const { insetBlockEnd: triggerBlockEnd, insetBlockStart: triggerBlockStart, insetInlineStart: triggerInlineStart, insetInlineEnd: triggerInlineEnd } = getLogicalBoundingClientRect(trigger2); - return overflowParents.reduce(({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => { - const currentBlockStart = triggerBlockEnd - overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL; - const currentBlockEnd = overflowParent.blockSize - triggerBlockStart + overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL; - const currentInlineStart = triggerInlineStart - overflowParent.insetInlineStart - AVAILABLE_SPACE_RESERVE_HORIZONTAL; - const currentInlineEnd = overflowParent.insetInlineStart + overflowParent.inlineSize - triggerInlineEnd - AVAILABLE_SPACE_RESERVE_HORIZONTAL; - return { - blockStart: Math.min(blockStart, currentBlockStart), - blockEnd: Math.min(blockEnd, currentBlockEnd), - inlineStart: Math.min(inlineStart, currentInlineStart), - inlineEnd: Math.min(inlineEnd, currentInlineEnd) - }; - }, { - blockStart: Number.MAX_VALUE, - blockEnd: Number.MAX_VALUE, - inlineStart: Number.MAX_VALUE, - inlineEnd: Number.MAX_VALUE - }); -}; -var getWidths = ({ triggerElement, dropdownElement, desiredMinWidth, stretchBeyondTriggerWidth = false }) => { - const { inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(triggerElement); - const minWidth = desiredMinWidth ? Math.min(triggerInlineSize, desiredMinWidth) : triggerInlineSize; - const maxWidth = stretchBeyondTriggerWidth ? Math.max(defaultMaxDropdownWidth, triggerInlineSize) : Number.MAX_VALUE; - const { inlineSize: requiredWidth } = getLogicalBoundingClientRect(dropdownElement); - const idealWidth = Math.min(Math.max(requiredWidth, minWidth), maxWidth); - return { idealWidth, minWidth, triggerInlineSize }; -}; -var hasEnoughSpaceToStretchBeyondTriggerWidth = ({ triggerElement, dropdownElement, desiredMinWidth, expandToViewport, stretchWidth, stretchHeight, isMobile }) => { - const overflowParents = getOverflowParentDimensions({ - element: dropdownElement, - excludeClosestParent: false, - expandToViewport, - canExpandOutsideViewport: stretchHeight - }); - const { idealWidth } = getWidths({ - triggerElement, - dropdownElement, - desiredMinWidth, - stretchBeyondTriggerWidth: true - }); - const availableSpace = getAvailableSpace({ - trigger: triggerElement, - overflowParents, - stretchWidth, - stretchHeight, - isMobile - }); - return idealWidth <= availableSpace.inlineStart || idealWidth <= availableSpace.inlineEnd; -}; -var getDropdownPosition = ({ triggerElement, dropdownElement, overflowParents, minWidth: desiredMinWidth, preferCenter = false, stretchWidth = false, stretchHeight = false, isMobile = false, stretchBeyondTriggerWidth = false }) => { - const availableSpace = getAvailableSpace({ - trigger: triggerElement, - overflowParents, - stretchWidth, - stretchHeight, - isMobile - }); - const { idealWidth, minWidth, triggerInlineSize } = getWidths({ - triggerElement, - dropdownElement, - desiredMinWidth, - stretchBeyondTriggerWidth - }); - let dropInlineStart; - let insetInlineStart = null; - let inlineSize = idealWidth; - if (idealWidth <= availableSpace.inlineEnd) { - dropInlineStart = false; - } else if (idealWidth <= availableSpace.inlineStart) { - dropInlineStart = true; - } else { - dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd; - inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd, minWidth); - } - if (preferCenter) { - const spillOver = (idealWidth - triggerInlineSize) / 2; - const availableOutsideLeft = availableSpace.inlineStart - triggerInlineSize; - const availableOutsideRight = availableSpace.inlineEnd - triggerInlineSize; - const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver; - if (fitsInCenter) { - insetInlineStart = -spillOver; - } - } - const dropBlockStart = availableSpace.blockEnd < dropdownElement.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd; - const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd; - const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16; - return { - dropBlockStart, - dropInlineStart, - insetInlineStart: insetInlineStart === null ? "auto" : `${insetInlineStart}px`, - blockSize: `${croppedHeight}px`, - inlineSize: `${inlineSize}px` - }; -}; -var getInteriorDropdownPosition = (trigger2, dropdown, overflowParents, isMobile) => { - const availableSpace = getInteriorAvailableSpace({ trigger: trigger2, overflowParents, isMobile }); - const { insetBlockEnd: triggerBlockEnd, insetBlockStart: triggerBlockStart, inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(trigger2); - const { insetBlockStart: parentDropdownBlockStart, blockSize: parentDropdownHeight } = getClosestParentDimensions(trigger2); - let dropInlineStart; - let { inlineSize } = getLogicalBoundingClientRect(dropdown); - const insetBlockStart = triggerBlockStart - parentDropdownBlockStart; - if (inlineSize <= availableSpace.inlineEnd) { - dropInlineStart = false; - } else if (inlineSize <= availableSpace.inlineStart) { - dropInlineStart = true; - } else { - dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd; - inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd); - } - const insetInlineStart = dropInlineStart ? 0 - inlineSize : triggerInlineSize; - const dropBlockStart = availableSpace.blockEnd < dropdown.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd; - const insetBlockEnd = dropBlockStart ? parentDropdownBlockStart + parentDropdownHeight - triggerBlockEnd : 0; - const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd; - const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16; - return { - dropBlockStart, - dropInlineStart, - blockSize: `${croppedHeight}px`, - inlineSize: `${inlineSize}px`, - insetBlockStart: `${insetBlockStart}px`, - insetBlockEnd: `${insetBlockEnd}px`, - insetInlineStart: `${insetInlineStart}px` - }; -}; -var calculatePosition2 = (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth, stretchBeyondTriggerWidth) => { - verticalContainerElement.style.maxBlockSize = ""; - dropdownElement.style.inlineSize = ""; - dropdownElement.style.insetBlockStart = ""; - dropdownElement.style.insetBlockEnd = ""; - dropdownElement.style.insetInlineStart = ""; - dropdownElement.classList.remove(styles_css_default17["dropdown-drop-left"]); - dropdownElement.classList.remove(styles_css_default17["dropdown-drop-right"]); - dropdownElement.classList.remove(styles_css_default17["dropdown-drop-up"]); - const overflowParents = getOverflowParentDimensions({ - element: dropdownElement, - excludeClosestParent: interior, - expandToViewport, - canExpandOutsideViewport: stretchHeight - }); - const position = interior ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile) : getDropdownPosition({ - triggerElement, - dropdownElement, - overflowParents, - minWidth, - preferCenter, - stretchWidth, - stretchHeight, - isMobile, - stretchBeyondTriggerWidth - }); - const triggerBox = triggerElement.getBoundingClientRect(); - return [position, triggerBox]; -}; - -// node_modules/@cloudscape-design/components/internal/components/transition/index.js -var import_react58 = __toESM(require_react()); -var import_react59 = __toESM(require_react()); - -// node_modules/@babel/runtime/helpers/esm/extends.js -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} - -// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key2, i; - for (i = 0; i < sourceKeys.length; i++) { - key2 = sourceKeys[i]; - if (excluded.indexOf(key2) >= 0) continue; - target[key2] = source[key2]; - } - return target; -} - -// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); -} - -// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); -} - -// node_modules/react-transition-group/esm/CSSTransition.js -var import_prop_types3 = __toESM(require_prop_types()); - -// node_modules/dom-helpers/esm/hasClass.js -function hasClass(element, className2) { - if (element.classList) return !!className2 && element.classList.contains(className2); - return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className2 + " ") !== -1; -} - -// node_modules/dom-helpers/esm/addClass.js -function addClass(element, className2) { - if (element.classList) element.classList.add(className2); - else if (!hasClass(element, className2)) if (typeof element.className === "string") element.className = element.className + " " + className2; - else element.setAttribute("class", (element.className && element.className.baseVal || "") + " " + className2); -} - -// node_modules/dom-helpers/esm/removeClass.js -function replaceClassName(origClass, classToRemove) { - return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, ""); -} -function removeClass(element, className2) { - if (element.classList) { - element.classList.remove(className2); - } else if (typeof element.className === "string") { - element.className = replaceClassName(element.className, className2); - } else { - element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className2)); - } -} - -// node_modules/react-transition-group/esm/CSSTransition.js -var import_react53 = __toESM(require_react()); - -// node_modules/react-transition-group/esm/Transition.js -var import_prop_types2 = __toESM(require_prop_types()); -var import_react52 = __toESM(require_react()); -var import_react_dom2 = __toESM(require_react_dom()); - -// node_modules/react-transition-group/esm/config.js -var config_default = { - disabled: false -}; - -// node_modules/react-transition-group/esm/utils/PropTypes.js -var import_prop_types = __toESM(require_prop_types()); -var timeoutsShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.shape({ - enter: import_prop_types.default.number, - exit: import_prop_types.default.number, - appear: import_prop_types.default.number -}).isRequired]) : null; -var classNamesShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.shape({ - enter: import_prop_types.default.string, - exit: import_prop_types.default.string, - active: import_prop_types.default.string -}), import_prop_types.default.shape({ - enter: import_prop_types.default.string, - enterDone: import_prop_types.default.string, - enterActive: import_prop_types.default.string, - exit: import_prop_types.default.string, - exitDone: import_prop_types.default.string, - exitActive: import_prop_types.default.string -})]) : null; - -// node_modules/react-transition-group/esm/TransitionGroupContext.js -var import_react51 = __toESM(require_react()); -var TransitionGroupContext_default = import_react51.default.createContext(null); - -// node_modules/react-transition-group/esm/utils/reflow.js -var forceReflow = function forceReflow2(node) { - return node.scrollTop; -}; - -// node_modules/react-transition-group/esm/Transition.js -var UNMOUNTED = "unmounted"; -var EXITED = "exited"; -var ENTERING = "entering"; -var ENTERED = "entered"; -var EXITING = "exiting"; -var Transition = function(_React$Component) { - _inheritsLoose(Transition3, _React$Component); - function Transition3(props2, context) { - var _this; - _this = _React$Component.call(this, props2, context) || this; - var parentGroup = context; - var appear = parentGroup && !parentGroup.isMounting ? props2.enter : props2.appear; - var initialStatus; - _this.appearStatus = null; - if (props2.in) { - if (appear) { - initialStatus = EXITED; - _this.appearStatus = ENTERING; - } else { - initialStatus = ENTERED; - } - } else { - if (props2.unmountOnExit || props2.mountOnEnter) { - initialStatus = UNMOUNTED; - } else { - initialStatus = EXITED; - } - } - _this.state = { - status: initialStatus - }; - _this.nextCallback = null; - return _this; - } - Transition3.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) { - var nextIn = _ref.in; - if (nextIn && prevState.status === UNMOUNTED) { - return { - status: EXITED - }; - } - return null; - }; - var _proto = Transition3.prototype; - _proto.componentDidMount = function componentDidMount() { - this.updateStatus(true, this.appearStatus); - }; - _proto.componentDidUpdate = function componentDidUpdate(prevProps) { - var nextStatus = null; - if (prevProps !== this.props) { - var status = this.state.status; - if (this.props.in) { - if (status !== ENTERING && status !== ENTERED) { - nextStatus = ENTERING; - } - } else { - if (status === ENTERING || status === ENTERED) { - nextStatus = EXITING; - } - } - } - this.updateStatus(false, nextStatus); - }; - _proto.componentWillUnmount = function componentWillUnmount() { - this.cancelNextCallback(); - }; - _proto.getTimeouts = function getTimeouts() { - var timeout2 = this.props.timeout; - var exit, enter, appear; - exit = enter = appear = timeout2; - if (timeout2 != null && typeof timeout2 !== "number") { - exit = timeout2.exit; - enter = timeout2.enter; - appear = timeout2.appear !== void 0 ? timeout2.appear : enter; - } - return { - exit, - enter, - appear - }; - }; - _proto.updateStatus = function updateStatus(mounting, nextStatus) { - if (mounting === void 0) { - mounting = false; - } - if (nextStatus !== null) { - this.cancelNextCallback(); - if (nextStatus === ENTERING) { - if (this.props.unmountOnExit || this.props.mountOnEnter) { - var node = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom2.default.findDOMNode(this); - if (node) forceReflow(node); - } - this.performEnter(mounting); - } else { - this.performExit(); - } - } else if (this.props.unmountOnExit && this.state.status === EXITED) { - this.setState({ - status: UNMOUNTED - }); - } - }; - _proto.performEnter = function performEnter(mounting) { - var _this2 = this; - var enter = this.props.enter; - var appearing = this.context ? this.context.isMounting : mounting; - var _ref2 = this.props.nodeRef ? [appearing] : [import_react_dom2.default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1]; - var timeouts = this.getTimeouts(); - var enterTimeout = appearing ? timeouts.appear : timeouts.enter; - if (!mounting && !enter || config_default.disabled) { - this.safeSetState({ - status: ENTERED - }, function() { - _this2.props.onEntered(maybeNode); - }); - return; - } - this.props.onEnter(maybeNode, maybeAppearing); - this.safeSetState({ - status: ENTERING - }, function() { - _this2.props.onEntering(maybeNode, maybeAppearing); - _this2.onTransitionEnd(enterTimeout, function() { - _this2.safeSetState({ - status: ENTERED - }, function() { - _this2.props.onEntered(maybeNode, maybeAppearing); - }); - }); - }); - }; - _proto.performExit = function performExit() { - var _this3 = this; - var exit = this.props.exit; - var timeouts = this.getTimeouts(); - var maybeNode = this.props.nodeRef ? void 0 : import_react_dom2.default.findDOMNode(this); - if (!exit || config_default.disabled) { - this.safeSetState({ - status: EXITED - }, function() { - _this3.props.onExited(maybeNode); - }); - return; - } - this.props.onExit(maybeNode); - this.safeSetState({ - status: EXITING - }, function() { - _this3.props.onExiting(maybeNode); - _this3.onTransitionEnd(timeouts.exit, function() { - _this3.safeSetState({ - status: EXITED - }, function() { - _this3.props.onExited(maybeNode); - }); - }); - }); - }; - _proto.cancelNextCallback = function cancelNextCallback() { - if (this.nextCallback !== null) { - this.nextCallback.cancel(); - this.nextCallback = null; - } - }; - _proto.safeSetState = function safeSetState(nextState, callback) { - callback = this.setNextCallback(callback); - this.setState(nextState, callback); - }; - _proto.setNextCallback = function setNextCallback(callback) { - var _this4 = this; - var active = true; - this.nextCallback = function(event) { - if (active) { - active = false; - _this4.nextCallback = null; - callback(event); - } - }; - this.nextCallback.cancel = function() { - active = false; - }; - return this.nextCallback; - }; - _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) { - this.setNextCallback(handler); - var node = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom2.default.findDOMNode(this); - var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener; - if (!node || doesNotHaveTimeoutOrListener) { - setTimeout(this.nextCallback, 0); - return; - } - if (this.props.addEndListener) { - var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1]; - this.props.addEndListener(maybeNode, maybeNextCallback); - } - if (timeout2 != null) { - setTimeout(this.nextCallback, timeout2); - } - }; - _proto.render = function render2() { - var status = this.state.status; - if (status === UNMOUNTED) { - return null; - } - var _this$props = this.props, children2 = _this$props.children, _in = _this$props.in, _mountOnEnter = _this$props.mountOnEnter, _unmountOnExit = _this$props.unmountOnExit, _appear = _this$props.appear, _enter = _this$props.enter, _exit = _this$props.exit, _timeout = _this$props.timeout, _addEndListener = _this$props.addEndListener, _onEnter = _this$props.onEnter, _onEntering = _this$props.onEntering, _onEntered = _this$props.onEntered, _onExit = _this$props.onExit, _onExiting = _this$props.onExiting, _onExited = _this$props.onExited, _nodeRef = _this$props.nodeRef, childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]); - return ( - // allows for nested Transitions - import_react52.default.createElement(TransitionGroupContext_default.Provider, { - value: null - }, typeof children2 === "function" ? children2(status, childProps) : import_react52.default.cloneElement(import_react52.default.Children.only(children2), childProps)) - ); - }; - return Transition3; -}(import_react52.default.Component); -Transition.contextType = TransitionGroupContext_default; -Transition.propTypes = true ? { - /** - * A React reference to DOM element that need to transition: - * https://stackoverflow.com/a/51127130/4671932 - * - * - When `nodeRef` prop is used, `node` is not passed to callback functions - * (e.g. `onEnter`) because user already has direct access to the node. - * - When changing `key` prop of `Transition` in a `TransitionGroup` a new - * `nodeRef` need to be provided to `Transition` with changed `key` prop - * (see - * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). - */ - nodeRef: import_prop_types2.default.shape({ - current: typeof Element === "undefined" ? import_prop_types2.default.any : function(propValue, key2, componentName3, location, propFullName, secret) { - var value = propValue[key2]; - return import_prop_types2.default.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key2, componentName3, location, propFullName, secret); - } - }), - /** - * A `function` child can be used instead of a React element. This function is - * called with the current transition status (`'entering'`, `'entered'`, - * `'exiting'`, `'exited'`), which can be used to apply context - * specific props to a component. - * - * ```jsx - * - * {state => ( - * - * )} - * - * ``` - */ - children: import_prop_types2.default.oneOfType([import_prop_types2.default.func.isRequired, import_prop_types2.default.element.isRequired]).isRequired, - /** - * Show the component; triggers the enter or exit states - */ - in: import_prop_types2.default.bool, - /** - * By default the child component is mounted immediately along with - * the parent `Transition` component. If you want to "lazy mount" the component on the - * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay - * mounted, even on "exited", unless you also specify `unmountOnExit`. - */ - mountOnEnter: import_prop_types2.default.bool, - /** - * By default the child component stays mounted after it reaches the `'exited'` state. - * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. - */ - unmountOnExit: import_prop_types2.default.bool, - /** - * By default the child component does not perform the enter transition when - * it first mounts, regardless of the value of `in`. If you want this - * behavior, set both `appear` and `in` to `true`. - * - * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop - * > only adds an additional enter transition. However, in the - * > `` component that first enter transition does result in - * > additional `.appear-*` classes, that way you can choose to style it - * > differently. - */ - appear: import_prop_types2.default.bool, - /** - * Enable or disable enter transitions. - */ - enter: import_prop_types2.default.bool, - /** - * Enable or disable exit transitions. - */ - exit: import_prop_types2.default.bool, - /** - * The duration of the transition, in milliseconds. - * Required unless `addEndListener` is provided. - * - * You may specify a single timeout for all transitions: - * - * ```jsx - * timeout={500} - * ``` - * - * or individually: - * - * ```jsx - * timeout={{ - * appear: 500, - * enter: 300, - * exit: 500, - * }} - * ``` - * - * - `appear` defaults to the value of `enter` - * - `enter` defaults to `0` - * - `exit` defaults to `0` - * - * @type {number | { enter?: number, exit?: number, appear?: number }} - */ - timeout: function timeout(props2) { - var pt = timeoutsShape; - if (!props2.addEndListener) pt = pt.isRequired; - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - return pt.apply(void 0, [props2].concat(args)); - }, - /** - * Add a custom transition end trigger. Called with the transitioning - * DOM node and a `done` callback. Allows for more fine grained transition end - * logic. Timeouts are still used as a fallback if provided. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * ```jsx - * addEndListener={(node, done) => { - * // use the css transitionend event to mark the finish of a transition - * node.addEventListener('transitionend', done, false); - * }} - * ``` - */ - addEndListener: import_prop_types2.default.func, - /** - * Callback fired before the "entering" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) -> void - */ - onEnter: import_prop_types2.default.func, - /** - * Callback fired after the "entering" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) - */ - onEntering: import_prop_types2.default.func, - /** - * Callback fired after the "entered" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) -> void - */ - onEntered: import_prop_types2.default.func, - /** - * Callback fired before the "exiting" status is applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement) -> void - */ - onExit: import_prop_types2.default.func, - /** - * Callback fired after the "exiting" status is applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement) -> void - */ - onExiting: import_prop_types2.default.func, - /** - * Callback fired after the "exited" status is applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed - * - * @type Function(node: HtmlElement) -> void - */ - onExited: import_prop_types2.default.func -} : {}; -function noop() { -} -Transition.defaultProps = { - in: false, - mountOnEnter: false, - unmountOnExit: false, - appear: false, - enter: true, - exit: true, - onEnter: noop, - onEntering: noop, - onEntered: noop, - onExit: noop, - onExiting: noop, - onExited: noop -}; -Transition.UNMOUNTED = UNMOUNTED; -Transition.EXITED = EXITED; -Transition.ENTERING = ENTERING; -Transition.ENTERED = ENTERED; -Transition.EXITING = EXITING; -var Transition_default = Transition; - -// node_modules/react-transition-group/esm/CSSTransition.js -var _addClass = function addClass2(node, classes) { - return node && classes && classes.split(" ").forEach(function(c) { - return addClass(node, c); - }); -}; -var removeClass2 = function removeClass3(node, classes) { - return node && classes && classes.split(" ").forEach(function(c) { - return removeClass(node, c); - }); -}; -var CSSTransition = function(_React$Component) { - _inheritsLoose(CSSTransition2, _React$Component); - function CSSTransition2() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; - _this.appliedClasses = { - appear: {}, - enter: {}, - exit: {} - }; - _this.onEnter = function(maybeNode, maybeAppearing) { - var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument[0], appearing = _this$resolveArgument[1]; - _this.removeClasses(node, "exit"); - _this.addClass(node, appearing ? "appear" : "enter", "base"); - if (_this.props.onEnter) { - _this.props.onEnter(maybeNode, maybeAppearing); - } - }; - _this.onEntering = function(maybeNode, maybeAppearing) { - var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument2[0], appearing = _this$resolveArgument2[1]; - var type = appearing ? "appear" : "enter"; - _this.addClass(node, type, "active"); - if (_this.props.onEntering) { - _this.props.onEntering(maybeNode, maybeAppearing); - } - }; - _this.onEntered = function(maybeNode, maybeAppearing) { - var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument3[0], appearing = _this$resolveArgument3[1]; - var type = appearing ? "appear" : "enter"; - _this.removeClasses(node, type); - _this.addClass(node, type, "done"); - if (_this.props.onEntered) { - _this.props.onEntered(maybeNode, maybeAppearing); - } - }; - _this.onExit = function(maybeNode) { - var _this$resolveArgument4 = _this.resolveArguments(maybeNode), node = _this$resolveArgument4[0]; - _this.removeClasses(node, "appear"); - _this.removeClasses(node, "enter"); - _this.addClass(node, "exit", "base"); - if (_this.props.onExit) { - _this.props.onExit(maybeNode); - } - }; - _this.onExiting = function(maybeNode) { - var _this$resolveArgument5 = _this.resolveArguments(maybeNode), node = _this$resolveArgument5[0]; - _this.addClass(node, "exit", "active"); - if (_this.props.onExiting) { - _this.props.onExiting(maybeNode); - } - }; - _this.onExited = function(maybeNode) { - var _this$resolveArgument6 = _this.resolveArguments(maybeNode), node = _this$resolveArgument6[0]; - _this.removeClasses(node, "exit"); - _this.addClass(node, "exit", "done"); - if (_this.props.onExited) { - _this.props.onExited(maybeNode); - } - }; - _this.resolveArguments = function(maybeNode, maybeAppearing) { - return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] : [maybeNode, maybeAppearing]; - }; - _this.getClassNames = function(type) { - var classNames = _this.props.classNames; - var isStringClassNames = typeof classNames === "string"; - var prefix = isStringClassNames && classNames ? classNames + "-" : ""; - var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type]; - var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"]; - var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"]; - return { - baseClassName, - activeClassName, - doneClassName - }; - }; - return _this; - } - var _proto = CSSTransition2.prototype; - _proto.addClass = function addClass3(node, type, phase) { - var className2 = this.getClassNames(type)[phase + "ClassName"]; - var _this$getClassNames = this.getClassNames("enter"), doneClassName = _this$getClassNames.doneClassName; - if (type === "appear" && phase === "done" && doneClassName) { - className2 += " " + doneClassName; - } - if (phase === "active") { - if (node) forceReflow(node); - } - if (className2) { - this.appliedClasses[type][phase] = className2; - _addClass(node, className2); - } - }; - _proto.removeClasses = function removeClasses(node, type) { - var _this$appliedClasses$ = this.appliedClasses[type], baseClassName = _this$appliedClasses$.base, activeClassName = _this$appliedClasses$.active, doneClassName = _this$appliedClasses$.done; - this.appliedClasses[type] = {}; - if (baseClassName) { - removeClass2(node, baseClassName); - } - if (activeClassName) { - removeClass2(node, activeClassName); - } - if (doneClassName) { - removeClass2(node, doneClassName); - } - }; - _proto.render = function render2() { - var _this$props = this.props, _ = _this$props.classNames, props2 = _objectWithoutPropertiesLoose(_this$props, ["classNames"]); - return import_react53.default.createElement(Transition_default, _extends({}, props2, { - onEnter: this.onEnter, - onEntered: this.onEntered, - onEntering: this.onEntering, - onExit: this.onExit, - onExiting: this.onExiting, - onExited: this.onExited - })); - }; - return CSSTransition2; -}(import_react53.default.Component); -CSSTransition.defaultProps = { - classNames: "" -}; -CSSTransition.propTypes = true ? _extends({}, Transition_default.propTypes, { - /** - * The animation classNames applied to the component as it appears, enters, - * exits or has finished the transition. A single name can be provided, which - * will be suffixed for each stage, e.g. `classNames="fade"` applies: - * - * - `fade-appear`, `fade-appear-active`, `fade-appear-done` - * - `fade-enter`, `fade-enter-active`, `fade-enter-done` - * - `fade-exit`, `fade-exit-active`, `fade-exit-done` - * - * A few details to note about how these classes are applied: - * - * 1. They are _joined_ with the ones that are already defined on the child - * component, so if you want to add some base styles, you can use - * `className` without worrying that it will be overridden. - * - * 2. If the transition component mounts with `in={false}`, no classes are - * applied yet. You might be expecting `*-exit-done`, but if you think - * about it, a component cannot finish exiting if it hasn't entered yet. - * - * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This - * allows you to define different behavior for when appearing is done and - * when regular entering is done, using selectors like - * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply - * an epic entrance animation when element first appears in the DOM using - * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can - * simply use `fade-enter-done` for defining both cases. - * - * Each individual classNames can also be specified independently like: - * - * ```js - * classNames={{ - * appear: 'my-appear', - * appearActive: 'my-active-appear', - * appearDone: 'my-done-appear', - * enter: 'my-enter', - * enterActive: 'my-active-enter', - * enterDone: 'my-done-enter', - * exit: 'my-exit', - * exitActive: 'my-active-exit', - * exitDone: 'my-done-exit', - * }} - * ``` - * - * If you want to set these classes using CSS Modules: - * - * ```js - * import styles from './styles.css'; - * ``` - * - * you might want to use camelCase in your CSS file, that way could simply - * spread them instead of listing them one by one: - * - * ```js - * classNames={{ ...styles }} - * ``` - * - * @type {string | { - * appear?: string, - * appearActive?: string, - * appearDone?: string, - * enter?: string, - * enterActive?: string, - * enterDone?: string, - * exit?: string, - * exitActive?: string, - * exitDone?: string, - * }} - */ - classNames: classNamesShape, - /** - * A `` callback fired immediately after the 'enter' or 'appear' class is - * applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) - */ - onEnter: import_prop_types3.default.func, - /** - * A `` callback fired immediately after the 'enter-active' or - * 'appear-active' class is applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) - */ - onEntering: import_prop_types3.default.func, - /** - * A `` callback fired immediately after the 'enter' or - * 'appear' classes are **removed** and the `done` class is added to the DOM node. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed. - * - * @type Function(node: HtmlElement, isAppearing: bool) - */ - onEntered: import_prop_types3.default.func, - /** - * A `` callback fired immediately after the 'exit' class is - * applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed - * - * @type Function(node: HtmlElement) - */ - onExit: import_prop_types3.default.func, - /** - * A `` callback fired immediately after the 'exit-active' is applied. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed - * - * @type Function(node: HtmlElement) - */ - onExiting: import_prop_types3.default.func, - /** - * A `` callback fired immediately after the 'exit' classes - * are **removed** and the `exit-done` class is added to the DOM node. - * - * **Note**: when `nodeRef` prop is passed, `node` is not passed - * - * @type Function(node: HtmlElement) - */ - onExited: import_prop_types3.default.func -}) : {}; -var CSSTransition_default = CSSTransition; - -// node_modules/react-transition-group/esm/ReplaceTransition.js -var import_prop_types5 = __toESM(require_prop_types()); -var import_react56 = __toESM(require_react()); -var import_react_dom3 = __toESM(require_react_dom()); - -// node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; -} - -// node_modules/react-transition-group/esm/TransitionGroup.js -var import_prop_types4 = __toESM(require_prop_types()); -var import_react55 = __toESM(require_react()); - -// node_modules/react-transition-group/esm/utils/ChildMapping.js -var import_react54 = __toESM(require_react()); -function getChildMapping(children2, mapFn) { - var mapper = function mapper2(child) { - return mapFn && (0, import_react54.isValidElement)(child) ? mapFn(child) : child; - }; - var result = /* @__PURE__ */ Object.create(null); - if (children2) import_react54.Children.map(children2, function(c) { - return c; - }).forEach(function(child) { - result[child.key] = mapper(child); - }); - return result; -} -function mergeChildMappings(prev, next) { - prev = prev || {}; - next = next || {}; - function getValueForKey(key2) { - return key2 in next ? next[key2] : prev[key2]; - } - var nextKeysPending = /* @__PURE__ */ Object.create(null); - var pendingKeys = []; - for (var prevKey in prev) { - if (prevKey in next) { - if (pendingKeys.length) { - nextKeysPending[prevKey] = pendingKeys; - pendingKeys = []; - } - } else { - pendingKeys.push(prevKey); - } - } - var i; - var childMapping = {}; - for (var nextKey in next) { - if (nextKeysPending[nextKey]) { - for (i = 0; i < nextKeysPending[nextKey].length; i++) { - var pendingNextKey = nextKeysPending[nextKey][i]; - childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey); - } - } - childMapping[nextKey] = getValueForKey(nextKey); - } - for (i = 0; i < pendingKeys.length; i++) { - childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]); - } - return childMapping; -} -function getProp(child, prop, props2) { - return props2[prop] != null ? props2[prop] : child.props[prop]; -} -function getInitialChildMapping(props2, onExited) { - return getChildMapping(props2.children, function(child) { - return (0, import_react54.cloneElement)(child, { - onExited: onExited.bind(null, child), - in: true, - appear: getProp(child, "appear", props2), - enter: getProp(child, "enter", props2), - exit: getProp(child, "exit", props2) - }); - }); -} -function getNextChildMapping(nextProps, prevChildMapping, onExited) { - var nextChildMapping = getChildMapping(nextProps.children); - var children2 = mergeChildMappings(prevChildMapping, nextChildMapping); - Object.keys(children2).forEach(function(key2) { - var child = children2[key2]; - if (!(0, import_react54.isValidElement)(child)) return; - var hasPrev = key2 in prevChildMapping; - var hasNext = key2 in nextChildMapping; - var prevChild = prevChildMapping[key2]; - var isLeaving = (0, import_react54.isValidElement)(prevChild) && !prevChild.props.in; - if (hasNext && (!hasPrev || isLeaving)) { - children2[key2] = (0, import_react54.cloneElement)(child, { - onExited: onExited.bind(null, child), - in: true, - exit: getProp(child, "exit", nextProps), - enter: getProp(child, "enter", nextProps) - }); - } else if (!hasNext && hasPrev && !isLeaving) { - children2[key2] = (0, import_react54.cloneElement)(child, { - in: false - }); - } else if (hasNext && hasPrev && (0, import_react54.isValidElement)(prevChild)) { - children2[key2] = (0, import_react54.cloneElement)(child, { - onExited: onExited.bind(null, child), - in: prevChild.props.in, - exit: getProp(child, "exit", nextProps), - enter: getProp(child, "enter", nextProps) - }); - } - }); - return children2; -} - -// node_modules/react-transition-group/esm/TransitionGroup.js -var values = Object.values || function(obj) { - return Object.keys(obj).map(function(k2) { - return obj[k2]; - }); -}; -var defaultProps = { - component: "div", - childFactory: function childFactory(child) { - return child; - } -}; -var TransitionGroup = function(_React$Component) { - _inheritsLoose(TransitionGroup2, _React$Component); - function TransitionGroup2(props2, context) { - var _this; - _this = _React$Component.call(this, props2, context) || this; - var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); - _this.state = { - contextValue: { - isMounting: true - }, - handleExited, - firstRender: true - }; - return _this; - } - var _proto = TransitionGroup2.prototype; - _proto.componentDidMount = function componentDidMount() { - this.mounted = true; - this.setState({ - contextValue: { - isMounting: false - } - }); - }; - _proto.componentWillUnmount = function componentWillUnmount() { - this.mounted = false; - }; - TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) { - var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender; - return { - children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited), - firstRender: false - }; - }; - _proto.handleExited = function handleExited(child, node) { - var currentChildMapping = getChildMapping(this.props.children); - if (child.key in currentChildMapping) return; - if (child.props.onExited) { - child.props.onExited(node); - } - if (this.mounted) { - this.setState(function(state) { - var children2 = _extends({}, state.children); - delete children2[child.key]; - return { - children: children2 - }; - }); - } - }; - _proto.render = function render2() { - var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props2 = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]); - var contextValue = this.state.contextValue; - var children2 = values(this.state.children).map(childFactory2); - delete props2.appear; - delete props2.enter; - delete props2.exit; - if (Component === null) { - return import_react55.default.createElement(TransitionGroupContext_default.Provider, { - value: contextValue - }, children2); - } - return import_react55.default.createElement(TransitionGroupContext_default.Provider, { - value: contextValue - }, import_react55.default.createElement(Component, props2, children2)); - }; - return TransitionGroup2; -}(import_react55.default.Component); -TransitionGroup.propTypes = true ? { - /** - * `` renders a `
` by default. You can change this - * behavior by providing a `component` prop. - * If you use React v16+ and would like to avoid a wrapping `
` element - * you can pass in `component={null}`. This is useful if the wrapping div - * borks your css styles. - */ - component: import_prop_types4.default.any, - /** - * A set of `` components, that are toggled `in` and out as they - * leave. the `` will inject specific transition props, so - * remember to spread them through if you are wrapping the `` as - * with our `` example. - * - * While this component is meant for multiple `Transition` or `CSSTransition` - * children, sometimes you may want to have a single transition child with - * content that you want to be transitioned out and in when you change it - * (e.g. routes, images etc.) In that case you can change the `key` prop of - * the transition child as you change its content, this will cause - * `TransitionGroup` to transition the child out and back in. - */ - children: import_prop_types4.default.node, - /** - * A convenience prop that enables or disables appear animations - * for all children. Note that specifying this will override any defaults set - * on individual children Transitions. - */ - appear: import_prop_types4.default.bool, - /** - * A convenience prop that enables or disables enter animations - * for all children. Note that specifying this will override any defaults set - * on individual children Transitions. - */ - enter: import_prop_types4.default.bool, - /** - * A convenience prop that enables or disables exit animations - * for all children. Note that specifying this will override any defaults set - * on individual children Transitions. - */ - exit: import_prop_types4.default.bool, - /** - * You may need to apply reactive updates to a child as it is exiting. - * This is generally done by using `cloneElement` however in the case of an exiting - * child the element has already been removed and not accessible to the consumer. - * - * If you do need to update a child as it leaves you can provide a `childFactory` - * to wrap every child, even the ones that are leaving. - * - * @type Function(child: ReactElement) -> ReactElement - */ - childFactory: import_prop_types4.default.func -} : {}; -TransitionGroup.defaultProps = defaultProps; -var TransitionGroup_default = TransitionGroup; - -// node_modules/react-transition-group/esm/ReplaceTransition.js -var ReplaceTransition = function(_React$Component) { - _inheritsLoose(ReplaceTransition2, _React$Component); - function ReplaceTransition2() { - var _this; - for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { - _args[_key] = arguments[_key]; - } - _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this; - _this.handleEnter = function() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return _this.handleLifecycle("onEnter", 0, args); - }; - _this.handleEntering = function() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - return _this.handleLifecycle("onEntering", 0, args); - }; - _this.handleEntered = function() { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - return _this.handleLifecycle("onEntered", 0, args); - }; - _this.handleExit = function() { - for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - return _this.handleLifecycle("onExit", 1, args); - }; - _this.handleExiting = function() { - for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - args[_key6] = arguments[_key6]; - } - return _this.handleLifecycle("onExiting", 1, args); - }; - _this.handleExited = function() { - for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { - args[_key7] = arguments[_key7]; - } - return _this.handleLifecycle("onExited", 1, args); - }; - return _this; - } - var _proto = ReplaceTransition2.prototype; - _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) { - var _child$props; - var children2 = this.props.children; - var child = import_react56.default.Children.toArray(children2)[idx]; - if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs); - if (this.props[handler]) { - var maybeNode = child.props.nodeRef ? void 0 : import_react_dom3.default.findDOMNode(this); - this.props[handler](maybeNode); - } - }; - _proto.render = function render2() { - var _this$props = this.props, children2 = _this$props.children, inProp = _this$props.in, props2 = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]); - var _React$Children$toArr = import_react56.default.Children.toArray(children2), first = _React$Children$toArr[0], second2 = _React$Children$toArr[1]; - delete props2.onEnter; - delete props2.onEntering; - delete props2.onEntered; - delete props2.onExit; - delete props2.onExiting; - delete props2.onExited; - return import_react56.default.createElement(TransitionGroup_default, props2, inProp ? import_react56.default.cloneElement(first, { - key: "first", - onEnter: this.handleEnter, - onEntering: this.handleEntering, - onEntered: this.handleEntered - }) : import_react56.default.cloneElement(second2, { - key: "second", - onEnter: this.handleExit, - onEntering: this.handleExiting, - onEntered: this.handleExited - })); - }; - return ReplaceTransition2; -}(import_react56.default.Component); -ReplaceTransition.propTypes = true ? { - in: import_prop_types5.default.bool.isRequired, - children: function children(props2, propName) { - if (import_react56.default.Children.count(props2[propName]) !== 2) return new Error('"' + propName + '" must be exactly two transition components.'); - return null; - } -} : {}; - -// node_modules/react-transition-group/esm/SwitchTransition.js -var import_react57 = __toESM(require_react()); -var import_prop_types6 = __toESM(require_prop_types()); -var _leaveRenders; -var _enterRenders; -function areChildrenDifferent(oldChildren, newChildren) { - if (oldChildren === newChildren) return false; - if (import_react57.default.isValidElement(oldChildren) && import_react57.default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) { - return false; - } - return true; -} -var modes = { - out: "out-in", - in: "in-out" -}; -var callHook = function callHook2(element, name, cb) { - return function() { - var _element$props; - element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments); - cb(); - }; -}; -var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function(_ref) { - var current = _ref.current, changeState = _ref.changeState; - return import_react57.default.cloneElement(current, { - in: false, - onExited: callHook(current, "onExited", function() { - changeState(ENTERING, null); - }) - }); -}, _leaveRenders[modes.in] = function(_ref2) { - var current = _ref2.current, changeState = _ref2.changeState, children2 = _ref2.children; - return [current, import_react57.default.cloneElement(children2, { - in: true, - onEntered: callHook(children2, "onEntered", function() { - changeState(ENTERING); - }) - })]; -}, _leaveRenders); -var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function(_ref3) { - var children2 = _ref3.children, changeState = _ref3.changeState; - return import_react57.default.cloneElement(children2, { - in: true, - onEntered: callHook(children2, "onEntered", function() { - changeState(ENTERED, import_react57.default.cloneElement(children2, { - in: true - })); - }) - }); -}, _enterRenders[modes.in] = function(_ref4) { - var current = _ref4.current, children2 = _ref4.children, changeState = _ref4.changeState; - return [import_react57.default.cloneElement(current, { - in: false, - onExited: callHook(current, "onExited", function() { - changeState(ENTERED, import_react57.default.cloneElement(children2, { - in: true - })); - }) - }), import_react57.default.cloneElement(children2, { - in: true - })]; -}, _enterRenders); -var SwitchTransition = function(_React$Component) { - _inheritsLoose(SwitchTransition2, _React$Component); - function SwitchTransition2() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; - _this.state = { - status: ENTERED, - current: null - }; - _this.appeared = false; - _this.changeState = function(status, current) { - if (current === void 0) { - current = _this.state.current; - } - _this.setState({ - status, - current - }); - }; - return _this; - } - var _proto = SwitchTransition2.prototype; - _proto.componentDidMount = function componentDidMount() { - this.appeared = true; - }; - SwitchTransition2.getDerivedStateFromProps = function getDerivedStateFromProps(props2, state) { - if (props2.children == null) { - return { - current: null - }; - } - if (state.status === ENTERING && props2.mode === modes.in) { - return { - status: ENTERING - }; - } - if (state.current && areChildrenDifferent(state.current, props2.children)) { - return { - status: EXITING - }; - } - return { - current: import_react57.default.cloneElement(props2.children, { - in: true - }) - }; - }; - _proto.render = function render2() { - var _this$props = this.props, children2 = _this$props.children, mode = _this$props.mode, _this$state = this.state, status = _this$state.status, current = _this$state.current; - var data = { - children: children2, - current, - changeState: this.changeState, - status - }; - var component; - switch (status) { - case ENTERING: - component = enterRenders[mode](data); - break; - case EXITING: - component = leaveRenders[mode](data); - break; - case ENTERED: - component = current; - } - return import_react57.default.createElement(TransitionGroupContext_default.Provider, { - value: { - isMounting: !this.appeared - } - }, component); - }; - return SwitchTransition2; -}(import_react57.default.Component); -SwitchTransition.propTypes = true ? { - /** - * Transition modes. - * `out-in`: Current element transitions out first, then when complete, the new element transitions in. - * `in-out`: New element transitions in first, then when complete, the current element transitions out. - * - * @type {'out-in'|'in-out'} - */ - mode: import_prop_types6.default.oneOf([modes.in, modes.out]), - /** - * Any `Transition` or `CSSTransition` component. - */ - children: import_prop_types6.default.oneOfType([import_prop_types6.default.element.isRequired]) -} : {}; -SwitchTransition.defaultProps = { - mode: modes.out -}; - -// node_modules/@cloudscape-design/components/internal/components/transition/index.js -function Transition2(_a2) { - var { in: isIn, children: children2, exit = true, onStatusChange = () => void 0, disabled = false, transitionChangeDelay } = _a2, rest = __rest(_a2, ["in", "children", "exit", "onStatusChange", "disabled", "transitionChangeDelay"]); - const transitionRootElement = (0, import_react59.useRef)(null); - const [transitionState, setTransitionState] = (0, import_react58.useState)(isIn ? "entered" : "exited"); - const motionDisabled = useReducedMotion(transitionRootElement) || disabled; - const addTransitionEndListener = (0, import_react59.useCallback)((done) => { - const node = transitionRootElement.current; - if (node === null) { - return; - } - const listener = (e) => { - if (e.target === node) { - node.removeEventListener("transitionend", listener); - node.removeEventListener("animationend", listener); - done(); - } - }; - node.addEventListener("transitionend", listener); - node.addEventListener("animationend", listener); - }, []); - return import_react58.default.createElement(Transition_default, Object.assign({ addEndListener: addTransitionEndListener, timeout: motionDisabled ? 0 : void 0, in: isIn, nodeRef: transitionRootElement, exit, onEnter: (isAppearing) => { - if (!isAppearing) { - setTransitionState("enter"); - onStatusChange("enter"); - } - }, onEntering: (isAppearing) => { - var _a3; - if (!isAppearing) { - void ((_a3 = transitionRootElement.current) === null || _a3 === void 0 ? void 0 : _a3.offsetHeight); - if (transitionChangeDelay === null || transitionChangeDelay === void 0 ? void 0 : transitionChangeDelay.entering) { - setTimeout(() => { - setTransitionState("entering"); - onStatusChange("entering"); - }, transitionChangeDelay === null || transitionChangeDelay === void 0 ? void 0 : transitionChangeDelay.entering); - } else { - setTransitionState("entering"); - onStatusChange("entering"); - } - } - }, onEntered: (isAppearing) => { - if (!isAppearing) { - setTransitionState("entered"); - onStatusChange("entered"); - } - }, onExit: () => { - setTransitionState("exit"); - onStatusChange("exit"); - }, onExiting: () => { - setTransitionState("exiting"); - onStatusChange("exiting"); - }, onExited: () => { - setTransitionState("exited"); - onStatusChange("exited"); - } }, rest), () => children2(transitionState, transitionRootElement)); -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-portal-mode-classes/index.js -function usePortalModeClasses(ref) { - const colorMode = useCurrentMode(ref); - const densityMode = useDensityMode(ref); - const context = useVisualContext(ref); - const visualRefresh = useVisualRefresh(); - return clsx_m_default({ - "awsui-polaris-dark-mode awsui-dark-mode": colorMode === "dark", - "awsui-polaris-compact-mode awsui-compact-mode": densityMode === "compact", - "awsui-visual-refresh": visualRefresh, - [`awsui-context-${context}`]: context - }); -} - -// node_modules/@cloudscape-design/components/internal/components/dropdown/context.js -var import_react60 = __toESM(require_react()); -var DropdownContext = import_react60.default.createContext({ - position: "bottom-right" -}); -function DropdownContextProvider({ children: children2, position = "bottom-right" }) { - return import_react60.default.createElement(DropdownContext.Provider, { value: { position } }, children2); -} -function useDropdownContext() { - return (0, import_react60.useContext)(DropdownContext); -} - -// node_modules/@cloudscape-design/components/internal/generated/custom-css-properties/index.js -var customCSSPropertiesMap = { - breadcrumbsGap: "--awsui-breadcrumbs-gap-lgosor", - contentGapLeft: "--awsui-content-gap-left-lgosor", - contentGapRight: "--awsui-content-gap-right-lgosor", - contentHeight: "--awsui-content-height-lgosor", - defaultMaxContentWidth: "--awsui-default-max-content-width-lgosor", - defaultMinContentWidth: "--awsui-default-min-content-width-lgosor", - drawerSize: "--awsui-drawer-size-lgosor", - footerHeight: "--awsui-footer-height-lgosor", - headerGap: "--awsui-header-gap-lgosor", - headerHeight: "--awsui-header-height-lgosor", - layoutWidth: "--awsui-layout-width-lgosor", - mainGap: "--awsui-main-gap-lgosor", - mainOffsetLeft: "--awsui-main-offset-left-lgosor", - mainTemplateRows: "--awsui-main-template-rows-lgosor", - maxContentWidth: "--awsui-max-content-width-lgosor", - minContentWidth: "--awsui-min-content-width-lgosor", - mobileBarHeight: "--awsui-mobile-bar-height-lgosor", - notificationsGap: "--awsui-notifications-gap-lgosor", - notificationsHeight: "--awsui-notifications-height-lgosor", - offsetTop: "--awsui-offset-top-lgosor", - offsetTopWithNotifications: "--awsui-offset-top-with-notifications-lgosor", - overlapHeight: "--awsui-overlap-height-lgosor", - navigationWidth: "--awsui-navigation-width-lgosor", - splitPanelReportedHeaderSize: "--awsui-split-panel-reported-header-size-lgosor", - splitPanelReportedSize: "--awsui-split-panel-reported-size-lgosor", - splitPanelHeight: "--awsui-split-panel-height-lgosor", - splitPanelMinWidth: "--awsui-split-panel-min-width-lgosor", - splitPanelMaxWidth: "--awsui-split-panel-max-width-lgosor", - toolsMaxWidth: "--awsui-tools-max-width-lgosor", - toolsWidth: "--awsui-tools-width-lgosor", - toolsAnimationStartingOpacity: "--awsui-tools-animation-starting-opacity-lgosor", - contentScrollMargin: "--awsui-content-scroll-margin-lgosor", - flashbarStackDepth: "--awsui-flashbar-stack-depth-lgosor", - flashbarStackIndex: "--awsui-flashbar-stack-index-lgosor", - flashbarStickyBottomMargin: "--awsui-flashbar-sticky-bottom-margin-lgosor", - stackedNotificationsBottomMargin: "--awsui-stacked-notifications-bottom-margin-lgosor", - stackedNotificationsDefaultBottomMargin: "--awsui-stacked-notifications-default-bottom-margin-lgosor", - dropdownDefaultMaxWidth: "--awsui-dropdown-default-max-width-lgosor", - spinnerRotatorFrom: "--awsui-spinner-rotator-from-lgosor", - spinnerRotatorTo: "--awsui-spinner-rotator-to-lgosor", - spinnerLineLeftFrom: "--awsui-spinner-line-left-from-lgosor", - spinnerLineLeftTo: "--awsui-spinner-line-left-to-lgosor", - spinnerLineRightFrom: "--awsui-spinner-line-right-from-lgosor", - spinnerLineRightTo: "--awsui-spinner-line-right-to-lgosor" -}; -var custom_css_properties_default = customCSSPropertiesMap; - -// node_modules/@cloudscape-design/components/internal/components/dropdown/index.js -var DropdownContainer = ({ children: children2, renderWithPortal = false, id, referrerId, open }) => { - if (renderWithPortal) { - if (open) { - return (0, import_react_dom4.createPortal)(import_react61.default.createElement("div", { id, "data-awsui-referrer-id": referrerId }, children2), document.body); - } else { - return null; - } - } else { - return import_react61.default.createElement(import_react61.default.Fragment, null, children2); - } -}; -var TransitionContent = ({ state, transitionRef, dropdownClasses, stretchWidth, interior, isRefresh, dropdownRef, verticalContainerRef, expandToViewport, stretchBeyondTriggerWidth, header, children: children2, footer, position, open, onMouseDown, id, role, ariaLabelledby, ariaDescribedby }) => { - const contentRef = useMergeRefs(dropdownRef, transitionRef); - return import_react61.default.createElement( - "div", - { className: clsx_m_default(styles_css_default17.dropdown, dropdownClasses, { - [styles_css_default17.open]: open, - [styles_css_default17["with-limited-width"]]: !stretchWidth, - [styles_css_default17["hide-block-border"]]: stretchWidth, - [styles_css_default17.interior]: interior, - [styles_css_default17.refresh]: isRefresh, - [styles_css_default17["use-portal"]]: expandToViewport && !interior, - [styles_css_default17["stretch-beyond-trigger-width"]]: stretchBeyondTriggerWidth - }), ref: contentRef, id, role, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-open": open, "data-animating": state !== "exited", "aria-hidden": !open, style: stretchBeyondTriggerWidth ? { [custom_css_properties_default.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}, onMouseDown }, - import_react61.default.createElement( - "div", - { className: clsx_m_default(styles_css_default17["dropdown-content-wrapper"], !header && !children2 && styles_css_default17["is-empty"], isRefresh && styles_css_default17.refresh) }, - import_react61.default.createElement( - "div", - { ref: verticalContainerRef, className: styles_css_default17["dropdown-content"] }, - import_react61.default.createElement( - DropdownContextProvider, - { position }, - header, - children2, - footer - ) - ) - ) - ); -}; -var Dropdown = ({ children: children2, trigger: trigger2, open, onDropdownClose, onMouseDown, header, footer, dropdownId, stretchTriggerHeight = false, stretchWidth = true, stretchHeight = false, stretchToTriggerWidth = true, stretchBeyondTriggerWidth = false, expandToViewport = false, preferCenter = false, interior = false, minWidth, scrollable = true, loopFocus = expandToViewport, onFocus, onBlur, contentKey, dropdownContentId, dropdownContentRole, ariaLabelledby, ariaDescribedby }) => { - const wrapperRef = (0, import_react61.useRef)(null); - const triggerRef = (0, import_react61.useRef)(null); - const dropdownRef = (0, import_react61.useRef)(null); - const dropdownContainerRef = (0, import_react61.useRef)(null); - const verticalContainerRef = (0, import_react61.useRef)(null); - const fixedPosition = (0, import_react61.useRef)(null); - const isRefresh = useVisualRefresh(); - const dropdownClasses = usePortalModeClasses(triggerRef); - const [position, setPosition] = (0, import_react61.useState)("bottom-right"); - const isMobile = useMobile(); - const setDropdownPosition = (position2, triggerBox, target, verticalContainer) => { - const entireWidth = !interior && stretchWidth; - if (!stretchWidth) { - verticalContainer.style.maxBlockSize = `${parseInt(position2.blockSize) + 1}px`; - } else { - verticalContainer.style.maxBlockSize = position2.blockSize; - } - if (entireWidth && !expandToViewport) { - if (stretchToTriggerWidth) { - target.classList.add(styles_css_default17["occupy-entire-width"]); - } - } else { - target.style.inlineSize = position2.inlineSize; - } - if (position2.dropBlockStart && !interior) { - target.classList.add(styles_css_default17["dropdown-drop-up"]); - if (!expandToViewport) { - target.style.insetBlockEnd = "100%"; - } - } else { - target.classList.remove(styles_css_default17["dropdown-drop-up"]); - } - target.classList.add(position2.dropInlineStart ? styles_css_default17["dropdown-drop-left"] : styles_css_default17["dropdown-drop-right"]); - if (position2.insetInlineStart && position2.insetInlineStart !== "auto") { - target.style.insetInlineStart = position2.insetInlineStart; - } - if (expandToViewport && !interior) { - target.style.position = "fixed"; - if (position2.dropBlockStart) { - target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`; - } else { - target.style.insetBlockStart = `${triggerBox.bottom}px`; - } - if (position2.dropInlineStart) { - target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position2.inlineSize})`; - } else { - target.style.insetInlineStart = `${triggerBox.left}px`; - } - fixedPosition.current = position2; - return; - } - if (interior && isInteriorPosition(position2)) { - if (position2.dropBlockStart) { - target.style.insetBlockEnd = position2.insetBlockEnd; - } else { - target.style.insetBlockStart = position2.insetBlockStart; - } - target.style.insetInlineStart = position2.insetInlineStart; - } - if (position2.dropBlockStart && position2.dropInlineStart) { - setPosition("top-left"); - } else if (position2.dropBlockStart) { - setPosition("top-right"); - } else if (position2.dropInlineStart) { - setPosition("bottom-left"); - } else { - setPosition("bottom-right"); - } - }; - const isOutsideDropdown = (element) => (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) && (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element)); - const focusHandler = (event) => { - if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) { - fireNonCancelableEvent(onFocus, event); - } - }; - const blurHandler = (event) => { - if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) { - fireNonCancelableEvent(onBlur, event); - } - }; - const fixStretching = () => { - const classNameToRemove = styles_css_default17["stretch-beyond-trigger-width"]; - if (open && stretchBeyondTriggerWidth && dropdownRef.current && triggerRef.current && dropdownRef.current.classList.contains(classNameToRemove) && !hasEnoughSpaceToStretchBeyondTriggerWidth({ - triggerElement: triggerRef.current, - dropdownElement: dropdownRef.current, - desiredMinWidth: minWidth, - expandToViewport, - stretchWidth, - stretchHeight, - isMobile - })) { - dropdownRef.current.classList.remove(classNameToRemove); - } - }; - useResizeObserver(() => dropdownRef.current, fixStretching); - (0, import_react61.useLayoutEffect)(() => { - const onDropdownOpen = () => { - if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) { - if (scrollable) { - dropdownRef.current.classList.add(styles_css_default17.nowrap); - } - setDropdownPosition(...calculatePosition2(dropdownRef.current, triggerRef.current, verticalContainerRef.current, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth, stretchBeyondTriggerWidth), dropdownRef.current, verticalContainerRef.current); - if (scrollable) { - dropdownRef.current.classList.remove(styles_css_default17.nowrap); - } - } - }; - onDropdownOpen(); - if (open) { - window.addEventListener("scroll", onDropdownOpen); - const timeoutId = setTimeout(() => { - window.removeEventListener("scroll", onDropdownOpen); - }, 500); - return () => { - clearTimeout(timeoutId); - window.removeEventListener("scroll", onDropdownOpen); - }; - } - }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]); - (0, import_react61.useEffect)(() => { - if (!open) { - return; - } - const clickListener = (e) => { - if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) { - fireNonCancelableEvent(onDropdownClose); - } - }; - window.addEventListener("click", clickListener, true); - return () => { - window.removeEventListener("click", clickListener, true); - }; - }, [open, onDropdownClose]); - (0, import_react61.useLayoutEffect)(() => { - if (!expandToViewport || !open) { - return; - } - const updateDropdownPosition = () => { - if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) { - const triggerRect = getLogicalBoundingClientRect(triggerRef.current); - const target = dropdownRef.current; - if (fixedPosition.current) { - if (fixedPosition.current.dropBlockStart) { - dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`; - } else { - target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`; - } - if (fixedPosition.current.dropInlineStart) { - target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`; - } else { - target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`; - } - } - } - }; - updateDropdownPosition(); - window.addEventListener("scroll", updateDropdownPosition, true); - window.addEventListener("resize", updateDropdownPosition, true); - return () => { - window.removeEventListener("scroll", updateDropdownPosition, true); - window.removeEventListener("resize", updateDropdownPosition, true); - }; - }, [open, expandToViewport]); - const referrerId = useUniqueId(); - return import_react61.default.createElement( - "div", - { className: clsx_m_default(styles_css_default17.root, interior && styles_css_default17.interior, stretchTriggerHeight && styles_css_default17["stretch-trigger-height"]), ref: wrapperRef, onFocus: focusHandler, onBlur: blurHandler }, - import_react61.default.createElement("div", { id: referrerId, className: clsx_m_default(stretchTriggerHeight && styles_css_default17["stretch-trigger-height"]), ref: triggerRef }, trigger2), - import_react61.default.createElement(TabTrap, { focusNextCallback: () => { - var _a2; - return dropdownRef.current && ((_a2 = getFirstFocusable(dropdownRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus()); - }, disabled: !open || !loopFocus }), - import_react61.default.createElement( - DropdownContainer, - { renderWithPortal: expandToViewport && !interior, id: dropdownId, referrerId, open }, - import_react61.default.createElement(Transition2, { in: open !== null && open !== void 0 ? open : false, exit: false }, (state, ref) => import_react61.default.createElement( - "div", - { ref: dropdownContainerRef }, - import_react61.default.createElement(TabTrap, { focusNextCallback: () => { - var _a2; - return triggerRef.current && ((_a2 = getLastFocusable(triggerRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus()); - }, disabled: !open || !loopFocus }), - import_react61.default.createElement(TransitionContent, { state, transitionRef: ref, dropdownClasses, open, stretchWidth, interior, header, expandToViewport, stretchBeyondTriggerWidth, footer, onMouseDown, isRefresh, dropdownRef, verticalContainerRef, position, id: dropdownContentId, role: dropdownContentRole, ariaLabelledby, ariaDescribedby }, children2), - import_react61.default.createElement(TabTrap, { focusNextCallback: () => { - var _a2; - return triggerRef.current && ((_a2 = getFirstFocusable(triggerRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus()); - }, disabled: !open || !loopFocus }) - )) - ) - ); -}; -var isInteriorPosition = (position) => position.insetBlockEnd !== void 0; -var dropdown_default = Dropdown; - -// node_modules/@cloudscape-design/components/button-dropdown/items-list.js -var import_react71 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/item-element/index.js -var import_react66 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/utils/utils.js -var isItemGroup = (item) => item && item.items !== void 0; -var isLinkItem = (item) => item && item.href !== void 0; -var getItemTarget = (item) => item.external ? "_blank" : void 0; -function indexIncludes(source, target) { - for (let index = 0; index < source.length; index++) { - if (source[index] !== target[index]) { - return false; - } - } - return true; -} -function indexEquals(left, right) { - if (left.length !== right.length) { - return false; - } - for (let index = 0; index < left.length; index++) { - if (left[index] !== right[index]) { - return false; - } - } - return true; -} - -// node_modules/@cloudscape-design/components/button-dropdown/item-element/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/button-dropdown/item-element/styles.scoped.css"; -var styles_css_default18 = { - "item-element": "awsui_item-element_93a1u_goggu_99", - "disabled": "awsui_disabled_93a1u_goggu_111", - "show-divider": "awsui_show-divider_93a1u_goggu_118", - "highlighted": "awsui_highlighted_93a1u_goggu_121", - "is-focused": "awsui_is-focused_93a1u_goggu_136", - "menu-item": "awsui_menu-item_93a1u_goggu_141", - "has-category-header": "awsui_has-category-header_93a1u_goggu_155", - "icon": "awsui_icon_93a1u_goggu_159", - "external-icon": "awsui_external-icon_93a1u_goggu_164" -}; - -// node_modules/@cloudscape-design/components/button-dropdown/tooltip.js -var import_react64 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/popover/arrow.js -var import_react62 = __toESM(require_react()); -var Arrow = (props2) => { - const isVisualRefresh = useVisualRefresh(); - return import_react62.default.createElement( - "div", - { className: clsx_m_default(styles_css_default13.arrow, props2.position && styles_css_default13[`arrow-position-${props2.position}`]) }, - import_react62.default.createElement("div", { className: styles_css_default13["arrow-outer"] }), - import_react62.default.createElement("div", { className: clsx_m_default(styles_css_default13["arrow-inner"], isVisualRefresh && styles_css_default13.refresh) }) - ); -}; -var arrow_default = import_react62.default.memo(Arrow); - -// node_modules/@cloudscape-design/components/internal/components/portal/index.js -var import_react63 = __toESM(require_react()); -var import_react_dom5 = __toESM(require_react_dom()); -function manageDefaultContainer(setState) { - const newContainer = document.createElement("div"); - document.body.appendChild(newContainer); - setState(newContainer); - return () => { - document.body.removeChild(newContainer); - }; -} -function manageAsyncContainer(getContainer, removeContainer, setState) { - let newContainer; - getContainer().then((container) => { - newContainer = container; - setState(container); - }, (error) => { - console.warn("[AwsUi] [portal]: failed to load portal root", error); - }); - return () => { - removeContainer(newContainer); - }; -} -function Portal({ container, getContainer, removeContainer, children: children2 }) { - const [activeContainer, setActiveContainer] = (0, import_react63.useState)(container !== null && container !== void 0 ? container : null); - (0, import_react63.useLayoutEffect)(() => { - if (container) { - setActiveContainer(container); - return; - } - if (isDevelopment2) { - if (getContainer && !removeContainer) { - warnOnce("portal", "`removeContainer` is required when `getContainer` is provided"); - } - if (!getContainer && removeContainer) { - warnOnce("portal", "`getContainer` is required when `removeContainer` is provided"); - } - } - if (getContainer && removeContainer) { - return manageAsyncContainer(getContainer, removeContainer, setActiveContainer); - } - return manageDefaultContainer(setActiveContainer); - }, [container, getContainer, removeContainer]); - return activeContainer && (0, import_react_dom5.createPortal)(children2, activeContainer); -} - -// node_modules/@cloudscape-design/components/button-dropdown/tooltip.js -var DEFAULT_OPEN_TIMEOUT_IN_MS = 120; -function Tooltip({ children: children2, content, position = "right" }) { - const ref = (0, import_react64.useRef)(null); - const isReducedMotion = useReducedMotion(ref); - const { open, triggerProps } = useTooltipOpen(isReducedMotion ? 0 : DEFAULT_OPEN_TIMEOUT_IN_MS); - const portalClasses = usePortalModeClasses(ref); - return import_react64.default.createElement( - "span", - Object.assign({ ref }, triggerProps), - children2, - open && import_react64.default.createElement( - Portal, - null, - import_react64.default.createElement( - "span", - { className: portalClasses }, - import_react64.default.createElement( - PopoverContainer, - { size: "small", fixedWidth: false, position, trackRef: ref, arrow: (position2) => import_react64.default.createElement(arrow_default, { position: position2 }), renderWithPortal: true, zIndex: 7e3 }, - import_react64.default.createElement( - PopoverBody, - { dismissButton: false, dismissAriaLabel: void 0, header: null, onDismiss: () => { - }, overflowVisible: "both" }, - import_react64.default.createElement("span", { "data-testid": "button-dropdown-disabled-reason", role: "tooltip" }, content) - ) - ) - ) - ) - ); -} -function useTooltipOpen(timeout2) { - const handle = (0, import_react64.useRef)(); - const [isOpen, setIsOpen] = (0, import_react64.useState)(false); - const close = () => { - clearTimeout(handle.current); - setIsOpen(false); - }; - const open = () => setIsOpen(true); - const openDelayed = () => { - handle.current = setTimeout(open, timeout2); - }; - const onKeyDown = (e) => { - if (isOpen && isEscape(e.key)) { - e.preventDefault(); - e.stopPropagation(); - close(); - } - }; - const onFocus = openDelayed; - const onBlur = close; - return { - open: isOpen, - triggerProps: { - onBlur, - onFocus, - onKeyDown - } - }; -} -var isEscape = (key2) => key2 === "Escape" || key2 === "Esc"; - -// node_modules/@cloudscape-design/components/button-dropdown/utils/use-hidden-description.js -var import_react65 = __toESM(require_react()); -function useHiddenDescription(description) { - const id = useUniqueId(); - return { - targetProps: { - "aria-describedby": description ? id : void 0 - }, - descriptionEl: description ? import_react65.default.createElement("span", { id, hidden: true }, description) : null - }; -} - -// node_modules/@cloudscape-design/components/button-dropdown/utils/menu-item.js -var getMenuItemProps = ({ disabled, parent, expanded }) => ({ - role: "menuitem", - "aria-disabled": disabled ? "true" : void 0, - "aria-haspopup": parent ? "true" : void 0, - "aria-expanded": expanded ? "true" : parent ? "false" : void 0 -}); - -// node_modules/@cloudscape-design/components/button-dropdown/item-element/index.js -var ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem, showDivider, hasCategoryHeader, isKeyboardHighlighted = false, variant = "normal" }) => { - const isLink = isLinkItem(item); - const onClick = (event) => { - event.stopPropagation(); - if (!isLink) { - event.preventDefault(); - } - if (!disabled) { - onItemActivate(item, event); - } - }; - const onHover = () => { - highlightItem(item); - }; - return import_react66.default.createElement( - "li", - { className: clsx_m_default(styles_css_default18["item-element"], styles_css_default18[`variant-${variant}`], { - [styles_css_default18.highlighted]: highlighted, - [styles_css_default18.disabled]: disabled, - [styles_css_default18["has-category-header"]]: hasCategoryHeader, - [styles_css_default18["show-divider"]]: showDivider, - [styles_css_default18["is-focused"]]: isKeyboardHighlighted - }), role: "presentation", "data-testid": item.id, "data-description": item.description, onClick, onMouseEnter: onHover, onTouchStart: onHover }, - import_react66.default.createElement(MenuItem, { item, disabled, highlighted }) - ); -}; -function MenuItem({ item, disabled, highlighted }) { - const menuItemRef = (0, import_react66.useRef)(null); - (0, import_react66.useEffect)(() => { - if (highlighted && menuItemRef.current) { - menuItemRef.current.focus(); - } - }, [highlighted]); - const isDisabledWithReason = disabled && item.disabledReason; - const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); - const menuItemProps = Object.assign(Object.assign({ - className: styles_css_default18["menu-item"], - lang: item.lang, - ref: menuItemRef, - // We are using the roving tabindex technique to manage the focus state of the dropdown. - // The current element will always have tabindex=0 which means that it can be tabbed to, - // while all other items have tabindex=-1 so we can focus them when necessary. - tabIndex: highlighted ? 0 : -1 - }, getMenuItemProps({ disabled })), isDisabledWithReason ? targetProps : {}); - const menuItem = isLinkItem(item) ? import_react66.default.createElement( - "a", - Object.assign({}, menuItemProps, { href: !disabled ? item.href : void 0, target: getItemTarget(item), rel: item.external ? "noopener noreferrer" : void 0 }), - import_react66.default.createElement(MenuItemContent, { item, disabled }) - ) : import_react66.default.createElement( - "span", - Object.assign({}, menuItemProps), - import_react66.default.createElement(MenuItemContent, { item, disabled }) - ); - const { position } = useDropdownContext(); - const tooltipPosition = position === "bottom-left" || position === "top-left" ? "left" : "right"; - return isDisabledWithReason ? import_react66.default.createElement( - Tooltip, - { content: item.disabledReason, position: tooltipPosition }, - menuItem, - descriptionEl - ) : menuItem; -} -var MenuItemContent = ({ item, disabled }) => { - const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg); - const hasExternal = isLinkItem(item) && item.external; - return import_react66.default.createElement( - import_react66.default.Fragment, - null, - hasIcon && import_react66.default.createElement(MenuItemIcon, { name: item.iconName, url: item.iconUrl, svg: item.iconSvg, alt: item.iconAlt, badge: item.badge }), - " ", - item.text, - " ", - hasExternal && import_react66.default.createElement(ExternalIcon, { disabled, ariaLabel: item.externalIconAriaLabel }) - ); -}; -var MenuItemIcon = (props2) => import_react66.default.createElement( - "span", - { className: styles_css_default18.icon }, - import_react66.default.createElement(internal_default, Object.assign({}, props2)) -); -var ExternalIcon = ({ disabled, ariaLabel }) => { - const icon = import_react66.default.createElement(internal_default, { variant: disabled ? "disabled" : "normal", name: "external" }); - return import_react66.default.createElement("span", { className: styles_css_default18["external-icon"], role: ariaLabel ? "img" : void 0, "aria-label": ariaLabel }, icon); -}; -var item_element_default = ItemElement; - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/expandable-category-element.js -var import_react67 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/button-dropdown/category-elements/styles.scoped.css"; -var styles_css_default19 = { - "header": "awsui_header_16mm3_w5lmn_99", - "disabled": "awsui_disabled_16mm3_w5lmn_116", - "expandable-header": "awsui_expandable-header_16mm3_w5lmn_120", - "rolled-down": "awsui_rolled-down_16mm3_w5lmn_131", - "highlighted": "awsui_highlighted_16mm3_w5lmn_134", - "is-focused": "awsui_is-focused_16mm3_w5lmn_152", - "category": "awsui_category_16mm3_w5lmn_157", - "expandable": "awsui_expandable_16mm3_w5lmn_120", - "variant-navigation": "awsui_variant-navigation_16mm3_w5lmn_172", - "expand-icon": "awsui_expand-icon_16mm3_w5lmn_179", - "expand-icon-up": "awsui_expand-icon-up_16mm3_w5lmn_186", - "expand-icon-right": "awsui_expand-icon-right_16mm3_w5lmn_189", - "items-list-container": "awsui_items-list-container_16mm3_w5lmn_206", - "in-dropdown": "awsui_in-dropdown_16mm3_w5lmn_215" -}; - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/expandable-category-element.js -var ExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, expandToViewport, variant }) => { - const highlighted = isHighlighted(item); - const expanded = isExpanded(item); - const isKeyboardHighlighted = isKeyboardHighlight(item); - const triggerRef = import_react67.default.useRef(null); - const ref = (0, import_react67.useRef)(null); - (0, import_react67.useEffect)(() => { - if (triggerRef.current && highlighted && !expanded) { - triggerRef.current.focus(); - } - }, [expanded, highlighted]); - const onClick = (event) => { - var _a2; - if (!disabled) { - event.preventDefault(); - onGroupToggle(item, event); - (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - }; - const onHover = () => { - highlightItem(item); - }; - const isDisabledWithReason = !!item.disabledReason && item.disabled; - const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); - const trigger2 = item.text && import_react67.default.createElement( - "span", - Object.assign({ - className: clsx_m_default(styles_css_default19.header, styles_css_default19["expandable-header"], styles_css_default19[`variant-${variant}`], { - [styles_css_default19.disabled]: disabled, - [styles_css_default19.highlighted]: highlighted, - [styles_css_default19["is-focused"]]: isKeyboardHighlighted - }), - // We are using the roving tabindex technique to manage the focus state of the dropdown. - // The current element will always have tabindex=0 which means that it can be tabbed to, - // while all other items have tabindex=-1 so we can focus them when necessary. - tabIndex: highlighted ? 0 : -1, - ref: triggerRef - }, getMenuItemProps({ parent: true, expanded, disabled }), isDisabledWithReason ? targetProps : {}), - item.text, - import_react67.default.createElement( - "span", - { className: clsx_m_default(styles_css_default19["expand-icon"], styles_css_default19["expand-icon-right"]) }, - import_react67.default.createElement(internal_default, { name: "caret-down-filled" }) - ) - ); - let content; - if (isDisabledWithReason) { - content = import_react67.default.createElement( - Tooltip, - { content: item.disabledReason }, - trigger2, - descriptionEl - ); - } else if (disabled) { - content = trigger2; - } else { - content = import_react67.default.createElement(dropdown_default, { open: expanded, stretchWidth: false, interior: true, expandToViewport, trigger: trigger2 }, item.items && expanded && import_react67.default.createElement( - "ul", - { role: "menu", "aria-label": item.text, className: clsx_m_default(styles_css_default19["items-list-container"], styles_css_default19["in-dropdown"]) }, - import_react67.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, variant }) - )); - } - return import_react67.default.createElement("li", { className: clsx_m_default(styles_css_default19.category, styles_css_default19[`variant-${variant}`], styles_css_default19.expandable, { - [styles_css_default19.expanded]: expanded, - [styles_css_default19.disabled]: disabled, - [styles_css_default19.highlighted]: highlighted - }), role: "presentation", "data-testid": item.id, ref, onClick, onMouseEnter: onHover, onTouchStart: onHover }, content); -}; -var expandable_category_element_default = ExpandableCategoryElement; - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/category-element.js -var import_react68 = __toESM(require_react()); -var CategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant }) => { - return import_react68.default.createElement( - "li", - { className: clsx_m_default(styles_css_default19.category, styles_css_default19[`variant-${variant}`], disabled && styles_css_default19.disabled), role: "presentation", "aria-disabled": disabled ? "true" : void 0 }, - item.text && import_react68.default.createElement("p", { className: clsx_m_default(styles_css_default19.header, { [styles_css_default19.disabled]: disabled }), "aria-hidden": "true" }, item.text), - import_react68.default.createElement("ul", { className: clsx_m_default(styles_css_default19["items-list-container"]), role: "group", "aria-label": item.text }, item.items && import_react68.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, categoryDisabled: disabled, hasCategoryHeader: !!item.text, variant })) - ); -}; -var category_element_default = CategoryElement; - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/mobile-expandable-category-element.js -var import_react70 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/mobile-expandable-group.js -var import_react69 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.scoped.css"; -var styles_css_default20 = { - "root": "awsui_root_14cnr_1ev1z_99", - "trigger": "awsui_trigger_14cnr_1ev1z_136", - "dropdown": "awsui_dropdown_14cnr_1ev1z_139", - "nowrap": "awsui_nowrap_14cnr_1ev1z_150", - "open": "awsui_open_14cnr_1ev1z_153" -}; - -// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/mobile-expandable-group.js -var MobileExpandableGroup = ({ children: children2, trigger: trigger2, open }) => { - return import_react69.default.createElement( - "div", - { className: clsx_m_default(styles_css_default20.root) }, - import_react69.default.createElement("div", { className: styles_css_default20.trigger }, trigger2), - import_react69.default.createElement("div", { className: clsx_m_default(styles_css_default20.dropdown, { [styles_css_default20.open]: open }), "data-open": open }, children2) - ); -}; -var mobile_expandable_group_default = MobileExpandableGroup; - -// node_modules/@cloudscape-design/components/button-dropdown/category-elements/mobile-expandable-category-element.js -var MobileExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant }) => { - const highlighted = isHighlighted(item); - const expanded = isExpanded(item); - const isKeyboardHighlighted = isKeyboardHighlight(item); - const triggerRef = import_react70.default.useRef(null); - (0, import_react70.useEffect)(() => { - if (triggerRef.current && highlighted && !expanded) { - triggerRef.current.focus(); - } - }, [expanded, highlighted]); - const onClick = (e) => { - if (!disabled) { - e.preventDefault(); - onGroupToggle(item, e); - } - }; - const onHover = () => { - highlightItem(item); - }; - const isDisabledWithReason = !!item.disabledReason && item.disabled; - const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); - const trigger2 = item.text && import_react70.default.createElement( - "span", - Object.assign({ - className: clsx_m_default(styles_css_default19.header, styles_css_default19["expandable-header"], styles_css_default19[`variant-${variant}`], { - [styles_css_default19.highlighted]: highlighted, - [styles_css_default19["rolled-down"]]: expanded, - [styles_css_default19.disabled]: disabled, - [styles_css_default19["is-focused"]]: isKeyboardHighlighted - }), - // We are using the roving tabindex technique to manage the focus state of the dropdown. - // The current element will always have tabindex=0 which means that it can be tabbed to, - // while all other items have tabindex=-1 so we can focus them when necessary. - tabIndex: highlighted ? 0 : -1, - ref: triggerRef - }, getMenuItemProps({ parent: true, disabled, expanded }), isDisabledWithReason ? targetProps : {}), - item.text, - import_react70.default.createElement( - "span", - { className: clsx_m_default(styles_css_default19["expand-icon"], { - [styles_css_default19["expand-icon-up"]]: expanded - }) }, - import_react70.default.createElement(internal_default, { name: "caret-down-filled" }) - ) - ); - let content; - if (isDisabledWithReason) { - content = import_react70.default.createElement( - import_react70.default.Fragment, - null, - descriptionEl, - import_react70.default.createElement(Tooltip, { content: item.disabledReason }, trigger2) - ); - } else if (disabled) { - content = trigger2; - } else { - content = import_react70.default.createElement(mobile_expandable_group_default, { open: expanded, trigger: trigger2 }, item.items && expanded && import_react70.default.createElement( - "ul", - { role: "menu", "aria-label": item.text, className: clsx_m_default(styles_css_default19["items-list-container"]) }, - import_react70.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, hasCategoryHeader: true, variant }) - )); - } - return import_react70.default.createElement("li", { className: clsx_m_default(styles_css_default19.category, styles_css_default19[`variant-${variant}`], styles_css_default19.expandable, { - [styles_css_default19.expanded]: expanded, - [styles_css_default19.disabled]: disabled, - [styles_css_default19.highlighted]: highlighted || expanded, - [styles_css_default19.expandable]: true - }), role: "presentation", onClick, onMouseEnter: onHover, onTouchStart: onHover, "data-testid": item.id }, content); -}; -var mobile_expandable_category_element_default = MobileExpandableCategoryElement; - -// node_modules/@cloudscape-design/components/button-dropdown/items-list.js -function ItemsList({ items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, categoryDisabled = false, hasExpandableGroups = false, hasCategoryHeader = false, expandToViewport = false, variant = "normal" }) { - const isMobile = useMobile(); - const elements = items.map((item, index) => { - var _a2, _b, _c, _d; - if (!isItemGroup(item)) { - const showDivider = index === items.length - 1 && !lastInDropdown || isItemGroup(items[index + 1]); - return import_react71.default.createElement(item_element_default, { key: index, item, onItemActivate, disabled: (_a2 = item.disabled) !== null && _a2 !== void 0 ? _a2 : categoryDisabled, highlighted: isHighlighted(item), isKeyboardHighlighted: isKeyboardHighlight(item), highlightItem, showDivider, hasCategoryHeader, variant }); - } - if (hasExpandableGroups) { - return item.text ? isMobile ? import_react71.default.createElement(mobile_expandable_category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: lastInDropdown && index === items.length - 1, highlightItem, disabled: (_b = item.disabled) !== null && _b !== void 0 ? _b : false, variant }) : import_react71.default.createElement(expandable_category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: true, highlightItem, disabled: (_c = item.disabled) !== null && _c !== void 0 ? _c : false, expandToViewport, variant }) : null; - } - return import_react71.default.createElement(category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: lastInDropdown && index === items.length - 1, highlightItem, disabled: (_d = item.disabled) !== null && _d !== void 0 ? _d : false, variant }); - }); - return import_react71.default.createElement(import_react71.default.Fragment, null, elements); -} - -// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-open-state.js -var import_react72 = __toESM(require_react()); -var useOpenState = ({ onOpen, onClose }) => { - const [isOpen, setIsOpen] = (0, import_react72.useState)(false); - const [openedWithKeyboard, setOpenedWithKeyboard] = (0, import_react72.useState)(false); - const openDropdown = (isKeyboard) => { - if (!isOpen) { - setIsOpen(true); - setOpenedWithKeyboard(!!isKeyboard); - onOpen === null || onOpen === void 0 ? void 0 : onOpen(); - } - }; - const closeDropdown = () => { - if (isOpen) { - setIsOpen(false); - onClose === null || onClose === void 0 ? void 0 : onClose(); - } - }; - const toggleDropdown = () => { - if (isOpen) { - closeDropdown(); - } else { - openDropdown(false); - } - }; - return { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard }; -}; - -// node_modules/@cloudscape-design/components/button-dropdown/utils/use-highlighted-menu.js -var import_react73 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/button-dropdown/utils/create-items-tree.js -function createItemsTree(items) { - const itemToIndex = /* @__PURE__ */ new Map(); - const indexToItem = /* @__PURE__ */ new Map(); - const flatIndices = []; - traverseItems(items, (item, index) => { - const indexKey = stringifyIndex(index); - itemToIndex.set(item, indexKey); - indexToItem.set(indexKey, item); - flatIndices.push(indexKey); - }); - return { - getItem: (index) => { - const indexKey = stringifyIndex(index); - return indexToItem.get(indexKey) || null; - }, - getItemIndex: (item) => { - const indexKey = itemToIndex.get(item); - if (!indexKey) { - throw new Error("Invariant violation: item is not found."); - } - return parseIndex(indexKey); - }, - getSequentialIndex: (index, direction) => { - const indexKey = stringifyIndex(index); - const position = flatIndices.indexOf(indexKey); - const nextIndexKey = flatIndices[position + direction]; - if (!nextIndexKey) { - return null; - } - return parseIndex(nextIndexKey); - }, - getParentIndex: (item) => { - const indexKey = itemToIndex.get(item); - if (!indexKey) { - throw new Error("Invariant violation: item is not found."); - } - const index = parseIndex(indexKey); - if (index.length === 1) { - return null; - } - return index.slice(0, index.length - 1); - } - }; -} -function traverseItems(items, act, parentIndex = []) { - items.forEach((item, index) => { - const itemIndex = [...parentIndex, index]; - act(item, itemIndex); - if (isItemGroup(item)) { - traverseItems(item.items, act, itemIndex); - } - }); -} -function stringifyIndex(index) { - return index.join("-"); -} -function parseIndex(index) { - return index.split("-").map((it) => parseInt(it)); -} - -// node_modules/@cloudscape-design/components/button-dropdown/utils/move-highlight.js -function moveHighlight({ startIndex, expandedIndex, getNext, hasExpandableGroups, isInRestrictedView }) { - const tryMove = (currentIndex) => { - var _a2; - const next = getNext(currentIndex); - if (!next) { - return null; - } - if (((_a2 = next.parent) === null || _a2 === void 0 ? void 0 : _a2.disabled) && hasExpandableGroups) { - return tryMove(next.index); - } - if (isItemGroup(next.item) && !hasExpandableGroups) { - return tryMove(next.index); - } - if (hasExpandableGroups && !isInRestrictedView && !isSameParent(startIndex, next.index)) { - return tryMove(next.index); - } - if (hasExpandableGroups && isInRestrictedView && !isSameLevel(next.index, expandedIndex) && !isIncluded(expandedIndex, next.index)) { - return tryMove(next.index); - } - return next.index; - }; - return tryMove(startIndex); -} -function isSameParent(left, right) { - return indexEquals(left.slice(0, -1), right.slice(0, -1)); -} -function isSameLevel(left, right) { - return left.length === right.length; -} -function isIncluded(parent, child) { - return indexEquals(parent, child.slice(0, -1)); -} - -// node_modules/@cloudscape-design/components/button-dropdown/utils/use-highlighted-menu.js -function useHighlightedMenu({ items, hasExpandableGroups, isInRestrictedView = false }) { - const [targetIndex, setTargetIndex] = (0, import_react73.useState)([]); - const [expandedIndex, setExpandedIndex] = (0, import_react73.useState)([]); - const [isUsingMouse, setIsUsingMouse] = (0, import_react73.useState)(true); - const { getItem, getItemIndex: getItemIndex2, getSequentialIndex, getParentIndex } = (0, import_react73.useMemo)(() => createItemsTree(items), [items]); - const targetItem = (0, import_react73.useMemo)(() => getItem(targetIndex), [targetIndex, getItem]); - const isHighlighted = (0, import_react73.useCallback)((item) => { - const index = getItemIndex2(item); - return indexIncludes(index, targetIndex); - }, [targetIndex, getItemIndex2]); - const isKeyboardHighlight = (0, import_react73.useCallback)((item) => { - const index = getItemIndex2(item); - return !isUsingMouse && indexEquals(index, targetIndex); - }, [targetIndex, getItemIndex2, isUsingMouse]); - const isExpanded = (0, import_react73.useCallback)((group) => { - const index = getItemIndex2(group); - return indexIncludes(index, expandedIndex); - }, [expandedIndex, getItemIndex2]); - const moveHighlight2 = (0, import_react73.useCallback)((direction) => { - const getNext = (index) => { - const nextIndex2 = getSequentialIndex(index, direction); - const item = getItem(nextIndex2 || [-1]); - if (!nextIndex2 || !item) { - return null; - } - const parentIndex = getParentIndex(item); - const parentItem = parentIndex && getItem(parentIndex); - return { index: nextIndex2, item, parent: parentItem || void 0 }; - }; - const nextIndex = moveHighlight({ - startIndex: targetIndex, - expandedIndex, - getNext, - hasExpandableGroups, - isInRestrictedView - }); - if (nextIndex) { - setTargetIndex(nextIndex); - } - }, [targetIndex, expandedIndex, getItem, getSequentialIndex, getParentIndex, hasExpandableGroups, isInRestrictedView]); - const highlightItem = (0, import_react73.useCallback)((item) => { - setTargetIndex(getItemIndex2(item)); - }, [getItemIndex2]); - const expandGroup = (0, import_react73.useCallback)((group) => { - const groupIndex = group ? getItemIndex2(group) : targetIndex; - const firstChildIndex = [...groupIndex, 0]; - setTargetIndex(isInRestrictedView ? groupIndex : firstChildIndex); - setExpandedIndex(groupIndex); - }, [targetIndex, getItemIndex2, isInRestrictedView]); - const collapseGroup = (0, import_react73.useCallback)(() => { - if (expandedIndex.length > 0) { - setTargetIndex(expandedIndex); - setExpandedIndex(expandedIndex.slice(0, -1)); - } - }, [expandedIndex]); - const reset = (0, import_react73.useCallback)(() => { - setTargetIndex([]); - setExpandedIndex([]); - }, []); - return { - targetItem, - isHighlighted, - isKeyboardHighlight, - isExpanded, - moveHighlight: moveHighlight2, - highlightItem, - expandGroup, - collapseGroup, - reset, - setIsUsingMouse - }; -} - -// node_modules/@cloudscape-design/components/button-dropdown/utils/use-button-dropdown.js -function useButtonDropdown({ items, onItemClick, onItemFollow, onReturnFocus, hasExpandableGroups, isInRestrictedView = false, expandToViewport = false }) { - const { targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, moveHighlight: moveHighlight2, expandGroup, collapseGroup, reset, setIsUsingMouse } = useHighlightedMenu({ - items, - hasExpandableGroups, - isInRestrictedView - }); - const _a2 = useOpenState({ onClose: reset }), { isOpen, closeDropdown } = _a2, openStateProps = __rest(_a2, ["isOpen", "closeDropdown"]); - const toggleDropdown = (options = {}) => { - var _a3; - const moveHighlightOnOpen = (_a3 = options.moveHighlightOnOpen) !== null && _a3 !== void 0 ? _a3 : true; - if (!isOpen && moveHighlightOnOpen) { - moveHighlight2(1); - } - openStateProps.toggleDropdown(); - }; - const onGroupToggle = (item) => !isExpanded(item) ? expandGroup(item) : collapseGroup(); - const onItemActivate = (item, event) => { - const details = { - id: item.id || "undefined", - href: item.href, - external: item.external, - target: getItemTarget(item) - }; - if (onItemFollow && item.href && isPlainLeftClick(event)) { - fireCancelableEvent(onItemFollow, details, event); - } - if (onItemClick) { - fireCancelableEvent(onItemClick, details, event); - } - onReturnFocus(); - closeDropdown(); - }; - const doVerticalNavigation = (direction) => { - if (isOpen) { - moveHighlight2(direction); - } - }; - const openAndSelectFirst = (event) => { - toggleDropdown(); - event.preventDefault(); - }; - const actOnParentDropdown = (event) => { - if (!targetItem) { - if (isOpen && !isInRestrictedView) { - toggleDropdown(); - } else { - openAndSelectFirst(event); - } - } else { - if (isItemGroup(targetItem)) { - onGroupToggle(targetItem, event); - } else { - onItemActivate(targetItem, event); - } - } - }; - const activate = (event, isEnter) => { - setIsUsingMouse(false); - if (targetItem && isLinkItem(targetItem) && isEnter) { - return; - } - event.preventDefault(); - actOnParentDropdown(event); - }; - const onKeyDown = (event) => { - setIsUsingMouse(false); - switch (event.keyCode) { - case KeyCode.down: { - doVerticalNavigation(1); - event.preventDefault(); - break; - } - case KeyCode.up: { - doVerticalNavigation(-1); - event.preventDefault(); - break; - } - case KeyCode.space: { - event.preventDefault(); - break; - } - case KeyCode.enter: { - if (!(targetItem === null || targetItem === void 0 ? void 0 : targetItem.disabled)) { - activate(event, true); - } - break; - } - case KeyCode.left: - case KeyCode.right: { - if (targetItem && !targetItem.disabled && isItemGroup(targetItem) && !isExpanded(targetItem)) { - expandGroup(); - } else if (hasExpandableGroups) { - collapseGroup(); - } - event.preventDefault(); - break; - } - case KeyCode.escape: { - onReturnFocus(); - closeDropdown(); - event.preventDefault(); - if (isOpen) { - event.stopPropagation(); - } - break; - } - case KeyCode.tab: { - if (expandToViewport) { - onReturnFocus(); - } - closeDropdown(); - break; - } - } - }; - const onKeyUp = (event) => { - if (event.keyCode === KeyCode.space && !(targetItem === null || targetItem === void 0 ? void 0 : targetItem.disabled)) { - activate(event); - } - }; - return { - isOpen, - targetItem, - isHighlighted, - isKeyboardHighlight, - isExpanded, - highlightItem, - onKeyDown, - onKeyUp, - onItemActivate, - onGroupToggle, - toggleDropdown, - closeDropdown, - setIsUsingMouse - }; -} - -// node_modules/@cloudscape-design/components/internal/components/options-list/index.js -var import_react74 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/options-list/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/options-list/styles.scoped.css"; -var styles_css_default21 = { - "options-list": "awsui_options-list_19gcf_halkh_99", - "decrease-block-margin": "awsui_decrease-block-margin_19gcf_halkh_149" -}; - -// node_modules/@cloudscape-design/components/internal/components/options-list/index.js -var BOTTOM_TRIGGER_OFFSET = 80; -var getItemIndex = (containerRef, event) => { - const target = findUpUntil2(event.target, (element) => element === containerRef.current || !!element.dataset.mouseTarget); - const mouseTarget = target === null || target === void 0 ? void 0 : target.dataset.mouseTarget; - return mouseTarget ? parseInt(mouseTarget) : -1; -}; -var OptionsList = (_a2, ref) => { - var { open, statusType, children: children2, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = "relative", role = "listbox", decreaseBlockMargin = false, ariaLabel, ariaLabelledby, ariaDescribedby } = _a2, restProps = __rest(_a2, ["open", "statusType", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseBlockMargin", "ariaLabel", "ariaLabelledby", "ariaDescribedby"]); - const baseProps = getBaseProps(restProps); - const menuRef = (0, import_react74.useRef)(null); - const handleScroll = useStableCallback(() => { - const scrollContainer = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current; - if (scrollContainer) { - const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight; - const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition; - if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) { - fireNonCancelableEvent(onLoadMore); - } - } - }); - (0, import_react74.useEffect)(() => { - if (open && statusType === "pending") { - handleScroll(); - } - }, [open, statusType, handleScroll]); - const className2 = clsx_m_default(styles_css_default21["options-list"], { - [styles_css_default21["decrease-block-margin"]]: decreaseBlockMargin - }); - const mergedRef = useMergeRefs(ref, menuRef); - return import_react74.default.createElement("ul", Object.assign({}, baseProps, nativeAttributes, { className: className2, ref: mergedRef, style: { position }, role, onScroll: handleScroll, onKeyDown: (event) => onKeyDown && fireKeyboardEvent(onKeyDown, event), onMouseMove: (event) => onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(getItemIndex(menuRef, event)), onMouseUp: (event) => onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(getItemIndex(menuRef, event)), onBlur: (event) => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }), onFocus: () => fireNonCancelableEvent(onFocus), tabIndex: -1, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }), open && children2); -}; -var options_list_default = import_react74.default.forwardRef(OptionsList); - -// node_modules/@cloudscape-design/components/button-dropdown/internal.js -var InternalButtonDropdown = import_react75.default.forwardRef((_a2, ref) => { - var _b; - var { items, variant = "normal", loading = false, loadingText, disabled = false, expandableGroups = false, children: children2, onItemClick, onItemFollow, customTriggerBuilder, expandToViewport, ariaLabel, title, description, preferCenter, mainAction, __internalRootRef } = _a2, props2 = __rest(_a2, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "children", "onItemClick", "onItemFollow", "customTriggerBuilder", "expandToViewport", "ariaLabel", "title", "description", "preferCenter", "mainAction", "__internalRootRef"]); - const isInRestrictedView = useMobile(); - const dropdownId = useUniqueId("dropdown"); - for (const item of items) { - checkSafeUrl("ButtonDropdown", item.href); - } - if (mainAction) { - checkSafeUrl("ButtonDropdown", mainAction.href); - } - if (isDevelopment2) { - if (mainAction && variant !== "primary" && variant !== "normal") { - warnOnce("ButtonDropdown", 'Main action is only supported for "primary" and "normal" component variant.'); - } - } - const isMainAction = mainAction && (variant === "primary" || variant === "normal"); - const isVisualRefresh = useVisualRefresh(); - const { isOpen, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, onKeyDown, onKeyUp, onItemActivate, onGroupToggle, toggleDropdown, closeDropdown, setIsUsingMouse } = useButtonDropdown({ - items, - onItemClick, - onItemFollow, - // Scroll is unnecessary when moving focus back to the dropdown trigger. - onReturnFocus: () => { - var _a3; - return (_a3 = triggerRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus({ preventScroll: true }); - }, - expandToViewport, - hasExpandableGroups: expandableGroups, - isInRestrictedView - }); - const handleMouseEvent = () => { - setIsUsingMouse(true); - }; - const baseProps = getBaseProps(props2); - const mainActionRef = (0, import_react75.useRef)(null); - const triggerRef = (0, import_react75.useRef)(null); - useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef); - const clickHandler = () => { - if (!loading && !disabled) { - toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView }); - } - }; - const canBeOpened = !loading && !disabled; - const triggerVariant = variant === "navigation" ? void 0 : variant === "inline-icon" ? "inline-icon" : variant; - const iconProps = variant === "icon" || variant === "inline-icon" ? { - iconName: "ellipsis" - } : { - iconName: "caret-down-filled", - iconAlign: "right", - __iconClass: canBeOpened && isOpen ? styles_css_default16["rotate-up"] : styles_css_default16["rotate-down"] - }; - const baseTriggerProps = Object.assign(Object.assign({ className: clsx_m_default(styles_css_default16["trigger-button"], styles_css_default16["test-utils-button-trigger"]) }, iconProps), { - variant: triggerVariant, - loading, - loadingText, - disabled, - onClick: (event) => { - event.preventDefault(); - clickHandler(); - }, - ariaLabel, - ariaExpanded: canBeOpened && isOpen, - formAction: "none", - __nativeAttributes: { - "aria-haspopup": true - } - }); - const triggerId = useUniqueId("awsui-button-dropdown__trigger"); - const triggerHasBadge = () => { - const flatItems = items.flatMap((item) => { - if ("items" in item) { - return item.items; - } - return item; - }); - return variant === "icon" && !!(flatItems === null || flatItems === void 0 ? void 0 : flatItems.find((item) => { - if ("badge" in item) { - return item.badge; - } - })); - }; - let trigger2 = null; - if (customTriggerBuilder) { - trigger2 = import_react75.default.createElement("div", { className: styles_css_default16["dropdown-trigger"] }, customTriggerBuilder({ - testUtilsClass: styles_css_default16["test-utils-button-trigger"], - ariaExpanded: canBeOpened && isOpen, - onClick: clickHandler, - triggerRef, - ariaLabel, - disabled, - isOpen - })); - } else if (isMainAction) { - const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel } = mainAction, mainActionProps = __rest(mainAction, ["text", "iconName", "iconAlt", "iconSvg", "iconUrl", "external", "externalIconAriaLabel"]); - const mainActionIconProps = external ? { iconName: "external", iconAlign: "right" } : { iconName, iconAlt, iconSvg, iconUrl }; - const mainActionAriaLabel = externalIconAriaLabel ? `${(_b = mainAction.ariaLabel) !== null && _b !== void 0 ? _b : mainAction.text} ${mainAction.externalIconAriaLabel}` : void 0; - trigger2 = import_react75.default.createElement( - "div", - { role: "group", "aria-label": ariaLabel, className: styles_css_default16["split-trigger-wrapper"] }, - import_react75.default.createElement( - "div", - { - className: clsx_m_default(styles_css_default16["trigger-item"], styles_css_default16["split-trigger"]), - // Close dropdown upon main action click unless event is cancelled. - onClick: closeDropdown, - // Prevent keyboard events from propagation to the button dropdown handler. - onKeyDown: (e) => e.stopPropagation(), - onKeyUp: (e) => e.stopPropagation() - }, - import_react75.default.createElement(InternalButton, Object.assign({ ref: mainActionRef }, mainActionProps, mainActionIconProps, { className: styles_css_default16["trigger-button"], variant, ariaLabel: mainActionAriaLabel, formAction: "none" }), text) - ), - import_react75.default.createElement( - "div", - { className: clsx_m_default(styles_css_default16["trigger-item"], styles_css_default16["dropdown-trigger"], isVisualRefresh && styles_css_default16["visual-refresh"]) }, - import_react75.default.createElement(InternalButton, Object.assign({ ref: triggerRef }, baseTriggerProps)) - ) - ); - } else { - trigger2 = import_react75.default.createElement( - "div", - { className: styles_css_default16["dropdown-trigger"] }, - import_react75.default.createElement(InternalButton, Object.assign({ ref: triggerRef, id: triggerId }, baseTriggerProps, { badge: triggerHasBadge() }), children2) - ); - } - const hasHeader = title || description; - const headerId = useUniqueId("awsui-button-dropdown__header"); - const shouldLabelWithTrigger = !ariaLabel && !mainAction && variant !== "icon" && variant !== "inline-icon"; - const { loadingButtonCount } = useFunnel(); - (0, import_react75.useEffect)(() => { - if (loading) { - loadingButtonCount.current++; - return () => { - loadingButtonCount.current--; - }; - } - }, [loading, loadingButtonCount]); - return import_react75.default.createElement( - "div", - Object.assign({}, baseProps, { onKeyDown, onKeyUp, onMouseDown: handleMouseEvent, onMouseMove: handleMouseEvent, className: clsx_m_default(styles_css_default16["button-dropdown"], styles_css_default16[`variant-${variant}`], baseProps.className), "aria-owns": expandToViewport && isOpen ? dropdownId : void 0, ref: __internalRootRef }), - import_react75.default.createElement( - dropdown_default, - { open: canBeOpened && isOpen, stretchWidth: false, stretchTriggerHeight: variant === "navigation", expandToViewport, preferCenter, onDropdownClose: () => toggleDropdown(), trigger: trigger2, dropdownId }, - hasHeader && import_react75.default.createElement( - "div", - { className: styles_css_default16.header, id: headerId }, - title && import_react75.default.createElement( - "div", - { className: styles_css_default16.title }, - import_react75.default.createElement(InternalBox, { fontSize: "heading-s", fontWeight: "bold", color: "inherit", tagOverride: "h2", margin: { vertical: "n", horizontal: "n" } }, title) - ), - description && import_react75.default.createElement( - InternalBox, - { fontSize: "body-s" }, - import_react75.default.createElement("span", { className: styles_css_default16.description }, description) - ) - ), - import_react75.default.createElement( - options_list_default, - { open: canBeOpened && isOpen, position: "static", role: "menu", decreaseBlockMargin: true, ariaLabel, ariaLabelledby: hasHeader ? headerId : shouldLabelWithTrigger ? triggerId : void 0, statusType: "finished" }, - import_react75.default.createElement(ItemsList, { items, onItemActivate, onGroupToggle, hasExpandableGroups: expandableGroups, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: true, highlightItem, expandToViewport, variant }) - ) - ) - ); -}); -var internal_default4 = InternalButtonDropdown; - -// node_modules/@cloudscape-design/components/app-layout/test-classes/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/test-classes/styles.scoped.css"; -var styles_css_default22 = { - "root": "awsui_root_1fj9k_3pu9z_5", - "navigation": "awsui_navigation_1fj9k_3pu9z_9", - "navigation-toggle": "awsui_navigation-toggle_1fj9k_3pu9z_13", - "navigation-close": "awsui_navigation-close_1fj9k_3pu9z_17", - "content": "awsui_content_1fj9k_3pu9z_21", - "notifications": "awsui_notifications_1fj9k_3pu9z_25", - "breadcrumbs": "awsui_breadcrumbs_1fj9k_3pu9z_29", - "tools": "awsui_tools_1fj9k_3pu9z_33", - "tools-close": "awsui_tools-close_1fj9k_3pu9z_37", - "tools-toggle": "awsui_tools-toggle_1fj9k_3pu9z_41", - "drawer-closed": "awsui_drawer-closed_1fj9k_3pu9z_45", - "mobile-bar": "awsui_mobile-bar_1fj9k_3pu9z_49", - "disable-body-scroll-root": "awsui_disable-body-scroll-root_1fj9k_3pu9z_53", - "drawers-trigger": "awsui_drawers-trigger_1fj9k_3pu9z_57", - "active-drawer": "awsui_active-drawer_1fj9k_3pu9z_61", - "active-drawer-close-button": "awsui_active-drawer-close-button_1fj9k_3pu9z_65", - "overflow-menu": "awsui_overflow-menu_1fj9k_3pu9z_69", - "drawers-slider": "awsui_drawers-slider_1fj9k_3pu9z_73" -}; - -// node_modules/@cloudscape-design/components/app-layout/drawer/overflow-menu.js -function OverflowMenu({ items, onItemClick, customTriggerBuilder, ariaLabel }) { - return import_react76.default.createElement(internal_default4, { items: items.map((item) => ({ - id: item.id, - text: item.ariaLabels.drawerName, - iconName: item.trigger.iconName, - iconSvg: item.trigger.iconSvg, - badge: item.badge - })), className: styles_css_default22["overflow-menu"], onItemClick, ariaLabel, variant: "icon", customTriggerBuilder, expandToViewport: true }); -} - -// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/styles.scoped.css"; -var styles_css_default23 = { - "block-body-scroll": "awsui_block-body-scroll_19d8l_c90gb_103", - "mobile-bar": "awsui_mobile-bar_19d8l_c90gb_107", - "mobile-bar-breadcrumbs": "awsui_mobile-bar-breadcrumbs_19d8l_c90gb_120", - "mobile-toggle": "awsui_mobile-toggle_19d8l_c90gb_127", - "mobile-toggle-type-navigation": "awsui_mobile-toggle-type-navigation_19d8l_c90gb_136", - "mobile-toggle-type-tools": "awsui_mobile-toggle-type-tools_19d8l_c90gb_139", - "mobile-toggle-type-drawer": "awsui_mobile-toggle-type-drawer_19d8l_c90gb_139", - "drawers-container": "awsui_drawers-container_19d8l_c90gb_146" -}; - -// node_modules/@cloudscape-design/components/app-layout/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/styles.scoped.css"; -var styles_css_default24 = { - "resize-active": "awsui_resize-active_lm6vo_1lt83_104", - "resize-side": "awsui_resize-side_lm6vo_1lt83_110", - "resize-bottom": "awsui_resize-bottom_lm6vo_1lt83_113", - "with-motion": "awsui_with-motion_lm6vo_1lt83_118", - "root": "awsui_root_lm6vo_1lt83_133", - "root-no-scroll": "awsui_root-no-scroll_lm6vo_1lt83_140", - "layout": "awsui_layout_lm6vo_1lt83_145", - "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1lt83_151", - "layout-main": "awsui_layout-main_lm6vo_1lt83_155", - "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1lt83_161", - "unfocusable": "awsui_unfocusable_lm6vo_1lt83_166", - "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1lt83_170", - "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1lt83_175", - "content-wrapper": "awsui_content-wrapper_lm6vo_1lt83_179", - "content-overlapped": "awsui_content-overlapped_lm6vo_1lt83_183", - "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1lt83_187" -}; - -// node_modules/@cloudscape-design/components/app-layout/drawer/drawers-helpers.js -function splitItems(maybeItems, splitIndex, activeId) { - const items = maybeItems !== null && maybeItems !== void 0 ? maybeItems : []; - const visibleItems = items.slice(0, splitIndex); - const overflowItems = items.slice(splitIndex); - if (overflowItems.length === 1) { - return { visibleItems: items, overflowItems: [] }; - } - if (activeId && overflowItems.length > 0 && visibleItems.length > 0) { - const activeInOverflow = overflowItems.find((item) => item.id === activeId); - if (activeInOverflow) { - overflowItems.splice(overflowItems.indexOf(activeInOverflow), 1); - overflowItems.unshift(visibleItems.pop()); - visibleItems.push(activeInOverflow); - } - } - return { visibleItems, overflowItems }; -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-drawers.js -var import_react78 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/runtime-api.js -var import_react77 = __toESM(require_react()); -function convertRuntimeDrawers(drawers) { - const converted = drawers.map((_a2) => { - var _b; - var { mountContent, unmountContent, trigger: trigger2 } = _a2, runtimeDrawer = __rest(_a2, ["mountContent", "unmountContent", "trigger"]); - return Object.assign(Object.assign({}, runtimeDrawer), { ariaLabels: Object.assign({ drawerName: (_b = runtimeDrawer.ariaLabels.content) !== null && _b !== void 0 ? _b : "" }, runtimeDrawer.ariaLabels), trigger: { - iconSvg: ( - // eslint-disable-next-line react/no-danger - import_react77.default.createElement("span", { dangerouslySetInnerHTML: { __html: trigger2.iconSvg } }) - ) - }, content: import_react77.default.createElement(RuntimeContentWrapper, { key: runtimeDrawer.id, mountContent, unmountContent }), onResize: (event) => { - fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id }); - } }); - }); - const sorted = sortByPriority(converted); - return { - before: sorted.filter((item) => { - var _a2; - return ((_a2 = item.orderPriority) !== null && _a2 !== void 0 ? _a2 : 0) > 0; - }), - after: sorted.filter((item) => { - var _a2; - return ((_a2 = item.orderPriority) !== null && _a2 !== void 0 ? _a2 : 0) <= 0; - }) - }; -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-drawers.js -var TOOLS_DRAWER_ID = "awsui-internal-tools"; -function getToolsDrawerItem(props2) { - if (props2.toolsHide) { - return null; - } - const { iconName, getLabels } = togglesConfig.tools; - const { mainLabel, closeLabel, openLabel } = getLabels(props2.ariaLabels); - return { - id: TOOLS_DRAWER_ID, - content: props2.tools, - resizable: false, - ariaLabels: { - triggerButton: openLabel, - closeButton: closeLabel, - drawerName: mainLabel !== null && mainLabel !== void 0 ? mainLabel : "" - }, - trigger: { - iconName - } - }; -} -function useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange) { - const [runtimeDrawers, setRuntimeDrawers] = (0, import_react78.useState)({ before: [], after: [] }); - const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange); - const drawerWasOpenRef = (0, import_react78.useRef)(false); - drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId; - (0, import_react78.useEffect)(() => { - if (disableRuntimeDrawers) { - return; - } - const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered((drawers) => { - setRuntimeDrawers(convertRuntimeDrawers(drawers)); - if (!drawerWasOpenRef.current) { - const defaultActiveDrawer = sortByPriority(drawers).find((drawer) => drawer.defaultActive); - if (defaultActiveDrawer) { - onActiveDrawerChangeStable(defaultActiveDrawer.id); - } - } - }); - return () => { - unsubscribe(); - setRuntimeDrawers({ before: [], after: [] }); - }; - }, [disableRuntimeDrawers, onActiveDrawerChangeStable]); - return runtimeDrawers; -} -function applyToolsDrawer(toolsProps, runtimeDrawers) { - const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after]; - if (drawers.length === 0) { - return null; - } - const toolsItem = getToolsDrawerItem(toolsProps); - if (toolsItem) { - drawers.unshift(toolsItem); - } - return drawers; -} -function useDrawers({ drawers, activeDrawerId: controlledActiveDrawerId, onDrawerChange, __disableRuntimeDrawers: disableRuntimeDrawers }, ariaLabels, toolsProps) { - var _a2, _b, _c, _d; - const [activeDrawerId = null, setActiveDrawerId] = useControllable2(controlledActiveDrawerId, onDrawerChange, null, { - componentName: "AppLayout", - controlledProp: "activeDrawerId", - changeHandler: "onChange" - }); - const [drawerSizes, setDrawerSizes] = (0, import_react78.useState)({}); - function onActiveDrawerResize({ id, size: size2 }) { - setDrawerSizes((oldSizes) => Object.assign(Object.assign({}, oldSizes), { [id]: size2 })); - fireNonCancelableEvent(activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.onResize, { id, size: size2 }); - } - function onActiveDrawerChange(newDrawerId) { - setActiveDrawerId(newDrawerId); - if (hasOwnDrawers) { - fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId }); - } else if (!toolsProps.toolsHide) { - toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID); - } - } - const hasOwnDrawers = !!drawers; - const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange); - const combinedDrawers = drawers ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after] : applyToolsDrawer(toolsProps, runtimeDrawers); - let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId; - const activeDrawer = combinedDrawers === null || combinedDrawers === void 0 ? void 0 : combinedDrawers.find((drawer) => drawer.id === activeDrawerIdResolved); - activeDrawerIdResolved = (_a2 = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== null && _a2 !== void 0 ? _a2 : null; - const activeDrawerSize = activeDrawerIdResolved ? (_c = (_b = drawerSizes[activeDrawerIdResolved]) !== null && _b !== void 0 ? _b : activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _c !== void 0 ? _c : toolsProps.toolsWidth : toolsProps.toolsWidth; - const minDrawerSize = Math.min((_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _d !== void 0 ? _d : 290, 290); - return { - ariaLabelsWithDrawers: ariaLabels, - drawers: combinedDrawers || void 0, - activeDrawer, - activeDrawerId: activeDrawerIdResolved, - activeDrawerSize, - minDrawerSize, - onActiveDrawerChange, - onActiveDrawerResize - }; -} - -// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/index.js -var MobileToggle = import_react79.default.forwardRef(({ className: className2, ariaLabels, type, disabled, onClick }, ref) => { - const { TagName, iconName, getLabels } = togglesConfig[type]; - const { mainLabel, openLabel } = getLabels(ariaLabels); - return import_react79.default.createElement( - TagName, - { className: clsx_m_default(styles_css_default23["mobile-toggle"], styles_css_default23[`mobile-toggle-type-${type}`]), "aria-hidden": disabled, "aria-label": mainLabel, onClick: (e) => e.target === e.currentTarget && onClick() }, - import_react79.default.createElement(ToggleButton, { ref, className: className2, iconName, onClick, ariaLabel: openLabel, disabled, ariaExpanded: disabled }) - ); -}); -function MobileToolbar({ ariaLabels, toggleRefs, topOffset, navigationHide, toolsHide, anyPanelOpen, unfocusable, drawers, activeDrawerId, children: children2, onNavigationOpen, onToolsOpen, onDrawerChange, mobileBarRef }) { - (0, import_react79.useEffect)(() => { - if (anyPanelOpen) { - document.body.classList.add(styles_css_default23["block-body-scroll"]); - return () => { - document.body.classList.remove(styles_css_default23["block-body-scroll"]); - }; - } else { - document.body.classList.remove(styles_css_default23["block-body-scroll"]); - } - }, [anyPanelOpen]); - const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId); - const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); - return import_react79.default.createElement( - "div", - { ref: mobileBarRef, className: clsx_m_default(styles_css_default23["mobile-bar"], styles_css_default22["mobile-bar"], unfocusable && styles_css_default24.unfocusable), style: { top: topOffset } }, - !navigationHide && import_react79.default.createElement(MobileToggle, { ref: toggleRefs.navigation, type: "navigation", className: styles_css_default22["navigation-toggle"], ariaLabels, disabled: anyPanelOpen, onClick: onNavigationOpen }), - import_react79.default.createElement("div", { className: styles_css_default23["mobile-bar-breadcrumbs"] }, children2 && import_react79.default.createElement("div", { className: styles_css_default22.breadcrumbs }, children2)), - !toolsHide && !drawers && import_react79.default.createElement(MobileToggle, { ref: toggleRefs.tools, type: "tools", className: styles_css_default22["tools-toggle"], ariaLabels, disabled: anyPanelOpen, onClick: onToolsOpen }), - drawers && import_react79.default.createElement( - "aside", - { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" }, - import_react79.default.createElement( - "div", - { className: clsx_m_default(styles_css_default23["drawers-container"]), role: "toolbar", "aria-orientation": "horizontal" }, - visibleItems.map((item, index) => { - var _a2; - return import_react79.default.createElement( - "div", - { className: clsx_m_default(styles_css_default23["mobile-toggle"], styles_css_default23["mobile-toggle-type-drawer"]), key: index, onClick: () => onDrawerChange(item.id) }, - import_react79.default.createElement(ToggleButton, { className: clsx_m_default(styles_css_default22["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default22["tools-toggle"]), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, ariaLabel: (_a2 = item.ariaLabels) === null || _a2 === void 0 ? void 0 : _a2.triggerButton, ariaExpanded: activeDrawerId === item.id, testId: `awsui-app-layout-trigger-${item.id}` }) - ); - }), - overflowItems.length > 0 && import_react79.default.createElement( - "div", - { className: clsx_m_default(styles_css_default23["mobile-toggle"], styles_css_default23["mobile-toggle-type-drawer"]) }, - import_react79.default.createElement(OverflowMenu, { ariaLabel: overflowMenuHasBadge ? ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflowWithBadge : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflow, items: overflowItems, onItemClick: ({ detail }) => onDrawerChange(detail.id) }) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-focus-control.js -var import_react80 = __toESM(require_react()); -function useFocusControl(isOpen, restoreFocus = false, activeDrawerId) { - const refs = { - toggle: (0, import_react80.useRef)(null), - close: (0, import_react80.useRef)(null), - slider: (0, import_react80.useRef)(null) - }; - const previousFocusedElement = (0, import_react80.useRef)(); - const shouldFocus = (0, import_react80.useRef)(false); - const doFocus = () => { - var _a2, _b, _c; - if (!shouldFocus.current) { - return; - } - if (isOpen) { - previousFocusedElement.current = document.activeElement !== document.body ? document.activeElement : void 0; - if (refs.slider.current) { - (_a2 = refs.slider.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } else { - (_b = refs.close.current) === null || _b === void 0 ? void 0 : _b.focus(); - } - } else { - if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) { - previousFocusedElement.current.focus(); - previousFocusedElement.current = void 0; - } else { - (_c = refs.toggle.current) === null || _c === void 0 ? void 0 : _c.focus(); - } - } - shouldFocus.current = false; - }; - const setFocus = (force) => { - shouldFocus.current = true; - if (force && isOpen) { - doFocus(); - } - }; - (0, import_react80.useEffect)(doFocus, [isOpen, activeDrawerId]); - const loseFocus = (0, import_react80.useCallback)(() => { - previousFocusedElement.current = void 0; - }, []); - return { - refs, - setFocus, - loseFocus - }; -} - -// node_modules/@cloudscape-design/components/internal/context/app-layout-context.js -var import_react81 = __toESM(require_react()); -var defaultValue3 = { - stickyOffsetTop: 0, - stickyOffsetBottom: 0, - mobileBarHeight: 0 -}; -var AppLayoutContext = (0, import_react81.createContext)(defaultValue3); -function useAppLayoutContext() { - return (0, import_react81.useContext)(AppLayoutContext); -} - -// node_modules/@cloudscape-design/components/split-panel/utils/size-utils.js -var CONSTRAINED_PAGE_HEIGHT = 400; -var MAIN_PANEL_MIN_HEIGHT = 250; -var CONSTRAINED_MAIN_PANEL_MIN_HEIGHT = 40; -function getSplitPanelDefaultSize(position) { - if (typeof document === "undefined") { - return 0; - } - return position === "side" ? document.documentElement.clientWidth / 3 : document.documentElement.clientHeight / 2; -} -function getLimitedValue(min3, value, max3) { - if (min3 > max3) { - return min3; - } - if (value < min3) { - return min3; - } - if (value > max3) { - return max3; - } - return value; -} - -// node_modules/@cloudscape-design/components/app-layout/content-wrapper/index.js -var import_react82 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/content-wrapper/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/content-wrapper/styles.scoped.css"; -var styles_css_default25 = { - "content-wrapper": "awsui_content-wrapper_zycdx_1ocfz_103", - "content-wrapper-mobile": "awsui_content-wrapper-mobile_zycdx_1ocfz_107", - "content-type-dashboard": "awsui_content-type-dashboard_zycdx_1ocfz_112" -}; - -// node_modules/@cloudscape-design/components/app-layout/content-wrapper/index.js -var ContentWrapper = import_react82.default.forwardRef(({ className: className2, contentType, children: children2, toolsPadding, disablePaddings, navigationPadding, isMobile, contentWidthStyles }, ref) => { - if (disablePaddings) { - return import_react82.default.createElement("div", { className: className2, ref }, children2); - } - return import_react82.default.createElement( - "div", - { ref, className: clsx_m_default(styles_css_default25["content-wrapper"], !navigationPadding && styles_css_default25["content-wrapper-no-navigation-padding"], !toolsPadding && styles_css_default25["content-wrapper-no-tools-padding"], isMobile && styles_css_default25["content-wrapper-mobile"]) }, - import_react82.default.createElement("div", { style: contentWidthStyles, className: clsx_m_default(className2, styles_css_default25[`content-type-${contentType}`]) }, children2) - ); -}); -var content_wrapper_default = ContentWrapper; - -// node_modules/@cloudscape-design/components/app-layout/drawer/index.js -var import_react83 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/drawer/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/drawer/styles.scoped.css"; -var styles_css_default26 = { - "toggle": "awsui_toggle_1uo6m_1740t_103", - "drawer-triggers": "awsui_drawer-triggers_1uo6m_1740t_109", - "drawer": "awsui_drawer_1uo6m_1740t_109", - "drawer-mobile": "awsui_drawer-mobile_1uo6m_1740t_119", - "drawer-closed": "awsui_drawer-closed_1uo6m_1740t_122", - "drawer-content": "awsui_drawer-content_1uo6m_1740t_129", - "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_1740t_141", - "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_1740t_151", - "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_1740t_157", - "drawer-trigger": "awsui_drawer-trigger_1uo6m_1740t_109", - "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_1740t_176", - "hide": "awsui_hide_1uo6m_1740t_184" -}; - -// node_modules/@cloudscape-design/components/app-layout/drawer/index.js -var Drawer = import_react83.default.forwardRef(({ id, contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children: children2, hideOpenButton, isOpen, isHidden: isHidden2, isMobile, onToggle, onClick, onLoseFocus, resizeHandle }, ref) => { - const openButtonWrapperRef = (0, import_react83.useRef)(null); - const { TagName, iconName } = togglesConfig[type]; - const { mainLabel, closeLabel, openLabel } = ariaLabels; - const drawerContentWidthOpen = isMobile ? void 0 : width; - const drawerContentWidth = isOpen ? drawerContentWidthOpen : void 0; - const regularOpenButton = import_react83.default.createElement( - TagName, - { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles_css_default26.toggle, "aria-hidden": isOpen }, - import_react83.default.createElement(ToggleButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: isOpen ? void 0 : false }) - ); - return import_react83.default.createElement( - "div", - { ref, className: clsx_m_default(styles_css_default26.drawer, { - [styles_css_default26.hide]: isHidden2, - [styles_css_default26["drawer-closed"]]: !isOpen, - [styles_css_default22["drawer-closed"]]: !isOpen, - [styles_css_default26["drawer-mobile"]]: isMobile - }), style: { width: drawerContentWidth }, onBlur: onLoseFocus ? (e) => { - if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { - onLoseFocus(e); - } - } : void 0, onClick: (event) => { - var _a2; - if (onClick) { - onClick(event); - } - if (!isOpen) { - if (openButtonWrapperRef.current === event.target || !((_a2 = openButtonWrapperRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target))) { - onToggle(true); - } - } - } }, - import_react83.default.createElement( - "div", - { id, style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx_m_default(styles_css_default26["drawer-content"], styles_css_default26["drawer-content-clickable"], contentClassName) }, - !isMobile && !hideOpenButton && regularOpenButton, - import_react83.default.createElement( - TagName, - { className: clsx_m_default(resizeHandle && styles_css_default26["drawer-resize-content"]), "aria-label": mainLabel, "aria-hidden": !isOpen }, - !isMobile && isOpen && resizeHandle, - import_react83.default.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => { - onToggle(false); - } }), - children2 - ) - ) - ); -}); -var DrawerTrigger = import_react83.default.forwardRef(({ testUtilsClassName, ariaLabel, ariaExpanded, ariaControls, badge, itemId, isActive, trigger: trigger2, onClick }, ref) => import_react83.default.createElement( - "div", - { className: clsx_m_default(styles_css_default26["drawer-trigger"], isActive && styles_css_default26["drawer-trigger-active"]), onClick }, - import_react83.default.createElement(ToggleButton, { ref, className: testUtilsClassName, iconName: trigger2.iconName, iconSvg: trigger2.iconSvg, ariaLabel, ariaExpanded, ariaControls, badge, testId: itemId && `awsui-app-layout-trigger-${itemId}` }) -)); -var DrawerTriggersBar = ({ isMobile, topOffset, bottomOffset, activeDrawerId, ariaLabels, drawers, drawerRefs, onDrawerChange }) => { - const containerRef = import_react83.default.useRef(null); - const previousActiveDrawerId = (0, import_react83.useRef)(activeDrawerId); - const [containerHeight, triggersContainerRef] = useContainerQuery((rect) => rect.contentBoxHeight); - const isCompactMode = useDensityMode(containerRef) === "compact"; - if (activeDrawerId) { - previousActiveDrawerId.current = activeDrawerId; - } - const getIndexOfOverflowItem = () => { - if (containerHeight) { - const ITEM_HEIGHT = isCompactMode ? 34 : 38; - const overflowSpot = containerHeight / 1.5; - const index = Math.floor(overflowSpot / ITEM_HEIGHT); - return index; - } - return 0; - }; - const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId); - const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); - return import_react83.default.createElement( - "div", - { className: clsx_m_default(styles_css_default26.drawer, styles_css_default26["drawer-closed"], styles_css_default22["drawer-closed"], { - [styles_css_default26["drawer-mobile"]]: isMobile, - [styles_css_default26.hide]: drawers.length === 1 && !!activeDrawerId - }), ref: containerRef }, - import_react83.default.createElement("div", { ref: triggersContainerRef, style: { top: topOffset, bottom: bottomOffset }, className: clsx_m_default(styles_css_default26["drawer-content"], { - [styles_css_default26["drawer-content-clickable"]]: drawers.length === 1 - }), onClick: drawers.length === 1 ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null) : void 0 }, !isMobile && import_react83.default.createElement( - "aside", - { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" }, - import_react83.default.createElement( - "div", - { className: clsx_m_default(styles_css_default26["drawer-triggers-wrapper"]), role: "toolbar", "aria-orientation": "vertical" }, - visibleItems.map((item, index) => { - var _a2; - return import_react83.default.createElement(DrawerTrigger, { key: index, testUtilsClassName: clsx_m_default(styles_css_default22["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default22["tools-toggle"]), ariaExpanded: activeDrawerId === item.id, ref: item.id === previousActiveDrawerId.current ? drawerRefs.toggle : void 0, ariaLabel: (_a2 = item.ariaLabels) === null || _a2 === void 0 ? void 0 : _a2.triggerButton, ariaControls: activeDrawerId === item.id ? item.id : void 0, trigger: item.trigger, badge: item.badge, itemId: item.id, isActive: activeDrawerId === item.id, onClick: drawers.length !== 1 ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null) : void 0 }); - }), - overflowItems.length > 0 && import_react83.default.createElement( - "div", - { className: clsx_m_default(styles_css_default26["drawer-trigger"]) }, - import_react83.default.createElement(OverflowMenu, { ariaLabel: overflowMenuHasBadge ? ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflowWithBadge : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflow, items: overflowItems, onItemClick: ({ detail }) => onDrawerChange(detail.id) }) - ) - ) - )) - ); -}; - -// node_modules/@cloudscape-design/components/app-layout/drawer/resizable-drawer.js -var import_react86 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/utils/use-pointer-events.js -var import_react84 = __toESM(require_react()); -var usePointerEvents = ({ position, panelRef, handleRef, onResize, hasTransitions = false }) => { - const onDocumentPointerMove = (0, import_react84.useCallback)((event) => { - if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) { - return; - } - panelRef.current.classList.remove(styles_css_default24["with-motion"]); - if (position === "side") { - const mouseClientX = event.clientX || 0; - const handleOffset = handleRef.current.getBoundingClientRect().width / 2; - const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset; - onResize(width); - } else { - const mouseClientY = event.clientY || 0; - const handleOffset = handleRef.current.getBoundingClientRect().height / 2; - const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset; - onResize(height); - } - }, [position, panelRef, handleRef, onResize]); - const onDocumentPointerUp = (0, import_react84.useCallback)(() => { - if (!panelRef || !panelRef.current) { - return; - } - if (hasTransitions) { - panelRef.current.classList.add(styles_css_default24["with-motion"]); - } - document.body.classList.remove(styles_css_default24["resize-active"]); - document.body.classList.remove(styles_css_default24[`resize-${position}`]); - document.removeEventListener("pointerup", onDocumentPointerUp); - document.removeEventListener("pointermove", onDocumentPointerMove); - }, [panelRef, onDocumentPointerMove, position, hasTransitions]); - const onSliderPointerDown = (0, import_react84.useCallback)(() => { - document.body.classList.add(styles_css_default24["resize-active"]); - document.body.classList.add(styles_css_default24[`resize-${position}`]); - document.addEventListener("pointerup", onDocumentPointerUp); - document.addEventListener("pointermove", onDocumentPointerMove); - }, [onDocumentPointerMove, onDocumentPointerUp, position]); - return onSliderPointerDown; -}; - -// node_modules/@cloudscape-design/components/app-layout/utils/use-keyboard-events.js -var KEYBOARD_SINGLE_STEP_SIZE = 10; -var KEYBOARD_MULTIPLE_STEPS_SIZE = 60; -var getCurrentSize = (panelRef) => { - if (!panelRef || !panelRef.current) { - return { - panelHeight: 0, - panelWidth: 0 - }; - } - return { - panelHeight: panelRef.current.clientHeight, - panelWidth: panelRef.current.clientWidth - }; -}; -var useKeyboardEvents = ({ position, onResize, panelRef }) => { - return (event) => { - let currentSize; - let maxSize; - const { panelHeight, panelWidth } = getCurrentSize(panelRef); - if (position === "side") { - currentSize = panelWidth; - maxSize = window.innerWidth; - } else { - currentSize = panelHeight; - maxSize = window.innerHeight; - } - const primaryGrowKey = position === "bottom" ? KeyCode.up : KeyCode.left; - const primaryShrinkKey = position === "bottom" ? KeyCode.down : KeyCode.right; - const altGrowKey = position === "bottom" ? KeyCode.right : KeyCode.down; - const altShrinkKey = position === "bottom" ? KeyCode.left : KeyCode.up; - let isEventHandled = true; - switch (event.keyCode) { - case primaryGrowKey: - case altGrowKey: - onResize(currentSize + KEYBOARD_SINGLE_STEP_SIZE); - break; - case primaryShrinkKey: - case altShrinkKey: - onResize(currentSize - KEYBOARD_SINGLE_STEP_SIZE); - break; - case KeyCode.pageUp: - onResize(currentSize + KEYBOARD_MULTIPLE_STEPS_SIZE); - break; - case KeyCode.pageDown: - onResize(currentSize - KEYBOARD_MULTIPLE_STEPS_SIZE); - break; - case KeyCode.home: - onResize(maxSize); - break; - case KeyCode.end: - onResize(0); - break; - default: - isEventHandled = false; - } - if (isEventHandled) { - event.preventDefault(); - event.stopPropagation(); - } - }; -}; - -// node_modules/@cloudscape-design/components/split-panel/icons/resize-handler.js -var import_react85 = __toESM(require_react()); -var ResizeHandler = ({ className: className2 }) => import_react85.default.createElement( - "svg", - { focusable: false, className: className2, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" }, - import_react85.default.createElement("line", { strokeWidth: "2", x1: "2", y1: "5", x2: "14", y2: "5" }), - import_react85.default.createElement("line", { strokeWidth: "2", x1: "14", y1: "10", x2: "2", y2: "10" }) -); -var resize_handler_default = ResizeHandler; - -// node_modules/@cloudscape-design/components/split-panel/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/split-panel/styles.scoped.css"; -var styles_css_default27 = { - "drawer": "awsui_drawer_1r9lg_5jcsd_201", - "refresh": "awsui_refresh_1r9lg_5jcsd_201", - "animating": "awsui_animating_1r9lg_5jcsd_215", - "preference-icon--layout-border": "awsui_preference-icon--layout-border_1r9lg_5jcsd_238", - "preference-icon--layout-background": "awsui_preference-icon--layout-background_1r9lg_5jcsd_242", - "preference-icon--layout-header": "awsui_preference-icon--layout-header_1r9lg_5jcsd_245", - "preference-icon--border": "awsui_preference-icon--border_1r9lg_5jcsd_248", - "preference-icon--primary-button": "awsui_preference-icon--primary-button_1r9lg_5jcsd_252", - "preference-icon--secondary": "awsui_preference-icon--secondary_1r9lg_5jcsd_255", - "preference-icon--disabled-element": "awsui_preference-icon--disabled-element_1r9lg_5jcsd_258", - "preference-icon--separator": "awsui_preference-icon--separator_1r9lg_5jcsd_261", - "preference-icon--focus-text": "awsui_preference-icon--focus-text_1r9lg_5jcsd_264", - "preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-top_1r9lg_5jcsd_268", - "preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-main_1r9lg_5jcsd_271", - "preference-icon-refresh--primary": "awsui_preference-icon-refresh--primary_1r9lg_5jcsd_274", - "preference-icon-refresh--disabled": "awsui_preference-icon-refresh--disabled_1r9lg_5jcsd_277", - "preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-header_1r9lg_5jcsd_280", - "preference-icon-refresh--window": "awsui_preference-icon-refresh--window_1r9lg_5jcsd_283", - "preference-icon-refresh--secondary": "awsui_preference-icon-refresh--secondary_1r9lg_5jcsd_287", - "preference-icon-refresh--default": "awsui_preference-icon-refresh--default_1r9lg_5jcsd_290", - "preference-icon-refresh--separator": "awsui_preference-icon-refresh--separator_1r9lg_5jcsd_293", - "preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-default_1r9lg_5jcsd_296", - "preference-icon-refresh--heading": "awsui_preference-icon-refresh--heading_1r9lg_5jcsd_299", - "root": "awsui_root_1r9lg_5jcsd_303", - "preferences-button": "awsui_preferences-button_1r9lg_5jcsd_338", - "close-button": "awsui_close-button_1r9lg_5jcsd_342", - "drawer-closed": "awsui_drawer-closed_1r9lg_5jcsd_354", - "drawer-content-side": "awsui_drawer-content-side_1r9lg_5jcsd_359", - "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_5jcsd_375", - "position-bottom": "awsui_position-bottom_1r9lg_5jcsd_381", - "position-side": "awsui_position-side_1r9lg_5jcsd_408", - "slider": "awsui_slider_1r9lg_5jcsd_414", - "slider-side": "awsui_slider-side_1r9lg_5jcsd_449", - "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_5jcsd_456", - "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_5jcsd_467", - "open-button": "awsui_open-button_1r9lg_5jcsd_478", - "open-button-side": "awsui_open-button-side_1r9lg_5jcsd_482", - "slider-icon": "awsui_slider-icon_1r9lg_5jcsd_491", - "slider-icon-bottom": "awsui_slider-icon-bottom_1r9lg_5jcsd_497", - "slider-icon-side": "awsui_slider-icon-side_1r9lg_5jcsd_501", - "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_5jcsd_505", - "drawer-mobile": "awsui_drawer-mobile_1r9lg_5jcsd_516", - "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_5jcsd_520", - "content-bottom": "awsui_content-bottom_1r9lg_5jcsd_529", - "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_5jcsd_545", - "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_5jcsd_550", - "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_5jcsd_554", - "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_5jcsd_558", - "content-side": "awsui_content-side_1r9lg_5jcsd_563", - "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_5jcsd_573", - "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_5jcsd_579", - "header": "awsui_header_1r9lg_5jcsd_586", - "header-text": "awsui_header-text_1r9lg_5jcsd_596", - "header-actions": "awsui_header-actions_1r9lg_5jcsd_609", - "divider": "awsui_divider_1r9lg_5jcsd_617" -}; - -// node_modules/@cloudscape-design/components/app-layout/drawer/resizable-drawer.js -var ResizableDrawer = (_a2) => { - var _b, _c, _d, _e; - var { onResize, maxWidth, minWidth, refs, activeDrawer, toolsContent } = _a2, props2 = __rest(_a2, ["onResize", "maxWidth", "minWidth", "refs", "activeDrawer", "toolsContent"]); - const { isOpen, children: children2, width, isMobile } = props2; - const clampedWidth = getLimitedValue(minWidth, width, maxWidth); - const relativeSize = (clampedWidth - minWidth) / (maxWidth - minWidth) * 100; - const setSidePanelWidth = (newWidth) => { - const size2 = getLimitedValue(minWidth, newWidth, maxWidth); - const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id; - if (isOpen && id && maxWidth >= minWidth) { - onResize({ size: size2, id }); - } - }; - const drawerRefObject = (0, import_react86.useRef)(null); - const sizeControlProps = { - position: "side", - panelRef: drawerRefObject, - handleRef: refs.slider, - onResize: setSidePanelWidth - }; - const onSliderPointerDown = usePointerEvents(sizeControlProps); - const onKeyDown = useKeyboardEvents(sizeControlProps); - const resizeHandle = import_react86.default.createElement( - "div", - { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx_m_default(styles_css_default27.slider, styles_css_default27[`slider-side`], styles_css_default22["drawers-slider"]), onKeyDown, onPointerDown: onSliderPointerDown }, - import_react86.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default27["slider-icon"], styles_css_default27[`slider-icon-side`]) }) - ); - return import_react86.default.createElement( - Drawer, - Object.assign({}, props2, { id: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id, width: clampedWidth, ref: drawerRefObject, isHidden: !activeDrawer, resizeHandle: !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && import_react86.default.createElement("div", { className: styles_css_default27["slider-wrapper-side"] }, resizeHandle), ariaLabels: { - openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton, - mainLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.drawerName, - closeLabel: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.closeButton - } }), - toolsContent && import_react86.default.createElement("div", { className: clsx_m_default((activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== TOOLS_DRAWER_ID && styles_css_default26.hide) }, toolsContent), - (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== TOOLS_DRAWER_ID ? children2 : null - ); -}; - -// node_modules/@cloudscape-design/components/app-layout/split-panel/constants.js -var SPLIT_PANEL_MIN_HEIGHT = 160; -var SPLIT_PANEL_MIN_WIDTH = 280; - -// node_modules/@cloudscape-design/components/app-layout/split-panel/drawer.js -var import_react88 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/split-panel/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/split-panel/styles.scoped.css"; -var styles_css_default28 = { - "drawer-displayed": "awsui_drawer-displayed_1lh3u_1yevz_103", - "drawer-content": "awsui_drawer-content_1lh3u_1yevz_107" -}; - -// node_modules/@cloudscape-design/components/internal/context/split-panel-context.js -var import_react87 = __toESM(require_react()); -var SplitPanelContext = (0, import_react87.createContext)(null); -var SplitPanelContextProvider = SplitPanelContext.Provider; -function useSplitPanelContext() { - const ctx = (0, import_react87.useContext)(SplitPanelContext); - if (!ctx) { - throw new Error("Split panel can only be used inside app layout"); - } - return ctx; -} - -// node_modules/@cloudscape-design/components/app-layout/split-panel/drawer.js -function SideSplitPanelDrawer({ displayed, children: children2 }) { - const { isOpen, size: size2, topOffset, bottomOffset } = useSplitPanelContext(); - const width = isOpen && children2 ? size2 : void 0; - return import_react88.default.createElement( - "div", - { className: clsx_m_default(displayed && styles_css_default28["drawer-displayed"]), style: { width }, "data-testid": "side-split-panel-drawer" }, - import_react88.default.createElement("div", { className: styles_css_default28["drawer-content"], style: { width, top: topOffset, bottom: bottomOffset } }, children2) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/split-panel/provider.js -var import_react89 = __toESM(require_react()); -function SplitPanelProvider(_a2) { - var { children: children2, size: size2, getMaxHeight, maxWidth, onResize } = _a2, rest = __rest(_a2, ["children", "size", "getMaxHeight", "maxWidth", "onResize"]); - const { position, reportSize, isOpen } = rest; - const [maxHeight, setMaxHeight] = (0, import_react89.useState)(size2); - const minSize = position === "bottom" ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH; - const maxSize = position === "bottom" ? maxHeight : maxWidth; - const cappedSize = getLimitedValue(minSize, size2, maxSize); - const relativeSize = (size2 - minSize) / (maxSize - minSize) * 100; - const onResizeWithValidation = (newSize) => { - const maxSize2 = position === "side" ? maxWidth : getMaxHeight(); - const isResizeValid = position === "side" ? maxSize2 >= SPLIT_PANEL_MIN_WIDTH : maxSize2 >= SPLIT_PANEL_MIN_HEIGHT; - if (isOpen && isResizeValid) { - onResize(getLimitedValue(minSize, newSize, maxSize2)); - } - }; - (0, import_react89.useEffect)(() => { - if (position !== "bottom") { - return; - } - const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight())); - return () => cancelAnimationFrame(handle); - }, [size2, minSize, position, getMaxHeight]); - (0, import_react89.useEffect)(() => { - reportSize(cappedSize); - }, [reportSize, cappedSize]); - (0, import_react89.useEffect)(() => { - if (position !== "bottom") { - return; - } - const handler = () => setMaxHeight(getMaxHeight()); - window.addEventListener("resize", handler); - return () => window.removeEventListener("resize", handler); - }, [position, getMaxHeight]); - return import_react89.default.createElement(SplitPanelContextProvider, { value: Object.assign(Object.assign({}, rest), { size: cappedSize, relativeSize, onResize: onResizeWithValidation }) }, children2); -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-split-panel-focus-control.js -var import_react90 = __toESM(require_react()); -function useSplitPanelFocusControl(dependencies) { - const refs = { - toggle: (0, import_react90.useRef)(null), - slider: (0, import_react90.useRef)(null), - preferences: (0, import_react90.useRef)(null) - }; - const lastInteraction = (0, import_react90.useRef)(null); - (0, import_react90.useEffect)(() => { - var _a2, _b, _c, _d; - switch ((_a2 = lastInteraction.current) === null || _a2 === void 0 ? void 0 : _a2.type) { - case "open": - (_b = refs.slider.current) === null || _b === void 0 ? void 0 : _b.focus(); - break; - case "close": - (_c = refs.toggle.current) === null || _c === void 0 ? void 0 : _c.focus(); - break; - case "position": - (_d = refs.preferences.current) === null || _d === void 0 ? void 0 : _d.focus(); - break; - } - lastInteraction.current = null; - }, dependencies); - return { - refs, - setLastInteraction: (interaction) => lastInteraction.current = interaction - }; -} - -// node_modules/@cloudscape-design/components/app-layout/classic.js -var ClassicAppLayout = import_react91.default.forwardRef((_a2, ref) => { - var _b, _c, _d, _e, _f, _g; - var { navigation, navigationWidth, navigationHide, navigationOpen, tools, toolsWidth, toolsHide, toolsOpen: controlledToolsOpen, breadcrumbs, notifications, stickyNotifications, contentHeader, disableContentHeaderOverlap, content, contentType, disableContentPaddings, disableBodyScroll, maxContentWidth, minContentWidth, placement, ariaLabels, splitPanel, splitPanelSize: controlledSplitPanelSize, splitPanelOpen: controlledSplitPanelOpen, splitPanelPreferences: controlledSplitPanelPreferences, onSplitPanelPreferencesChange, onSplitPanelResize, onSplitPanelToggle, onNavigationChange, onToolsChange, drawers: controlledDrawers, onDrawerChange, activeDrawerId: controlledActiveDrawerId } = _a2, rest = __rest(_a2, ["navigation", "navigationWidth", "navigationHide", "navigationOpen", "tools", "toolsWidth", "toolsHide", "toolsOpen", "breadcrumbs", "notifications", "stickyNotifications", "contentHeader", "disableContentHeaderOverlap", "content", "contentType", "disableContentPaddings", "disableBodyScroll", "maxContentWidth", "minContentWidth", "placement", "ariaLabels", "splitPanel", "splitPanelSize", "splitPanelOpen", "splitPanelPreferences", "onSplitPanelPreferencesChange", "onSplitPanelResize", "onSplitPanelToggle", "onNavigationChange", "onToolsChange", "drawers", "onDrawerChange", "activeDrawerId"]); - const __embeddedViewMode = Boolean(rest.__embeddedViewMode); - const rootRef = (0, import_react91.useRef)(null); - const isMobile = useMobile(); - const [toolsOpen = false, setToolsOpen] = useControllable2(controlledToolsOpen, onToolsChange, false, { - componentName: "AppLayout", - controlledProp: "toolsOpen", - changeHandler: "onToolsChange" - }); - const onToolsToggle = (open) => { - setToolsOpen(open); - focusToolsButtons(); - fireNonCancelableEvent(onToolsChange, { open }); - }; - const { drawers, activeDrawer, minDrawerSize, activeDrawerSize, activeDrawerId, ariaLabelsWithDrawers, onActiveDrawerChange, onActiveDrawerResize } = useDrawers(Object.assign({ drawers: controlledDrawers, onDrawerChange, activeDrawerId: controlledActiveDrawerId }, rest), ariaLabels, { - ariaLabels, - tools, - toolsOpen, - toolsHide, - toolsWidth, - onToolsToggle - }); - ariaLabels = ariaLabelsWithDrawers; - const hasDrawers = !!drawers; - const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen); - const { refs: toolsRefs, setFocus: focusToolsButtons, loseFocus: loseToolsFocus } = useFocusControl(toolsOpen || activeDrawer !== void 0, true); - const { refs: drawerRefs, setFocus: focusDrawersButtons, loseFocus: loseDrawersFocus } = useFocusControl(!!activeDrawerId, true, activeDrawerId); - const onNavigationToggle = useStableCallback((open) => { - focusNavButtons(); - fireNonCancelableEvent(onNavigationChange, { open }); - }); - const onNavigationClick = (event) => { - const hasLink = findUpUntil2(event.target, (node) => node.tagName === "A" && !!node.href); - if (hasLink) { - onNavigationToggle(false); - } - }; - (0, import_react91.useEffect)(() => { - if (isMobile) { - onNavigationToggle(false); - } - }, [isMobile, onNavigationToggle]); - const navigationVisible = !navigationHide && navigationOpen; - const toolsVisible = !toolsHide && toolsOpen; - const [headerFooterHeight, setHeaderFooterHeight] = (0, import_react91.useState)(0); - (0, import_react91.useEffect)(() => { - const id = requestAnimationFrame(() => setHeaderFooterHeight(placement.top + placement.bottom)); - return () => cancelAnimationFrame(id); - }, [placement.top, placement.bottom]); - const contentHeightStyle = { - [disableBodyScroll ? "height" : "minHeight"]: `calc(100vh - ${headerFooterHeight}px)` - }; - const [notificationsHeight, notificationsRef] = useContainerQuery((rect) => rect.contentBoxHeight); - const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer; - const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false; - const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null; - const [splitPanelPreferences, setSplitPanelPreferences] = useControllable2(controlledSplitPanelPreferences, onSplitPanelPreferencesChange, void 0, { - componentName: "AppLayout", - controlledProp: "splitPanelPreferences", - changeHandler: "onSplitPanelPreferencesChange" - }); - const [splitPanelOpen = false, setSplitPanelOpen] = useControllable2(controlledSplitPanelOpen, onSplitPanelToggle, false, { - componentName: "AppLayout", - controlledProp: "splitPanelOpen", - changeHandler: "onSplitPanelToggle" - }); - const splitPanelPosition = (splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) || "bottom"; - const [splitPanelReportedToggle, setSplitPanelReportedToggle] = (0, import_react91.useState)({ - displayed: false, - ariaLabel: void 0 - }); - const splitPanelDisplayed = !!(splitPanel && (splitPanelReportedToggle.displayed || splitPanelOpen)); - const closedDrawerWidth = 40; - const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth; - const getEffectiveToolsWidth = () => { - if (activeDrawer && activeDrawerSize) { - return activeDrawerSize; - } - if (toolsHide || drawers) { - return 0; - } - if (toolsOpen) { - return toolsWidth; - } - return closedDrawerWidth; - }; - const effectiveToolsWidth = getEffectiveToolsWidth(); - const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition); - const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable2(controlledSplitPanelSize, onSplitPanelResize, defaultSplitPanelSize, { - componentName: "AppLayout", - controlledProp: "splitPanelSize", - changeHandler: "onSplitPanelResize" - }); - const mainContentRef = (0, import_react91.useRef)(null); - const legacyScrollRootRef = (0, import_react91.useRef)(null); - const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([ - splitPanelPreferences, - splitPanelOpen - ]); - const onSplitPanelPreferencesSet = (0, import_react91.useCallback)((detail) => { - setSplitPanelPreferences(detail); - setSplitPanelLastInteraction({ type: "position" }); - fireNonCancelableEvent(onSplitPanelPreferencesChange, detail); - }, [setSplitPanelPreferences, onSplitPanelPreferencesChange, setSplitPanelLastInteraction]); - const onSplitPanelSizeSet = (0, import_react91.useCallback)((newSize) => { - setSplitPanelSize(newSize); - fireNonCancelableEvent(onSplitPanelResize, { size: newSize }); - }, [setSplitPanelSize, onSplitPanelResize]); - const onSplitPanelToggleHandler = (0, import_react91.useCallback)(() => { - setSplitPanelOpen(!splitPanelOpen); - setSplitPanelLastInteraction({ type: splitPanelOpen ? "close" : "open" }); - fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen }); - }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle, setSplitPanelLastInteraction]); - const getSplitPanelMaxHeight = useStableCallback(() => { - if (typeof document === "undefined") { - return 0; - } else if (disableBodyScroll && legacyScrollRootRef.current) { - const availableHeight = legacyScrollRootRef.current.clientHeight; - return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT; - } else { - const availableHeight = document.documentElement.clientHeight - placement.top - placement.bottom; - return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT : availableHeight - MAIN_PANEL_MIN_HEIGHT; - } - }); - const rightDrawerBarWidth = drawers ? drawers.length > 1 ? closedDrawerWidth : 0 : 0; - const contentPadding = 80; - const resizableSpaceAvailable = Math.max(0, placement.width - effectiveNavigationWidth - minContentWidth - contentPadding - rightDrawerBarWidth); - const isSplitPanelForcedPosition = isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH; - const finalSplitPanePosition = isSplitPanelForcedPosition ? "bottom" : splitPanelPosition; - const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === "side"; - const sideSplitPanelSize = splitPaneAvailableOnTheSide ? splitPanelOpen ? splitPanelSize : closedDrawerWidth : 0; - const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth); - const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize); - const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth; - const contentMaxWidthStyle = !isMobile ? { maxWidth: maxContentWidth } : void 0; - const [splitPanelReportedSize, setSplitPanelReportedSize] = (0, import_react91.useState)(0); - const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = (0, import_react91.useState)(0); - const splitPanelContextProps = { - topOffset: placement.top + (finalSplitPanePosition === "bottom" ? stickyNotificationsHeight || 0 : 0), - bottomOffset: placement.bottom, - leftOffset: placement.left + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth), - rightOffset: isMobile ? 0 : placement.right + effectiveToolsWidth + rightDrawerBarWidth, - position: finalSplitPanePosition, - size: splitPanelSize, - maxWidth: splitPanelMaxWidth, - getMaxHeight: getSplitPanelMaxHeight, - disableContentPaddings, - contentWidthStyles: contentMaxWidthStyle, - isOpen: splitPanelOpen, - isForcedPosition: isSplitPanelForcedPosition, - onResize: onSplitPanelSizeSet, - onToggle: onSplitPanelToggleHandler, - onPreferencesChange: onSplitPanelPreferencesSet, - setSplitPanelToggle: setSplitPanelReportedToggle, - reportSize: setSplitPanelReportedSize, - reportHeaderHeight: setSplitPanelReportedHeaderHeight, - refs: splitPanelRefs - }; - const splitPanelWrapped = splitPanel && import_react91.default.createElement(SplitPanelProvider, Object.assign({}, splitPanelContextProps), finalSplitPanePosition === "side" ? import_react91.default.createElement(SideSplitPanelDrawer, { displayed: splitPanelDisplayed }, splitPanel) : splitPanel); - const contentWrapperProps = { - contentType, - navigationPadding: navigationHide || !!navigationOpen, - contentWidthStyles: !isMobile ? { minWidth: minContentWidth, maxWidth: maxContentWidth } : void 0, - toolsPadding: ( - // tools padding is displayed in one of the three cases - // 1. Nothing on the that screen edge (no tools panel and no split panel) - toolsHide || hasDrawers && !activeDrawer && (!splitPanelDisplayed || finalSplitPanePosition !== "side") || // 2. Tools panel is present and open - toolsVisible || // 3. Split panel is open in side position - splitPaneAvailableOnTheSide && splitPanelOpen - ), - isMobile - }; - (0, import_react91.useImperativeHandle)(ref, () => ({ - openTools: () => onToolsToggle(true), - closeNavigationIfNecessary: () => { - if (isMobile) { - onNavigationToggle(false); - } - }, - focusToolsClose: () => { - if (hasDrawers) { - focusDrawersButtons(true); - } else { - focusToolsButtons(true); - } - }, - focusActiveDrawer: () => focusDrawersButtons(true), - focusSplitPanel: () => { - var _a3; - return (_a3 = splitPanelRefs.slider.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - })); - const splitPanelBottomOffset = (_b = !splitPanelDisplayed || finalSplitPanePosition !== "bottom" ? void 0 : splitPanelOpen ? splitPanelReportedSize : splitPanelReportedHeaderHeight) !== null && _b !== void 0 ? _b : void 0; - const [mobileBarHeight, mobileBarRef] = useContainerQuery((rect) => rect.contentBoxHeight); - return import_react91.default.createElement( - "div", - { className: clsx_m_default(styles_css_default24.root, styles_css_default22.root, disableBodyScroll && styles_css_default24["root-no-scroll"]), ref: rootRef, style: contentHeightStyle }, - isMobile && !__embeddedViewMode && (!toolsHide || !navigationHide || breadcrumbs) && import_react91.default.createElement(MobileToolbar, { anyPanelOpen, toggleRefs: { navigation: navigationRefs.toggle, tools: toolsRefs.toggle }, topOffset: placement.top, ariaLabels, navigationHide, toolsHide, onNavigationOpen: () => onNavigationToggle(true), onToolsOpen: () => onToolsToggle(true), unfocusable: anyPanelOpen, mobileBarRef, drawers, activeDrawerId, onDrawerChange: (newDrawerId) => { - onActiveDrawerChange(newDrawerId); - if (newDrawerId !== activeDrawerId) { - focusToolsButtons(); - focusDrawersButtons(); - } - } }, breadcrumbs), - import_react91.default.createElement( - "div", - { className: clsx_m_default(styles_css_default24.layout, disableBodyScroll && styles_css_default24["layout-no-scroll"]) }, - !navigationHide && import_react91.default.createElement(Drawer, { contentClassName: styles_css_default22.navigation, toggleClassName: styles_css_default22["navigation-toggle"], closeClassName: styles_css_default22["navigation-close"], ariaLabels: togglesConfig.navigation.getLabels(ariaLabels), bottomOffset: placement.bottom, topOffset: placement.top, isMobile, isOpen: navigationOpen, onClick: isMobile ? onNavigationClick : void 0, onToggle: onNavigationToggle, toggleRefs: navigationRefs, type: "navigation", width: navigationWidth }, navigation), - import_react91.default.createElement( - "main", - { ref: legacyScrollRootRef, className: clsx_m_default(styles_css_default24["layout-main"], { - [styles_css_default24["layout-main-scrollable"]]: disableBodyScroll, - [styles_css_default22["disable-body-scroll-root"]]: disableBodyScroll, - [styles_css_default24.unfocusable]: isMobile && anyPanelOpen - }) }, - import_react91.default.createElement( - "div", - { style: { - marginBottom: splitPanelBottomOffset - } }, - notifications && import_react91.default.createElement(Notifications, { disableContentPaddings, testUtilsClassName: styles_css_default22.notifications, labels: ariaLabels, topOffset: disableBodyScroll ? 0 : placement.top, sticky: !isMobile && stickyNotifications, ref: notificationsRef }, notifications), - (!isMobile && breadcrumbs || contentHeader) && import_react91.default.createElement( - content_wrapper_default, - Object.assign({}, contentWrapperProps), - !isMobile && breadcrumbs && import_react91.default.createElement("div", { className: clsx_m_default(styles_css_default22.breadcrumbs, styles_css_default24["breadcrumbs-desktop"]) }, breadcrumbs), - contentHeader && import_react91.default.createElement("div", { className: clsx_m_default(styles_css_default24["content-header-wrapper"], !hasRenderedNotifications && (isMobile || !breadcrumbs) && styles_css_default24["content-extra-top-padding"], !hasRenderedNotifications && !breadcrumbs && styles_css_default24["content-header-wrapper-first-child"], !disableContentHeaderOverlap && styles_css_default24["content-header-wrapper-overlapped"]) }, contentHeader) - ), - import_react91.default.createElement( - content_wrapper_default, - Object.assign({}, contentWrapperProps, { - ref: mainContentRef, - disablePaddings: disableContentPaddings, - // eslint-disable-next-line react/forbid-component-props - className: clsx_m_default(!disableContentPaddings && styles_css_default24["content-wrapper"], !disableContentPaddings && (isMobile || !breadcrumbs) && !contentHeader && styles_css_default24["content-extra-top-padding"], styles_css_default22.content, !disableContentHeaderOverlap && contentHeader && styles_css_default24["content-overlapped"], !hasRenderedNotifications && !breadcrumbs && !isMobile && !contentHeader && styles_css_default24["content-wrapper-first-child"]) - }), - import_react91.default.createElement(AppLayoutContext.Provider, { value: { - stickyOffsetTop: ( - // We don't support the table header being sticky in case the deprecated disableBodyScroll is enabled, - // therefore we ensure the table header scrolls out of view by offseting a large enough value (9999px) - (disableBodyScroll ? isMobile ? -9999 : 0 : placement.top) + (isMobile ? 0 : stickyNotificationsHeight !== null ? stickyNotificationsHeight : 0) - ), - stickyOffsetBottom: placement.bottom + (splitPanelBottomOffset || 0), - mobileBarHeight: mobileBarHeight !== null && mobileBarHeight !== void 0 ? mobileBarHeight : 0 - } }, content) - ) - ), - finalSplitPanePosition === "bottom" && splitPanelWrapped - ), - finalSplitPanePosition === "side" && splitPanelWrapped, - hasDrawers ? import_react91.default.createElement(ResizableDrawer, { contentClassName: clsx_m_default(activeDrawerId && styles_css_default22["active-drawer"], activeDrawerId === TOOLS_DRAWER_ID && styles_css_default22.tools), toggleClassName: styles_css_default22["tools-toggle"], closeClassName: clsx_m_default(styles_css_default22["active-drawer-close-button"], activeDrawerId === TOOLS_DRAWER_ID && styles_css_default22["tools-close"]), ariaLabels: { - openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton, - closeLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.closeButton, - mainLabel: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.drawerName, - resizeHandle: (_f = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _f === void 0 ? void 0 : _f.resizeHandle - }, minWidth: minDrawerSize, maxWidth: drawerMaxSize, width: activeDrawerSize, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, onToggle: (isOpen) => { - if (!isOpen) { - focusToolsButtons(); - focusDrawersButtons(); - onActiveDrawerChange(null); - } - }, isOpen: true, hideOpenButton: true, toggleRefs: drawerRefs, type: "tools", onLoseFocus: loseDrawersFocus, activeDrawer, onResize: (changeDetail) => onActiveDrawerResize(changeDetail), refs: drawerRefs, toolsContent: (_g = drawers === null || drawers === void 0 ? void 0 : drawers.find((drawer) => drawer.id === TOOLS_DRAWER_ID)) === null || _g === void 0 ? void 0 : _g.content }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content) : !toolsHide && import_react91.default.createElement(Drawer, { contentClassName: styles_css_default22.tools, toggleClassName: styles_css_default22["tools-toggle"], closeClassName: styles_css_default22["tools-close"], ariaLabels: togglesConfig.tools.getLabels(ariaLabels), width: toolsWidth, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, onToggle: onToolsToggle, isOpen: toolsOpen, toggleRefs: toolsRefs, type: "tools", onLoseFocus: loseToolsFocus }, tools), - hasDrawers && drawers.length > 0 && import_react91.default.createElement(DrawerTriggersBar, { drawerRefs, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, drawers, activeDrawerId, onDrawerChange: (newDrawerId) => { - if (activeDrawerId !== newDrawerId) { - focusToolsButtons(); - focusDrawersButtons(); - } - onActiveDrawerChange(newDrawerId); - }, ariaLabels }) - ) - ); -}); -var classic_default = ClassicAppLayout; - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/index.js -var import_react108 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/context.js -var import_react96 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/context/dynamic-overlap-context.js -var import_react92 = __toESM(require_react()); -var DynamicOverlapContext = (0, import_react92.createContext)(() => { -}); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/split-panel.js -var import_react93 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/app-layout/visual-refresh/styles.scoped.css"; -var styles_css_default29 = { - "background": "awsui_background_hyvsj_1t7qb_99", - "scrolling-background": "awsui_scrolling-background_hyvsj_1t7qb_102", - "sticky-background": "awsui_sticky-background_hyvsj_1t7qb_108", - "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1t7qb_116", - "breadcrumbs": "awsui_breadcrumbs_hyvsj_1t7qb_129", - "has-sticky-background": "awsui_has-sticky-background_hyvsj_1t7qb_139", - "drawers-container": "awsui_drawers-container_hyvsj_1t7qb_151", - "has-open-drawer": "awsui_has-open-drawer_hyvsj_1t7qb_162", - "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1t7qb_185", - "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1t7qb_190", - "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1t7qb_231", - "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1t7qb_241", - "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1t7qb_245", - "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1t7qb_259", - "drawers-trigger": "awsui_drawers-trigger_hyvsj_1t7qb_245", - "drawer": "awsui_drawer_hyvsj_1t7qb_151", - "drawer-content-container": "awsui_drawer-content-container_hyvsj_1t7qb_290", - "drawer-close-button": "awsui_drawer-close-button_hyvsj_1t7qb_299", - "drawer-content": "awsui_drawer-content_hyvsj_1t7qb_290", - "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_1t7qb_307", - "drawer-slider": "awsui_drawer-slider_hyvsj_1t7qb_310", - "is-drawer-open": "awsui_is-drawer-open_hyvsj_1t7qb_317", - "content": "awsui_content_hyvsj_1t7qb_343", - "layout": "awsui_layout_hyvsj_1t7qb_364", - "has-max-content-width": "awsui_has-max-content-width_hyvsj_1t7qb_445", - "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1t7qb_460", - "content-type-table": "awsui_content-type-table_hyvsj_1t7qb_474", - "content-type-cards": "awsui_content-type-cards_hyvsj_1t7qb_474", - "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1t7qb_480", - "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_1t7qb_483", - "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1t7qb_515", - "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1t7qb_518", - "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1t7qb_528", - "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1t7qb_531", - "content-first-child-header": "awsui_content-first-child-header_hyvsj_1t7qb_534", - "has-header": "awsui_has-header_hyvsj_1t7qb_534", - "content-first-child-main": "awsui_content-first-child-main_hyvsj_1t7qb_552", - "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1t7qb_552", - "has-split-panel": "awsui_has-split-panel_hyvsj_1t7qb_589", - "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1t7qb_589", - "block-body-scroll": "awsui_block-body-scroll_hyvsj_1t7qb_605", - "unfocusable": "awsui_unfocusable_hyvsj_1t7qb_610", - "container": "awsui_container_hyvsj_1t7qb_620", - "is-navigation-open": "awsui_is-navigation-open_hyvsj_1t7qb_646", - "is-tools-open": "awsui_is-tools-open_hyvsj_1t7qb_649", - "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1t7qb_649", - "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1t7qb_649", - "has-active-drawer": "awsui_has-active-drawer_hyvsj_1t7qb_649", - "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1t7qb_658", - "remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_1t7qb_675", - "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1t7qb_679", - "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1t7qb_683", - "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1t7qb_687", - "navigation-container": "awsui_navigation-container_hyvsj_1t7qb_696", - "show-navigation": "awsui_show-navigation_hyvsj_1t7qb_734", - "animating": "awsui_animating_hyvsj_1t7qb_757", - "showButtons": "awsui_showButtons_hyvsj_1t7qb_1", - "navigation": "awsui_navigation_hyvsj_1t7qb_696", - "openNavigation": "awsui_openNavigation_hyvsj_1t7qb_1", - "animated-content": "awsui_animated-content_hyvsj_1t7qb_819", - "hide-navigation": "awsui_hide-navigation_hyvsj_1t7qb_828", - "notifications": "awsui_notifications_hyvsj_1t7qb_838", - "sticky-notifications": "awsui_sticky-notifications_hyvsj_1t7qb_844", - "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1t7qb_861", - "position-bottom": "awsui_position-bottom_hyvsj_1t7qb_908", - "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1t7qb_1", - "split-panel-side": "awsui_split-panel-side_hyvsj_1t7qb_937", - "position-side": "awsui_position-side_hyvsj_1t7qb_950", - "tools-container": "awsui_tools-container_hyvsj_1t7qb_972", - "tools": "awsui_tools_hyvsj_1t7qb_972", - "openTools": "awsui_openTools_hyvsj_1t7qb_1", - "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1t7qb_1063", - "hide-tools": "awsui_hide-tools_hyvsj_1t7qb_1073", - "show-tools": "awsui_show-tools_hyvsj_1t7qb_1085", - "has-tools-form": "awsui_has-tools-form_hyvsj_1t7qb_1063", - "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1t7qb_1168", - "trigger": "awsui_trigger_hyvsj_1t7qb_1168", - "selected": "awsui_selected_hyvsj_1t7qb_1242", - "badge": "awsui_badge_hyvsj_1t7qb_1262", - "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1t7qb_1266", - "dot": "awsui_dot_hyvsj_1t7qb_1277" -}; - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/split-panel.js -function SplitPanel({ children: children2 }) { - const { footerHeight, handleSplitPanelClick, handleSplitPanelPreferencesChange, handleSplitPanelResize, headerHeight, isSplitPanelForcedPosition, isSplitPanelOpen, setSplitPanelReportedSize, setSplitPanelReportedHeaderHeight, setSplitPanelToggle, splitPanelPosition, splitPanelRefs, splitPanelSize } = useAppLayoutInternals(); - const props2 = { - bottomOffset: 0, - getMaxHeight: () => { - const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight; - return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250; - }, - maxWidth: typeof document !== "undefined" ? document.documentElement.clientWidth : Number.POSITIVE_INFINITY, - isForcedPosition: isSplitPanelForcedPosition, - isOpen: isSplitPanelOpen, - leftOffset: 0, - onPreferencesChange: handleSplitPanelPreferencesChange, - onResize: handleSplitPanelResize, - onToggle: handleSplitPanelClick, - position: splitPanelPosition, - reportSize: setSplitPanelReportedSize, - reportHeaderHeight: setSplitPanelReportedHeaderHeight, - rightOffset: 0, - size: splitPanelSize || 0, - topOffset: 0, - setSplitPanelToggle, - refs: splitPanelRefs - }; - return import_react93.default.createElement(SplitPanelProvider, Object.assign({}, props2), children2); -} -function SplitPanelBottom() { - const { disableBodyScroll, hasOpenDrawer, navigationOpen, isSplitPanelOpen, splitPanel, splitPanelPosition, splitPanelReportedSize, splitPanelReportedHeaderHeight } = useAppLayoutInternals(); - if (!splitPanel) { - return null; - } - return import_react93.default.createElement(Transition2, { in: isSplitPanelOpen !== null && isSplitPanelOpen !== void 0 ? isSplitPanelOpen : false, exit: false }, (state, transitionEventsRef) => import_react93.default.createElement( - "section", - { className: clsx_m_default(styles_css_default29["split-panel-bottom"], styles_css_default29[`position-${splitPanelPosition}`], { - [styles_css_default29.animating]: state === "entering", - [styles_css_default29["disable-body-scroll"]]: disableBodyScroll, - [styles_css_default29["has-open-drawer"]]: hasOpenDrawer, - [styles_css_default29["is-navigation-open"]]: navigationOpen, - [styles_css_default29["is-split-panel-open"]]: isSplitPanelOpen - }), ref: transitionEventsRef, style: { - [custom_css_properties_default.splitPanelReportedSize]: `${splitPanelReportedSize}px`, - [custom_css_properties_default.splitPanelReportedHeaderSize]: `${splitPanelReportedHeaderHeight}px` - } }, - import_react93.default.createElement(SplitPanel, null), - splitPanelPosition === "bottom" && splitPanel - )); -} -function SplitPanelSide() { - const { isSplitPanelOpen, splitPanel, splitPanelPosition, splitPanelMaxWidth, splitPanelControlId, isToolsOpen, activeDrawerId } = useAppLayoutInternals(); - if (!splitPanel) { - return null; - } - return import_react93.default.createElement("section", { id: splitPanelControlId, "aria-hidden": !isSplitPanelOpen || splitPanelPosition === "bottom" ? true : false, className: clsx_m_default(styles_css_default29["split-panel-side"], styles_css_default29[`position-${splitPanelPosition}`], { - [styles_css_default29["is-split-panel-open"]]: isSplitPanelOpen, - [styles_css_default29["has-open-drawer"]]: !!activeDrawerId || isToolsOpen - }), style: { - [custom_css_properties_default.splitPanelMaxWidth]: `${splitPanelMaxWidth}px`, - [custom_css_properties_default.splitPanelMinWidth]: `${SPLIT_PANEL_MIN_WIDTH}px` - } }, splitPanelPosition === "side" && splitPanel); -} -function getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences) { - let splitPanelPosition = "bottom"; - if (!isSplitPanelForcedPosition && (splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) === "side") { - splitPanelPosition = "side"; - } - return splitPanelPosition; -} -SplitPanel.Bottom = SplitPanelBottom; -SplitPanel.Side = SplitPanelSide; -var split_panel_default = SplitPanel; - -// node_modules/@cloudscape-design/components/app-layout/utils/use-resize.js -var import_react94 = __toESM(require_react()); -function useResize(drawerRefObject, { activeDrawer, activeDrawerSize, onActiveDrawerResize, drawersRefs, isToolsOpen, drawersMinWidth, drawersMaxWidth }) { - var _a2; - const [relativeSize, setRelativeSize] = (0, import_react94.useState)(0); - const drawerSize = !activeDrawer && !isToolsOpen ? 0 : activeDrawerSize; - (0, import_react94.useEffect)(() => { - const handle = requestAnimationFrame(() => { - const maxSize = drawersMaxWidth; - setRelativeSize((drawerSize - drawersMinWidth) / (maxSize - drawersMinWidth) * 100); - }); - return () => cancelAnimationFrame(handle); - }, [drawerSize, drawersMaxWidth, drawersMinWidth]); - const setSidePanelWidth = (width) => { - const maxWidth = drawersMaxWidth; - const size2 = getLimitedValue(drawersMinWidth, width, maxWidth); - const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id; - if (id && maxWidth >= drawersMinWidth) { - onActiveDrawerResize({ size: size2, id }); - } - }; - const sizeControlProps = { - position: "side", - panelRef: drawerRefObject, - handleRef: drawersRefs.slider, - onResize: setSidePanelWidth, - hasTransitions: true - }; - const onSliderPointerDown = usePointerEvents(sizeControlProps); - const onKeyDown = useKeyboardEvents(sizeControlProps); - const resizeHandle = import_react94.default.createElement( - "div", - { ref: drawersRefs.slider, role: "slider", tabIndex: 0, "aria-label": (_a2 = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _a2 === void 0 ? void 0 : _a2.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx_m_default(styles_css_default27.slider, styles_css_default27[`slider-side`], styles_css_default22["drawers-slider"]), onKeyDown, onPointerDown: onSliderPointerDown }, - import_react94.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default27["slider-icon"], styles_css_default27[`slider-icon-side`]) }) - ); - return { resizeHandle: import_react94.default.createElement("div", { className: styles_css_default29["drawer-slider"] }, resizeHandle), drawerSize }; -} -var use_resize_default = useResize; - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/use-background-overlap.js -var import_react95 = __toESM(require_react()); -function useBackgroundOverlap({ contentHeader, disableContentHeaderOverlap, layoutElement }) { - const hasContentHeader = !!contentHeader; - const [hasBackgroundOverlap, setHasBackgroundOverlap] = (0, import_react95.useState)(hasContentHeader); - const updateBackgroundOverlapHeight = (0, import_react95.useCallback)((height) => { - const hasOverlap = hasContentHeader || height > 0; - setHasBackgroundOverlap(hasOverlap); - const element = typeof layoutElement !== "function" && (layoutElement === null || layoutElement === void 0 ? void 0 : layoutElement.current); - if (!element) { - return; - } - if (disableContentHeaderOverlap || !hasOverlap || height <= 0) { - element.style.removeProperty(custom_css_properties_default.overlapHeight); - } else { - element.style.setProperty(custom_css_properties_default.overlapHeight, `${height}px`); - } - }, [hasContentHeader, layoutElement, disableContentHeaderOverlap]); - return { - hasBackgroundOverlap, - updateBackgroundOverlapHeight - }; -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/context.js -var AppLayoutInternalsContext = (0, import_react96.createContext)(null); -function useAppLayoutInternals() { - const ctx = (0, import_react96.useContext)(AppLayoutInternalsContext); - if (!ctx) { - throw new Error("Invariant violation: this context is only available inside app layout"); - } - return ctx; -} -var AppLayoutInternalsProvider = import_react96.default.forwardRef((props2, forwardRef18) => { - var _a2, _b, _c, _d, _e; - const { toolsHide, toolsOpen: controlledToolsOpen, navigationHide, navigationOpen, contentType, placement, children: children2, splitPanel } = props2; - const isMobile = useMobile(); - const __embeddedViewMode = Boolean(props2.__embeddedViewMode); - const [hasStickyBackground, setHasStickyBackground] = (0, import_react96.useState)(false); - const geckoMaxCssLength = ((1 << 30) - 1) / 60; - const halfGeckoMaxCssLength = geckoMaxCssLength / 2; - const maxContentWidth = props2.maxContentWidth && props2.maxContentWidth > halfGeckoMaxCssLength ? halfGeckoMaxCssLength : (_a2 = props2.maxContentWidth) !== null && _a2 !== void 0 ? _a2 : 0; - const minContentWidth = (_b = props2.minContentWidth) !== null && _b !== void 0 ? _b : 280; - const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen); - const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen) { - focusNavButtons(); - fireNonCancelableEvent(props2.onNavigationChange, { open: isOpen }); - }); - (0, import_react96.useEffect)(() => { - if (isMobile) { - handleNavigationClick(false); - } - }, [isMobile, handleNavigationClick]); - const toolsWidth = props2.toolsWidth; - const [isToolsOpen = false, setIsToolsOpen] = useControllable2(controlledToolsOpen, props2.onToolsChange, false, { - componentName: "AppLayout", - controlledProp: "toolsOpen", - changeHandler: "onToolsChange" - }); - const { refs: toolsRefs, setFocus: focusToolsButtons, loseFocus: loseToolsFocus } = useFocusControl(isToolsOpen, true); - const handleToolsClick = (0, import_react96.useCallback)(function handleToolsChange(isOpen, skipFocusControl) { - setIsToolsOpen(isOpen); - !skipFocusControl && focusToolsButtons(); - fireNonCancelableEvent(props2.onToolsChange, { open: isOpen }); - }, [props2.onToolsChange, setIsToolsOpen, focusToolsButtons]); - const [splitPanelMaxWidth, setSplitPanelMaxWidth] = (0, import_react96.useState)(SPLIT_PANEL_MIN_WIDTH); - const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable2(props2.splitPanelOpen, props2.onSplitPanelToggle, false, { componentName: "AppLayout", controlledProp: "splitPanelOpen", changeHandler: "onSplitPanelToggle" }); - const [splitPanelPreferences, setSplitPanelPreferences] = useControllable2(props2.splitPanelPreferences, props2.onSplitPanelPreferencesChange, void 0, { - componentName: "AppLayout", - controlledProp: "splitPanelPreferences", - changeHandler: "onSplitPanelPreferencesChange" - }); - const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([ - splitPanelPreferences, - isSplitPanelOpen - ]); - const handleSplitPanelClick = (0, import_react96.useCallback)(function handleSplitPanelChange() { - setIsSplitPanelOpen(!isSplitPanelOpen); - setSplitPanelLastInteraction({ type: isSplitPanelOpen ? "close" : "open" }); - fireNonCancelableEvent(props2.onSplitPanelToggle, { open: !isSplitPanelOpen }); - }, [props2.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]); - const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth; - const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences); - const [splitPanelReportedSize, setSplitPanelReportedSize] = (0, import_react96.useState)(0); - const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = (0, import_react96.useState)(0); - const [splitPanelToggle, setSplitPanelToggle] = (0, import_react96.useState)({ - displayed: false, - ariaLabel: void 0 - }); - const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel; - const splitPanelControlId = useUniqueId("split-panel-"); - const toolsControlId = useUniqueId("tools-"); - const [splitPanelSize, setSplitPanelSize] = useControllable2(props2.splitPanelSize, props2.onSplitPanelResize, getSplitPanelDefaultSize(splitPanelPosition), { componentName: "AppLayout", controlledProp: "splitPanelSize", changeHandler: "onSplitPanelResize" }); - const handleSplitPanelResize = (0, import_react96.useCallback)((size2) => { - setSplitPanelSize(size2); - fireNonCancelableEvent(props2.onSplitPanelResize, { size: size2 }); - }, [props2.onSplitPanelResize, setSplitPanelSize]); - const handleSplitPanelPreferencesChange = (0, import_react96.useCallback)(function handleSplitPanelChange(detail) { - setSplitPanelPreferences(detail); - setSplitPanelLastInteraction({ type: "position" }); - fireNonCancelableEvent(props2.onSplitPanelPreferencesChange, detail); - }, [props2.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]); - const _f = useDrawers(props2, props2.ariaLabels, { - ariaLabels: props2.ariaLabels, - toolsHide, - toolsOpen: isToolsOpen, - tools: props2.tools, - toolsWidth, - onToolsToggle: handleToolsClick - }), { drawers, activeDrawer, activeDrawerId, minDrawerSize: drawersMinWidth, onActiveDrawerChange, onActiveDrawerResize, activeDrawerSize } = _f, drawersProps = __rest(_f, ["drawers", "activeDrawer", "activeDrawerId", "minDrawerSize", "onActiveDrawerChange", "onActiveDrawerResize", "activeDrawerSize"]); - const [drawersMaxWidth, setDrawersMaxWidth] = (0, import_react96.useState)(toolsWidth); - const hasDrawers = !!drawers && drawers.length > 0; - const { refs: drawersRefs, setFocus: focusDrawersButtons, loseFocus: loseDrawersFocus } = useFocusControl(!!activeDrawerId, true, activeDrawerId); - const drawerRef = (0, import_react96.useRef)(null); - const { resizeHandle, drawerSize } = use_resize_default(drawerRef, { - onActiveDrawerResize, - activeDrawerSize, - activeDrawer, - drawersRefs, - isToolsOpen, - drawersMaxWidth, - drawersMinWidth - }); - const handleDrawersClick = (id, skipFocusControl) => { - const newActiveDrawerId = id !== activeDrawerId ? id : null; - onActiveDrawerChange(newActiveDrawerId); - !skipFocusControl && focusDrawersButtons(); - }; - let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0; - if (splitPanelDisplayed && splitPanelPosition === "side") { - drawersTriggerCount++; - } - const hasOpenDrawer = !!activeDrawerId || !toolsHide && isToolsOpen || splitPanelDisplayed && splitPanelPosition === "side" && isSplitPanelOpen; - const hasDrawerViewportOverlay = isMobile && (!!activeDrawerId || !navigationHide && navigationOpen || !toolsHide && isToolsOpen); - const layoutElement = (0, import_react96.useRef)(null); - const mainElement = (0, import_react96.useRef)(null); - const [mainOffsetLeft, setMainOffsetLeft] = (0, import_react96.useState)(0); - const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({ - contentHeader: props2.contentHeader, - disableContentHeaderOverlap: props2.disableContentHeaderOverlap, - layoutElement - }); - (0, import_react96.useLayoutEffect)(function handleMainOffsetLeft() { - var _a3, _b2; - setMainOffsetLeft((_b2 = (_a3 = mainElement === null || mainElement === void 0 ? void 0 : mainElement.current) === null || _a3 === void 0 ? void 0 : _a3.offsetLeft) !== null && _b2 !== void 0 ? _b2 : 0); - }, [placement.width, navigationOpen, isToolsOpen, splitPanelReportedSize]); - (0, import_react96.useEffect)(function handleBodyScroll() { - if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) { - document.body.classList.add(styles_css_default29["block-body-scroll"]); - } else { - document.body.classList.remove(styles_css_default29["block-body-scroll"]); - } - return function cleanup() { - document.body.classList.remove(styles_css_default29["block-body-scroll"]); - }; - }, [isMobile, navigationOpen, isToolsOpen, activeDrawer]); - const [notificationsContainerQuery, notificationsElement] = useContainerQuery((rect) => rect.contentBoxHeight); - const notificationsHeight = notificationsContainerQuery !== null && notificationsContainerQuery !== void 0 ? notificationsContainerQuery : 0; - const hasNotificationsContent = notificationsHeight > 0; - let offsetBottom = placement.bottom; - if (splitPanelDisplayed && splitPanelPosition === "bottom") { - if (isSplitPanelOpen) { - offsetBottom += splitPanelReportedSize; - } else { - offsetBottom += splitPanelReportedHeaderHeight; - } - } - (0, import_react96.useLayoutEffect)(function handleSplitPanelMaxWidth() { - const contentGapRight = 50; - const toolsFormOffsetWidth = 120; - const getPanelOffsetWidth = () => { - if (drawers) { - return activeDrawerId ? drawerSize : 0; - } - return isToolsOpen ? toolsWidth : 0; - }; - setSplitPanelMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth - getPanelOffsetWidth()); - setDrawersMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth); - }, [ - activeDrawerId, - drawerSize, - drawers, - navigationOpen, - isToolsOpen, - placement.width, - mainOffsetLeft, - minContentWidth, - toolsWidth - ]); - (0, import_react96.useImperativeHandle)(forwardRef18, function createImperativeHandle() { - return { - closeNavigationIfNecessary: function() { - isMobile && handleNavigationClick(false); - }, - openTools: function() { - handleToolsClick(true); - }, - focusToolsClose: () => { - if (hasDrawers) { - focusDrawersButtons(true); - } else { - focusToolsButtons(true); - } - }, - focusActiveDrawer: () => focusDrawersButtons(true), - focusSplitPanel: () => { - var _a3; - return (_a3 = splitPanelRefs.slider.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }; - }, [ - isMobile, - handleNavigationClick, - handleToolsClick, - focusToolsButtons, - focusDrawersButtons, - splitPanelRefs.slider, - hasDrawers - ]); - return import_react96.default.createElement( - AppLayoutInternalsContext.Provider, - { value: Object.assign(Object.assign({}, props2), { - activeDrawerId, - contentType, - drawers, - drawersAriaLabel: (_c = drawersProps.ariaLabelsWithDrawers) === null || _c === void 0 ? void 0 : _c.drawers, - drawersOverflowAriaLabel: (_d = drawersProps.ariaLabelsWithDrawers) === null || _d === void 0 ? void 0 : _d.drawersOverflow, - drawersOverflowWithBadgeAriaLabel: (_e = drawersProps.ariaLabelsWithDrawers) === null || _e === void 0 ? void 0 : _e.drawersOverflowWithBadge, - drawersRefs, - drawersMinWidth, - drawersMaxWidth, - drawerSize, - drawerRef, - resizeHandle, - drawersTriggerCount, - headerHeight: placement.top, - footerHeight: placement.bottom, - hasDrawerViewportOverlay, - handleDrawersClick, - handleNavigationClick, - handleSplitPanelClick, - handleSplitPanelPreferencesChange, - handleSplitPanelResize, - handleToolsClick, - hasBackgroundOverlap, - hasNotificationsContent, - hasOpenDrawer, - hasStickyBackground, - isBackgroundOverlapDisabled: props2.disableContentHeaderOverlap || !hasBackgroundOverlap, - isMobile, - isSplitPanelForcedPosition, - isSplitPanelOpen, - isToolsOpen, - layoutElement, - layoutWidth: placement.width, - loseToolsFocus, - loseDrawersFocus, - mainElement, - mainOffsetLeft, - maxContentWidth, - minContentWidth, - navigationHide, - navigationRefs, - notificationsElement, - notificationsHeight, - offsetBottom, - setHasStickyBackground, - setSplitPanelReportedSize, - setSplitPanelReportedHeaderHeight, - splitPanel, - splitPanelControlId, - splitPanelDisplayed, - splitPanelMaxWidth, - splitPanelPosition, - splitPanelPreferences, - splitPanelReportedSize, - splitPanelReportedHeaderHeight, - splitPanelSize, - splitPanelToggle, - setSplitPanelToggle, - splitPanelRefs, - toolsControlId, - toolsHide, - toolsOpen: isToolsOpen, - toolsWidth, - toolsRefs, - __embeddedViewMode - }) }, - import_react96.default.createElement( - AppLayoutContext.Provider, - { value: { - stickyOffsetBottom: offsetBottom, - stickyOffsetTop: 0, - setHasStickyBackground - } }, - import_react96.default.createElement(DynamicOverlapContext.Provider, { value: updateBackgroundOverlapHeight }, children2) - ) - ); -}); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/background.js -var import_react97 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/utils/content-header-utils.js -var shouldRemoveHighContrastHeader = () => !!getGlobalFlag("removeHighContrastHeader"); -var getContentHeaderClassName = () => shouldRemoveHighContrastHeader() ? "" : "awsui-context-content-header"; - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/background.js -function Background() { - const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, hasStickyBackground, isMobile, stickyNotifications } = useAppLayoutInternals(); - if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) { - return null; - } - return import_react97.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29.background, getContentHeaderClassName()) }, - import_react97.default.createElement("div", { className: styles_css_default29["scrolling-background"] }), - !isMobile && hasStickyBackground && import_react97.default.createElement("div", { className: clsx_m_default(styles_css_default29["sticky-background"], { - [styles_css_default29["has-sticky-notifications"]]: stickyNotifications - }) }) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/breadcrumbs.js -var import_react98 = __toESM(require_react()); -function Breadcrumbs() { - const { breadcrumbs, hasStickyBackground, isMobile } = useAppLayoutInternals(); - if (isMobile || !breadcrumbs) { - return null; - } - return import_react98.default.createElement("div", { className: clsx_m_default(styles_css_default29.breadcrumbs, styles_css_default22.breadcrumbs, { - [styles_css_default29["has-sticky-background"]]: hasStickyBackground - }, getContentHeaderClassName()) }, breadcrumbs); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/drawers.js -var import_react100 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/trigger-button.js -var import_react99 = __toESM(require_react()); -function TriggerButton({ ariaLabel, className: className2, iconName, iconSvg, ariaExpanded, ariaControls, onClick, testId, badge, selected = false }, ref) { - return import_react99.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["trigger-wrapper"], shouldRemoveHighContrastHeader() && styles_css_default29["remove-high-contrast-header"]) }, - import_react99.default.createElement( - "button", - { "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": true, "aria-label": ariaLabel, className: clsx_m_default(styles_css_default29.trigger, { - [styles_css_default29.selected]: selected, - [styles_css_default29.badge]: badge - }, className2), onClick, ref, type: "button", "data-testid": testId }, - import_react99.default.createElement( - "span", - { className: clsx_m_default(badge && styles_css_default29["trigger-badge-wrapper"]) }, - import_react99.default.createElement(internal_default, { name: iconName, svg: iconSvg }) - ) - ), - badge && import_react99.default.createElement("div", { className: clsx_m_default(styles_css_default29.dot) }) - ); -} -var trigger_button_default = import_react99.default.forwardRef(TriggerButton); - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/drawers.js -function Drawers() { - const { disableBodyScroll, drawers, drawersTriggerCount, hasDrawerViewportOverlay, hasOpenDrawer, navigationOpen, navigationHide, isMobile } = useAppLayoutInternals(); - const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide; - if (!drawers || drawersTriggerCount === 0) { - return null; - } - return import_react100.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["drawers-container"], { - [styles_css_default29["disable-body-scroll"]]: disableBodyScroll, - [styles_css_default29["has-open-drawer"]]: hasOpenDrawer, - [styles_css_default29.unfocusable]: isUnfocusable - }) }, - import_react100.default.createElement(split_panel_default.Side, null), - import_react100.default.createElement(ActiveDrawer, null), - !isMobile && import_react100.default.createElement(DesktopTriggers, null) - ); -} -function ActiveDrawer() { - var _a2, _b, _c, _d; - const { activeDrawerId, ariaLabels, drawers, drawersRefs, handleDrawersClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, navigationOpen, navigationHide, loseDrawersFocus, resizeHandle, drawerSize, drawersMinWidth, drawersMaxWidth, drawerRef } = useAppLayoutInternals(); - const activeDrawer = (_a2 = drawers === null || drawers === void 0 ? void 0 : drawers.find((item) => item.id === activeDrawerId)) !== null && _a2 !== void 0 ? _a2 : null; - const computedAriaLabels = { - closeButton: activeDrawerId ? (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.closeButton : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose, - content: activeDrawerId ? (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.drawerName : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools - }; - const isHidden2 = !activeDrawerId; - const isUnfocusable = isHidden2 || hasDrawerViewportOverlay && navigationOpen && !navigationHide; - const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID; - const toolsContent = (_d = drawers === null || drawers === void 0 ? void 0 : drawers.find((drawer) => drawer.id === TOOLS_DRAWER_ID)) === null || _d === void 0 ? void 0 : _d.content; - const size2 = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth); - return import_react100.default.createElement( - "aside", - { id: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : void 0, "aria-hidden": isHidden2, "aria-label": computedAriaLabels.content, className: clsx_m_default(styles_css_default29.drawer, { - [styles_css_default29["is-drawer-open"]]: activeDrawerId, - [styles_css_default29.unfocusable]: isUnfocusable, - [styles_css_default22["active-drawer"]]: activeDrawerId, - [styles_css_default22.tools]: isToolsDrawer - }), style: Object.assign({}, !isMobile && drawerSize && { [custom_css_properties_default.drawerSize]: `${size2}px` }), ref: drawerRef, onBlur: (e) => { - if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { - loseDrawersFocus(); - } - } }, - !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && resizeHandle, - import_react100.default.createElement( - "div", - { className: styles_css_default29["drawer-content-container"] }, - import_react100.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["drawer-close-button"]) }, - import_react100.default.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx_m_default({ - [styles_css_default22["active-drawer-close-button"]]: activeDrawerId, - [styles_css_default22["tools-close"]]: isToolsDrawer - }), formAction: "none", iconName: isMobile ? "close" : "angle-right", onClick: () => { - handleDrawersClick(activeDrawerId); - handleToolsClick(false); - }, ref: drawersRefs.close, variant: "icon" }) - ), - toolsContent && import_react100.default.createElement("div", { className: clsx_m_default(styles_css_default29["drawer-content"], activeDrawerId !== TOOLS_DRAWER_ID && styles_css_default29["drawer-content-hidden"]) }, toolsContent), - activeDrawerId !== TOOLS_DRAWER_ID && import_react100.default.createElement("div", { className: styles_css_default29["drawer-content"] }, activeDrawerId && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)) - ) - ); -} -function DesktopTriggers() { - const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, drawersTriggerCount, handleDrawersClick, handleSplitPanelClick, hasOpenDrawer, isSplitPanelOpen, splitPanel, splitPanelControlId, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, splitPanelReportedHeaderHeight, splitPanelReportedSize } = useAppLayoutInternals(); - const hasMultipleTriggers = drawersTriggerCount > 1; - const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === "side"; - const previousActiveDrawerId = (0, import_react100.useRef)(activeDrawerId); - const [containerHeight, triggersContainerRef] = useContainerQuery((rect) => rect.contentBoxHeight); - if (activeDrawerId) { - previousActiveDrawerId.current = activeDrawerId; - } - const splitPanelHeight = isSplitPanelOpen && splitPanelPosition === "bottom" ? splitPanelReportedSize : splitPanelReportedHeaderHeight; - const getIndexOfOverflowItem = () => { - if (containerHeight) { - const ITEM_HEIGHT = 48; - const overflowSpot = activeDrawerId && isSplitPanelOpen ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5 : (containerHeight - splitPanelHeight) / 1.5; - const index = Math.floor(overflowSpot / ITEM_HEIGHT); - let splitPanelItem = 0; - if (hasSplitPanel && splitPanelToggle.displayed) { - splitPanelItem = 1; - } - return index - splitPanelItem; - } - return 0; - }; - const { visibleItems, overflowItems } = splitItems(drawers !== null && drawers !== void 0 ? drawers : void 0, getIndexOfOverflowItem(), activeDrawerId); - const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); - return import_react100.default.createElement( - "aside", - { className: clsx_m_default(styles_css_default29["drawers-desktop-triggers-container"], { - [styles_css_default29["has-multiple-triggers"]]: hasMultipleTriggers, - [styles_css_default29["has-open-drawer"]]: hasOpenDrawer - }), "aria-label": drawersAriaLabel, ref: triggersContainerRef, role: "region" }, - import_react100.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["drawers-trigger-content"], { - [styles_css_default29["has-multiple-triggers"]]: hasMultipleTriggers, - [styles_css_default29["has-open-drawer"]]: hasOpenDrawer - }), role: "toolbar", "aria-orientation": "vertical" }, - visibleItems.map((item) => { - var _a2; - return import_react100.default.createElement(trigger_button_default, { ariaLabel: (_a2 = item.ariaLabels) === null || _a2 === void 0 ? void 0 : _a2.triggerButton, ariaExpanded: item.id === activeDrawerId, ariaControls: activeDrawerId === item.id ? item.id : void 0, className: clsx_m_default(styles_css_default29["drawers-trigger"], styles_css_default22["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default22["tools-toggle"]), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => handleDrawersClick(item.id), ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : void 0, selected: item.id === activeDrawerId, badge: item.badge, testId: `awsui-app-layout-trigger-${item.id}` }); - }), - overflowItems.length > 0 && import_react100.default.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, customTriggerBuilder: ({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => import_react100.default.createElement(trigger_button_default, { ref: triggerRef, ariaLabel, ariaExpanded, badge: overflowMenuHasBadge, className: clsx_m_default(styles_css_default29["drawers-trigger"], styles_css_default22["drawers-trigger"], testUtilsClass), iconName: "ellipsis", onClick }), onItemClick: ({ detail }) => { - handleDrawersClick(detail.id); - } }), - hasSplitPanel && splitPanelToggle.displayed && import_react100.default.createElement(trigger_button_default, { ariaLabel: splitPanelToggle.ariaLabel, ariaControls: splitPanelControlId, ariaExpanded: !!isSplitPanelOpen, className: clsx_m_default(styles_css_default29["drawers-trigger"], styles_css_default27["open-button"]), iconName: "view-vertical", onClick: () => handleSplitPanelClick(), selected: hasSplitPanel && isSplitPanelOpen, ref: splitPanelRefs.toggle }) - ) - ); -} -function MobileTriggers() { - const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, handleDrawersClick, hasDrawerViewportOverlay } = useAppLayoutInternals(); - const previousActiveDrawerId = (0, import_react100.useRef)(activeDrawerId); - if (!drawers) { - return null; - } - if (activeDrawerId) { - previousActiveDrawerId.current = activeDrawerId; - } - const { visibleItems, overflowItems } = splitItems(drawers, 2, activeDrawerId); - const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); - return import_react100.default.createElement( - "aside", - { "aria-hidden": hasDrawerViewportOverlay, className: clsx_m_default({ - [styles_css_default29.unfocusable]: hasDrawerViewportOverlay - }), "aria-label": drawersAriaLabel, role: "region" }, - import_react100.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["drawers-mobile-triggers-container"]), role: "toolbar", "aria-orientation": "horizontal" }, - visibleItems.map((item) => { - var _a2; - return import_react100.default.createElement(InternalButton, { ariaExpanded: item.id === activeDrawerId, ariaLabel: (_a2 = item.ariaLabels) === null || _a2 === void 0 ? void 0 : _a2.triggerButton, className: clsx_m_default(styles_css_default29["drawers-trigger"], styles_css_default22["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default22["tools-toggle"]), disabled: hasDrawerViewportOverlay, ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : void 0, formAction: "none", iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, key: item.id, onClick: () => handleDrawersClick(item.id), variant: "icon", __nativeAttributes: { "aria-haspopup": true, "data-testid": `awsui-app-layout-trigger-${item.id}` } }); - }), - overflowItems.length > 0 && import_react100.default.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, onItemClick: ({ detail }) => handleDrawersClick(detail.id) }) - ) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/header.js -var import_react101 = __toESM(require_react()); -function Header() { - const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals(); - if (!contentHeader) { - return null; - } - return import_react101.default.createElement("header", { className: clsx_m_default(styles_css_default29.content, { - [styles_css_default29["has-breadcrumbs"]]: breadcrumbs, - [styles_css_default29["has-notifications-content"]]: hasNotificationsContent, - [styles_css_default29.unfocusable]: hasDrawerViewportOverlay - }, getContentHeaderClassName()) }, contentHeader); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/layout.js -var import_react102 = __toESM(require_react()); -function Layout({ children: children2 }) { - const { breadcrumbs, contentHeader, contentType, disableBodyScroll, disableContentPaddings, drawersTriggerCount, footerHeight, hasNotificationsContent, hasStickyBackground, hasOpenDrawer, headerHeight, isBackgroundOverlapDisabled, isMobile, navigationOpen, layoutElement, layoutWidth, mainOffsetLeft, maxContentWidth, minContentWidth, navigationHide, notificationsHeight, __embeddedViewMode, splitPanelPosition, stickyNotifications, splitPanelDisplayed } = useAppLayoutInternals(); - const contentFirstChild = getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile); - const hasContentGapLeft = navigationOpen || navigationHide; - const hasContentGapRight = drawersTriggerCount === 0 || hasOpenDrawer; - return import_react102.default.createElement("main", { className: clsx_m_default(styles_css_default29.layout, styles_css_default29[`content-first-child-${contentFirstChild}`], styles_css_default29[`content-type-${contentType}`], styles_css_default29[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : "bottom"}`], { - [styles_css_default29["disable-body-scroll"]]: disableBodyScroll, - [styles_css_default22["disable-body-scroll-root"]]: disableBodyScroll, - [styles_css_default29["disable-content-paddings"]]: disableContentPaddings, - [styles_css_default29["has-breadcrumbs"]]: breadcrumbs && !isMobile, - [styles_css_default29["has-content-gap-left"]]: hasContentGapLeft, - [styles_css_default29["has-content-gap-right"]]: hasContentGapRight, - [styles_css_default29["has-header"]]: contentHeader, - [styles_css_default29["has-max-content-width"]]: maxContentWidth && maxContentWidth > 0, - [styles_css_default29["has-split-panel"]]: splitPanelDisplayed, - [styles_css_default29["has-sticky-background"]]: hasStickyBackground, - [styles_css_default29["has-sticky-notifications"]]: stickyNotifications && hasNotificationsContent, - [styles_css_default29["is-overlap-disabled"]]: isBackgroundOverlapDisabled, - [styles_css_default29["is-hide-mobile-toolbar"]]: __embeddedViewMode - }, styles_css_default22.root), ref: layoutElement, style: Object.assign(Object.assign(Object.assign({ [custom_css_properties_default.headerHeight]: `${headerHeight}px`, [custom_css_properties_default.footerHeight]: `${footerHeight}px`, [custom_css_properties_default.layoutWidth]: `${layoutWidth}px`, [custom_css_properties_default.mainOffsetLeft]: `${mainOffsetLeft}px` }, maxContentWidth && { [custom_css_properties_default.maxContentWidth]: `${maxContentWidth}px` }), minContentWidth && { [custom_css_properties_default.minContentWidth]: `${minContentWidth}px` }), { [custom_css_properties_default.notificationsHeight]: `${notificationsHeight}px` }) }, children2); -} -function getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile) { - let contentFirstChild = "main"; - if (hasNotificationsContent) { - contentFirstChild = "notifications"; - } else if (breadcrumbs && !isMobile) { - contentFirstChild = "breadcrumbs"; - } else if (contentHeader) { - contentFirstChild = "header"; - } - return contentFirstChild; -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/main.js -var import_react103 = __toESM(require_react()); -function Main() { - const { content, disableContentPaddings, footerHeight, hasDrawerViewportOverlay, navigationOpen, isSplitPanelOpen, isToolsOpen, mainElement, offsetBottom, splitPanelDisplayed, splitPanelPosition, activeDrawerId } = useAppLayoutInternals(); - const splitPanelHeight = offsetBottom - footerHeight; - return import_react103.default.createElement("div", { className: clsx_m_default(styles_css_default29.container, styles_css_default29[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : "bottom"}`], { - [styles_css_default29["disable-content-paddings"]]: disableContentPaddings, - [styles_css_default29["has-split-panel"]]: splitPanelDisplayed, - [styles_css_default29["is-navigation-open"]]: navigationOpen, - [styles_css_default29["is-tools-open"]]: isToolsOpen, - [styles_css_default29["has-active-drawer"]]: !!activeDrawerId, - [styles_css_default29["is-split-panel-open"]]: isSplitPanelOpen, - [styles_css_default29.unfocusable]: hasDrawerViewportOverlay - }, styles_css_default22.content), ref: mainElement, style: { - [custom_css_properties_default.splitPanelHeight]: `${splitPanelHeight}px` - } }, content); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/mobile-toolbar.js -var import_react104 = __toESM(require_react()); -function MobileToolbar2() { - var _a2, _b, _c; - const { ariaLabels, breadcrumbs, drawers, handleNavigationClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, navigationOpen, __embeddedViewMode, isToolsOpen, navigationHide, navigationRefs, toolsHide, toolsRefs } = useAppLayoutInternals(); - if (!isMobile || __embeddedViewMode || navigationHide && !breadcrumbs && toolsHide && (!drawers || drawers.length === 0)) { - return null; - } - return import_react104.default.createElement( - "section", - { className: clsx_m_default(styles_css_default29["mobile-toolbar"], [styles_css_default22["mobile-bar"]], { - [styles_css_default29["has-breadcrumbs"]]: breadcrumbs, - [styles_css_default29.unfocusable]: hasDrawerViewportOverlay - }, styles_css_default22["mobile-bar"], getContentHeaderClassName(), shouldRemoveHighContrastHeader() && styles_css_default29["remove-high-contrast-header"]) }, - !navigationHide && import_react104.default.createElement( - "nav", - { "aria-hidden": navigationOpen, className: clsx_m_default(styles_css_default29["mobile-toolbar-nav"], { [styles_css_default22["drawer-closed"]]: !navigationOpen }) }, - import_react104.default.createElement(InternalButton, { ariaLabel: (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a2 !== void 0 ? _a2 : void 0, ariaExpanded: navigationOpen ? void 0 : false, iconName: "menu", formAction: "none", onClick: () => handleNavigationClick(true), variant: "icon", className: styles_css_default22["navigation-toggle"], ref: navigationRefs.toggle, disabled: hasDrawerViewportOverlay, __nativeAttributes: { "aria-haspopup": navigationOpen ? void 0 : true } }) - ), - breadcrumbs && import_react104.default.createElement("div", { className: clsx_m_default(styles_css_default29["mobile-toolbar-breadcrumbs"], styles_css_default22.breadcrumbs) }, breadcrumbs), - drawers ? import_react104.default.createElement(MobileTriggers, null) : !toolsHide && import_react104.default.createElement( - "aside", - { "aria-hidden": isToolsOpen, "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _b !== void 0 ? _b : void 0, className: clsx_m_default(styles_css_default29["mobile-toolbar-tools"], { [styles_css_default22["drawer-closed"]]: !isToolsOpen }) }, - import_react104.default.createElement(InternalButton, { className: styles_css_default22["tools-toggle"], ariaExpanded: isToolsOpen, disabled: hasDrawerViewportOverlay, ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _c !== void 0 ? _c : void 0, iconName: "status-info", formAction: "none", onClick: () => handleToolsClick(true), variant: "icon", ref: toolsRefs.toggle, __nativeAttributes: { "aria-haspopup": true } }) - ) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/navigation.js -var import_react105 = __toESM(require_react()); -function Navigation() { - const { ariaLabels, disableBodyScroll, handleNavigationClick, hasDrawerViewportOverlay, isMobile, navigationOpen, isToolsOpen, navigation, navigationHide, navigationRefs, navigationWidth, toolsHide } = useAppLayoutInternals(); - if (navigationHide) { - return null; - } - const onNavigationClick = (event) => { - const hasLink = findUpUntil2(event.target, (node) => node.tagName === "A" && !!node.href); - if (hasLink && isMobile) { - handleNavigationClick(false); - } - }; - const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || isToolsOpen && !toolsHide); - return import_react105.default.createElement(Transition2, { in: navigationOpen }, (state, transitionEventsRef) => { - var _a2, _b, _c; - return import_react105.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["navigation-container"], { - [styles_css_default29["disable-body-scroll"]]: disableBodyScroll, - [styles_css_default29.unfocusable]: isUnfocusable, - [styles_css_default22["drawer-closed"]]: !navigationOpen - }), style: { [custom_css_properties_default.navigationWidth]: `${navigationWidth}px` } }, - !isMobile && import_react105.default.createElement( - "nav", - { "aria-hidden": isMobile || navigationOpen, "aria-label": (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _a2 !== void 0 ? _a2 : void 0, className: clsx_m_default(styles_css_default29["show-navigation"], { - [styles_css_default29.animating]: state === "exiting", - [styles_css_default29["is-navigation-open"]]: navigationOpen - }), ref: state === "exiting" ? transitionEventsRef : void 0 }, - import_react105.default.createElement(trigger_button_default, { ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle, ariaExpanded: navigationOpen ? void 0 : false, iconName: "menu", className: styles_css_default22["navigation-toggle"], onClick: () => handleNavigationClick(true), ref: navigationRefs.toggle }) - ), - import_react105.default.createElement( - "nav", - { "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _b !== void 0 ? _b : void 0, className: clsx_m_default(styles_css_default29.navigation, { - [styles_css_default29.animating]: state === "entering", - [styles_css_default29["is-navigation-open"]]: navigationOpen - }, styles_css_default22.navigation), ref: state !== "exiting" ? transitionEventsRef : void 0, "aria-hidden": !navigationOpen, onClick: (event) => { - onNavigationClick && onNavigationClick(event); - } }, - import_react105.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["animated-content"]) }, - import_react105.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["hide-navigation"]) }, - import_react105.default.createElement(InternalButton, { ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _c !== void 0 ? _c : void 0, iconName: isMobile ? "close" : "angle-left", onClick: () => handleNavigationClick(false), variant: "icon", formAction: "none", className: styles_css_default22["navigation-close"], ref: navigationRefs.close }) - ), - navigation - ) - ) - ); - }); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/notifications.js -var import_react106 = __toESM(require_react()); -function Notifications2() { - var _a2; - const { ariaLabels, hasDrawerViewportOverlay, notifications, notificationsElement, stickyNotifications } = useAppLayoutInternals(); - if (!notifications) { - return null; - } - return import_react106.default.createElement( - "div", - { role: "region", "aria-label": (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.notifications) !== null && _a2 !== void 0 ? _a2 : void 0, className: clsx_m_default(styles_css_default29.notifications, { - [styles_css_default29["sticky-notifications"]]: stickyNotifications, - [styles_css_default29.unfocusable]: hasDrawerViewportOverlay - }, styles_css_default22.notifications, getContentHeaderClassName()) }, - import_react106.default.createElement("div", { ref: notificationsElement }, notifications) - ); -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/tools.js -var import_react107 = __toESM(require_react()); -function Tools({ children: children2 }) { - const { ariaLabels, disableBodyScroll, drawers, handleSplitPanelClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, isSplitPanelOpen, isToolsOpen, loseToolsFocus, splitPanel, splitPanelControlId, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsControlId, toolsHide, toolsRefs, toolsWidth } = useAppLayoutInternals(); - const hasSplitPanel = !!splitPanel && splitPanelPosition === "side"; - const hasToolsForm = getToolsFormStatus(hasSplitPanel && splitPanelDisplayed, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide); - const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide); - const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen; - if (toolsHide && !hasSplitPanel || drawers) { - return null; - } - return import_react107.default.createElement(Transition2, { in: isToolsOpen !== null && isToolsOpen !== void 0 ? isToolsOpen : false }, (state, transitionEventsRef) => { - var _a2, _b, _c; - return import_react107.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["tools-container"], { - [styles_css_default29["disable-body-scroll"]]: disableBodyScroll, - [styles_css_default29.unfocusable]: isUnfocusable, - [styles_css_default22["drawer-closed"]]: !isToolsOpen - }), style: { - [custom_css_properties_default.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`, - [custom_css_properties_default.toolsWidth]: `${toolsWidth}px` - }, onBlur: (e) => { - if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { - loseToolsFocus(); - } - } }, - children2, - !toolsHide && import_react107.default.createElement( - "aside", - { id: toolsControlId, "aria-hidden": !isToolsOpen ? true : false, "aria-label": (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _a2 !== void 0 ? _a2 : void 0, className: clsx_m_default(styles_css_default29.tools, { - [styles_css_default29.animating]: state === "entering", - [styles_css_default29["has-tools-form-persistence"]]: hasToolsFormPersistence, - [styles_css_default29["is-tools-open"]]: isToolsOpen - }, styles_css_default22.tools), ref: state !== "exiting" ? transitionEventsRef : void 0 }, - import_react107.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["animated-content"]) }, - import_react107.default.createElement( - "div", - { className: clsx_m_default(styles_css_default29["hide-tools"]) }, - import_react107.default.createElement(InternalButton, { ariaLabel: (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose) !== null && _b !== void 0 ? _b : void 0, iconName: isMobile ? "close" : "angle-right", onClick: () => handleToolsClick(false), variant: "icon", formAction: "none", className: styles_css_default22["tools-close"], ref: toolsRefs.close }) - ), - tools - ) - ), - !isMobile && import_react107.default.createElement( - "aside", - { "aria-hidden": !hasToolsForm ? true : false, "aria-label": (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _c !== void 0 ? _c : void 0, className: clsx_m_default(styles_css_default29["show-tools"], { - [styles_css_default29.animating]: state === "exiting", - [styles_css_default29["has-tools-form"]]: hasToolsForm, - [styles_css_default29["has-tools-form-persistence"]]: hasToolsFormPersistence - }), ref: state === "exiting" ? transitionEventsRef : void 0, "data-testid": "side-split-panel-drawer" }, - !toolsHide && import_react107.default.createElement(trigger_button_default, { ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle, ariaControls: toolsControlId, ariaExpanded: isToolsOpen, iconName: "status-info", onClick: () => handleToolsClick(!isToolsOpen), selected: hasSplitPanel && isToolsOpen, className: styles_css_default22["tools-toggle"], ref: toolsRefs.toggle }), - hasSplitPanel && splitPanelToggle.displayed && import_react107.default.createElement(trigger_button_default, { ariaLabel: splitPanelToggle.ariaLabel, ariaControls: splitPanelControlId, ariaExpanded: !!isSplitPanelOpen, iconName: "view-vertical", onClick: () => handleSplitPanelClick(), selected: hasSplitPanel && isSplitPanelOpen, className: styles_css_default27["open-button"], ref: splitPanelRefs.toggle }) - ) - ); - }); -} -function getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide) { - let hasToolsForm = false; - if (!isMobile) { - if (hasSplitPanel && !toolsHide) { - hasToolsForm = true; - } - if (hasSplitPanel && !isSplitPanelOpen && toolsHide) { - hasToolsForm = true; - } - if (!hasSplitPanel && !toolsHide && !isToolsOpen) { - hasToolsForm = true; - } - } - return hasToolsForm; -} -function getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide) { - let hasToolsFormPersistence = false; - if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) { - hasToolsFormPersistence = true; - } - return hasToolsFormPersistence; -} - -// node_modules/@cloudscape-design/components/app-layout/visual-refresh/index.js -var AppLayoutWithRef = import_react108.default.forwardRef(function AppLayout(props2, ref) { - return import_react108.default.createElement( - AppLayoutInternalsProvider, - Object.assign({}, props2, { ref }), - import_react108.default.createElement( - split_panel_default, - null, - import_react108.default.createElement( - Layout, - null, - import_react108.default.createElement(Background, null), - import_react108.default.createElement(Navigation, null), - import_react108.default.createElement(MobileToolbar2, null), - import_react108.default.createElement(Notifications2, null), - import_react108.default.createElement(Breadcrumbs, null), - import_react108.default.createElement(Header, null), - import_react108.default.createElement(Main, null), - import_react108.default.createElement(split_panel_default.Bottom, null), - import_react108.default.createElement( - Tools, - null, - import_react108.default.createElement(split_panel_default.Side, null) - ), - import_react108.default.createElement(Drawers, null) - ) - ) - ); -}); -var visual_refresh_default = AppLayoutWithRef; - -// node_modules/@cloudscape-design/components/app-layout/implementation.js -var AppLayoutImplementation = import_react109.default.forwardRef((props2, ref) => { - const isRefresh = useVisualRefresh(); - return isRefresh ? import_react109.default.createElement(visual_refresh_default, Object.assign({ ref }, props2)) : import_react109.default.createElement(classic_default, Object.assign({ ref }, props2)); -}); - -// node_modules/@cloudscape-design/components/app-layout/widget.js -function createWidgetizedAppLayout(AppLayoutLoader) { - return import_react110.default.forwardRef((props2, ref) => { - const isRefresh = useVisualRefresh(); - if (isRefresh && getGlobalFlag("appLayoutWidget") && AppLayoutLoader) { - return import_react110.default.createElement(AppLayoutLoader, Object.assign({ ref }, props2)); - } - return import_react110.default.createElement(AppLayoutImplementation, Object.assign({ ref }, props2)); - }); -} - -// node_modules/@cloudscape-design/components/app-layout/internal.js -var AppLayoutInternal = createWidgetizedAppLayout(); - -// node_modules/@cloudscape-design/components/app-layout/defaults.js -var defaultContentTypeState = { - navigationOpen: true, - minContentWidth: 280, - maxContentWidth: void 0 -}; -var defaults = { - default: Object.assign({}, defaultContentTypeState), - dashboard: Object.assign({}, defaultContentTypeState), - cards: { - navigationOpen: true, - minContentWidth: 280, - maxContentWidth: void 0 - }, - form: { - navigationOpen: false, - minContentWidth: 280, - maxContentWidth: 800 - }, - table: { - navigationOpen: true, - minContentWidth: 280, - maxContentWidth: void 0 - }, - wizard: { - navigationOpen: false, - minContentWidth: 280, - maxContentWidth: 1080 - } -}; -function applyDefaults(contentType, stateFromProps, isRefresh) { - var _a2, _b, _c; - const contentTypeDefaults = isRefresh ? Object.assign(Object.assign({}, defaults[contentType]), { maxContentWidth: void 0 }) : defaults[contentType]; - return { - maxContentWidth: (_a2 = stateFromProps.maxContentWidth) !== null && _a2 !== void 0 ? _a2 : contentTypeDefaults.maxContentWidth, - minContentWidth: (_b = stateFromProps.minContentWidth) !== null && _b !== void 0 ? _b : contentTypeDefaults.minContentWidth, - navigationOpen: (_c = stateFromProps.navigationOpen) !== null && _c !== void 0 ? _c : contentTypeDefaults.navigationOpen - }; -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-app-layout-placement.js -var import_react112 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/app-layout/utils/use-observed-element.js -var import_react111 = __toESM(require_react()); -function useObservedElement(selector) { - const getElement = (0, import_react111.useCallback)(() => { - return document.querySelector(selector); - }, [selector]); - const [height, setHeight] = (0, import_react111.useState)(0); - useResizeObserver(getElement, (entry) => setHeight(entry.borderBoxHeight)); - return height; -} - -// node_modules/@cloudscape-design/components/app-layout/utils/use-app-layout-placement.js -function useAppLayoutPlacement(headerSelector, footerSelector) { - const mainElementRef = (0, import_react112.useRef)(null); - const headerHeight = useObservedElement(headerSelector); - const footerHeight = useObservedElement(footerSelector); - const [offsets, setOffsets] = (0, import_react112.useState)({ left: 0, right: 0, width: Number.POSITIVE_INFINITY }); - const updatePosition2 = (0, import_react112.useCallback)(() => { - if (!mainElementRef.current) { - return; - } - const { left, right, width } = mainElementRef.current.getBoundingClientRect(); - if (width === 0) { - return; - } - setOffsets({ left, right: width - right, width }); - }, []); - (0, import_react112.useEffect)(() => { - window.addEventListener("resize", updatePosition2); - return () => window.removeEventListener("resize", updatePosition2); - }, [updatePosition2]); - useResizeObserver(mainElementRef, updatePosition2); - return [mainElementRef, Object.assign(Object.assign({}, offsets), { top: headerHeight, bottom: footerHeight })]; -} - -// node_modules/@cloudscape-design/components/app-layout/index.js -var AppLayout2 = import_react113.default.forwardRef((_a2, ref) => { - var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; - var { contentType = "default", headerSelector = "#b #h", footerSelector = "#b #f", navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange } = _a2, rest = __rest(_a2, ["contentType", "headerSelector", "footerSelector", "navigationWidth", "toolsWidth", "maxContentWidth", "minContentWidth", "navigationOpen", "onNavigationChange"]); - if (isDevelopment2) { - if (rest.toolsOpen && rest.toolsHide) { - warnOnce("AppLayout", `You have enabled both the \`toolsOpen\` prop and the \`toolsHide\` prop. This is not supported. Set \`toolsOpen\` to \`false\` when you set \`toolsHide\` to \`true\`.`); - } - } - const { __internalRootRef } = useBaseComponent("AppLayout", { - props: { - contentType, - disableContentPaddings: rest.disableContentPaddings, - disableBodyScroll: rest.disableBodyScroll, - navigationWidth, - navigationHide: rest.navigationHide, - toolsHide: rest.toolsHide, - toolsWidth, - maxContentWidth, - minContentWidth, - stickyNotifications: rest.stickyNotifications, - disableContentHeaderOverlap: rest.disableContentHeaderOverlap - }, - metadata: { - drawersCount: (_c = (_b = rest.drawers) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : null, - hasContentHeader: !!rest.contentHeader - } - }); - const isRefresh = useVisualRefresh(); - const isMobile = useMobile(); - const i18n = useInternalI18n("app-layout"); - const ariaLabels = { - navigation: i18n("ariaLabels.navigation", (_d = rest.ariaLabels) === null || _d === void 0 ? void 0 : _d.navigation), - navigationClose: i18n("ariaLabels.navigationClose", (_e = rest.ariaLabels) === null || _e === void 0 ? void 0 : _e.navigationClose), - navigationToggle: i18n("ariaLabels.navigationToggle", (_f = rest.ariaLabels) === null || _f === void 0 ? void 0 : _f.navigationToggle), - notifications: i18n("ariaLabels.notifications", (_g = rest.ariaLabels) === null || _g === void 0 ? void 0 : _g.notifications), - tools: i18n("ariaLabels.tools", (_h = rest.ariaLabels) === null || _h === void 0 ? void 0 : _h.tools), - toolsClose: i18n("ariaLabels.toolsClose", (_j = rest.ariaLabels) === null || _j === void 0 ? void 0 : _j.toolsClose), - toolsToggle: i18n("ariaLabels.toolsToggle", (_k = rest.ariaLabels) === null || _k === void 0 ? void 0 : _k.toolsToggle), - drawers: i18n("ariaLabels.drawers", (_l = rest.ariaLabels) === null || _l === void 0 ? void 0 : _l.drawers), - drawersOverflow: i18n("ariaLabels.drawersOverflow", (_m = rest.ariaLabels) === null || _m === void 0 ? void 0 : _m.drawersOverflow), - drawersOverflowWithBadge: i18n("ariaLabels.drawersOverflowWithBadge", (_o = rest.ariaLabels) === null || _o === void 0 ? void 0 : _o.drawersOverflowWithBadge) - }; - const _p = applyDefaults(contentType, { maxContentWidth, minContentWidth }, isRefresh), { navigationOpen: defaultNavigationOpen } = _p, restDefaults = __rest(_p, ["navigationOpen"]); - const [navigationOpen = false, setNavigationOpen] = useControllable2(controlledNavigationOpen, controlledOnNavigationChange, isMobile ? false : defaultNavigationOpen, { componentName: "AppLayout", controlledProp: "navigationOpen", changeHandler: "onNavigationChange" }); - const onNavigationChange = (event) => { - setNavigationOpen(event.detail.open); - controlledOnNavigationChange === null || controlledOnNavigationChange === void 0 ? void 0 : controlledOnNavigationChange(event); - }; - const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector); - const props2 = Object.assign(Object.assign(Object.assign({ - contentType, - navigationWidth, - toolsWidth, - navigationOpen, - onNavigationChange - }, restDefaults), rest), { - ariaLabels, - placement - }); - const baseProps = getBaseProps(rest); - return import_react113.default.createElement( - "div", - Object.assign({ ref: useMergeRefs(__internalRootRef, rootRef) }, baseProps), - import_react113.default.createElement(AppLayoutInternal, Object.assign({ ref }, props2)) - ); -}); -applyDisplayName(AppLayout2, "AppLayout"); -var app_layout_default = AppLayout2; - -// node_modules/@cloudscape-design/components/area-chart/index.js -var import_react200 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/area-chart/internal.js -var import_react199 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-status-container/index.js -var import_react117 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/status-indicator/internal.js -var import_react114 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/status-indicator/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/status-indicator/styles.scoped.css"; -var styles_css_default30 = { - "icon-shake": "awsui_icon-shake_1cbgc_azp03_103", - "awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_1cbgc_azp03_1", - "container-fade-in": "awsui_container-fade-in_1cbgc_azp03_131", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1cbgc_azp03_1", - "root": "awsui_root_1cbgc_azp03_153", - "status-error": "awsui_status-error_1cbgc_azp03_162", - "status-warning": "awsui_status-warning_1cbgc_azp03_165", - "status-success": "awsui_status-success_1cbgc_azp03_168", - "status-info": "awsui_status-info_1cbgc_azp03_171", - "status-stopped": "awsui_status-stopped_1cbgc_azp03_174", - "status-pending": "awsui_status-pending_1cbgc_azp03_177", - "status-in-progress": "awsui_status-in-progress_1cbgc_azp03_180", - "status-loading": "awsui_status-loading_1cbgc_azp03_183", - "color-override-red": "awsui_color-override-red_1cbgc_azp03_186", - "color-override-grey": "awsui_color-override-grey_1cbgc_azp03_189", - "color-override-blue": "awsui_color-override-blue_1cbgc_azp03_192", - "color-override-green": "awsui_color-override-green_1cbgc_azp03_195", - "color-override-yellow": "awsui_color-override-yellow_1cbgc_azp03_198", - "container": "awsui_container_1cbgc_azp03_131", - "display-inline": "awsui_display-inline_1cbgc_azp03_202", - "icon": "awsui_icon_1cbgc_azp03_103", - "display-inline-block": "awsui_display-inline-block_1cbgc_azp03_210", - "overflow-ellipsis": "awsui_overflow-ellipsis_1cbgc_azp03_219" -}; - -// node_modules/@cloudscape-design/components/status-indicator/internal.js -var typeToIcon2 = (size2) => ({ - error: import_react114.default.createElement(internal_default, { name: "status-negative", size: size2 }), - warning: import_react114.default.createElement(internal_default, { name: "status-warning", size: size2 }), - success: import_react114.default.createElement(internal_default, { name: "status-positive", size: size2 }), - info: import_react114.default.createElement(internal_default, { name: "status-info", size: size2 }), - stopped: import_react114.default.createElement(internal_default, { name: "status-stopped", size: size2 }), - pending: import_react114.default.createElement(internal_default, { name: "status-pending", size: size2 }), - "in-progress": import_react114.default.createElement(internal_default, { name: "status-in-progress", size: size2 }), - loading: import_react114.default.createElement(InternalSpinner, null) -}); -function StatusIndicator(_a2) { - var { type, children: children2, iconAriaLabel, colorOverride, wrapText = true, __animate = false, __internalRootRef, __size = "normal", __display = "inline-block" } = _a2, rest = __rest(_a2, ["type", "children", "iconAriaLabel", "colorOverride", "wrapText", "__animate", "__internalRootRef", "__size", "__display"]); - const baseProps = getBaseProps(rest); - return import_react114.default.createElement( - "span", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default30.root, styles_css_default30[`status-${type}`], { - [styles_css_default30[`color-override-${colorOverride}`]]: colorOverride - }, baseProps.className), ref: __internalRootRef }), - import_react114.default.createElement( - "span", - { className: clsx_m_default(styles_css_default30.container, styles_css_default30[`display-${__display}`], wrapText === false && styles_css_default30["overflow-ellipsis"], __animate && styles_css_default30["container-fade-in"]) }, - import_react114.default.createElement( - "span", - { className: clsx_m_default(styles_css_default30.icon, __animate && styles_css_default30["icon-shake"]), "aria-label": iconAriaLabel, role: iconAriaLabel ? "img" : void 0 }, - typeToIcon2(__size)[type], - __display === "inline" && import_react114.default.createElement(import_react114.default.Fragment, null, " ") - ), - children2 - ) - ); -} - -// node_modules/@cloudscape-design/components/link/internal.js -var import_react116 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/link/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/link/styles.scoped.css"; -var styles_css_default31 = { - "link": "awsui_link_4c84z_i6aqa_99", - "variant-secondary": "awsui_variant-secondary_4c84z_i6aqa_168", - "variant-primary": "awsui_variant-primary_4c84z_i6aqa_203", - "variant-info": "awsui_variant-info_4c84z_i6aqa_236", - "variant-value-large": "awsui_variant-value-large_4c84z_i6aqa_271", - "variant-top-navigation": "awsui_variant-top-navigation_4c84z_i6aqa_303", - "variant-recovery": "awsui_variant-recovery_4c84z_i6aqa_336", - "button": "awsui_button_4c84z_i6aqa_369", - "color-inverted": "awsui_color-inverted_4c84z_i6aqa_404", - "font-size-body-s": "awsui_font-size-body-s_4c84z_i6aqa_425", - "font-size-body-m": "awsui_font-size-body-m_4c84z_i6aqa_432", - "font-size-heading-xs": "awsui_font-size-heading-xs_4c84z_i6aqa_438", - "font-size-heading-s": "awsui_font-size-heading-s_4c84z_i6aqa_444", - "font-size-heading-m": "awsui_font-size-heading-m_4c84z_i6aqa_451", - "font-size-heading-l": "awsui_font-size-heading-l_4c84z_i6aqa_458", - "font-size-heading-xl": "awsui_font-size-heading-xl_4c84z_i6aqa_465", - "font-size-display-l": "awsui_font-size-display-l_4c84z_i6aqa_472", - "font-size-inherit": "awsui_font-size-inherit_4c84z_i6aqa_479", - "icon-wrapper": "awsui_icon-wrapper_4c84z_i6aqa_491", - "icon": "awsui_icon_4c84z_i6aqa_491" -}; - -// node_modules/@cloudscape-design/components/internal/context/info-link-label-context.js -var import_react115 = __toESM(require_react()); -var InfoLinkLabelContext = (0, import_react115.createContext)(void 0); - -// node_modules/@cloudscape-design/components/link/internal.js -var InternalLink = import_react116.default.forwardRef((_a2, ref) => { - var { variant: providedVariant, fontSize = "body-m", color: color2 = "normal", external = false, target, href, rel, ariaLabel, externalIconAriaLabel, onFollow, children: children2, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["variant", "fontSize", "color", "external", "target", "href", "rel", "ariaLabel", "externalIconAriaLabel", "onFollow", "children", "__internalRootRef"]); - checkSafeUrl("Link", href); - const isButton = !href; - const { defaultVariant } = (0, import_react116.useContext)(LinkDefaultVariantContext); - const variant = providedVariant || defaultVariant; - const specialStyles = ["top-navigation", "link", "recovery"]; - const hasSpecialStyle = specialStyles.indexOf(variant) > -1; - const i18n = useInternalI18n("link"); - const baseProps = getBaseProps(props2); - const anchorTarget = target !== null && target !== void 0 ? target : external ? "_blank" : void 0; - const anchorRel = rel !== null && rel !== void 0 ? rel : anchorTarget === "_blank" ? "noopener noreferrer" : void 0; - const uniqueId = useUniqueId("link"); - const linkId = useUniqueId("link-self"); - const infoId = useUniqueId("link-info"); - const infoLinkLabelFromContext = (0, import_react116.useContext)(InfoLinkLabelContext); - const { funnelInteractionId } = useFunnel(); - const { stepNumber, stepNameSelector } = useFunnelStep(); - const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); - const fireFunnelEvent = (funnelInteractionId2) => { - if (variant === "info") { - const stepName = getNameFromSelector(stepNameSelector); - const subStepName = getNameFromSelector(subStepNameSelector); - FunnelMetrics.helpPanelInteracted({ - funnelInteractionId: funnelInteractionId2, - stepNumber, - stepName, - stepNameSelector, - subStepSelector, - subStepName, - subStepNameSelector, - elementSelector: getFunnelValueSelector(uniqueId), - subStepAllSelector: getSubStepAllSelector() - }); - } else if (external) { - const stepName = getNameFromSelector(stepNameSelector); - const subStepName = getNameFromSelector(subStepNameSelector); - FunnelMetrics.externalLinkInteracted({ - funnelInteractionId: funnelInteractionId2, - stepNumber, - stepName, - stepNameSelector, - subStepSelector, - subStepName, - subStepNameSelector, - elementSelector: getFunnelValueSelector(uniqueId), - subStepAllSelector: getSubStepAllSelector() - }); - } - }; - const fireFollowEvent = (event) => { - if (funnelInteractionId) { - fireFunnelEvent(funnelInteractionId); - } - fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event); - }; - const handleLinkClick = (event) => { - if (isPlainLeftClick(event)) { - fireFollowEvent(event); - } - }; - const handleButtonClick = (event) => { - fireFollowEvent(event); - }; - const handleButtonKeyDown = (event) => { - if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) { - event.preventDefault(); - fireFollowEvent(event); - } - }; - const linkRef = (0, import_react116.useRef)(null); - const isVisualRefresh = useVisualRefresh(); - useForwardFocus(ref, linkRef); - const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle; - const sharedProps = Object.assign(Object.assign({ id: linkId }, baseProps), { - // https://github.com/microsoft/TypeScript/issues/36659 - ref: useMergeRefs(linkRef, __internalRootRef), - className: clsx_m_default(styles_css_default31.link, baseProps.className, applyButtonStyles ? styles_css_default31.button : null, styles_css_default31[getVariantStyle(variant)], styles_css_default31[getFontSizeStyle(variant, fontSize)], styles_css_default31[getColorStyle(variant, color2)]), - "aria-label": ariaLabel, - "aria-labelledby": "", - [DATA_ATTR_FUNNEL_VALUE]: uniqueId - }); - if (variant === "info" && infoLinkLabelFromContext && !ariaLabel) { - sharedProps["aria-labelledby"] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`; - } - const renderedExternalIconAriaLabel = i18n("externalIconAriaLabel", externalIconAriaLabel); - const content = import_react116.default.createElement( - import_react116.default.Fragment, - null, - children2, - external && import_react116.default.createElement( - "span", - { className: styles_css_default31["icon-wrapper"] }, - " ", - import_react116.default.createElement( - "span", - { className: styles_css_default31.icon, "aria-label": renderedExternalIconAriaLabel, role: renderedExternalIconAriaLabel ? "img" : void 0 }, - import_react116.default.createElement(internal_default, { name: "external", size: "inherit" }) - ) - ), - variant === "info" && import_react116.default.createElement("span", { hidden: true, id: infoId }, ":") - ); - const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : void 0 }); - if (isButton) { - return import_react116.default.createElement("a", Object.assign({}, sharedProps, { role: "button", tabIndex, onKeyDown: handleButtonKeyDown, onClick: handleButtonClick }), content); - } - return ( - // we dynamically set proper rel in the code above - // eslint-disable-next-line react/jsx-no-target-blank - import_react116.default.createElement("a", Object.assign({}, sharedProps, { tabIndex, target: anchorTarget, rel: anchorRel, href, onClick: handleLinkClick }), content) - ); -}); -function getVariantStyle(variant) { - return `variant-${variant.replace(/^awsui-/, "")}`; -} -function getFontSizeStyle(variant, fontSize) { - switch (variant) { - case "info": - return "font-size-body-s"; - case "awsui-value-large": - return "font-size-display-l"; - default: - return `font-size-${fontSize}`; - } -} -function getColorStyle(variant, color2) { - return `color-${variant === "info" ? "normal" : color2}`; -} -var internal_default5 = InternalLink; - -// node_modules/@cloudscape-design/components/internal/components/chart-status-container/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-status-container/styles.scoped.css"; -var styles_css_default32 = { - "root": "awsui_root_11n0s_6tm6j_9", - "empty": "awsui_empty_11n0s_6tm6j_13" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-status-container/index.js -function getChartStatus({ externalData, visibleData, statusType }) { - const isEmpty = !visibleData || visibleData.length === 0; - const isNoMatch = isEmpty && visibleData.length !== externalData.length; - const showChart = statusType === "finished" && !isEmpty; - return { isEmpty, isNoMatch, showChart }; -} -function ChartStatusContainer({ statusType, errorText, loadingText, recoveryText, noMatch, empty, onRecoveryClick, isNoMatch, isEmpty, showChart }) { - const i18n = useInternalI18n("[charts]"); - const statusContainer = (0, import_react117.useMemo)(() => { - const handleRecoveryClick = (event) => { - event.preventDefault(); - fireNonCancelableEvent(onRecoveryClick); - }; - if (statusType === "error") { - const renderedRecoveryText = i18n("recoveryText", recoveryText); - return import_react117.default.createElement( - "span", - null, - import_react117.default.createElement(StatusIndicator, { type: "error" }, i18n("errorText", errorText)), - " ", - !!renderedRecoveryText && !!onRecoveryClick && import_react117.default.createElement(internal_default5, { onFollow: handleRecoveryClick, variant: "recovery" }, renderedRecoveryText) - ); - } - if (statusType === "loading") { - return import_react117.default.createElement(StatusIndicator, { type: "loading" }, i18n("loadingText", loadingText)); - } - if (isNoMatch) { - return import_react117.default.createElement("div", { className: styles_css_default32.empty }, noMatch); - } - if (isEmpty) { - return import_react117.default.createElement("div", { className: styles_css_default32.empty }, empty); - } - }, [i18n, statusType, onRecoveryClick, isEmpty, isNoMatch, recoveryText, loadingText, errorText, empty, noMatch]); - return import_react117.default.createElement("div", { className: styles_css_default32.root, "aria-live": "polite", "aria-atomic": "true" }, !showChart && statusContainer); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-filter.js -var import_react157 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-filter/index.js -var import_react156 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/form-field/internal.js -var import_react120 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/context/form-field-context.js -var import_react118 = __toESM(require_react()); -var FormFieldContext = (0, import_react118.createContext)({}); -function applyDefault(fields, defaults2, keys) { - const result = {}; - keys.forEach((key2) => { - result[key2] = fields[key2] === void 0 ? defaults2[key2] : fields[key2]; - }); - return result; -} -function useFormFieldContext(props2) { - const context = (0, import_react118.useContext)(FormFieldContext); - return applyDefault(props2, context, ["invalid", "controlId", "ariaLabelledby", "ariaDescribedby"]); -} - -// node_modules/@cloudscape-design/components/grid/internal.js -var import_react119 = __toESM(require_react()); -var import_react_keyed_flatten_children2 = __toESM(require_react_keyed_flatten_children()); - -// node_modules/@cloudscape-design/components/grid/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/grid/styles.scoped.css"; -var styles_css_default33 = { - "grid": "awsui_grid_14yj0_1lwse_99", - "no-gutters": "awsui_no-gutters_14yj0_1lwse_138", - "grid-column": "awsui_grid-column_14yj0_1lwse_143", - "colspan-1": "awsui_colspan-1_14yj0_1lwse_154", - "push-1": "awsui_push-1_14yj0_1lwse_158", - "pull-1": "awsui_pull-1_14yj0_1lwse_161", - "colspan-2": "awsui_colspan-2_14yj0_1lwse_164", - "push-2": "awsui_push-2_14yj0_1lwse_168", - "pull-2": "awsui_pull-2_14yj0_1lwse_171", - "colspan-3": "awsui_colspan-3_14yj0_1lwse_174", - "push-3": "awsui_push-3_14yj0_1lwse_178", - "pull-3": "awsui_pull-3_14yj0_1lwse_181", - "colspan-4": "awsui_colspan-4_14yj0_1lwse_184", - "push-4": "awsui_push-4_14yj0_1lwse_188", - "pull-4": "awsui_pull-4_14yj0_1lwse_191", - "colspan-5": "awsui_colspan-5_14yj0_1lwse_194", - "push-5": "awsui_push-5_14yj0_1lwse_198", - "pull-5": "awsui_pull-5_14yj0_1lwse_201", - "colspan-6": "awsui_colspan-6_14yj0_1lwse_204", - "push-6": "awsui_push-6_14yj0_1lwse_208", - "pull-6": "awsui_pull-6_14yj0_1lwse_211", - "colspan-7": "awsui_colspan-7_14yj0_1lwse_214", - "push-7": "awsui_push-7_14yj0_1lwse_218", - "pull-7": "awsui_pull-7_14yj0_1lwse_221", - "colspan-8": "awsui_colspan-8_14yj0_1lwse_224", - "push-8": "awsui_push-8_14yj0_1lwse_228", - "pull-8": "awsui_pull-8_14yj0_1lwse_231", - "colspan-9": "awsui_colspan-9_14yj0_1lwse_234", - "push-9": "awsui_push-9_14yj0_1lwse_238", - "pull-9": "awsui_pull-9_14yj0_1lwse_241", - "colspan-10": "awsui_colspan-10_14yj0_1lwse_244", - "push-10": "awsui_push-10_14yj0_1lwse_248", - "pull-10": "awsui_pull-10_14yj0_1lwse_251", - "colspan-11": "awsui_colspan-11_14yj0_1lwse_254", - "push-11": "awsui_push-11_14yj0_1lwse_258", - "pull-11": "awsui_pull-11_14yj0_1lwse_261", - "colspan-12": "awsui_colspan-12_14yj0_1lwse_264", - "push-12": "awsui_push-12_14yj0_1lwse_268", - "pull-12": "awsui_pull-12_14yj0_1lwse_271", - "push-0": "awsui_push-0_14yj0_1lwse_274", - "pull-0": "awsui_pull-0_14yj0_1lwse_277", - "offset-1": "awsui_offset-1_14yj0_1lwse_280", - "offset-2": "awsui_offset-2_14yj0_1lwse_283", - "offset-3": "awsui_offset-3_14yj0_1lwse_286", - "offset-4": "awsui_offset-4_14yj0_1lwse_289", - "offset-5": "awsui_offset-5_14yj0_1lwse_292", - "offset-6": "awsui_offset-6_14yj0_1lwse_295", - "offset-7": "awsui_offset-7_14yj0_1lwse_298", - "offset-8": "awsui_offset-8_14yj0_1lwse_301", - "offset-9": "awsui_offset-9_14yj0_1lwse_304", - "offset-10": "awsui_offset-10_14yj0_1lwse_307", - "offset-11": "awsui_offset-11_14yj0_1lwse_310", - "restore-pointer-events": "awsui_restore-pointer-events_14yj0_1lwse_314" -}; - -// node_modules/@cloudscape-design/components/grid/internal.js -var InternalGrid = import_react119.default.forwardRef((_a2, ref) => { - var { __breakpoint, gridDefinition = [], disableGutters = false, children: children2, __responsiveClassName, __internalRootRef = null } = _a2, restProps = __rest(_a2, ["__breakpoint", "gridDefinition", "disableGutters", "children", "__responsiveClassName", "__internalRootRef"]); - let [defaultBreakpoint, defaultRef] = useContainerBreakpoints(void 0); - if (__breakpoint !== void 0) { - defaultBreakpoint = __breakpoint; - defaultRef = ref; - } - const baseProps = getBaseProps(restProps); - const flattenedChildren = (0, import_react_keyed_flatten_children2.default)(children2); - if (isDevelopment2) { - const columnCount = gridDefinition.length; - const childCount = flattenedChildren.length; - if (columnCount !== childCount) { - warnOnce("Grid", `The number of children (${childCount}) does not match the number of columns defined (${columnCount}).`); - } - } - const mergedRef = useMergeRefs(defaultRef, __internalRootRef); - return import_react119.default.createElement("div", Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default33.grid, baseProps.className, { [styles_css_default33["no-gutters"]]: disableGutters }, __responsiveClassName ? __responsiveClassName(defaultBreakpoint) : null), ref: mergedRef }), flattenedChildren.map((child, i) => { - var _a3, _b, _c, _d; - const key2 = child.key; - return import_react119.default.createElement( - "div", - { key: key2 ? String(key2) : void 0, className: clsx_m_default(styles_css_default33["grid-column"], getColumnClassNames("colspan", (_a3 = gridDefinition[i]) === null || _a3 === void 0 ? void 0 : _a3.colspan, defaultBreakpoint), getColumnClassNames("offset", (_b = gridDefinition[i]) === null || _b === void 0 ? void 0 : _b.offset, defaultBreakpoint), getColumnClassNames("pull", (_c = gridDefinition[i]) === null || _c === void 0 ? void 0 : _c.pull, defaultBreakpoint), getColumnClassNames("push", (_d = gridDefinition[i]) === null || _d === void 0 ? void 0 : _d.push, defaultBreakpoint)) }, - import_react119.default.createElement("div", { className: styles_css_default33["restore-pointer-events"] }, child) - ); - })); -}); -function getColumnClassNames(prop, mapping, breakpoint) { - if (typeof mapping === "number") { - return styles_css_default33[`${prop}-${mapping}`]; - } - if (breakpoint === null || mapping === void 0) { - return null; - } - return styles_css_default33[`${prop}-${matchBreakpointMapping(mapping, breakpoint)}`]; -} -var internal_default6 = InternalGrid; - -// node_modules/@cloudscape-design/components/form-field/util.js -function makeSlotId(prop, formFieldId, propName) { - if (!prop) { - return void 0; - } - return `${formFieldId}-${propName}`; -} -function getSlotIds(formFieldId, label, description, constraintText, errorText) { - const ids2 = { - label: makeSlotId(label, formFieldId, "label"), - description: makeSlotId(description, formFieldId, "description"), - constraint: makeSlotId(constraintText, formFieldId, "constraint"), - error: makeSlotId(errorText, formFieldId, "error") - }; - return ids2; -} -function getAriaDescribedBy({ error, description, constraint }) { - const describedByAttributes = [error, description, constraint].filter((e) => !!e); - const describedBy = describedByAttributes.length ? describedByAttributes.join(" ") : void 0; - return describedBy; -} -function getGridDefinition(stretch, secondaryControlPresent, isRefresh) { - let columns; - if (stretch) { - columns = [{ colspan: 12 }, { colspan: 12 }]; - } else if (isRefresh) { - columns = [{ colspan: { default: 12, xs: 8 } }, { colspan: { default: 12, xs: 4 } }]; - } else { - columns = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }]; - } - if (!secondaryControlPresent) { - return [columns[0]]; - } - return columns; -} - -// node_modules/@cloudscape-design/components/form-field/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/form-field/styles.scoped.css"; -var styles_css_default34 = { - "error-icon-shake-wrapper": "awsui_error-icon-shake-wrapper_14mhv_av9zi_103", - "awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_14mhv_av9zi_1", - "error-icon-scale-wrapper": "awsui_error-icon-scale-wrapper_14mhv_av9zi_130", - "awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_14mhv_av9zi_1", - "error": "awsui_error_14mhv_av9zi_103", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_14mhv_av9zi_1", - "root": "awsui_root_14mhv_av9zi_174", - "label": "awsui_label_14mhv_av9zi_210", - "info": "awsui_info_14mhv_av9zi_224", - "description": "awsui_description_14mhv_av9zi_229", - "constraint": "awsui_constraint_14mhv_av9zi_230", - "hints": "awsui_hints_14mhv_av9zi_237", - "constraint-has-error": "awsui_constraint-has-error_14mhv_av9zi_238", - "secondary-control": "awsui_secondary-control_14mhv_av9zi_242", - "controls": "awsui_controls_14mhv_av9zi_246", - "label-hidden": "awsui_label-hidden_14mhv_av9zi_246", - "control": "awsui_control_14mhv_av9zi_246", - "error__message": "awsui_error__message_14mhv_av9zi_264", - "visually-hidden": "awsui_visually-hidden_14mhv_av9zi_268" -}; - -// node_modules/@cloudscape-design/components/internal/utils/strings/pad-left-zeros.js -function padLeftZeros(text, length) { - while (text.length < length) { - text = `0${text}`; - } - return text; -} - -// node_modules/@cloudscape-design/components/form-field/internal.js -function FormFieldError({ id, children: children2, errorIconAriaLabel }) { - const i18n = useInternalI18n("form-field"); - const contentRef = (0, import_react120.useRef)(null); - return import_react120.default.createElement( - import_react120.default.Fragment, - null, - import_react120.default.createElement( - "div", - { id, className: styles_css_default34.error }, - import_react120.default.createElement( - "div", - { className: styles_css_default34["error-icon-shake-wrapper"] }, - import_react120.default.createElement( - "div", - { role: "img", "aria-label": i18n("i18nStrings.errorIconAriaLabel", errorIconAriaLabel), className: styles_css_default34["error-icon-scale-wrapper"] }, - import_react120.default.createElement(internal_default, { name: "status-warning", size: "small" }) - ) - ), - import_react120.default.createElement("span", { className: styles_css_default34.error__message, ref: contentRef }, children2) - ), - import_react120.default.createElement(live_region_default, { assertive: true, source: [errorIconAriaLabel, contentRef] }) - ); -} -function ConstraintText({ id, hasError, children: children2 }) { - return import_react120.default.createElement("div", { id, className: clsx_m_default(styles_css_default34.constraint, hasError && styles_css_default34["constraint-has-error"]) }, children2); -} -function InternalFormField(_a2) { - var { controlId, stretch = false, label, info, i18nStrings, children: children2, secondaryControl, description, constraintText, errorText, __hideLabel, __internalRootRef = null, __disableGutters = false } = _a2, rest = __rest(_a2, ["controlId", "stretch", "label", "info", "i18nStrings", "children", "secondaryControl", "description", "constraintText", "errorText", "__hideLabel", "__internalRootRef", "__disableGutters"]); - const baseProps = getBaseProps(rest); - const isRefresh = useVisualRefresh(); - const instanceUniqueId = useUniqueId("formField"); - const generatedControlId = controlId || instanceUniqueId; - const formFieldId = controlId || generatedControlId; - const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel(); - const { stepNumber, stepNameSelector } = useFunnelStep(); - const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); - const slotIds = getSlotIds(formFieldId, label, description, constraintText, errorText); - const ariaDescribedBy = getAriaDescribedBy(slotIds); - const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh); - const { ariaLabelledby: parentAriaLabelledby, ariaDescribedby: parentAriaDescribedby, invalid: parentInvalid } = useFormFieldContext({}); - const contextValuesWithoutControlId = { - ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || void 0, - ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || void 0, - invalid: !!errorText || !!parentInvalid - }; - const analyticsAttributes = { - [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : void 0, - [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : void 0 - }; - (0, import_react120.useEffect)(() => { - var _a3, _b, _c; - if (funnelInteractionId && errorText && funnelState.current !== "complete") { - const stepName = getNameFromSelector(stepNameSelector); - const subStepName = getNameFromSelector(subStepNameSelector); - errorCount.current++; - const errorIsVisible = ((_c = (_b = (_a3 = __internalRootRef === null || __internalRootRef === void 0 ? void 0 : __internalRootRef.current) === null || _a3 === void 0 ? void 0 : _a3.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 0) > 0; - if (errorIsVisible) { - FunnelMetrics.funnelSubStepError({ - funnelInteractionId, - subStepSelector, - subStepName, - subStepNameSelector, - stepNumber, - stepName, - stepNameSelector, - fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles_css_default34.error__message}`, - fieldLabelSelector: getFieldSlotSeletor(slotIds.label), - subStepAllSelector: getSubStepAllSelector() - }); - } - return () => { - errorCount.current--; - }; - } - }, [funnelInteractionId, errorText, submissionAttempt, errorCount]); - return import_react120.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default34.root), ref: __internalRootRef }, analyticsAttributes), - import_react120.default.createElement( - "div", - { className: clsx_m_default(__hideLabel && styles_css_default34["visually-hidden"]) }, - label && import_react120.default.createElement("label", { className: styles_css_default34.label, id: slotIds.label, htmlFor: generatedControlId }, label), - import_react120.default.createElement(InfoLinkLabelContext.Provider, { value: slotIds.label }, !__hideLabel && info && import_react120.default.createElement("span", { className: styles_css_default34.info }, info)) - ), - description && import_react120.default.createElement("div", { className: styles_css_default34.description, id: slotIds.description }, description), - import_react120.default.createElement( - "div", - { className: clsx_m_default(styles_css_default34.controls, __hideLabel && styles_css_default34["label-hidden"]) }, - import_react120.default.createElement( - internal_default6, - { gridDefinition, disableGutters: __disableGutters }, - import_react120.default.createElement(FormFieldContext.Provider, { value: Object.assign({ controlId: generatedControlId }, contextValuesWithoutControlId) }, children2 && import_react120.default.createElement("div", { className: styles_css_default34.control }, children2)), - secondaryControl && import_react120.default.createElement( - FormFieldContext.Provider, - { value: contextValuesWithoutControlId }, - import_react120.default.createElement("div", { className: styles_css_default34["secondary-control"] }, secondaryControl) - ) - ) - ), - (constraintText || errorText) && import_react120.default.createElement( - "div", - { className: styles_css_default34.hints }, - errorText && import_react120.default.createElement(FormFieldError, { id: slotIds.error, errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, errorText), - constraintText && import_react120.default.createElement(ConstraintText, { id: slotIds.constraint, hasError: !!errorText }, constraintText) - ) - ); -} - -// node_modules/@cloudscape-design/components/multiselect/internal.js -var import_react154 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/option/utils/filter-options.js -var searchableFields = ["value", "label", "description", "labelTag"]; -var matchesString = (value, searchText, strictMatching) => { - if (!value) { - return false; - } - const index = value.toLowerCase().indexOf(searchText); - return strictMatching ? index === 0 : index > -1; -}; -var matchesSingleOption = (dropdownOption, text, strictMatching) => { - const searchText = text.toLowerCase(); - const option = dropdownOption.option; - const searchStrFields = (attr) => matchesString(option[attr], searchText, strictMatching); - const searchTagsFields = (attr) => { - var _a2; - return (_a2 = option[attr]) === null || _a2 === void 0 ? void 0 : _a2.some((value) => matchesString(value, searchText, strictMatching)); - }; - const searchableTagFields = ["tags"]; - if (!strictMatching) { - searchableTagFields.push("filteringTags"); - } - return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields); -}; -var filterOptions = (options, searchText, strictMatching = false) => { - if (searchText === "") { - return options; - } - let currentGroup = null; - let parentMatched = false; - return options.reduce((acc, option) => { - if (option.type === "parent") { - parentMatched = false; - currentGroup = option; - if (matchesSingleOption(option, searchText, strictMatching)) { - parentMatched = true; - acc.push(currentGroup); - } - return acc; - } - if (option.type !== "child") { - currentGroup = null; - parentMatched = false; - } - if (parentMatched) { - acc.push(option); - } else if (matchesSingleOption(option, searchText, strictMatching)) { - if (currentGroup) { - acc.push(currentGroup); - currentGroup = null; - } - acc.push(option); - } - return acc; - }, []); -}; -var isInteractive = (option) => !!option && !option.disabled && option.type !== "parent"; -var isGroupInteractive = (option) => !!option && !option.disabled; -var isGroup = (option) => !!option && "options" in option; - -// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/index.js -var import_react123 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/dropdown-footer/styles.scoped.css"; -var styles_css_default35 = { - "root": "awsui_root_1afi9_5kqbd_99", - "hidden": "awsui_hidden_1afi9_5kqbd_133", - "no-items": "awsui_no-items_1afi9_5kqbd_136" -}; - -// node_modules/@cloudscape-design/components/internal/components/dropdown-status/index.js -var import_react122 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/use-previous/index.js -var import_react121 = __toESM(require_react()); -var usePrevious = (value) => { - const ref = (0, import_react121.useRef)(); - (0, import_react121.useEffect)(() => { - ref.current = value; - }); - return ref.current; -}; - -// node_modules/@cloudscape-design/components/internal/components/dropdown-status/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/dropdown-status/styles.scoped.css"; -var styles_css_default36 = { - "root": "awsui_root_vrgzu_ljki3_99", - "recovery": "awsui_recovery_vrgzu_ljki3_137" -}; - -// node_modules/@cloudscape-design/components/internal/components/dropdown-status/index.js -function DropdownStatus({ children: children2 }) { - return import_react122.default.createElement("div", { className: styles_css_default36.root }, children2); -} -var useDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, onRecoveryClick, hasRecoveryCallback = false, errorIconAriaLabel }) => { - const previousStatusType = usePrevious(statusType); - const statusResult = { isSticky: true, content: null }; - if (statusType === "loading") { - statusResult.content = import_react122.default.createElement(StatusIndicator, { type: "loading" }, loadingText); - } else if (statusType === "error") { - statusResult.content = import_react122.default.createElement( - "span", - null, - import_react122.default.createElement(StatusIndicator, { type: "error", __display: "inline", __animate: previousStatusType !== "error", iconAriaLabel: errorIconAriaLabel }, errorText), - " ", - !!recoveryText && hasRecoveryCallback && import_react122.default.createElement(internal_default5, { onFollow: () => fireNonCancelableEvent(onRecoveryClick), variant: "recovery", className: styles_css_default36.recovery }, recoveryText) - ); - } else if (isEmpty && empty) { - statusResult.content = empty; - } else if (isNoMatch && noMatch) { - statusResult.content = noMatch; - } else if (isFiltered && filteringResultsText) { - statusResult.content = filteringResultsText; - } else if (statusType === "finished" && finishedText) { - statusResult.content = finishedText; - statusResult.isSticky = false; - } - return statusResult; -}; -var dropdown_status_default = DropdownStatus; - -// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/index.js -var DropdownFooter = ({ content, id, hasItems = true }) => import_react123.default.createElement( - "div", - { className: clsx_m_default(styles_css_default35.root, { [styles_css_default35.hidden]: content === null, [styles_css_default35["no-items"]]: !hasItems }) }, - import_react123.default.createElement(live_region_default, { visible: true, tagName: "div", id }, content && import_react123.default.createElement(dropdown_status_default, null, content)) -); -var dropdown_footer_default = DropdownFooter; - -// node_modules/@cloudscape-design/components/internal/components/option/utils/flatten-options.js -var flattenOptions = (options) => { - const parentMap = /* @__PURE__ */ new Map(); - const flatOptions = options.reduce((acc, option) => { - if ("options" in option) { - const { options: options2 } = option, rest = __rest(option, ["options"]); - const parentDropdownOption = { type: "parent", option }; - const allOptionsDisabled = options2.every((option2) => option2.disabled); - if (option.disabled || allOptionsDisabled) { - parentDropdownOption.disabled = true; - } - acc.push(parentDropdownOption); - options2.forEach((child) => { - const childDropdownOption = { type: "child", option: child }; - if (rest.disabled || child.disabled) { - childDropdownOption.disabled = true; - } - acc.push(childDropdownOption); - parentMap.set(childDropdownOption, parentDropdownOption); - }); - } else { - const dropdownOption = { option }; - if (option.disabled) { - dropdownOption.disabled = true; - } - acc.push(dropdownOption); - } - return acc; - }, []); - return { - flatOptions, - parentMap - }; -}; - -// node_modules/@cloudscape-design/components/internal/components/options-list/utils/test-indexes.js -var testIndexMap = /* @__PURE__ */ new WeakMap(); -var getTestOptionIndexes = (item) => testIndexMap.get(item); -var generateTestIndexes = (filteredItems, getParentGroup) => { - let throughIndex = 1; - let groupIndex = 0; - let inGroupIndex = 1; - let currentGroup = null; - filteredItems.forEach((item) => { - const isGroup5 = item.type === "parent"; - const group = isGroup5 ? item : getParentGroup(item); - if (group && group !== currentGroup) { - currentGroup = group; - groupIndex += 1; - inGroupIndex = 1; - } - if (isGroup5) { - testIndexMap.set(item, { groupIndex }); - } else if (group && item.type === "child") { - testIndexMap.set(item, { - throughIndex: throughIndex++, - groupIndex, - inGroupIndex: inGroupIndex++ - }); - } else if (item.type === "child" || !item.type) { - testIndexMap.set(item, { throughIndex: throughIndex++ }); - } - }); -}; - -// node_modules/@cloudscape-design/components/internal/components/option/utils/prepare-options.js -function prepareOptions(options, filteringType, filteringText) { - const { flatOptions, parentMap } = flattenOptions(options); - const filteredOptions = filteringType !== "auto" ? flatOptions : filterOptions(flatOptions, filteringText); - generateTestIndexes(filteredOptions, parentMap.get.bind(parentMap)); - return { - filteredOptions, - parentMap, - totalCount: flatOptions.length, - matchesCount: filteredOptions.length - }; -} - -// node_modules/@cloudscape-design/components/select/utils/use-select.js -var import_react126 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-highlight-option.js -var import_react124 = __toESM(require_react()); -var HighlightType = class { - constructor(type, moveFocus = type === "keyboard") { - this.type = type; - this.moveFocus = moveFocus; - } -}; -function useHighlightedOption({ options, isHighlightable: isHighlightable2 }) { - const [highlightedIndex, setHighlightedIndexState] = (0, import_react124.useState)(-1); - const [highlightType, setHighlightType] = (0, import_react124.useState)(new HighlightType("keyboard")); - const setHighlightedIndex = (0, import_react124.useCallback)((index, highlightType2) => { - setHighlightedIndexState(index); - setHighlightType(highlightType2); - }, []); - const highlightedOption = options[highlightedIndex] && isHighlightable2(options[highlightedIndex]) ? options[highlightedIndex] : void 0; - const moveHighlightFrom = (direction, startIndex = highlightedIndex, highlightType2) => { - const fromBottomEnd = startIndex === -1 && direction === -1; - let newIndex = fromBottomEnd ? options.length : startIndex; - do { - newIndex += direction; - } while (options[newIndex] && !isHighlightable2(options[newIndex])); - if (options[newIndex]) { - setHighlightedIndex(newIndex, highlightType2); - } - }; - const moveHighlight2 = (direction, highlightType2) => moveHighlightFrom(direction, highlightedIndex, highlightType2); - const highlightOption = (0, import_react124.useCallback)((option, highlightType2) => { - const index = options.indexOf(option); - setHighlightedIndex(index, highlightType2); - }, [options, setHighlightedIndex]); - return [ - { highlightType, highlightedIndex, highlightedOption }, - { - setHighlightedIndexWithMouse: (index, moveFocus = false) => setHighlightedIndex(index, new HighlightType("mouse", moveFocus)), - moveHighlightWithKeyboard: (direction) => moveHighlight2(direction, new HighlightType("keyboard")), - highlightOptionWithKeyboard: (option) => highlightOption(option, new HighlightType("keyboard")), - resetHighlightWithKeyboard: () => setHighlightedIndex(-1, new HighlightType("keyboard")), - goHomeWithKeyboard: () => moveHighlightFrom(1, -1, new HighlightType("keyboard")), - goEndWithKeyboard: () => moveHighlightFrom(-1, options.length, new HighlightType("keyboard")) - } - ]; -} - -// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-keyboard.js -var import_react125 = __toESM(require_react()); -var HOME = 36; -var END = 35; -var useMenuKeyboard = ({ moveHighlight: moveHighlight2, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace = false }) => { - return (0, import_react125.useCallback)((e) => { - switch (e.detail.keyCode) { - case KeyCode.up: - e.preventDefault(); - moveHighlight2(-1); - break; - case KeyCode.down: - e.preventDefault(); - moveHighlight2(1); - break; - case HOME: - goHome(); - break; - case END: - goEnd(); - break; - case KeyCode.escape: - e.stopPropagation(); - closeDropdown(); - break; - case KeyCode.enter: - e.preventDefault(); - selectOption(); - break; - case KeyCode.space: - if (preventNativeSpace) { - e.preventDefault(); - selectOption(); - } - } - }, [moveHighlight2, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace]); -}; -var useTriggerKeyboard = ({ openDropdown, goHome }) => { - return (0, import_react125.useCallback)((e) => { - switch (e.detail.keyCode) { - case KeyCode.up: - case KeyCode.down: - e.preventDefault(); - goHome(); - openDropdown(); - break; - case KeyCode.space: - case KeyCode.enter: - e.preventDefault(); - openDropdown(); - break; - } - }, [openDropdown, goHome]); -}; - -// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-ids.js -var getOptionId = (menuId, index) => { - if (index < 0) { - return void 0; - } - return `${menuId}-option-${index}`; -}; - -// node_modules/@cloudscape-design/components/select/utils/connect-options.js -var connectOptionsByValue = (options, selectedOptions) => { - return (selectedOptions || []).map((selectedOption) => { - for (const dropdownOption of options) { - if (dropdownOption.type !== "parent" && dropdownOption.option.value === selectedOption.value) { - return dropdownOption; - } - } - return { option: selectedOption }; - }); -}; -var findOptionIndex = (options, option) => { - for (let index = 0; index < options.length; index++) { - const __option = options[index]; - if (__option === option || __option.value === option.value) { - return index; - } - } - return -1; -}; - -// node_modules/@cloudscape-design/components/select/utils/use-select.js -function useSelect({ selectedOptions, updateSelectedOption, options, filteringType, onBlur, onFocus, externalRef, keepOpen, fireLoadItems, setFilteringValue, useInteractiveGroups = false, statusType }) { - const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive; - const isHighlightable2 = (option) => !!option && (useInteractiveGroups || option.type !== "parent"); - const filterRef = (0, import_react126.useRef)(null); - const triggerRef = (0, import_react126.useRef)(null); - const menuRef = (0, import_react126.useRef)(null); - const hasFilter = filteringType !== "none"; - const activeRef = hasFilter ? filterRef : menuRef; - const __selectedOptions = connectOptionsByValue(options, selectedOptions); - const __selectedValuesSet = selectedOptions.reduce((selectedValuesSet, item) => { - if (item.value) { - selectedValuesSet.add(item.value); - } - return selectedValuesSet; - }, /* @__PURE__ */ new Set()); - const [{ highlightType, highlightedOption, highlightedIndex }, { moveHighlightWithKeyboard, resetHighlightWithKeyboard, setHighlightedIndexWithMouse, highlightOptionWithKeyboard, goHomeWithKeyboard, goEndWithKeyboard }] = useHighlightedOption({ options, isHighlightable: isHighlightable2 }); - const { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard } = useOpenState({ - onOpen: () => fireLoadItems(""), - onClose: () => { - resetHighlightWithKeyboard(); - setFilteringValue(""); - } - }); - const handleFocus = () => { - fireNonCancelableEvent(onFocus, {}); - }; - const handleBlur = () => { - fireNonCancelableEvent(onBlur, {}); - closeDropdown(); - }; - const hasSelectedOption = __selectedOptions.length > 0; - const menuId = useUniqueId("option-list"); - const dialogId = useUniqueId("dialog"); - const highlightedOptionId = getOptionId(menuId, highlightedIndex); - const selectOption = (option) => { - var _a2; - const optionToSelect = option || highlightedOption; - if (!optionToSelect || !interactivityCheck(optionToSelect)) { - return; - } - updateSelectedOption(optionToSelect.option); - if (!keepOpen) { - (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - closeDropdown(); - } - }; - const activeKeyDownHandler = useMenuKeyboard({ - moveHighlight: moveHighlightWithKeyboard, - selectOption, - goHome: goHomeWithKeyboard, - goEnd: goEndWithKeyboard, - closeDropdown: () => { - var _a2; - (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - closeDropdown(); - }, - preventNativeSpace: !hasFilter - }); - const triggerKeyDownHandler = useTriggerKeyboard({ - openDropdown: () => openDropdown(true), - goHome: goHomeWithKeyboard - }); - const getDropdownProps = () => ({ - onFocus: handleFocus, - onBlur: handleBlur, - dropdownContentId: dialogId, - dropdownContentRole: hasFilter ? "dialog" : void 0 - }); - const getTriggerProps = (disabled = false, autoFocus = false) => { - const triggerProps = { - ref: triggerRef, - onFocus: () => closeDropdown(), - autoFocus, - ariaHasPopup: hasFilter ? "dialog" : "listbox", - ariaControls: isOpen ? hasFilter ? dialogId : menuId : void 0 - }; - if (!disabled) { - triggerProps.onMouseDown = (event) => { - var _a2; - event.preventDefault(); - if (isOpen) { - (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - toggleDropdown(); - }; - triggerProps.onKeyDown = triggerKeyDownHandler; - } - return triggerProps; - }; - const getFilterProps = () => { - if (!hasFilter) { - return {}; - } - return { - ref: filterRef, - onKeyDown: activeKeyDownHandler, - onChange: (event) => { - setFilteringValue(event.detail.value); - resetHighlightWithKeyboard(); - }, - __onDelayedInput: (event) => { - fireLoadItems(event.detail.value); - }, - __nativeAttributes: { - "aria-activedescendant": highlightedOptionId, - ["aria-owns"]: menuId, - ["aria-controls"]: menuId - } - }; - }; - const getMenuProps = () => { - const menuProps = { - id: menuId, - ref: menuRef, - open: isOpen, - onMouseUp: (itemIndex) => { - if (itemIndex > -1) { - selectOption(options[itemIndex]); - } - }, - onMouseMove: (itemIndex) => { - if (itemIndex > -1) { - setHighlightedIndexWithMouse(itemIndex); - } - }, - statusType - }; - if (!hasFilter) { - menuProps.onKeyDown = activeKeyDownHandler; - menuProps.nativeAttributes = { - "aria-activedescendant": highlightedOptionId - }; - } - return menuProps; - }; - const getGroupState = (option) => { - const totalSelected = option.options.filter((item) => !!item.value && __selectedValuesSet.has(item.value)).length; - const hasSelected = totalSelected > 0; - const allSelected = totalSelected === option.options.length; - return { - selected: hasSelected && allSelected, - indeterminate: hasSelected && !allSelected - }; - }; - const getOptionProps2 = (option, index) => { - var _a2; - const highlighted = option === highlightedOption; - const groupState = isGroup(option.option) ? getGroupState(option.option) : void 0; - const selected = __selectedOptions.indexOf(option) > -1 || !!(groupState === null || groupState === void 0 ? void 0 : groupState.selected); - const nextOption = (_a2 = options[index + 1]) === null || _a2 === void 0 ? void 0 : _a2.option; - const isNextSelected = !!nextOption && isGroup(nextOption) ? getGroupState(nextOption).selected : __selectedOptions.indexOf(options[index + 1]) > -1; - const optionProps = { - key: index, - option, - highlighted, - selected, - isNextSelected, - indeterminate: !!(groupState === null || groupState === void 0 ? void 0 : groupState.indeterminate), - ["data-mouse-target"]: isHighlightable2(option) ? index : -1, - id: getOptionId(menuId, index) - }; - return optionProps; - }; - const prevOpen = usePrevious(isOpen); - (0, import_react126.useEffect)(() => { - if (isOpen && !prevOpen && hasSelectedOption && !hasFilter) { - if (openedWithKeyboard) { - highlightOptionWithKeyboard(__selectedOptions[0]); - } else { - setHighlightedIndexWithMouse(options.indexOf(__selectedOptions[0]), true); - } - } - }, [ - isOpen, - __selectedOptions, - hasSelectedOption, - setHighlightedIndexWithMouse, - highlightOptionWithKeyboard, - openedWithKeyboard, - options, - prevOpen, - hasFilter - ]); - (0, import_react126.useEffect)(() => { - var _a2; - if (isOpen) { - (_a2 = activeRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventScroll: true }); - } - }, [isOpen, activeRef]); - useForwardFocus(externalRef, triggerRef); - const highlightedGroupSelected = !!highlightedOption && isGroup(highlightedOption.option) && getGroupState(highlightedOption.option).selected; - const announceSelected = !!highlightedOption && (__selectedOptions.indexOf(highlightedOption) > -1 || highlightedGroupSelected); - return { - isOpen, - highlightedOption, - highlightedIndex, - highlightType, - getTriggerProps, - getDropdownProps, - getMenuProps, - getFilterProps, - getOptionProps: getOptionProps2, - highlightOption: highlightOptionWithKeyboard, - selectOption, - announceSelected, - dialogId - }; -} - -// node_modules/@cloudscape-design/components/select/utils/use-native-search.js -var import_react128 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/use-debounce-callback/index.js -var import_react127 = __toESM(require_react()); -function useDebounceCallback(callback, delay) { - const callbackRef = (0, import_react127.useRef)(); - callbackRef.current = callback; - return (0, import_react127.useCallback)(debounce((...args) => { - if (callbackRef.current) { - callbackRef.current(...args); - } - }, delay), []); -} - -// node_modules/@cloudscape-design/components/select/utils/use-native-search.js -var isRepeatedChar = (str) => str.split("").every((c) => c === str[0]); -function findMatchingOption(options, searchText, currentHighlight, useInteractiveGroups) { - const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive; - const filter = (searchText2) => filterOptions(options, searchText2, true).filter((option) => interactivityCheck(option)); - const matchingOptions = filter(searchText); - if (matchingOptions.length === 1) { - return matchingOptions[0]; - } - if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) { - const matchingOptions2 = filter(searchText[0]); - if (matchingOptions2.length > 0) { - let active = isGroup(currentHighlight) ? matchingOptions2.map(({ option }) => option).indexOf(currentHighlight) : matchingOptions2.map(({ option }) => option.value).indexOf(currentHighlight.value); - active += 1; - active = active % matchingOptions2.length; - return matchingOptions2[active]; - } - } - if (matchingOptions.length > 0) { - return matchingOptions[0]; - } - return null; -} -function useNativeSearch({ isEnabled, options, highlightOption, highlightedOption, useInteractiveGroups }) { - const value = (0, import_react128.useRef)(""); - const delayedResetValue = useDebounceCallback(() => value.current = "", 500); - return (event) => { - if (!isEnabled) { - return; - } - const { key: key2 } = event; - if (!key2 || key2.length !== 1) { - return; - } - delayedResetValue(); - const newValue = value.current + key2; - value.current = newValue; - const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups); - if (nextHighlight) { - highlightOption(nextHighlight); - } - }; -} - -// node_modules/@cloudscape-design/components/select/utils/use-load-items.js -var import_react129 = __toESM(require_react()); -var useLoadItems = ({ onLoadItems, options, statusType }) => { - const prevFilteringText = (0, import_react129.useRef)(void 0); - const fireLoadItems = (filteringText) => { - if (prevFilteringText.current === filteringText) { - return; - } - prevFilteringText.current = filteringText; - fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false }); - }; - const handleLoadMore = () => { - const firstPage = options.length === 0; - statusType === "pending" && fireNonCancelableEvent(onLoadItems, { - firstPage, - samePage: false, - filteringText: prevFilteringText.current || "" - }); - }; - const handleRecoveryClick = () => fireNonCancelableEvent(onLoadItems, { - firstPage: false, - samePage: true, - filteringText: prevFilteringText.current || "" - }); - return { - fireLoadItems, - handleLoadMore, - handleRecoveryClick - }; -}; - -// node_modules/@cloudscape-design/components/select/utils/use-announcement.js -var import_react130 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/option/option-announcer.js -function defaultOptionDescription(option, parentGroup) { - return [ - parentGroup && parentGroup.label, - option.__labelPrefix, - option.label || option.value, - option.description, - option.labelTag - ].concat(option.tags).filter((el) => !!el).join(" "); -} -var option_announcer_default = defaultOptionDescription; - -// node_modules/@cloudscape-design/components/select/utils/use-announcement.js -function useAnnouncement({ announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive }) { - const prevAnnouncedGroup = (0, import_react130.useRef)(void 0); - (0, import_react130.useEffect)(() => { - if (highlightedOption) { - const frameId = requestAnimationFrame(() => { - prevAnnouncedGroup.current = getParent(highlightedOption); - }); - return () => cancelAnimationFrame(frameId); - } - }); - if (!highlightedOption) { - return ""; - } - const option = highlightedOption.option; - const parent = getParent(highlightedOption); - const group = parent && parent !== prevAnnouncedGroup.current ? parent : void 0; - if (renderHighlightedAriaLive) { - return renderHighlightedAriaLive(option, group); - } - const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : ""; - const defaultDescription = option_announcer_default(option, group); - return [selectedAnnouncement, defaultDescription].filter(Boolean).join(" "); -} - -// node_modules/@cloudscape-design/components/select/parts/plain-list.js -var import_react139 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/select/utils/render-options.js -var import_react138 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/select/parts/item.js -var import_react136 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/select/parts/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/select/parts/styles.scoped.css"; -var styles_css_default37 = { - "placeholder": "awsui_placeholder_dwuol_18z0d_99", - "item": "awsui_item_dwuol_18z0d_104", - "checkbox": "awsui_checkbox_dwuol_18z0d_108", - "filter": "awsui_filter_dwuol_18z0d_117", - "trigger": "awsui_trigger_dwuol_18z0d_122", - "layout-strut": "awsui_layout-strut_dwuol_18z0d_128", - "list-bottom": "awsui_list-bottom_dwuol_18z0d_134", - "selected-icon": "awsui_selected-icon_dwuol_18z0d_138", - "show-label-tag": "awsui_show-label-tag_dwuol_18z0d_142", - "inline-token-trigger": "awsui_inline-token-trigger_dwuol_18z0d_146", - "inline-token-list": "awsui_inline-token-list_dwuol_18z0d_153", - "inline-token": "awsui_inline-token_dwuol_18z0d_146", - "visual-refresh": "awsui_visual-refresh_dwuol_18z0d_182", - "inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_18z0d_189", - "inline-token-counter": "awsui_inline-token-counter_dwuol_18z0d_195", - "inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_18z0d_199" -}; - -// node_modules/@cloudscape-design/components/internal/components/option/index.js -var import_react133 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/option/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/option/styles.scoped.css"; -var styles_css_default38 = { - "option": "awsui_option_1p2cx_cx2ic_103", - "disabled": "awsui_disabled_1p2cx_cx2ic_143", - "parent": "awsui_parent_1p2cx_cx2ic_146", - "highlighted": "awsui_highlighted_1p2cx_cx2ic_149", - "content": "awsui_content_1p2cx_cx2ic_153", - "label-content": "awsui_label-content_1p2cx_cx2ic_160", - "label": "awsui_label_1p2cx_cx2ic_160", - "tag": "awsui_tag_1p2cx_cx2ic_167", - "label-tag": "awsui_label-tag_1p2cx_cx2ic_168", - "label-prefix": "awsui_label-prefix_1p2cx_cx2ic_178", - "tags": "awsui_tags_1p2cx_cx2ic_191", - "description": "awsui_description_1p2cx_cx2ic_192", - "selected": "awsui_selected_1p2cx_cx2ic_203", - "icon": "awsui_icon_1p2cx_cx2ic_217", - "icon-size-big": "awsui_icon-size-big_1p2cx_cx2ic_224", - "filtering-match-highlight": "awsui_filtering-match-highlight_1p2cx_cx2ic_228", - "trigger-variant": "awsui_trigger-variant_1p2cx_cx2ic_243" -}; - -// node_modules/@cloudscape-design/components/internal/components/option/option-parts.js -var import_react132 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/option/highlight-match.js -var import_react131 = __toESM(require_react()); -var splitOnFiltering = (str, highlightText) => { - if (highlightText.length > 1e5) { - return { noMatches: [str], matches: null }; - } - const filteringPattern = highlightText.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); - const regexp = new RegExp(filteringPattern, "gi"); - const noMatches = str.split(regexp); - const matches = str.match(regexp); - return { noMatches, matches }; -}; -var Highlight = ({ str }) => str ? import_react131.default.createElement("span", { className: clsx_m_default(styles_css_default38["filtering-match-highlight"]) }, str) : null; -function HighlightMatch({ str, highlightText }) { - if (!str || !highlightText) { - return import_react131.default.createElement("span", null, str); - } - if (str === highlightText) { - return import_react131.default.createElement(Highlight, { str }); - } - const { noMatches, matches } = splitOnFiltering(str, highlightText); - const highlighted = []; - noMatches.forEach((noMatch, idx) => { - highlighted.push(import_react131.default.createElement("span", { key: `noMatch-${idx}` }, noMatch)); - if (matches && idx < matches.length) { - highlighted.push(import_react131.default.createElement(Highlight, { key: `match-${idx}`, str: matches[idx] })); - } - }); - return import_react131.default.createElement("span", null, highlighted); -} - -// node_modules/@cloudscape-design/components/internal/components/option/option-parts.js -var Label = ({ label, prefix, highlightText, triggerVariant }) => import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38.label, triggerVariant && styles_css_default38["trigger-variant"]) }, - prefix && import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38["label-prefix"], triggerVariant && styles_css_default38["trigger-variant"]) }, - prefix, - " " - ), - import_react132.default.createElement(HighlightMatch, { str: label, highlightText }) -); -var LabelTag = ({ labelTag, highlightText, triggerVariant }) => labelTag ? import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38["label-tag"], triggerVariant && styles_css_default38["trigger-variant"]) }, - import_react132.default.createElement(HighlightMatch, { str: labelTag, highlightText }) -) : null; -var Description = ({ description, highlightedOption, highlightText, selectedOption, triggerVariant }) => description ? import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38.description, { - [styles_css_default38["trigger-variant"]]: triggerVariant, - [styles_css_default38.highlighted]: highlightedOption, - [styles_css_default38.selected]: selectedOption - }) }, - import_react132.default.createElement(HighlightMatch, { str: description, highlightText }) -) : null; -var Tags = ({ tags, highlightedOption, highlightText, selectedOption, triggerVariant }) => tags ? import_react132.default.createElement("span", { className: clsx_m_default(styles_css_default38.tags, { - [styles_css_default38.highlighted]: highlightedOption, - [styles_css_default38.selected]: selectedOption -}) }, tags.map((tag, idx) => import_react132.default.createElement( - "span", - { key: idx, className: clsx_m_default(styles_css_default38.tag, triggerVariant && styles_css_default38["trigger-variant"]) }, - import_react132.default.createElement(HighlightMatch, { str: tag, highlightText }) -))) : null; -var FilteringTags = ({ filteringTags, highlightedOption, highlightText, selectedOption, triggerVariant }) => { - if (!highlightText || !filteringTags) { - return null; - } - const searchElement = highlightText.toLowerCase(); - return import_react132.default.createElement("span", { className: clsx_m_default(styles_css_default38.tags, { - [styles_css_default38.highlighted]: highlightedOption, - [styles_css_default38.selected]: selectedOption - }) }, filteringTags.map((filteringTag, key2) => { - const match2 = filteringTag.toLowerCase().indexOf(searchElement) !== -1; - if (match2) { - return import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38.tag, triggerVariant && styles_css_default38["trigger-variant"]), key: key2, "aria-disabled": true }, - import_react132.default.createElement(HighlightMatch, { str: filteringTag, highlightText }) - ); - } - return null; - })); -}; -var OptionIcon = (props2) => { - if (!props2.name && !props2.url && !props2.svg) { - return null; - } - return import_react132.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38.icon, props2.size === "big" && [styles_css_default38[`icon-size-big`]]) }, - import_react132.default.createElement(internal_default, Object.assign({}, props2)) - ); -}; - -// node_modules/@cloudscape-design/components/internal/components/option/index.js -function validateStringValue(value, propertyName) { - if (typeof value !== "undefined" && typeof value !== "string") { - warnOnce("DropdownOption", `This component only supports string values, but "option.${propertyName}" has ${typeof value} type. The component may work incorrectly.`); - } -} -var Option = (_a2) => { - var _b, _c, _d, _e; - var { option, highlightText, triggerVariant = false, isGroupOption = false, isGenericGroup = true, highlightedOption = false, selectedOption = false } = _a2, restProps = __rest(_a2, ["option", "highlightText", "triggerVariant", "isGroupOption", "isGenericGroup", "highlightedOption", "selectedOption"]); - if (!option) { - return null; - } - const { disabled } = option; - const baseProps = getBaseProps(restProps); - if (isDevelopment2) { - validateStringValue(option.label, "label"); - validateStringValue(option.description, "description"); - validateStringValue(option.labelTag, "labelTag"); - (_b = option.tags) === null || _b === void 0 ? void 0 : _b.forEach((tag, index) => { - validateStringValue(tag, `tags[${index}]`); - }); - (_c = option.filteringTags) === null || _c === void 0 ? void 0 : _c.forEach((tag, index) => { - validateStringValue(tag, `filteringTags[${index}]`); - }); - } - const className2 = clsx_m_default(styles_css_default38.option, disabled && styles_css_default38.disabled, isGroupOption && styles_css_default38.parent, highlightedOption && styles_css_default38.highlighted); - const icon = option.__customIcon || import_react133.default.createElement(OptionIcon, { name: option.iconName, url: option.iconUrl, svg: option.iconSvg, alt: option.iconAlt, size: option.description || option.tags ? "big" : "normal" }); - const genericGroupProps = isGenericGroup ? { - title: (_d = option.label) !== null && _d !== void 0 ? _d : option.value, - "aria-disabled": disabled - } : void 0; - return import_react133.default.createElement( - "span", - Object.assign({ "data-value": option.value, className: className2, lang: option.lang }, genericGroupProps, baseProps), - icon, - import_react133.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38.content) }, - import_react133.default.createElement( - "span", - { className: clsx_m_default(styles_css_default38["label-content"]) }, - import_react133.default.createElement(Label, { label: (_e = option.label) !== null && _e !== void 0 ? _e : option.value, prefix: option.__labelPrefix, highlightText, triggerVariant }), - import_react133.default.createElement(LabelTag, { labelTag: option.labelTag, highlightText, triggerVariant }) - ), - import_react133.default.createElement(Description, { description: option.description, highlightedOption, selectedOption, highlightText, triggerVariant }), - import_react133.default.createElement(Tags, { tags: option.tags, highlightedOption, selectedOption, highlightText, triggerVariant }), - import_react133.default.createElement(FilteringTags, { filteringTags: option.filteringTags, highlightedOption, selectedOption, highlightText, triggerVariant }) - ) - ); -}; -var option_default = Option; - -// node_modules/@cloudscape-design/components/internal/components/selectable-item/index.js -var import_react134 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/selectable-item/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/selectable-item/styles.scoped.css"; -var styles_css_default39 = { - "selectable-item": "awsui_selectable-item_15o6u_1qv14_99", - "pad-bottom": "awsui_pad-bottom_15o6u_1qv14_123", - "has-background": "awsui_has-background_15o6u_1qv14_132", - "highlighted": "awsui_highlighted_15o6u_1qv14_135", - "selected": "awsui_selected_15o6u_1qv14_135", - "disabled": "awsui_disabled_15o6u_1qv14_153", - "next-item-selected": "awsui_next-item-selected_15o6u_1qv14_163", - "is-keyboard": "awsui_is-keyboard_15o6u_1qv14_175", - "parent": "awsui_parent_15o6u_1qv14_179", - "interactiveGroups": "awsui_interactiveGroups_15o6u_1qv14_183", - "child": "awsui_child_15o6u_1qv14_201", - "virtual": "awsui_virtual_15o6u_1qv14_216", - "measure-strut": "awsui_measure-strut_15o6u_1qv14_227", - "measure-strut-first": "awsui_measure-strut-first_15o6u_1qv14_236", - "screenreader-content": "awsui_screenreader-content_15o6u_1qv14_240", - "option-content": "awsui_option-content_15o6u_1qv14_246" -}; - -// node_modules/@cloudscape-design/components/internal/components/selectable-item/index.js -var SelectableItem = (_a2, ref) => { - var { children: content, ariaSelected, ariaChecked, selected, highlighted, disabled, hasBackground, isParent, isChild, virtualPosition, padBottom, isNextSelected, useInteractiveGroups, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a2, restProps = __rest(_a2, ["children", "ariaSelected", "ariaChecked", "selected", "highlighted", "disabled", "hasBackground", "isParent", "isChild", "virtualPosition", "padBottom", "isNextSelected", "useInteractiveGroups", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); - const _b = getBaseProps(restProps), { className: className2 } = _b, rest = __rest(_b, ["className"]); - const classNames = clsx_m_default(className2, styles_css_default39["selectable-item"], { - [styles_css_default39.selected]: selected, - [styles_css_default39.highlighted]: highlighted, - [styles_css_default39["has-background"]]: hasBackground, - [styles_css_default39.parent]: isParent, - [styles_css_default39.child]: isChild, - [styles_css_default39["is-keyboard"]]: highlightType === "keyboard", - [styles_css_default39.disabled]: disabled, - [styles_css_default39.virtual]: virtualPosition !== void 0, - [styles_css_default39["pad-bottom"]]: padBottom, - [styles_css_default39["next-item-selected"]]: isNextSelected, - [styles_css_default39.interactiveGroups]: useInteractiveGroups - }); - const contentRef = (0, import_react134.useRef)(null); - const screenReaderContentRef = (0, import_react134.useRef)(null); - (0, import_react134.useLayoutEffect)(() => { - if (highlighted && screenReaderContent) { - if (contentRef.current) { - contentRef.current.setAttribute("aria-hidden", "true"); - } - if (screenReaderContentRef.current) { - screenReaderContentRef.current.textContent = screenReaderContent; - } - } - }, [highlighted, screenReaderContent, contentRef, screenReaderContentRef]); - const style = virtualPosition !== void 0 ? { - transform: `translateY(${virtualPosition}px)` - } : void 0; - const a11yProperties = { - "aria-disabled": disabled - }; - if (isParent && !useInteractiveGroups) { - a11yProperties["aria-hidden"] = true; - } - if (ariaSelected !== void 0) { - a11yProperties["aria-selected"] = ariaSelected; - } - if (ariaChecked !== void 0) { - a11yProperties["aria-checked"] = ariaChecked; - } - if (ariaPosinset && ariaSetsize) { - a11yProperties["aria-posinset"] = ariaPosinset; - a11yProperties["aria-setsize"] = ariaSetsize; - } - return import_react134.default.createElement( - "li", - Object.assign({ role: "option", className: classNames, style }, a11yProperties, rest), - import_react134.default.createElement("div", { className: styles_css_default39["option-content"], ref: contentRef }, content), - import_react134.default.createElement("div", { className: styles_css_default39["measure-strut"], ref }), - import_react134.default.createElement("div", { className: styles_css_default39["screenreader-content"], ref: screenReaderContentRef }) - ); -}; -var selectable_item_default = import_react134.default.forwardRef(SelectableItem); - -// node_modules/@cloudscape-design/components/internal/components/checkbox-icon/index.js -var import_react135 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/checkbox-icon/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/checkbox-icon/styles.scoped.css"; -var styles_css_default40 = { - "root": "awsui_root_1fn7j_ayb8r_99", - "styled-box": "awsui_styled-box_1fn7j_ayb8r_106", - "styled-box-checked": "awsui_styled-box-checked_1fn7j_ayb8r_112", - "styled-box-indeterminate": "awsui_styled-box-indeterminate_1fn7j_ayb8r_112", - "styled-box-disabled": "awsui_styled-box-disabled_1fn7j_ayb8r_116", - "styled-line": "awsui_styled-line_1fn7j_ayb8r_130", - "styled-line-disabled": "awsui_styled-line-disabled_1fn7j_ayb8r_135" -}; - -// node_modules/@cloudscape-design/components/internal/components/checkbox-icon/index.js -var dimensionsByTheme = { - default: { - viewBox: "0 0 14 14", - indeterminate: "2.5,7 11.5,7", - checked: "2.5,7 6,10 11,3", - xy: 0.5, - r: 1.5, - size: 13 - }, - refresh: { - viewBox: "0 0 16 16", - indeterminate: "3.5,8 12.5,8", - checked: "3.5,8 7,11 12,4", - xy: 1, - r: 2, - size: 14 - } -}; -var CheckboxIcon = (_a2) => { - var { checked, indeterminate, disabled = false } = _a2, restProps = __rest(_a2, ["checked", "indeterminate", "disabled"]); - const baseProps = getBaseProps(restProps); - const theme2 = useVisualRefresh() ? "refresh" : "default"; - const dimensions = dimensionsByTheme[theme2]; - return import_react135.default.createElement( - "svg", - Object.assign({ className: styles_css_default40.root, viewBox: dimensions.viewBox, "aria-hidden": "true", focusable: "false" }, baseProps), - import_react135.default.createElement("rect", { className: clsx_m_default(styles_css_default40["styled-box"], { - [styles_css_default40["styled-box-checked"]]: checked, - [styles_css_default40["styled-box-indeterminate"]]: indeterminate, - [styles_css_default40["styled-box-disabled"]]: disabled - }), x: dimensions.xy, y: dimensions.xy, rx: dimensions.r, ry: dimensions.r, width: dimensions.size, height: dimensions.size }), - checked || indeterminate ? import_react135.default.createElement("polyline", { className: clsx_m_default(styles_css_default40["styled-line"], { [styles_css_default40["styled-line-disabled"]]: disabled }), points: indeterminate ? dimensions.indeterminate : dimensions.checked }) : null - ); -}; -var checkbox_icon_default = CheckboxIcon; - -// node_modules/@cloudscape-design/components/select/parts/item.js -var Item = (_a2, ref) => { - var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a2, restProps = __rest(_a2, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); - const baseProps = getBaseProps(restProps); - const isParent = option.type === "parent"; - const isChild = option.type === "child"; - const wrappedOption = option.option; - const disabled = option.disabled || wrappedOption.disabled; - return import_react136.default.createElement( - selectable_item_default, - Object.assign({ ariaSelected: Boolean(selected), selected, isNextSelected, highlighted, disabled: option.disabled, isParent, isChild, ref, virtualPosition, padBottom, screenReaderContent, ariaPosinset, ariaSetsize, highlightType }, baseProps), - import_react136.default.createElement( - "div", - { className: clsx_m_default(styles_css_default37.item, !isParent && wrappedOption.labelTag && styles_css_default37["show-label-tag"]) }, - hasCheckbox && !isParent && import_react136.default.createElement( - "div", - { className: styles_css_default37.checkbox }, - import_react136.default.createElement(checkbox_icon_default, { checked: selected || false, disabled: option.disabled }) - ), - isParent ? import_react136.default.createElement("span", null, wrappedOption.label || wrappedOption.value) : import_react136.default.createElement(option_default, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue }), - !hasCheckbox && !isParent && selected && import_react136.default.createElement( - "div", - { className: styles_css_default37["selected-icon"] }, - import_react136.default.createElement(internal_default, { name: "check" }) - ) - ) - ); -}; -var item_default = import_react136.default.memo(import_react136.default.forwardRef(Item)); - -// node_modules/@cloudscape-design/components/select/parts/multiselect-item.js -var import_react137 = __toESM(require_react()); -var MultiSelectItem = (_a2, ref) => { - var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a2, restProps = __rest(_a2, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); - const baseProps = getBaseProps(restProps); - const isParent = option.type === "parent"; - const isChild = option.type === "child"; - const wrappedOption = option.option; - const disabled = option.disabled || wrappedOption.disabled; - const className2 = clsx_m_default(styles_css_default37.item, { - [styles_css_default37.disabled]: disabled - }); - return import_react137.default.createElement( - selectable_item_default, - Object.assign({ ariaChecked: isParent && indeterminate ? "mixed" : Boolean(selected), selected, isNextSelected, highlighted, disabled, isParent, isChild, highlightType, ref, virtualPosition, padBottom, useInteractiveGroups: true, screenReaderContent, ariaPosinset, ariaSetsize }, baseProps), - import_react137.default.createElement( - "div", - { className: className2 }, - hasCheckbox && import_react137.default.createElement( - "div", - { className: styles_css_default37.checkbox }, - import_react137.default.createElement(checkbox_icon_default, { checked: selected, indeterminate: isParent && indeterminate, disabled: option.disabled }) - ), - import_react137.default.createElement(option_default, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent }) - ) - ); -}; -var multiselect_item_default = import_react137.default.memo(import_react137.default.forwardRef(MultiSelectItem)); - -// node_modules/@cloudscape-design/components/select/utils/get-item-props.js -var getItemProps = ({ option, index, getOptionProps: getOptionProps2, filteringValue, checkboxes = false }) => { - const optionProps = getOptionProps2(option, index); - optionProps.filteringValue = filteringValue; - const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {}; - return Object.assign(Object.assign({}, optionProps), { hasCheckbox: checkboxes, ["data-group-index"]: groupIndex, ["data-child-index"]: inGroupIndex, ["data-test-index"]: throughIndex }); -}; - -// node_modules/@cloudscape-design/components/select/utils/render-options.js -var renderOptions = ({ options, getOptionProps: getOptionProps2, filteringValue, highlightType, checkboxes = false, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize }) => { - return options.map((option, index) => { - const virtualItem = virtualItems && virtualItems[index]; - const globalIndex = virtualItem ? virtualItem.index : index; - const props2 = getItemProps({ - option, - index: globalIndex, - getOptionProps: getOptionProps2, - filteringValue, - checkboxes - }); - const isLastItem = index === options.length - 1; - const padBottom = !hasDropdownStatus && isLastItem; - const ListItem2 = useInteractiveGroups ? multiselect_item_default : item_default; - return import_react138.default.createElement(ListItem2, Object.assign({ key: globalIndex }, props2, { virtualPosition: virtualItem && virtualItem.start, ref: virtualItem && virtualItem.measureRef, padBottom, screenReaderContent, ariaPosinset: globalIndex + 1, ariaSetsize, highlightType: highlightType.type })); - }); -}; - -// node_modules/@cloudscape-design/components/select/parts/plain-list.js -var PlainList = ({ menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent }, ref) => { - const menuRef = menuProps.ref; - (0, import_react139.useImperativeHandle)(ref, () => (index) => { - var _a2; - const item = (_a2 = menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`[data-mouse-target="${index}"]`); - if (highlightType.moveFocus && item) { - scrollElementIntoView(item); - } - }, [highlightType, menuRef]); - return import_react139.default.createElement( - options_list_default, - Object.assign({}, menuProps), - renderOptions({ - options: filteredOptions, - getOptionProps: getOptionProps2, - filteringValue, - highlightType, - checkboxes, - hasDropdownStatus, - useInteractiveGroups, - screenReaderContent - }), - listBottom ? import_react139.default.createElement("li", { role: "option", className: styles_css_default37["list-bottom"] }, listBottom) : null - ); -}; -var plain_list_default = (0, import_react139.forwardRef)(PlainList); - -// node_modules/@cloudscape-design/components/select/parts/virtual-list.js -var import_react142 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/use-virtual/index.js -var import_react141 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/vendor/react-virtual.js -var import_react140 = __toESM(require_react()); -function _extends2() { - _extends2 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - return _extends2.apply(this, arguments); -} -function _objectWithoutPropertiesLoose2(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key2, i; - for (i = 0; i < sourceKeys.length; i++) { - key2 = sourceKeys[i]; - if (excluded.indexOf(key2) >= 0) continue; - target[key2] = source[key2]; - } - return target; -} -var props = ["bottom", "height", "left", "right", "top", "width"]; -var rectChanged = function rectChanged2(a2, b) { - if (a2 === void 0) { - a2 = {}; - } - if (b === void 0) { - b = {}; - } - return props.some(function(prop) { - return a2[prop] !== b[prop]; - }); -}; -var observedNodes = /* @__PURE__ */ new Map(); -var rafId; -var run = function run2() { - var changedStates = []; - observedNodes.forEach(function(state, node) { - var newRect = node.getBoundingClientRect(); - if (rectChanged(newRect, state.rect)) { - state.rect = newRect; - changedStates.push(state); - } - }); - changedStates.forEach(function(state) { - state.callbacks.forEach(function(cb) { - return cb(state.rect); - }); - }); - rafId = window.requestAnimationFrame(run2); -}; -function observeRect(node, cb) { - return { - observe: function observe() { - var wasEmpty = observedNodes.size === 0; - if (observedNodes.has(node)) { - observedNodes.get(node).callbacks.push(cb); - } else { - observedNodes.set(node, { - rect: void 0, - hasRectChanged: false, - callbacks: [cb] - }); - } - if (wasEmpty) run(); - }, - unobserve: function unobserve() { - var state = observedNodes.get(node); - if (state) { - var index = state.callbacks.indexOf(cb); - if (index >= 0) state.callbacks.splice(index, 1); - if (!state.callbacks.length) observedNodes["delete"](node); - if (!observedNodes.size) cancelAnimationFrame(rafId); - } - } - }; -} -var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react140.default.useLayoutEffect : import_react140.default.useEffect; -function useRect(nodeRef, initialRect) { - if (initialRect === void 0) { - initialRect = { - width: 0, - height: 0 - }; - } - var _React$useState = import_react140.default.useState(nodeRef.current), element = _React$useState[0], setElement = _React$useState[1]; - var _React$useReducer = import_react140.default.useReducer(rectReducer, initialRect), rect = _React$useReducer[0], dispatch = _React$useReducer[1]; - var initialRectSet = import_react140.default.useRef(false); - useIsomorphicLayoutEffect(function() { - if (nodeRef.current !== element) { - setElement(nodeRef.current); - } - }); - useIsomorphicLayoutEffect(function() { - if (element && !initialRectSet.current) { - initialRectSet.current = true; - var _rect = element.getBoundingClientRect(); - dispatch({ - rect: _rect - }); - } - }, [element]); - import_react140.default.useEffect(function() { - if (!element) { - return; - } - var observer = observeRect(element, function(rect2) { - dispatch({ - rect: rect2 - }); - }); - observer.observe(); - return function() { - observer.unobserve(); - }; - }, [element]); - return rect; -} -function rectReducer(state, action) { - var rect = action.rect; - if (state.height !== rect.height || state.width !== rect.width) { - return rect; - } - return state; -} -var defaultEstimateSize = function defaultEstimateSize2() { - return 50; -}; -var defaultKeyExtractor = function defaultKeyExtractor2(index) { - return index; -}; -var defaultMeasureSize = function defaultMeasureSize2(el, horizontal) { - var key2 = horizontal ? "offsetWidth" : "offsetHeight"; - return el[key2]; -}; -var defaultRangeExtractor = function defaultRangeExtractor2(range3) { - var start = Math.max(range3.start - range3.overscan, 0); - var end = Math.min(range3.end + range3.overscan, range3.size - 1); - var arr = []; - for (var i = start; i <= end; i++) { - arr.push(i); - } - return arr; -}; -function useVirtual(_ref) { - var _measurements; - var _ref$size = _ref.size, size2 = _ref$size === void 0 ? 0 : _ref$size, _ref$estimateSize = _ref.estimateSize, estimateSize = _ref$estimateSize === void 0 ? defaultEstimateSize : _ref$estimateSize, _ref$overscan = _ref.overscan, overscan = _ref$overscan === void 0 ? 1 : _ref$overscan, _ref$paddingStart = _ref.paddingStart, paddingStart = _ref$paddingStart === void 0 ? 0 : _ref$paddingStart, _ref$paddingEnd = _ref.paddingEnd, paddingEnd = _ref$paddingEnd === void 0 ? 0 : _ref$paddingEnd, parentRef = _ref.parentRef, horizontal = _ref.horizontal, scrollToFn = _ref.scrollToFn, useObserver = _ref.useObserver, initialRect = _ref.initialRect, onScrollElement = _ref.onScrollElement, scrollOffsetFn = _ref.scrollOffsetFn, _ref$keyExtractor = _ref.keyExtractor, keyExtractor = _ref$keyExtractor === void 0 ? defaultKeyExtractor : _ref$keyExtractor, _ref$measureSize = _ref.measureSize, measureSize = _ref$measureSize === void 0 ? defaultMeasureSize : _ref$measureSize, _ref$rangeExtractor = _ref.rangeExtractor, rangeExtractor = _ref$rangeExtractor === void 0 ? defaultRangeExtractor : _ref$rangeExtractor; - var sizeKey = horizontal ? "width" : "height"; - var scrollKey = horizontal ? "scrollLeft" : "scrollTop"; - var latestRef = import_react140.default.useRef({ - scrollOffset: 0, - measurements: [] - }); - var _React$useState = import_react140.default.useState(0), scrollOffset = _React$useState[0], setScrollOffset = _React$useState[1]; - latestRef.current.scrollOffset = scrollOffset; - var useMeasureParent = useObserver || useRect; - var _useMeasureParent = useMeasureParent(parentRef, initialRect), outerSize = _useMeasureParent[sizeKey]; - latestRef.current.outerSize = outerSize; - var defaultScrollToFn = import_react140.default.useCallback(function(offset) { - if (parentRef.current) { - parentRef.current[scrollKey] = offset; - } - }, [parentRef, scrollKey]); - var resolvedScrollToFn = scrollToFn || defaultScrollToFn; - scrollToFn = import_react140.default.useCallback(function(offset) { - resolvedScrollToFn(offset, defaultScrollToFn); - }, [defaultScrollToFn, resolvedScrollToFn]); - var _React$useState2 = import_react140.default.useState({}), measuredCache = _React$useState2[0], setMeasuredCache = _React$useState2[1]; - var measure = import_react140.default.useCallback(function() { - return setMeasuredCache({}); - }, []); - var pendingMeasuredCacheIndexesRef = import_react140.default.useRef([]); - var measurements = import_react140.default.useMemo(function() { - var min3 = pendingMeasuredCacheIndexesRef.current.length > 0 ? Math.min.apply(Math, pendingMeasuredCacheIndexesRef.current) : 0; - pendingMeasuredCacheIndexesRef.current = []; - var measurements2 = latestRef.current.measurements.slice(0, min3); - for (var i = min3; i < size2; i++) { - var key2 = keyExtractor(i); - var measuredSize = measuredCache[key2]; - var _start = measurements2[i - 1] ? measurements2[i - 1].end : paddingStart; - var _size = typeof measuredSize === "number" ? measuredSize : estimateSize(i); - var _end = _start + _size; - measurements2[i] = { - index: i, - start: _start, - size: _size, - end: _end, - key: key2 - }; - } - return measurements2; - }, [estimateSize, measuredCache, paddingStart, size2, keyExtractor]); - var totalSize = (((_measurements = measurements[size2 - 1]) == null ? void 0 : _measurements.end) || paddingStart) + paddingEnd; - latestRef.current.measurements = measurements; - latestRef.current.totalSize = totalSize; - var element = onScrollElement ? onScrollElement.current : parentRef.current; - var scrollOffsetFnRef = import_react140.default.useRef(scrollOffsetFn); - scrollOffsetFnRef.current = scrollOffsetFn; - useIsomorphicLayoutEffect(function() { - if (!element) { - setScrollOffset(0); - return; - } - var onScroll = function onScroll2(event) { - var offset = scrollOffsetFnRef.current ? scrollOffsetFnRef.current(event) : element[scrollKey]; - setScrollOffset(offset); - }; - onScroll(); - element.addEventListener("scroll", onScroll, { - capture: false, - passive: true - }); - return function() { - element.removeEventListener("scroll", onScroll); - }; - }, [element, scrollKey]); - var _calculateRange = calculateRange(latestRef.current), start = _calculateRange.start, end = _calculateRange.end; - var indexes = import_react140.default.useMemo(function() { - return rangeExtractor({ - start, - end, - overscan, - size: measurements.length - }); - }, [start, end, overscan, measurements.length, rangeExtractor]); - var measureSizeRef = import_react140.default.useRef(measureSize); - measureSizeRef.current = measureSize; - var virtualItems = import_react140.default.useMemo(function() { - var virtualItems2 = []; - var _loop = function _loop2(k3, len2) { - var i = indexes[k3]; - var measurement = measurements[i]; - var item = _extends2(_extends2({}, measurement), {}, { - measureRef: function measureRef(el) { - if (el) { - var measuredSize = measureSizeRef.current(el, horizontal); - if (measuredSize !== item.size) { - var _scrollOffset = latestRef.current.scrollOffset; - if (item.start < _scrollOffset) { - defaultScrollToFn(_scrollOffset + (measuredSize - item.size)); - } - pendingMeasuredCacheIndexesRef.current.push(i); - setMeasuredCache(function(old) { - var _extends22; - return _extends2(_extends2({}, old), {}, (_extends22 = {}, _extends22[item.key] = measuredSize, _extends22)); - }); - } - } - } - }); - virtualItems2.push(item); - }; - for (var k2 = 0, len = indexes.length; k2 < len; k2++) { - _loop(k2); - } - return virtualItems2; - }, [indexes, defaultScrollToFn, horizontal, measurements]); - var mountedRef = import_react140.default.useRef(false); - useIsomorphicLayoutEffect(function() { - if (mountedRef.current) { - setMeasuredCache({}); - } - mountedRef.current = true; - }, [estimateSize]); - var scrollToOffset = import_react140.default.useCallback(function(toOffset, _temp) { - var _ref2 = _temp === void 0 ? {} : _temp, _ref2$align = _ref2.align, align = _ref2$align === void 0 ? "start" : _ref2$align; - var _latestRef$current = latestRef.current, scrollOffset2 = _latestRef$current.scrollOffset, outerSize2 = _latestRef$current.outerSize; - if (align === "auto") { - if (toOffset <= scrollOffset2) { - align = "start"; - } else if (toOffset >= scrollOffset2 + outerSize2) { - align = "end"; - } else { - align = "start"; - } - } - if (align === "start") { - scrollToFn(toOffset); - } else if (align === "end") { - scrollToFn(toOffset - outerSize2); - } else if (align === "center") { - scrollToFn(toOffset - outerSize2 / 2); - } - }, [scrollToFn]); - var tryScrollToIndex = import_react140.default.useCallback(function(index, _temp2) { - var _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$align = _ref3.align, align = _ref3$align === void 0 ? "auto" : _ref3$align, rest = _objectWithoutPropertiesLoose2(_ref3, ["align"]); - var _latestRef$current2 = latestRef.current, measurements2 = _latestRef$current2.measurements, scrollOffset2 = _latestRef$current2.scrollOffset, outerSize2 = _latestRef$current2.outerSize; - var measurement = measurements2[Math.max(0, Math.min(index, size2 - 1))]; - if (!measurement) { - return; - } - if (align === "auto") { - if (measurement.end >= scrollOffset2 + outerSize2) { - align = "end"; - } else if (measurement.start <= scrollOffset2) { - align = "start"; - } else { - return; - } - } - var toOffset = align === "center" ? measurement.start + measurement.size / 2 : align === "end" ? measurement.end : measurement.start; - scrollToOffset(toOffset, _extends2({ - align - }, rest)); - }, [scrollToOffset, size2]); - var scrollToIndex = import_react140.default.useCallback(function() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - tryScrollToIndex.apply(void 0, args); - requestAnimationFrame(function() { - tryScrollToIndex.apply(void 0, args); - }); - }, [tryScrollToIndex]); - return { - virtualItems, - totalSize, - scrollToOffset, - scrollToIndex, - measure - }; -} -var findNearestBinarySearch = function findNearestBinarySearch2(low, high, getCurrentValue, value) { - while (low <= high) { - var middle = (low + high) / 2 | 0; - var currentValue = getCurrentValue(middle); - if (currentValue < value) { - low = middle + 1; - } else if (currentValue > value) { - high = middle - 1; - } else { - return middle; - } - } - if (low > 0) { - return low - 1; - } else { - return 0; - } -}; -function calculateRange(_ref4) { - var measurements = _ref4.measurements, outerSize = _ref4.outerSize, scrollOffset = _ref4.scrollOffset; - var size2 = measurements.length - 1; - var getOffset = function getOffset2(index) { - return measurements[index].start; - }; - var start = findNearestBinarySearch(0, size2, getOffset, scrollOffset); - var end = start; - while (end < size2 && measurements[end].end < scrollOffset + outerSize) { - end++; - } - return { - start, - end - }; -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-virtual/index.js -var MAX_ITEM_MOUNTS = 100; -function useVirtual2({ items, parentRef, estimateSize }) { - const rowVirtualizer = useVirtual({ size: items.length, parentRef, estimateSize, overscan: 5 }); - const measuresCache = (0, import_react141.useRef)(/* @__PURE__ */ new WeakMap()); - const indicesKey = rowVirtualizer.virtualItems.map((item) => `${item.index}`).join(":"); - (0, import_react141.useEffect)(() => { - measuresCache.current = /* @__PURE__ */ new WeakMap(); - }, [indicesKey, items, estimateSize]); - const virtualItems = (0, import_react141.useMemo)(() => rowVirtualizer.virtualItems.map((virtualItem) => Object.assign(Object.assign({}, virtualItem), { measureRef: (node) => { - var _a2; - const mountedCount = (_a2 = measuresCache.current.get(items[virtualItem.index])) !== null && _a2 !== void 0 ? _a2 : 0; - if (mountedCount < MAX_ITEM_MOUNTS) { - virtualItem.measureRef(node); - measuresCache.current.set(items[virtualItem.index], mountedCount + 1); - } - } })), [items, rowVirtualizer.virtualItems]); - return { - virtualItems, - totalSize: rowVirtualizer.totalSize, - scrollToIndex: rowVirtualizer.scrollToIndex - }; -} - -// node_modules/@cloudscape-design/components/select/parts/virtual-list.js -var VirtualList = (props2, ref) => { - return props2.menuProps.open ? import_react142.default.createElement(VirtualListOpen, Object.assign({}, props2, { ref })) : import_react142.default.createElement(VirtualListClosed, Object.assign({}, props2, { ref })); -}; -var VirtualListOpen = (0, import_react142.forwardRef)(({ menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent }, ref) => { - const [width, menuMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth, []); - const menuRefObject = (0, import_react142.useRef)(null); - const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref); - const { virtualItems, totalSize, scrollToIndex } = useVirtual2({ - items: filteredOptions, - parentRef: menuRefObject, - // estimateSize is a dependency of measurements memo. We update it to force full recalculation - // when the height of any option could have changed: - // 1: because the component got resized (width property got updated) - // 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags) - // eslint-disable-next-line react-hooks/exhaustive-deps - estimateSize: (0, import_react142.useCallback)(() => 31, [width, filteringValue]) - }); - (0, import_react142.useImperativeHandle)(ref, () => (index) => { - if (highlightType.moveFocus) { - scrollToIndex(index); - } - }, [highlightType, scrollToIndex]); - const finalOptions = renderOptions({ - options: virtualItems.map(({ index }) => filteredOptions[index]), - getOptionProps: getOptionProps2, - filteringValue, - highlightType, - checkboxes, - hasDropdownStatus, - virtualItems, - useInteractiveGroups, - screenReaderContent, - ariaSetsize: filteredOptions.length - }); - return import_react142.default.createElement( - options_list_default, - Object.assign({}, menuProps, { ref: menuRef }), - import_react142.default.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles_css_default37["layout-strut"], style: { height: totalSize } }), - finalOptions, - listBottom ? import_react142.default.createElement("li", { role: "option", className: styles_css_default37["list-bottom"] }, listBottom) : null - ); -}); -var VirtualListClosed = (0, import_react142.forwardRef)(({ menuProps, listBottom }, ref) => { - (0, import_react142.useImperativeHandle)(ref, () => () => { - }, []); - return import_react142.default.createElement(options_list_default, Object.assign({}, menuProps, { ref: menuProps.ref }), listBottom ? import_react142.default.createElement("li", { role: "option", className: styles_css_default37["list-bottom"] }, listBottom) : null); -}); -var virtual_list_default = (0, import_react142.forwardRef)(VirtualList); - -// node_modules/@cloudscape-design/components/select/utils/check-option-value-field.js -function checkOptionValueField(componentName3, propertyName, propertyValue) { - if (isDevelopment2) { - if (!propertyValue) { - return; - } - const valuePropertyMissing = !propertyValue.every((element) => { - return "options" in element || "value" in element; - }); - if (valuePropertyMissing) { - warnOnce(componentName3, `You provided an \`${propertyName}\` prop where at least one non-group array element is missing the \`value\` field. This field is required for all options without sub-items.`); - } - } -} - -// node_modules/@cloudscape-design/components/select/parts/filter.js -var import_react145 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/input/internal.js -var import_react144 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/input/utils.js -var import_react143 = __toESM(require_react()); -var useSearchProps = (type, disabled, readOnly, value, inputRef, onChange) => { - const searchProps = {}; - const handleIconClick = (0, import_react143.useCallback)(() => { - var _a2; - (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - onChange(""); - }, [inputRef, onChange]); - if (type === "search" || type === "visualSearch") { - searchProps.__leftIcon = "search"; - if (!disabled && !readOnly && value) { - searchProps.__rightIcon = "close"; - searchProps.__onRightIconClick = handleIconClick; - } - } - return searchProps; -}; -var convertAutoComplete = (propertyValue = false) => { - if (propertyValue === true) { - return "on"; - } - return propertyValue || "off"; -}; - -// node_modules/@cloudscape-design/components/input/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/input/styles.scoped.css"; -var styles_css_default41 = { - "root": "awsui_root_2rhyz_15wpl_99", - "input": "awsui_input_2rhyz_15wpl_103", - "input-readonly": "awsui_input-readonly_2rhyz_15wpl_153", - "input-invalid": "awsui_input-invalid_2rhyz_15wpl_220", - "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_15wpl_231", - "input-type-search": "awsui_input-type-search_2rhyz_15wpl_236", - "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_15wpl_252", - "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_15wpl_255", - "input-container": "awsui_input-container_2rhyz_15wpl_262", - "input-icon-left": "awsui_input-icon-left_2rhyz_15wpl_267", - "input-icon-right": "awsui_input-icon-right_2rhyz_15wpl_274", - "input-button-right": "awsui_input-button-right_2rhyz_15wpl_280" -}; - -// node_modules/@cloudscape-design/components/input/internal.js -function InternalInput(_a2, ref) { - var { type = "text", step: step2, inputMode, autoComplete = true, ariaLabel, clearAriaLabel: clearAriaLabelOverride, name, value, placeholder, autoFocus, disabled, readOnly, disableBrowserAutocorrect, spellcheck, __noBorderRadius, __leftIcon, __leftIconVariant = "subtle", __onLeftIconClick, ariaRequired, __rightIcon, __onRightIconClick, onKeyDown, onKeyUp, onChange, __onDelayedInput, __onBlurWithDetail, onBlur, onFocus, __nativeAttributes, __internalRootRef, __inheritFormFieldProps } = _a2, rest = __rest(_a2, ["type", "step", "inputMode", "autoComplete", "ariaLabel", "clearAriaLabel", "name", "value", "placeholder", "autoFocus", "disabled", "readOnly", "disableBrowserAutocorrect", "spellcheck", "__noBorderRadius", "__leftIcon", "__leftIconVariant", "__onLeftIconClick", "ariaRequired", "__rightIcon", "__onRightIconClick", "onKeyDown", "onKeyUp", "onChange", "__onDelayedInput", "__onBlurWithDetail", "onBlur", "onFocus", "__nativeAttributes", "__internalRootRef", "__inheritFormFieldProps"]); - const baseProps = getBaseProps(rest); - const i18n = useInternalI18n("input"); - const fireDelayedInput = useDebounceCallback((value2) => fireNonCancelableEvent(__onDelayedInput, { value: value2 })); - const handleChange = (value2) => { - fireDelayedInput(value2); - fireNonCancelableEvent(onChange, { value: value2 }); - }; - const inputRef = (0, import_react144.useRef)(null); - const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange); - __leftIcon = __leftIcon !== null && __leftIcon !== void 0 ? __leftIcon : searchProps.__leftIcon; - __rightIcon = __rightIcon !== null && __rightIcon !== void 0 ? __rightIcon : searchProps.__rightIcon; - __onRightIconClick = __onRightIconClick !== null && __onRightIconClick !== void 0 ? __onRightIconClick : searchProps.__onRightIconClick; - const formFieldContext = useFormFieldContext(rest); - const { ariaLabelledby, ariaDescribedby, controlId, invalid } = __inheritFormFieldProps ? formFieldContext : rest; - const attributes = Object.assign({ - "aria-label": ariaLabel, - // aria-labelledby has precedence over aria-label in accessible name calculation. - // When aria-label is provided for Input, it should override aria-labelledBy from form-field context. - // If both aria-label and aria-labelledby come from Input props, aria-labelledby will be used in accessible name - "aria-labelledby": ariaLabel && !rest.ariaLabelledby ? void 0 : ariaLabelledby, - "aria-describedby": ariaDescribedby, - name, - placeholder, - autoFocus, - id: controlId, - className: clsx_m_default(styles_css_default41.input, type && styles_css_default41[`input-type-${type}`], __rightIcon && styles_css_default41["input-has-icon-right"], __leftIcon && styles_css_default41["input-has-icon-left"], __noBorderRadius && styles_css_default41["input-has-no-border-radius"], { - [styles_css_default41["input-readonly"]]: readOnly, - [styles_css_default41["input-invalid"]]: invalid - }), - autoComplete: convertAutoComplete(autoComplete), - disabled, - readOnly, - type, - step: step2, - inputMode, - spellCheck: spellcheck, - onKeyDown: onKeyDown && ((event) => fireKeyboardEvent(onKeyDown, event)), - onKeyUp: onKeyUp && ((event) => fireKeyboardEvent(onKeyUp, event)), - // We set a default value on the component in order to force it into the controlled mode. - value: value !== null && value !== void 0 ? value : "", - onChange: onChange && ((event) => handleChange(event.target.value)), - onBlur: (e) => { - onBlur && fireNonCancelableEvent(onBlur); - __onBlurWithDetail && fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: e.relatedTarget }); - }, - onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)) - }, __nativeAttributes); - if (type === "number") { - attributes.onWheel = (event) => event.currentTarget.blur(); - } - if (disableBrowserAutocorrect) { - attributes.autoCorrect = "off"; - attributes.autoCapitalize = "off"; - } - if (ariaRequired) { - attributes["aria-required"] = "true"; - } - if (invalid) { - attributes["aria-invalid"] = "true"; - } - const mergedRef = useMergeRefs(ref, inputRef); - if (attributes.type === "visualSearch") { - attributes.type = "text"; - } - return import_react144.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default41["input-container"]), ref: __internalRootRef }), - __leftIcon && import_react144.default.createElement( - "span", - { onClick: __onLeftIconClick, className: styles_css_default41["input-icon-left"] }, - import_react144.default.createElement(internal_default, { name: __leftIcon, variant: disabled || readOnly ? "disabled" : __leftIconVariant }) - ), - import_react144.default.createElement("input", Object.assign({ ref: mergedRef }, attributes)), - __rightIcon && import_react144.default.createElement( - "span", - { className: styles_css_default41["input-icon-right"] }, - import_react144.default.createElement( - internal_default2, - { - // Used for test utils - // eslint-disable-next-line react/forbid-component-props - className: styles_css_default41["input-button-right"], - variant: "inline-icon", - formAction: "none", - iconName: __rightIcon, - onClick: __onRightIconClick, - ariaLabel: i18n("clearAriaLabel", clearAriaLabelOverride), - disabled - } - ) - ) - ); -} -var internal_default7 = import_react144.default.forwardRef(InternalInput); - -// node_modules/@cloudscape-design/components/select/parts/filter.js -var Filter = import_react145.default.forwardRef((_a2, ref) => { - var { filteringType } = _a2, filterProps = __rest(_a2, ["filteringType"]); - if (filteringType === "none") { - return null; - } - return import_react145.default.createElement(internal_default7, Object.assign({ ref, type: "visualSearch", className: styles_css_default37.filter, autoComplete: false, disableBrowserAutocorrect: true, invalid: false, __noBorderRadius: true }, filterProps, { __nativeAttributes: Object.assign({ "aria-expanded": true, "aria-haspopup": true, role: "combobox", autoCorrect: "off", autoCapitalize: "off" }, filterProps.__nativeAttributes) })); -}); -var filter_default = Filter; - -// node_modules/@cloudscape-design/components/select/parts/trigger.js -var import_react147 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/button-trigger/index.js -var import_react146 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/button-trigger/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/button-trigger/styles.scoped.css"; -var styles_css_default42 = { - "button-trigger": "awsui_button-trigger_18eso_syr88_103", - "arrow": "awsui_arrow_18eso_syr88_103", - "has-caret": "awsui_has-caret_18eso_syr88_170", - "placeholder": "awsui_placeholder_18eso_syr88_173", - "pressed": "awsui_pressed_18eso_syr88_186", - "disabled": "awsui_disabled_18eso_syr88_189", - "in-filtering-token": "awsui_in-filtering-token_18eso_syr88_199", - "read-only": "awsui_read-only_18eso_syr88_205", - "invalid": "awsui_invalid_18eso_syr88_227", - "inline-tokens": "awsui_inline-tokens_18eso_syr88_265" -}; - -// node_modules/@cloudscape-design/components/internal/components/button-trigger/index.js -var ButtonTrigger = (_a2, ref) => { - var { children: children2, pressed = false, hideCaret = false, disabled = false, readOnly = false, invalid = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, autoFocus } = _a2, restProps = __rest(_a2, ["children", "pressed", "hideCaret", "disabled", "readOnly", "invalid", "inlineTokens", "inFilteringToken", "ariaHasPopup", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaControls", "onKeyDown", "onKeyUp", "onMouseDown", "onClick", "onFocus", "onBlur", "autoFocus"]); - const baseProps = getBaseProps(restProps); - const attributes = Object.assign(Object.assign({}, baseProps), { type: "button", className: clsx_m_default(styles_css_default42["button-trigger"], baseProps.className, pressed && styles_css_default42.pressed, disabled && styles_css_default42.disabled, invalid && styles_css_default42.invalid, !hideCaret && styles_css_default42["has-caret"], readOnly && styles_css_default42["read-only"], inFilteringToken && styles_css_default42["in-filtering-token"], inlineTokens && styles_css_default42["inline-tokens"]), disabled: disabled || readOnly, "aria-expanded": pressed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-haspopup": ariaHasPopup !== null && ariaHasPopup !== void 0 ? ariaHasPopup : "listbox", "aria-controls": ariaControls, onKeyDown: onKeyDown && ((event) => fireKeyboardEvent(onKeyDown, event)), onKeyUp: onKeyUp && ((event) => fireKeyboardEvent(onKeyUp, event)), onMouseDown: onMouseDown && ((event) => fireCancelableEvent(onMouseDown, {}, event)), onClick: onClick && ((event) => fireCancelableEvent(onClick, {}, event)), onFocus: onFocus && ((event) => fireCancelableEvent(onFocus, {}, event)), onBlur: onBlur && ((event) => fireCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }, event)), autoFocus }); - if (invalid) { - attributes["aria-invalid"] = invalid; - } - return import_react146.default.createElement( - "button", - Object.assign({ ref }, attributes), - children2, - !hideCaret && import_react146.default.createElement( - "span", - { className: styles_css_default42.arrow }, - import_react146.default.createElement(internal_default, { name: "caret-down-filled", variant: disabled ? "disabled" : "normal" }) - ) - ); -}; -var button_trigger_default = import_react146.default.forwardRef(ButtonTrigger); - -// node_modules/@cloudscape-design/components/select/parts/trigger.js -var Trigger = import_react147.default.forwardRef(({ ariaLabelledby, ariaDescribedby, controlId, invalid, triggerProps, selectedOption, selectedOptions, triggerVariant, inFilteringToken, isOpen, placeholder, disabled }, ref) => { - const isVisualRefresh = useVisualRefresh(); - const generatedId = useUniqueId(); - const id = controlId !== null && controlId !== void 0 ? controlId : generatedId; - const triggerContentId = useUniqueId("trigger-content-"); - let ariaLabelledbyIds = joinStrings(ariaLabelledby, triggerContentId); - let triggerContent = null; - if (triggerVariant === "tokens") { - if (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) { - triggerContent = import_react147.default.createElement( - "span", - { className: clsx_m_default(styles_css_default37["inline-token-trigger"], disabled && styles_css_default37["inline-token-trigger--disabled"], isVisualRefresh && styles_css_default37["visual-refresh"]) }, - import_react147.default.createElement("span", { className: styles_css_default37["inline-token-list"] }, selectedOptions.map(({ label }, i) => import_react147.default.createElement("span", { key: i, className: styles_css_default37["inline-token"] }, label))), - import_react147.default.createElement( - "span", - { className: styles_css_default37["inline-token-counter"], id: triggerContentId }, - import_react147.default.createElement("span", { className: styles_css_default37["inline-token-hidden-placeholder"] }, placeholder), - import_react147.default.createElement( - "span", - null, - "(", - selectedOptions.length, - ")" - ) - ) - ); - ariaLabelledbyIds = ariaLabelledby; - } else { - triggerContent = import_react147.default.createElement("span", { "aria-disabled": "true", className: clsx_m_default(styles_css_default37.placeholder, styles_css_default37.trigger), id: triggerContentId }, placeholder); - } - } else if (!selectedOption) { - triggerContent = import_react147.default.createElement("span", { "aria-disabled": "true", className: clsx_m_default(styles_css_default37.placeholder, styles_css_default37.trigger), id: triggerContentId }, placeholder); - } else if (triggerVariant === "option") { - triggerContent = import_react147.default.createElement(option_default, { id: triggerContentId, option: Object.assign(Object.assign({}, selectedOption), { disabled }), triggerVariant: true }); - } else { - triggerContent = import_react147.default.createElement("span", { id: triggerContentId, className: styles_css_default37.trigger }, selectedOption.label || selectedOption.value); - } - const mergedRef = useMergeRefs(triggerProps.ref, ref); - return import_react147.default.createElement(button_trigger_default, Object.assign({}, triggerProps, { id, ref: mergedRef, pressed: isOpen, disabled, invalid, inFilteringToken, inlineTokens: triggerVariant === "tokens", ariaDescribedby, ariaLabelledby: ariaLabelledbyIds }), triggerContent); -}); -var trigger_default = Trigger; - -// node_modules/@cloudscape-design/components/token-group/internal.js -var import_react153 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/check-controlled/index.js -function checkControlled(componentName3, propertyName, propertyValue, handlerName, handlerValue) { - if (propertyValue !== void 0 && handlerValue === void 0 && isDevelopment2) { - warnOnce(componentName3, `You provided \`${propertyName}\` prop without an \`${handlerName}\` handler. This will render a read-only component. If the component should be mutable, set an \`${handlerName}\` handler.`); - } -} - -// node_modules/@cloudscape-design/components/token-group/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/token-group/styles.scoped.css"; -var styles_css_default43 = { - "root": "awsui_root_dm8gx_9oo5q_103", - "has-items": "awsui_has-items_dm8gx_9oo5q_137", - "no-padding": "awsui_no-padding_dm8gx_9oo5q_137", - "dismiss-button": "awsui_dismiss-button_dm8gx_9oo5q_141", - "token": "awsui_token_dm8gx_9oo5q_183", - "token-box": "awsui_token-box_dm8gx_9oo5q_190", - "token-box-error": "awsui_token-box-error_dm8gx_9oo5q_209", - "token-box-disabled": "awsui_token-box-disabled_dm8gx_9oo5q_220" -}; - -// node_modules/@cloudscape-design/components/internal/components/token-list/index.js -var import_react150 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/token-list/token-limit-toggle.js -var import_react148 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/token-list/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/token-list/styles.scoped.css"; -var styles_css_default44 = { - "root": "awsui_root_gfwv3_1exu9_99", - "horizontal": "awsui_horizontal_gfwv3_1exu9_104", - "vertical": "awsui_vertical_gfwv3_1exu9_108", - "list": "awsui_list_gfwv3_1exu9_112", - "list-item": "awsui_list-item_gfwv3_1exu9_132", - "toggle-container-inline": "awsui_toggle-container-inline_gfwv3_1exu9_139", - "toggle": "awsui_toggle_gfwv3_1exu9_139", - "description": "awsui_description_gfwv3_1exu9_235", - "separator": "awsui_separator_gfwv3_1exu9_239" -}; - -// node_modules/@cloudscape-design/components/internal/components/token-list/token-limit-toggle.js -function TokenLimitToggle({ controlId, allHidden, expanded, numberOfHiddenOptions, onClick, i18nStrings = {}, limitShowFewerAriaLabel, limitShowMoreAriaLabel }) { - const i18n = useInternalI18n("token-group"); - const numberOfHiddenOptionLabel = allHidden ? numberOfHiddenOptions : `+${numberOfHiddenOptions}`; - const description = expanded ? i18n("i18nStrings.limitShowFewer", i18nStrings.limitShowFewer) : `${i18n("i18nStrings.limitShowMore", i18nStrings.limitShowMore) || ""} (${numberOfHiddenOptionLabel})`; - const ariaLabel = expanded ? limitShowFewerAriaLabel : limitShowMoreAriaLabel; - const handleClick = (0, import_react148.useCallback)(() => { - fireNonCancelableEvent(onClick, null); - }, [onClick]); - return import_react148.default.createElement( - "button", - { type: "button", className: styles_css_default44.toggle, onClick: handleClick, "aria-controls": controlId, "aria-expanded": expanded, "aria-label": ariaLabel }, - import_react148.default.createElement(internal_default, { name: expanded ? "treeview-collapse" : "treeview-expand" }), - import_react148.default.createElement("span", { className: styles_css_default44.description }, description) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/token-list/token-focus-controller.js -var import_react149 = __toESM(require_react()); -var tokenSelector = `.${styles_css_default44["list-item"]}`; -var toggleButtonSelector = `.${styles_css_default44.toggle}`; -function useTokenFocusController({ moveFocusNextToIndex }) { - const tokenListRef = (0, import_react149.useRef)(null); - (0, import_react149.useEffect)(() => { - var _a2, _b; - if (moveFocusNextToIndex === void 0 || moveFocusNextToIndex === null || tokenListRef.current === null) { - return; - } - const tokenElements = tokenListRef.current.querySelectorAll(tokenSelector); - const toggleButton = tokenListRef.current.querySelector(toggleButtonSelector); - let closestPrevIndex = Number.NEGATIVE_INFINITY; - let closestNextIndex = Number.POSITIVE_INFINITY; - for (let activeIndex = 0; activeIndex < tokenElements.length; activeIndex++) { - if (activeIndex < moveFocusNextToIndex) { - closestPrevIndex = moveFocusNextToIndex - activeIndex < moveFocusNextToIndex - closestPrevIndex ? activeIndex : closestPrevIndex; - } else { - closestNextIndex = activeIndex - moveFocusNextToIndex < closestNextIndex - moveFocusNextToIndex ? activeIndex : closestNextIndex; - } - } - const nextElement = tokenElements[closestNextIndex]; - const prevElement = tokenElements[closestPrevIndex]; - if (nextElement instanceof HTMLElement) { - (_a2 = getFirstFocusable(nextElement)) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } else if (prevElement instanceof HTMLElement) { - (_b = getFirstFocusable(prevElement)) === null || _b === void 0 ? void 0 : _b.focus(); - } else if (toggleButton instanceof HTMLElement) { - toggleButton.focus(); - } - }, [moveFocusNextToIndex]); - return tokenListRef; -} - -// node_modules/@cloudscape-design/components/internal/components/token-list/index.js -function TokenList({ items, alignment, renderItem, limit, after, i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, moveFocusNextToIndex, onExpandedClick = () => void 0 }) { - const tokenListRef = useTokenFocusController({ moveFocusNextToIndex }); - const controlId = useUniqueId(); - const [expanded, setExpanded] = (0, import_react150.useState)(false); - const hasItems = items.length > 0; - const hasHiddenItems = hasItems && limit !== void 0 && items.length > limit; - const visibleItems = hasHiddenItems && !expanded ? items.slice(0, limit) : items; - const hasVisibleItems = visibleItems.length > 0; - const toggle = hasHiddenItems ? import_react150.default.createElement( - "div", - { className: styles_css_default44[`toggle-container-${alignment}`] }, - import_react150.default.createElement(TokenLimitToggle, { controlId: hasVisibleItems ? controlId : void 0, allHidden: limit === 0, expanded, numberOfHiddenOptions: items.length - visibleItems.length, i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, onClick: () => { - const isExpanded = !expanded; - setExpanded(isExpanded); - onExpandedClick(isExpanded); - } }) - ) : null; - if (alignment === "inline") { - return import_react150.default.createElement( - "div", - { ref: tokenListRef, className: clsx_m_default(styles_css_default44.root, styles_css_default44.horizontal) }, - hasItems && import_react150.default.createElement("ul", { id: controlId, className: styles_css_default44.list }, visibleItems.map((item, itemIndex) => import_react150.default.createElement("li", { key: itemIndex, className: styles_css_default44["list-item"], "aria-setsize": items.length, "aria-posinset": itemIndex + 1 }, renderItem(item, itemIndex)))), - toggle, - after && import_react150.default.createElement("div", { className: styles_css_default44.separator }), - after - ); - } - return import_react150.default.createElement( - "div", - { ref: tokenListRef, className: clsx_m_default(styles_css_default44.root, styles_css_default44.vertical) }, - hasVisibleItems && import_react150.default.createElement("ul", { id: controlId, className: clsx_m_default(styles_css_default44.list, styles_css_default44[alignment]) }, visibleItems.map((item, itemIndex) => import_react150.default.createElement("li", { key: itemIndex, className: styles_css_default44["list-item"], "aria-setsize": items.length, "aria-posinset": itemIndex + 1 }, renderItem(item, itemIndex)))), - toggle, - after - ); -} - -// node_modules/@cloudscape-design/components/token-group/token.js -var import_react152 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/token-group/dismiss-button.js -var import_react151 = __toESM(require_react()); -var dismiss_button_default = (0, import_react151.forwardRef)(DismissButton); -function DismissButton({ disabled, dismissLabel, onDismiss }, ref) { - return import_react151.default.createElement( - "button", - { ref, type: "button", className: clsx_m_default(styles_css_default43["dismiss-button"]), "aria-disabled": disabled ? true : void 0, onClick: !disabled && onDismiss ? () => onDismiss() : void 0, "aria-label": dismissLabel }, - import_react151.default.createElement(internal_default, { name: "close" }) - ); -} - -// node_modules/@cloudscape-design/components/token-group/token.js -function Token(_a2) { - var { ariaLabel, disabled, dismissLabel, onDismiss, children: children2, errorText, errorIconAriaLabel } = _a2, restProps = __rest(_a2, ["ariaLabel", "disabled", "dismissLabel", "onDismiss", "children", "errorText", "errorIconAriaLabel"]); - const errorId = useUniqueId("error"); - const baseProps = getBaseProps(restProps); - return import_react152.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default43.token, baseProps.className), role: "group", "aria-label": ariaLabel, "aria-describedby": errorText ? errorId : void 0, "aria-disabled": disabled }), - import_react152.default.createElement( - "div", - { className: clsx_m_default(styles_css_default43["token-box"], disabled && styles_css_default43["token-box-disabled"], errorText && styles_css_default43["token-box-error"]) }, - children2, - onDismiss && import_react152.default.createElement(dismiss_button_default, { disabled, dismissLabel, onDismiss }) - ), - errorText && import_react152.default.createElement(FormFieldError, { id: errorId, errorIconAriaLabel }, errorText) - ); -} - -// node_modules/@cloudscape-design/components/token-group/internal.js -function InternalTokenGroup(_a2) { - var { alignment, items, onDismiss, limit, i18nStrings, disableOuterPadding, limitShowFewerAriaLabel, limitShowMoreAriaLabel, __internalRootRef } = _a2, props2 = __rest(_a2, ["alignment", "items", "onDismiss", "limit", "i18nStrings", "disableOuterPadding", "limitShowFewerAriaLabel", "limitShowMoreAriaLabel", "__internalRootRef"]); - checkControlled("TokenGroup", "items", items, "onDismiss", onDismiss); - const [removedItemIndex, setRemovedItemIndex] = (0, import_react153.useState)(null); - const baseProps = getBaseProps(props2); - const hasItems = items.length > 0; - return import_react153.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default43.root, hasItems && styles_css_default43["has-items"], disableOuterPadding && styles_css_default43["no-padding"]), ref: __internalRootRef }), - import_react153.default.createElement(TokenList, { alignment, items, limit, renderItem: (item, itemIndex) => import_react153.default.createElement( - Token, - { ariaLabel: item.label, dismissLabel: item.dismissLabel, onDismiss: () => { - fireNonCancelableEvent(onDismiss, { itemIndex }); - setRemovedItemIndex(itemIndex); - }, disabled: item.disabled }, - import_react153.default.createElement(option_default, { option: item, isGenericGroup: false }) - ), i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, moveFocusNextToIndex: removedItemIndex, onExpandedClick: (isExpanded) => { - if (isExpanded && limit) { - setRemovedItemIndex(limit); - } else { - setRemovedItemIndex(null); - } - } }) - ); -} - -// node_modules/@cloudscape-design/components/multiselect/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/multiselect/styles.scoped.css"; -var styles_css_default45 = { - "root": "awsui_root_f8g6q_17z04_99", - "tokens": "awsui_tokens_f8g6q_17z04_134" -}; - -// node_modules/@cloudscape-design/components/multiselect/internal.js -var InternalMultiselect = import_react154.default.forwardRef((_a2, externalRef) => { - var _b; - var { options = [], filteringType = "none", filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, filteringResultsText, ariaRequired, placeholder, disabled, ariaLabel, statusType = "finished", empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions = [], deselectAriaLabel, keepOpen = true, tokenLimit, i18nStrings, onBlur, onFocus, onLoadItems, onChange, virtualScroll, inlineTokens = false, hideTokens = false, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef = null, autoFocus } = _a2, restProps = __rest(_a2, ["options", "filteringType", "filteringPlaceholder", "filteringAriaLabel", "filteringClearAriaLabel", "filteringResultsText", "ariaRequired", "placeholder", "disabled", "ariaLabel", "statusType", "empty", "loadingText", "finishedText", "errorText", "noMatch", "renderHighlightedAriaLive", "selectedOptions", "deselectAriaLabel", "keepOpen", "tokenLimit", "i18nStrings", "onBlur", "onFocus", "onLoadItems", "onChange", "virtualScroll", "inlineTokens", "hideTokens", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel", "__internalRootRef", "autoFocus"]); - checkOptionValueField("Multiselect", "options", options); - const baseProps = getBaseProps(restProps); - const formFieldContext = useFormFieldContext(restProps); - const i18n = useInternalI18n("multiselect"); - const i18nCommon = useInternalI18n("select"); - const recoveryText = i18nCommon("recoveryText", restProps.recoveryText); - const errorIconAriaLabel = i18nCommon("errorIconAriaLabel", restProps.errorIconAriaLabel); - const selectedAriaLabel = i18nCommon("selectedAriaLabel", restProps.selectedAriaLabel); - if (restProps.recoveryText && !onLoadItems) { - warnOnce("Multiselect", "`onLoadItems` must be provided for `recoveryText` to be displayed."); - } - const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({ - onLoadItems, - options, - statusType - }); - const useInteractiveGroups = true; - const [filteringValue, setFilteringValue] = (0, import_react154.useState)(""); - const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(options, filteringType, filteringValue); - const updateSelectedOption = (0, import_react154.useCallback)((option) => { - const filtered = filteredOptions.filter((item) => item.type !== "parent").map((item) => item.option); - const isAllChildrenSelected = (optionsArray) => optionsArray.every((item) => findOptionIndex(selectedOptions, item) > -1 || item.disabled); - const intersection = (visibleOptions, options2) => visibleOptions.filter((item) => findOptionIndex(options2, item) > -1 && !item.disabled); - const union = (visibleOptions, options2) => visibleOptions.filter((item) => findOptionIndex(options2, item) === -1).concat(options2); - const select = (options2, selectedOptions2) => { - return union(selectedOptions2, options2); - }; - const unselect = (options2, selectedOptions2) => { - return selectedOptions2.filter((option2) => findOptionIndex(options2, option2) === -1); - }; - let newSelectedOptions = [...selectedOptions]; - if (isGroup(option)) { - const visibleOptions = intersection([...option.options], filtered); - newSelectedOptions = isAllChildrenSelected(visibleOptions) ? unselect(visibleOptions, newSelectedOptions) : select(visibleOptions, newSelectedOptions); - } else { - newSelectedOptions = isAllChildrenSelected([option]) ? unselect([option], newSelectedOptions) : select([option], newSelectedOptions); - } - fireNonCancelableEvent(onChange, { - selectedOptions: newSelectedOptions - }); - }, [onChange, selectedOptions, filteredOptions]); - const rootRef = (0, import_react154.useRef)(null); - const selfControlId = useUniqueId("trigger"); - const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId; - const multiSelectAriaLabelId = useUniqueId("multiselect-arialabel-"); - const footerId = useUniqueId("footer"); - const scrollToIndex = (0, import_react154.useRef)(null); - const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps: getOptionProps2, highlightOption, announceSelected } = useSelect({ - selectedOptions, - updateSelectedOption, - options: filteredOptions, - filteringType, - onFocus, - onBlur, - externalRef, - keepOpen, - fireLoadItems, - setFilteringValue, - useInteractiveGroups, - statusType - }); - const handleNativeSearch = useNativeSearch({ - isEnabled: filteringType === "none" && isOpen, - options: filteredOptions, - highlightOption, - highlightedOption: highlightedOption === null || highlightedOption === void 0 ? void 0 : highlightedOption.option, - useInteractiveGroups - }); - const isEmpty = !options || options.length === 0; - const isNoMatch = filteredOptions && filteredOptions.length === 0; - const isFiltered = filteringType !== "none" && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0; - const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(matchesCount, totalCount) : void 0; - const dropdownStatus = useDropdownStatus({ - statusType, - empty, - loadingText, - finishedText, - errorText, - recoveryText, - isEmpty, - isNoMatch, - noMatch, - isFiltered, - filteringResultsText: filteredText, - onRecoveryClick: handleRecoveryClick, - errorIconAriaLabel, - hasRecoveryCallback: !!onLoadItems - }); - const filter = import_react154.default.createElement(filter_default, Object.assign({ clearAriaLabel: filteringClearAriaLabel, filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired, value: filteringValue }, getFilterProps())); - const trigger2 = import_react154.default.createElement(trigger_default, Object.assign({ placeholder, disabled, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions, triggerVariant: inlineTokens ? "tokens" : "placeholder", isOpen }, formFieldContext, { controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, multiSelectAriaLabelId) })); - const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId), ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); - const announcement = useAnnouncement({ - announceSelected, - highlightedOption, - getParent: (option) => { - var _a3; - return (_a3 = parentMap.get(option)) === null || _a3 === void 0 ? void 0 : _a3.option; - }, - selectedAriaLabel, - renderHighlightedAriaLive - }); - const tokens = selectedOptions.map((option) => ({ - label: option.label, - disabled: disabled || option.disabled, - labelTag: option.labelTag, - description: option.description, - iconAlt: option.iconAlt, - iconName: option.iconName, - iconUrl: option.iconUrl, - iconSvg: option.iconSvg, - tags: option.tags, - dismissLabel: i18n("deselectAriaLabel", deselectAriaLabel === null || deselectAriaLabel === void 0 ? void 0 : deselectAriaLabel(option), (format3) => { - var _a3; - return format3({ option__label: (_a3 = option.label) !== null && _a3 !== void 0 ? _a3 : "" }); - }) - })); - (0, import_react154.useEffect)(() => { - var _a3; - (_a3 = scrollToIndex.current) === null || _a3 === void 0 ? void 0 : _a3.call(scrollToIndex, highlightedIndex); - }, [highlightedIndex]); - const ListComponent = virtualScroll ? virtual_list_default : plain_list_default; - const handleMouseDown = (event) => { - const target = event.target; - if (target !== document.activeElement) { - event.preventDefault(); - } - }; - const showTokens = !hideTokens && !inlineTokens && tokens.length > 0; - const handleTokenDismiss = ({ detail }) => { - const optionToDeselect = selectedOptions[detail.itemIndex]; - updateSelectedOption(optionToDeselect); - const targetRef = getTriggerProps().ref; - if (targetRef.current) { - targetRef.current.focus(); - } - }; - const tokenGroupI18nStrings = { - limitShowFewer: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tokenLimitShowFewer, - limitShowMore: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tokenLimitShowMore - }; - const mergedRef = useMergeRefs(rootRef, __internalRootRef); - const dropdownProps = getDropdownProps(); - return import_react154.default.createElement( - "div", - Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(styles_css_default45.root, baseProps.className), onKeyPress: handleNativeSearch }), - import_react154.default.createElement( - dropdown_default, - Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : void 0, ariaDescribedby: dropdownProps.dropdownContentRole ? dropdownStatus.content ? footerId : void 0 : void 0, open: isOpen, trigger: trigger2, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? import_react154.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, expandToViewport, stretchBeyondTriggerWidth: true }), - import_react154.default.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? import_react154.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups, screenReaderContent: announcement, highlightType }) - ), - showTokens && import_react154.default.createElement(InternalTokenGroup, { className: styles_css_default45.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, onDismiss: handleTokenDismiss, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true }), - import_react154.default.createElement(ScreenreaderOnly, { id: multiSelectAriaLabelId }, ariaLabel) - ); -}); -var internal_default8 = InternalMultiselect; - -// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/index.js -var import_react155 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-series-marker/styles.scoped.css"; -var styles_css_default46 = { - "marker": "awsui_marker_1isd1_t85q3_99", - "marker--line": "awsui_marker--line_1isd1_t85q3_142", - "marker--rectangle": "awsui_marker--rectangle_1isd1_t85q3_146", - "marker--hollow-rectangle": "awsui_marker--hollow-rectangle_1isd1_t85q3_153", - "marker--dashed": "awsui_marker--dashed_1isd1_t85q3_169" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/index.js -var chart_series_marker_default = (0, import_react155.memo)(ChartSeriesMarker); -function ChartSeriesMarker({ type = "line", color: color2 }) { - return import_react155.default.createElement("span", { className: clsx_m_default(styles_css_default46.marker, styles_css_default46[`marker--${type}`]), style: { backgroundColor: color2 }, "aria-hidden": "true" }); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-filter/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-filter/styles.scoped.css"; -var styles_css_default47 = { - "root": "awsui_root_1px7g_1cmh4_99", - "chart-filter": "awsui_chart-filter_1px7g_1cmh4_134", - "custom-icon-wrapper": "awsui_custom-icon-wrapper_1px7g_1cmh4_138" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-filter/index.js -var chart_filter_default = (0, import_react156.memo)(ChartFilter); -function ChartFilter(_a2) { - var { series, i18nStrings, selectedSeries, onChange } = _a2, restProps = __rest(_a2, ["series", "i18nStrings", "selectedSeries", "onChange"]); - const baseProps = getBaseProps(restProps); - const className2 = clsx_m_default(baseProps.className, styles_css_default47.root); - const i18n = useInternalI18n("[charts]"); - const defaultOptions3 = series.map((d, i) => ({ - label: d.label, - value: "" + i, - datum: d.datum, - __customIcon: import_react156.default.createElement( - "span", - { className: styles_css_default47["custom-icon-wrapper"] }, - import_react156.default.createElement(chart_series_marker_default, { color: d.color, type: d.type }) - ) - })); - const selectedOptions = defaultOptions3.filter((option) => (selectedSeries === null || selectedSeries === void 0 ? void 0 : selectedSeries.indexOf(option.datum)) !== -1); - const updateSelection = (0, import_react156.useCallback)(({ detail: { selectedOptions: selectedOptions2 } }) => { - const selectedSeries2 = defaultOptions3.filter((option) => selectedOptions2.indexOf(option) !== -1).map((option) => option.datum); - onChange(selectedSeries2); - }, [onChange, defaultOptions3]); - return import_react156.default.createElement( - InternalFormField, - Object.assign({}, baseProps, { label: i18n("i18nStrings.filterLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterLabel), className: className2 }), - import_react156.default.createElement(internal_default8, { placeholder: i18n("i18nStrings.filterPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterPlaceholder), options: defaultOptions3, selectedOptions, onChange: updateSelection, className: styles_css_default47["chart-filter"], selectedAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterSelectedAriaLabel, hideTokens: true }) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-filter.js -var area_chart_filter_default = (0, import_react157.memo)(AreaChartFilter); -function AreaChartFilter({ model, filterLabel, filterPlaceholder, filterSelectedAriaLabel }) { - const filterItems = model.allSeries.map((s2) => { - const { title, color: color2, markerType } = model.getInternalSeries(s2); - return { label: title, color: color2, type: markerType, datum: s2 }; - }); - return import_react157.default.createElement(chart_filter_default, { series: filterItems, onChange: model.handlers.onFilterSeries, selectedSeries: model.series, i18nStrings: { - filterLabel, - filterPlaceholder, - filterSelectedAriaLabel - } }); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-legend.js -var import_react160 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-legend/index.js -var import_react158 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-legend/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-legend/styles.scoped.css"; -var styles_css_default48 = { - "marker": "awsui_marker_1kjc7_12d3z_99", - "root": "awsui_root_1kjc7_12d3z_117", - "title": "awsui_title_1kjc7_12d3z_155", - "list": "awsui_list_1kjc7_12d3z_159", - "marker--dimmed": "awsui_marker--dimmed_1kjc7_12d3z_208", - "marker--highlighted": "awsui_marker--highlighted_1kjc7_12d3z_211" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-legend/index.js -var chart_legend_default = (0, import_react158.memo)(ChartLegend); -function ChartLegend({ series, onHighlightChange, highlightedSeries, legendTitle, ariaLabel, plotContainerRef }) { - const i18n = useInternalI18n("[charts]"); - const containerRef = (0, import_react158.useRef)(null); - const segmentsRef = (0, import_react158.useRef)([]); - const highlightedSeriesIndex = findSeriesIndex(series, highlightedSeries); - const highlightLeft = () => { - var _a2; - const currentIndex = highlightedSeriesIndex !== null && highlightedSeriesIndex !== void 0 ? highlightedSeriesIndex : 0; - const nextIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : series.length - 1; - (_a2 = segmentsRef.current[nextIndex]) === null || _a2 === void 0 ? void 0 : _a2.focus(); - }; - const highlightRight = () => { - var _a2; - const currentIndex = highlightedSeriesIndex !== null && highlightedSeriesIndex !== void 0 ? highlightedSeriesIndex : 0; - const nextIndex = currentIndex + 1 < series.length ? currentIndex + 1 : 0; - (_a2 = segmentsRef.current[nextIndex]) === null || _a2 === void 0 ? void 0 : _a2.focus(); - }; - const handleKeyPress = (event) => { - if (event.keyCode === KeyCode.right || event.keyCode === KeyCode.left) { - event.preventDefault(); - switch (event.keyCode) { - case KeyCode.left: - return highlightLeft(); - case KeyCode.right: - return highlightRight(); - default: - return; - } - } - }; - const handleSelection = (index) => { - if (series[index].datum !== highlightedSeries) { - onHighlightChange(series[index].datum); - } - }; - const handleBlur = (event) => { - var _a2; - if (event.relatedTarget === null || containerRef.current && !containerRef.current.contains(event.relatedTarget) && !((_a2 = plotContainerRef === null || plotContainerRef === void 0 ? void 0 : plotContainerRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.relatedTarget))) { - onHighlightChange(null); - } - }; - const handleMouseOver = (s2) => { - if (s2 !== highlightedSeries) { - onHighlightChange(s2); - } - }; - const handleMouseLeave = () => { - onHighlightChange(null); - }; - return import_react158.default.createElement( - import_react158.default.Fragment, - null, - import_react158.default.createElement( - "div", - { ref: containerRef, role: "toolbar", "aria-label": legendTitle || i18n("i18nStrings.legendAriaLabel", ariaLabel), className: styles_css_default48.root, onKeyDown: handleKeyPress, onBlur: handleBlur }, - legendTitle && import_react158.default.createElement(InternalBox, { fontWeight: "bold", className: styles_css_default48.title }, legendTitle), - import_react158.default.createElement("div", { className: styles_css_default48.list }, series.map((s2, index) => { - const someHighlighted = highlightedSeries !== null; - const isHighlighted = highlightedSeries === s2.datum; - const isDimmed = someHighlighted && !isHighlighted; - return import_react158.default.createElement( - "div", - { role: "button", key: index, "aria-pressed": isHighlighted, className: clsx_m_default(styles_css_default48.marker, { - [styles_css_default48["marker--dimmed"]]: isDimmed, - [styles_css_default48["marker--highlighted"]]: isHighlighted - }), ref: (elem) => { - if (elem) { - segmentsRef.current[index] = elem; - } else { - delete segmentsRef.current[index]; - } - }, tabIndex: index === highlightedSeriesIndex || highlightedSeriesIndex === void 0 && index === 0 ? 0 : -1, onFocus: () => handleSelection(index), onClick: () => handleSelection(index), onMouseOver: () => handleMouseOver(s2.datum), onMouseLeave: handleMouseLeave }, - import_react158.default.createElement(chart_series_marker_default, { color: s2.color, type: s2.type }), - " ", - s2.label - ); - })) - ) - ); -} -function findSeriesIndex(series, targetSeries) { - for (let index = 0; index < series.length; index++) { - if (series[index].datum === targetSeries) { - return index; - } - } - return void 0; -} - -// node_modules/@cloudscape-design/components/area-chart/async-store/index.js -var import_react159 = __toESM(require_react()); -var import_react_dom6 = __toESM(require_react_dom()); -var AsyncStore = class { - constructor(state) { - this._listeners = []; - this._state = state; - } - get() { - return this._state; - } - set(cb) { - const prevState = this._state; - const newState = cb(prevState); - this._state = newState; - (0, import_react_dom6.unstable_batchedUpdates)(() => { - for (const [selector, listener] of this._listeners) { - if (selector(prevState) !== selector(newState)) { - listener(newState, prevState); - } - } - }); - } - subscribe(selector, listener) { - this._listeners.push([selector, listener]); - return () => this.unsubscribe(listener); - } - unsubscribe(listener) { - for (let index = 0; index < this._listeners.length; index++) { - const [, storedListener] = this._listeners[index]; - if (storedListener === listener) { - this._listeners.splice(index, 1); - break; - } - } - } -}; -function useReaction(store, selector, effect) { - (0, import_react159.useLayoutEffect)( - () => { - const unsubscribe = store.subscribe(selector, (newState, prevState) => effect(selector(newState), selector(prevState))); - return unsubscribe; - }, - // ignoring selector and effect as they are expected to stay constant - // eslint-disable-next-line react-hooks/exhaustive-deps - [store] - ); -} -function useSelector(store, selector) { - const [state, setState] = (0, import_react159.useState)(selector(store.get())); - useReaction(store, selector, (newState) => { - setState(newState); - }); - const prevStore = usePrevious(store); - if (prevStore !== null && prevStore !== store) { - return selector(store.get()); - } - return state; -} - -// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-legend.js -var area_chart_legend_default = (0, import_react160.memo)(AreaChartLegend); -function AreaChartLegend({ model, legendTitle, ariaLabel, plotContainerRef }) { - const legendItems = (0, import_react160.useMemo)(() => model.series.map((s2) => { - const { title, color: color2, markerType } = model.getInternalSeries(s2); - return { label: title, color: color2, type: markerType, datum: s2 }; - }), [model]); - const legendSeries = useSelector(model.interactions, (state) => state.legendSeries); - return import_react160.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: legendSeries, onHighlightChange: model.handlers.onLegendHighlight, legendTitle, ariaLabel, plotContainerRef }); -} - -// node_modules/@cloudscape-design/components/area-chart/chart-container.js -var import_react193 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-plot/index.js -var import_react163 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-plot/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-plot/styles.scoped.css"; -var styles_css_default49 = { - "root": "awsui_root_1fcus_y6use_99", - "clickable": "awsui_clickable_1fcus_y6use_108", - "precise": "awsui_precise_1fcus_y6use_112", - "focus-outline": "awsui_focus-outline_1fcus_y6use_116", - "application": "awsui_application_1fcus_y6use_125" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-plot/application-controller.js -var import_react161 = __toESM(require_react()); -var application_controller_default = (0, import_react161.forwardRef)(ApplicationController); -function ApplicationController({ activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }, ref) { - const containerRef = (0, import_react161.useRef)(null); - const applicationRef = (0, import_react161.useRef)(null); - const focusTransitionRef = (0, import_react161.useRef)(false); - const [isFocused, setFocused] = (0, import_react161.useState)(false); - const onApplicationFocus = (0, import_react161.useCallback)((event) => { - if (focusTransitionRef.current === false) { - setFocused(true); - onFocus && onFocus(event); - } else { - focusTransitionRef.current = false; - } - }, [onFocus]); - const onApplicationBlur = (0, import_react161.useCallback)((event) => { - if (focusTransitionRef.current === false) { - setFocused(false); - onBlur && onBlur(event); - muteApplication(applicationRef.current); - } - }, [onBlur]); - const onApplicationKeyDown = onKeyDown; - (0, import_react161.useImperativeHandle)(ref, () => ({ - focus: () => focusApplication(applicationRef.current, (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || null) - }), [activeElementRef]); - (0, import_react161.useEffect)(() => { - if (!isFocused || focusTransitionRef.current === true) { - return; - } - focusTransitionRef.current = true; - containerRef.current.removeChild(applicationRef.current); - containerRef.current.appendChild(applicationRef.current); - focusApplication(applicationRef.current, (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || null); - }, [isFocused, activeElementKey, activeElementRef]); - return import_react161.default.createElement( - "g", - { ref: containerRef }, - import_react161.default.createElement("g", { tabIndex: -1, ref: applicationRef, onFocus: onApplicationFocus, onBlur: onApplicationBlur, onKeyDown: onApplicationKeyDown, className: styles_css_default49.application }) - ); -} -function focusApplication(app, target) { - for (const attributeName of getAttributeNames(app)) { - if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { - app.removeAttribute(attributeName); - } - } - if (target) { - for (const attributeName of getAttributeNames(target)) { - if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { - const attributeValue = target.getAttribute(attributeName); - attributeValue && app.setAttribute(attributeName, attributeValue); - } - } - } - app.tabIndex = 0; - app.setAttribute("focusable", "true"); - app.setAttribute("aria-hidden", "false"); - app.focus({ preventScroll: true }); -} -function muteApplication(app) { - for (const attributeName of getAttributeNames(app)) { - if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { - app.removeAttribute(attributeName); - } - } - app.tabIndex = -1; - app.setAttribute("focusable", "false"); - app.setAttribute("aria-hidden", "true"); -} -function getAttributeNames(element) { - const attributes = element.attributes; - const result = new Array(attributes.length); - for (let i = 0; i < attributes.length; i++) { - result[i] = attributes[i].name; - } - return result; -} - -// node_modules/@cloudscape-design/components/internal/components/chart-plot/focus-outline.js -var import_react162 = __toESM(require_react()); -function useFocusVisibleState() { - const [focusVisible, setFocusVisible] = (0, import_react162.useState)(false); - (0, import_react162.useEffect)(() => { - function handleMousedown2() { - return setFocusVisible(false); - } - function handleKeydown2(event) { - if (!isModifierKey(event)) { - setFocusVisible(true); - } - } - document.addEventListener("mousedown", handleMousedown2); - document.addEventListener("keydown", handleKeydown2); - return () => { - document.removeEventListener("mousedown", handleMousedown2); - document.removeEventListener("keydown", handleKeydown2); - }; - }); - return focusVisible; -} -function FocusOutline({ elementKey, elementRef, offset = 0 }) { - const ref = (0, import_react162.useRef)(null); - const focusVisible = useFocusVisibleState(); - (0, import_react162.useEffect)(() => { - if (!ref.current) { - return; - } - if (focusVisible && elementKey && elementRef && elementRef.current && elementRef.current.getBBox) { - const element = elementRef.current.getBBox(); - showOutline(ref.current, element, offset); - } else { - hideOutline(ref.current); - } - }, [focusVisible, elementKey, elementRef, offset]); - return import_react162.default.createElement("rect", { ref, "aria-hidden": "true", className: styles_css_default49["focus-outline"], rx: "2" }); -} -function showOutline(el, position, offset) { - const offsetX = typeof offset === "number" ? offset : offset.x; - const offsetY = typeof offset === "number" ? offset : offset.y; - el.setAttribute("x", (position.x - offsetX).toString()); - el.setAttribute("y", (position.y - offsetY).toString()); - el.setAttribute("width", (position.width + 2 * offsetX).toString()); - el.setAttribute("height", (position.height + 2 * offsetY).toString()); - el.style.visibility = "visible"; -} -function hideOutline(el) { - el.style.visibility = "hidden"; - el.removeAttribute("x"); - el.removeAttribute("y"); - el.removeAttribute("width"); - el.removeAttribute("height"); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-plot/index.js -var DEFAULT_PLOT_FOCUS_OFFSET = 3; -var DEFAULT_ELEMENT_FOCUS_OFFSET = 3; -var chart_plot_default = (0, import_react163.forwardRef)(ChartPlot); -function ChartPlot({ width, height, transform, offsetTop, offsetBottom, offsetLeft, offsetRight, ariaLabel, ariaLabelledby, ariaRoleDescription, ariaDescription, ariaDescribedby, activeElementKey, activeElementRef, ariaLiveRegion, isClickable, isPrecise, children: children2, onClick, onKeyDown, focusOffset = DEFAULT_PLOT_FOCUS_OFFSET, activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET, onMouseMove, onMouseOut, onApplicationBlur, onApplicationFocus }, ref) { - const i18n = useInternalI18n("[charts]"); - const svgRef = (0, import_react163.useRef)(null); - const applicationRef = (0, import_react163.useRef)(null); - const plotClickedRef = (0, import_react163.useRef)(false); - const [isPlotFocused, setPlotFocused] = (0, import_react163.useState)(false); - const [isApplicationFocused, setApplicationFocused] = (0, import_react163.useState)(false); - const internalDescriptionId = useUniqueId("awsui-chart-plot__description"); - const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(" "); - (0, import_react163.useImperativeHandle)(ref, () => ({ - svg: svgRef.current, - focusPlot: () => svgRef.current.focus(), - focusApplication: () => applicationRef.current.focus() - })); - const onPlotMouseDown = () => { - plotClickedRef.current = true; - }; - const onPlotFocus = (event) => { - if (plotClickedRef.current || !!activeElementKey) { - applicationRef.current.focus(); - } else if (event.target === svgRef.current) { - setPlotFocused(true); - } - }; - const onPlotClick = (event) => { - onClick && onClick(event); - }; - const onPlotBlur = (event) => { - if (event.target === svgRef.current) { - setPlotFocused(false); - } - }; - const onPlotKeyDown = (event) => { - if (isPlotFocused) { - const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down]; - if (codes.indexOf(event.keyCode) !== -1) { - applicationRef.current.focus(); - } - } - }; - const onPlotApplicationFocus = (event) => { - onApplicationFocus && onApplicationFocus(event, plotClickedRef.current ? "mouse" : "keyboard"); - plotClickedRef.current = false; - setApplicationFocused(true); - }; - const onPlotApplicationBlur = (event) => { - onApplicationBlur && onApplicationBlur(event); - setApplicationFocused(false); - }; - const onApplicationKeyDown = onKeyDown; - const plotFocusable = !isApplicationFocused; - const plotTabIndex = plotFocusable ? 0 : -1; - const plotAria = !isApplicationFocused ? { - "aria-label": ariaLabel, - "aria-labelledby": ariaLabelledby, - "aria-describedby": ariaDescriptionId, - "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription) - } : {}; - return import_react163.default.createElement( - import_react163.default.Fragment, - null, - import_react163.default.createElement( - "svg", - Object.assign({ onMouseMove, onMouseOut, focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef, style: { - width, - height, - marginTop: offsetTop, - marginBottom: offsetBottom, - marginLeft: offsetLeft, - marginRight: offsetRight - }, className: clsx_m_default(styles_css_default49.root, { - [styles_css_default49.clickable]: isClickable, - [styles_css_default49.precise]: isPrecise - }), onMouseDown: onPlotMouseDown, onClick: onPlotClick, onFocus: onPlotFocus, onBlur: onPlotBlur, onKeyDown: onPlotKeyDown }), - import_react163.default.createElement(FocusOutline, { elementRef: svgRef, elementKey: isPlotFocused, offset: focusOffset }), - import_react163.default.createElement( - "g", - { transform }, - import_react163.default.createElement(application_controller_default, { activeElementKey: isApplicationFocused && activeElementKey || null, activeElementRef, ref: applicationRef, onFocus: onPlotApplicationFocus, onBlur: onPlotApplicationBlur, onKeyDown: onApplicationKeyDown }), - ariaDescription && plotFocusable && import_react163.default.createElement("desc", { "aria-hidden": "true", id: internalDescriptionId }, ariaDescription), - children2, - import_react163.default.createElement(FocusOutline, { elementRef: activeElementRef, elementKey: isApplicationFocused && activeElementKey, offset: activeElementFocusOffset }) - ) - ), - import_react163.default.createElement(live_region_default, null, ariaLiveRegion) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/axis-label.js -var import_react164 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/cartesian-chart/styles.scoped.css"; -var styles_css_default50 = { - "axis": "awsui_axis_f0fot_f6jsx_9", - "vertical-marker": "awsui_vertical-marker_f0fot_f6jsx_10", - "axis--emphasized": "awsui_axis--emphasized_f0fot_f6jsx_15", - "axis-label": "awsui_axis-label_f0fot_f6jsx_19", - "axis-label--x": "awsui_axis-label--x_f0fot_f6jsx_24", - "axis-label--y": "awsui_axis-label--y_f0fot_f6jsx_25", - "grid": "awsui_grid_f0fot_f6jsx_29", - "ticks__line": "awsui_ticks__line_f0fot_f6jsx_34", - "ticks__text": "awsui_ticks__text_f0fot_f6jsx_39", - "ticks--y": "awsui_ticks--y_f0fot_f6jsx_44", - "ticks--x": "awsui_ticks--x_f0fot_f6jsx_45", - "ticks--bottom": "awsui_ticks--bottom_f0fot_f6jsx_49", - "labels-left": "awsui_labels-left_f0fot_f6jsx_54", - "ticks": "awsui_ticks_f0fot_f6jsx_34", - "labels-left__label": "awsui_labels-left__label_f0fot_f6jsx_69", - "labels-left--hidden": "awsui_labels-left--hidden_f0fot_f6jsx_73", - "labels-bottom": "awsui_labels-bottom_f0fot_f6jsx_81", - "vertical-marker-circle": "awsui_vertical-marker-circle_f0fot_f6jsx_92", - "vertical-marker-circle-active": "awsui_vertical-marker-circle-active_f0fot_f6jsx_98", - "focus-outline": "awsui_focus-outline_f0fot_f6jsx_103", - "chart-container": "awsui_chart-container_f0fot_f6jsx_111", - "fit-height": "awsui_fit-height_f0fot_f6jsx_116", - "chart-container-outer": "awsui_chart-container-outer_f0fot_f6jsx_121", - "chart-container-inner": "awsui_chart-container-inner_f0fot_f6jsx_128", - "chart-container-plot-wrapper": "awsui_chart-container-plot-wrapper_f0fot_f6jsx_135", - "chart-container-plot": "awsui_chart-container-plot_f0fot_f6jsx_135", - "chart-container-bottom-labels": "awsui_chart-container-bottom-labels_f0fot_f6jsx_147" -}; - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/axis-label.js -var axis_label_default = (0, import_react164.memo)(AxisLabel); -function AxisLabel({ title, axis, position }) { - if (!title) { - return null; - } - return import_react164.default.createElement( - InternalBox, - { className: clsx_m_default(styles_css_default50["axis-label"], axis === "x" ? styles_css_default50["axis-label--x"] : styles_css_default50["axis-label--y"]), fontWeight: "bold", textAlign: position === "left" ? "left" : "center", margin: { bottom: position === "left" ? "l" : "n" } }, - import_react164.default.createElement("span", { "aria-hidden": "true" }, title) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/labels-measure.js -var import_react165 = __toESM(require_react()); -var labels_measure_default = (0, import_react165.memo)(LabelsMeasure); -function LabelsMeasure({ scale, ticks: ticks2, tickFormatter, autoWidth, maxLabelsWidth }) { - const [width, ref] = useContainerQuery((rect) => rect.contentBoxWidth); - (0, import_react165.useEffect)(() => { - autoWidth(width || 0); - }, [autoWidth, width]); - const labelMapper = (value) => { - const scaledValue = scale.d3Scale(value); - if (scaledValue === void 0 || !isFinite(scaledValue)) { - return null; - } - const formattedValue = tickFormatter ? tickFormatter(value) : value.toString(); - const lines = (formattedValue + "").split("\n"); - return import_react165.default.createElement(import_react165.Fragment, { key: `${value}` }, lines.map((line, lineIndex) => import_react165.default.createElement("div", { key: lineIndex, className: styles_css_default50["labels-left__label"], "aria-hidden": "true" }, line))); - }; - return import_react165.default.createElement("div", { ref, className: clsx_m_default(styles_css_default50["labels-left"], styles_css_default50["labels-left--hidden"]), style: { maxWidth: maxLabelsWidth } }, ticks2.map(labelMapper)); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/left-labels.js -var import_react167 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/constants.js -var TICK_LENGTH = 8; -var TICK_MARGIN = 4; -var TICK_LINE_HEIGHT = 16; -var X_TICK_COUNT_RATIO = 100; -var Y_TICK_COUNT_RATIO = 50; - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/label-utils.js -var SPACE_BETWEEN = 4; -function formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }) { - return ticks2.map((tick) => { - var _a2; - const position = (_a2 = scale.d3Scale(tick)) !== null && _a2 !== void 0 ? _a2 : NaN; - const label = tickFormatter ? tickFormatter(tick) : tick.toString(); - const lines = (label + "").split("\n"); - return { position, lines, space: Math.max(...lines.map(getLabelSpace)) }; - }); -} -function getVisibleTicks(ticks2, from, until, balanceTicks = false) { - ticks2 = getTicksInRange(ticks2, from, until); - return balanceTicks ? getReducedTicks(ticks2) : removeIntersections(ticks2); -} -function getTicksInRange(ticks2, from, until) { - return ticks2.filter((tick) => from <= tick.position - tick.space / 2 && tick.position + tick.space / 2 <= until); -} -function getReducedTicks(ticks2) { - const reduceLabelRatio = findReduceLabelRatio(ticks2); - const reducedTicks = []; - for (let index = 0; index < ticks2.length; index += reduceLabelRatio) { - reducedTicks.push(ticks2[index]); - } - return reducedTicks; -} -function findReduceLabelRatio(ticks2, ratio = 1) { - if (ratio >= ticks2.length) { - return ratio; - } - for (let i = ratio; i < ticks2.length; i += ratio) { - if (hasIntersection(ticks2[i - ratio], ticks2[i])) { - return findReduceLabelRatio(ticks2, ratio + 1); - } - } - return ratio; -} -function removeIntersections(ticks2) { - const visibleTicks = []; - let prevTick = null; - for (const tick of ticks2) { - if (!prevTick || !hasIntersection(prevTick, tick)) { - visibleTicks.push(tick); - prevTick = tick; - } - } - return visibleTicks; -} -function hasIntersection(a2, b) { - const [left, right] = a2.position < b.position ? [a2, b] : [b, a2]; - const leftEdge = left.position + left.space / 2 + SPACE_BETWEEN; - const rightEdge = right.position - right.space / 2; - return leftEdge > rightEdge; -} -function getSVGTextSize(element) { - if (element && element.getBBox) { - return element.getBBox(); - } - return void 0; -} - -// node_modules/@cloudscape-design/components/internal/components/responsive-text/index.js -var import_react166 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/responsive-text/responsive-text-utils.js -function getTextWidth(textNode) { - if (textNode.getComputedTextLength) { - return textNode.getComputedTextLength(); - } - return -1; -} - -// node_modules/@cloudscape-design/components/internal/components/responsive-text/index.js -var responsive_text_default = (0, import_react166.memo)(ResponsiveText); -function ResponsiveText({ x: x2, y: y2, className: className2, children: children2, maxWidth }) { - const textRef = (0, import_react166.useRef)(null); - (0, import_react166.useEffect)(() => { - renderTextContent(textRef.current, children2, maxWidth); - }, [maxWidth, children2]); - return import_react166.default.createElement("text", { ref: textRef, x: x2, y: y2, style: { textAnchor: "end" }, className: className2 }, children2); -} -function renderTextContent(textNode, text, maxWidth) { - let visibleLength = text.length; - while (visibleLength >= 0) { - textNode.textContent = truncateText(text, visibleLength); - if (getTextWidth(textNode) <= maxWidth) { - return; - } else { - visibleLength--; - } - } -} -function truncateText(text, maxLength) { - if (text.length === maxLength) { - return text; - } - return text.slice(0, maxLength) + "…"; -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/left-labels.js -var OFFSET_PX = 12; -var left_labels_default = (0, import_react167.memo)(LeftLabels); -function LeftLabels({ axis = "y", plotWidth, plotHeight, maxLabelsWidth = Number.POSITIVE_INFINITY, scale, ticks: ticks2, tickFormatter, title, ariaRoleDescription }) { - const i18n = useInternalI18n("[charts]"); - const virtualTextRef = (0, import_react167.useRef)(null); - const yOffset = axis === "x" && scale.isCategorical() ? Math.max(0, scale.d3Scale.bandwidth() - 1) / 2 : 0; - const labelToBoxCache = (0, import_react167.useRef)({}); - const getLabelSpace = (label) => { - var _a2, _b, _c, _d; - if (labelToBoxCache.current[label] !== void 0) { - return (_b = (_a2 = labelToBoxCache.current[label]) === null || _a2 === void 0 ? void 0 : _a2.height) !== null && _b !== void 0 ? _b : 0; - } - if (virtualTextRef.current) { - virtualTextRef.current.textContent = label; - } - labelToBoxCache.current[label] = getSVGTextSize(virtualTextRef.current); - return (_d = (_c = labelToBoxCache.current[label]) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0; - }; - const formattedTicks = formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }); - if (virtualTextRef.current) { - virtualTextRef.current.textContent = ""; - } - const from = 0 - OFFSET_PX - yOffset; - const until = plotHeight + OFFSET_PX - yOffset; - const visibleTicks = getVisibleTicks(formattedTicks, from, until); - return import_react167.default.createElement( - "g", - { className: clsx_m_default(styles_css_default50["labels-left"]), "aria-label": title, role: "list", "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription), "aria-hidden": true }, - visibleTicks.map(({ position, lines }, index) => isFinite(position) && import_react167.default.createElement( - "g", - { key: index, role: "listitem", transform: `translate(0,${position + yOffset})`, className: clsx_m_default(styles_css_default50.ticks, axis === "x" ? styles_css_default50["ticks--x"] : styles_css_default50["ticks--y"]) }, - axis === "y" && import_react167.default.createElement("line", { className: clsx_m_default(styles_css_default50.grid, styles_css_default50.ticks_line), x1: -TICK_LENGTH, y1: 0, x2: plotWidth, y2: 0, "aria-hidden": "true" }), - lines.map((line, lineIndex) => { - var _a2, _b; - const lineTextProps = { - x: -(TICK_LENGTH + TICK_MARGIN), - y: (lineIndex - (lines.length - 1) * 0.5) * TICK_LINE_HEIGHT, - className: styles_css_default50.ticks__text, - children: line - }; - return ((_b = (_a2 = labelToBoxCache.current[lines[0]]) === null || _a2 === void 0 ? void 0 : _a2.width) !== null && _b !== void 0 ? _b : 0) > maxLabelsWidth ? import_react167.default.createElement(responsive_text_default, Object.assign({ key: lineIndex }, lineTextProps, { maxWidth: maxLabelsWidth })) : import_react167.default.createElement("text", Object.assign({ key: lineIndex }, lineTextProps)); - }) - )), - import_react167.default.createElement("text", { ref: virtualTextRef, x: 0, y: 0, style: { visibility: "hidden" }, "aria-hidden": "true" }) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/bottom-labels.js -var import_react168 = __toESM(require_react()); -function useBottomLabels({ ticks: ticks2, scale, tickFormatter }) { - const virtualTextRef = (0, import_react168.useRef)(null); - const cacheRef = (0, import_react168.useRef)({}); - const getLabelSpace = (label) => { - if (cacheRef.current[label] !== void 0 && cacheRef.current[label] !== 0) { - return cacheRef.current[label]; - } - if (virtualTextRef.current && virtualTextRef.current.getComputedTextLength) { - virtualTextRef.current.textContent = label; - cacheRef.current[label] = virtualTextRef.current.getComputedTextLength(); - return cacheRef.current[label]; - } - return 0; - }; - const formattedTicks = formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }); - if (virtualTextRef.current) { - virtualTextRef.current.textContent = ""; - } - let height = TICK_LENGTH + TICK_MARGIN; - for (const { lines } of formattedTicks) { - height = Math.max(height, TICK_LENGTH + TICK_MARGIN + lines.length * TICK_LINE_HEIGHT); - } - return { virtualTextRef, formattedTicks, height }; -} -var bottom_labels_default = (0, import_react168.memo)(BottomLabels); -function BottomLabels({ axis = "x", width, height, scale, title, ariaRoleDescription, offsetLeft = 0, offsetRight = 0, virtualTextRef, formattedTicks }) { - const i18n = useInternalI18n("[charts]"); - const xOffset = scale.isCategorical() && axis === "x" ? Math.max(0, scale.d3Scale.bandwidth() - 1) / 2 : 0; - const from = 0 - offsetLeft - xOffset; - const until = width + offsetRight - xOffset; - const balanceLabels = axis === "x" && scale.scaleType !== "log"; - const visibleTicks = getVisibleTicks(formattedTicks, from, until, balanceLabels); - return import_react168.default.createElement( - "g", - { transform: `translate(0,${height})`, className: styles_css_default50["labels-bottom"], "aria-label": title, role: "list", "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription), "aria-hidden": true }, - visibleTicks.map(({ position, lines }, index) => isFinite(position) && import_react168.default.createElement( - "g", - { key: index, transform: `translate(${position + xOffset},0)`, className: clsx_m_default(styles_css_default50.ticks, styles_css_default50["ticks--bottom"], { - [styles_css_default50["ticks--x"]]: axis === "x", - [styles_css_default50["ticks--y"]]: axis === "y" - }), role: "listitem", "aria-label": lines.join("\n") }, - import_react168.default.createElement("line", { className: styles_css_default50.ticks__line, x1: 0, x2: 0, y1: 0, y2: TICK_LENGTH, "aria-hidden": "true" }), - lines.map((line, lineIndex) => import_react168.default.createElement("text", { className: styles_css_default50.ticks__text, key: lineIndex, x: 0, y: TICK_LENGTH + TICK_MARGIN + lineIndex * TICK_LINE_HEIGHT }, line)) - )), - import_react168.default.createElement("text", { ref: virtualTextRef, x: 0, y: 0, style: { visibility: "hidden" }, "aria-hidden": "true" }) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/emphasized-baseline.js -var import_react169 = __toESM(require_react()); -var emphasized_baseline_default = (0, import_react169.memo)(EmphasizedBaseline); -function EmphasizedBaseline({ axis = "x", width, height, scale }) { - var _a2; - const baselineY = (_a2 = scale.d3Scale(0)) !== null && _a2 !== void 0 ? _a2 : NaN; - const showYBaseline = axis === "x" && isFinite(baselineY) && baselineY <= height; - if (showYBaseline) { - return import_react169.default.createElement("line", { className: clsx_m_default(styles_css_default50.axis, styles_css_default50["axis--emphasized"]), x1: -TICK_MARGIN, x2: width, y1: baselineY, y2: baselineY, "aria-hidden": "true" }); - } - if (axis === "y") { - return import_react169.default.createElement("line", { className: clsx_m_default(styles_css_default50.axis, styles_css_default50["axis--emphasized"]), x1: 0, y1: 0, x2: 0, y2: height + TICK_LENGTH, "aria-hidden": "true" }); - } - return null; -} - -// node_modules/@cloudscape-design/components/area-chart/elements/data-series.js -var import_react172 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/area-chart/elements/area-series.js -var import_react170 = __toESM(require_react()); - -// node_modules/d3-path/src/path.js -var pi = Math.PI; -var tau = 2 * pi; -var epsilon = 1e-6; -var tauEpsilon = tau - epsilon; -function Path() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; - this._ = ""; -} -function path() { - return new Path(); -} -Path.prototype = path.prototype = { - constructor: Path, - moveTo: function(x2, y2) { - this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2); - }, - closePath: function() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._ += "Z"; - } - }, - lineTo: function(x2, y2) { - this._ += "L" + (this._x1 = +x2) + "," + (this._y1 = +y2); - }, - quadraticCurveTo: function(x1, y1, x2, y2) { - this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x2) + "," + (this._y1 = +y2); - }, - bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { - this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x3) + "," + (this._y1 = +y3); - }, - arcTo: function(x1, y1, x2, y2, r2) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r2 = +r2; - var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; - if (r2 < 0) throw new Error("negative radius: " + r2); - if (this._x1 === null) { - this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); - } else if (!(l01_2 > epsilon)) ; - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r2) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } else { - var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r2 * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } - this._ += "A" + r2 + "," + r2 + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); - } - }, - arc: function(x2, y2, r2, a0, a1, ccw) { - x2 = +x2, y2 = +y2, r2 = +r2, ccw = !!ccw; - var dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; - if (r2 < 0) throw new Error("negative radius: " + r2); - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } - if (!r2) return; - if (da < 0) da = da % tau + tau; - if (da > tauEpsilon) { - this._ += "A" + r2 + "," + r2 + ",0,1," + cw + "," + (x2 - dx) + "," + (y2 - dy) + "A" + r2 + "," + r2 + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); - } else if (da > epsilon) { - this._ += "A" + r2 + "," + r2 + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x2 + r2 * Math.cos(a1)) + "," + (this._y1 = y2 + r2 * Math.sin(a1)); - } - }, - rect: function(x2, y2, w, h) { - this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2) + "h" + +w + "v" + +h + "h" + -w + "Z"; - }, - toString: function() { - return this._; - } -}; -var path_default = path; - -// node_modules/d3-shape/src/constant.js -function constant_default(x2) { - return function constant2() { - return x2; - }; -} - -// node_modules/d3-shape/src/math.js -var abs = Math.abs; -var atan2 = Math.atan2; -var cos = Math.cos; -var max = Math.max; -var min = Math.min; -var sin = Math.sin; -var sqrt = Math.sqrt; -var epsilon2 = 1e-12; -var pi2 = Math.PI; -var halfPi = pi2 / 2; -var tau2 = 2 * pi2; -function acos(x2) { - return x2 > 1 ? 0 : x2 < -1 ? pi2 : Math.acos(x2); -} -function asin(x2) { - return x2 >= 1 ? halfPi : x2 <= -1 ? -halfPi : Math.asin(x2); -} - -// node_modules/d3-shape/src/arc.js -function arcInnerRadius(d) { - return d.innerRadius; -} -function arcOuterRadius(d) { - return d.outerRadius; -} -function arcStartAngle(d) { - return d.startAngle; -} -function arcEndAngle(d) { - return d.endAngle; -} -function arcPadAngle(d) { - return d && d.padAngle; -} -function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { - var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10; - if (t * t < epsilon2) return; - t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; - return [x0 + t * x10, y0 + t * y10]; -} -function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { - var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r2 = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max(0, r2 * r2 * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00; - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; - return { - cx: cx0, - cy: cy0, - x01: -ox, - y01: -oy, - x11: cx0 * (r1 / r2 - 1), - y11: cy0 * (r1 / r2 - 1) - }; -} -function arc_default() { - var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null; - function arc() { - var buffer, r2, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0; - if (!context) context = buffer = path_default(); - if (r1 < r0) r2 = r1, r1 = r0, r0 = r2; - if (!(r1 > epsilon2)) context.moveTo(0, 0); - else if (da > tau2 - epsilon2) { - context.moveTo(r1 * cos(a0), r1 * sin(a0)); - context.arc(0, 0, r1, a0, a1, !cw); - if (r0 > epsilon2) { - context.moveTo(r0 * cos(a1), r0 * sin(a1)); - context.arc(0, 0, r0, a1, a0, cw); - } - } else { - var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon2 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12; - if (rp > epsilon2) { - var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap)); - if ((da0 -= p0 * 2) > epsilon2) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0; - else da0 = 0, a00 = a10 = (a0 + a1) / 2; - if ((da1 -= p1 * 2) > epsilon2) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1; - else da1 = 0, a01 = a11 = (a0 + a1) / 2; - } - var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10); - if (rc > epsilon2) { - var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc; - if (da < pi2 && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { - var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); - rc0 = min(rc, (r0 - lc) / (kc - 1)); - rc1 = min(rc, (r1 - lc) / (kc + 1)); - } - } - if (!(da1 > epsilon2)) context.moveTo(x01, y01); - else if (rc1 > epsilon2) { - t02 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); - t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); - context.moveTo(t02.cx + t02.x01, t02.cy + t02.y01); - if (rc1 < rc) context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); - else { - context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); - context.arc(0, 0, r1, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), !cw); - context.arc(t12.cx, t12.cy, rc1, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); - } - } else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); - if (!(r0 > epsilon2) || !(da0 > epsilon2)) context.lineTo(x10, y10); - else if (rc0 > epsilon2) { - t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); - t12 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); - context.lineTo(t02.cx + t02.x01, t02.cy + t02.y01); - if (rc0 < rc) context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); - else { - context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); - context.arc(0, 0, r0, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), cw); - context.arc(t12.cx, t12.cy, rc0, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); - } - } else context.arc(0, 0, r0, a10, a00, cw); - } - context.closePath(); - if (buffer) return context = null, buffer + "" || null; - } - arc.centroid = function() { - var r2 = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2; - return [cos(a2) * r2, sin(a2) * r2]; - }; - arc.innerRadius = function(_) { - return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : innerRadius; - }; - arc.outerRadius = function(_) { - return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : outerRadius; - }; - arc.cornerRadius = function(_) { - return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : cornerRadius; - }; - arc.padRadius = function(_) { - return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), arc) : padRadius; - }; - arc.startAngle = function(_) { - return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : startAngle; - }; - arc.endAngle = function(_) { - return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : endAngle; - }; - arc.padAngle = function(_) { - return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : padAngle; - }; - arc.context = function(_) { - return arguments.length ? (context = _ == null ? null : _, arc) : context; - }; - return arc; -} - -// node_modules/d3-shape/src/curve/linear.js -function Linear(context) { - this._context = context; -} -Linear.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - default: - this._context.lineTo(x2, y2); - break; - } - } -}; -function linear_default(context) { - return new Linear(context); -} - -// node_modules/d3-shape/src/point.js -function x(p) { - return p[0]; -} -function y(p) { - return p[1]; -} - -// node_modules/d3-shape/src/line.js -function line_default() { - var x2 = x, y2 = y, defined = constant_default(true), context = null, curve = linear_default, output = null; - function line(data) { - var i, n = data.length, d, defined0 = false, buffer; - if (context == null) output = curve(buffer = path_default()); - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) output.lineStart(); - else output.lineEnd(); - } - if (defined0) output.point(+x2(d, i, data), +y2(d, i, data)); - } - if (buffer) return output = null, buffer + "" || null; - } - line.x = function(_) { - return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default(+_), line) : x2; - }; - line.y = function(_) { - return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default(+_), line) : y2; - }; - line.defined = function(_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default(!!_), line) : defined; - }; - line.curve = function(_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; - }; - line.context = function(_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; - }; - return line; -} - -// node_modules/d3-shape/src/area.js -function area_default() { - var x0 = x, x1 = null, y0 = constant_default(0), y1 = y, defined = constant_default(true), context = null, curve = linear_default, output = null; - function area(data) { - var i, j, k2, n = data.length, d, defined0 = false, buffer, x0z = new Array(n), y0z = new Array(n); - if (context == null) output = curve(buffer = path_default()); - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) { - j = i; - output.areaStart(); - output.lineStart(); - } else { - output.lineEnd(); - output.lineStart(); - for (k2 = i - 1; k2 >= j; --k2) { - output.point(x0z[k2], y0z[k2]); - } - output.lineEnd(); - output.areaEnd(); - } - } - if (defined0) { - x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); - output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); - } - } - if (buffer) return output = null, buffer + "" || null; - } - function arealine() { - return line_default().defined(defined).curve(curve).context(context); - } - area.x = function(_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), x1 = null, area) : x0; - }; - area.x0 = function(_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), area) : x0; - }; - area.x1 = function(_) { - return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : x1; - }; - area.y = function(_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), y1 = null, area) : y0; - }; - area.y0 = function(_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), area) : y0; - }; - area.y1 = function(_) { - return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : y1; - }; - area.lineX0 = area.lineY0 = function() { - return arealine().x(x0).y(y0); - }; - area.lineY1 = function() { - return arealine().x(x0).y(y1); - }; - area.lineX1 = function() { - return arealine().x(x1).y(y0); - }; - area.defined = function(_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default(!!_), area) : defined; - }; - area.curve = function(_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; - }; - area.context = function(_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; - }; - return area; -} - -// node_modules/d3-shape/src/descending.js -function descending_default(a2, b) { - return b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; -} - -// node_modules/d3-shape/src/identity.js -function identity_default(d) { - return d; -} - -// node_modules/d3-shape/src/pie.js -function pie_default() { - var value = identity_default, sortValues = descending_default, sort = null, startAngle = constant_default(0), endAngle = constant_default(tau2), padAngle = constant_default(0); - function pie(data) { - var i, n = data.length, j, k2, sum2 = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p * (da < 0 ? -1 : 1), v; - for (i = 0; i < n; ++i) { - if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { - sum2 += v; - } - } - if (sortValues != null) index.sort(function(i2, j2) { - return sortValues(arcs[i2], arcs[j2]); - }); - else if (sort != null) index.sort(function(i2, j2) { - return sort(data[i2], data[j2]); - }); - for (i = 0, k2 = sum2 ? (da - n * pa) / sum2 : 0; i < n; ++i, a0 = a1) { - j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k2 : 0) + pa, arcs[j] = { - data: data[j], - index: i, - value: v, - startAngle: a0, - endAngle: a1, - padAngle: p - }; - } - return arcs; - } - pie.value = function(_) { - return arguments.length ? (value = typeof _ === "function" ? _ : constant_default(+_), pie) : value; - }; - pie.sortValues = function(_) { - return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; - }; - pie.sort = function(_) { - return arguments.length ? (sort = _, sortValues = null, pie) : sort; - }; - pie.startAngle = function(_) { - return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : startAngle; - }; - pie.endAngle = function(_) { - return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : endAngle; - }; - pie.padAngle = function(_) { - return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : padAngle; - }; - return pie; -} - -// node_modules/d3-shape/src/curve/radial.js -var curveRadialLinear = curveRadial(linear_default); -function Radial(curve) { - this._curve = curve; -} -Radial.prototype = { - areaStart: function() { - this._curve.areaStart(); - }, - areaEnd: function() { - this._curve.areaEnd(); - }, - lineStart: function() { - this._curve.lineStart(); - }, - lineEnd: function() { - this._curve.lineEnd(); - }, - point: function(a2, r2) { - this._curve.point(r2 * Math.sin(a2), r2 * -Math.cos(a2)); - } -}; -function curveRadial(curve) { - function radial(context) { - return new Radial(curve(context)); - } - radial._curve = curve; - return radial; -} - -// node_modules/d3-shape/src/array.js -var slice = Array.prototype.slice; - -// node_modules/d3-shape/src/symbol/diamond.js -var tan30 = Math.sqrt(1 / 3); -var tan30_2 = tan30 * 2; - -// node_modules/d3-shape/src/symbol/star.js -var kr = Math.sin(pi2 / 10) / Math.sin(7 * pi2 / 10); -var kx = Math.sin(tau2 / 10) * kr; -var ky = -Math.cos(tau2 / 10) * kr; - -// node_modules/d3-shape/src/symbol/triangle.js -var sqrt3 = Math.sqrt(3); - -// node_modules/d3-shape/src/symbol/wye.js -var s = Math.sqrt(3) / 2; -var k = 1 / Math.sqrt(12); -var a = (k / 2 + 1) * 3; - -// node_modules/d3-shape/src/noop.js -function noop_default() { -} - -// node_modules/d3-shape/src/curve/basis.js -function point(that, x2, y2) { - that._context.bezierCurveTo( - (2 * that._x0 + that._x1) / 3, - (2 * that._y0 + that._y1) / 3, - (that._x0 + 2 * that._x1) / 3, - (that._y0 + 2 * that._y1) / 3, - (that._x0 + 4 * that._x1 + x2) / 6, - (that._y0 + 4 * that._y1 + y2) / 6 - ); -} -function Basis(context) { - this._context = context; -} -Basis.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 3: - point(this, this._x1, this._y1); - case 2: - this._context.lineTo(this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); - default: - point(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; - -// node_modules/d3-shape/src/curve/basisClosed.js -function BasisClosed(context) { - this._context = context; -} -BasisClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x2, this._y2); - this._context.closePath(); - break; - } - case 2: { - this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); - this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x2 = x2, this._y2 = y2; - break; - case 1: - this._point = 2; - this._x3 = x2, this._y3 = y2; - break; - case 2: - this._point = 3; - this._x4 = x2, this._y4 = y2; - this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6); - break; - default: - point(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; - -// node_modules/d3-shape/src/curve/basisOpen.js -function BasisOpen(context) { - this._context = context; -} -BasisOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6; - this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); - break; - case 3: - this._point = 4; - default: - point(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; - -// node_modules/d3-shape/src/curve/bundle.js -function Bundle(context, beta) { - this._basis = new Basis(context); - this._beta = beta; -} -Bundle.prototype = { - lineStart: function() { - this._x = []; - this._y = []; - this._basis.lineStart(); - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, j = x2.length - 1; - if (j > 0) { - var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t; - while (++i <= j) { - t = i / j; - this._basis.point( - this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx), - this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy) - ); - } - } - this._x = this._y = null; - this._basis.lineEnd(); - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } -}; -var bundle_default = function custom(beta) { - function bundle(context) { - return beta === 1 ? new Basis(context) : new Bundle(context, beta); - } - bundle.beta = function(beta2) { - return custom(+beta2); - }; - return bundle; -}(0.85); - -// node_modules/d3-shape/src/curve/cardinal.js -function point2(that, x2, y2) { - that._context.bezierCurveTo( - that._x1 + that._k * (that._x2 - that._x0), - that._y1 + that._k * (that._y2 - that._y0), - that._x2 + that._k * (that._x1 - x2), - that._y2 + that._k * (that._y1 - y2), - that._x2, - that._y2 - ); -} -function Cardinal(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -Cardinal.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - point2(this, this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - this._x1 = x2, this._y1 = y2; - break; - case 2: - this._point = 3; - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinal_default = function custom2(tension) { - function cardinal(context) { - return new Cardinal(context, tension); - } - cardinal.tension = function(tension2) { - return custom2(+tension2); - }; - return cardinal; -}(0); - -// node_modules/d3-shape/src/curve/cardinalClosed.js -function CardinalClosed(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -CardinalClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinalClosed_default = function custom3(tension) { - function cardinal(context) { - return new CardinalClosed(context, tension); - } - cardinal.tension = function(tension2) { - return custom3(+tension2); - }; - return cardinal; -}(0); - -// node_modules/d3-shape/src/curve/cardinalOpen.js -function CardinalOpen(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -CardinalOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinalOpen_default = function custom4(tension) { - function cardinal(context) { - return new CardinalOpen(context, tension); - } - cardinal.tension = function(tension2) { - return custom4(+tension2); - }; - return cardinal; -}(0); - -// node_modules/d3-shape/src/curve/catmullRom.js -function point3(that, x2, y2) { - var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; - if (that._l01_a > epsilon2) { - var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a); - x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; - y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; - } - if (that._l23_a > epsilon2) { - var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a); - x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m; - y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m; - } - that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); -} -function CatmullRom(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRom.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - this.point(this._x2, this._y2); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - default: - point3(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRom_default = function custom5(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom5(+alpha2); - }; - return catmullRom; -}(0.5); - -// node_modules/d3-shape/src/curve/catmullRomClosed.js -function CatmullRomClosed(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRomClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point3(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRomClosed_default = function custom6(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom6(+alpha2); - }; - return catmullRom; -}(0.5); - -// node_modules/d3-shape/src/curve/catmullRomOpen.js -function CatmullRomOpen(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRomOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - default: - point3(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRomOpen_default = function custom7(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom7(+alpha2); - }; - return catmullRom; -}(0.5); - -// node_modules/d3-shape/src/curve/linearClosed.js -function LinearClosed(context) { - this._context = context; -} -LinearClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._point) this._context.closePath(); - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) this._context.lineTo(x2, y2); - else this._point = 1, this._context.moveTo(x2, y2); - } -}; - -// node_modules/d3-shape/src/curve/monotone.js -function sign(x2) { - return x2 < 0 ? -1 : 1; -} -function slope3(that, x2, y2) { - var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); - return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; -} -function slope2(that, t) { - var h = that._x1 - that._x0; - return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; -} -function point4(that, t02, t12) { - var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3; - that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1); -} -function MonotoneX(context) { - this._context = context; -} -MonotoneX.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x1, this._y1); - break; - case 3: - point4(this, this._t0, slope2(this, this._t0)); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - var t12 = NaN; - x2 = +x2, y2 = +y2; - if (x2 === this._x1 && y2 === this._y1) return; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - point4(this, slope2(this, t12 = slope3(this, x2, y2)), t12); - break; - default: - point4(this, this._t0, t12 = slope3(this, x2, y2)); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - this._t0 = t12; - } -}; -function MonotoneY(context) { - this._context = new ReflectContext(context); -} -(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) { - MonotoneX.prototype.point.call(this, y2, x2); -}; -function ReflectContext(context) { - this._context = context; -} -ReflectContext.prototype = { - moveTo: function(x2, y2) { - this._context.moveTo(y2, x2); - }, - closePath: function() { - this._context.closePath(); - }, - lineTo: function(x2, y2) { - this._context.lineTo(y2, x2); - }, - bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { - this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3); - } -}; - -// node_modules/d3-shape/src/curve/natural.js -function Natural(context) { - this._context = context; -} -Natural.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = []; - this._y = []; - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, n = x2.length; - if (n) { - this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]); - if (n === 2) { - this._context.lineTo(x2[1], y2[1]); - } else { - var px = controlPoints(x2), py = controlPoints(y2); - for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { - this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]); - } - } - } - if (this._line || this._line !== 0 && n === 1) this._context.closePath(); - this._line = 1 - this._line; - this._x = this._y = null; - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } -}; -function controlPoints(x2) { - var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r2 = new Array(n); - a2[0] = 0, b[0] = 2, r2[0] = x2[0] + 2 * x2[1]; - for (i = 1; i < n - 1; ++i) a2[i] = 1, b[i] = 4, r2[i] = 4 * x2[i] + 2 * x2[i + 1]; - a2[n - 1] = 2, b[n - 1] = 7, r2[n - 1] = 8 * x2[n - 1] + x2[n]; - for (i = 1; i < n; ++i) m = a2[i] / b[i - 1], b[i] -= m, r2[i] -= m * r2[i - 1]; - a2[n - 1] = r2[n - 1] / b[n - 1]; - for (i = n - 2; i >= 0; --i) a2[i] = (r2[i] - a2[i + 1]) / b[i]; - b[n - 1] = (x2[n] + a2[n - 1]) / 2; - for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a2[i + 1]; - return [a2, b]; -} - -// node_modules/d3-shape/src/curve/step.js -function Step(context, t) { - this._context = context; - this._t = t; -} -Step.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = this._y = NaN; - this._point = 0; - }, - lineEnd: function() { - if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - default: { - if (this._t <= 0) { - this._context.lineTo(this._x, y2); - this._context.lineTo(x2, y2); - } else { - var x1 = this._x * (1 - this._t) + x2 * this._t; - this._context.lineTo(x1, this._y); - this._context.lineTo(x1, y2); - } - break; - } - } - this._x = x2, this._y = y2; - } -}; - -// node_modules/@cloudscape-design/components/area-chart/elements/area-series.js -var area_series_default = (0, import_react170.memo)(AreaSeries); -function AreaSeries({ data, color: color2, chartAreaClipPath }) { - const areaGenerator = area_default().x((p) => p.scaled.x).y0((p) => p.scaled.y0).y1((p) => p.scaled.y1); - const areaPath = areaGenerator(data) || ""; - const lineGenerator = line_default().x((p) => p.scaled.x).y((p) => p.scaled.y1); - const linePath = lineGenerator(data) || ""; - return import_react170.default.createElement( - import_react170.default.Fragment, - null, - import_react170.default.createElement("path", { "aria-hidden": true, fill: color2, stroke: color2, style: { opacity: 0.4 }, clipPath: `url(#${chartAreaClipPath})`, d: areaPath }), - import_react170.default.createElement("path", { "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})`, d: linePath }) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/threshold-series.js -var import_react171 = __toESM(require_react()); -var threshold_series_default = (0, import_react171.memo)(ThresholdSeries); -function ThresholdSeries({ data, xScale, color: color2, chartAreaClipPath }) { - const range3 = xScale.d3Scale.range(); - const y2 = data[0].scaled.y0; - const path2 = { x1: range3[0], x2: range3[1], y1: y2, y2 }; - return import_react171.default.createElement("line", Object.assign({ "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})` }, path2)); -} - -// node_modules/@cloudscape-design/components/area-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/area-chart/styles.scoped.css"; -var styles_css_default51 = { - "series": "awsui_series_y1yrh_17b8g_99", - "root": "awsui_root_y1yrh_17b8g_117", - "series--highlighted": "awsui_series--highlighted_y1yrh_17b8g_129", - "series--dimmed": "awsui_series--dimmed_y1yrh_17b8g_133", - "series--threshold": "awsui_series--threshold_y1yrh_17b8g_137", - "popover-divider": "awsui_popover-divider_y1yrh_17b8g_142" -}; - -// node_modules/@cloudscape-design/components/area-chart/elements/data-series.js -var data_series_default = (0, import_react172.memo)(DataSeries); -function DataSeries({ model }) { - const chartAreaClipPath = useUniqueId("awsui-area-chart__chart-area-"); - const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); - const highlightedSeries = useSelector(model.interactions, (state) => state.highlightedSeries); - const useHighlightDimmed = !highlightedX; - const seriesData = []; - for (let seriesIndex = model.series.length - 1; seriesIndex >= 0; seriesIndex--) { - if (model.computed.plot.sx[seriesIndex]) { - seriesData.push([model.series[seriesIndex], model.computed.plot.sx[seriesIndex] || []]); - } - } - return import_react172.default.createElement( - import_react172.default.Fragment, - null, - import_react172.default.createElement( - "defs", - { "aria-hidden": "true" }, - import_react172.default.createElement( - "clipPath", - { id: chartAreaClipPath }, - import_react172.default.createElement("rect", { x: 0, y: 0, width: model.width, height: model.height }) - ) - ), - import_react172.default.createElement("g", { role: "group" }, seriesData.map(([series, data]) => { - const isHighlighted = series === highlightedSeries; - const isDimmed = !!highlightedSeries && !isHighlighted; - return import_react172.default.createElement("g", { key: series.title, role: "group", "aria-label": series.title, className: clsx_m_default(styles_css_default51.series, styles_css_default51[`series--${series.type}`], { - [styles_css_default51["series--highlighted"]]: isHighlighted, - [styles_css_default51["series--dimmed"]]: useHighlightDimmed && isDimmed - }) }, series.type === "area" ? import_react172.default.createElement(area_series_default, { data, color: model.getInternalSeries(series).color, chartAreaClipPath }) : import_react172.default.createElement(threshold_series_default, { data, xScale: model.computed.xScale, color: model.getInternalSeries(series).color, chartAreaClipPath })); - })) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/chart-popover.js -var import_react187 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-popover/index.js -var import_react173 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-popover/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-popover/styles.scoped.css"; -var styles_css_default52 = { - "root": "awsui_root_1t44z_16g1a_99", - "hover-area": "awsui_hover-area_1t44z_16g1a_135", - "popover-body": "awsui_popover-body_1t44z_16g1a_143" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-popover/index.js -var chart_popover_default = import_react173.default.forwardRef(ChartPopover); -function ChartPopover(_a2, ref) { - var { position = "right", size: size2 = "medium", fixedWidth = false, dismissButton: dismissButton2 = false, dismissAriaLabel, children: children2, title, trackRef, trackKey, onDismiss, container, onMouseEnter, onMouseLeave, onBlur } = _a2, restProps = __rest(_a2, ["position", "size", "fixedWidth", "dismissButton", "dismissAriaLabel", "children", "title", "trackRef", "trackKey", "onDismiss", "container", "onMouseEnter", "onMouseLeave", "onBlur"]); - const baseProps = getBaseProps(restProps); - const popoverObjectRef = (0, import_react173.useRef)(null); - const popoverRef = useMergeRefs(popoverObjectRef, ref); - (0, import_react173.useEffect)(() => { - const onDocumentClick = (event) => { - if (event.target && !nodeBelongs(popoverObjectRef.current, event.target) && // click not in popover - !nodeContains(container, event.target)) { - onDismiss(true); - } - }; - document.addEventListener("mousedown", onDocumentClick, { capture: true }); - return () => { - document.removeEventListener("mousedown", onDocumentClick, { capture: true }); - }; - }, [container, onDismiss]); - const isPinned = dismissButton2; - return import_react173.default.createElement( - "div", - Object.assign({}, baseProps, { - className: clsx_m_default(styles_css_default13.root, styles_css_default52.root, baseProps.className), - ref: popoverRef, - onMouseEnter, - onMouseLeave, - onBlur, - // The tabIndex makes it so that clicking inside popover assigns this element as blur target. - // That is necessary in charts to ensure the blur target is within the chart and no cleanup is needed. - tabIndex: -1 - }), - import_react173.default.createElement( - PopoverContainer, - { size: size2, fixedWidth, position, trackRef, trackKey, arrow: (position2) => import_react173.default.createElement( - "div", - { className: clsx_m_default(styles_css_default13.arrow, styles_css_default13[`arrow-position-${position2}`]) }, - import_react173.default.createElement("div", { className: styles_css_default13["arrow-outer"] }), - import_react173.default.createElement("div", { className: styles_css_default13["arrow-inner"] }) - ), keepPosition: true, allowVerticalOverflow: true, allowScrollToFit: isPinned }, - import_react173.default.createElement( - "div", - { className: styles_css_default52["hover-area"] }, - import_react173.default.createElement(PopoverBody, { dismissButton: dismissButton2, dismissAriaLabel, header: title, onDismiss, overflowVisible: "content", className: styles_css_default52["popover-body"] }, children2) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-series-details/index.js -var import_react185 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-series-details/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-series-details/styles.scoped.css"; -var styles_css_default53 = { - "dimmed": "awsui_dimmed_10ipo_1di0o_99", - "marker": "awsui_marker_10ipo_1di0o_150", - "marker--line": "awsui_marker--line_10ipo_1di0o_193", - "marker--rectangle": "awsui_marker--rectangle_10ipo_1di0o_197", - "marker--hollow-rectangle": "awsui_marker--hollow-rectangle_10ipo_1di0o_204", - "marker--dashed": "awsui_marker--dashed_10ipo_1di0o_220", - "root": "awsui_root_10ipo_1di0o_243", - "value": "awsui_value_10ipo_1di0o_278", - "expandable": "awsui_expandable_10ipo_1di0o_282", - "list-item": "awsui_list-item_10ipo_1di0o_286", - "inner-list-item": "awsui_inner-list-item_10ipo_1di0o_287", - "key-value-pair": "awsui_key-value-pair_10ipo_1di0o_292", - "expandable-section": "awsui_expandable-section_10ipo_1di0o_293", - "key": "awsui_key_10ipo_1di0o_292", - "sub-items": "awsui_sub-items_10ipo_1di0o_306", - "list": "awsui_list_10ipo_1di0o_286", - "compact": "awsui_compact_10ipo_1di0o_332", - "with-sub-items": "awsui_with-sub-items_10ipo_1di0o_337", - "full-width": "awsui_full-width_10ipo_1di0o_342", - "announced": "awsui_announced_10ipo_1di0o_346" -}; - -// node_modules/@cloudscape-design/components/expandable-section/internal.js -var import_react184 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/expandable-section/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/expandable-section/styles.scoped.css"; -var styles_css_default54 = { - "content-enter": "awsui_content-enter_gwq0h_xoje_103", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_xoje_1", - "trigger-expanded": "awsui_trigger-expanded_gwq0h_xoje_125", - "icon": "awsui_icon_gwq0h_xoje_139", - "root": "awsui_root_gwq0h_xoje_157", - "expand-button": "awsui_expand-button_gwq0h_xoje_195", - "expanded": "awsui_expanded_gwq0h_xoje_202", - "icon-container": "awsui_icon-container_gwq0h_xoje_212", - "icon-container-container": "awsui_icon-container-container_gwq0h_xoje_216", - "wrapper": "awsui_wrapper_gwq0h_xoje_220", - "wrapper-default": "awsui_wrapper-default_gwq0h_xoje_228", - "wrapper-footer": "awsui_wrapper-footer_gwq0h_xoje_228", - "wrapper-navigation": "awsui_wrapper-navigation_gwq0h_xoje_232", - "wrapper-container": "awsui_wrapper-container_gwq0h_xoje_235", - "wrapper-compact": "awsui_wrapper-compact_gwq0h_xoje_239", - "header-deprecated": "awsui_header-deprecated_gwq0h_xoje_252", - "wrapper-expanded": "awsui_wrapper-expanded_gwq0h_xoje_274", - "header": "awsui_header_gwq0h_xoje_252", - "header-wrapper": "awsui_header-wrapper_gwq0h_xoje_294", - "header-actions-wrapper": "awsui_header-actions-wrapper_gwq0h_xoje_306", - "header-button": "awsui_header-button_gwq0h_xoje_311", - "header-container-button": "awsui_header-container-button_gwq0h_xoje_311", - "header-container": "awsui_header-container_gwq0h_xoje_311", - "header-navigation": "awsui_header-navigation_gwq0h_xoje_346", - "header-text": "awsui_header-text_gwq0h_xoje_383", - "content": "awsui_content_gwq0h_xoje_103", - "content-default": "awsui_content-default_gwq0h_xoje_390", - "content-footer": "awsui_content-footer_gwq0h_xoje_394", - "content-expanded": "awsui_content-expanded_gwq0h_xoje_398", - "content-compact": "awsui_content-compact_gwq0h_xoje_401", - "focusable": "awsui_focusable_gwq0h_xoje_405", - "click-target": "awsui_click-target_gwq0h_xoje_420" -}; - -// node_modules/@cloudscape-design/components/container/internal.js -var import_react178 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/container/use-sticky-header.js -var import_react174 = __toESM(require_react()); -function computeOffset({ isMobile, isVisualRefresh, customCssProps, __stickyOffset, __mobileStickyOffset, mobileBarHeight = 0, stickyOffsetTop, hasInnerOverflowParents }) { - const effectiveStickyOffset = __stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : hasInnerOverflowParents ? 0 : stickyOffsetTop; - let computedOffset = `${effectiveStickyOffset}px`; - if (isMobile) { - const classicOffset = `${stickyOffsetTop + mobileBarHeight + (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px`; - const visualRefreshOffset = `calc(var(${customCssProps.offsetTop}, 0px) + var(${customCssProps.mobileBarHeight}, 0px) + ${(__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px)`; - computedOffset = isVisualRefresh ? visualRefreshOffset : classicOffset; - } else if (isVisualRefresh && !hasInnerOverflowParents) { - computedOffset = `var(${customCssProps.offsetTopWithNotifications}, ${computedOffset})`; - } - return computedOffset; -} -var StickyHeaderContext = (0, import_react174.createContext)({ - isStuck: false -}); -var useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableMobile = true) => { - const isMobile = useMobile(); - const { stickyOffsetTop, mobileBarHeight } = useAppLayoutContext(); - const disableSticky = isMobile && __disableMobile; - const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader; - const isVisualRefresh = useVisualRefresh(); - const [hasInnerOverflowParents, setHasInnerOverflowParents] = (0, import_react174.useState)(false); - const [isStuck, setIsStuck] = (0, import_react174.useState)(false); - (0, import_react174.useLayoutEffect)(() => { - if (rootRef.current) { - const overflowParents = getOverflowParents(rootRef.current); - const mainElement = findUpUntil2(rootRef.current, (elem) => elem.tagName === "MAIN"); - setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement); - } - }, [rootRef]); - const computedOffset = computeOffset({ - isMobile, - isVisualRefresh, - customCssProps: custom_css_properties_default, - __stickyOffset, - __mobileStickyOffset, - mobileBarHeight, - stickyOffsetTop, - hasInnerOverflowParents - }); - const stickyStyles = isSticky ? { - style: { - top: computedOffset - } - } : {}; - const checkIfStuck = (0, import_react174.useCallback)(() => { - if (rootRef.current && headerRef.current) { - const rootTopBorderWidth = parseFloat(getComputedStyle(rootRef.current).borderTopWidth) || 0; - const rootTop = rootRef.current.getBoundingClientRect().top + rootTopBorderWidth; - const headerTop = headerRef.current.getBoundingClientRect().top; - if (rootTop < headerTop) { - setIsStuck(true); - } else { - setIsStuck(false); - } - } - }, [rootRef, headerRef]); - (0, import_react174.useEffect)(() => { - if (isSticky) { - window.addEventListener("scroll", checkIfStuck, true); - window.addEventListener("resize", checkIfStuck); - return () => { - window.removeEventListener("scroll", checkIfStuck, true); - window.removeEventListener("resize", checkIfStuck); - }; - } - }, [isSticky, checkIfStuck]); - return { - isSticky, - isStuck, - stickyStyles - }; -}; - -// node_modules/@cloudscape-design/components/internal/hooks/use-dynamic-overlap/index.js -var import_react175 = __toESM(require_react()); -var import_react176 = __toESM(require_react()); -function useDynamicOverlap(props2) { - var _a2; - const disabled = (_a2 = props2 === null || props2 === void 0 ? void 0 : props2.disabled) !== null && _a2 !== void 0 ? _a2 : false; - const setDynamicOverlapHeight = (0, import_react175.useContext)(DynamicOverlapContext); - const overlapElementRef = (0, import_react176.useRef)(null); - const getElement = (0, import_react176.useCallback)(() => overlapElementRef.current, [overlapElementRef]); - const updateState = (0, import_react176.useCallback)((entry) => { - if (!disabled) { - setDynamicOverlapHeight(entry.contentBoxHeight); - } - }, [disabled, setDynamicOverlapHeight]); - useResizeObserver(getElement, updateState); - (0, import_react175.useLayoutEffect)(function handleDynamicOverlapHeight() { - return () => { - if (!disabled) { - setDynamicOverlapHeight(0); - } - }; - }, [disabled, setDynamicOverlapHeight]); - return overlapElementRef; -} - -// node_modules/@cloudscape-design/components/container/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/container/styles.scoped.css"; -var styles_css_default55 = { - "root": "awsui_root_14iqq_v4tpg_103", - "fit-height": "awsui_fit-height_14iqq_v4tpg_139", - "with-side-media": "awsui_with-side-media_14iqq_v4tpg_144", - "variant-default": "awsui_variant-default_14iqq_v4tpg_147", - "variant-stacked": "awsui_variant-stacked_14iqq_v4tpg_147", - "refresh": "awsui_refresh_14iqq_v4tpg_155", - "sticky-enabled": "awsui_sticky-enabled_14iqq_v4tpg_205", - "with-top-media": "awsui_with-top-media_14iqq_v4tpg_217", - "content-wrapper": "awsui_content-wrapper_14iqq_v4tpg_222", - "content-wrapper-fit-height": "awsui_content-wrapper-fit-height_14iqq_v4tpg_227", - "media": "awsui_media_14iqq_v4tpg_234", - "media-top": "awsui_media-top_14iqq_v4tpg_252", - "media-side": "awsui_media-side_14iqq_v4tpg_257", - "header": "awsui_header_14iqq_v4tpg_263", - "header-with-media": "awsui_header-with-media_14iqq_v4tpg_268", - "header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_v4tpg_274", - "header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_v4tpg_278", - "header-stuck": "awsui_header-stuck_14iqq_v4tpg_284", - "header-variant-cards": "awsui_header-variant-cards_14iqq_v4tpg_294", - "header-dynamic-height": "awsui_header-dynamic-height_14iqq_v4tpg_297", - "with-paddings": "awsui_with-paddings_14iqq_v4tpg_303", - "with-hidden-content": "awsui_with-hidden-content_14iqq_v4tpg_312", - "header-variant-full-page": "awsui_header-variant-full-page_14iqq_v4tpg_370", - "remove-high-contrast-header": "awsui_remove-high-contrast-header_14iqq_v4tpg_390", - "dark-header": "awsui_dark-header_14iqq_v4tpg_399", - "content": "awsui_content_14iqq_v4tpg_222", - "content-fit-height": "awsui_content-fit-height_14iqq_v4tpg_407", - "content-with-media": "awsui_content-with-media_14iqq_v4tpg_417", - "footer": "awsui_footer_14iqq_v4tpg_421", - "with-divider": "awsui_with-divider_14iqq_v4tpg_425" -}; - -// node_modules/@cloudscape-design/components/internal/context/modal-context.js -var import_react177 = __toESM(require_react()); -var ModalContext = (0, import_react177.createContext)({ isInModal: false }); -var useModalContext = () => { - const modalContext = (0, import_react177.useContext)(ModalContext); - return modalContext; -}; - -// node_modules/@cloudscape-design/components/container/internal.js -function InternalContainerAsSubstep(props2) { - const { subStepRef, funnelSubStepProps } = useFunnelSubStep(); - const modalContext = useModalContext(); - return import_react178.default.createElement(InternalContainer, Object.assign({}, props2, { __subStepRef: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? { current: null } : subStepRef, __funnelSubStepProps: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? {} : funnelSubStepProps })); -} -function InternalContainer(_a2) { - var _b; - var { header, footer, children: children2, variant = "default", disableHeaderPaddings = false, disableContentPaddings = false, fitHeight, media, __stickyOffset, __mobileStickyOffset, __stickyHeader = false, __internalRootRef = null, __disableFooterDivider = false, __disableFooterPaddings = false, __hiddenContent = false, __headerRef, __darkHeader = false, __disableStickyMobile = true, __funnelSubStepProps, __subStepRef } = _a2, restProps = __rest(_a2, ["header", "footer", "children", "variant", "disableHeaderPaddings", "disableContentPaddings", "fitHeight", "media", "__stickyOffset", "__mobileStickyOffset", "__stickyHeader", "__internalRootRef", "__disableFooterDivider", "__disableFooterPaddings", "__hiddenContent", "__headerRef", "__darkHeader", "__disableStickyMobile", "__funnelSubStepProps", "__subStepRef"]); - const isMobile = useMobile(); - const baseProps = getBaseProps(restProps); - const rootRef = (0, import_react178.useRef)(null); - const headerRef = (0, import_react178.useRef)(null); - const { isSticky, isStuck, stickyStyles } = useStickyHeader(rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableStickyMobile); - const contentId = useUniqueId(); - const { setHasStickyBackground } = useAppLayoutContext(); - const isRefresh = useVisualRefresh(); - const hasDynamicHeight = isRefresh && variant === "full-page"; - const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader }); - const mergedRef = useMergeRefs(rootRef, __internalRootRef); - const headerMergedRef = useMergeRefs(headerRef, overlapElement, __headerRef); - (0, import_react178.useEffect)(() => { - const shouldUpdateStickyBackground = isSticky && variant === "full-page" && setHasStickyBackground; - if (shouldUpdateStickyBackground) { - setHasStickyBackground(true); - } - return () => { - if (shouldUpdateStickyBackground) { - setHasStickyBackground(false); - } - }; - }, [isSticky, setHasStickyBackground, variant]); - const shouldHaveStickyStyles = isSticky && !isMobile; - const hasMedia = !!(media === null || media === void 0 ? void 0 : media.content); - const mediaPosition = (_b = media === null || media === void 0 ? void 0 : media.position) !== null && _b !== void 0 ? _b : "top"; - return import_react178.default.createElement( - "div", - Object.assign({}, baseProps, __funnelSubStepProps, { className: clsx_m_default(baseProps.className, styles_css_default55.root, styles_css_default55[`variant-${variant}`], fitHeight && styles_css_default55["fit-height"], hasMedia && (mediaPosition === "side" ? styles_css_default55["with-side-media"] : styles_css_default55["with-top-media"]), shouldHaveStickyStyles && [styles_css_default55["sticky-enabled"]], isRefresh && styles_css_default55.refresh), ref: mergedRef }), - hasMedia && import_react178.default.createElement("div", { className: clsx_m_default(styles_css_default55[`media-${mediaPosition === "side" ? "side" : "top"}`], styles_css_default55.media), style: mediaPosition === "top" ? { height: (media === null || media === void 0 ? void 0 : media.height) || "" } : { width: (media === null || media === void 0 ? void 0 : media.width) || "" } }, media.content), - import_react178.default.createElement( - "div", - { id: contentId, ref: __subStepRef, className: clsx_m_default(styles_css_default55["content-wrapper"], fitHeight && styles_css_default55["content-wrapper-fit-height"]) }, - header && import_react178.default.createElement( - StickyHeaderContext.Provider, - { value: { isStuck } }, - import_react178.default.createElement("div", Object.assign({ className: clsx_m_default(isRefresh && styles_css_default55.refresh, styles_css_default55.header, styles_css_default55[`header-variant-${variant}`], shouldRemoveHighContrastHeader() && styles_css_default55["remove-high-contrast-header"], { - [styles_css_default55["header-sticky-disabled"]]: __stickyHeader && !isSticky, - [styles_css_default55["header-sticky-enabled"]]: isSticky, - [styles_css_default55["header-dynamic-height"]]: hasDynamicHeight, - [styles_css_default55["header-stuck"]]: isStuck, - [styles_css_default55["with-paddings"]]: !disableHeaderPaddings, - [styles_css_default55["with-hidden-content"]]: !children2 || __hiddenContent, - [styles_css_default55["header-with-media"]]: hasMedia - }) }, stickyStyles, { ref: headerMergedRef }), __darkHeader ? import_react178.default.createElement("div", { className: clsx_m_default(styles_css_default55["dark-header"], getContentHeaderClassName()) }, header) : header) - ), - import_react178.default.createElement("div", { className: clsx_m_default(styles_css_default55.content, fitHeight && styles_css_default55["content-fit-height"], shouldRemoveHighContrastHeader() && styles_css_default55["remove-high-contrast-header"], { - [styles_css_default55["with-paddings"]]: !disableContentPaddings - }) }, children2), - footer && import_react178.default.createElement("div", { className: clsx_m_default(styles_css_default55.footer, { - [styles_css_default55["with-divider"]]: !__disableFooterDivider, - [styles_css_default55["with-paddings"]]: !__disableFooterPaddings - }) }, footer) - ) - ); -} - -// node_modules/@cloudscape-design/components/expandable-section/expandable-section-container.js -var import_react180 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/analytics/components/analytics-funnel.js -var import_react179 = __toESM(require_react()); -var FUNNEL_VERSION = "1.4"; -var AnalyticsFunnel = (props2) => { - const { isInFunnel } = useFunnel(); - if (isInFunnel && props2.funnelType === "single-page") { - return import_react179.default.createElement(import_react179.default.Fragment, null, props2.children); - } - return import_react179.default.createElement(InnerAnalyticsFunnel, Object.assign({}, props2)); -}; -var CREATION_EDIT_FLOW_DONE_EVENT_NAME = "awsui-creation-edit-flow-done"; -var dispatchCreateEditFlowDoneEvent = () => { - var _a2; - try { - (_a2 = window.top) === null || _a2 === void 0 ? void 0 : _a2.document.dispatchEvent(new Event(CREATION_EDIT_FLOW_DONE_EVENT_NAME)); - } catch (_b) { - } -}; -var onFunnelCancelled = ({ funnelInteractionId }) => { - FunnelMetrics.funnelCancelled({ funnelInteractionId }); -}; -var onFunnelComplete = ({ funnelInteractionId }) => { - FunnelMetrics.funnelComplete({ funnelInteractionId }); - dispatchCreateEditFlowDoneEvent(); -}; -function evaluateSelectors(selectors, defaultSelector) { - for (const selector of selectors) { - const element = document.querySelector(selector); - if (element) { - return selector; - } - } - return defaultSelector; -} -var InnerAnalyticsFunnel = (_a2) => { - var { children: children2, stepConfiguration } = _a2, props2 = __rest(_a2, ["children", "stepConfiguration"]); - const [funnelInteractionId, setFunnelInteractionId] = (0, import_react179.useState)(""); - const [submissionAttempt, setSubmissionAttempt] = (0, import_react179.useState)(0); - const isVisualRefresh = useVisualRefresh(); - const funnelState = (0, import_react179.useRef)("default"); - const funnelNameSelector = (0, import_react179.useRef)(getFunnelNameSelector()); - const errorCount = (0, import_react179.useRef)(0); - const loadingButtonCount = (0, import_react179.useRef)(0); - const wizardCount = (0, import_react179.useRef)(0); - const latestFocusCleanupFunction = (0, import_react179.useRef)(void 0); - (0, import_react179.useEffect)(() => { - let funnelInteractionId2; - const handle = setTimeout(() => { - var _a3; - funnelNameSelector.current = evaluateSelectors(props2.funnelNameSelectors || [], getFunnelNameSelector()); - if (props2.funnelType === "single-page" && wizardCount.current > 0) { - return; - } - funnelState.current = "default"; - const singleStepFlowStepConfiguration = [ - { number: 1, isOptional: false, name: (_a3 = getNameFromSelector(funnelNameSelector.current)) !== null && _a3 !== void 0 ? _a3 : "" } - ]; - funnelInteractionId2 = FunnelMetrics.funnelStart({ - instanceIdentifier: props2.instanceIdentifier, - flowType: props2.flowType, - funnelNameSelector: funnelNameSelector.current, - optionalStepNumbers: props2.optionalStepNumbers, - funnelType: props2.funnelType, - totalFunnelSteps: props2.totalFunnelSteps, - componentVersion: PACKAGE_VERSION, - theme: isVisualRefresh ? "vr" : "classic", - funnelVersion: FUNNEL_VERSION, - stepConfiguration: stepConfiguration !== null && stepConfiguration !== void 0 ? stepConfiguration : singleStepFlowStepConfiguration - }); - setFunnelInteractionId(funnelInteractionId2); - }, 1); - return () => { - clearTimeout(handle); - if (props2.funnelType === "single-page" && wizardCount.current > 0) { - return; - } - if (funnelState.current === "validating") { - onFunnelComplete({ funnelInteractionId: funnelInteractionId2 }); - funnelState.current = "complete"; - } - if (funnelState.current === "complete") { - FunnelMetrics.funnelSuccessful({ funnelInteractionId: funnelInteractionId2 }); - } else { - onFunnelCancelled({ funnelInteractionId: funnelInteractionId2 }); - funnelState.current = "cancelled"; - } - }; - }, []); - const funnelSubmit = () => { - funnelState.current = "validating"; - const VALIDATION_WAIT_DELAY = 50; - const LOADING_WAIT_DELAY = 100; - const checkForCompleteness = () => { - if (funnelState.current === "complete") { - return; - } - if (loadingButtonCount.current > 0) { - setTimeout(checkForCompleteness, LOADING_WAIT_DELAY); - return; - } - if (errorCount.current === 0) { - onFunnelComplete({ funnelInteractionId }); - funnelState.current = "complete"; - } else { - funnelState.current = "default"; - } - }; - setTimeout(checkForCompleteness, VALIDATION_WAIT_DELAY); - }; - const funnelNextOrSubmitAttempt = () => setSubmissionAttempt((i) => i + 1); - const funnelCancel = () => { - }; - const funnelContextValue = { - funnelInteractionId, - setFunnelInteractionId, - funnelType: props2.funnelType, - optionalStepNumbers: props2.optionalStepNumbers, - totalFunnelSteps: props2.totalFunnelSteps, - funnelNameSelector: funnelNameSelector.current, - funnelSubmit, - funnelCancel, - submissionAttempt, - funnelNextOrSubmitAttempt, - funnelState, - errorCount, - loadingButtonCount, - latestFocusCleanupFunction, - isInFunnel: true, - wizardCount - }; - return import_react179.default.createElement(FunnelContext.Provider, { value: funnelContextValue }, children2); -}; -var AnalyticsFunnelStep = (props2) => { - return import_react179.default.createElement(InnerAnalyticsFunnelStep, Object.assign({}, props2, { key: props2.stepNumber })); -}; -function getSubStepConfiguration() { - const subSteps = Array.from(document.querySelectorAll(getSubStepAllSelector())); - const subStepConfiguration = subSteps.map((substep, index) => { - var _a2, _b, _c; - const name = (_c = (_b = (_a2 = substep.querySelector(getSubStepNameSelector())) === null || _a2 === void 0 ? void 0 : _a2.innerText) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : ""; - return { - name, - number: index + 1 - }; - }); - return subStepConfiguration; -} -function useStepChangeListener(stepNumber, handler) { - const subStepConfiguration = (0, import_react179.useRef)(/* @__PURE__ */ new Map()); - const SUBSTEP_CHANGE_DEBOUNCE = 50; - const listenForSubStepChanges = (0, import_react179.useRef)(false); - (0, import_react179.useEffect)(() => { - const handle = setTimeout(() => listenForSubStepChanges.current = true, SUBSTEP_CHANGE_DEBOUNCE); - return () => { - clearTimeout(handle); - listenForSubStepChanges.current = false; - }; - }, []); - (0, import_react179.useEffect)(() => { - const handle = setTimeout(() => subStepConfiguration.current.set(stepNumber, getSubStepConfiguration()), SUBSTEP_CHANGE_DEBOUNCE); - return () => { - clearTimeout(handle); - }; - }, [stepNumber]); - const stepChangeCallback = useDebounceCallback(() => { - if (!listenForSubStepChanges.current) { - return; - } - subStepConfiguration.current.set(stepNumber, getSubStepConfiguration()); - handler(subStepConfiguration.current.get(stepNumber)); - }, SUBSTEP_CHANGE_DEBOUNCE); - return { onStepChange: stepChangeCallback, subStepConfiguration }; -} -var InnerAnalyticsFunnelStep = (_a2) => { - var { children: children2, stepNumber, instanceIdentifier } = _a2, rest = __rest(_a2, ["children", "stepNumber", "instanceIdentifier"]); - const { funnelInteractionId, funnelNameSelector, funnelState, funnelType } = useFunnel(); - const parentStep = useFunnelStep(); - const parentStepExists = parentStep.isInStep; - const parentStepFunnelInteractionId = parentStep.funnelInteractionId; - const funnelStepProps = { [DATA_ATTR_FUNNEL_STEP]: stepNumber }; - const subStepCount = (0, import_react179.useRef)(0); - const stepNameSelector = rest.stepNameSelector || funnelNameSelector; - const { onStepChange, subStepConfiguration } = useStepChangeListener(stepNumber, (subStepConfiguration2) => { - var _a3; - if (!funnelInteractionId) { - return; - } - const stepName = (_a3 = getNameFromSelector(stepNameSelector)) !== null && _a3 !== void 0 ? _a3 : ""; - FunnelMetrics.funnelStepChange({ - instanceIdentifier, - funnelInteractionId, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector(), - totalSubSteps: subStepCount.current, - subStepConfiguration: subStepConfiguration2 - }); - }); - (0, import_react179.useEffect)(() => { - if (!funnelInteractionId) { - return; - } - if (parentStepExists && parentStepFunnelInteractionId) { - return; - } - const stepName = getNameFromSelector(stepNameSelector); - if (funnelState.current === "default") { - FunnelMetrics.funnelStepStart({ - instanceIdentifier, - funnelInteractionId, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector(), - totalSubSteps: subStepCount.current, - subStepConfiguration: getSubStepConfiguration() - }); - } - return () => { - if (funnelState.current !== "cancelled") { - FunnelMetrics.funnelStepComplete({ - instanceIdentifier, - funnelInteractionId, - stepNumber, - stepName, - stepNameSelector, - subStepAllSelector: getSubStepAllSelector(), - // eslint-disable-next-line react-hooks/exhaustive-deps - totalSubSteps: subStepCount.current - }); - } - }; - }, [ - instanceIdentifier, - funnelInteractionId, - stepNumber, - stepNameSelector, - funnelState, - parentStepExists, - funnelType, - parentStepFunnelInteractionId - ]); - const contextValue = { - instanceIdentifier, - stepNumber, - stepNameSelector, - funnelStepProps, - subStepCount, - isInStep: true, - funnelInteractionId, - onStepChange, - subStepConfiguration - }; - const effectiveContextValue = parentStepExists && parentStepFunnelInteractionId ? parentStep : contextValue; - return import_react179.default.createElement(FunnelStepContext.Provider, { value: effectiveContextValue }, typeof children2 === "function" ? children2(effectiveContextValue) : children2); -}; -var AnalyticsFunnelSubStep = ({ children: children2, instanceIdentifier }) => { - const subStepId = useUniqueId("substep"); - const subStepSelector = getSubStepSelector(subStepId); - const subStepNameSelector = getSubStepNameSelector(subStepId); - const subStepRef = (0, import_react179.useRef)(null); - const { subStepCount, onStepChange } = useFunnelStep(); - const mousePressed = (0, import_react179.useRef)(false); - const isFocusedSubStep = (0, import_react179.useRef)(false); - const focusCleanupFunction = (0, import_react179.useRef)(void 0); - const { funnelState, funnelInteractionId } = useFunnel(); - const { stepNumber, stepNameSelector } = useFunnelStep(); - const newContext = { - instanceIdentifier, - subStepSelector, - subStepNameSelector, - subStepId, - subStepRef, - mousePressed, - isFocusedSubStep, - focusCleanupFunction, - isNestedSubStep: false - }; - const inheritedContext = Object.assign(Object.assign({}, (0, import_react179.useContext)(FunnelSubStepContext)), { isNestedSubStep: true }); - const isNested = Boolean(inheritedContext.subStepId); - (0, import_react179.useEffect)(() => { - if (!isNested) { - subStepCount.current++; - onStepChange(); - return () => { - subStepCount.current--; - onStepChange(); - }; - } - }, [isNested, subStepCount, onStepChange]); - const context = isNested ? inheritedContext : newContext; - (0, import_react179.useEffect)(() => { - if (isNested || !subStepRef.current) { - return; - } - const onMouseDown = () => mousePressed.current = true; - const onMouseUp = () => __awaiter(void 0, void 0, void 0, function* () { - var _a2; - mousePressed.current = false; - if (!isFocusedSubStep.current) { - return; - } - yield new Promise((r2) => setTimeout(r2, 1)); - if (!subStepRef.current || !document.activeElement || !nodeBelongs(subStepRef.current, document.activeElement)) { - isFocusedSubStep.current = false; - (_a2 = focusCleanupFunction.current) === null || _a2 === void 0 ? void 0 : _a2.call(focusCleanupFunction); - } - }); - window.addEventListener("mousedown", onMouseDown); - window.addEventListener("mouseup", onMouseUp); - return () => { - window.removeEventListener("mousedown", onMouseDown); - window.removeEventListener("mouseup", onMouseUp); - }; - }, [ - funnelInteractionId, - funnelState, - stepNameSelector, - stepNumber, - subStepNameSelector, - subStepSelector, - focusCleanupFunction, - isNested, - subStepRef - ]); - return import_react179.default.createElement(FunnelSubStepContext.Provider, { value: context }, typeof children2 === "function" ? children2(context) : children2); -}; - -// node_modules/@cloudscape-design/components/expandable-section/expandable-section-container.js -var ExpandableSectionContainer = (_a2) => { - var { className: className2, children: children2, header, variant, expanded, disableContentPaddings, __internalRootRef } = _a2, rest = __rest(_a2, ["className", "children", "header", "variant", "expanded", "disableContentPaddings", "__internalRootRef"]); - if (variant === "container" || variant === "stacked") { - return import_react180.default.createElement( - AnalyticsFunnelSubStep, - null, - import_react180.default.createElement(InternalContainerAsSubstep, Object.assign({}, rest, { className: className2, header, variant: variant === "stacked" ? "stacked" : "default", disableContentPaddings: disableContentPaddings || !expanded, disableHeaderPaddings: true, __hiddenContent: !expanded, __internalRootRef }), children2) - ); - } - return import_react180.default.createElement( - "div", - Object.assign({ className: className2 }, rest, { ref: __internalRootRef }), - header, - children2 - ); -}; - -// node_modules/@cloudscape-design/components/expandable-section/expandable-section-header.js -var import_react183 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/header/internal.js -var import_react182 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/header/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/header/styles.scoped.css"; -var styles_css_default56 = { - "root": "awsui_root_2qdw9_1bpgx_99", - "refresh": "awsui_refresh_2qdw9_1bpgx_138", - "root-no-actions": "awsui_root-no-actions_2qdw9_1bpgx_138", - "root-variant-h2": "awsui_root-variant-h2_2qdw9_1bpgx_141", - "root-variant-h3": "awsui_root-variant-h3_2qdw9_1bpgx_141", - "root-has-description": "awsui_root-has-description_2qdw9_1bpgx_141", - "root-variant-h1": "awsui_root-variant-h1_2qdw9_1bpgx_150", - "main": "awsui_main_2qdw9_1bpgx_160", - "no-wrap": "awsui_no-wrap_2qdw9_1bpgx_170", - "main-variant-h1": "awsui_main-variant-h1_2qdw9_1bpgx_176", - "actions": "awsui_actions_2qdw9_1bpgx_184", - "actions-centered": "awsui_actions-centered_2qdw9_1bpgx_189", - "actions-variant-h1": "awsui_actions-variant-h1_2qdw9_1bpgx_192", - "actions-variant-h2": "awsui_actions-variant-h2_2qdw9_1bpgx_196", - "actions-variant-h3": "awsui_actions-variant-h3_2qdw9_1bpgx_200", - "title": "awsui_title_2qdw9_1bpgx_216", - "title-variant-h1": "awsui_title-variant-h1_2qdw9_1bpgx_221", - "title-variant-h2": "awsui_title-variant-h2_2qdw9_1bpgx_228", - "title-variant-h3": "awsui_title-variant-h3_2qdw9_1bpgx_234", - "virtual-space": "awsui_virtual-space_2qdw9_1bpgx_259", - "info": "awsui_info_2qdw9_1bpgx_265", - "description": "awsui_description_2qdw9_1bpgx_269", - "description-variant-h1": "awsui_description-variant-h1_2qdw9_1bpgx_276", - "description-variant-h2": "awsui_description-variant-h2_2qdw9_1bpgx_280", - "description-variant-h3": "awsui_description-variant-h3_2qdw9_1bpgx_287", - "heading": "awsui_heading_2qdw9_1bpgx_296", - "heading-variant-h1": "awsui_heading-variant-h1_2qdw9_1bpgx_307", - "heading-variant-h2": "awsui_heading-variant-h2_2qdw9_1bpgx_312", - "heading-variant-h3": "awsui_heading-variant-h3_2qdw9_1bpgx_317", - "heading-text": "awsui_heading-text_2qdw9_1bpgx_327", - "heading-text-variant-h1": "awsui_heading-text-variant-h1_2qdw9_1bpgx_330", - "heading-text-variant-h2": "awsui_heading-text-variant-h2_2qdw9_1bpgx_338", - "heading-text-variant-h3": "awsui_heading-text-variant-h3_2qdw9_1bpgx_346", - "counter": "awsui_counter_2qdw9_1bpgx_355" -}; - -// node_modules/@cloudscape-design/components/internal/context/collection-label-context.js -var import_react181 = __toESM(require_react()); -var CollectionLabelContext = (0, import_react181.createContext)({}); - -// node_modules/@cloudscape-design/components/header/internal.js -function InternalHeader(_a2) { - var { variant, headingTagOverride, children: children2, actions, counter: counter2, description, info, __internalRootRef = null, __disableActionsWrapping } = _a2, restProps = __rest(_a2, ["variant", "headingTagOverride", "children", "actions", "counter", "description", "info", "__internalRootRef", "__disableActionsWrapping"]); - const isMobile = useMobile(); - const HeadingTag = headingTagOverride !== null && headingTagOverride !== void 0 ? headingTagOverride : variant === "awsui-h1-sticky" ? "h1" : variant; - const { isStuck } = (0, import_react182.useContext)(StickyHeaderContext); - const baseProps = getBaseProps(restProps); - const isRefresh = useVisualRefresh(); - const assignHeaderId = (0, import_react182.useContext)(CollectionLabelContext).assignId; - const headingId = useUniqueId("heading"); - if (assignHeaderId !== void 0) { - assignHeaderId(headingId); - } - const dynamicVariant = !isMobile && isStuck ? "h2" : "h1"; - const variantOverride = variant === "awsui-h1-sticky" ? isRefresh ? dynamicVariant : "h2" : variant; - return import_react182.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default56.root, baseProps.className, styles_css_default56[`root-variant-${variantOverride}`], isRefresh && styles_css_default56.refresh, !actions && [styles_css_default56[`root-no-actions`]], description && [styles_css_default56[`root-has-description`]]), ref: __internalRootRef }), - import_react182.default.createElement( - "div", - { className: clsx_m_default(styles_css_default56.main, styles_css_default56[`main-variant-${variantOverride}`], isRefresh && styles_css_default56.refresh, __disableActionsWrapping && [styles_css_default56["no-wrap"]]) }, - import_react182.default.createElement( - "div", - { className: clsx_m_default(styles_css_default56.title, styles_css_default56[`title-variant-${variantOverride}`], isRefresh && styles_css_default56.refresh) }, - import_react182.default.createElement( - HeadingTag, - { className: clsx_m_default(styles_css_default56.heading, styles_css_default56[`heading-variant-${variantOverride}`]) }, - import_react182.default.createElement("span", Object.assign({}, HeadingTag === "h2" ? { [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_SUBSTEP_NAME } : {}, { className: clsx_m_default(styles_css_default56["heading-text"], styles_css_default56[`heading-text-variant-${variantOverride}`]), id: headingId }), children2), - counter2 !== void 0 && import_react182.default.createElement( - "span", - { className: styles_css_default56.counter }, - " ", - counter2 - ) - ), - info && import_react182.default.createElement( - InfoLinkLabelContext.Provider, - { value: headingId }, - import_react182.default.createElement("span", { className: styles_css_default56["virtual-space"] }, "  "), - import_react182.default.createElement("span", { className: styles_css_default56.info }, info) - ) - ), - actions && import_react182.default.createElement("div", { className: clsx_m_default(styles_css_default56.actions, styles_css_default56[`actions-variant-${variantOverride}`], isRefresh && styles_css_default56.refresh, !__disableActionsWrapping && [styles_css_default56["actions-centered"]]) }, actions) - ), - import_react182.default.createElement(Description2, { variantOverride }, description) - ); -} -function Description2({ children: children2, variantOverride }) { - const isRefresh = useVisualRefresh(); - return children2 && import_react182.default.createElement("p", { className: clsx_m_default(styles_css_default56.description, styles_css_default56[`description-variant-${variantOverride}`], isRefresh && styles_css_default56.refresh) }, children2) || null; -} - -// node_modules/@cloudscape-design/components/expandable-section/utils.js -function variantSupportsDescription(variant) { - return ["container", "default", "footer"].includes(variant); -} -function variantSupportsInteractiveElements(variant) { - return ["container", "compact"].includes(variant); -} - -// node_modules/@cloudscape-design/components/expandable-section/expandable-section-header.js -var componentName = "ExpandableSection"; -var ExpandableDeprecatedHeader = ({ id, className: className2, onClick, ariaLabel, ariaControls, expanded, children: children2, icon, onKeyUp, onKeyDown, variant }) => { - return import_react183.default.createElement( - "div", - { id, role: "button", className: clsx_m_default(className2, styles_css_default54["expand-button"], styles_css_default54["click-target"], styles_css_default54["header-deprecated"]), tabIndex: 0, onKeyUp, onKeyDown, onClick, "aria-label": ariaLabel, "aria-controls": ariaControls, "aria-expanded": expanded }, - import_react183.default.createElement("div", { className: clsx_m_default(styles_css_default54["icon-container"], styles_css_default54[`icon-container-${variant}`]) }, icon), - children2 - ); -}; -var ExpandableNavigationHeader = ({ id, className: className2, onClick, ariaLabelledBy, ariaLabel, ariaControls, expanded, children: children2, icon }) => { - return import_react183.default.createElement( - "div", - { id, className: clsx_m_default(className2, styles_css_default54["click-target"]) }, - import_react183.default.createElement("button", { className: clsx_m_default(styles_css_default54["icon-container"], styles_css_default54["expand-button"]), "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, "aria-controls": ariaControls, "aria-expanded": expanded, type: "button", onClick }, icon), - children2 - ); -}; -var ExpandableHeaderTextWrapper = ({ id, descriptionId, className: className2, onClick, ariaLabel, ariaControls, expanded, children: children2, icon, headerDescription, headerCounter, headerInfo, headerActions, variant, headingTagOverride, onKeyUp, onKeyDown }) => { - const isContainer = variant === "container"; - const HeadingTag = headingTagOverride || "div"; - const supportsInteractiveElements = variantSupportsInteractiveElements(variant); - const restrictClickableArea = supportsInteractiveElements && (headerInfo || headerActions); - const actions = supportsInteractiveElements && headerActions; - const description = variantSupportsDescription(variant) && headerDescription && import_react183.default.createElement("span", { id: descriptionId, className: styles_css_default54[`description-${variant}`] }, headerDescription); - const listeners = { onClick, onKeyDown, onKeyUp }; - const headerButtonListeners = restrictClickableArea ? listeners : void 0; - const headingTagListeners = !headerButtonListeners && !isContainer && description ? listeners : void 0; - const wrapperListeners = !headerButtonListeners && !headingTagListeners ? listeners : void 0; - const headerButton = import_react183.default.createElement( - "span", - Object.assign({ className: clsx_m_default(styles_css_default54["expand-button"], isContainer ? styles_css_default54["header-container-button"] : styles_css_default54["header-button"], headerButtonListeners && styles_css_default54["click-target"]), role: "button", tabIndex: 0, "aria-label": ariaLabel, "aria-labelledby": !ariaLabel && description ? id : void 0, "aria-describedby": description ? descriptionId : void 0, "aria-controls": ariaControls, "aria-expanded": expanded }, headerButtonListeners), - import_react183.default.createElement("span", { className: clsx_m_default(styles_css_default54["icon-container"], styles_css_default54[`icon-container-${variant}`]) }, icon), - import_react183.default.createElement("span", { id, className: styles_css_default54["header-text"] }, children2) - ); - return import_react183.default.createElement("div", Object.assign({ className: clsx_m_default(className2, wrapperListeners && styles_css_default54["click-target"]) }, wrapperListeners), isContainer ? import_react183.default.createElement(InternalHeader, { variant: "h2", description, counter: headerCounter, info: headerInfo, actions, headingTagOverride }, headerButton) : import_react183.default.createElement( - import_react183.default.Fragment, - null, - import_react183.default.createElement( - "div", - { className: clsx_m_default(actions && styles_css_default54["header-actions-wrapper"]) }, - import_react183.default.createElement(HeadingTag, Object.assign({ className: clsx_m_default(styles_css_default54["header-wrapper"], headingTagListeners && styles_css_default54["click-target"]) }, headingTagListeners), headerButton), - actions - ), - description && import_react183.default.createElement(Description2, { variantOverride: "h3" }, description) - )); -}; -var ExpandableSectionHeader = ({ id, descriptionId, className: className2, variant, header, headerText, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride, expanded, ariaControls, ariaLabel, ariaLabelledBy, onKeyUp, onKeyDown, onClick }) => { - const icon = import_react183.default.createElement(internal_default, { size: variant === "container" ? "medium" : "normal", className: clsx_m_default(styles_css_default54.icon, expanded && styles_css_default54.expanded), name: "caret-down-filled" }); - const defaultHeaderProps = { - id, - icon, - expanded, - ariaControls, - ariaLabel, - onClick, - variant - }; - if ((headerCounter || headerInfo || headerActions) && !variantSupportsInteractiveElements(variant) && isDevelopment2) { - warnOnce(componentName, 'The `headerCounter`, `headerInfo` and `headerActions` props are only supported for the "container" variant.'); - } - if (headerDescription && !variantSupportsDescription(variant) && isDevelopment2) { - warnOnce(componentName, `The \`headerDescription\` prop is not supported for the ${variant} variant.`); - } - const wrapperClassName = clsx_m_default(styles_css_default54.wrapper, styles_css_default54[`wrapper-${variant}`], expanded && styles_css_default54["wrapper-expanded"]); - if (variant === "navigation") { - return import_react183.default.createElement(ExpandableNavigationHeader, Object.assign({ className: clsx_m_default(className2, wrapperClassName), ariaLabelledBy }, defaultHeaderProps), headerText !== null && headerText !== void 0 ? headerText : header); - } - if (headerText) { - return import_react183.default.createElement(ExpandableHeaderTextWrapper, Object.assign({ className: clsx_m_default(className2, wrapperClassName, expanded && styles_css_default54.expanded), descriptionId, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride, onKeyUp, onKeyDown }, defaultHeaderProps), headerText); - } - if (variant === "container" && header && isDevelopment2) { - warnOnce(componentName, "Use `headerText` instead of `header` to provide the button within the heading for a11y."); - } - return import_react183.default.createElement(ExpandableDeprecatedHeader, Object.assign({ className: clsx_m_default(className2, wrapperClassName, styles_css_default54.focusable, expanded && styles_css_default54.expanded), onKeyUp, onKeyDown }, defaultHeaderProps), header); -}; - -// node_modules/@cloudscape-design/components/expandable-section/internal.js -function InternalExpandableSection(_a2) { - var { expanded: controlledExpanded, defaultExpanded, onChange, variant = "default", children: children2, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef } = _a2, props2 = __rest(_a2, ["expanded", "defaultExpanded", "onChange", "variant", "children", "header", "headerText", "headerCounter", "headerDescription", "headerInfo", "headerActions", "headingTagOverride", "disableContentPaddings", "headerAriaLabel", "__internalRootRef"]); - const ref = (0, import_react184.useRef)(null); - const controlId = useUniqueId(); - const triggerControlId = `${controlId}-trigger`; - const descriptionId = `${controlId}-description`; - const baseProps = getBaseProps(props2); - const [expanded, setExpanded] = useControllable2(controlledExpanded, onChange, defaultExpanded, { - componentName: "ExpandableSection", - controlledProp: "expanded", - changeHandler: "onChange" - }); - const onExpandChange = (0, import_react184.useCallback)((expanded2) => { - setExpanded(expanded2); - fireNonCancelableEvent(onChange, { expanded: expanded2 }); - }, [onChange, setExpanded]); - const onClick = (0, import_react184.useCallback)(() => { - onExpandChange(!expanded); - }, [onExpandChange, expanded]); - const onKeyUp = (0, import_react184.useCallback)((event) => { - const interactionKeys = [KeyCode.enter, KeyCode.space]; - if (interactionKeys.indexOf(event.keyCode) !== -1) { - onExpandChange(!expanded); - } - }, [onExpandChange, expanded]); - const onKeyDown = (0, import_react184.useCallback)((event) => { - if (event.keyCode === KeyCode.space) { - event.preventDefault(); - } - }, []); - const triggerProps = { - ariaControls: controlId, - ariaLabel: headerAriaLabel, - ariaLabelledBy: headerAriaLabel ? void 0 : triggerControlId, - onKeyUp, - onKeyDown, - onClick - }; - const baseVariant = variant === "stacked" ? "container" : variant; - return import_react184.default.createElement( - ExpandableSectionContainer, - Object.assign({}, baseProps, { expanded, className: clsx_m_default(baseProps.className, styles_css_default54.root), variant, disableContentPaddings, header: import_react184.default.createElement(ExpandableSectionHeader, Object.assign({ id: triggerControlId, descriptionId, className: clsx_m_default(styles_css_default54.header, styles_css_default54[`header-${baseVariant}`]), variant: baseVariant, expanded: !!expanded, header, headerText, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride }, triggerProps)), __internalRootRef }), - import_react184.default.createElement( - CSSTransition_default, - { in: expanded, timeout: 30, classNames: { enter: styles_css_default54["content-enter"] }, nodeRef: ref }, - import_react184.default.createElement("div", { id: controlId, ref, className: clsx_m_default(styles_css_default54.content, styles_css_default54[`content-${baseVariant}`], expanded && styles_css_default54["content-expanded"]), role: "group", "aria-label": triggerProps.ariaLabel, "aria-labelledby": triggerProps.ariaLabelledBy, "aria-describedby": variantSupportsDescription(baseVariant) && headerDescription ? descriptionId : void 0 }, children2) - ) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-series-details/series-details-text.js -function getSeriesDetailsText(element) { - const elementsWithText = Array.from(element.querySelectorAll(`.${styles_css_default53.announced},.${styles_css_default54.header}`)); - return elementsWithText.map((element2) => { - var _a2; - if (element2 instanceof HTMLElement) { - return (_a2 = element2.innerText) === null || _a2 === void 0 ? void 0 : _a2.split("\n").map((s2) => s2.trim()).join(" ").trim(); - } - }).filter(Boolean).join(", "); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-series-details/index.js -var chart_series_details_default = (0, import_react185.memo)((0, import_react185.forwardRef)(ChartSeriesDetails)); -function ChartSeriesDetails(_a2, ref) { - var { details, expandedSeries, setPopoverText, setExpandedState, compactList } = _a2, restProps = __rest(_a2, ["details", "expandedSeries", "setPopoverText", "setExpandedState", "compactList"]); - const baseProps = getBaseProps(restProps); - const className2 = clsx_m_default(baseProps.className, styles_css_default53.root); - const detailsRef = (0, import_react185.useRef)(null); - const mergedRef = useMergeRefs(ref, detailsRef); - (0, import_react185.useEffect)(() => { - if (setPopoverText) { - if (detailsRef.current) { - setPopoverText(getSeriesDetailsText(detailsRef.current)); - } - return () => { - setPopoverText(""); - }; - } - }, [details, setPopoverText]); - const isExpanded = (seriesTitle) => !!expandedSeries && expandedSeries.has(seriesTitle); - return import_react185.default.createElement( - "div", - Object.assign({}, baseProps, { className: className2, ref: mergedRef }), - import_react185.default.createElement("ul", { className: clsx_m_default(styles_css_default53.list, compactList && styles_css_default53.compact) }, details.map(({ key: key2, value, markerType, color: color2, isDimmed, subItems, expandableId }, index) => import_react185.default.createElement("li", { key: index, className: clsx_m_default({ - [styles_css_default53.dimmed]: isDimmed, - [styles_css_default53["list-item"]]: true, - [styles_css_default53["with-sub-items"]]: subItems === null || subItems === void 0 ? void 0 : subItems.length, - [styles_css_default53.expandable]: !!expandableId - }) }, (subItems === null || subItems === void 0 ? void 0 : subItems.length) && !!expandableId ? import_react185.default.createElement(ExpandableSeries, { itemKey: key2, value, markerType, color: color2, subItems, expanded: isExpanded(expandableId), setExpandedState: (state) => setExpandedState && setExpandedState(expandableId, state) }) : import_react185.default.createElement(NonExpandableSeries, { itemKey: key2, value, markerType, color: color2, subItems })))) - ); -} -function SubItems({ items, expandable, expanded }) { - return import_react185.default.createElement("ul", { className: clsx_m_default(styles_css_default53["sub-items"], expandable && styles_css_default53.expandable) }, items.map(({ key: key2, value }, index) => import_react185.default.createElement( - "li", - { key: index, className: clsx_m_default(styles_css_default53["inner-list-item"], styles_css_default53["key-value-pair"], (expanded || !expandable) && styles_css_default53.announced) }, - import_react185.default.createElement("span", { className: styles_css_default53.key }, key2), - import_react185.default.createElement("span", { className: styles_css_default53.value }, value) - ))); -} -function ExpandableSeries({ itemKey, value, subItems, markerType, color: color2, expanded, setExpandedState }) { - return import_react185.default.createElement( - "div", - { className: styles_css_default53["expandable-section"] }, - markerType && color2 && import_react185.default.createElement(chart_series_marker_default, { type: markerType, color: color2 }), - import_react185.default.createElement( - "div", - { className: styles_css_default53["full-width"] }, - import_react185.default.createElement( - InternalExpandableSection, - { variant: "compact", headerText: itemKey, headerActions: import_react185.default.createElement("span", { className: clsx_m_default(styles_css_default53.value, styles_css_default53.expandable) }, value), expanded, onChange: ({ detail }) => setExpandedState(detail.expanded) }, - import_react185.default.createElement(SubItems, { items: subItems, expandable: true, expanded }) - ) - ) - ); -} -function NonExpandableSeries({ itemKey, value, subItems, markerType, color: color2 }) { - return import_react185.default.createElement( - import_react185.default.Fragment, - null, - import_react185.default.createElement( - "div", - { className: clsx_m_default(styles_css_default53["key-value-pair"], styles_css_default53.announced) }, - import_react185.default.createElement( - "div", - { className: styles_css_default53.key }, - markerType && color2 && import_react185.default.createElement(chart_series_marker_default, { type: markerType, color: color2 }), - import_react185.default.createElement("span", null, itemKey) - ), - import_react185.default.createElement("span", { className: styles_css_default53.value }, value) - ), - subItems && import_react185.default.createElement(SubItems, { items: subItems }) - ); -} - -// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/index.js -var import_react186 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/styles.scoped.css"; -var styles_css_default57 = { - "root": "awsui_root_1t8ew_td4bm_9" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/index.js -function ChartPopoverFooter({ children: children2 }) { - return import_react186.default.createElement("div", { className: styles_css_default57.root }, children2); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/chart-popover.js -function AreaChartPopover({ model, highlightDetails, dismissAriaLabel, footer, size: size2, onBlur }) { - if (!highlightDetails) { - return null; - } - const popoverProps = { - title: highlightDetails.formattedX, - trackRef: model.refs.verticalMarker, - trackKey: highlightDetails.highlightIndex, - dismissButton: highlightDetails.isPopoverPinned, - onDismiss: model.handlers.onPopoverDismiss, - onMouseLeave: model.handlers.onPopoverLeave, - ref: model.refs.popoverRef - }; - return import_react187.default.createElement( - chart_popover_default, - Object.assign({}, popoverProps, { container: model.refs.container.current, dismissAriaLabel, size: size2, onBlur }), - import_react187.default.createElement(chart_series_details_default, { details: highlightDetails.seriesDetails }), - import_react187.default.createElement("div", { className: styles_css_default51["popover-divider"] }), - import_react187.default.createElement(chart_series_details_default, { details: highlightDetails.totalDetails }), - footer && import_react187.default.createElement(ChartPopoverFooter, null, footer) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/highlighted-point.js -var import_react189 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/highlighted-point.js -var import_react188 = __toESM(require_react()); -var highlighted_point_default = (0, import_react188.memo)((0, import_react188.forwardRef)(HighlightedPoint)); -function HighlightedPoint({ point: point5, role = "group", ariaLabel, ariaHasPopup, ariaExpanded }, ref) { - if (!point5) { - return null; - } - return import_react188.default.createElement( - "g", - { ref, role, "aria-label": ariaLabel, "aria-haspopup": ariaHasPopup, "aria-expanded": ariaExpanded }, - import_react188.default.createElement("circle", { key: point5.key, "aria-hidden": "true", className: styles_css_default50["vertical-marker-circle-active"], cx: point5.x, cy: point5.y, r: 4, stroke: point5.color, fill: point5.color }) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/highlighted-point.js -var highlighted_point_default2 = (0, import_react189.memo)((0, import_react189.forwardRef)(AreaHighlightedPoint)); -function AreaHighlightedPoint({ model, ariaLabel }, ref) { - const highlightedPoint = useSelector(model.interactions, (state) => state.highlightedPoint); - const isPopoverPinned = useSelector(model.interactions, (state) => state.isPopoverPinned); - const point5 = highlightedPoint ? { - key: `${highlightedPoint.index.x}:${highlightedPoint.index.s}`, - x: highlightedPoint.scaled.x, - y: highlightedPoint.scaled.y1, - color: model.getInternalSeries(model.series[highlightedPoint.index.s]).color - } : null; - return import_react189.default.createElement(highlighted_point_default, { ref, point: point5, role: "button", ariaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned }); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/vertical-marker.js -var import_react191 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/vertical-marker.js -var import_react190 = __toESM(require_react()); -var vertical_marker_default = (0, import_react190.memo)((0, import_react190.forwardRef)(VerticalMarker)); -function VerticalMarker({ height, showPoints = true, showLine = true, points }, ref) { - const [firstPoint] = points || []; - return import_react190.default.createElement( - "g", - null, - import_react190.default.createElement("line", { ref, "aria-hidden": "true", className: styles_css_default50["vertical-marker"], style: { visibility: showLine && firstPoint ? "visible" : "hidden" }, x1: firstPoint === null || firstPoint === void 0 ? void 0 : firstPoint.x, x2: firstPoint === null || firstPoint === void 0 ? void 0 : firstPoint.x, y1: 0, y2: height }), - showPoints && points && points.map((point5) => import_react190.default.createElement("circle", { key: point5.key, "aria-hidden": "true", className: styles_css_default50["vertical-marker-circle"], cx: point5.x, cy: point5.y, r: 4, stroke: point5.color })) - ); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/vertical-marker.js -var vertical_marker_default2 = (0, import_react191.memo)(AreaVerticalMarker); -function AreaVerticalMarker({ model }) { - const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); - const verticalMarker = (highlightedX || []).map((point5) => ({ - key: `${point5.index.x}:${point5.index.s}`, - x: point5.scaled.x, - y: point5.scaled.y1, - color: model.getInternalSeries(model.series[point5.index.s]).color - })); - return import_react191.default.createElement(vertical_marker_default, { height: model.height, points: verticalMarker, ref: model.refs.verticalMarker }); -} - -// node_modules/@cloudscape-design/components/area-chart/elements/use-highlight-details.js -function useHighlightDetails({ model, xTickFormatter, yTickFormatter, detailTotalFormatter, detailTotalLabel }) { - const i18n = useInternalI18n("area-chart"); - const hX = useSelector(model.interactions, (state) => state.highlightedX); - const hPoint = useSelector(model.interactions, (state) => state.highlightedPoint); - const isPopoverPinned = useSelector(model.interactions, (state) => state.isPopoverPinned); - if (!hX) { - return null; - } - const [firstPoint] = hX; - const highlightIndex = firstPoint.index.x; - const seriesPoints = [...model.computed.plot.xs[highlightIndex]]; - const detailsTotal = seriesPoints.reduce((total, point5) => total + point5.value, 0); - const formattedX = xTickFormatter ? xTickFormatter(firstPoint.x) : firstPoint.x.toString(); - const seriesTitle = hPoint ? getInternalSeries(hPoint).title : ""; - const formattedY = hPoint ? getInternalSeries(hPoint).formatValue(hPoint.value, hPoint.x) : ""; - const seriesDetails = seriesPoints.map((point5) => { - const { title, formatValue: formatValue2, color: color2, markerType } = getInternalSeries(point5); - const isDimmed = Boolean(hPoint) && point5 !== hPoint; - return { key: title, value: formatValue2(point5.value, point5.x), color: color2, markerType, isDimmed }; - }); - const totalDetails = [ - { - key: i18n("i18nStrings.detailTotalLabel", detailTotalLabel) || "", - value: detailTotalFormatter ? detailTotalFormatter(detailsTotal) : yTickFormatter ? yTickFormatter(detailsTotal) : detailsTotal - } - ]; - const pointDetails = hPoint ? seriesDetails[hPoint.index.s] : null; - const activeLabel = `${seriesTitle} ${formattedX} ${formattedY}, ${totalDetails[0].key} ${totalDetails[0].value}`; - return { - isPopoverPinned, - highlightIndex, - formattedX, - seriesTitle, - formattedY, - activeLabel, - seriesDetails, - totalDetails, - pointDetails - }; - function getInternalSeries(point5) { - return model.getInternalSeries(model.series[point5.index.s]); - } -} - -// node_modules/@cloudscape-design/components/internal/utils/use-container-width.js -function useContainerWidth(defaultValue5 = 0, threshold = 1) { - const [width, ref] = useContainerQuery((rect, prev) => { - if (prev === null) { - return rect.contentBoxWidth; - } - return Math.abs(prev - rect.contentBoxWidth) >= threshold ? rect.contentBoxWidth : prev; - }); - return [width !== null && width !== void 0 ? width : defaultValue5, ref]; -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/chart-container.js -var import_react192 = __toESM(require_react()); -var CONTENT_MIN_HEIGHT_BOUNDARY = 40; -var CartesianChartContainer = (0, import_react192.forwardRef)(({ minHeight, fitHeight, leftAxisLabel, leftAxisLabelMeasure, bottomAxisLabel, chartPlot, popover }, ref) => { - if (fitHeight) { - return import_react192.default.createElement( - "div", - { className: clsx_m_default(styles_css_default50["chart-container"], styles_css_default50["fit-height"]), ref }, - leftAxisLabel, - import_react192.default.createElement( - "div", - { className: clsx_m_default(styles_css_default50["chart-container-outer"], styles_css_default50["fit-height"]) }, - leftAxisLabelMeasure, - import_react192.default.createElement( - "div", - { className: styles_css_default50["chart-container-inner"] }, - import_react192.default.createElement( - "div", - { className: clsx_m_default(styles_css_default50["chart-container-plot-wrapper"], styles_css_default50["fit-height"]), style: { minHeight: Math.max(minHeight, CONTENT_MIN_HEIGHT_BOUNDARY) } }, - import_react192.default.createElement("div", { className: clsx_m_default(styles_css_default50["chart-container-plot"], styles_css_default50["fit-height"]) }, chartPlot) - ), - import_react192.default.createElement("div", { className: clsx_m_default(styles_css_default50["chart-container-bottom-labels"], styles_css_default50["fit-height"]) }, bottomAxisLabel) - ), - popover - ) - ); - } - return import_react192.default.createElement( - "div", - { className: styles_css_default50["chart-container"], ref }, - leftAxisLabel, - import_react192.default.createElement( - "div", - { className: styles_css_default50["chart-container-outer"] }, - leftAxisLabelMeasure, - import_react192.default.createElement( - "div", - { className: styles_css_default50["chart-container-inner"] }, - chartPlot, - bottomAxisLabel - ), - popover - ) - ); -}); - -// node_modules/@cloudscape-design/components/area-chart/chart-container.js -var DEFAULT_CHART_WIDTH = 500; -var LEFT_LABELS_MARGIN = 16; -var BOTTOM_LABELS_OFFSET = 12; -var chart_container_default = (0, import_react193.memo)(ChartContainer); -function ChartContainer({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel } = {}, fitHeight, minHeight, xTickFormatter = deprecatedXTickFormatter, yTickFormatter = deprecatedYTickFormatter, detailTotalFormatter = deprecatedDetailTotalFormatter }) { - const [leftLabelsWidth, setLeftLabelsWidth] = (0, import_react193.useState)(0); - const [containerWidth, containerWidthRef] = useContainerWidth(DEFAULT_CHART_WIDTH); - const maxLeftLabelsWidth = Math.round(containerWidth / 2); - const bottomLabelsProps = useBottomLabels({ - ticks: model.computed.xTicks, - scale: model.computed.xScale, - tickFormatter: xTickFormatter - }); - const plotWidth = Math.max(0, containerWidth - leftLabelsWidth - LEFT_LABELS_MARGIN); - (0, import_react193.useEffect)(() => { - autoWidth(plotWidth); - }, [autoWidth, plotWidth]); - const highlightDetails = useHighlightDetails({ - model, - xTickFormatter, - yTickFormatter, - detailTotalFormatter, - detailTotalLabel - }); - const highlightedPointRef = (0, import_react193.useRef)(null); - const mergedRef = useMergeRefs(containerWidthRef, model.refs.container); - const isPointHighlighted = model.interactions.get().highlightedPoint !== null; - const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); - const detailPopoverFooterContent = (0, import_react193.useMemo)(() => detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX[0].x) : null, [detailPopoverFooter, highlightedX]); - return import_react193.default.createElement(CartesianChartContainer, { ref: mergedRef, minHeight: minHeight + bottomLabelsProps.height, fitHeight: !!fitHeight, leftAxisLabel: import_react193.default.createElement(axis_label_default, { axis: "y", position: "left", title: yTitle }), leftAxisLabelMeasure: import_react193.default.createElement(labels_measure_default, { scale: model.computed.yScale, ticks: model.computed.yTicks, tickFormatter: yTickFormatter, autoWidth: setLeftLabelsWidth, maxLabelsWidth: maxLeftLabelsWidth }), bottomAxisLabel: import_react193.default.createElement(axis_label_default, { axis: "x", position: "bottom", title: xTitle }), chartPlot: import_react193.default.createElement( - chart_plot_default, - { ref: model.refs.plot, width: "100%", height: fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : model.height, offsetBottom: bottomLabelsProps.height, ariaLabel, ariaLabelledby, ariaDescription, ariaRoleDescription: chartAriaRoleDescription, activeElementKey: !(highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.isPopoverPinned) && (highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.activeLabel), activeElementRef: isPointHighlighted ? highlightedPointRef : model.refs.verticalMarker, activeElementFocusOffset: isPointHighlighted ? 3 : { x: 8, y: 0 }, isClickable: !(highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.isPopoverPinned), onMouseMove: model.handlers.onSVGMouseMove, onMouseOut: model.handlers.onSVGMouseOut, onClick: model.handlers.onSVGMouseDown, onKeyDown: model.handlers.onSVGKeyDown, onApplicationFocus: model.handlers.onApplicationFocus, onApplicationBlur: model.handlers.onApplicationBlur }, - import_react193.default.createElement("line", { ref: model.refs.plotMeasure, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: "none" } }), - import_react193.default.createElement(left_labels_default, { plotWidth: model.width, plotHeight: model.height, scale: model.computed.yScale, ticks: model.computed.yTicks, tickFormatter: yTickFormatter, title: yTitle, ariaRoleDescription: yAxisAriaRoleDescription, maxLabelsWidth: maxLeftLabelsWidth }), - import_react193.default.createElement(data_series_default, { model }), - import_react193.default.createElement(bottom_labels_default, Object.assign({}, bottomLabelsProps, { width: model.width, height: model.height, scale: model.computed.xScale, title: xTitle, ariaRoleDescription: xAxisAriaRoleDescription, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET, offsetRight: BOTTOM_LABELS_OFFSET })), - import_react193.default.createElement(emphasized_baseline_default, { width: model.width, height: model.height, scale: model.computed.yScale }), - import_react193.default.createElement(vertical_marker_default2, { model }), - import_react193.default.createElement(highlighted_point_default2, { ref: highlightedPointRef, model, ariaLabel: highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.activeLabel }) - ), popover: import_react193.default.createElement(AreaChartPopover, { model, highlightDetails, dismissAriaLabel: detailPopoverDismissAriaLabel, size: detailPopoverSize, footer: detailPopoverFooterContent, onBlur: model.handlers.onApplicationBlur }) }); -} - -// node_modules/@cloudscape-design/components/area-chart/model/use-chart-model.js -var import_react195 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/area-chart/model/utils.js -var EPSILON = 1e-13; -function computeDomainX(series) { - const xValues = getXValues(series); - if (xValues.length === 0) { - return []; - } - if (typeof xValues[0] === "string") { - return uniq(xValues); - } - return xValues.reduce(([min3, max3], x2) => [x2 < min3 ? x2 : min3, max3 < x2 ? x2 : max3], [xValues[0], xValues[0]]); -} -function computeDomainY(series, scaleType) { - let min3 = Number.POSITIVE_INFINITY; - let max3 = Number.NEGATIVE_INFINITY; - series.forEach((s2) => { - if (s2.type === "threshold") { - min3 = Math.min(min3, s2.y); - max3 = Math.max(max3, s2.y); - } - }); - getXValues(series).forEach((_, xIndex) => { - var _a2; - let stackY = scaleType === "linear" ? 0 : EPSILON; - for (const s2 of series) { - if (s2.type === "area") { - stackY = stackY + (((_a2 = s2.data[xIndex]) === null || _a2 === void 0 ? void 0 : _a2.y) || 0); - min3 = Math.min(min3, stackY); - max3 = Math.max(max3, stackY); - } - } - }); - if (min3 === Number.POSITIVE_INFINITY) { - return []; - } - if (scaleType === "log" && min3 === 0 && max3 > 1) { - return [1, max3]; - } - return [min3, max3]; -} -function computePlotPoints(series, xScale, yScale) { - const xValues = getXValues(series); - const xy = []; - const xs = []; - const sx = []; - getVisibleData(xValues, xScale).forEach(({ x: x2, scaledX }, xIndex) => { - let stackY = yScale.scaleType === "linear" ? 0 : EPSILON; - const points = []; - series.forEach((s2, sIndex) => { - var _a2; - if (s2.type === "threshold") { - const scaledY = yScale.d3Scale(s2.y) || 0; - points.push({ - x: x2, - y0: s2.y, - y1: s2.y, - scaled: { x: scaledX, y0: scaledY, y1: scaledY }, - index: { x: xIndex, s: sIndex, y: 0 }, - value: 0 - }); - } else { - const value = ((_a2 = s2.data[xIndex]) === null || _a2 === void 0 ? void 0 : _a2.y) || 0; - const y0 = stackY; - const y1 = stackY + value; - points.push({ - x: x2, - y0, - y1, - scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 }, - index: { x: xIndex, s: sIndex, y: 0 }, - value - }); - stackY = y1; - } - }); - points.sort((p1, p2) => p1.y1 - p2.y1).forEach((point5, index) => { - point5.index.y = index; - insertIntoMatrix(xy, point5.index.x, point5.index.y, point5); - insertIntoMatrix(xs, point5.index.x, point5.index.s, point5); - insertIntoMatrix(sx, point5.index.s, point5.index.x, point5); - }); - }); - return { xy, xs, sx }; -} -function findClosest(sortedArray, target, getter) { - if (sortedArray.length === 0) { - throw new Error("Invariant violation: array is empty."); - } - const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]); - const compare = (x2) => isAscending ? getter(x2) < target : getter(x2) > target; - const delta = (x2) => Math.abs(getter(x2) - target); - let lo = 0; - let hi = sortedArray.length - 1; - while (hi - lo > 1) { - const mid = Math.floor((lo + hi) / 2); - if (compare(sortedArray[mid])) { - lo = mid; - } else { - hi = mid; - } - } - return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi]; -} -function circleIndex(index, [from, to]) { - if (index < from) { - return to; - } - if (index > to) { - return from; - } - return index; -} -function isSeriesValid(series) { - var _a2; - const sampleXValues = getXValues(series); - for (const s2 of series) { - if (s2.type === "area") { - for (let i = 0; i < Math.max(s2.data.length, sampleXValues.length); i++) { - if (((_a2 = s2.data[i]) === null || _a2 === void 0 ? void 0 : _a2.x) !== sampleXValues[i]) { - return false; - } - } - } - } - return true; -} -function getXValues(series) { - for (const s2 of series) { - if (s2.type === "area") { - return s2.data.map(({ x: x2 }) => x2); - } - } - return []; -} -function getVisibleData(data, xScale) { - const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; - const visibleData = []; - for (const x2 of data) { - const scaledX = xScale.d3Scale(x2); - if (scaledX !== void 0) { - visibleData.push({ x: x2, scaledX: scaledX + scaledOffsetX }); - } - } - return visibleData; -} -function insertIntoMatrix(matrix, row, col, value) { - if (!matrix[row]) { - matrix[row] = []; - } - matrix[row][col] = value; -} -function uniq(arr) { - const set2 = /* @__PURE__ */ new Set(); - const uniqArray = []; - for (const value of arr) { - if (!set2.has(value)) { - set2.add(value); - uniqArray.push(value); - } - } - return uniqArray; -} - -// node_modules/@babel/runtime/helpers/esm/typeof.js -function _typeof(o) { - "@babel/helpers - typeof"; - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof(o); -} - -// node_modules/date-fns/esm/_lib/toInteger/index.js -function toInteger(dirtyNumber) { - if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { - return NaN; - } - var number2 = Number(dirtyNumber); - if (isNaN(number2)) { - return number2; - } - return number2 < 0 ? Math.ceil(number2) : Math.floor(number2); -} - -// node_modules/date-fns/esm/_lib/requiredArgs/index.js -function requiredArgs(required, args) { - if (args.length < required) { - throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present"); - } -} - -// node_modules/date-fns/esm/toDate/index.js -function toDate(argument) { - requiredArgs(1, arguments); - var argStr = Object.prototype.toString.call(argument); - if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") { - return new Date(argument.getTime()); - } else if (typeof argument === "number" || argStr === "[object Number]") { - return new Date(argument); - } else { - if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") { - console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); - console.warn(new Error().stack); - } - return /* @__PURE__ */ new Date(NaN); - } -} - -// node_modules/date-fns/esm/addDays/index.js -function addDays(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var amount = toInteger(dirtyAmount); - if (isNaN(amount)) { - return /* @__PURE__ */ new Date(NaN); - } - if (!amount) { - return date2; - } - date2.setDate(date2.getDate() + amount); - return date2; -} - -// node_modules/date-fns/esm/addMonths/index.js -function addMonths(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var amount = toInteger(dirtyAmount); - if (isNaN(amount)) { - return /* @__PURE__ */ new Date(NaN); - } - if (!amount) { - return date2; - } - var dayOfMonth = date2.getDate(); - var endOfDesiredMonth = new Date(date2.getTime()); - endOfDesiredMonth.setMonth(date2.getMonth() + amount + 1, 0); - var daysInMonth = endOfDesiredMonth.getDate(); - if (dayOfMonth >= daysInMonth) { - return endOfDesiredMonth; - } else { - date2.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); - return date2; - } -} - -// node_modules/date-fns/esm/add/index.js -function add(dirtyDate, duration) { - requiredArgs(2, arguments); - if (!duration || _typeof(duration) !== "object") return /* @__PURE__ */ new Date(NaN); - var years = duration.years ? toInteger(duration.years) : 0; - var months = duration.months ? toInteger(duration.months) : 0; - var weeks = duration.weeks ? toInteger(duration.weeks) : 0; - var days = duration.days ? toInteger(duration.days) : 0; - var hours = duration.hours ? toInteger(duration.hours) : 0; - var minutes = duration.minutes ? toInteger(duration.minutes) : 0; - var seconds = duration.seconds ? toInteger(duration.seconds) : 0; - var date2 = toDate(dirtyDate); - var dateWithMonths = months || years ? addMonths(date2, months + years * 12) : date2; - var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths; - var minutesToAdd = minutes + hours * 60; - var secondsToAdd = seconds + minutesToAdd * 60; - var msToAdd = secondsToAdd * 1e3; - var finalDate = new Date(dateWithDays.getTime() + msToAdd); - return finalDate; -} - -// node_modules/date-fns/esm/addMilliseconds/index.js -function addMilliseconds(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var timestamp = toDate(dirtyDate).getTime(); - var amount = toInteger(dirtyAmount); - return new Date(timestamp + amount); -} - -// node_modules/date-fns/esm/_lib/defaultOptions/index.js -var defaultOptions = {}; -function getDefaultOptions() { - return defaultOptions; -} - -// node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js -function getTimezoneOffsetInMilliseconds(date2) { - var utcDate2 = new Date(Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), date2.getMinutes(), date2.getSeconds(), date2.getMilliseconds())); - utcDate2.setUTCFullYear(date2.getFullYear()); - return date2.getTime() - utcDate2.getTime(); -} - -// node_modules/date-fns/esm/startOfDay/index.js -function startOfDay(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - date2.setHours(0, 0, 0, 0); - return date2; -} - -// node_modules/date-fns/esm/differenceInCalendarDays/index.js -var MILLISECONDS_IN_DAY = 864e5; -function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var startOfDayLeft = startOfDay(dirtyDateLeft); - var startOfDayRight = startOfDay(dirtyDateRight); - var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft); - var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY); -} - -// node_modules/date-fns/esm/addMinutes/index.js -var MILLISECONDS_IN_MINUTE = 6e4; -function addMinutes(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE); -} - -// node_modules/date-fns/esm/addWeeks/index.js -function addWeeks(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - var days = amount * 7; - return addDays(dirtyDate, days); -} - -// node_modules/date-fns/esm/addYears/index.js -function addYears(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - return addMonths(dirtyDate, amount * 12); -} - -// node_modules/date-fns/esm/max/index.js -function max2(dirtyDatesArray) { - requiredArgs(1, arguments); - var datesArray; - if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { - datesArray = dirtyDatesArray; - } else if (_typeof(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { - datesArray = Array.prototype.slice.call(dirtyDatesArray); - } else { - return /* @__PURE__ */ new Date(NaN); - } - var result; - datesArray.forEach(function(dirtyDate) { - var currentDate = toDate(dirtyDate); - if (result === void 0 || result < currentDate || isNaN(Number(currentDate))) { - result = currentDate; - } - }); - return result || /* @__PURE__ */ new Date(NaN); -} - -// node_modules/date-fns/esm/min/index.js -function min2(dirtyDatesArray) { - requiredArgs(1, arguments); - var datesArray; - if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { - datesArray = dirtyDatesArray; - } else if (_typeof(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { - datesArray = Array.prototype.slice.call(dirtyDatesArray); - } else { - return /* @__PURE__ */ new Date(NaN); - } - var result; - datesArray.forEach(function(dirtyDate) { - var currentDate = toDate(dirtyDate); - if (result === void 0 || result > currentDate || isNaN(currentDate.getDate())) { - result = currentDate; - } - }); - return result || /* @__PURE__ */ new Date(NaN); -} - -// node_modules/date-fns/esm/compareAsc/index.js -function compareAsc(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var diff = dateLeft.getTime() - dateRight.getTime(); - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - } else { - return diff; - } -} - -// node_modules/date-fns/esm/constants/index.js -var daysInYear = 365.2425; -var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3; -var millisecondsInMinute = 6e4; -var millisecondsInHour = 36e5; -var millisecondsInSecond = 1e3; -var minTime = -maxTime; -var secondsInHour = 3600; -var secondsInDay = secondsInHour * 24; -var secondsInWeek = secondsInDay * 7; -var secondsInYear = secondsInDay * daysInYear; -var secondsInMonth = secondsInYear / 12; -var secondsInQuarter = secondsInMonth * 3; - -// node_modules/date-fns/esm/isSameDay/index.js -function isSameDay(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeftStartOfDay = startOfDay(dirtyDateLeft); - var dateRightStartOfDay = startOfDay(dirtyDateRight); - return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); -} - -// node_modules/date-fns/esm/differenceInCalendarYears/index.js -function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - return dateLeft.getFullYear() - dateRight.getFullYear(); -} - -// node_modules/date-fns/esm/differenceInDays/index.js -function compareLocalAsc(dateLeft, dateRight) { - var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds(); - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - } else { - return diff; - } -} -function differenceInDays(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var sign2 = compareLocalAsc(dateLeft, dateRight); - var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight)); - dateLeft.setDate(dateLeft.getDate() - sign2 * difference); - var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign2); - var result = sign2 * (difference - isLastDayNotFull); - return result === 0 ? 0 : result; -} - -// node_modules/date-fns/esm/endOfDay/index.js -function endOfDay(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - date2.setHours(23, 59, 59, 999); - return date2; -} - -// node_modules/date-fns/esm/endOfMonth/index.js -function endOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var month = date2.getMonth(); - date2.setFullYear(date2.getFullYear(), month + 1, 0); - date2.setHours(23, 59, 59, 999); - return date2; -} - -// node_modules/date-fns/esm/isLastDayOfMonth/index.js -function isLastDayOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - return endOfDay(date2).getTime() === endOfMonth(date2).getTime(); -} - -// node_modules/date-fns/esm/differenceInYears/index.js -function differenceInYears(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var sign2 = compareAsc(dateLeft, dateRight); - var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); - dateLeft.setFullYear(1584); - dateRight.setFullYear(1584); - var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign2; - var result = sign2 * (difference - Number(isLastYearNotFull)); - return result === 0 ? 0 : result; -} - -// node_modules/date-fns/esm/startOfMonth/index.js -function startOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - date2.setDate(1); - date2.setHours(0, 0, 0, 0); - return date2; -} - -// node_modules/date-fns/esm/startOfYear/index.js -function startOfYear(dirtyDate) { - requiredArgs(1, arguments); - var cleanDate = toDate(dirtyDate); - var date2 = /* @__PURE__ */ new Date(0); - date2.setFullYear(cleanDate.getFullYear(), 0, 1); - date2.setHours(0, 0, 0, 0); - return date2; -} - -// node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js -function startOfUTCISOWeek(dirtyDate) { - requiredArgs(1, arguments); - var weekStartsOn = 1; - var date2 = toDate(dirtyDate); - var day = date2.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date2.setUTCDate(date2.getUTCDate() - diff); - date2.setUTCHours(0, 0, 0, 0); - return date2; -} - -// node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js -function getUTCISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var year = date2.getUTCFullYear(); - var fourthOfJanuaryOfNextYear = /* @__PURE__ */ new Date(0); - fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear); - var fourthOfJanuaryOfThisYear = /* @__PURE__ */ new Date(0); - fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear); - if (date2.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date2.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; - } -} - -// node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js -function startOfUTCISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var year = getUTCISOWeekYear(dirtyDate); - var fourthOfJanuary = /* @__PURE__ */ new Date(0); - fourthOfJanuary.setUTCFullYear(year, 0, 4); - fourthOfJanuary.setUTCHours(0, 0, 0, 0); - var date2 = startOfUTCISOWeek(fourthOfJanuary); - return date2; -} - -// node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js -var MILLISECONDS_IN_WEEK = 6048e5; -function getUTCISOWeek(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var diff = startOfUTCISOWeek(date2).getTime() - startOfUTCISOWeekYear(date2).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; -} - -// node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js -function startOfUTCWeek(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var defaultOptions3 = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - } - var date2 = toDate(dirtyDate); - var day = date2.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date2.setUTCDate(date2.getUTCDate() - diff); - date2.setUTCHours(0, 0, 0, 0); - return date2; -} - -// node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js -function getUTCWeekYear(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var year = date2.getUTCFullYear(); - var defaultOptions3 = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); - if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { - throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); - } - var firstWeekOfNextYear = /* @__PURE__ */ new Date(0); - firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); - firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options); - var firstWeekOfThisYear = /* @__PURE__ */ new Date(0); - firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); - firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options); - if (date2.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date2.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; - } -} - -// node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js -function startOfUTCWeekYear(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var defaultOptions3 = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); - var year = getUTCWeekYear(dirtyDate, options); - var firstWeek = /* @__PURE__ */ new Date(0); - firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); - firstWeek.setUTCHours(0, 0, 0, 0); - var date2 = startOfUTCWeek(firstWeek, options); - return date2; -} - -// node_modules/date-fns/esm/_lib/getUTCWeek/index.js -var MILLISECONDS_IN_WEEK2 = 6048e5; -function getUTCWeek(dirtyDate, options) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var diff = startOfUTCWeek(date2, options).getTime() - startOfUTCWeekYear(date2, options).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1; -} - -// node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js -function buildFormatLongFn(args) { - return function() { - var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var width = options.width ? String(options.width) : args.defaultWidth; - var format3 = args.formats[width] || args.formats[args.defaultWidth]; - return format3; - }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js -var dateFormats = { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy" -}; -var timeFormats = { - full: "h:mm:ss a zzzz", - long: "h:mm:ss a z", - medium: "h:mm:ss a", - short: "h:mm a" -}; -var dateTimeFormats = { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}" -}; -var formatLong = { - date: buildFormatLongFn({ - formats: dateFormats, - defaultWidth: "full" - }), - time: buildFormatLongFn({ - formats: timeFormats, - defaultWidth: "full" - }), - dateTime: buildFormatLongFn({ - formats: dateTimeFormats, - defaultWidth: "full" - }) -}; - -// node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js -function buildLocalizeFn(args) { - return function(dirtyIndex, options) { - var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone"; - var valuesArray; - if (context === "formatting" && args.formattingValues) { - var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; - var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth; - valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; - } else { - var _defaultWidth = args.defaultWidth; - var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth; - valuesArray = args.values[_width] || args.values[_defaultWidth]; - } - var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; - return valuesArray[index]; - }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js -var eraValues = { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"] -}; -var quarterValues = { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] -}; -var monthValues = { - narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], - abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] -}; -var dayValues = { - narrow: ["S", "M", "T", "W", "T", "F", "S"], - short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], - abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] -}; -var dayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" - } -}; -var formattingDayPeriodValues = { - narrow: { - am: "a", - pm: "p", - midnight: "mi", - noon: "n", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - }, - abbreviated: { - am: "AM", - pm: "PM", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - }, - wide: { - am: "a.m.", - pm: "p.m.", - midnight: "midnight", - noon: "noon", - morning: "in the morning", - afternoon: "in the afternoon", - evening: "in the evening", - night: "at night" - } -}; -var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) { - var number2 = Number(dirtyNumber); - var rem100 = number2 % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number2 + "st"; - case 2: - return number2 + "nd"; - case 3: - return number2 + "rd"; - } - } - return number2 + "th"; -}; -var localize = { - ordinalNumber, - era: buildLocalizeFn({ - values: eraValues, - defaultWidth: "wide" - }), - quarter: buildLocalizeFn({ - values: quarterValues, - defaultWidth: "wide", - argumentCallback: function argumentCallback(quarter) { - return quarter - 1; - } - }), - month: buildLocalizeFn({ - values: monthValues, - defaultWidth: "wide" - }), - day: buildLocalizeFn({ - values: dayValues, - defaultWidth: "wide" - }), - dayPeriod: buildLocalizeFn({ - values: dayPeriodValues, - defaultWidth: "wide", - formattingValues: formattingDayPeriodValues, - defaultFormattingWidth: "wide" - }) -}; - -// node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js -function buildMatchFn(args) { - return function(string2) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var width = options.width; - var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; - var matchResult = string2.match(matchPattern); - if (!matchResult) { - return null; - } - var matchedString = matchResult[0]; - var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; - var key2 = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) { - return pattern.test(matchedString); - }) : findKey(parsePatterns, function(pattern) { - return pattern.test(matchedString); - }); - var value; - value = args.valueCallback ? args.valueCallback(key2) : key2; - value = options.valueCallback ? options.valueCallback(value) : value; - var rest = string2.slice(matchedString.length); - return { - value, - rest - }; - }; -} -function findKey(object2, predicate) { - for (var key2 in object2) { - if (object2.hasOwnProperty(key2) && predicate(object2[key2])) { - return key2; - } - } - return void 0; -} -function findIndex(array, predicate) { - for (var key2 = 0; key2 < array.length; key2++) { - if (predicate(array[key2])) { - return key2; - } - } - return void 0; -} - -// node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js -function buildMatchPatternFn(args) { - return function(string2) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var matchResult = string2.match(args.matchPattern); - if (!matchResult) return null; - var matchedString = matchResult[0]; - var parseResult = string2.match(args.parsePattern); - if (!parseResult) return null; - var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; - value = options.valueCallback ? options.valueCallback(value) : value; - var rest = string2.slice(matchedString.length); - return { - value, - rest - }; - }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/match/index.js -var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; -var parseOrdinalNumberPattern = /\d+/i; -var matchEraPatterns = { - narrow: /^(b|a)/i, - abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, - wide: /^(before christ|before common era|anno domini|common era)/i -}; -var parseEraPatterns = { - any: [/^b/i, /^(a|c)/i] -}; -var matchQuarterPatterns = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i -}; -var parseQuarterPatterns = { - any: [/1/i, /2/i, /3/i, /4/i] -}; -var matchMonthPatterns = { - narrow: /^[jfmasond]/i, - abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, - wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i -}; -var parseMonthPatterns = { - narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i], - any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] -}; -var matchDayPatterns = { - narrow: /^[smtwf]/i, - short: /^(su|mo|tu|we|th|fr|sa)/i, - abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, - wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i -}; -var parseDayPatterns = { - narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], - any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] -}; -var matchDayPeriodPatterns = { - narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, - any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i -}; -var parseDayPeriodPatterns = { - any: { - am: /^a/i, - pm: /^p/i, - midnight: /^mi/i, - noon: /^no/i, - morning: /morning/i, - afternoon: /afternoon/i, - evening: /evening/i, - night: /night/i - } -}; -var match = { - ordinalNumber: buildMatchPatternFn({ - matchPattern: matchOrdinalNumberPattern, - parsePattern: parseOrdinalNumberPattern, - valueCallback: function valueCallback(value) { - return parseInt(value, 10); - } - }), - era: buildMatchFn({ - matchPatterns: matchEraPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseEraPatterns, - defaultParseWidth: "any" - }), - quarter: buildMatchFn({ - matchPatterns: matchQuarterPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseQuarterPatterns, - defaultParseWidth: "any", - valueCallback: function valueCallback2(index) { - return index + 1; - } - }), - month: buildMatchFn({ - matchPatterns: matchMonthPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseMonthPatterns, - defaultParseWidth: "any" - }), - day: buildMatchFn({ - matchPatterns: matchDayPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseDayPatterns, - defaultParseWidth: "any" - }), - dayPeriod: buildMatchFn({ - matchPatterns: matchDayPeriodPatterns, - defaultMatchWidth: "any", - parsePatterns: parseDayPeriodPatterns, - defaultParseWidth: "any" - }) -}; - -// node_modules/date-fns/esm/formatDistanceStrict/index.js -var MILLISECONDS_IN_MINUTE2 = 1e3 * 60; -var MINUTES_IN_DAY = 60 * 24; -var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30; -var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365; - -// node_modules/date-fns/esm/getDaysInMonth/index.js -function getDaysInMonth(dirtyDate) { - requiredArgs(1, arguments); - var date2 = toDate(dirtyDate); - var year = date2.getFullYear(); - var monthIndex = date2.getMonth(); - var lastDayOfMonth2 = /* @__PURE__ */ new Date(0); - lastDayOfMonth2.setFullYear(year, monthIndex + 1, 0); - lastDayOfMonth2.setHours(0, 0, 0, 0); - return lastDayOfMonth2.getDate(); -} - -// node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js -var MILLISECONDS_IN_DAY2 = 24 * 60 * 60 * 1e3; - -// node_modules/date-fns/esm/isAfter/index.js -function isAfter(dirtyDate, dirtyDateToCompare) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var dateToCompare = toDate(dirtyDateToCompare); - return date2.getTime() > dateToCompare.getTime(); -} - -// node_modules/date-fns/esm/isBefore/index.js -function isBefore(dirtyDate, dirtyDateToCompare) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var dateToCompare = toDate(dirtyDateToCompare); - return date2.getTime() < dateToCompare.getTime(); -} - -// node_modules/@babel/runtime/helpers/esm/inherits.js -function _inherits(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) _setPrototypeOf(subClass, superClass); -} - -// node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) { - return o2.__proto__ || Object.getPrototypeOf(o2); - }; - return _getPrototypeOf(o); -} - -// node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js -function _isNativeReflectConstruct() { - try { - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { - })); - } catch (t2) { - } - return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() { - return !!t; - })(); -} - -// node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js -function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === "object" || typeof call === "function")) { - return call; - } else if (call !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return _assertThisInitialized(self); -} - -// node_modules/@babel/runtime/helpers/esm/createSuper.js -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; -} - -// node_modules/@babel/runtime/helpers/esm/classCallCheck.js -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -// node_modules/@babel/runtime/helpers/esm/toPrimitive.js -function toPrimitive(t, r2) { - if ("object" != _typeof(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r2 || "default"); - if ("object" != _typeof(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r2 ? String : Number)(t); -} - -// node_modules/@babel/runtime/helpers/esm/toPropertyKey.js -function toPropertyKey(t) { - var i = toPrimitive(t, "string"); - return "symbol" == _typeof(i) ? i : String(i); -} - -// node_modules/@babel/runtime/helpers/esm/createClass.js -function _defineProperties(target, props2) { - for (var i = 0; i < props2.length; i++) { - var descriptor = props2[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); - } -} -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; -} - -// node_modules/@babel/runtime/helpers/esm/defineProperty.js -function _defineProperty(obj, key2, value) { - key2 = toPropertyKey(key2); - if (key2 in obj) { - Object.defineProperty(obj, key2, { - value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key2] = value; - } - return obj; -} - -// node_modules/date-fns/esm/parse/_lib/Setter.js -var TIMEZONE_UNIT_PRIORITY = 10; -var Setter = function() { - function Setter2() { - _classCallCheck(this, Setter2); - _defineProperty(this, "priority", void 0); - _defineProperty(this, "subPriority", 0); - } - _createClass(Setter2, [{ - key: "validate", - value: function validate3(_utcDate, _options) { - return true; - } - }]); - return Setter2; -}(); -var ValueSetter = function(_Setter) { - _inherits(ValueSetter2, _Setter); - var _super = _createSuper(ValueSetter2); - function ValueSetter2(value, validateValue, setValue, priority, subPriority) { - var _this; - _classCallCheck(this, ValueSetter2); - _this = _super.call(this); - _this.value = value; - _this.validateValue = validateValue; - _this.setValue = setValue; - _this.priority = priority; - if (subPriority) { - _this.subPriority = subPriority; - } - return _this; - } - _createClass(ValueSetter2, [{ - key: "validate", - value: function validate3(utcDate2, options) { - return this.validateValue(utcDate2, this.value, options); - } - }, { - key: "set", - value: function set2(utcDate2, flags, options) { - return this.setValue(utcDate2, flags, this.value, options); - } - }]); - return ValueSetter2; -}(Setter); -var DateToSystemTimezoneSetter = function(_Setter2) { - _inherits(DateToSystemTimezoneSetter2, _Setter2); - var _super2 = _createSuper(DateToSystemTimezoneSetter2); - function DateToSystemTimezoneSetter2() { - var _this2; - _classCallCheck(this, DateToSystemTimezoneSetter2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this2 = _super2.call.apply(_super2, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY); - _defineProperty(_assertThisInitialized(_this2), "subPriority", -1); - return _this2; - } - _createClass(DateToSystemTimezoneSetter2, [{ - key: "set", - value: function set2(date2, flags) { - if (flags.timestampIsSet) { - return date2; - } - var convertedDate = /* @__PURE__ */ new Date(0); - convertedDate.setFullYear(date2.getUTCFullYear(), date2.getUTCMonth(), date2.getUTCDate()); - convertedDate.setHours(date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds()); - return convertedDate; - } - }]); - return DateToSystemTimezoneSetter2; -}(Setter); - -// node_modules/date-fns/esm/parse/_lib/Parser.js -var Parser = function() { - function Parser2() { - _classCallCheck(this, Parser2); - _defineProperty(this, "incompatibleTokens", void 0); - _defineProperty(this, "priority", void 0); - _defineProperty(this, "subPriority", void 0); - } - _createClass(Parser2, [{ - key: "run", - value: function run3(dateString, token, match2, options) { - var result = this.parse(dateString, token, match2, options); - if (!result) { - return null; - } - return { - setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority), - rest: result.rest - }; - } - }, { - key: "validate", - value: function validate3(_utcDate, _value, _options) { - return true; - } - }]); - return Parser2; -}(); - -// node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js -var EraParser = function(_Parser) { - _inherits(EraParser2, _Parser); - var _super = _createSuper(EraParser2); - function EraParser2() { - var _this; - _classCallCheck(this, EraParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 140); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["R", "u", "t", "T"]); - return _this; - } - _createClass(EraParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "G": - case "GG": - case "GGG": - return match2.era(dateString, { - width: "abbreviated" - }) || match2.era(dateString, { - width: "narrow" - }); - case "GGGGG": - return match2.era(dateString, { - width: "narrow" - }); - case "GGGG": - default: - return match2.era(dateString, { - width: "wide" - }) || match2.era(dateString, { - width: "abbreviated" - }) || match2.era(dateString, { - width: "narrow" - }); - } - } - }, { - key: "set", - value: function set2(date2, flags, value) { - flags.era = value; - date2.setUTCFullYear(value, 0, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return EraParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/constants.js -var numericPatterns = { - month: /^(1[0-2]|0?\d)/, - // 0 to 12 - date: /^(3[0-1]|[0-2]?\d)/, - // 0 to 31 - dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, - // 0 to 366 - week: /^(5[0-3]|[0-4]?\d)/, - // 0 to 53 - hour23h: /^(2[0-3]|[0-1]?\d)/, - // 0 to 23 - hour24h: /^(2[0-4]|[0-1]?\d)/, - // 0 to 24 - hour11h: /^(1[0-1]|0?\d)/, - // 0 to 11 - hour12h: /^(1[0-2]|0?\d)/, - // 0 to 12 - minute: /^[0-5]?\d/, - // 0 to 59 - second: /^[0-5]?\d/, - // 0 to 59 - singleDigit: /^\d/, - // 0 to 9 - twoDigits: /^\d{1,2}/, - // 0 to 99 - threeDigits: /^\d{1,3}/, - // 0 to 999 - fourDigits: /^\d{1,4}/, - // 0 to 9999 - anyDigitsSigned: /^-?\d+/, - singleDigitSigned: /^-?\d/, - // 0 to 9, -0 to -9 - twoDigitsSigned: /^-?\d{1,2}/, - // 0 to 99, -0 to -99 - threeDigitsSigned: /^-?\d{1,3}/, - // 0 to 999, -0 to -999 - fourDigitsSigned: /^-?\d{1,4}/ - // 0 to 9999, -0 to -9999 -}; -var timezonePatterns = { - basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, - basic: /^([+-])(\d{2})(\d{2})|Z/, - basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, - extended: /^([+-])(\d{2}):(\d{2})|Z/, - extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ -}; - -// node_modules/date-fns/esm/parse/_lib/utils.js -function mapValue(parseFnResult, mapFn) { - if (!parseFnResult) { - return parseFnResult; - } - return { - value: mapFn(parseFnResult.value), - rest: parseFnResult.rest - }; -} -function parseNumericPattern(pattern, dateString) { - var matchResult = dateString.match(pattern); - if (!matchResult) { - return null; - } - return { - value: parseInt(matchResult[0], 10), - rest: dateString.slice(matchResult[0].length) - }; -} -function parseTimezonePattern(pattern, dateString) { - var matchResult = dateString.match(pattern); - if (!matchResult) { - return null; - } - if (matchResult[0] === "Z") { - return { - value: 0, - rest: dateString.slice(1) - }; - } - var sign2 = matchResult[1] === "+" ? 1 : -1; - var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; - var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; - var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; - return { - value: sign2 * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond), - rest: dateString.slice(matchResult[0].length) - }; -} -function parseAnyDigitsSigned(dateString) { - return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString); -} -function parseNDigits(n, dateString) { - switch (n) { - case 1: - return parseNumericPattern(numericPatterns.singleDigit, dateString); - case 2: - return parseNumericPattern(numericPatterns.twoDigits, dateString); - case 3: - return parseNumericPattern(numericPatterns.threeDigits, dateString); - case 4: - return parseNumericPattern(numericPatterns.fourDigits, dateString); - default: - return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString); - } -} -function parseNDigitsSigned(n, dateString) { - switch (n) { - case 1: - return parseNumericPattern(numericPatterns.singleDigitSigned, dateString); - case 2: - return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString); - case 3: - return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString); - case 4: - return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString); - default: - return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString); - } -} -function dayPeriodEnumToHours(dayPeriod) { - switch (dayPeriod) { - case "morning": - return 4; - case "evening": - return 17; - case "pm": - case "noon": - case "afternoon": - return 12; - case "am": - case "midnight": - case "night": - default: - return 0; - } -} -function normalizeTwoDigitYear(twoDigitYear, currentYear) { - var isCommonEra = currentYear > 0; - var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; - var result; - if (absCurrentYear <= 50) { - result = twoDigitYear || 100; - } else { - var rangeEnd = absCurrentYear + 50; - var rangeEndCentury = Math.floor(rangeEnd / 100) * 100; - var isPreviousCentury = twoDigitYear >= rangeEnd % 100; - result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); - } - return isCommonEra ? result : 1 - result; -} -function isLeapYearIndex(year) { - return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; -} - -// node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js -var YearParser = function(_Parser) { - _inherits(YearParser2, _Parser); - var _super = _createSuper(YearParser2); - function YearParser2() { - var _this; - _classCallCheck(this, YearParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 130); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(YearParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - var valueCallback3 = function valueCallback4(year) { - return { - year, - isTwoDigitYear: token === "yy" - }; - }; - switch (token) { - case "y": - return mapValue(parseNDigits(4, dateString), valueCallback3); - case "yo": - return mapValue(match2.ordinalNumber(dateString, { - unit: "year" - }), valueCallback3); - default: - return mapValue(parseNDigits(token.length, dateString), valueCallback3); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value.isTwoDigitYear || value.year > 0; - } - }, { - key: "set", - value: function set2(date2, flags, value) { - var currentYear = date2.getUTCFullYear(); - if (value.isTwoDigitYear) { - var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); - date2.setUTCFullYear(normalizedTwoDigitYear, 0, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; - date2.setUTCFullYear(year, 0, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return YearParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js -var LocalWeekYearParser = function(_Parser) { - _inherits(LocalWeekYearParser2, _Parser); - var _super = _createSuper(LocalWeekYearParser2); - function LocalWeekYearParser2() { - var _this; - _classCallCheck(this, LocalWeekYearParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 130); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]); - return _this; - } - _createClass(LocalWeekYearParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - var valueCallback3 = function valueCallback4(year) { - return { - year, - isTwoDigitYear: token === "YY" - }; - }; - switch (token) { - case "Y": - return mapValue(parseNDigits(4, dateString), valueCallback3); - case "Yo": - return mapValue(match2.ordinalNumber(dateString, { - unit: "year" - }), valueCallback3); - default: - return mapValue(parseNDigits(token.length, dateString), valueCallback3); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value.isTwoDigitYear || value.year > 0; - } - }, { - key: "set", - value: function set2(date2, flags, value, options) { - var currentYear = getUTCWeekYear(date2, options); - if (value.isTwoDigitYear) { - var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); - date2.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate); - date2.setUTCHours(0, 0, 0, 0); - return startOfUTCWeek(date2, options); - } - var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; - date2.setUTCFullYear(year, 0, options.firstWeekContainsDate); - date2.setUTCHours(0, 0, 0, 0); - return startOfUTCWeek(date2, options); - } - }]); - return LocalWeekYearParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js -var ISOWeekYearParser = function(_Parser) { - _inherits(ISOWeekYearParser2, _Parser); - var _super = _createSuper(ISOWeekYearParser2); - function ISOWeekYearParser2() { - var _this; - _classCallCheck(this, ISOWeekYearParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 130); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]); - return _this; - } - _createClass(ISOWeekYearParser2, [{ - key: "parse", - value: function parse2(dateString, token) { - if (token === "R") { - return parseNDigitsSigned(4, dateString); - } - return parseNDigitsSigned(token.length, dateString); - } - }, { - key: "set", - value: function set2(_date, _flags, value) { - var firstWeekOfYear = /* @__PURE__ */ new Date(0); - firstWeekOfYear.setUTCFullYear(value, 0, 4); - firstWeekOfYear.setUTCHours(0, 0, 0, 0); - return startOfUTCISOWeek(firstWeekOfYear); - } - }]); - return ISOWeekYearParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js -var ExtendedYearParser = function(_Parser) { - _inherits(ExtendedYearParser2, _Parser); - var _super = _createSuper(ExtendedYearParser2); - function ExtendedYearParser2() { - var _this; - _classCallCheck(this, ExtendedYearParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 130); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(ExtendedYearParser2, [{ - key: "parse", - value: function parse2(dateString, token) { - if (token === "u") { - return parseNDigitsSigned(4, dateString); - } - return parseNDigitsSigned(token.length, dateString); - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCFullYear(value, 0, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return ExtendedYearParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js -var QuarterParser = function(_Parser) { - _inherits(QuarterParser2, _Parser); - var _super = _createSuper(QuarterParser2); - function QuarterParser2() { - var _this; - _classCallCheck(this, QuarterParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 120); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(QuarterParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "Q": - case "QQ": - return parseNDigits(token.length, dateString); - case "Qo": - return match2.ordinalNumber(dateString, { - unit: "quarter" - }); - case "QQQ": - return match2.quarter(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.quarter(dateString, { - width: "narrow", - context: "formatting" - }); - case "QQQQQ": - return match2.quarter(dateString, { - width: "narrow", - context: "formatting" - }); - case "QQQQ": - default: - return match2.quarter(dateString, { - width: "wide", - context: "formatting" - }) || match2.quarter(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.quarter(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 4; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMonth((value - 1) * 3, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return QuarterParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js -var StandAloneQuarterParser = function(_Parser) { - _inherits(StandAloneQuarterParser2, _Parser); - var _super = _createSuper(StandAloneQuarterParser2); - function StandAloneQuarterParser2() { - var _this; - _classCallCheck(this, StandAloneQuarterParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 120); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(StandAloneQuarterParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "q": - case "qq": - return parseNDigits(token.length, dateString); - case "qo": - return match2.ordinalNumber(dateString, { - unit: "quarter" - }); - case "qqq": - return match2.quarter(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.quarter(dateString, { - width: "narrow", - context: "standalone" - }); - case "qqqqq": - return match2.quarter(dateString, { - width: "narrow", - context: "standalone" - }); - case "qqqq": - default: - return match2.quarter(dateString, { - width: "wide", - context: "standalone" - }) || match2.quarter(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.quarter(dateString, { - width: "narrow", - context: "standalone" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 4; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMonth((value - 1) * 3, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return StandAloneQuarterParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js -var MonthParser = function(_Parser) { - _inherits(MonthParser2, _Parser); - var _super = _createSuper(MonthParser2); - function MonthParser2() { - var _this; - _classCallCheck(this, MonthParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]); - _defineProperty(_assertThisInitialized(_this), "priority", 110); - return _this; - } - _createClass(MonthParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - var valueCallback3 = function valueCallback4(value) { - return value - 1; - }; - switch (token) { - case "M": - return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback3); - case "MM": - return mapValue(parseNDigits(2, dateString), valueCallback3); - case "Mo": - return mapValue(match2.ordinalNumber(dateString, { - unit: "month" - }), valueCallback3); - case "MMM": - return match2.month(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.month(dateString, { - width: "narrow", - context: "formatting" - }); - case "MMMMM": - return match2.month(dateString, { - width: "narrow", - context: "formatting" - }); - case "MMMM": - default: - return match2.month(dateString, { - width: "wide", - context: "formatting" - }) || match2.month(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.month(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 11; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMonth(value, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return MonthParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js -var StandAloneMonthParser = function(_Parser) { - _inherits(StandAloneMonthParser2, _Parser); - var _super = _createSuper(StandAloneMonthParser2); - function StandAloneMonthParser2() { - var _this; - _classCallCheck(this, StandAloneMonthParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 110); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(StandAloneMonthParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - var valueCallback3 = function valueCallback4(value) { - return value - 1; - }; - switch (token) { - case "L": - return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback3); - case "LL": - return mapValue(parseNDigits(2, dateString), valueCallback3); - case "Lo": - return mapValue(match2.ordinalNumber(dateString, { - unit: "month" - }), valueCallback3); - case "LLL": - return match2.month(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.month(dateString, { - width: "narrow", - context: "standalone" - }); - case "LLLLL": - return match2.month(dateString, { - width: "narrow", - context: "standalone" - }); - case "LLLL": - default: - return match2.month(dateString, { - width: "wide", - context: "standalone" - }) || match2.month(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.month(dateString, { - width: "narrow", - context: "standalone" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 11; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMonth(value, 1); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return StandAloneMonthParser2; -}(Parser); - -// node_modules/date-fns/esm/_lib/setUTCWeek/index.js -function setUTCWeek(dirtyDate, dirtyWeek, options) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var week = toInteger(dirtyWeek); - var diff = getUTCWeek(date2, options) - week; - date2.setUTCDate(date2.getUTCDate() - diff * 7); - return date2; -} - -// node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js -var LocalWeekParser = function(_Parser) { - _inherits(LocalWeekParser2, _Parser); - var _super = _createSuper(LocalWeekParser2); - function LocalWeekParser2() { - var _this; - _classCallCheck(this, LocalWeekParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 100); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]); - return _this; - } - _createClass(LocalWeekParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "w": - return parseNumericPattern(numericPatterns.week, dateString); - case "wo": - return match2.ordinalNumber(dateString, { - unit: "week" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 53; - } - }, { - key: "set", - value: function set2(date2, _flags, value, options) { - return startOfUTCWeek(setUTCWeek(date2, value, options), options); - } - }]); - return LocalWeekParser2; -}(Parser); - -// node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js -function setUTCISOWeek(dirtyDate, dirtyISOWeek) { - requiredArgs(2, arguments); - var date2 = toDate(dirtyDate); - var isoWeek = toInteger(dirtyISOWeek); - var diff = getUTCISOWeek(date2) - isoWeek; - date2.setUTCDate(date2.getUTCDate() - diff * 7); - return date2; -} - -// node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js -var ISOWeekParser = function(_Parser) { - _inherits(ISOWeekParser2, _Parser); - var _super = _createSuper(ISOWeekParser2); - function ISOWeekParser2() { - var _this; - _classCallCheck(this, ISOWeekParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 100); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]); - return _this; - } - _createClass(ISOWeekParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "I": - return parseNumericPattern(numericPatterns.week, dateString); - case "Io": - return match2.ordinalNumber(dateString, { - unit: "week" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 53; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - return startOfUTCISOWeek(setUTCISOWeek(date2, value)); - } - }]); - return ISOWeekParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js -var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -var DateParser = function(_Parser) { - _inherits(DateParser2, _Parser); - var _super = _createSuper(DateParser2); - function DateParser2() { - var _this; - _classCallCheck(this, DateParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "subPriority", 1); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(DateParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "d": - return parseNumericPattern(numericPatterns.date, dateString); - case "do": - return match2.ordinalNumber(dateString, { - unit: "date" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(date2, value) { - var year = date2.getUTCFullYear(); - var isLeapYear2 = isLeapYearIndex(year); - var month = date2.getUTCMonth(); - if (isLeapYear2) { - return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; - } else { - return value >= 1 && value <= DAYS_IN_MONTH[month]; - } - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCDate(value); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return DateParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js -var DayOfYearParser = function(_Parser) { - _inherits(DayOfYearParser2, _Parser); - var _super = _createSuper(DayOfYearParser2); - function DayOfYearParser2() { - var _this; - _classCallCheck(this, DayOfYearParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "subpriority", 1); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(DayOfYearParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "D": - case "DD": - return parseNumericPattern(numericPatterns.dayOfYear, dateString); - case "Do": - return match2.ordinalNumber(dateString, { - unit: "date" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(date2, value) { - var year = date2.getUTCFullYear(); - var isLeapYear2 = isLeapYearIndex(year); - if (isLeapYear2) { - return value >= 1 && value <= 366; - } else { - return value >= 1 && value <= 365; - } - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMonth(0, value); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return DayOfYearParser2; -}(Parser); - -// node_modules/date-fns/esm/_lib/setUTCDay/index.js -function setUTCDay(dirtyDate, dirtyDay, options) { - var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(2, arguments); - var defaultOptions3 = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - } - var date2 = toDate(dirtyDate); - var day = toInteger(dirtyDay); - var currentDay = date2.getUTCDay(); - var remainder = day % 7; - var dayIndex = (remainder + 7) % 7; - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; - date2.setUTCDate(date2.getUTCDate() + diff); - return date2; -} - -// node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js -var DayParser = function(_Parser) { - _inherits(DayParser2, _Parser); - var _super = _createSuper(DayParser2); - function DayParser2() { - var _this; - _classCallCheck(this, DayParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]); - return _this; - } - _createClass(DayParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "E": - case "EE": - case "EEE": - return match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "EEEEE": - return match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "EEEEEE": - return match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "EEEE": - default: - return match2.day(dateString, { - width: "wide", - context: "formatting" - }) || match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 6; - } - }, { - key: "set", - value: function set2(date2, _flags, value, options) { - date2 = setUTCDay(date2, value, options); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return DayParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js -var LocalDayParser = function(_Parser) { - _inherits(LocalDayParser2, _Parser); - var _super = _createSuper(LocalDayParser2); - function LocalDayParser2() { - var _this; - _classCallCheck(this, LocalDayParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]); - return _this; - } - _createClass(LocalDayParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2, options) { - var valueCallback3 = function valueCallback4(value) { - var wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; - }; - switch (token) { - case "e": - case "ee": - return mapValue(parseNDigits(token.length, dateString), valueCallback3); - case "eo": - return mapValue(match2.ordinalNumber(dateString, { - unit: "day" - }), valueCallback3); - case "eee": - return match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "eeeee": - return match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "eeeeee": - return match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - case "eeee": - default: - return match2.day(dateString, { - width: "wide", - context: "formatting" - }) || match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 6; - } - }, { - key: "set", - value: function set2(date2, _flags, value, options) { - date2 = setUTCDay(date2, value, options); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return LocalDayParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js -var StandAloneLocalDayParser = function(_Parser) { - _inherits(StandAloneLocalDayParser2, _Parser); - var _super = _createSuper(StandAloneLocalDayParser2); - function StandAloneLocalDayParser2() { - var _this; - _classCallCheck(this, StandAloneLocalDayParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]); - return _this; - } - _createClass(StandAloneLocalDayParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2, options) { - var valueCallback3 = function valueCallback4(value) { - var wholeWeekDays = Math.floor((value - 1) / 7) * 7; - return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; - }; - switch (token) { - case "c": - case "cc": - return mapValue(parseNDigits(token.length, dateString), valueCallback3); - case "co": - return mapValue(match2.ordinalNumber(dateString, { - unit: "day" - }), valueCallback3); - case "ccc": - return match2.day(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.day(dateString, { - width: "short", - context: "standalone" - }) || match2.day(dateString, { - width: "narrow", - context: "standalone" - }); - case "ccccc": - return match2.day(dateString, { - width: "narrow", - context: "standalone" - }); - case "cccccc": - return match2.day(dateString, { - width: "short", - context: "standalone" - }) || match2.day(dateString, { - width: "narrow", - context: "standalone" - }); - case "cccc": - default: - return match2.day(dateString, { - width: "wide", - context: "standalone" - }) || match2.day(dateString, { - width: "abbreviated", - context: "standalone" - }) || match2.day(dateString, { - width: "short", - context: "standalone" - }) || match2.day(dateString, { - width: "narrow", - context: "standalone" - }); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 6; - } - }, { - key: "set", - value: function set2(date2, _flags, value, options) { - date2 = setUTCDay(date2, value, options); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return StandAloneLocalDayParser2; -}(Parser); - -// node_modules/date-fns/esm/_lib/setUTCISODay/index.js -function setUTCISODay(dirtyDate, dirtyDay) { - requiredArgs(2, arguments); - var day = toInteger(dirtyDay); - if (day % 7 === 0) { - day = day - 7; - } - var weekStartsOn = 1; - var date2 = toDate(dirtyDate); - var currentDay = date2.getUTCDay(); - var remainder = day % 7; - var dayIndex = (remainder + 7) % 7; - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; - date2.setUTCDate(date2.getUTCDate() + diff); - return date2; -} - -// node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js -var ISODayParser = function(_Parser) { - _inherits(ISODayParser2, _Parser); - var _super = _createSuper(ISODayParser2); - function ISODayParser2() { - var _this; - _classCallCheck(this, ISODayParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 90); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]); - return _this; - } - _createClass(ISODayParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - var valueCallback3 = function valueCallback4(value) { - if (value === 0) { - return 7; - } - return value; - }; - switch (token) { - case "i": - case "ii": - return parseNDigits(token.length, dateString); - case "io": - return match2.ordinalNumber(dateString, { - unit: "day" - }); - case "iii": - return mapValue(match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }), valueCallback3); - case "iiiii": - return mapValue(match2.day(dateString, { - width: "narrow", - context: "formatting" - }), valueCallback3); - case "iiiiii": - return mapValue(match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }), valueCallback3); - case "iiii": - default: - return mapValue(match2.day(dateString, { - width: "wide", - context: "formatting" - }) || match2.day(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.day(dateString, { - width: "short", - context: "formatting" - }) || match2.day(dateString, { - width: "narrow", - context: "formatting" - }), valueCallback3); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 7; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2 = setUTCISODay(date2, value); - date2.setUTCHours(0, 0, 0, 0); - return date2; - } - }]); - return ISODayParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js -var AMPMParser = function(_Parser) { - _inherits(AMPMParser2, _Parser); - var _super = _createSuper(AMPMParser2); - function AMPMParser2() { - var _this; - _classCallCheck(this, AMPMParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 80); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]); - return _this; - } - _createClass(AMPMParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "a": - case "aa": - case "aaa": - return match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "aaaaa": - return match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "aaaa": - default: - return match2.dayPeriod(dateString, { - width: "wide", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date2; - } - }]); - return AMPMParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js -var AMPMMidnightParser = function(_Parser) { - _inherits(AMPMMidnightParser2, _Parser); - var _super = _createSuper(AMPMMidnightParser2); - function AMPMMidnightParser2() { - var _this; - _classCallCheck(this, AMPMMidnightParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 80); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]); - return _this; - } - _createClass(AMPMMidnightParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "b": - case "bb": - case "bbb": - return match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "bbbbb": - return match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "bbbb": - default: - return match2.dayPeriod(dateString, { - width: "wide", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date2; - } - }]); - return AMPMMidnightParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js -var DayPeriodParser = function(_Parser) { - _inherits(DayPeriodParser2, _Parser); - var _super = _createSuper(DayPeriodParser2); - function DayPeriodParser2() { - var _this; - _classCallCheck(this, DayPeriodParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 80); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "t", "T"]); - return _this; - } - _createClass(DayPeriodParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "B": - case "BB": - case "BBB": - return match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "BBBBB": - return match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - case "BBBB": - default: - return match2.dayPeriod(dateString, { - width: "wide", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "abbreviated", - context: "formatting" - }) || match2.dayPeriod(dateString, { - width: "narrow", - context: "formatting" - }); - } - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); - return date2; - } - }]); - return DayPeriodParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js -var Hour1to12Parser = function(_Parser) { - _inherits(Hour1to12Parser2, _Parser); - var _super = _createSuper(Hour1to12Parser2); - function Hour1to12Parser2() { - var _this; - _classCallCheck(this, Hour1to12Parser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 70); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["H", "K", "k", "t", "T"]); - return _this; - } - _createClass(Hour1to12Parser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "h": - return parseNumericPattern(numericPatterns.hour12h, dateString); - case "ho": - return match2.ordinalNumber(dateString, { - unit: "hour" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 12; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - var isPM = date2.getUTCHours() >= 12; - if (isPM && value < 12) { - date2.setUTCHours(value + 12, 0, 0, 0); - } else if (!isPM && value === 12) { - date2.setUTCHours(0, 0, 0, 0); - } else { - date2.setUTCHours(value, 0, 0, 0); - } - return date2; - } - }]); - return Hour1to12Parser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js -var Hour0to23Parser = function(_Parser) { - _inherits(Hour0to23Parser2, _Parser); - var _super = _createSuper(Hour0to23Parser2); - function Hour0to23Parser2() { - var _this; - _classCallCheck(this, Hour0to23Parser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 70); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]); - return _this; - } - _createClass(Hour0to23Parser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "H": - return parseNumericPattern(numericPatterns.hour23h, dateString); - case "Ho": - return match2.ordinalNumber(dateString, { - unit: "hour" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 23; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCHours(value, 0, 0, 0); - return date2; - } - }]); - return Hour0to23Parser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js -var Hour0To11Parser = function(_Parser) { - _inherits(Hour0To11Parser2, _Parser); - var _super = _createSuper(Hour0To11Parser2); - function Hour0To11Parser2() { - var _this; - _classCallCheck(this, Hour0To11Parser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 70); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["h", "H", "k", "t", "T"]); - return _this; - } - _createClass(Hour0To11Parser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "K": - return parseNumericPattern(numericPatterns.hour11h, dateString); - case "Ko": - return match2.ordinalNumber(dateString, { - unit: "hour" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 11; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - var isPM = date2.getUTCHours() >= 12; - if (isPM && value < 12) { - date2.setUTCHours(value + 12, 0, 0, 0); - } else { - date2.setUTCHours(value, 0, 0, 0); - } - return date2; - } - }]); - return Hour0To11Parser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js -var Hour1To24Parser = function(_Parser) { - _inherits(Hour1To24Parser2, _Parser); - var _super = _createSuper(Hour1To24Parser2); - function Hour1To24Parser2() { - var _this; - _classCallCheck(this, Hour1To24Parser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 70); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]); - return _this; - } - _createClass(Hour1To24Parser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "k": - return parseNumericPattern(numericPatterns.hour24h, dateString); - case "ko": - return match2.ordinalNumber(dateString, { - unit: "hour" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 1 && value <= 24; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - var hours = value <= 24 ? value % 24 : value; - date2.setUTCHours(hours, 0, 0, 0); - return date2; - } - }]); - return Hour1To24Parser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js -var MinuteParser = function(_Parser) { - _inherits(MinuteParser2, _Parser); - var _super = _createSuper(MinuteParser2); - function MinuteParser2() { - var _this; - _classCallCheck(this, MinuteParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 60); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]); - return _this; - } - _createClass(MinuteParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "m": - return parseNumericPattern(numericPatterns.minute, dateString); - case "mo": - return match2.ordinalNumber(dateString, { - unit: "minute" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 59; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMinutes(value, 0, 0); - return date2; - } - }]); - return MinuteParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js -var SecondParser = function(_Parser) { - _inherits(SecondParser2, _Parser); - var _super = _createSuper(SecondParser2); - function SecondParser2() { - var _this; - _classCallCheck(this, SecondParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 50); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]); - return _this; - } - _createClass(SecondParser2, [{ - key: "parse", - value: function parse2(dateString, token, match2) { - switch (token) { - case "s": - return parseNumericPattern(numericPatterns.second, dateString); - case "so": - return match2.ordinalNumber(dateString, { - unit: "second" - }); - default: - return parseNDigits(token.length, dateString); - } - } - }, { - key: "validate", - value: function validate3(_date, value) { - return value >= 0 && value <= 59; - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCSeconds(value, 0); - return date2; - } - }]); - return SecondParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js -var FractionOfSecondParser = function(_Parser) { - _inherits(FractionOfSecondParser2, _Parser); - var _super = _createSuper(FractionOfSecondParser2); - function FractionOfSecondParser2() { - var _this; - _classCallCheck(this, FractionOfSecondParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 30); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]); - return _this; - } - _createClass(FractionOfSecondParser2, [{ - key: "parse", - value: function parse2(dateString, token) { - var valueCallback3 = function valueCallback4(value) { - return Math.floor(value * Math.pow(10, -token.length + 3)); - }; - return mapValue(parseNDigits(token.length, dateString), valueCallback3); - } - }, { - key: "set", - value: function set2(date2, _flags, value) { - date2.setUTCMilliseconds(value); - return date2; - } - }]); - return FractionOfSecondParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js -var ISOTimezoneWithZParser = function(_Parser) { - _inherits(ISOTimezoneWithZParser2, _Parser); - var _super = _createSuper(ISOTimezoneWithZParser2); - function ISOTimezoneWithZParser2() { - var _this; - _classCallCheck(this, ISOTimezoneWithZParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 10); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T", "x"]); - return _this; - } - _createClass(ISOTimezoneWithZParser2, [{ - key: "parse", - value: function parse2(dateString, token) { - switch (token) { - case "X": - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); - case "XX": - return parseTimezonePattern(timezonePatterns.basic, dateString); - case "XXXX": - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); - case "XXXXX": - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); - case "XXX": - default: - return parseTimezonePattern(timezonePatterns.extended, dateString); - } - } - }, { - key: "set", - value: function set2(date2, flags, value) { - if (flags.timestampIsSet) { - return date2; - } - return new Date(date2.getTime() - value); - } - }]); - return ISOTimezoneWithZParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js -var ISOTimezoneParser = function(_Parser) { - _inherits(ISOTimezoneParser2, _Parser); - var _super = _createSuper(ISOTimezoneParser2); - function ISOTimezoneParser2() { - var _this; - _classCallCheck(this, ISOTimezoneParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 10); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T", "X"]); - return _this; - } - _createClass(ISOTimezoneParser2, [{ - key: "parse", - value: function parse2(dateString, token) { - switch (token) { - case "x": - return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString); - case "xx": - return parseTimezonePattern(timezonePatterns.basic, dateString); - case "xxxx": - return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString); - case "xxxxx": - return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString); - case "xxx": - default: - return parseTimezonePattern(timezonePatterns.extended, dateString); - } - } - }, { - key: "set", - value: function set2(date2, flags, value) { - if (flags.timestampIsSet) { - return date2; - } - return new Date(date2.getTime() - value); - } - }]); - return ISOTimezoneParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js -var TimestampSecondsParser = function(_Parser) { - _inherits(TimestampSecondsParser2, _Parser); - var _super = _createSuper(TimestampSecondsParser2); - function TimestampSecondsParser2() { - var _this; - _classCallCheck(this, TimestampSecondsParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 40); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", "*"); - return _this; - } - _createClass(TimestampSecondsParser2, [{ - key: "parse", - value: function parse2(dateString) { - return parseAnyDigitsSigned(dateString); - } - }, { - key: "set", - value: function set2(_date, _flags, value) { - return [new Date(value * 1e3), { - timestampIsSet: true - }]; - } - }]); - return TimestampSecondsParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js -var TimestampMillisecondsParser = function(_Parser) { - _inherits(TimestampMillisecondsParser2, _Parser); - var _super = _createSuper(TimestampMillisecondsParser2); - function TimestampMillisecondsParser2() { - var _this; - _classCallCheck(this, TimestampMillisecondsParser2); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty(_assertThisInitialized(_this), "priority", 20); - _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", "*"); - return _this; - } - _createClass(TimestampMillisecondsParser2, [{ - key: "parse", - value: function parse2(dateString) { - return parseAnyDigitsSigned(dateString); - } - }, { - key: "set", - value: function set2(_date, _flags, value) { - return [new Date(value), { - timestampIsSet: true - }]; - } - }]); - return TimestampMillisecondsParser2; -}(Parser); - -// node_modules/date-fns/esm/parse/_lib/parsers/index.js -var parsers = { - G: new EraParser(), - y: new YearParser(), - Y: new LocalWeekYearParser(), - R: new ISOWeekYearParser(), - u: new ExtendedYearParser(), - Q: new QuarterParser(), - q: new StandAloneQuarterParser(), - M: new MonthParser(), - L: new StandAloneMonthParser(), - w: new LocalWeekParser(), - I: new ISOWeekParser(), - d: new DateParser(), - D: new DayOfYearParser(), - E: new DayParser(), - e: new LocalDayParser(), - c: new StandAloneLocalDayParser(), - i: new ISODayParser(), - a: new AMPMParser(), - b: new AMPMMidnightParser(), - B: new DayPeriodParser(), - h: new Hour1to12Parser(), - H: new Hour0to23Parser(), - K: new Hour0To11Parser(), - k: new Hour1To24Parser(), - m: new MinuteParser(), - s: new SecondParser(), - S: new FractionOfSecondParser(), - X: new ISOTimezoneWithZParser(), - x: new ISOTimezoneParser(), - t: new TimestampSecondsParser(), - T: new TimestampMillisecondsParser() -}; - -// node_modules/date-fns/esm/isSameMonth/index.js -function isSameMonth(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); -} - -// node_modules/date-fns/esm/isSameYear/index.js -function isSameYear(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - return dateLeft.getFullYear() === dateRight.getFullYear(); -} - -// node_modules/date-fns/esm/isToday/index.js -function isToday(dirtyDate) { - requiredArgs(1, arguments); - return isSameDay(dirtyDate, Date.now()); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/ticks.js -function getXTickCount(width) { - return Math.ceil(width / X_TICK_COUNT_RATIO); -} -function getYTickCount(height) { - return Math.ceil(height / Y_TICK_COUNT_RATIO); -} -function createXTicks(scale, values2) { - if (scale.isNumeric()) { - return scale.d3Scale.ticks(values2); - } else if (scale.isTime()) { - const rawTicks = scale.d3Scale.ticks(values2); - const domain = scale.d3Scale.domain(); - return uniform(rawTicks, domain[domain.length - 1]); - } else { - return scale.d3Scale.domain(); - } -} -function createYTicks(scale, values2) { - const ticks2 = scale.d3Scale.ticks(values2); - if (scale.scaleType === "log" && ticks2.length > 10) { - return scale.d3Scale.ticks(3); - } - return ticks2; -} -function uniform(ticks2, max3) { - if (ticks2.length < 3 || !isMixedDayInterval(ticks2)) { - return ticks2; - } - return createTwoDayInterval(ticks2[0], max3); -} -function isMixedDayInterval(ticks2) { - let oneDayInterval = false; - let twoDayInterval = false; - for (let i = 1; i < ticks2.length; i++) { - oneDayInterval = oneDayInterval || isDayInterval(ticks2[i - 1], ticks2[i], 1); - twoDayInterval = twoDayInterval || isDayInterval(ticks2[i - 1], ticks2[i], 2); - } - return oneDayInterval && twoDayInterval; -} -function isDayInterval(a2, b, difference = 1) { - return Math.abs(differenceInDays(a2, b)) === difference; -} -function createTwoDayInterval(start, max3) { - const result = []; - let curr = start; - while (curr < max3) { - result.push(curr); - curr = add(curr, { days: 2 }); - } - return result; -} - -// node_modules/@cloudscape-design/components/internal/vendor/d3-scale.js -function ascending(a2, b) { - return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN; -} -function descending(a2, b) { - return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; -} -function bisector(f) { - let compare1, compare2, delta; - if (f.length !== 2) { - compare1 = ascending; - compare2 = (d, x2) => ascending(f(d), x2); - delta = (d, x2) => f(d) - x2; - } else { - compare1 = f === ascending || f === descending ? f : zero$1; - compare2 = f; - delta = f; - } - function left(a2, x2, lo = 0, hi = a2.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) return hi; - do { - const mid = lo + hi >>> 1; - if (compare2(a2[mid], x2) < 0) lo = mid + 1; - else hi = mid; - } while (lo < hi); - } - return lo; - } - function right(a2, x2, lo = 0, hi = a2.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) return hi; - do { - const mid = lo + hi >>> 1; - if (compare2(a2[mid], x2) <= 0) lo = mid + 1; - else hi = mid; - } while (lo < hi); - } - return lo; - } - function center(a2, x2, lo = 0, hi = a2.length) { - const i = left(a2, x2, lo, hi - 1); - return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i; - } - return { left, center, right }; -} -function zero$1() { - return 0; -} -function number$2(x2) { - return x2 === null ? NaN : +x2; -} -var ascendingBisect = bisector(ascending); -var bisectRight = ascendingBisect.right; -bisector(number$2).center; -var bisect = bisectRight; -var InternMap = class extends Map { - constructor(entries, key2 = keyof) { - super(); - Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } }); - if (entries != null) for (const [key3, value] of entries) this.set(key3, value); - } - get(key2) { - return super.get(intern_get(this, key2)); - } - has(key2) { - return super.has(intern_get(this, key2)); - } - set(key2, value) { - return super.set(intern_set(this, key2), value); - } - delete(key2) { - return super.delete(intern_delete(this, key2)); - } -}; -function intern_get({ _intern, _key }, value) { - const key2 = _key(value); - return _intern.has(key2) ? _intern.get(key2) : value; -} -function intern_set({ _intern, _key }, value) { - const key2 = _key(value); - if (_intern.has(key2)) return _intern.get(key2); - _intern.set(key2, value); - return value; -} -function intern_delete({ _intern, _key }, value) { - const key2 = _key(value); - if (_intern.has(key2)) { - value = _intern.get(key2); - _intern.delete(key2); - } - return value; -} -function keyof(value) { - return value !== null && typeof value === "object" ? value.valueOf() : value; -} -var e10 = Math.sqrt(50); -var e5 = Math.sqrt(10); -var e2 = Math.sqrt(2); -function ticks(start, stop, count) { - var reverse, i = -1, n, ticks2, step2; - stop = +stop, start = +start, count = +count; - if (start === stop && count > 0) return [start]; - if (reverse = stop < start) n = start, start = stop, stop = n; - if ((step2 = tickIncrement(start, stop, count)) === 0 || !isFinite(step2)) return []; - if (step2 > 0) { - let r0 = Math.round(start / step2), r1 = Math.round(stop / step2); - if (r0 * step2 < start) ++r0; - if (r1 * step2 > stop) --r1; - ticks2 = new Array(n = r1 - r0 + 1); - while (++i < n) ticks2[i] = (r0 + i) * step2; - } else { - step2 = -step2; - let r0 = Math.round(start * step2), r1 = Math.round(stop * step2); - if (r0 / step2 < start) ++r0; - if (r1 / step2 > stop) --r1; - ticks2 = new Array(n = r1 - r0 + 1); - while (++i < n) ticks2[i] = (r0 + i) / step2; - } - if (reverse) ticks2.reverse(); - return ticks2; -} -function tickIncrement(start, stop, count) { - var step2 = (stop - start) / Math.max(0, count), power = Math.floor(Math.log(step2) / Math.LN10), error = step2 / Math.pow(10, power); - return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); -} -function tickStep(start, stop, count) { - var step0 = Math.abs(stop - start) / Math.max(0, count), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error = step0 / step1; - if (error >= e10) step1 *= 10; - else if (error >= e5) step1 *= 5; - else if (error >= e2) step1 *= 2; - return stop < start ? -step1 : step1; -} -function range(start, stop, step2) { - start = +start, stop = +stop, step2 = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step2; - var i = -1, n = Math.max(0, Math.ceil((stop - start) / step2)) | 0, range3 = new Array(n); - while (++i < n) { - range3[i] = start + i * step2; - } - return range3; -} -function initRange(domain, range3) { - switch (arguments.length) { - case 0: - break; - case 1: - this.range(domain); - break; - default: - this.range(range3).domain(domain); - break; - } - return this; -} -var implicit = Symbol("implicit"); -function ordinal() { - var index = new InternMap(), domain = [], range3 = [], unknown = implicit; - function scale(d) { - let i = index.get(d); - if (i === void 0) { - if (unknown !== implicit) return unknown; - index.set(d, i = domain.push(d) - 1); - } - return range3[i % range3.length]; - } - scale.domain = function(_) { - if (!arguments.length) return domain.slice(); - domain = [], index = new InternMap(); - for (const value of _) { - if (index.has(value)) continue; - index.set(value, domain.push(value) - 1); - } - return scale; - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), scale) : range3.slice(); - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - scale.copy = function() { - return ordinal(domain, range3).unknown(unknown); - }; - initRange.apply(scale, arguments); - return scale; -} -function band() { - var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step2, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5; - delete scale.unknown; - function rescale() { - var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1; - step2 = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); - if (round) step2 = Math.floor(step2); - start += (stop - start - step2 * (n - paddingInner)) * align; - bandwidth = step2 * (1 - paddingInner); - if (round) start = Math.round(start), bandwidth = Math.round(bandwidth); - var values2 = range(n).map(function(i) { - return start + step2 * i; - }); - return ordinalRange(reverse ? values2.reverse() : values2); - } - scale.domain = function(_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - scale.range = function(_) { - return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; - }; - scale.rangeRound = function(_) { - return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale(); - }; - scale.bandwidth = function() { - return bandwidth; - }; - scale.step = function() { - return step2; - }; - scale.round = function(_) { - return arguments.length ? (round = !!_, rescale()) : round; - }; - scale.padding = function(_) { - return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; - }; - scale.paddingInner = function(_) { - return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; - }; - scale.paddingOuter = function(_) { - return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; - }; - scale.align = function(_) { - return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; - }; - scale.copy = function() { - return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); - }; - return initRange.apply(rescale(), arguments); -} -function define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key2 in definition) prototype[key2] = definition[key2]; - return prototype; -} -function Color() { -} -var darker = 0.7; -var brighter = 1 / darker; -var reI = "\\s*([+-]?\\d+)\\s*"; -var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; -var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; -var reHex = /^#([0-9a-f]{3,8})$/; -var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`); -var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`); -var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`); -var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`); -var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`); -var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); -var named = { - aliceblue: 15792383, - antiquewhite: 16444375, - aqua: 65535, - aquamarine: 8388564, - azure: 15794175, - beige: 16119260, - bisque: 16770244, - black: 0, - blanchedalmond: 16772045, - blue: 255, - blueviolet: 9055202, - brown: 10824234, - burlywood: 14596231, - cadetblue: 6266528, - chartreuse: 8388352, - chocolate: 13789470, - coral: 16744272, - cornflowerblue: 6591981, - cornsilk: 16775388, - crimson: 14423100, - cyan: 65535, - darkblue: 139, - darkcyan: 35723, - darkgoldenrod: 12092939, - darkgray: 11119017, - darkgreen: 25600, - darkgrey: 11119017, - darkkhaki: 12433259, - darkmagenta: 9109643, - darkolivegreen: 5597999, - darkorange: 16747520, - darkorchid: 10040012, - darkred: 9109504, - darksalmon: 15308410, - darkseagreen: 9419919, - darkslateblue: 4734347, - darkslategray: 3100495, - darkslategrey: 3100495, - darkturquoise: 52945, - darkviolet: 9699539, - deeppink: 16716947, - deepskyblue: 49151, - dimgray: 6908265, - dimgrey: 6908265, - dodgerblue: 2003199, - firebrick: 11674146, - floralwhite: 16775920, - forestgreen: 2263842, - fuchsia: 16711935, - gainsboro: 14474460, - ghostwhite: 16316671, - gold: 16766720, - goldenrod: 14329120, - gray: 8421504, - green: 32768, - greenyellow: 11403055, - grey: 8421504, - honeydew: 15794160, - hotpink: 16738740, - indianred: 13458524, - indigo: 4915330, - ivory: 16777200, - khaki: 15787660, - lavender: 15132410, - lavenderblush: 16773365, - lawngreen: 8190976, - lemonchiffon: 16775885, - lightblue: 11393254, - lightcoral: 15761536, - lightcyan: 14745599, - lightgoldenrodyellow: 16448210, - lightgray: 13882323, - lightgreen: 9498256, - lightgrey: 13882323, - lightpink: 16758465, - lightsalmon: 16752762, - lightseagreen: 2142890, - lightskyblue: 8900346, - lightslategray: 7833753, - lightslategrey: 7833753, - lightsteelblue: 11584734, - lightyellow: 16777184, - lime: 65280, - limegreen: 3329330, - linen: 16445670, - magenta: 16711935, - maroon: 8388608, - mediumaquamarine: 6737322, - mediumblue: 205, - mediumorchid: 12211667, - mediumpurple: 9662683, - mediumseagreen: 3978097, - mediumslateblue: 8087790, - mediumspringgreen: 64154, - mediumturquoise: 4772300, - mediumvioletred: 13047173, - midnightblue: 1644912, - mintcream: 16121850, - mistyrose: 16770273, - moccasin: 16770229, - navajowhite: 16768685, - navy: 128, - oldlace: 16643558, - olive: 8421376, - olivedrab: 7048739, - orange: 16753920, - orangered: 16729344, - orchid: 14315734, - palegoldenrod: 15657130, - palegreen: 10025880, - paleturquoise: 11529966, - palevioletred: 14381203, - papayawhip: 16773077, - peachpuff: 16767673, - peru: 13468991, - pink: 16761035, - plum: 14524637, - powderblue: 11591910, - purple: 8388736, - rebeccapurple: 6697881, - red: 16711680, - rosybrown: 12357519, - royalblue: 4286945, - saddlebrown: 9127187, - salmon: 16416882, - sandybrown: 16032864, - seagreen: 3050327, - seashell: 16774638, - sienna: 10506797, - silver: 12632256, - skyblue: 8900331, - slateblue: 6970061, - slategray: 7372944, - slategrey: 7372944, - snow: 16775930, - springgreen: 65407, - steelblue: 4620980, - tan: 13808780, - teal: 32896, - thistle: 14204888, - tomato: 16737095, - turquoise: 4251856, - violet: 15631086, - wheat: 16113331, - white: 16777215, - whitesmoke: 16119285, - yellow: 16776960, - yellowgreen: 10145074 -}; -define(Color, color, { - copy(channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHex8: color_formatHex8, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); -function color_formatHex() { - return this.rgb().formatHex(); -} -function color_formatHex8() { - return this.rgb().formatHex8(); -} -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} -function color_formatRgb() { - return this.rgb().formatRgb(); -} -function color(format3) { - var m, l; - format3 = (format3 + "").trim().toLowerCase(); - return (m = reHex.exec(format3)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format3)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format3)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format3)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format3)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format3)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format3)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format3) ? rgbn(named[format3]) : format3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; -} -function rgbn(n) { - return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1); -} -function rgba(r2, g, b, a2) { - if (a2 <= 0) r2 = g = b = NaN; - return new Rgb(r2, g, b, a2); -} -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb(); - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} -function rgb$1(r2, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g, b, opacity == null ? 1 : opacity); -} -function Rgb(r2, g, b, opacity) { - this.r = +r2; - this.g = +g; - this.b = +b; - this.opacity = +opacity; -} -define(Rgb, rgb$1, extend(Color, { - brighter(k2) { - k2 = k2 == null ? brighter : Math.pow(brighter, k2); - return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); - }, - darker(k2) { - k2 = k2 == null ? darker : Math.pow(darker, k2); - return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); - }, - rgb() { - return this; - }, - clamp() { - return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); - }, - displayable() { - return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatHex8: rgb_formatHex8, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); -function rgb_formatHex() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; -} -function rgb_formatHex8() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; -} -function rgb_formatRgb() { - const a2 = clampa(this.opacity); - return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`; -} -function clampa(opacity) { - return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); -} -function clampi(value) { - return Math.max(0, Math.min(255, Math.round(value) || 0)); -} -function hex(value) { - value = clampi(value); - return (value < 16 ? "0" : "") + value.toString(16); -} -function hsla(h, s2, l, a2) { - if (a2 <= 0) h = s2 = l = NaN; - else if (l <= 0 || l >= 1) h = s2 = NaN; - else if (s2 <= 0) h = NaN; - return new Hsl(h, s2, l, a2); -} -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl(); - if (o instanceof Hsl) return o; - o = o.rgb(); - var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r2, g, b), max3 = Math.max(r2, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2; - if (s2) { - if (r2 === max3) h = (g - b) / s2 + (g < b) * 6; - else if (g === max3) h = (b - r2) / s2 + 2; - else h = (r2 - g) / s2 + 4; - s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3; - h *= 60; - } else { - s2 = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s2, l, o.opacity); -} -function hsl(h, s2, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity); -} -function Hsl(h, s2, l, opacity) { - this.h = +h; - this.s = +s2; - this.l = +l; - this.opacity = +opacity; -} -define(Hsl, hsl, extend(Color, { - brighter(k2) { - k2 = k2 == null ? brighter : Math.pow(brighter, k2); - return new Hsl(this.h, this.s, this.l * k2, this.opacity); - }, - darker(k2) { - k2 = k2 == null ? darker : Math.pow(darker, k2); - return new Hsl(this.h, this.s, this.l * k2, this.opacity); - }, - rgb() { - var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - clamp() { - return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); - }, - displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl() { - const a2 = clampa(this.opacity); - return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`; - } -})); -function clamph(value) { - value = (value || 0) % 360; - return value < 0 ? value + 360 : value; -} -function clampt(value) { - return Math.max(0, Math.min(1, value || 0)); -} -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; -} -var constant = (x2) => () => x2; -function linear$1(a2, d) { - return function(t) { - return a2 + t * d; - }; -} -function exponential(a2, b, y2) { - return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) { - return Math.pow(a2 + t * b, y2); - }; -} -function gamma(y2) { - return (y2 = +y2) === 1 ? nogamma : function(a2, b) { - return b - a2 ? exponential(a2, b, y2) : constant(isNaN(a2) ? b : a2); - }; -} -function nogamma(a2, b) { - var d = b - a2; - return d ? linear$1(a2, d) : constant(isNaN(a2) ? b : a2); -} -var rgb = function rgbGamma(y2) { - var color2 = gamma(y2); - function rgb2(start, end) { - var r2 = color2((start = rgb$1(start)).r, (end = rgb$1(end)).r), g = color2(start.g, end.g), b = color2(start.b, end.b), opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r2(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - rgb2.gamma = rgbGamma; - return rgb2; -}(1); -function numberArray(a2, b) { - if (!b) b = []; - var n = a2 ? Math.min(b.length, a2.length) : 0, c = b.slice(), i; - return function(t) { - for (i = 0; i < n; ++i) c[i] = a2[i] * (1 - t) + b[i] * t; - return c; - }; -} -function isNumberArray(x2) { - return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); -} -function genericArray(a2, b) { - var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c = new Array(nb), i; - for (i = 0; i < na; ++i) x2[i] = interpolate(a2[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; - return function(t) { - for (i = 0; i < na; ++i) c[i] = x2[i](t); - return c; - }; -} -function date$1(a2, b) { - var d = /* @__PURE__ */ new Date(); - return a2 = +a2, b = +b, function(t) { - return d.setTime(a2 * (1 - t) + b * t), d; - }; -} -function interpolateNumber(a2, b) { - return a2 = +a2, b = +b, function(t) { - return a2 * (1 - t) + b * t; - }; -} -function object(a2, b) { - var i = {}, c = {}, k2; - if (a2 === null || typeof a2 !== "object") a2 = {}; - if (b === null || typeof b !== "object") b = {}; - for (k2 in b) { - if (k2 in a2) { - i[k2] = interpolate(a2[k2], b[k2]); - } else { - c[k2] = b[k2]; - } - } - return function(t) { - for (k2 in i) c[k2] = i[k2](t); - return c; - }; -} -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; -var reB = new RegExp(reA.source, "g"); -function zero(b) { - return function() { - return b; - }; -} -function one(b) { - return function(t) { - return b(t) + ""; - }; -} -function string(a2, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = []; - a2 = a2 + "", b = b + ""; - while ((am = reA.exec(a2)) && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { - bs = b.slice(bi, bs); - if (s2[i]) s2[i] += bs; - else s2[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { - if (s2[i]) s2[i] += bm; - else s2[++i] = bm; - } else { - s2[++i] = null; - q.push({ i, x: interpolateNumber(am, bm) }); - } - bi = reB.lastIndex; - } - if (bi < b.length) { - bs = b.slice(bi); - if (s2[i]) s2[i] += bs; - else s2[++i] = bs; - } - return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) { - for (var i2 = 0, o; i2 < b; ++i2) s2[(o = q[i2]).i] = o.x(t); - return s2.join(""); - }); -} -function interpolate(a2, b) { - var t = typeof b, c; - return b == null || t === "boolean" ? constant(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, rgb) : string : b instanceof color ? rgb : b instanceof Date ? date$1 : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a2, b); -} -function interpolateRound(a2, b) { - return a2 = +a2, b = +b, function(t) { - return Math.round(a2 * (1 - t) + b * t); - }; -} -function constants(x2) { - return function() { - return x2; - }; -} -function number$1(x2) { - return +x2; -} -var unit = [0, 1]; -function identity$1(x2) { - return x2; -} -function normalize(a2, b) { - return (b -= a2 = +a2) ? function(x2) { - return (x2 - a2) / b; - } : constants(isNaN(b) ? NaN : 0.5); -} -function clamper(a2, b) { - var t; - if (a2 > b) t = a2, a2 = b, b = t; - return function(x2) { - return Math.max(a2, Math.min(b, x2)); - }; -} -function bimap(domain, range3, interpolate2) { - var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1]; - if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0); - else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1); - return function(x2) { - return r0(d0(x2)); - }; -} -function polymap(domain, range3, interpolate2) { - var j = Math.min(domain.length, range3.length) - 1, d = new Array(j), r2 = new Array(j), i = -1; - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range3 = range3.slice().reverse(); - } - while (++i < j) { - d[i] = normalize(domain[i], domain[i + 1]); - r2[i] = interpolate2(range3[i], range3[i + 1]); - } - return function(x2) { - var i2 = bisect(domain, x2, 1, j) - 1; - return r2[i2](d[i2](x2)); - }; -} -function copy(source, target) { - return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); -} -function transformer() { - var domain = unit, range3 = unit, interpolate$1 = interpolate, transform, untransform, unknown, clamp3 = identity$1, piecewise, output, input; - function rescale() { - var n = Math.min(domain.length, range3.length); - if (clamp3 !== identity$1) clamp3 = clamper(domain[0], domain[n - 1]); - piecewise = n > 2 ? polymap : bimap; - output = input = null; - return scale; - } - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain.map(transform), range3, interpolate$1)))(transform(clamp3(x2))); - } - scale.invert = function(y2) { - return clamp3(untransform((input || (input = piecewise(range3, domain.map(transform), interpolateNumber)))(y2))); - }; - scale.domain = function(_) { - return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice(); - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), rescale()) : range3.slice(); - }; - scale.rangeRound = function(_) { - return range3 = Array.from(_), interpolate$1 = interpolateRound, rescale(); - }; - scale.clamp = function(_) { - return arguments.length ? (clamp3 = _ ? true : identity$1, rescale()) : clamp3 !== identity$1; - }; - scale.interpolate = function(_) { - return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1; - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - return function(t, u) { - transform = t, untransform = u; - return rescale(); - }; -} -function continuous() { - return transformer()(identity$1, identity$1); -} -function formatDecimal(x2) { - return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10); -} -function formatDecimalParts(x2, p) { - if ((i = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e")) < 0) return null; - var i, coefficient = x2.slice(0, i); - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x2.slice(i + 1) - ]; -} -function exponent(x2) { - return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN; -} -function formatGroup(grouping, thousands) { - return function(value, width) { - var i = value.length, t = [], j = 0, g = grouping[0], length = 0; - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - return t.reverse().join(thousands); - }; -} -function formatNumerals(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; -} -var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; -function formatSpecifier(specifier) { - if (!(match2 = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match2; - return new FormatSpecifier({ - fill: match2[1], - align: match2[2], - sign: match2[3], - symbol: match2[4], - zero: match2[5], - width: match2[6], - comma: match2[7], - precision: match2[8] && match2[8].slice(1), - trim: match2[9], - type: match2[10] - }); -} -formatSpecifier.prototype = FormatSpecifier.prototype; -function FormatSpecifier(specifier) { - this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; - this.align = specifier.align === void 0 ? ">" : specifier.align + ""; - this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === void 0 ? void 0 : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === void 0 ? "" : specifier.type + ""; -} -FormatSpecifier.prototype.toString = function() { - return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; -}; -function formatTrim(s2) { - out: for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s2[i]) { - case ".": - i0 = i1 = i; - break; - case "0": - if (i0 === 0) i0 = i; - i1 = i; - break; - default: - if (!+s2[i]) break out; - if (i0 > 0) i0 = 0; - break; - } - } - return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; -} -var prefixExponent; -function formatPrefixAuto(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) return x2 + ""; - var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length; - return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p + i - 1))[0]; -} -function formatRounded(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) return x2 + ""; - var coefficient = d[0], exponent2 = d[1]; - return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0"); -} -var formatTypes = { - "%": (x2, p) => (x2 * 100).toFixed(p), - "b": (x2) => Math.round(x2).toString(2), - "c": (x2) => x2 + "", - "d": formatDecimal, - "e": (x2, p) => x2.toExponential(p), - "f": (x2, p) => x2.toFixed(p), - "g": (x2, p) => x2.toPrecision(p), - "o": (x2) => Math.round(x2).toString(8), - "p": (x2, p) => formatRounded(x2 * 100, p), - "r": formatRounded, - "s": formatPrefixAuto, - "X": (x2) => Math.round(x2).toString(16).toUpperCase(), - "x": (x2) => Math.round(x2).toString(16) -}; -function identity(x2) { - return x2; -} -var map = Array.prototype.map; -var prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; -function formatLocale$1(locale2) { - var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity : formatGroup(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity : formatNumerals(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + ""; - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero2 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type; - if (type === "n") comma = true, type = "g"; - else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g"; - if (zero2 || fill === "0" && align === "=") zero2 = true, fill = "0", align = "="; - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; - var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type); - precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); - function format3(value) { - var valuePrefix = prefix, valueSuffix = suffix, i, n, c; - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - var valueNegative = value < 0 || 1 / value < 0; - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - if (trim) value = formatTrim(value); - if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false; - valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix; - valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : ""); - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - if (comma && !zero2) value = group(value, Infinity); - var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : ""; - if (comma && zero2) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; - switch (align) { - case "<": - value = valuePrefix + value + valueSuffix + padding; - break; - case "=": - value = valuePrefix + padding + value + valueSuffix; - break; - case "^": - value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); - break; - default: - value = padding + valuePrefix + value + valueSuffix; - break; - } - return numerals(value); - } - format3.toString = function() { - return specifier + ""; - }; - return format3; - } - function formatPrefix2(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k2 = Math.pow(10, -e), prefix = prefixes[8 + e / 3]; - return function(value2) { - return f(k2 * value2) + prefix; - }; - } - return { - format: newFormat, - formatPrefix: formatPrefix2 - }; -} -var locale$1; -var format2; -var formatPrefix; -defaultLocale$1({ - thousands: ",", - grouping: [3], - currency: ["$", ""] -}); -function defaultLocale$1(definition) { - locale$1 = formatLocale$1(definition); - format2 = locale$1.format; - formatPrefix = locale$1.formatPrefix; - return locale$1; -} -function precisionFixed(step2) { - return Math.max(0, -exponent(Math.abs(step2))); -} -function precisionPrefix(step2, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step2))); -} -function precisionRound(step2, max3) { - step2 = Math.abs(step2), max3 = Math.abs(max3) - step2; - return Math.max(0, exponent(max3) - exponent(step2)) + 1; -} -function tickFormat(start, stop, count, specifier) { - var step2 = tickStep(start, stop, count), precision; - specifier = formatSpecifier(specifier == null ? ",f" : specifier); - switch (specifier.type) { - case "s": { - var value = Math.max(Math.abs(start), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix(step2, value))) specifier.precision = precision; - return formatPrefix(specifier, value); - } - case "": - case "e": - case "g": - case "p": - case "r": { - if (specifier.precision == null && !isNaN(precision = precisionRound(step2, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); - break; - } - case "f": - case "%": { - if (specifier.precision == null && !isNaN(precision = precisionFixed(step2))) specifier.precision = precision - (specifier.type === "%") * 2; - break; - } - } - return format2(specifier); -} -function linearish(scale) { - var domain = scale.domain; - scale.ticks = function(count) { - var d = domain(); - return ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - scale.tickFormat = function(count, specifier) { - var d = domain(); - return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); - }; - scale.nice = function(count) { - if (count == null) count = 10; - var d = domain(); - var i0 = 0; - var i1 = d.length - 1; - var start = d[i0]; - var stop = d[i1]; - var prestep; - var step2; - var maxIter = 10; - if (stop < start) { - step2 = start, start = stop, stop = step2; - step2 = i0, i0 = i1, i1 = step2; - } - while (maxIter-- > 0) { - step2 = tickIncrement(start, stop, count); - if (step2 === prestep) { - d[i0] = start; - d[i1] = stop; - return domain(d); - } else if (step2 > 0) { - start = Math.floor(start / step2) * step2; - stop = Math.ceil(stop / step2) * step2; - } else if (step2 < 0) { - start = Math.ceil(start * step2) / step2; - stop = Math.floor(stop * step2) / step2; - } else { - break; - } - prestep = step2; - } - return scale; - }; - return scale; -} -function linear() { - var scale = continuous(); - scale.copy = function() { - return copy(scale, linear()); - }; - initRange.apply(scale, arguments); - return linearish(scale); -} -function nice(domain, interval) { - domain = domain.slice(); - var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t; - if (x1 < x0) { - t = i0, i0 = i1, i1 = t; - t = x0, x0 = x1, x1 = t; - } - domain[i0] = interval.floor(x0); - domain[i1] = interval.ceil(x1); - return domain; -} -function transformLog(x2) { - return Math.log(x2); -} -function transformExp(x2) { - return Math.exp(x2); -} -function transformLogn(x2) { - return -Math.log(-x2); -} -function transformExpn(x2) { - return -Math.exp(-x2); -} -function pow10(x2) { - return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2; -} -function powp(base) { - return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2); -} -function logp(base) { - return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base); -} -function reflect(f) { - return (x2, k2) => -f(-x2, k2); -} -function loggish(transform) { - const scale = transform(transformLog, transformExp); - const domain = scale.domain; - let base = 10; - let logs; - let pows; - function rescale() { - logs = logp(base), pows = powp(base); - if (domain()[0] < 0) { - logs = reflect(logs), pows = reflect(pows); - transform(transformLogn, transformExpn); - } else { - transform(transformLog, transformExp); - } - return scale; - } - scale.base = function(_) { - return arguments.length ? (base = +_, rescale()) : base; - }; - scale.domain = function(_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - scale.ticks = (count) => { - const d = domain(); - let u = d[0]; - let v = d[d.length - 1]; - const r2 = v < u; - if (r2) [u, v] = [v, u]; - let i = logs(u); - let j = logs(v); - let k2; - let t; - const n = count == null ? 10 : +count; - let z = []; - if (!(base % 1) && j - i < n) { - i = Math.floor(i), j = Math.ceil(j); - if (u > 0) for (; i <= j; ++i) { - for (k2 = 1; k2 < base; ++k2) { - t = i < 0 ? k2 / pows(-i) : k2 * pows(i); - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } - else for (; i <= j; ++i) { - for (k2 = base - 1; k2 >= 1; --k2) { - t = i > 0 ? k2 / pows(-i) : k2 * pows(i); - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } - if (z.length * 2 < n) z = ticks(u, v, n); - } else { - z = ticks(i, j, Math.min(j - i, n)).map(pows); - } - return r2 ? z.reverse() : z; - }; - scale.tickFormat = (count, specifier) => { - if (count == null) count = 10; - if (specifier == null) specifier = base === 10 ? "s" : ","; - if (typeof specifier !== "function") { - if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true; - specifier = format2(specifier); - } - if (count === Infinity) return specifier; - const k2 = Math.max(1, base * count / scale.ticks().length); - return (d) => { - let i = d / pows(Math.round(logs(d))); - if (i * base < base - 0.5) i *= base; - return i <= k2 ? specifier(d) : ""; - }; - }; - scale.nice = () => { - return domain(nice(domain(), { - floor: (x2) => pows(Math.floor(logs(x2))), - ceil: (x2) => pows(Math.ceil(logs(x2))) - })); - }; - return scale; -} -function log() { - const scale = loggish(transformer()).domain([1, 10]); - scale.copy = () => copy(scale, log()).base(scale.base()); - initRange.apply(scale, arguments); - return scale; -} -var t0 = /* @__PURE__ */ new Date(); -var t1 = /* @__PURE__ */ new Date(); -function timeInterval(floori, offseti, count, field) { - function interval(date2) { - return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; - } - interval.floor = (date2) => { - return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; - }; - interval.ceil = (date2) => { - return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; - }; - interval.round = (date2) => { - const d0 = interval(date2), d1 = interval.ceil(date2); - return date2 - d0 < d1 - date2 ? d0 : d1; - }; - interval.offset = (date2, step2) => { - return offseti(date2 = /* @__PURE__ */ new Date(+date2), step2 == null ? 1 : Math.floor(step2)), date2; - }; - interval.range = (start, stop, step2) => { - const range3 = []; - start = interval.ceil(start); - step2 = step2 == null ? 1 : Math.floor(step2); - if (!(start < stop) || !(step2 > 0)) return range3; - let previous; - do - range3.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step2), floori(start); - while (previous < start && start < stop); - return range3; - }; - interval.filter = (test) => { - return timeInterval((date2) => { - if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1); - }, (date2, step2) => { - if (date2 >= date2) { - if (step2 < 0) while (++step2 <= 0) { - while (offseti(date2, -1), !test(date2)) { - } - } - else while (--step2 >= 0) { - while (offseti(date2, 1), !test(date2)) { - } - } - } - }); - }; - if (count) { - interval.count = (start, end) => { - t0.setTime(+start), t1.setTime(+end); - floori(t0), floori(t1); - return Math.floor(count(t0, t1)); - }; - interval.every = (step2) => { - step2 = Math.floor(step2); - return !isFinite(step2) || !(step2 > 0) ? null : !(step2 > 1) ? interval : interval.filter(field ? (d) => field(d) % step2 === 0 : (d) => interval.count(0, d) % step2 === 0); - }; - } - return interval; -} -var millisecond = timeInterval(() => { -}, (date2, step2) => { - date2.setTime(+date2 + step2); -}, (start, end) => { - return end - start; -}); -millisecond.every = (k2) => { - k2 = Math.floor(k2); - if (!isFinite(k2) || !(k2 > 0)) return null; - if (!(k2 > 1)) return millisecond; - return timeInterval((date2) => { - date2.setTime(Math.floor(date2 / k2) * k2); - }, (date2, step2) => { - date2.setTime(+date2 + step2 * k2); - }, (start, end) => { - return (end - start) / k2; - }); -}; -millisecond.range; -var durationSecond = 1e3; -var durationMinute = durationSecond * 60; -var durationHour = durationMinute * 60; -var durationDay = durationHour * 24; -var durationWeek = durationDay * 7; -var durationMonth = durationDay * 30; -var durationYear = durationDay * 365; -var second = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds()); -}, (date2, step2) => { - date2.setTime(+date2 + step2 * durationSecond); -}, (start, end) => { - return (end - start) / durationSecond; -}, (date2) => { - return date2.getUTCSeconds(); -}); -second.range; -var timeMinute = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); -}, (date2, step2) => { - date2.setTime(+date2 + step2 * durationMinute); -}, (start, end) => { - return (end - start) / durationMinute; -}, (date2) => { - return date2.getMinutes(); -}); -timeMinute.range; -var utcMinute = timeInterval((date2) => { - date2.setUTCSeconds(0, 0); -}, (date2, step2) => { - date2.setTime(+date2 + step2 * durationMinute); -}, (start, end) => { - return (end - start) / durationMinute; -}, (date2) => { - return date2.getUTCMinutes(); -}); -utcMinute.range; -var timeHour = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); -}, (date2, step2) => { - date2.setTime(+date2 + step2 * durationHour); -}, (start, end) => { - return (end - start) / durationHour; -}, (date2) => { - return date2.getHours(); -}); -timeHour.range; -var utcHour = timeInterval((date2) => { - date2.setUTCMinutes(0, 0, 0); -}, (date2, step2) => { - date2.setTime(+date2 + step2 * durationHour); -}, (start, end) => { - return (end - start) / durationHour; -}, (date2) => { - return date2.getUTCHours(); -}); -utcHour.range; -var timeDay = timeInterval( - (date2) => date2.setHours(0, 0, 0, 0), - (date2, step2) => date2.setDate(date2.getDate() + step2), - (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay, - (date2) => date2.getDate() - 1 -); -timeDay.range; -var utcDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setUTCDate(date2.getUTCDate() + step2); -}, (start, end) => { - return (end - start) / durationDay; -}, (date2) => { - return date2.getUTCDate() - 1; -}); -utcDay.range; -var unixDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setUTCDate(date2.getUTCDate() + step2); -}, (start, end) => { - return (end - start) / durationDay; -}, (date2) => { - return Math.floor(date2 / durationDay); -}); -unixDay.range; -function timeWeekday(i) { - return timeInterval((date2) => { - date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7); - date2.setHours(0, 0, 0, 0); - }, (date2, step2) => { - date2.setDate(date2.getDate() + step2 * 7); - }, (start, end) => { - return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; - }); -} -var timeSunday = timeWeekday(0); -var timeMonday = timeWeekday(1); -var timeTuesday = timeWeekday(2); -var timeWednesday = timeWeekday(3); -var timeThursday = timeWeekday(4); -var timeFriday = timeWeekday(5); -var timeSaturday = timeWeekday(6); -timeSunday.range; -timeMonday.range; -timeTuesday.range; -timeWednesday.range; -timeThursday.range; -timeFriday.range; -timeSaturday.range; -function utcWeekday(i) { - return timeInterval((date2) => { - date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step2) => { - date2.setUTCDate(date2.getUTCDate() + step2 * 7); - }, (start, end) => { - return (end - start) / durationWeek; - }); -} -var utcSunday = utcWeekday(0); -var utcMonday = utcWeekday(1); -var utcTuesday = utcWeekday(2); -var utcWednesday = utcWeekday(3); -var utcThursday = utcWeekday(4); -var utcFriday = utcWeekday(5); -var utcSaturday = utcWeekday(6); -utcSunday.range; -utcMonday.range; -utcTuesday.range; -utcWednesday.range; -utcThursday.range; -utcFriday.range; -utcSaturday.range; -var timeMonth = timeInterval((date2) => { - date2.setDate(1); - date2.setHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setMonth(date2.getMonth() + step2); -}, (start, end) => { - return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; -}, (date2) => { - return date2.getMonth(); -}); -timeMonth.range; -var utcMonth = timeInterval((date2) => { - date2.setUTCDate(1); - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setUTCMonth(date2.getUTCMonth() + step2); -}, (start, end) => { - return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; -}, (date2) => { - return date2.getUTCMonth(); -}); -utcMonth.range; -var timeYear = timeInterval((date2) => { - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setFullYear(date2.getFullYear() + step2); -}, (start, end) => { - return end.getFullYear() - start.getFullYear(); -}, (date2) => { - return date2.getFullYear(); -}); -timeYear.every = (k2) => { - return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { - date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2); - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, (date2, step2) => { - date2.setFullYear(date2.getFullYear() + step2 * k2); - }); -}; -timeYear.range; -var utcYear = timeInterval((date2) => { - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step2) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step2); -}, (start, end) => { - return end.getUTCFullYear() - start.getUTCFullYear(); -}, (date2) => { - return date2.getUTCFullYear(); -}); -utcYear.every = (k2) => { - return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { - date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2); - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step2) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step2 * k2); - }); -}; -utcYear.range; -function ticker(year, month, week, day, hour, minute) { - const tickIntervals = [ - [second, 1, durationSecond], - [second, 5, 5 * durationSecond], - [second, 15, 15 * durationSecond], - [second, 30, 30 * durationSecond], - [minute, 1, durationMinute], - [minute, 5, 5 * durationMinute], - [minute, 15, 15 * durationMinute], - [minute, 30, 30 * durationMinute], - [hour, 1, durationHour], - [hour, 3, 3 * durationHour], - [hour, 6, 6 * durationHour], - [hour, 12, 12 * durationHour], - [day, 1, durationDay], - [day, 2, 2 * durationDay], - [week, 1, durationWeek], - [month, 1, durationMonth], - [month, 3, 3 * durationMonth], - [year, 1, durationYear] - ]; - function ticks2(start, stop, count) { - const reverse = stop < start; - if (reverse) [start, stop] = [stop, start]; - const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count); - const ticks3 = interval ? interval.range(start, +stop + 1) : []; - return reverse ? ticks3.reverse() : ticks3; - } - function tickInterval(start, stop, count) { - const target = Math.abs(stop - start) / count; - const i = bisector(([, , step3]) => step3).right(tickIntervals, target); - if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count)); - if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1)); - const [t, step2] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; - return t.every(step2); - } - return [ticks2, tickInterval]; -} -ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute); -var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); -function localDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); - date2.setFullYear(d.y); - return date2; - } - return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); -} -function utcDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); - date2.setUTCFullYear(d.y); - return date2; - } - return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); -} -function newDate(y2, m, d) { - return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 }; -} -function formatLocale(locale2) { - var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths; - var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); - var formats = { - "a": formatShortWeekday, - "A": formatWeekday, - "b": formatShortMonth, - "B": formatMonth, - "c": null, - "d": formatDayOfMonth, - "e": formatDayOfMonth, - "f": formatMicroseconds, - "g": formatYearISO, - "G": formatFullYearISO, - "H": formatHour24, - "I": formatHour12, - "j": formatDayOfYear, - "L": formatMilliseconds, - "m": formatMonthNumber, - "M": formatMinutes, - "p": formatPeriod, - "q": formatQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatSeconds, - "u": formatWeekdayNumberMonday, - "U": formatWeekNumberSunday, - "V": formatWeekNumberISO, - "w": formatWeekdayNumberSunday, - "W": formatWeekNumberMonday, - "x": null, - "X": null, - "y": formatYear, - "Y": formatFullYear, - "Z": formatZone, - "%": formatLiteralPercent - }; - var utcFormats = { - "a": formatUTCShortWeekday, - "A": formatUTCWeekday, - "b": formatUTCShortMonth, - "B": formatUTCMonth, - "c": null, - "d": formatUTCDayOfMonth, - "e": formatUTCDayOfMonth, - "f": formatUTCMicroseconds, - "g": formatUTCYearISO, - "G": formatUTCFullYearISO, - "H": formatUTCHour24, - "I": formatUTCHour12, - "j": formatUTCDayOfYear, - "L": formatUTCMilliseconds, - "m": formatUTCMonthNumber, - "M": formatUTCMinutes, - "p": formatUTCPeriod, - "q": formatUTCQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatUTCSeconds, - "u": formatUTCWeekdayNumberMonday, - "U": formatUTCWeekNumberSunday, - "V": formatUTCWeekNumberISO, - "w": formatUTCWeekdayNumberSunday, - "W": formatUTCWeekNumberMonday, - "x": null, - "X": null, - "y": formatUTCYear, - "Y": formatUTCFullYear, - "Z": formatUTCZone, - "%": formatLiteralPercent - }; - var parses = { - "a": parseShortWeekday, - "A": parseWeekday, - "b": parseShortMonth, - "B": parseMonth, - "c": parseLocaleDateTime, - "d": parseDayOfMonth, - "e": parseDayOfMonth, - "f": parseMicroseconds, - "g": parseYear, - "G": parseFullYear, - "H": parseHour24, - "I": parseHour24, - "j": parseDayOfYear, - "L": parseMilliseconds, - "m": parseMonthNumber, - "M": parseMinutes, - "p": parsePeriod, - "q": parseQuarter, - "Q": parseUnixTimestamp, - "s": parseUnixTimestampSeconds, - "S": parseSeconds, - "u": parseWeekdayNumberMonday, - "U": parseWeekNumberSunday, - "V": parseWeekNumberISO, - "w": parseWeekdayNumberSunday, - "W": parseWeekNumberMonday, - "x": parseLocaleDate, - "X": parseLocaleTime, - "y": parseYear, - "Y": parseFullYear, - "Z": parseZone, - "%": parseLiteralPercent - }; - formats.x = newFormat(locale_date, formats); - formats.X = newFormat(locale_time, formats); - formats.c = newFormat(locale_dateTime, formats); - utcFormats.x = newFormat(locale_date, utcFormats); - utcFormats.X = newFormat(locale_time, utcFormats); - utcFormats.c = newFormat(locale_dateTime, utcFormats); - function newFormat(specifier, formats2) { - return function(date2) { - var string2 = [], i = -1, j = 0, n = specifier.length, c, pad2, format3; - if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); - while (++i < n) { - if (specifier.charCodeAt(i) === 37) { - string2.push(specifier.slice(j, i)); - if ((pad2 = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); - else pad2 = c === "e" ? " " : "0"; - if (format3 = formats2[c]) c = format3(date2, pad2); - string2.push(c); - j = i + 1; - } - } - string2.push(specifier.slice(j, i)); - return string2.join(""); - }; - } - function newParse(specifier, Z) { - return function(string2) { - var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string2 += "", 0), week, day; - if (i != string2.length) return null; - if ("Q" in d) return new Date(d.Q); - if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0)); - if (Z && !("Z" in d)) d.Z = 0; - if ("p" in d) d.H = d.H % 12 + d.p * 12; - if (d.m === void 0) d.m = "q" in d ? d.q : 0; - if ("V" in d) { - if (d.V < 1 || d.V > 53) return null; - if (!("w" in d)) d.w = 1; - if ("Z" in d) { - week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); - week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); - week = utcDay.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; - } else { - week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); - week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); - week = timeDay.offset(week, (d.V - 1) * 7); - d.y = week.getFullYear(); - d.m = week.getMonth(); - d.d = week.getDate() + (d.w + 6) % 7; - } - } else if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; - day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); - d.m = 0; - d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; - } - if ("Z" in d) { - d.H += d.Z / 100 | 0; - d.M += d.Z % 100; - return utcDate(d); - } - return localDate(d); - }; - } - function parseSpecifier(d, specifier, string2, j) { - var i = 0, n = specifier.length, m = string2.length, c, parse2; - while (i < n) { - if (j >= m) return -1; - c = specifier.charCodeAt(i++); - if (c === 37) { - c = specifier.charAt(i++); - parse2 = parses[c in pads ? specifier.charAt(i++) : c]; - if (!parse2 || (j = parse2(d, string2, j)) < 0) return -1; - } else if (c != string2.charCodeAt(j++)) { - return -1; - } - } - return j; - } - function parsePeriod(d, string2, i) { - var n = periodRe.exec(string2.slice(i)); - return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseShortWeekday(d, string2, i) { - var n = shortWeekdayRe.exec(string2.slice(i)); - return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseWeekday(d, string2, i) { - var n = weekdayRe.exec(string2.slice(i)); - return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseShortMonth(d, string2, i) { - var n = shortMonthRe.exec(string2.slice(i)); - return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseMonth(d, string2, i) { - var n = monthRe.exec(string2.slice(i)); - return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseLocaleDateTime(d, string2, i) { - return parseSpecifier(d, locale_dateTime, string2, i); - } - function parseLocaleDate(d, string2, i) { - return parseSpecifier(d, locale_date, string2, i); - } - function parseLocaleTime(d, string2, i) { - return parseSpecifier(d, locale_time, string2, i); - } - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; - } - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; - } - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; - } - function formatMonth(d) { - return locale_months[d.getMonth()]; - } - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; - } - function formatQuarter(d) { - return 1 + ~~(d.getMonth() / 3); - } - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; - } - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; - } - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; - } - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; - } - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; - } - function formatUTCQuarter(d) { - return 1 + ~~(d.getUTCMonth() / 3); - } - return { - format: function(specifier) { - var f = newFormat(specifier += "", formats); - f.toString = function() { - return specifier; - }; - return f; - }, - parse: function(specifier) { - var p = newParse(specifier += "", false); - p.toString = function() { - return specifier; - }; - return p; - }, - utcFormat: function(specifier) { - var f = newFormat(specifier += "", utcFormats); - f.toString = function() { - return specifier; - }; - return f; - }, - utcParse: function(specifier) { - var p = newParse(specifier += "", true); - p.toString = function() { - return specifier; - }; - return p; - } - }; -} -var pads = { "-": "", "_": " ", "0": "0" }; -var numberRe = /^\s*\d+/; -var percentRe = /^%/; -var requoteRe = /[\\^$*+?|[\]().{}]/g; -function pad(value, fill, width) { - var sign2 = value < 0 ? "-" : "", string2 = (sign2 ? -value : value) + "", length = string2.length; - return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string2 : string2); -} -function requote(s2) { - return s2.replace(requoteRe, "\\$&"); -} -function formatRe(names) { - return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); -} -function formatLookup(names) { - return new Map(names.map((name, i) => [name.toLowerCase(), i])); -} -function parseWeekdayNumberSunday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.w = +n[0], i + n[0].length) : -1; -} -function parseWeekdayNumberMonday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.u = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberSunday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.U = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberISO(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.V = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberMonday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.W = +n[0], i + n[0].length) : -1; -} -function parseFullYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 4)); - return n ? (d.y = +n[0], i + n[0].length) : -1; -} -function parseYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1; -} -function parseZone(d, string2, i) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i, i + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; -} -function parseQuarter(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; -} -function parseMonthNumber(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.m = n[0] - 1, i + n[0].length) : -1; -} -function parseDayOfMonth(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.d = +n[0], i + n[0].length) : -1; -} -function parseDayOfYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 3)); - return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; -} -function parseHour24(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.H = +n[0], i + n[0].length) : -1; -} -function parseMinutes(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.M = +n[0], i + n[0].length) : -1; -} -function parseSeconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.S = +n[0], i + n[0].length) : -1; -} -function parseMilliseconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 3)); - return n ? (d.L = +n[0], i + n[0].length) : -1; -} -function parseMicroseconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 6)); - return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1; -} -function parseLiteralPercent(d, string2, i) { - var n = percentRe.exec(string2.slice(i, i + 1)); - return n ? i + n[0].length : -1; -} -function parseUnixTimestamp(d, string2, i) { - var n = numberRe.exec(string2.slice(i)); - return n ? (d.Q = +n[0], i + n[0].length) : -1; -} -function parseUnixTimestampSeconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i)); - return n ? (d.s = +n[0], i + n[0].length) : -1; -} -function formatDayOfMonth(d, p) { - return pad(d.getDate(), p, 2); -} -function formatHour24(d, p) { - return pad(d.getHours(), p, 2); -} -function formatHour12(d, p) { - return pad(d.getHours() % 12 || 12, p, 2); -} -function formatDayOfYear(d, p) { - return pad(1 + timeDay.count(timeYear(d), d), p, 3); -} -function formatMilliseconds(d, p) { - return pad(d.getMilliseconds(), p, 3); -} -function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; -} -function formatMonthNumber(d, p) { - return pad(d.getMonth() + 1, p, 2); -} -function formatMinutes(d, p) { - return pad(d.getMinutes(), p, 2); -} -function formatSeconds(d, p) { - return pad(d.getSeconds(), p, 2); -} -function formatWeekdayNumberMonday(d) { - var day = d.getDay(); - return day === 0 ? 7 : day; -} -function formatWeekNumberSunday(d, p) { - return pad(timeSunday.count(timeYear(d) - 1, d), p, 2); -} -function dISO(d) { - var day = d.getDay(); - return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); -} -function formatWeekNumberISO(d, p) { - d = dISO(d); - return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); -} -function formatWeekdayNumberSunday(d) { - return d.getDay(); -} -function formatWeekNumberMonday(d, p) { - return pad(timeMonday.count(timeYear(d) - 1, d), p, 2); -} -function formatYear(d, p) { - return pad(d.getFullYear() % 100, p, 2); -} -function formatYearISO(d, p) { - d = dISO(d); - return pad(d.getFullYear() % 100, p, 2); -} -function formatFullYear(d, p) { - return pad(d.getFullYear() % 1e4, p, 4); -} -function formatFullYearISO(d, p) { - var day = d.getDay(); - d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); - return pad(d.getFullYear() % 1e4, p, 4); -} -function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); -} -function formatUTCDayOfMonth(d, p) { - return pad(d.getUTCDate(), p, 2); -} -function formatUTCHour24(d, p) { - return pad(d.getUTCHours(), p, 2); -} -function formatUTCHour12(d, p) { - return pad(d.getUTCHours() % 12 || 12, p, 2); -} -function formatUTCDayOfYear(d, p) { - return pad(1 + utcDay.count(utcYear(d), d), p, 3); -} -function formatUTCMilliseconds(d, p) { - return pad(d.getUTCMilliseconds(), p, 3); -} -function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; -} -function formatUTCMonthNumber(d, p) { - return pad(d.getUTCMonth() + 1, p, 2); -} -function formatUTCMinutes(d, p) { - return pad(d.getUTCMinutes(), p, 2); -} -function formatUTCSeconds(d, p) { - return pad(d.getUTCSeconds(), p, 2); -} -function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; -} -function formatUTCWeekNumberSunday(d, p) { - return pad(utcSunday.count(utcYear(d) - 1, d), p, 2); -} -function UTCdISO(d) { - var day = d.getUTCDay(); - return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); -} -function formatUTCWeekNumberISO(d, p) { - d = UTCdISO(d); - return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); -} -function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); -} -function formatUTCWeekNumberMonday(d, p) { - return pad(utcMonday.count(utcYear(d) - 1, d), p, 2); -} -function formatUTCYear(d, p) { - return pad(d.getUTCFullYear() % 100, p, 2); -} -function formatUTCYearISO(d, p) { - d = UTCdISO(d); - return pad(d.getUTCFullYear() % 100, p, 2); -} -function formatUTCFullYear(d, p) { - return pad(d.getUTCFullYear() % 1e4, p, 4); -} -function formatUTCFullYearISO(d, p) { - var day = d.getUTCDay(); - d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); - return pad(d.getUTCFullYear() % 1e4, p, 4); -} -function formatUTCZone() { - return "+0000"; -} -function formatLiteralPercent() { - return "%"; -} -function formatUnixTimestamp(d) { - return +d; -} -function formatUnixTimestampSeconds(d) { - return Math.floor(+d / 1e3); -} -var locale; -var timeFormat; -defaultLocale({ - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] -}); -function defaultLocale(definition) { - locale = formatLocale(definition); - timeFormat = locale.format; - locale.parse; - locale.utcFormat; - locale.utcParse; - return locale; -} -function date(t) { - return new Date(t); -} -function number(t) { - return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t); -} -function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format3) { - var scale = continuous(), invert = scale.invert, domain = scale.domain; - var formatMillisecond = format3(".%L"), formatSecond = format3(":%S"), formatMinute = format3("%I:%M"), formatHour = format3("%I %p"), formatDay = format3("%a %d"), formatWeek = format3("%b %d"), formatMonth = format3("%B"), formatYear2 = format3("%Y"); - function tickFormat2(date2) { - return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2); - } - scale.invert = function(y2) { - return new Date(invert(y2)); - }; - scale.domain = function(_) { - return arguments.length ? domain(Array.from(_, number)) : domain().map(date); - }; - scale.ticks = function(interval) { - var d = domain(); - return ticks2(d[0], d[d.length - 1], interval == null ? 10 : interval); - }; - scale.tickFormat = function(count, specifier) { - return specifier == null ? tickFormat2 : format3(specifier); - }; - scale.nice = function(interval) { - var d = domain(); - if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval); - return interval ? domain(nice(d, interval)) : scale; - }; - scale.copy = function() { - return copy(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format3)); - }; - return scale; -} -function time2() { - return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); -} - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/scales.js -function isNumericDomain(domain) { - return domain.length > 0 && typeof domain[0] === "number"; -} -function isDateDomain(domain) { - return domain.length > 0 && domain[0] instanceof Date; -} -function createNumericScale(type, domain) { - let scale; - switch (type) { - case "log": - scale = log(); - break; - default: - scale = linear(); - } - if (isNumericDomain(domain)) { - scale.domain(domain); - } - return scale; -} -function createTimeScale(domain) { - const scale = time2(); - if (isDateDomain(domain)) { - scale.domain(domain); - } - return scale; -} -function createBandScale(domain) { - const scale = band().padding(0.1); - scale.domain(domain); - return scale; -} -function createScale(type, domain, range3) { - switch (type) { - case "linear": - case "log": - return { type: "numeric", scale: createNumericScale(type, domain).range(range3) }; - case "time": - return { type: "time", scale: createTimeScale(domain).range(range3) }; - case "categorical": - return { type: "categorical", scale: createBandScale(domain).range(range3) }; - } -} -var ChartScale = class _ChartScale { - constructor(scaleType, domain, range3, noCategoricalOuterPadding = false) { - this.scaleType = scaleType; - this.domain = domain; - this.range = range3; - this.scale = createScale(this.scaleType, this.domain, this.range); - this.d3Scale = this.scale.scale; - if (this.isCategorical()) { - if (noCategoricalOuterPadding) { - this.d3Scale.paddingInner(0.7); - this.d3Scale.paddingOuter(0); - } else { - this.d3Scale.paddingInner(0.2); - this.d3Scale.paddingOuter(0.05); - } - } - } - cloneScale(newScaleType, newDomain, newRange) { - return new _ChartScale(newScaleType || this.scaleType, newDomain || this.domain, newRange || this.range); - } - isNumeric() { - return this.scale.type === "numeric"; - } - isTime() { - return this.scale.type === "time"; - } - isCategorical() { - return this.scale.type === "categorical"; - } -}; -var NumericChartScale = class { - constructor(scaleType, domain, range3, adjustDomain) { - this.scaleType = scaleType; - const scale = createNumericScale(scaleType, domain).range(range3); - if (adjustDomain !== null) { - scale.nice(adjustDomain); - } - this.scale = { type: "numeric", scale }; - this.d3Scale = this.scale.scale; - } - isCategorical() { - return false; - } -}; - -// node_modules/@cloudscape-design/components/area-chart/model/compute-chart-props.js -function computeChartProps({ series, xDomain: externalXDomain, yDomain: externalYDomain, xScaleType, yScaleType, height, width }) { - const xDomain = externalXDomain || computeDomainX(series); - const xTickCount = getXTickCount(width); - const xScale = new ChartScale(xScaleType, xDomain, [0, width]); - const xTicks = xScale.domain.length > 0 ? createXTicks(xScale, xTickCount) : []; - const yDomain = externalYDomain || computeDomainY(series, yScaleType); - const yTickCount = getYTickCount(height); - const yScale = new NumericChartScale(yScaleType, yDomain, [height, 0], externalYDomain ? null : yTickCount); - const yTicks = createYTicks(yScale, yTickCount); - const plot = computePlotPoints(series, xScale, yScale); - return { xDomain, yDomain, xScale, yScale, xTicks, yTicks, plot }; -} - -// node_modules/@cloudscape-design/components/internal/generated/styles/tokens.js -var colorChartsThresholdNeutral = "var(--color-charts-threshold-neutral-9351o8, #5f6b7a)"; -var colorChartsPaletteCategorical1 = "var(--color-charts-palette-categorical-1-ld9m1p, #688ae8)"; -var colorChartsPaletteCategorical2 = "var(--color-charts-palette-categorical-2-jwteam, #c33d69)"; -var colorChartsPaletteCategorical3 = "var(--color-charts-palette-categorical-3-tlwr5r, #2ea597)"; -var colorChartsPaletteCategorical4 = "var(--color-charts-palette-categorical-4-prlvih, #8456ce)"; -var colorChartsPaletteCategorical5 = "var(--color-charts-palette-categorical-5-04vsso, #e07941)"; -var colorChartsPaletteCategorical6 = "var(--color-charts-palette-categorical-6-2wgmsi, #3759ce)"; -var colorChartsPaletteCategorical7 = "var(--color-charts-palette-categorical-7-w06irv, #962249)"; -var colorChartsPaletteCategorical8 = "var(--color-charts-palette-categorical-8-1qnvcp, #096f64)"; -var colorChartsPaletteCategorical9 = "var(--color-charts-palette-categorical-9-0342zm, #6237a7)"; -var colorChartsPaletteCategorical10 = "var(--color-charts-palette-categorical-10-u73kns, #a84401)"; -var colorChartsPaletteCategorical11 = "var(--color-charts-palette-categorical-11-tloc2a, #273ea5)"; -var colorChartsPaletteCategorical12 = "var(--color-charts-palette-categorical-12-23xv0d, #780d35)"; -var colorChartsPaletteCategorical13 = "var(--color-charts-palette-categorical-13-tuq7ce, #03524a)"; -var colorChartsPaletteCategorical14 = "var(--color-charts-palette-categorical-14-bom4ss, #4a238b)"; -var colorChartsPaletteCategorical15 = "var(--color-charts-palette-categorical-15-kpqcpe, #7e3103)"; -var colorChartsPaletteCategorical16 = "var(--color-charts-palette-categorical-16-pzlo2l, #1b2b88)"; -var colorChartsPaletteCategorical17 = "var(--color-charts-palette-categorical-17-spn4mx, #ce567c)"; -var colorChartsPaletteCategorical18 = "var(--color-charts-palette-categorical-18-kxbv8i, #003e38)"; -var colorChartsPaletteCategorical19 = "var(--color-charts-palette-categorical-19-cl97gf, #9469d6)"; -var colorChartsPaletteCategorical20 = "var(--color-charts-palette-categorical-20-gzcnb4, #602400)"; -var colorChartsPaletteCategorical21 = "var(--color-charts-palette-categorical-21-vyqcuq, #4066df)"; -var colorChartsPaletteCategorical22 = "var(--color-charts-palette-categorical-22-6r7gq7, #a32952)"; -var colorChartsPaletteCategorical23 = "var(--color-charts-palette-categorical-23-7c98ot, #0d7d70)"; -var colorChartsPaletteCategorical24 = "var(--color-charts-palette-categorical-24-0i0wmq, #6b40b2)"; -var colorChartsPaletteCategorical25 = "var(--color-charts-palette-categorical-25-7j0tso, #bc4d01)"; -var colorChartsPaletteCategorical26 = "var(--color-charts-palette-categorical-26-eql7mt, #2c46b1)"; -var colorChartsPaletteCategorical27 = "var(--color-charts-palette-categorical-27-8doiqc, #81143b)"; -var colorChartsPaletteCategorical28 = "var(--color-charts-palette-categorical-28-tlstes, #045b52)"; -var colorChartsPaletteCategorical29 = "var(--color-charts-palette-categorical-29-noa7ft, #512994)"; -var colorChartsPaletteCategorical30 = "var(--color-charts-palette-categorical-30-ttbs6s, #8a3603)"; -var colorChartsPaletteCategorical31 = "var(--color-charts-palette-categorical-31-lz0ukh, #1f3191)"; -var colorChartsPaletteCategorical32 = "var(--color-charts-palette-categorical-32-ncpn1t, #da7596)"; -var colorChartsPaletteCategorical33 = "var(--color-charts-palette-categorical-33-fpbcye, #01443e)"; -var colorChartsPaletteCategorical34 = "var(--color-charts-palette-categorical-34-sk46nw, #a783e1)"; -var colorChartsPaletteCategorical35 = "var(--color-charts-palette-categorical-35-wwtyjx, #692801)"; -var colorChartsPaletteCategorical36 = "var(--color-charts-palette-categorical-36-7v0fgy, #5978e3)"; -var colorChartsPaletteCategorical37 = "var(--color-charts-palette-categorical-37-b2rc0w, #b1325c)"; -var colorChartsPaletteCategorical38 = "var(--color-charts-palette-categorical-38-nlzlk1, #1c8e81)"; -var colorChartsPaletteCategorical39 = "var(--color-charts-palette-categorical-39-esgczm, #7749bf)"; -var colorChartsPaletteCategorical40 = "var(--color-charts-palette-categorical-40-0hdln6, #cc5f21)"; -var colorChartsPaletteCategorical41 = "var(--color-charts-palette-categorical-41-bsk8cf, #314fbf)"; -var colorChartsPaletteCategorical42 = "var(--color-charts-palette-categorical-42-97om84, #8b1b42)"; -var colorChartsPaletteCategorical43 = "var(--color-charts-palette-categorical-43-euzcqg, #06645a)"; -var colorChartsPaletteCategorical44 = "var(--color-charts-palette-categorical-44-a7wos6, #59309d)"; -var colorChartsPaletteCategorical45 = "var(--color-charts-palette-categorical-45-iz0wz2, #983c02)"; -var colorChartsPaletteCategorical46 = "var(--color-charts-palette-categorical-46-nzigym, #23379b)"; -var colorChartsPaletteCategorical47 = "var(--color-charts-palette-categorical-47-croxgd, #6f062f)"; -var colorChartsPaletteCategorical48 = "var(--color-charts-palette-categorical-48-tptw1p, #014b44)"; -var colorChartsPaletteCategorical49 = "var(--color-charts-palette-categorical-49-6lrkes, #431d84)"; -var colorChartsPaletteCategorical50 = "var(--color-charts-palette-categorical-50-mqbaxr, #732c02)"; - -// node_modules/@cloudscape-design/components/internal/styles/colors.js -var categoryPalette = [ - colorChartsPaletteCategorical1, - colorChartsPaletteCategorical2, - colorChartsPaletteCategorical3, - colorChartsPaletteCategorical4, - colorChartsPaletteCategorical5, - colorChartsPaletteCategorical6, - colorChartsPaletteCategorical7, - colorChartsPaletteCategorical8, - colorChartsPaletteCategorical9, - colorChartsPaletteCategorical10, - colorChartsPaletteCategorical11, - colorChartsPaletteCategorical12, - colorChartsPaletteCategorical13, - colorChartsPaletteCategorical14, - colorChartsPaletteCategorical15, - colorChartsPaletteCategorical16, - colorChartsPaletteCategorical17, - colorChartsPaletteCategorical18, - colorChartsPaletteCategorical19, - colorChartsPaletteCategorical20, - colorChartsPaletteCategorical21, - colorChartsPaletteCategorical22, - colorChartsPaletteCategorical23, - colorChartsPaletteCategorical24, - colorChartsPaletteCategorical25, - colorChartsPaletteCategorical26, - colorChartsPaletteCategorical27, - colorChartsPaletteCategorical28, - colorChartsPaletteCategorical29, - colorChartsPaletteCategorical30, - colorChartsPaletteCategorical31, - colorChartsPaletteCategorical32, - colorChartsPaletteCategorical33, - colorChartsPaletteCategorical34, - colorChartsPaletteCategorical35, - colorChartsPaletteCategorical36, - colorChartsPaletteCategorical37, - colorChartsPaletteCategorical38, - colorChartsPaletteCategorical39, - colorChartsPaletteCategorical40, - colorChartsPaletteCategorical41, - colorChartsPaletteCategorical42, - colorChartsPaletteCategorical43, - colorChartsPaletteCategorical44, - colorChartsPaletteCategorical45, - colorChartsPaletteCategorical46, - colorChartsPaletteCategorical47, - colorChartsPaletteCategorical48, - colorChartsPaletteCategorical49, - colorChartsPaletteCategorical50 -]; - -// node_modules/@cloudscape-design/components/internal/utils/create-category-color-scale.js -function createCategoryColorScale(items, isThreshold = () => false, getOwnColor = () => null) { - const colors = []; - let categoryIndex = 0; - for (const it of items) { - const ownColor = getOwnColor(it); - const defaultColor = isThreshold(it) ? colorChartsThresholdNeutral : categoryPalette[categoryIndex % categoryPalette.length]; - colors.push(parseCssVariable(ownColor || defaultColor)); - if (!isThreshold(it) && !ownColor) { - categoryIndex++; - } - } - return colors; -} - -// node_modules/@cloudscape-design/components/area-chart/model/create-series-decorator.js -function createSeriesDecorator(externalSeries) { - const colorScale = createCategoryColorScale(externalSeries, (s2) => s2.type === "threshold", (s2) => s2.color || null); - const decorateSeries = (s2, index) => { - const title = s2.title; - const color2 = colorScale[index]; - const markerType = s2.type === "area" ? "hollow-rectangle" : "dashed"; - const formatValue2 = s2.type === "threshold" ? () => s2.valueFormatter ? s2.valueFormatter(s2.y) : s2.y : (y2, x2) => s2.valueFormatter ? s2.valueFormatter(y2, x2) : y2; - return { series: s2, title, color: color2, markerType, formatValue: formatValue2 }; - }; - const mapping = externalSeries.reduce((map2, series, index) => { - map2.set(series, decorateSeries(series, index)); - return map2; - }, /* @__PURE__ */ new Map()); - const seriesDecorator = (series) => mapping.get(series) || decorateSeries(series, externalSeries.length); - return seriesDecorator; -} - -// node_modules/@cloudscape-design/components/area-chart/model/interactions-store.js -var initialState = Object.freeze({ - highlightedX: null, - highlightedPoint: null, - highlightedSeries: null, - legendSeries: null, - isPopoverPinned: false -}); -var InteractionsStore = class extends AsyncStore { - constructor(series, plot) { - super(initialState); - this.series = series; - this.plot = plot; - } - highlightPoint(point5) { - this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: this.plot.xy[point5.index.x], highlightedPoint: point5, highlightedSeries: this.series[point5.index.s], legendSeries: this.series[point5.index.s] })); - } - highlightX(points) { - this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: points, highlightedPoint: null, highlightedSeries: null, legendSeries: null })); - } - highlightFirstPoint() { - this.set((state) => { - const series = state.legendSeries || state.highlightedSeries; - const firstSeriesPoint = series && this._getFirstSeriesPoint(series); - const point5 = state.highlightedPoint || firstSeriesPoint || this.plot.sx[0][0]; - return Object.assign(Object.assign({}, state), { highlightedX: this.plot.xy[point5.index.x], highlightedPoint: point5, highlightedSeries: this.series[point5.index.s], legendSeries: this.series[point5.index.s] }); - }); - } - highlightSeries(s2) { - this.set((state) => Object.assign(Object.assign({}, state), { highlightedSeries: s2, legendSeries: s2 })); - } - clearHighlight() { - this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: null, highlightedPoint: null, highlightedSeries: null })); - } - clearHighlightedLegend() { - this.set((state) => Object.assign(Object.assign({}, state), { legendSeries: null })); - } - clearState() { - this.set(() => initialState); - } - pinPopover() { - this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: true })); - } - unpinPopover() { - this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: false })); - } - togglePopoverPin() { - this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: !state.isPopoverPinned })); - } - _getFirstSeriesPoint(s2) { - const seriesIndex = this.series.indexOf(s2); - const [firstSeriesPoint] = this.plot.sx[seriesIndex] || []; - return firstSeriesPoint || null; - } -}; - -// node_modules/@cloudscape-design/components/internal/utils/throttle.js -function throttle(func, delay, { trailing = true } = {}) { - let pending = null; - let lastInvokeTime = null; - let timerId = null; - function pendingFunc() { - if (pending === null || lastInvokeTime === null) { - return; - } - const invokeTime = Date.now(); - const shouldInvoke = invokeTime - lastInvokeTime >= delay; - if (shouldInvoke) { - func.apply(pending.this, pending.args); - lastInvokeTime = invokeTime; - pending = null; - timerId = null; - } else if (trailing) { - startTimer(); - } - } - function startTimer() { - if (timerId) { - cancelAnimationFrame(timerId); - } - timerId = requestAnimationFrame(pendingFunc); - } - function throttled(...args) { - if (lastInvokeTime === null) { - lastInvokeTime = Date.now(); - func.apply(this, args); - } else { - pending = { this: this, args }; - startTimer(); - } - } - throttled.cancel = () => { - if (timerId) { - cancelAnimationFrame(timerId); - } - pending = null; - lastInvokeTime = null; - timerId = null; - }; - return throttled; -} - -// node_modules/@cloudscape-design/components/internal/hooks/container-queries/use-height-measure.js -var import_react194 = __toESM(require_react()); -function useHeightMeasure(getMeasure, skip = false, deps = []) { - const [measuredHeight, setHeight] = (0, import_react194.useState)(0); - const stableGetMeasure = (0, import_react194.useCallback)(getMeasure, [...deps, skip]); - useResizeObserver(stableGetMeasure, (entry) => !skip && setHeight(entry.borderBoxHeight)); - return !skip ? measuredHeight : void 0; -} - -// node_modules/@cloudscape-design/components/area-chart/model/use-chart-model.js -var MAX_HOVER_MARGIN = 6; -var SVG_HOVER_THROTTLE = 25; -var POPOVER_DEADZONE = 12; -function useChartModel({ fitHeight, externalSeries: allSeries, visibleSeries: series, setVisibleSeries, highlightedSeries, setHighlightedSeries, xDomain, yDomain, xScaleType, yScaleType, height: explicitHeight, width, popoverRef }) { - var _a2; - const plotRef = (0, import_react195.useRef)(null); - const containerRef = (0, import_react195.useRef)(null); - const verticalMarkerRef = (0, import_react195.useRef)(null); - const plotMeasureRef = (0, import_react195.useRef)(null); - const hasVisibleSeries = series.length > 0; - const height = (_a2 = useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries])) !== null && _a2 !== void 0 ? _a2 : explicitHeight; - const stableSetVisibleSeries = useStableCallback(setVisibleSeries); - const model = (0, import_react195.useMemo)(() => { - const computed = computeChartProps({ - series, - xDomain, - yDomain, - xScaleType, - yScaleType, - height, - width - }); - const interactions = new InteractionsStore(series, computed.plot); - const containsMultipleSeries = interactions.series.length > 1; - const getInternalSeries = createSeriesDecorator(allSeries); - const isMouseOverPopover = (clientX, clientY) => { - var _a3; - if ((_a3 = popoverRef.current) === null || _a3 === void 0 ? void 0 : _a3.firstChild) { - const popoverPosition = popoverRef.current.firstChild.getBoundingClientRect(); - if (clientX > popoverPosition.x - POPOVER_DEADZONE && clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE && clientY > popoverPosition.y - POPOVER_DEADZONE && clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE) { - return true; - } - } - return false; - }; - const onSVGMouseMoveThrottled = throttle((clientX, clientY) => { - if (interactions.get().isPopoverPinned || !plotRef.current || interactions.plot.xy.length === 0 || isMouseOverPopover(clientX, clientY)) { - return; - } - const svgRect = plotRef.current.svg.getBoundingClientRect(); - const offsetX = clientX - svgRect.left; - const offsetY = clientY - svgRect.top; - const closestX = findClosest(interactions.plot.xy, offsetX, (xPoints) => xPoints[0].scaled.x); - const closestPoint = findClosest(closestX, offsetY, (point5) => point5.scaled.y1); - if (Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN && Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN) { - interactions.highlightPoint(closestPoint); - } else { - interactions.highlightX(closestX); - } - }, SVG_HOVER_THROTTLE); - const onSVGMouseMove = ({ clientX, clientY }) => onSVGMouseMoveThrottled(clientX, clientY); - const onSVGMouseOut = (event) => { - onSVGMouseMoveThrottled.cancel(); - if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) { - return; - } - if (!nodeContains(plotRef.current.svg, event.relatedTarget)) { - interactions.clearHighlightedLegend(); - interactions.clearHighlight(); - } - }; - const onSVGMouseDown = (event) => { - interactions.togglePopoverPin(); - event.preventDefault(); - }; - const moveWithinXAxis = (direction) => { - if (interactions.get().highlightedPoint) { - return moveWithinSeries(direction); - } else if (containsMultipleSeries) { - const { highlightedX } = interactions.get(); - if (highlightedX) { - const currentXIndex = highlightedX[0].index.x; - const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]); - interactions.highlightX(interactions.plot.xy[nextXIndex]); - } - } - }; - const moveWithinSeries = (direction) => { - const point5 = interactions.get().highlightedPoint; - if (!point5) { - return; - } - const sIndex = point5.index.s; - const xIndex = circleIndex(point5.index.x + direction, [0, interactions.plot.xs.length - 1]); - interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]); - }; - const moveBetweenSeries = (direction) => { - const point5 = interactions.get().highlightedPoint; - if (!point5) { - const { highlightedX } = interactions.get(); - if (highlightedX) { - const xIndex2 = highlightedX[0].index.x; - const points = interactions.plot.xy[xIndex2]; - const yIndex = direction === 1 ? 0 : points.length - 1; - interactions.highlightPoint(points[yIndex]); - } - return; - } - const xIndex = point5.index.x; - const currentYIndex = point5.index.y; - if (containsMultipleSeries && (currentYIndex === 0 && direction === -1 || currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1)) { - interactions.highlightX(interactions.plot.xy[xIndex]); - } else { - const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]); - interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]); - } - }; - const onSVGKeyDown = (event) => { - const keyCode = event.keyCode; - if (keyCode !== KeyCode.up && keyCode !== KeyCode.right && keyCode !== KeyCode.down && keyCode !== KeyCode.left && keyCode !== KeyCode.space && keyCode !== KeyCode.enter) { - return; - } - event.preventDefault(); - if (interactions.get().isPopoverPinned) { - return; - } - if (keyCode === KeyCode.down || keyCode === KeyCode.up) { - moveBetweenSeries(keyCode === KeyCode.down ? -1 : 1); - } else if (keyCode === KeyCode.left || keyCode === KeyCode.right) { - moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1); - } else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { - interactions.pinPopover(); - } - }; - const highlightFirstX = () => { - interactions.highlightX(interactions.plot.xy[0]); - }; - const onApplicationFocus = (_event, trigger2) => { - if (trigger2 === "keyboard") { - const { highlightedX, highlightedPoint, highlightedSeries: highlightedSeries2, legendSeries } = interactions.get(); - if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries2 && !legendSeries) { - highlightFirstX(); - } else if (!highlightedX) { - interactions.highlightFirstPoint(); - } - } - }; - const onApplicationBlur = (event) => { - if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) { - interactions.clearHighlight(); - } - }; - const onFilterSeries = (series2) => { - stableSetVisibleSeries(series2); - }; - const onLegendHighlight = (series2) => { - interactions.highlightSeries(series2); - }; - const onPopoverDismiss = (outsideClick) => { - interactions.unpinPopover(); - if (!outsideClick) { - setTimeout(() => { - if (interactions.get().highlightedPoint || interactions.get().highlightedX) { - plotRef.current.focusApplication(); - } else { - interactions.clearHighlight(); - plotRef.current.focusPlot(); - } - }, 0); - } - }; - const onContainerBlur = () => { - interactions.clearState(); - }; - const onDocumentKeyDown = (event) => { - if (event.key === "Escape") { - interactions.clearHighlight(); - interactions.clearHighlightedLegend(); - } - }; - const onPopoverLeave = (event) => { - if (nodeContains(plotRef.current.svg, event.relatedTarget) || interactions.get().isPopoverPinned) { - return; - } - interactions.clearHighlight(); - interactions.clearHighlightedLegend(); - }; - return { - width, - height, - series, - allSeries, - getInternalSeries, - computed, - interactions, - handlers: { - onSVGMouseMove, - onSVGMouseOut, - onSVGMouseDown, - onSVGKeyDown, - onApplicationFocus, - onApplicationBlur, - onFilterSeries, - onLegendHighlight, - onPopoverDismiss, - onContainerBlur, - onDocumentKeyDown, - onPopoverLeave - }, - refs: { - plot: plotRef, - plotMeasure: plotMeasureRef, - container: containerRef, - verticalMarker: verticalMarkerRef, - popoverRef - } - }; - }, [allSeries, series, xDomain, yDomain, xScaleType, yScaleType, height, width, stableSetVisibleSeries, popoverRef]); - useReaction(model.interactions, (state) => state.highlightedSeries, setHighlightedSeries); - (0, import_react195.useEffect)(() => { - if (highlightedSeries !== model.interactions.get().highlightedSeries) { - model.interactions.highlightSeries(highlightedSeries); - } - }, [model, highlightedSeries]); - return model; -} - -// node_modules/@cloudscape-design/components/area-chart/model/use-filter-props.js -var import_react196 = __toESM(require_react()); -function useFilterProps(series, controlledVisibleSeries, controlledOnVisibleChange) { - const [visibleSeries = [], setVisibleSeriesState] = useControllable2(controlledVisibleSeries, controlledOnVisibleChange, series, { - componentName: "AreaChart", - controlledProp: "visibleSeries", - changeHandler: "onFilterChange" - }); - const setVisibleSeries = (0, import_react196.useCallback)((selectedSeries) => { - setVisibleSeriesState(selectedSeries); - fireNonCancelableEvent(controlledOnVisibleChange, { visibleSeries: selectedSeries }); - }, [controlledOnVisibleChange, setVisibleSeriesState]); - (0, import_react196.useEffect)(() => { - const newVisibleSeries = visibleSeries.filter((s2) => series.indexOf(s2) !== -1); - if (newVisibleSeries.length !== visibleSeries.length) { - setVisibleSeries(newVisibleSeries); - } - }, [series, visibleSeries, setVisibleSeries]); - return [visibleSeries, setVisibleSeries]; -} - -// node_modules/@cloudscape-design/components/area-chart/model/use-highlight-props.js -var import_react197 = __toESM(require_react()); -function useHighlightProps(series, controlledHighlightedSeries, controlledOnHighlightChange) { - const [highlightedSeries = null, setHighlightedSeries] = useControllable2(controlledHighlightedSeries, controlledOnHighlightChange, null, { - componentName: "AreaChart", - controlledProp: "highlightedSeries", - changeHandler: "onHighlightChange" - }); - const notifyHighlightedSeries = (0, import_react197.useCallback)((s2) => { - fireNonCancelableEvent(controlledOnHighlightChange, { highlightedSeries: s2 }); - }, [controlledOnHighlightChange]); - (0, import_react197.useEffect)(() => { - if (controlledHighlightedSeries) { - const highlightedSeriesIndex = series.indexOf(controlledHighlightedSeries); - if (highlightedSeriesIndex === -1) { - setHighlightedSeries(null); - notifyHighlightedSeries(null); - } - } - }, [series, controlledHighlightedSeries, setHighlightedSeries, notifyHighlightedSeries]); - return [highlightedSeries, notifyHighlightedSeries]; -} - -// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/index.js -var import_react198 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/chart-wrapper/styles.scoped.css"; -var styles_css_default58 = { - "wrapper": "awsui_wrapper_z5mul_nyco0_99", - "wrapper--fit-height": "awsui_wrapper--fit-height_z5mul_nyco0_135", - "inner-wrapper--fit-height": "awsui_inner-wrapper--fit-height_z5mul_nyco0_140", - "has-default-filter": "awsui_has-default-filter_z5mul_nyco0_146", - "content": "awsui_content_z5mul_nyco0_150", - "content--reserve-filter": "awsui_content--reserve-filter_z5mul_nyco0_157", - "content--reserve-legend": "awsui_content--reserve-legend_z5mul_nyco0_161", - "content--fit-height": "awsui_content--fit-height_z5mul_nyco0_165", - "filter-container": "awsui_filter-container_z5mul_nyco0_169" -}; - -// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/index.js -var ChartWrapper = (0, import_react198.forwardRef)((_a2, ref) => { - var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight, fitHeight } = _a2, props2 = __rest(_a2, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight", "fitHeight"]); - const baseProps = getBaseProps(props2); - const filtersNode = (defaultFilter || additionalFilters) && import_react198.default.createElement( - InternalBox, - { className: styles_css_default58["filter-container"], margin: { bottom: "l" } }, - import_react198.default.createElement( - InternalSpaceBetween, - { size: "l", direction: "horizontal", className: clsx_m_default({ [styles_css_default58["has-default-filter"]]: !!defaultFilter }) }, - defaultFilter, - additionalFilters - ) - ); - const legendNode = legend && import_react198.default.createElement(InternalBox, { margin: { top: "m" } }, legend); - if (fitHeight) { - return import_react198.default.createElement( - "div", - Object.assign({ ref }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default58.wrapper, styles_css_default58["wrapper--fit-height"]), onBlur }), - import_react198.default.createElement( - "div", - { className: clsx_m_default(styles_css_default58["inner-wrapper"], styles_css_default58["inner-wrapper--fit-height"]) }, - filtersNode, - import_react198.default.createElement( - "div", - { className: clsx_m_default(styles_css_default58.content, contentClassName, { - [styles_css_default58["content--reserve-filter"]]: reserveFilterSpace, - [styles_css_default58["content--reserve-legend"]]: reserveLegendSpace, - [styles_css_default58["content--fit-height"]]: true - }) }, - chartStatus, - chart - ), - legendNode - ) - ); - } - return import_react198.default.createElement( - "div", - Object.assign({ ref }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default58.wrapper), onBlur }), - filtersNode, - import_react198.default.createElement( - "div", - { className: clsx_m_default(styles_css_default58.content, contentClassName, { - [styles_css_default58["content--reserve-filter"]]: reserveFilterSpace, - [styles_css_default58["content--reserve-legend"]]: reserveLegendSpace - }), style: { minHeight: contentMinHeight } }, - chartStatus, - chart - ), - legendNode - ); -}); - -// node_modules/@cloudscape-design/components/area-chart/internal.js -function InternalAreaChart(_a2) { - var { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, detailTotalFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange: controlledOnVisibleChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["fitHeight", "height", "xScaleType", "yScaleType", "xDomain", "yDomain", "xTickFormatter", "yTickFormatter", "detailTotalFormatter", "highlightedSeries", "visibleSeries", "series", "onFilterChange", "onHighlightChange", "i18nStrings", "ariaLabel", "ariaLabelledby", "ariaDescription", "xTitle", "yTitle", "hideFilter", "additionalFilters", "hideLegend", "legendTitle", "statusType", "detailPopoverSize", "detailPopoverFooter", "empty", "noMatch", "errorText", "loadingText", "recoveryText", "onRecoveryClick", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const containerRef = (0, import_react199.useRef)(null); - const popoverRef = (0, import_react199.useRef)(null); - if (isDevelopment2) { - (0, import_react199.useEffect)(() => { - if (!isSeriesValid(externalSeries)) { - warnOnce("AreaChart", "The `series` property violates the component's constraints: all `area` series must have `data` arrays of the same length and with the same x-values."); - } - }, [externalSeries]); - } - const [width, setWidth] = (0, import_react199.useState)(0); - const [visibleSeries, setVisibleSeries] = useFilterProps(externalSeries, controlledVisibleSeries, controlledOnVisibleChange); - const [highlightedSeries, setHighlightedSeries] = useHighlightProps(externalSeries, controlledHighlightedSeries, controlledOnHighlightChange); - const model = useChartModel({ - fitHeight, - externalSeries, - visibleSeries, - setVisibleSeries, - highlightedSeries, - setHighlightedSeries, - xDomain, - yDomain, - xScaleType, - yScaleType, - height, - width, - popoverRef - }); - const { isEmpty, isNoMatch, showChart } = getChartStatus({ - externalData: externalSeries, - visibleData: visibleSeries, - statusType - }); - const showFilters = statusType === "finished" && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter); - const showLegend = !hideLegend && !isEmpty && statusType === "finished"; - const reserveLegendSpace = !showChart && !hideLegend; - const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters); - (0, import_react199.useEffect)(() => { - const onKeyDown = model.handlers.onDocumentKeyDown; - document.addEventListener("keydown", onKeyDown); - return () => document.removeEventListener("keydown", onKeyDown); - }, [model.handlers.onDocumentKeyDown]); - const onBlur = (event) => { - if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { - model.handlers.onContainerBlur(); - } - }; - const mergedRef = useMergeRefs(containerRef, __internalRootRef); - return import_react199.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default51.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? import_react199.default.createElement(area_chart_filter_default, { model, filterLabel: i18nStrings.filterLabel, filterPlaceholder: i18nStrings.filterPlaceholder, filterSelectedAriaLabel: i18nStrings.filterSelectedAriaLabel }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react199.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty, noMatch, loadingText, errorText, recoveryText, onRecoveryClick }), chart: showChart ? import_react199.default.createElement(chart_container_default, { model, autoWidth: setWidth, detailPopoverSize, detailPopoverFooter, xTitle, yTitle, xTickFormatter, yTickFormatter, detailTotalFormatter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings, fitHeight, minHeight: height }) : null, legend: showLegend ? import_react199.default.createElement(area_chart_legend_default, { plotContainerRef: containerRef, model, legendTitle, ariaLabel: i18nStrings.legendAriaLabel }) : null, onBlur })); -} - -// node_modules/@cloudscape-design/components/area-chart/index.js -function AreaChart(_a2) { - var { height = 500, xScaleType = "linear", yScaleType = "linear", statusType = "finished", detailPopoverSize = "medium", i18nStrings = {} } = _a2, props2 = __rest(_a2, ["height", "xScaleType", "yScaleType", "statusType", "detailPopoverSize", "i18nStrings"]); - const baseComponentProps = useBaseComponent("AreaChart", { - props: { - detailPopoverSize, - hideLegend: props2.hideLegend, - hideFilter: props2.hideFilter, - fitHeight: props2.fitHeight, - xScaleType, - yScaleType - } - }); - return import_react200.default.createElement(InternalAreaChart, Object.assign({ height, xScaleType, yScaleType, statusType, detailPopoverSize, i18nStrings }, props2, baseComponentProps)); -} -applyDisplayName(AreaChart, "AreaChart"); -var area_chart_default = AreaChart; - -// node_modules/@cloudscape-design/components/attribute-editor/index.js -var import_react207 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/attribute-editor/internal.js -var import_react206 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/attribute-editor/additional-info.js -var import_react201 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/attribute-editor/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/attribute-editor/styles.scoped.css"; -var styles_css_default59 = { - "empty-appear": "awsui_empty-appear_n4qlp_1ebkl_99", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1ebkl_1", - "root": "awsui_root_n4qlp_1ebkl_125", - "empty": "awsui_empty_n4qlp_1ebkl_99", - "row": "awsui_row_n4qlp_1ebkl_167", - "row-control": "awsui_row-control_n4qlp_1ebkl_171", - "field": "awsui_field_n4qlp_1ebkl_175", - "add-button": "awsui_add-button_n4qlp_1ebkl_179", - "remove-button": "awsui_remove-button_n4qlp_1ebkl_183", - "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_1ebkl_187", - "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_1ebkl_191", - "divider": "awsui_divider_n4qlp_1ebkl_195", - "additional-info": "awsui_additional-info_n4qlp_1ebkl_199", - "right-align": "awsui_right-align_n4qlp_1ebkl_245" -}; - -// node_modules/@cloudscape-design/components/attribute-editor/additional-info.js -var AdditionalInfo = ({ children: children2, id }) => import_react201.default.createElement( - live_region_default, - { visible: true, tagName: "div", "data-testid": "info-live-region" }, - import_react201.default.createElement("div", { id, className: styles_css_default59["additional-info"] }, children2) -); - -// node_modules/@cloudscape-design/components/attribute-editor/row.js -var import_react205 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/column-layout/internal.js -var import_react204 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/column-layout/flexible-column-layout/index.js -var import_react202 = __toESM(require_react()); -var import_react_keyed_flatten_children3 = __toESM(require_react_keyed_flatten_children()); - -// node_modules/@cloudscape-design/components/column-layout/flexible-column-layout/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/column-layout/flexible-column-layout/styles.scoped.css"; -var styles_css_default60 = { - "css-grid": "awsui_css-grid_zqq3x_19h7g_9", - "grid-no-gutters": "awsui_grid-no-gutters_zqq3x_19h7g_13", - "grid-variant-text-grid": "awsui_grid-variant-text-grid_zqq3x_19h7g_16", - "item": "awsui_item_zqq3x_19h7g_16", - "first-column": "awsui_first-column_zqq3x_19h7g_20" -}; - -// node_modules/@cloudscape-design/components/column-layout/flexible-column-layout/index.js -var isOdd = (value) => value % 2 !== 0; -function calculcateCssColumnCount(columns, minColumnWidth, containerWidth) { - if (!containerWidth) { - return columns; - } - const targetColumnCount = Math.min(columns, Math.floor(containerWidth / minColumnWidth)); - return Math.max(1, targetColumnCount < columns && isOdd(targetColumnCount) ? targetColumnCount - 1 : targetColumnCount); -} -function FlexibleColumnLayout({ columns = 1, minColumnWidth = 0, disableGutters, variant, children: children2 }) { - const [containerWidth, containerRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const columnCount = calculcateCssColumnCount(columns, minColumnWidth, containerWidth); - const shouldDisableGutters = variant !== "text-grid" && disableGutters; - const flattenedChildren = (0, import_react_keyed_flatten_children3.default)(children2); - return import_react202.default.createElement("div", { ref: containerRef, className: clsx_m_default(styles_css_default60["css-grid"], styles_css_default60[`grid-variant-${variant}`], shouldDisableGutters && [styles_css_default60["grid-no-gutters"]]), style: { gridTemplateColumns: `repeat(${columnCount}, 1fr)` } }, flattenedChildren.map((child, i) => { - const key2 = child.key; - return import_react202.default.createElement("div", { key: key2 ? String(key2) : void 0, className: clsx_m_default(styles_css_default60.item, { - [styles_css_default60["first-column"]]: i % columnCount === 0 - }) }, child); - })); -} - -// node_modules/@cloudscape-design/components/column-layout/grid-column-layout.js -var import_react203 = __toESM(require_react()); -var import_react_keyed_flatten_children4 = __toESM(require_react_keyed_flatten_children()); - -// node_modules/@cloudscape-design/components/column-layout/util.js -function repeat(value, times) { - const array = []; - for (let i = 0; i < times; i++) { - array[i] = value; - } - return array; -} - -// node_modules/@cloudscape-design/components/column-layout/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/column-layout/styles.scoped.css"; -var styles_css_default61 = { - "column-layout": "awsui_column-layout_vvxn7_g9i3s_99", - "grid": "awsui_grid_vvxn7_g9i3s_134", - "grid-no-gutters": "awsui_grid-no-gutters_vvxn7_g9i3s_140", - "grid-variant-text-grid": "awsui_grid-variant-text-grid_vvxn7_g9i3s_144", - "grid-breakpoint-default": "awsui_grid-breakpoint-default_vvxn7_g9i3s_152", - "grid-columns-1": "awsui_grid-columns-1_vvxn7_g9i3s_155", - "grid-breakpoint-xxs": "awsui_grid-breakpoint-xxs_vvxn7_g9i3s_155", - "grid-breakpoint-xs": "awsui_grid-breakpoint-xs_vvxn7_g9i3s_158", - "grid-columns-2": "awsui_grid-columns-2_vvxn7_g9i3s_161", - "grid-columns-3": "awsui_grid-columns-3_vvxn7_g9i3s_167", - "grid-columns-4": "awsui_grid-columns-4_vvxn7_g9i3s_173", - "grid-vertical-borders": "awsui_grid-vertical-borders_vvxn7_g9i3s_189", - "grid-horizontal-borders": "awsui_grid-horizontal-borders_vvxn7_g9i3s_222" -}; - -// node_modules/@cloudscape-design/components/column-layout/grid-column-layout.js -var COLUMN_DEFS = { - 1: { colspan: { default: 12, xxs: 12, xs: 12 } }, - 2: { colspan: { default: 12, xxs: 6, xs: 6 } }, - 3: { colspan: { default: 12, xxs: 6, xs: 4 } }, - 4: { colspan: { default: 12, xxs: 6, xs: 3 } } -}; -function GridColumnLayout({ columns, variant, borders, disableGutters, __breakpoint, children: children2 }) { - var _a2; - const isTextGridVariant = variant === "text-grid"; - const shouldDisableGutters = !isTextGridVariant && disableGutters; - const shouldHaveHorizontalBorders = !isTextGridVariant && (borders === "horizontal" || borders === "all"); - const shouldHaveVerticalBorders = !isTextGridVariant && (borders === "vertical" || borders === "all"); - const flattenedChildren = (0, import_react_keyed_flatten_children4.default)(children2); - const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS); - return import_react203.default.createElement(internal_default6, { ref, disableGutters: true, gridDefinition: repeat((_a2 = COLUMN_DEFS[columns]) !== null && _a2 !== void 0 ? _a2 : {}, flattenedChildren.length), className: clsx_m_default(styles_css_default61.grid, styles_css_default61[`grid-columns-${columns}`], styles_css_default61[`grid-variant-${variant}`], { - [styles_css_default61["grid-horizontal-borders"]]: shouldHaveHorizontalBorders, - [styles_css_default61["grid-vertical-borders"]]: shouldHaveVerticalBorders, - [styles_css_default61["grid-no-gutters"]]: shouldDisableGutters - }), __breakpoint: __breakpoint || breakpoint, __responsiveClassName: (breakpoint2) => breakpoint2 && styles_css_default61[`grid-breakpoint-${breakpoint2}`] }, children2); -} - -// node_modules/@cloudscape-design/components/column-layout/internal.js -var COLUMN_TRIGGERS = ["default", "xxs", "xs"]; -function ColumnLayout(_a2) { - var { columns = 1, variant = "default", borders = "none", disableGutters = false, minColumnWidth, children: children2, __breakpoint, __internalRootRef } = _a2, restProps = __rest(_a2, ["columns", "variant", "borders", "disableGutters", "minColumnWidth", "children", "__breakpoint", "__internalRootRef"]); - const baseProps = getBaseProps(restProps); - return import_react204.default.createElement("div", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default61["column-layout"]), ref: __internalRootRef }), minColumnWidth ? import_react204.default.createElement(FlexibleColumnLayout, { columns, borders, variant, minColumnWidth, disableGutters }, children2) : import_react204.default.createElement(GridColumnLayout, { columns, variant, borders, disableGutters, __breakpoint }, children2)); -} - -// node_modules/@cloudscape-design/components/attribute-editor/row.js -var Divider = () => import_react205.default.createElement(InternalBox, { className: styles_css_default59.divider, padding: { top: "l" } }); -function render(item, itemIndex, slot) { - if (isSlotFunction(slot)) { - return slot(item, itemIndex); - } - return slot; - function isSlotFunction(slot2) { - return typeof slot2 === "function"; - } -} -var GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }]; -var REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }]; -var Row = import_react205.default.memo(({ breakpoint, item, definition, i18nStrings = {}, index, removable, removeButtonText, removeButtonRefs, onRemoveButtonClick, removeButtonAriaLabel }) => { - var _a2; - const i18n = useInternalI18n("attribute-editor"); - const isNarrowViewport = breakpoint === "default" || breakpoint === "xxs"; - const isWideViewport = !isNarrowViewport; - const handleRemoveClick = (0, import_react205.useCallback)(() => { - fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index }); - }, [onRemoveButtonClick, index]); - const firstControlId = useUniqueId("first-control-id-"); - return import_react205.default.createElement( - InternalBox, - { className: styles_css_default59.row, margin: { bottom: "s" } }, - import_react205.default.createElement( - "div", - { role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` }, - import_react205.default.createElement( - internal_default6, - { __breakpoint: breakpoint, gridDefinition: removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION }, - import_react205.default.createElement(ColumnLayout, { className: styles_css_default59["row-control"], columns: definition.length, __breakpoint: breakpoint }, definition.map(({ info, label, constraintText, errorText, control }, defIndex) => import_react205.default.createElement(InternalFormField, { key: defIndex, className: styles_css_default59.field, label, info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), stretch: true, i18nStrings: { errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, __hideLabel: isWideViewport && index > 0, controlId: defIndex === 0 ? firstControlId : void 0 }, render(item, index, control)))), - removable && import_react205.default.createElement( - ButtonContainer, - { index, isNarrowViewport, hasLabel: definition.some((row) => row.label) }, - import_react205.default.createElement(InternalButton, { className: styles_css_default59["remove-button"], formAction: "none", ref: (ref) => { - removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : void 0; - }, ariaLabel: (_a2 = removeButtonAriaLabel !== null && removeButtonAriaLabel !== void 0 ? removeButtonAriaLabel : i18nStrings.removeButtonAriaLabel) === null || _a2 === void 0 ? void 0 : _a2(item), onClick: handleRemoveClick }, i18n("removeButtonText", removeButtonText)) - ) - ) - ), - isNarrowViewport && import_react205.default.createElement(Divider, null) - ); -}); -var ButtonContainer = ({ index, children: children2, isNarrowViewport, hasLabel }) => import_react205.default.createElement("div", { className: clsx_m_default({ - [styles_css_default59["button-container-haslabel"]]: !isNarrowViewport && index === 0 && hasLabel, - [styles_css_default59["button-container-nolabel"]]: !isNarrowViewport && index === 0 && !hasLabel, - [styles_css_default59["right-align"]]: isNarrowViewport -}) }, children2); - -// node_modules/@cloudscape-design/components/attribute-editor/internal.js -var InternalAttributeEditor = import_react206.default.forwardRef((_a2, ref) => { - var { additionalInfo, disableAddButton, definition, items, isItemRemovable: isItemRemovable2 = () => true, empty, addButtonText, removeButtonText, removeButtonAriaLabel, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["additionalInfo", "disableAddButton", "definition", "items", "isItemRemovable", "empty", "addButtonText", "removeButtonText", "removeButtonAriaLabel", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef"]); - const [breakpoint, breakpointRef] = useContainerBreakpoints(["default", "xxs", "xs"]); - const removeButtonRefs = (0, import_react206.useRef)([]); - const addButtonRef = (0, import_react206.useRef)(null); - const wasNonEmpty = (0, import_react206.useRef)(false); - const [removalAnnouncement, setRemovalAnnouncement] = (0, import_react206.useState)(""); - const baseProps = getBaseProps(props2); - const isEmpty = items && items.length === 0; - wasNonEmpty.current = wasNonEmpty.current || !isEmpty; - (0, import_react206.useImperativeHandle)(ref, () => ({ - focusRemoveButton(rowIndex) { - var _a3; - (_a3 = removeButtonRefs.current[rowIndex]) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }, - focusAddButton() { - var _a3; - (_a3 = addButtonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - })); - const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); - const additionalInfoId = useUniqueId("attribute-editor-info"); - const infoAriaDescribedBy = additionalInfo ? additionalInfoId : void 0; - const prevItemsLength = usePrevious(items.length); - import_react206.default.useEffect(() => { - if (prevItemsLength && prevItemsLength > items.length && (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive)) { - setRemovalAnnouncement(i18nStrings.itemRemovedAriaLive); - } else { - setRemovalAnnouncement(""); - } - }, [items, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive]); - return import_react206.default.createElement( - "div", - Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(baseProps.className, styles_css_default59.root) }), - import_react206.default.createElement( - InternalBox, - { margin: { bottom: "l" } }, - isEmpty && import_react206.default.createElement("div", { className: clsx_m_default(styles_css_default59.empty, wasNonEmpty.current && styles_css_default59["empty-appear"]) }, empty), - items.map((item, index) => import_react206.default.createElement(Row, { key: index, index, breakpoint, item, definition, i18nStrings, removable: isItemRemovable2(item), removeButtonText, removeButtonRefs: removeButtonRefs.current, onRemoveButtonClick, removeButtonAriaLabel })) - ), - import_react206.default.createElement(InternalButton, { className: styles_css_default59["add-button"], disabled: disableAddButton, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy }, addButtonText), - import_react206.default.createElement(live_region_default, { "data-testid": "removal-announcement", delay: 5, key: items.length }, removalAnnouncement), - !!additionalInfo && import_react206.default.createElement(AdditionalInfo, { id: infoAriaDescribedBy }, additionalInfo) - ); -}); -var internal_default9 = InternalAttributeEditor; - -// node_modules/@cloudscape-design/components/attribute-editor/index.js -var AttributeEditor = import_react207.default.forwardRef((_a2, ref) => { - var { items = [], isItemRemovable: isItemRemovable2 = () => true } = _a2, props2 = __rest(_a2, ["items", "isItemRemovable"]); - const baseComponentProps = useBaseComponent("AttributeEditor"); - return import_react207.default.createElement(internal_default9, Object.assign({ items, isItemRemovable: isItemRemovable2 }, props2, baseComponentProps, { ref })); -}); -applyDisplayName(AttributeEditor, "AttributeEditor"); -var attribute_editor_default = AttributeEditor; - -// node_modules/@cloudscape-design/components/autosuggest/index.js -var import_react216 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/internal.js -var import_react215 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/options-controller.js -var import_react208 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/utils/utils.js -var isGroup2 = (option) => "type" in option && option.type === "parent"; -var popLastGroup = (options) => { - if (options.length) { - const lastOption = options[options.length - 1]; - if (isGroup2(lastOption)) { - options.pop(); - } - } -}; -var filterOptions2 = (options, text) => { - const filteredOptions = options.reduce((filteredIn, option) => { - if (isGroup2(option)) { - popLastGroup(filteredIn); - filteredIn.push(option); - } else if (matchSingleOption(option, text)) { - filteredIn.push(option); - } - return filteredIn; - }, []); - popLastGroup(filteredOptions); - return filteredOptions; -}; -var matchSingleOption = (option, text) => { - const searchableFields2 = ["value", "label", "description", "labelTag"]; - const searchableTagFields = ["tags", "filteringTags"]; - const searchText = text.toLowerCase(); - const searchStrFieldsFn = (attr) => matchString(option[attr], searchText); - const searchTagsFieldsFn = (attr) => { - var _a2; - return (_a2 = option[attr]) === null || _a2 === void 0 ? void 0 : _a2.some((value) => matchString(value, searchText)); - }; - return searchableFields2.some(searchStrFieldsFn) || searchableTagFields.some(searchTagsFieldsFn); -}; -var matchString = (value, searchText) => { - return value && value.toLowerCase().indexOf(searchText) !== -1; -}; - -// node_modules/@cloudscape-design/components/autosuggest/options-controller.js -var isHighlightable = (option) => { - return !!option && option.type !== "parent"; -}; -var isInteractive2 = (option) => !!option && !option.disabled && option.type !== "parent"; -var useAutosuggestItems = ({ options, filterValue, filterText, filteringType, enteredTextLabel, hideEnteredTextLabel, onSelectItem }) => { - const i18n = useInternalI18n("autosuggest"); - const [showAll, setShowAll] = (0, import_react208.useState)(false); - const { items, getItemGroup, getItemParent } = (0, import_react208.useMemo)(() => createItems(options), [options]); - const enteredItemLabel = i18n("enteredTextLabel", enteredTextLabel === null || enteredTextLabel === void 0 ? void 0 : enteredTextLabel(filterValue), (format3) => format3({ value: filterValue })); - if (!enteredItemLabel) { - warnOnce("Autosuggest", "A value for enteredTextLabel must be provided."); - } - const filteredItems = (0, import_react208.useMemo)(() => { - const filteredItems2 = filteringType === "auto" && !showAll ? filterOptions2(items, filterText) : [...items]; - if (filterValue && !hideEnteredTextLabel) { - filteredItems2.unshift({ - value: filterValue, - type: "use-entered", - label: enteredItemLabel, - option: { value: filterValue } - }); - } - generateTestIndexes(filteredItems2, getItemParent); - return filteredItems2; - }, [filteringType, showAll, items, filterText, filterValue, hideEnteredTextLabel, getItemParent, enteredItemLabel]); - const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({ - options: filteredItems, - isHighlightable - }); - const selectHighlightedOptionWithKeyboard = () => { - if (highlightedOptionState.highlightedOption && isInteractive2(highlightedOptionState.highlightedOption)) { - onSelectItem(highlightedOptionState.highlightedOption); - return true; - } - return false; - }; - const highlightVisibleOptionWithMouse = (index) => { - if (filteredItems[index] && isHighlightable(filteredItems[index])) { - highlightedOptionHandlers.setHighlightedIndexWithMouse(index); - } - }; - const selectVisibleOptionWithMouse = (index) => { - if (filteredItems[index] && isInteractive2(filteredItems[index])) { - onSelectItem(filteredItems[index]); - } - }; - return [ - Object.assign(Object.assign({}, highlightedOptionState), { items: filteredItems, showAll, getItemGroup }), - Object.assign(Object.assign({}, highlightedOptionHandlers), { - setShowAll, - selectHighlightedOptionWithKeyboard, - highlightVisibleOptionWithMouse, - selectVisibleOptionWithMouse - }) - ]; -}; -function createItems(options) { - const items = []; - const itemToGroup = /* @__PURE__ */ new WeakMap(); - const getItemParent = (item) => itemToGroup.get(item); - const getItemGroup = (item) => { - var _a2; - return (_a2 = getItemParent(item)) === null || _a2 === void 0 ? void 0 : _a2.option; - }; - for (const option of options) { - if (isGroup3(option)) { - for (const item of flattenGroup(option)) { - items.push(item); - } - } else { - items.push(Object.assign(Object.assign({}, option), { option })); - } - } - function flattenGroup(group) { - const { options: options2 } = group, rest = __rest(group, ["options"]); - let hasOnlyDisabledChildren = true; - const groupItem = Object.assign(Object.assign({}, rest), { type: "parent", option: group }); - const items2 = [groupItem]; - for (const option of options2) { - if (!option.disabled) { - hasOnlyDisabledChildren = false; - } - const childOption = Object.assign(Object.assign({}, option), { type: "child", disabled: option.disabled || rest.disabled, option }); - items2.push(childOption); - itemToGroup.set(childOption, groupItem); - } - items2[0].disabled = items2[0].disabled || hasOnlyDisabledChildren; - return items2; - } - return { items, getItemGroup, getItemParent }; -} -function isGroup3(optionOrGroup) { - return "options" in optionOrGroup; -} - -// node_modules/@cloudscape-design/components/autosuggest/options-list.js -var import_react212 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/virtual-list.js -var import_react211 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/autosuggest-option.js -var import_react209 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/autosuggest/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/autosuggest/styles.scoped.css"; -var styles_css_default62 = { - "root": "awsui_root_12hwc_oboi4_5", - "layout-strut": "awsui_layout-strut_12hwc_oboi4_9", - "list-bottom": "awsui_list-bottom_12hwc_oboi4_15" -}; - -// node_modules/@cloudscape-design/components/autosuggest/autosuggest-option.js -var AutosuggestOption = (_a2, ref) => { - var { nativeAttributes = {}, highlightText, option, highlighted, highlightType, current, virtualPosition, padBottom, screenReaderContent, ariaSetsize, ariaPosinset } = _a2, rest = __rest(_a2, ["nativeAttributes", "highlightText", "option", "highlighted", "highlightType", "current", "virtualPosition", "padBottom", "screenReaderContent", "ariaSetsize", "ariaPosinset"]); - const baseProps = getBaseProps(rest); - const useEntered = "type" in option && option.type === "use-entered"; - const isParent = "type" in option && option.type === "parent"; - const isChild = "type" in option && option.type === "child"; - const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {}; - let optionContent; - if (useEntered) { - optionContent = option.label; - screenReaderContent = void 0; - } else if (isParent) { - optionContent = option.label; - } else { - const a11yProperties = {}; - if (nativeAttributes["aria-label"]) { - a11yProperties["aria-label"] = nativeAttributes["aria-label"]; - } - optionContent = import_react209.default.createElement( - "div", - Object.assign({}, a11yProperties), - import_react209.default.createElement(option_default, { option, highlightedOption: highlighted, highlightText }) - ); - } - return import_react209.default.createElement(selectable_item_default, Object.assign({}, baseProps, { className: styles_css_default62.option, ariaSelected: current, highlighted, disabled: option.disabled, hasBackground: useEntered, isParent, isChild, virtualPosition, "data-test-index": throughIndex, "data-in-group-index": inGroupIndex, "data-group-index": groupIndex, ref, padBottom, screenReaderContent, ariaSetsize, ariaPosinset, highlightType: highlightType.type }), optionContent); -}; -var autosuggest_option_default = import_react209.default.memo(import_react209.default.forwardRef(AutosuggestOption)); - -// node_modules/@cloudscape-design/components/autosuggest/plain-list.js -var import_react210 = __toESM(require_react()); -var getOptionProps = (index, item, filteredItems, highlightedA11yProps, highlightedOption, hasDropdownStatus) => { - const nativeAttributes = item === highlightedOption ? highlightedA11yProps : {}; - const baseOptionProps = getBaseProps(nativeAttributes); - const isLastItem = index === filteredItems.length - 1; - const isNotEnteredTextItem = filteredItems.length > 1; - const padBottom = !hasDropdownStatus && isNotEnteredTextItem && isLastItem; - return Object.assign({ nativeAttributes, padBottom }, baseOptionProps); -}; -var PlainList2 = ({ autosuggestItemsState, handleLoadMore, menuProps, highlightedA11yProps, hasDropdownStatus, highlightText, listBottom, screenReaderContent }) => { - const listRef = (0, import_react210.useRef)(null); - (0, import_react210.useEffect)(() => { - var _a2; - const item = (_a2 = listRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`[data-mouse-target="${autosuggestItemsState.highlightedIndex}"]`); - if (autosuggestItemsState.highlightType.moveFocus && item) { - scrollElementIntoView(item); - } - }, [autosuggestItemsState.highlightType, autosuggestItemsState.highlightedIndex]); - return import_react210.default.createElement( - options_list_default, - Object.assign({}, menuProps, { - onLoadMore: handleLoadMore, - open: true, - ref: listRef, - // to prevent closing the list when clicking the scrollbar on IE11 - nativeAttributes: { unselectable: "on" } - }), - autosuggestItemsState.items.map((item, index) => { - const optionProps = getOptionProps(index, item, autosuggestItemsState.items, highlightedA11yProps, autosuggestItemsState.highlightedOption, hasDropdownStatus); - return import_react210.default.createElement(autosuggest_option_default, Object.assign({ highlightText, option: item, highlighted: item === autosuggestItemsState.highlightedOption, current: item.value === highlightText, key: index, "data-mouse-target": index, screenReaderContent, highlightType: autosuggestItemsState.highlightType }, optionProps)); - }), - listBottom ? import_react210.default.createElement("li", { role: "option", className: styles_css_default62["list-bottom"] }, listBottom) : null - ); -}; -var plain_list_default2 = PlainList2; - -// node_modules/@cloudscape-design/components/autosuggest/virtual-list.js -var VirtualList2 = ({ autosuggestItemsState, handleLoadMore, menuProps, highlightedA11yProps, hasDropdownStatus, highlightText, listBottom, screenReaderContent }) => { - const scrollRef = (0, import_react211.useRef)(null); - const [width, strutRef] = useContainerQuery((rect) => rect.contentBoxWidth, []); - (0, import_react211.useImperativeHandle)(strutRef, () => scrollRef.current); - const rowVirtualizer = useVirtual2({ - items: autosuggestItemsState.items, - parentRef: scrollRef, - // estimateSize is a dependency of measurements memo. We update it to force full recalculation - // when the height of any option could have changed: - // 1: because the component got resized (width property got updated) - // 2: because the option changed its content (highlightText property controls the highlight and the visibility of hidden tags) - // eslint-disable-next-line react-hooks/exhaustive-deps - estimateSize: (0, import_react211.useCallback)(() => 31, [width, highlightText]) - }); - (0, import_react211.useEffect)(() => { - if (autosuggestItemsState.highlightType.moveFocus) { - rowVirtualizer.scrollToIndex(autosuggestItemsState.highlightedIndex); - } - }, [autosuggestItemsState.highlightType, autosuggestItemsState.highlightedIndex, rowVirtualizer]); - return import_react211.default.createElement( - options_list_default, - Object.assign({}, menuProps, { - onLoadMore: handleLoadMore, - ref: scrollRef, - open: true, - // to prevent closing the list when clicking the scrollbar on IE11 - nativeAttributes: { unselectable: "on" } - }), - import_react211.default.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles_css_default62["layout-strut"], style: { height: rowVirtualizer.totalSize + (autosuggestItemsState.items.length === 1 ? 1 : 0) } }), - rowVirtualizer.virtualItems.map((virtualRow) => { - const { index, start, measureRef } = virtualRow; - const item = autosuggestItemsState.items[index]; - const optionProps = getOptionProps(index, item, autosuggestItemsState.items, highlightedA11yProps, autosuggestItemsState.highlightedOption, hasDropdownStatus); - return import_react211.default.createElement(autosuggest_option_default, Object.assign({ key: index, ref: measureRef, highlightText, option: item, highlighted: item === autosuggestItemsState.highlightedOption, current: item.value === highlightText, "data-mouse-target": index, virtualPosition: start + (index === 0 ? 1 : 0), screenReaderContent, ariaSetsize: autosuggestItemsState.items.length, ariaPosinset: index + 1, highlightType: autosuggestItemsState.highlightType }, optionProps)); - }), - listBottom ? import_react211.default.createElement("li", { role: "option", className: styles_css_default62["list-bottom"] }, listBottom) : null - ); -}; -var virtual_list_default2 = VirtualList2; - -// node_modules/@cloudscape-design/components/autosuggest/options-list.js -var createMouseEventHandler = (handler) => (itemIndex) => { - if (itemIndex > -1) { - handler(itemIndex); - } -}; -function AutosuggestOptionsList({ statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText, listId, controlId, handleLoadMore, hasDropdownStatus, virtualScroll, selectedAriaLabel, renderHighlightedAriaLive, listBottom, ariaDescribedby }) { - var _a2; - const handleMouseUp = createMouseEventHandler(autosuggestItemsHandlers.selectVisibleOptionWithMouse); - const handleMouseMove = createMouseEventHandler(autosuggestItemsHandlers.highlightVisibleOptionWithMouse); - const ListComponent = virtualScroll ? virtual_list_default2 : plain_list_default2; - const announcement = useAnnouncement({ - announceSelected: ((_a2 = autosuggestItemsState.highlightedOption) === null || _a2 === void 0 ? void 0 : _a2.value) === highlightText, - highlightedOption: autosuggestItemsState.highlightedOption, - getParent: (option) => autosuggestItemsState.getItemGroup(option), - selectedAriaLabel, - renderHighlightedAriaLive - }); - return import_react212.default.createElement(ListComponent, { listBottom, handleLoadMore, autosuggestItemsState, highlightText, highlightedA11yProps: highlightedOptionId ? { id: highlightedOptionId } : {}, hasDropdownStatus, menuProps: { - id: listId, - ariaLabelledby: controlId, - onMouseUp: handleMouseUp, - onMouseMove: handleMouseMove, - ariaDescribedby, - statusType - }, screenReaderContent: announcement }); -} - -// node_modules/@cloudscape-design/components/autosuggest/load-more-controller.js -var import_react213 = __toESM(require_react()); -var useAutosuggestLoadMore = ({ options = [], statusType, onLoadItems }) => { - const lastFilteringText = (0, import_react213.useRef)(null); - const fireLoadMore = ({ firstPage, samePage, filteringText }) => { - var _a2; - if (filteringText === void 0 || lastFilteringText.current !== filteringText) { - if (filteringText !== void 0) { - lastFilteringText.current = filteringText; - } - onLoadItems({ filteringText: (_a2 = lastFilteringText.current) !== null && _a2 !== void 0 ? _a2 : "", firstPage, samePage }); - } - }; - const fireLoadMoreOnScroll = () => { - options.length > 0 && statusType === "pending" && fireLoadMore({ firstPage: false, samePage: false }); - }; - const fireLoadMoreOnRecoveryClick = () => fireLoadMore({ firstPage: false, samePage: true }); - const fireLoadMoreOnInputFocus = () => fireLoadMore({ firstPage: true, samePage: false, filteringText: "" }); - const fireLoadMoreOnInputChange = (filteringText) => fireLoadMore({ firstPage: true, samePage: false, filteringText }); - return { fireLoadMoreOnScroll, fireLoadMoreOnRecoveryClick, fireLoadMoreOnInputFocus, fireLoadMoreOnInputChange }; -}; - -// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/index.js -var import_react214 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/autosuggest-input/styles.scoped.css"; -var styles_css_default63 = { - "dropdown-footer": "awsui_dropdown-footer_vm8qf_jxdvh_5", - "dropdown-content": "awsui_dropdown-content_vm8qf_jxdvh_10" -}; - -// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/index.js -var AutosuggestInput = import_react214.default.forwardRef((_a2, ref) => { - var { value, onChange, onBlur, onFocus, onKeyUp, onKeyDown, name, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, disableBrowserAutocorrect = false, expandToViewport, ariaControls, ariaActivedescendant, clearAriaLabel, dropdownExpanded = true, dropdownContentKey, dropdownContentFocusable = false, dropdownContent = null, dropdownFooter = null, dropdownWidth, loopFocus, onCloseDropdown, onDelayedInput, onPressArrowDown, onPressArrowUp, onPressEnter, __internalRootRef } = _a2, restProps = __rest(_a2, ["value", "onChange", "onBlur", "onFocus", "onKeyUp", "onKeyDown", "name", "placeholder", "disabled", "readOnly", "autoFocus", "ariaLabel", "ariaRequired", "disableBrowserAutocorrect", "expandToViewport", "ariaControls", "ariaActivedescendant", "clearAriaLabel", "dropdownExpanded", "dropdownContentKey", "dropdownContentFocusable", "dropdownContent", "dropdownFooter", "dropdownWidth", "loopFocus", "onCloseDropdown", "onDelayedInput", "onPressArrowDown", "onPressArrowUp", "onPressEnter", "__internalRootRef"]); - const baseProps = getBaseProps(restProps); - const formFieldContext = useFormFieldContext(restProps); - const inputRef = (0, import_react214.useRef)(null); - const dropdownContentRef = (0, import_react214.useRef)(null); - const dropdownFooterRef = (0, import_react214.useRef)(null); - const preventOpenOnFocusRef = (0, import_react214.useRef)(false); - const preventCloseOnBlurRef = (0, import_react214.useRef)(false); - const [open, setOpen] = (0, import_react214.useState)(false); - const openDropdown = () => !readOnly && setOpen(true); - const closeDropdown = () => { - setOpen(false); - fireNonCancelableEvent(onCloseDropdown, null); - }; - (0, import_react214.useImperativeHandle)(ref, () => ({ - focus(options) { - var _a3; - if (options === null || options === void 0 ? void 0 : options.preventDropdown) { - preventOpenOnFocusRef.current = true; - } - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }, - select() { - var _a3; - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.select(); - }, - open: openDropdown, - close: closeDropdown - })); - const handleBlur = () => { - if (!preventCloseOnBlurRef.current) { - closeDropdown(); - fireNonCancelableEvent(onBlur, null); - } - }; - const handleFocus = () => { - if (!preventOpenOnFocusRef.current) { - openDropdown(); - fireNonCancelableEvent(onFocus, null); - } - preventOpenOnFocusRef.current = false; - }; - const fireKeydown = (event) => fireCancelableEvent(onKeyDown, event.detail, event); - const handleKeyDown = (event) => { - switch (event.detail.keyCode) { - case KeyCode.down: { - onPressArrowDown === null || onPressArrowDown === void 0 ? void 0 : onPressArrowDown(); - openDropdown(); - event.preventDefault(); - break; - } - case KeyCode.up: { - onPressArrowUp === null || onPressArrowUp === void 0 ? void 0 : onPressArrowUp(); - openDropdown(); - event.preventDefault(); - break; - } - case KeyCode.enter: { - if (open) { - if (!(onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter())) { - closeDropdown(); - } - event.preventDefault(); - } - fireKeydown(event); - break; - } - case KeyCode.escape: { - if (open) { - event.stopPropagation(); - closeDropdown(); - } else if (value) { - event.stopPropagation(); - fireNonCancelableEvent(onChange, { value: "" }); - } - event.preventDefault(); - fireKeydown(event); - break; - } - default: { - fireKeydown(event); - } - } - }; - const handleChange = (value2) => { - openDropdown(); - fireNonCancelableEvent(onChange, { value: value2 }); - }; - const handleDelayedInput = (value2) => { - fireNonCancelableEvent(onDelayedInput, { value: value2 }); - }; - const handleDropdownMouseDown = (event) => { - if (!dropdownContentFocusable) { - event.preventDefault(); - } else { - preventCloseOnBlurRef.current = true; - requestAnimationFrame(() => { - preventCloseOnBlurRef.current = false; - }); - } - }; - const expanded = open && dropdownExpanded; - const nativeAttributes = { - name, - placeholder, - autoFocus, - onClick: openDropdown, - role: "combobox", - "aria-autocomplete": "list", - "aria-expanded": expanded, - "aria-controls": open ? ariaControls : void 0, - // 'aria-owns' needed for safari+vo to announce activedescendant content - "aria-owns": open ? ariaControls : void 0, - "aria-label": ariaLabel, - "aria-activedescendant": ariaActivedescendant - }; - (0, import_react214.useEffect)(() => { - if (!open) { - return; - } - const clickListener = (event) => { - if (!nodeBelongs(inputRef.current, event.target) && !nodeBelongs(dropdownContentRef.current, event.target) && !nodeBelongs(dropdownFooterRef.current, event.target)) { - closeDropdown(); - } - }; - window.addEventListener("mousedown", clickListener); - return () => { - window.removeEventListener("mousedown", clickListener); - }; - }, [open]); - return import_react214.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default63.root), ref: __internalRootRef }), - import_react214.default.createElement(dropdown_default, { minWidth: dropdownWidth, stretchWidth: !dropdownWidth, stretchBeyondTriggerWidth: true, contentKey: dropdownContentKey, onFocus: handleFocus, onBlur: handleBlur, trigger: import_react214.default.createElement(internal_default7, Object.assign({ type: "visualSearch", value, onChange: (event) => handleChange(event.detail.value), __onDelayedInput: (event) => handleDelayedInput(event.detail.value), onKeyDown: handleKeyDown, onKeyUp, disabled, disableBrowserAutocorrect, readOnly, ariaRequired, clearAriaLabel, ref: inputRef, autoComplete: false, __nativeAttributes: nativeAttributes }, formFieldContext)), onMouseDown: handleDropdownMouseDown, open: open && (!!dropdownContent || !!dropdownFooter), footer: dropdownFooterRef && import_react214.default.createElement("div", { ref: dropdownFooterRef, className: styles_css_default63["dropdown-footer"] }, dropdownFooter), expandToViewport, loopFocus }, open && dropdownContent ? import_react214.default.createElement("div", { ref: dropdownContentRef, className: styles_css_default63["dropdown-content"] }, dropdownContent) : null) - ); -}); -var autosuggest_input_default = AutosuggestInput; - -// node_modules/@cloudscape-design/components/autosuggest/internal.js -var InternalAutosuggest = import_react215.default.forwardRef((props2, ref) => { - var _a2, _b; - const { value, onChange, onBlur, onFocus, onKeyUp, onLoadItems, options, filteringType = "auto", statusType = "finished", placeholder, clearAriaLabel, name, disabled, disableBrowserAutocorrect = false, autoFocus, readOnly, ariaLabel, ariaRequired, enteredTextLabel, filteringResultsText, onKeyDown, virtualScroll, expandToViewport, onSelect, renderHighlightedAriaLive, __internalRootRef } = props2, restProps = __rest(props2, ["value", "onChange", "onBlur", "onFocus", "onKeyUp", "onLoadItems", "options", "filteringType", "statusType", "placeholder", "clearAriaLabel", "name", "disabled", "disableBrowserAutocorrect", "autoFocus", "readOnly", "ariaLabel", "ariaRequired", "enteredTextLabel", "filteringResultsText", "onKeyDown", "virtualScroll", "expandToViewport", "onSelect", "renderHighlightedAriaLive", "__internalRootRef"]); - checkControlled("Autosuggest", "value", value, "onChange", onChange); - checkOptionValueField("Autosuggest", "options", options); - const autosuggestInputRef = (0, import_react215.useRef)(null); - (0, import_react215.useImperativeHandle)(ref, () => ({ - focus: () => { - var _a3; - return (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }, - select: () => { - var _a3; - return (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.select(); - } - }), []); - const i18n = useInternalI18n("autosuggest"); - const errorIconAriaLabel = i18n("errorIconAriaLabel", restProps.errorIconAriaLabel); - const selectedAriaLabel = i18n("selectedAriaLabel", restProps.selectedAriaLabel); - const recoveryText = i18n("recoveryText", restProps.recoveryText); - if (restProps.recoveryText && !onLoadItems) { - warnOnce("Autosuggest", "`onLoadItems` must be provided for `recoveryText` to be displayed."); - } - const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({ - options: options || [], - filterValue: value, - filterText: value, - filteringType, - enteredTextLabel, - hideEnteredTextLabel: false, - onSelectItem: (option) => { - var _a3; - const value2 = option.value || ""; - fireNonCancelableEvent(onChange, { value: value2 }); - fireNonCancelableEvent(onSelect, { - value: value2, - selectedOption: option.type !== "use-entered" ? option.option : void 0 - }); - (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.close(); - } - }); - const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({ - options, - statusType, - onLoadItems: (detail) => fireNonCancelableEvent(onLoadItems, detail) - }); - const handleChange = (event) => { - autosuggestItemsHandlers.setShowAll(false); - autosuggestItemsHandlers.resetHighlightWithKeyboard(); - fireNonCancelableEvent(onChange, event.detail); - }; - const handleDelayedInput = (event) => { - autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value); - }; - const handleBlur = () => { - fireNonCancelableEvent(onBlur, null); - }; - const handleFocus = () => { - autosuggestItemsHandlers.setShowAll(true); - autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus(); - fireNonCancelableEvent(onFocus, null); - }; - const handleKeyUp = (event) => { - fireCancelableEvent(onKeyUp, event.detail, event); - }; - const handleKeyDown = (event) => { - fireCancelableEvent(onKeyDown, event.detail, event); - }; - const handlePressArrowDown = () => { - autosuggestItemsHandlers.moveHighlightWithKeyboard(1); - }; - const handlePressArrowUp = () => { - autosuggestItemsHandlers.moveHighlightWithKeyboard(-1); - }; - const handlePressEnter = () => { - return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard(); - }; - const handleCloseDropdown = () => { - autosuggestItemsHandlers.resetHighlightWithKeyboard(); - }; - const handleRecoveryClick = () => { - var _a3; - autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick(); - (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }; - const formFieldContext = useFormFieldContext(restProps); - const selfControlId = useUniqueId("input"); - const footerControlId = useUniqueId("footer"); - const controlId = (_a2 = formFieldContext.controlId) !== null && _a2 !== void 0 ? _a2 : selfControlId; - const listId = useUniqueId("list"); - const highlightedOptionIdSource = useUniqueId(); - const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : void 0; - const isEmpty = !value && !autosuggestItemsState.items.length; - const isFiltered = !!value && value.length !== 0; - const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(autosuggestItemsState.items.length, (_b = options === null || options === void 0 ? void 0 : options.length) !== null && _b !== void 0 ? _b : 0) : void 0; - const dropdownStatus = useDropdownStatus(Object.assign(Object.assign({}, props2), { - isEmpty, - isFiltered, - recoveryText, - errorIconAriaLabel, - onRecoveryClick: handleRecoveryClick, - filteringResultsText: filteredText, - hasRecoveryCallback: !!onLoadItems - })); - const shouldRenderDropdownContent = !isEmpty || dropdownStatus.content; - return import_react215.default.createElement(autosuggest_input_default, Object.assign({}, restProps, { className: clsx_m_default(styles_css_default62.root, restProps.className), ref: autosuggestInputRef, __internalRootRef, value, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, name, controlId, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, clearAriaLabel, disableBrowserAutocorrect, expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null, dropdownContent: shouldRenderDropdownContent && import_react215.default.createElement(AutosuggestOptionsList, { statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText: value, listId, controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll, selectedAriaLabel, renderHighlightedAriaLive, listBottom: !dropdownStatus.isSticky ? import_react215.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, id: footerControlId }) : null, ariaDescribedby: dropdownStatus.content ? footerControlId : void 0 }), dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? import_react215.default.createElement(dropdown_footer_default, { id: footerControlId, content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 }) : null, loopFocus: statusType === "error" && !!recoveryText && !!onLoadItems, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })); -}); -var internal_default10 = InternalAutosuggest; - -// node_modules/@cloudscape-design/components/internal/utils/external-props.js -var getExternalProps = (props2) => { - const externalPropNames = Object.keys(props2).filter((propName) => propName.indexOf("__") !== 0); - return externalPropNames.reduce((acc, propName) => { - acc[propName] = props2[propName]; - return acc; - }, {}); -}; - -// node_modules/@cloudscape-design/components/autosuggest/index.js -var Autosuggest = import_react216.default.forwardRef((_a2, ref) => { - var { filteringType = "auto", statusType = "finished", disableBrowserAutocorrect = false } = _a2, props2 = __rest(_a2, ["filteringType", "statusType", "disableBrowserAutocorrect"]); - const baseComponentProps = useBaseComponent("Autosuggest", { - props: { - autoFocus: props2.autoFocus, - disableBrowserAutocorrect, - expandToViewport: props2.expandToViewport, - filteringType, - readOnly: props2.readOnly, - virtualScroll: props2.virtualScroll - } - }); - const externalProps = getExternalProps(props2); - return import_react216.default.createElement(internal_default10, Object.assign({ filteringType, statusType, disableBrowserAutocorrect }, externalProps, baseComponentProps, { ref })); -}); -applyDisplayName(Autosuggest, "Autosuggest"); -var autosuggest_default = Autosuggest; - -// node_modules/@cloudscape-design/components/badge/index.js -var import_react217 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/badge/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/badge/styles.scoped.css"; -var styles_css_default64 = { - "badge": "awsui_badge_1yjyg_bjogl_99", - "badge-color-grey": "awsui_badge-color-grey_1yjyg_bjogl_145", - "badge-color-green": "awsui_badge-color-green_1yjyg_bjogl_148", - "badge-color-blue": "awsui_badge-color-blue_1yjyg_bjogl_151", - "badge-color-red": "awsui_badge-color-red_1yjyg_bjogl_154" -}; - -// node_modules/@cloudscape-design/components/badge/index.js -function Badge(_a2) { - var { color: color2 = "grey", children: children2 } = _a2, rest = __rest(_a2, ["color", "children"]); - const { __internalRootRef } = useBaseComponent("Badge", { props: { color: color2 } }); - const baseProps = getBaseProps(rest); - const className2 = clsx_m_default(baseProps.className, styles_css_default64.badge, styles_css_default64[`badge-color-${color2}`]); - return import_react217.default.createElement("span", Object.assign({}, baseProps, { className: className2 }, { ref: __internalRootRef }), children2); -} -applyDisplayName(Badge, "Badge"); - -// node_modules/@cloudscape-design/components/bar-chart/index.js -var import_react229 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/bar-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/bar-chart/styles.scoped.css"; -var styles_css_default65 = { - "root": "awsui_root_1gfe1_7b6p8_9" -}; - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/internal.js -var import_react228 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-legend.js -var import_react218 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/utils.js -var chartLegendMap = { - line: "line", - bar: "rectangle", - threshold: "dashed" -}; -var nextValidDomainIndex = (nextGroupIndex, barGroups, direction = 1) => { - let index = nextGroupIndex; - if (index < 0 || index >= barGroups.length) { - index = 0; - } - do { - if (barGroups[index].isValid && barGroups[index].hasData) { - return index; - } - index += direction; - if (index >= barGroups.length) { - index = 0; - } else if (index < 0) { - index = barGroups.length - 1; - } - } while (index !== nextGroupIndex); - return 0; -}; -function findNavigableSeries(series) { - const navigableSeries = []; - let navigableBarSeriesIndex = -1; - series.forEach((internalSeries) => { - if (internalSeries.series.type === "bar") { - if (navigableBarSeriesIndex === -1) { - navigableBarSeriesIndex = navigableSeries.length; - navigableSeries.push(internalSeries.series); - } - } else { - navigableSeries.push(internalSeries.series); - } - }); - return { navigableSeries, navigableBarSeriesIndex }; -} -var matchesX = (x1, x2) => { - if (x1 instanceof Date && x2 instanceof Date) { - return x1.getTime() === x2.getTime(); - } - return x1 === x2; -}; -function calculateOffsetMaps(data) { - return data.reduce((acc, curr, idx) => { - if (idx === 0) { - acc.push({ positiveOffsets: /* @__PURE__ */ new Map(), negativeOffsets: /* @__PURE__ */ new Map() }); - } - const lastMap = acc[idx]; - const map2 = lastMap ? { positiveOffsets: new Map(lastMap.positiveOffsets), negativeOffsets: new Map(lastMap.negativeOffsets) } : { positiveOffsets: /* @__PURE__ */ new Map(), negativeOffsets: /* @__PURE__ */ new Map() }; - curr.forEach(({ x: x2, y: y2 }) => { - const key2 = getKeyValue(x2); - if (y2 < 0) { - const lastValue = (lastMap === null || lastMap === void 0 ? void 0 : lastMap.negativeOffsets.get(key2)) || 0; - map2.negativeOffsets.set(key2, lastValue + y2); - } else { - const lastValue = (lastMap === null || lastMap === void 0 ? void 0 : lastMap.positiveOffsets.get(key2)) || 0; - map2.positiveOffsets.set(key2, lastValue + y2); - } - }); - if (idx < data.length - 1) { - acc.push(map2); - } - return acc; - }, []); -} -var getKeyValue = (key2) => key2 instanceof Date ? key2.getTime() : key2; -function isYThreshold(series) { - return series.type === "threshold" && "y" in series; -} -function isXThreshold(series) { - return series.type === "threshold" && "x" in series; -} -function isDataSeries(series) { - return series.type === "line" || series.type === "bar"; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-legend.js -function InternalChartLegend({ series, visibleSeries, highlightedSeries, onHighlightChange, legendTitle, ariaLabel, plotContainerRef }) { - const legendItems = (0, import_react218.useMemo)(() => { - return series.filter((s2) => visibleSeries.indexOf(s2.series) !== -1).map(({ series: series2, color: color2 }) => ({ - label: series2.title, - type: chartLegendMap[series2.type], - color: color2, - datum: series2 - })); - }, [series, visibleSeries]); - return import_react218.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: highlightedSeries || null, onHighlightChange, legendTitle, ariaLabel, plotContainerRef }); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-container.js -var import_react227 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/vertical-grid-lines.js -var import_react219 = __toESM(require_react()); -var vertical_grid_lines_default = (0, import_react219.memo)(VerticalGridLines); -function VerticalGridLines({ ticks: ticks2, scale, height }) { - return import_react219.default.createElement("g", { "aria-hidden": "true" }, ticks2.map((tick) => { - var _a2; - const x2 = (_a2 = scale.d3Scale(tick)) !== null && _a2 !== void 0 ? _a2 : NaN; - return isFinite(x2) && import_react219.default.createElement("line", { key: tick, className: styles_css_default50.grid, x1: x2, y1: 0, x2, y2: height }); - })); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-popover.js -var import_react220 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/mixed-line-bar-chart/styles.scoped.css"; -var styles_css_default66 = { - "series": "awsui_series_1yz9c_1g0qf_99", - "series--bar": "awsui_series--bar_1yz9c_1g0qf_100", - "series__rect": "awsui_series__rect_1yz9c_1g0qf_100", - "exiting": "awsui_exiting_1yz9c_1g0qf_117", - "awsui-motion-fade-out-0": "awsui_awsui-motion-fade-out-0_1yz9c_1g0qf_1", - "root": "awsui_root_1yz9c_1g0qf_143", - "series--highlighted": "awsui_series--highlighted_1yz9c_1g0qf_156", - "series__bar--highlighted": "awsui_series__bar--highlighted_1yz9c_1g0qf_157", - "series--dimmed": "awsui_series--dimmed_1yz9c_1g0qf_161", - "series--threshold": "awsui_series--threshold_1yz9c_1g0qf_165", - "bar-group": "awsui_bar-group_1yz9c_1g0qf_170" -}; - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-popover.js -var chart_popover_default2 = import_react220.default.forwardRef(MixedChartPopover); -function MixedChartPopover({ containerRef, trackRef, isOpen, isPinned, highlightDetails, footer, onDismiss, size: size2 = "medium", dismissAriaLabel, onMouseEnter, onMouseLeave, onBlur, setPopoverText }, popoverRef) { - const [expandedSeries, setExpandedSeries] = (0, import_react220.useState)({}); - return import_react220.default.createElement(Transition2, { in: isOpen }, (state, ref) => import_react220.default.createElement("div", { ref, className: clsx_m_default(state === "exiting" && styles_css_default66.exiting) }, (isOpen || state !== "exited") && highlightDetails && import_react220.default.createElement( - chart_popover_default, - { ref: popoverRef, title: highlightDetails.position, trackRef, trackKey: highlightDetails.position, dismissButton: isPinned, dismissAriaLabel, onDismiss, container: containerRef.current, size: size2, onMouseEnter, onMouseLeave, onBlur }, - import_react220.default.createElement(chart_series_details_default, { key: highlightDetails.position, details: highlightDetails.details, setPopoverText, expandedSeries: expandedSeries[highlightDetails.position], setExpandedState: (id, isExpanded) => setExpandedSeries((oldState) => { - const expandedSeriesInCurrentCoordinate = new Set(oldState[highlightDetails.position]); - if (isExpanded) { - expandedSeriesInCurrentCoordinate.add(id); - } else { - expandedSeriesInCurrentCoordinate.delete(id); - } - return Object.assign(Object.assign({}, oldState), { [highlightDetails.position]: expandedSeriesInCurrentCoordinate }); - }) }), - footer && import_react220.default.createElement(ChartPopoverFooter, null, footer) - ))); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/domain.js -function computeDomainX2(series, xScaleType) { - if (xScaleType === "categorical") { - return series.reduce((acc, s2) => { - if (isDataSeries(s2.series)) { - s2.series.data.forEach(({ x: x2 }) => { - if (acc.indexOf(x2) === -1) { - acc.push(x2); - } - }); - } - if (isXThreshold(s2.series)) { - if (acc.indexOf(s2.series.x) === -1) { - acc.push(s2.series.x); - } - } - return acc; - }, []); - } - return series.reduce((acc, curr) => { - if (isYThreshold(curr.series)) { - return acc; - } - if (isXThreshold(curr.series)) { - const [min3, max3] = acc; - const newMin = min3 === void 0 || min3 === null || curr.series.x < min3 ? curr.series.x : min3; - const newMax = max3 === void 0 || max3 === null || max3 < curr.series.x ? curr.series.x : max3; - return [newMin, newMax]; - } - if (isDataSeries(curr.series)) { - return curr.series.data.reduce(([min3, max3], { x: x2 }) => { - const newMin = min3 === void 0 || min3 === null || x2 < min3 ? x2 : min3; - const newMax = max3 === void 0 || max3 === null || max3 < x2 ? x2 : max3; - return [newMin, newMax]; - }, acc); - } - return acc; - }, []); -} -function find(arr, func) { - for (let i = 0; i < arr.length; i++) { - const found = func(arr[i]); - if (found) { - return arr[i]; - } - } - return null; -} -function computeDomainY2(series, scaleType, stackedBars) { - let _series = series; - if (stackedBars) { - const { positiveData, negativeData } = series.reduce((acc, curr) => { - if (curr.series.type === "bar") { - curr.series.data.forEach(({ x: x2, y: y2 }) => { - const data = y2 < 0 ? acc.negativeData : acc.positiveData; - const stackedDatum = find(data, (el) => matchesX(el.x, x2)); - if (stackedDatum) { - stackedDatum.y += y2; - } else { - data.push({ x: x2, y: y2 }); - } - return acc; - }); - } - return acc; - }, { - positiveData: [], - negativeData: [] - }); - const stackedSeries = [ - { - color: "", - index: NaN, - series: { - type: "bar", - title: "positive", - data: positiveData - } - }, - { - color: "", - index: NaN, - series: { - type: "bar", - title: "negative", - data: negativeData - } - } - ]; - _series = [...stackedSeries, ..._series.filter((s2) => s2.series.type !== "bar")]; - } - const domain = _series.reduce((acc, curr) => { - if (isYThreshold(curr.series)) { - const [min3, max3] = acc; - const newMin = min3 === void 0 || curr.series.y < min3 ? curr.series.y : min3; - const newMax = max3 === void 0 || max3 < curr.series.y ? curr.series.y : max3; - return [newMin, newMax]; - } - if (isXThreshold(curr.series)) { - return acc; - } - if (isDataSeries(curr.series)) { - return curr.series.data.reduce(([min3, max3], { y: y2 }) => { - const newMin = min3 === void 0 || y2 < min3 ? y2 : min3; - const newMax = max3 === void 0 || max3 < y2 ? y2 : max3; - return [newMin, newMax]; - }, acc); - } - return acc; - }, [0, 0]); - if (scaleType === "log" && domain[0] === 0 && domain[1] > 1) { - return [1, domain[1]]; - } - return domain; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/make-scaled-series.js -function makeScaledSeries(allSeries, xScale, yScale) { - const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; - const scaleX = (x2) => (xScale.d3Scale(x2) || 0) + xOffset; - const scaleY = (y2) => yScale.d3Scale(y2) || 0; - const allX = getAllX(allSeries); - function mergeLineSeriesPointsWithXThresholds(scaledPoints, xThresholdSeries, xThresholdSeriesColor) { - var _a2, _b; - const x2 = scaleX(xThresholdSeries.x); - let bisectIndex = -1; - for (let i = 0; i < scaledPoints.length - 1; i++) { - if (scaledPoints[i].x < x2 && x2 < scaledPoints[i + 1].x) { - bisectIndex = i; - break; - } - } - if (bisectIndex !== -1) { - const prevY = ((_a2 = scaledPoints[bisectIndex].datum) === null || _a2 === void 0 ? void 0 : _a2.y) || 0; - const nextY = ((_b = scaledPoints[bisectIndex + 1].datum) === null || _b === void 0 ? void 0 : _b.y) || 0; - const averageY = (prevY + nextY) / 2; - scaledPoints.push({ - x: x2, - y: scaleY(averageY), - datum: { x: xThresholdSeries.x, y: NaN }, - series: scaledPoints[bisectIndex].series, - color: xThresholdSeriesColor - }); - } - } - const scaledSeriesX = allSeries.map(({ series, color: color2 }) => { - const scaledPoints = []; - if (series.type === "line") { - for (const datum of series.data) { - scaledPoints.push({ x: scaleX(datum.x), y: scaleY(datum.y), datum, series, color: color2 }); - } - scaledPoints.sort((s1, s2) => s1.x - s2.x); - for (const otherSeries of allSeries) { - if (isXThreshold(otherSeries.series)) { - mergeLineSeriesPointsWithXThresholds(scaledPoints, otherSeries.series, otherSeries.color); - } - } - } else if (isYThreshold(series)) { - for (const x2 of allX) { - scaledPoints.push({ x: scaleX(x2), y: scaleY(series.y), datum: { x: x2, y: series.y }, series, color: color2 }); - } - if (allX.length === 0) { - scaledPoints.push({ x: NaN, y: scaleY(series.y), series, color: color2 }); - } - } else if (isXThreshold(series)) { - scaledPoints.push({ x: scaleX(series.x), y: NaN, datum: { x: series.x, y: NaN }, series, color: color2 }); - } - return scaledPoints; - }); - return flatten(scaledSeriesX).sort((s1, s2) => s1.x - s2.x); -} -function getAllX(series) { - const addDataXSet = /* @__PURE__ */ new Set(); - for (const { series: s2 } of series) { - switch (s2.type) { - case "bar": - case "line": - for (const d of s2.data) { - addDataXSet.add(d.x); - } - break; - case "threshold": - if (isXThreshold(s2)) { - addDataXSet.add(s2.x); - } - break; - } - } - const allDataX = []; - addDataXSet.forEach((x2) => allDataX.push(x2)); - return allDataX; -} -function flatten(arrays) { - const merged = []; - for (const array of arrays) { - for (const item of array) { - merged.push(item); - } - } - return merged; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/make-scaled-bar-groups.js -function makeScaledBarGroups(series, xScale, plotWidth, plotHeight, axis) { - if (!xScale.isCategorical()) { - return []; - } - return xScale.domain.map((x2) => { - const scaledX = xScale.d3Scale(x2); - const isValid2 = typeof scaledX !== "undefined" && isFinite(scaledX); - return { - x: x2, - isValid: isValid2, - hasData: series.some(({ series: series2 }) => { - if (isYThreshold(series2)) { - return true; - } - if (isXThreshold(series2)) { - return false; - } - if (isDataSeries(series2)) { - return series2.data.some((datum) => matchesX(datum.x, x2)); - } - return false; - }), - position: axis === "x" ? { - x: 0, - y: isValid2 ? scaledX || 0 : 0, - width: plotWidth, - height: xScale.d3Scale.bandwidth() - } : { - x: isValid2 ? scaledX || 0 : 0, - y: 0, - width: xScale.d3Scale.bandwidth(), - height: plotHeight - } - }; - }); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/format-highlighted.js -function formatHighlighted({ position, series, xTickFormatter, detailPopoverSeriesContent }) { - const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString(); - const details = []; - series.forEach((s2) => { - const detail = getSeriesDetail({ internalSeries: s2, targetX: position, detailPopoverSeriesContent }); - if (detail) { - details.push(detail); - } - }); - return { position: formattedPosition, details }; -} -function getSeriesDetail({ internalSeries, targetX, detailPopoverSeriesContent }) { - var _a2; - const { series, color: color2 } = internalSeries; - if (isXThreshold(series)) { - return series.x === targetX ? { - key: series.title, - value: "", - color: color2, - markerType: "dashed" - } : null; - } - if (isYThreshold(series)) { - return { - key: series.title, - value: series.valueFormatter ? series.valueFormatter(series.y) : series.y, - color: color2, - markerType: "dashed" - }; - } - if (isDataSeries(series)) { - for (const datum of series.data) { - if (matchesX(targetX, datum.x)) { - const customContent = detailPopoverSeriesContent ? detailPopoverSeriesContent({ series, x: targetX, y: datum.y }) : void 0; - const hasSubItems = !!((_a2 = customContent === null || customContent === void 0 ? void 0 : customContent.subItems) === null || _a2 === void 0 ? void 0 : _a2.length); - const isExpandable = (customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && hasSubItems; - const isKeyString = typeof (customContent === null || customContent === void 0 ? void 0 : customContent.key) === "string"; - const key2 = (customContent === null || customContent === void 0 ? void 0 : customContent.key) && (!isExpandable || isKeyString) ? customContent.key : series.title; - if ((customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && !hasSubItems) { - warnOnce("MixedLineBarChart", "`expandable` was set to `true` for a series without sub-items. This property will be ignored."); - } - if (isExpandable && !isKeyString) { - warnOnce("MixedLineBarChart", "A ReactNode was used for the key of an expandable series. The series title will be used instead because nested interactive elements can cause accessiblity issues."); - } - if (!isKeyString && !isExpandable && (customContent === null || customContent === void 0 ? void 0 : customContent.value) && typeof customContent.value !== "string") { - warnOnce("MixedLineBarChart", "Use a ReactNode for the key or the value of a series, but not for both. It is not recommended to use links for key and value at the same time."); - } - return { - key: key2, - value: (customContent === null || customContent === void 0 ? void 0 : customContent.value) || (series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y), - color: color2, - markerType: series.type === "line" ? "line" : "rectangle", - subItems: customContent === null || customContent === void 0 ? void 0 : customContent.subItems, - expandableId: isExpandable ? series.title : void 0 - }; - } - } - } - return null; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/data-series.js -var import_react223 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/line-series.js -var import_react221 = __toESM(require_react()); -function LineSeries({ axis, series, color: color2, xScale, yScale, chartAreaClipPath }) { - var _a2; - const commonProps = { "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})` }; - if (series.type === "line") { - const lineGenerator = line_default().x((d) => { - let x2 = xScale.d3Scale(d.x) || 0; - if (xScale.isCategorical()) { - const offset = Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2; - x2 += offset; - } - return x2; - }).y((d) => yScale.d3Scale(d.y) || 0); - const visibleData = series.data.filter(({ x: x2 }) => xScale.d3Scale(x2) !== void 0); - return import_react221.default.createElement("path", Object.assign({}, commonProps, { d: lineGenerator(visibleData) || "" })); - } else if (isYThreshold(series)) { - const [x1, x2] = xScale.d3Scale.range(); - const y2 = yScale.d3Scale(series.y); - const coordinates = axis === "x" ? { x1, x2, y1: y2, y2 } : { x1: y2, x2: y2, y1: x1, y2: x2 }; - return import_react221.default.createElement("line", Object.assign({}, commonProps, coordinates)); - } else if (isXThreshold(series)) { - const [y1, y2] = yScale.d3Scale.range(); - const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; - const x2 = ((_a2 = xScale.d3Scale(series.x)) !== null && _a2 !== void 0 ? _a2 : NaN) + xOffset; - const coordinates = axis === "x" ? { x1: x2, x2, y1, y2 } : { x1: y1, x2: y2, y1: x2, y2: x2 }; - return import_react221.default.createElement("line", Object.assign({}, commonProps, coordinates)); - } else { - return null; - } -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/bar-series.js -var import_react222 = __toESM(require_react()); -function BarSeries({ axis, series, color: color2, xScale, yScale, highlighted, dimmed, highlightedGroupIndex, stackedBarOffsets, totalSeriesCount, seriesIndex, plotSize, chartAreaClipPath }) { - const isRefresh = useVisualRefresh(); - const xCoordinates = (0, import_react222.useMemo)(() => { - var _a2; - if (series.type !== "bar" || !xScale.isCategorical()) { - return []; - } - const yContinuosScale = yScale.d3Scale; - const xPoints = series.data.map(({ x: x2 }) => xScale.d3Scale(x2) || NaN); - const zeroY = (_a2 = yScale.d3Scale(0)) !== null && _a2 !== void 0 ? _a2 : NaN; - const baseY = isFinite(zeroY) ? Math.min(plotSize, zeroY) : plotSize; - let barWidth = xScale.d3Scale.bandwidth(); - const PADDING = 4; - const MINWIDTH = 4; - if (!stackedBarOffsets && totalSeriesCount > 1) { - barWidth = (barWidth - (totalSeriesCount - 1) * PADDING) / totalSeriesCount; - barWidth = Math.max(barWidth, MINWIDTH); - } - return xPoints.map((x2, i) => { - var _a3, _b; - const d = series.data[i]; - let barX = x2; - let yValue = d.y; - if (stackedBarOffsets) { - const offsetMap = d.y < 0 ? stackedBarOffsets.negativeOffsets : stackedBarOffsets.positiveOffsets; - yValue = d.y + (offsetMap.get(getKeyValue(d.x)) || 0); - } else if (totalSeriesCount > 1) { - barX += seriesIndex * (barWidth + PADDING); - } - yValue = yValue < 0 ? yValue - d.y : yValue; - return { - x: barX, - y: (_a3 = yContinuosScale(yValue)) !== null && _a3 !== void 0 ? _a3 : NaN, - width: barWidth, - height: Math.abs(((_b = yContinuosScale(d.y)) !== null && _b !== void 0 ? _b : NaN) - baseY) - }; - }); - }, [series, xScale, yScale, plotSize, stackedBarOffsets, totalSeriesCount, seriesIndex]); - const highlightedXValue = highlightedGroupIndex !== null ? xScale.domain[highlightedGroupIndex] : null; - return import_react222.default.createElement("g", { "aria-label": series.title, clipPath: `url(#${chartAreaClipPath})`, className: clsx_m_default(styles_css_default66.series, styles_css_default66["series--bar"], { - [styles_css_default66["series--highlighted"]]: highlighted, - [styles_css_default66["series--dimmed"]]: dimmed - }) }, xCoordinates.map(({ x: x2, y: y2, width, height }, i) => { - if (!isFinite(x2) || !isFinite(height)) { - return; - } - const baseHeightOffset = stackedBarOffsets ? 3 : 0; - const isSmallBar = height < 4; - const heightOffset = isSmallBar ? 0 : baseHeightOffset; - const widthOffset = 2; - const rx = isRefresh ? isSmallBar ? "2px" : "4px" : "0px"; - const className2 = clsx_m_default(styles_css_default66.series__rect, { - [styles_css_default66["series--dimmed"]]: highlightedXValue !== null && !matchesX(highlightedXValue, series.data[i].x) - }); - return axis === "x" ? import_react222.default.createElement("rect", { key: `bar-${i}`, fill: color2, x: x2 + widthOffset / 2, y: y2 + heightOffset / 2, width: width - widthOffset, height: height - heightOffset, rx, className: className2 }) : import_react222.default.createElement("rect", { key: `bar-${i}`, fill: color2, x: y2 - height + heightOffset / 2, y: x2 + widthOffset / 2, width: height - heightOffset, height: width - widthOffset, rx, className: className2 }); - })); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/data-series.js -var STROKE_WIDTH = 2; -function DataSeries2({ axis, plotHeight, plotWidth, highlightedGroupIndex, highlightedSeries, stackedBars, isGroupNavigation, visibleSeries, xScale, yScale }) { - const chartAreaClipPath = useUniqueId("awsui-mixed-line-bar-chart__chart-area-"); - const lineAreaClipPath = useUniqueId("awsui-line-chart__chart-area-"); - const stackedBarOffsetMaps = (0, import_react223.useMemo)(() => { - if (!stackedBars) { - return []; - } - const barData = []; - visibleSeries.forEach(({ series }) => { - if (series.type === "bar") { - barData.push(series.data); - } - }); - return calculateOffsetMaps(barData); - }, [visibleSeries, stackedBars]); - return import_react223.default.createElement( - import_react223.default.Fragment, - null, - import_react223.default.createElement( - "defs", - { "aria-hidden": "true" }, - import_react223.default.createElement( - "clipPath", - { id: chartAreaClipPath }, - import_react223.default.createElement("rect", { x: 0, y: 0, width: plotWidth, height: plotHeight }) - ), - import_react223.default.createElement( - "clipPath", - { id: lineAreaClipPath }, - import_react223.default.createElement("rect", { x: 0, y: -STROKE_WIDTH / 2, width: plotWidth, height: plotHeight + STROKE_WIDTH }) - ) - ), - import_react223.default.createElement("g", { "aria-hidden": isGroupNavigation ? true : void 0, role: "group" }, visibleSeries.map(({ series, color: color2 }, index) => { - const isHighlighted = series === highlightedSeries; - const isDimmed = !!highlightedSeries && !isHighlighted; - switch (series.type) { - case "line": - case "threshold": { - return import_react223.default.createElement( - "g", - { key: index, role: "group", "aria-label": series.title, className: clsx_m_default(styles_css_default66.series, styles_css_default66[`series--${series.type}`], { - [styles_css_default66["series--highlighted"]]: isHighlighted, - [styles_css_default66["series--dimmed"]]: isDimmed - }) }, - import_react223.default.createElement(LineSeries, { axis, series, color: color2, xScale, yScale, chartAreaClipPath: lineAreaClipPath }) - ); - } - case "bar": - return import_react223.default.createElement(BarSeries, { key: index, axis, series, color: color2, totalSeriesCount: visibleSeries.filter((s2) => s2.series.type === "bar").length, seriesIndex: index, xScale, yScale, plotSize: axis === "y" ? plotWidth : plotHeight, highlighted: isHighlighted, dimmed: isDimmed, chartAreaClipPath, stackedBarOffsets: stackedBarOffsetMaps[index], highlightedGroupIndex }); - } - })) - ); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/bar-groups.js -var import_react224 = __toESM(require_react()); -var OUTLINE_PADDING = 2; -function BarGroups({ ariaLabel, isRefresh, isPopoverPinned, barGroups, highlightedGroupIndex, highlightedGroupRef }) { - return import_react224.default.createElement("g", { role: "group", "aria-hidden": "true" }, barGroups.map((group, index) => import_react224.default.createElement("rect", { key: index, x: Math.max(0, group.position.x - OUTLINE_PADDING), y: Math.max(0, group.position.y - OUTLINE_PADDING), width: group.position.width + 2 * OUTLINE_PADDING, height: group.position.height + 2 * OUTLINE_PADDING, ref: index === highlightedGroupIndex ? highlightedGroupRef : void 0, rx: isRefresh ? 4 : 2, role: "button", "aria-label": ariaLabel, "aria-haspopup": true, "aria-expanded": isPopoverPinned, fill: "none", className: styles_css_default66["bar-group"] }))); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-mouse-hover.js -var MAX_HOVER_MARGIN2 = 6; -var POPOVER_DEADZONE2 = 12; -function useMouseHover({ plotRef, popoverRef, scaledSeries, barGroups, highlightPoint, highlightGroup, clearHighlightedSeries, isGroupNavigation, isHandlersDisabled, highlightX }) { - const isMouseOverPopover = (event) => { - var _a2; - if ((_a2 = popoverRef.current) === null || _a2 === void 0 ? void 0 : _a2.firstChild) { - const popoverPosition = popoverRef.current.firstChild.getBoundingClientRect(); - if (event.clientX > popoverPosition.x - POPOVER_DEADZONE2 && event.clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE2 && event.clientY > popoverPosition.y - POPOVER_DEADZONE2 && event.clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE2) { - return true; - } - } - return false; - }; - const onSeriesMouseMove = (event) => { - var _a2, _b; - const svgRect = event.target.getBoundingClientRect(); - const offsetX = event.clientX - svgRect.left; - const closestX = scaledSeries.map((v) => v.x).reduce((prev, curr) => Math.abs(curr - offsetX) < Math.abs(prev - offsetX) ? curr : prev, -Infinity); - if (isFinite(closestX)) { - const offsetY = event.clientY - svgRect.top; - const closestY = scaledSeries.filter((v) => v.x === closestX || isYThreshold(v.series)).map((v) => v.y).reduce((prev, curr) => Math.abs(curr - offsetY) < Math.abs(prev - offsetY) ? curr : prev, -Infinity); - if (isFinite(closestY) && Math.abs(offsetX - closestX) < MAX_HOVER_MARGIN2 && Math.abs(offsetY - closestY) < MAX_HOVER_MARGIN2) { - const [{ color: color2, datum, series }] = scaledSeries.filter((s2) => (s2.x === closestX || isYThreshold(s2.series)) && s2.y === closestY); - highlightPoint({ x: closestX, y: closestY, color: color2, datum, series }); - } else { - let datumX = null; - for (const point5 of scaledSeries) { - if (point5.x === closestX) { - datumX = (_b = (_a2 = point5.datum) === null || _a2 === void 0 ? void 0 : _a2.x) !== null && _b !== void 0 ? _b : null; - break; - } - } - highlightX({ scaledX: closestX, label: datumX }); - } - } - }; - const onGroupMouseMove = (event) => { - const svgRect = event.target.getBoundingClientRect(); - const offsetX = event.clientX - svgRect.left; - const offsetY = event.clientY - svgRect.top; - for (let groupIndex = 0; groupIndex < barGroups.length; groupIndex++) { - const { position: { x: x2, y: y2, width, height } } = barGroups[groupIndex]; - if (x2 <= offsetX && offsetX <= x2 + width && y2 <= offsetY && offsetY <= y2 + height) { - highlightGroup(groupIndex); - return; - } - } - clearHighlightedSeries(); - }; - const onSVGMouseMove = (event) => { - if (event.target === plotRef.current.svg && !isHandlersDisabled && !isMouseOverPopover(event)) { - if (isGroupNavigation) { - onGroupMouseMove(event); - } else if (scaledSeries.length > 0) { - onSeriesMouseMove(event); - } - } - }; - const onSVGMouseOut = (event) => { - if (isHandlersDisabled || isMouseOverPopover(event)) { - return; - } - if (!nodeContains(plotRef.current.svg, event.relatedTarget) || event.relatedTarget && event.relatedTarget.classList.contains(styles_css_default66.series)) { - highlightX(null); - clearHighlightedSeries(); - } - }; - const onPopoverLeave = (event) => { - if (!isHandlersDisabled && nodeContains(plotRef.current.svg, event.relatedTarget)) { - highlightX(null); - clearHighlightedSeries(); - } - }; - return { onSVGMouseMove, onSVGMouseOut, onPopoverLeave }; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-navigation.js -var import_react225 = __toESM(require_react()); -function useNavigation({ series, visibleSeries, scaledSeries, barGroups, xScale, yScale, highlightedPoint, highlightedGroupIndex, highlightedSeries, isHandlersDisabled, pinPopover, highlightSeries, highlightGroup, highlightPoint, highlightX, verticalMarkerX }) { - const [targetX, setTargetX] = (0, import_react225.useState)(null); - const [xIndex, setXIndex] = (0, import_react225.useState)(0); - const isGroupNavigation = (0, import_react225.useMemo)(() => visibleSeries.some(({ series: series2 }) => series2.type === "bar"), [visibleSeries]); - const { navigableSeries } = (0, import_react225.useMemo)(() => findNavigableSeries(visibleSeries), [visibleSeries]); - const containsMultipleSeries = navigableSeries.length > 1; - const onBarGroupFocus = () => { - const groupIndex = highlightedGroupIndex !== null && highlightedGroupIndex !== void 0 ? highlightedGroupIndex : 0; - setTargetX(xScale.domain[groupIndex]); - highlightGroup(groupIndex); - }; - const onLineFocus = () => { - if (verticalMarkerX === null) { - if (containsMultipleSeries) { - moveToLineGroupIndex(0); - } else { - moveBetweenSeries(0); - } - } - }; - const onFocus = () => { - if (isGroupNavigation) { - onBarGroupFocus(); - } else { - onLineFocus(); - } - }; - const allUniqueX = (0, import_react225.useMemo)(() => { - const result = []; - for (let i = 0; i < scaledSeries.length; i += 1) { - const point5 = scaledSeries[i]; - if (point5 !== void 0 && (!result.length || result[result.length - 1].scaledX !== point5.x)) { - result.push({ scaledX: point5.x, datum: point5.datum }); - } - } - return result; - }, [scaledSeries]); - const moveBetweenSeries = (0, import_react225.useCallback)((direction) => { - var _a2, _b, _c, _d; - if (isGroupNavigation) { - return; - } - const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; - const MAX_SERIES_INDEX = navigableSeries.length - 1; - let previousSeriesIndex = -1; - if (highlightedSeries) { - previousSeriesIndex = navigableSeries.indexOf(highlightedSeries); - } - const firstPossibleIndex = containsMultipleSeries ? -1 : 0; - let nextSeriesIndex = 0; - if (previousSeriesIndex !== null) { - nextSeriesIndex = previousSeriesIndex + direction; - if (nextSeriesIndex > MAX_SERIES_INDEX) { - nextSeriesIndex = firstPossibleIndex; - } else if (nextSeriesIndex < firstPossibleIndex) { - nextSeriesIndex = MAX_SERIES_INDEX; - } - } - if (nextSeriesIndex === -1) { - highlightSeries(null); - highlightPoint(null); - return; - } - const nextSeries = navigableSeries[nextSeriesIndex]; - const nextInternalSeries = series.filter(({ series: series2 }) => series2 === nextSeries)[0]; - let targetXPoint = ((_a2 = xScale.d3Scale(targetX)) !== null && _a2 !== void 0 ? _a2 : NaN) + xOffset; - if (!isFinite(targetXPoint)) { - targetXPoint = 0; - } - if (nextSeries.type === "line") { - const nextScaledSeries = scaledSeries.filter((it) => it.series === nextSeries); - const closestNextSeriesPoint = nextScaledSeries.reduce((prev, curr) => Math.abs(curr.x - targetXPoint) < Math.abs(prev.x - targetXPoint) ? curr : prev, { x: -Infinity, y: -Infinity }); - highlightPoint(Object.assign(Object.assign({}, closestNextSeriesPoint), { color: nextInternalSeries.color, series: nextSeries })); - } else if (isYThreshold(nextSeries)) { - const scaledTargetIndex = scaledSeries.map((it) => { - var _a3; - return ((_a3 = it.datum) === null || _a3 === void 0 ? void 0 : _a3.x) || null; - }).indexOf(targetX); - highlightPoint({ - x: targetXPoint, - y: (_b = yScale.d3Scale(nextSeries.y)) !== null && _b !== void 0 ? _b : NaN, - color: nextInternalSeries.color, - series: nextSeries, - datum: (_c = scaledSeries[scaledTargetIndex]) === null || _c === void 0 ? void 0 : _c.datum - }); - } else if (isXThreshold(nextSeries)) { - highlightPoint({ - x: (_d = xScale.d3Scale(nextSeries.x)) !== null && _d !== void 0 ? _d : NaN, - y: yScale.d3Scale.range()[0], - color: nextInternalSeries.color, - series: nextSeries, - datum: { x: nextSeries.x, y: NaN } - }); - } - }, [ - isGroupNavigation, - xScale, - navigableSeries, - highlightedSeries, - containsMultipleSeries, - highlightSeries, - highlightPoint, - series, - targetX, - scaledSeries, - yScale - ]); - const moveWithinSeries = (0, import_react225.useCallback)((direction) => { - var _a2; - const series2 = highlightedSeries || visibleSeries[0].series; - if (series2.type === "line" || isYThreshold(series2)) { - const targetScaledSeries = scaledSeries.filter((it) => it.series === series2); - const previousPoint = highlightedPoint || targetScaledSeries[0]; - const indexOfPreviousPoint = targetScaledSeries.map((it) => it.x).indexOf(previousPoint.x); - const nextPointIndex = circleIndex2(indexOfPreviousPoint + direction, [0, targetScaledSeries.length - 1]); - const nextPoint = targetScaledSeries[nextPointIndex]; - setTargetX(((_a2 = nextPoint.datum) === null || _a2 === void 0 ? void 0 : _a2.x) || null); - setXIndex(nextPointIndex); - highlightPoint(nextPoint); - } else if (series2.type === "bar") { - const xDomain = xScale.domain; - const MAX_GROUP_INDEX = xDomain.length - 1; - let nextGroupIndex = 0; - if (highlightedGroupIndex !== null) { - nextGroupIndex = highlightedGroupIndex + direction; - if (nextGroupIndex > MAX_GROUP_INDEX) { - nextGroupIndex = 0; - } else if (nextGroupIndex < 0) { - nextGroupIndex = MAX_GROUP_INDEX; - } - } - const nextDomainIndex = nextValidDomainIndex(nextGroupIndex, barGroups, direction); - setTargetX(xDomain[nextDomainIndex]); - highlightGroup(nextDomainIndex); - } - }, [ - highlightedSeries, - visibleSeries, - scaledSeries, - highlightedPoint, - highlightPoint, - xScale.domain, - highlightedGroupIndex, - barGroups, - highlightGroup - ]); - const moveToLineGroupIndex = (0, import_react225.useCallback)((index) => { - var _a2, _b, _c, _d; - const point5 = allUniqueX[index]; - setXIndex(index); - setTargetX(((_a2 = point5.datum) === null || _a2 === void 0 ? void 0 : _a2.x) || null); - highlightX({ scaledX: (_b = point5 === null || point5 === void 0 ? void 0 : point5.scaledX) !== null && _b !== void 0 ? _b : null, label: (_d = (_c = point5.datum) === null || _c === void 0 ? void 0 : _c.x) !== null && _d !== void 0 ? _d : null }); - }, [allUniqueX, highlightX]); - const moveWithinXAxis = (0, import_react225.useCallback)((direction) => { - if (highlightedSeries || isGroupNavigation) { - moveWithinSeries(direction); - } else { - const nextPointGroupIndex = circleIndex2(xIndex + direction, [0, allUniqueX.length - 1]); - moveToLineGroupIndex(nextPointGroupIndex); - } - }, [highlightedSeries, isGroupNavigation, moveWithinSeries, xIndex, allUniqueX.length, moveToLineGroupIndex]); - const onKeyDown = (0, import_react225.useCallback)((event) => { - const keyCode = event.keyCode; - if (keyCode !== KeyCode.up && keyCode !== KeyCode.right && keyCode !== KeyCode.down && keyCode !== KeyCode.left && keyCode !== KeyCode.space && keyCode !== KeyCode.enter) { - return; - } - event.preventDefault(); - if (isHandlersDisabled) { - return; - } - if (keyCode === KeyCode.down || keyCode === KeyCode.up) { - moveBetweenSeries(keyCode === KeyCode.down ? 1 : -1); - } else if (keyCode === KeyCode.left || keyCode === KeyCode.right) { - moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1); - } else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { - pinPopover(); - } - }, [isHandlersDisabled, moveBetweenSeries, moveWithinXAxis, pinPopover]); - return { isGroupNavigation, onFocus, onKeyDown, xIndex }; -} -function circleIndex2(index, [from, to]) { - if (index < from) { - return to; - } - if (index > to) { - return from; - } - return index; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-popover.js -var import_react226 = __toESM(require_react()); -function usePopover() { - const [state, setState] = (0, import_react226.useState)("closed"); - const isPopoverOpen = state !== "closed"; - const isPopoverPinned = state === "pinned"; - const showPopover = (0, import_react226.useCallback)(() => setState("open"), []); - const pinPopover = (0, import_react226.useCallback)(() => setState("pinned"), []); - const dismissPopover = (0, import_react226.useCallback)(() => setState("closed"), []); - return { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover }; -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-container.js -var LEFT_LABELS_MARGIN2 = 16; -var BOTTOM_LABELS_OFFSET2 = 12; -var fallbackContainerWidth = 500; -function ChartContainer2(_a2) { - var _b, _c; - var { fitHeight, height: explicitPlotHeight, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverFooter, detailPopoverSize = "medium", stackedBars = false, horizontalBars = false, xScaleType, yScaleType, xTickFormatter, yTickFormatter, emphasizeBaselineAxis, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings = {}, detailPopoverSeriesContent } = _a2, props2 = __rest(_a2, ["fitHeight", "height", "series", "visibleSeries", "highlightedSeries", "onHighlightChange", "highlightedPoint", "setHighlightedPoint", "highlightedGroupIndex", "setHighlightedGroupIndex", "detailPopoverFooter", "detailPopoverSize", "stackedBars", "horizontalBars", "xScaleType", "yScaleType", "xTickFormatter", "yTickFormatter", "emphasizeBaselineAxis", "xTitle", "yTitle", "ariaLabel", "ariaLabelledby", "ariaDescription", "i18nStrings", "detailPopoverSeriesContent"]); - const plotRef = (0, import_react227.useRef)(null); - const verticalMarkerRef = (0, import_react227.useRef)(null); - const [leftLabelsWidth, setLeftLabelsWidth] = (0, import_react227.useState)(0); - const [verticalMarkerX, setVerticalMarkerX] = (0, import_react227.useState)(null); - const [detailsPopoverText, setDetailsPopoverText] = (0, import_react227.useState)(""); - const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth); - const maxLeftLabelsWidth = Math.round(containerWidth / 2); - const plotWidth = containerWidth ? ( - // Calculate the minimum between leftLabelsWidth and maxLeftLabelsWidth for extra safety because leftLabelsWidth could be out of date - Math.max(0, containerWidth - Math.min(leftLabelsWidth, maxLeftLabelsWidth) - LEFT_LABELS_MARGIN2) - ) : fallbackContainerWidth; - const containerRefObject = (0, import_react227.useRef)(null); - const containerRef = useMergeRefs(containerMeasureRef, containerRefObject); - const popoverRef = (0, import_react227.useRef)(null); - const xDomain = props2.xDomain || computeDomainX2(series, xScaleType); - const yDomain = props2.yDomain || computeDomainY2(series, yScaleType, stackedBars); - const linesOnly = series.every(({ series: series2 }) => series2.type === "line" || series2.type === "threshold"); - function getXAxisProps(size2, range3) { - const tickCount = getXTickCount(size2); - const scale = new ChartScale(xScaleType, xDomain, range3, linesOnly); - const ticks2 = createXTicks(scale, tickCount); - return { - axis: "x", - tickCount, - scale, - ticks: ticks2, - tickFormatter: xTickFormatter, - title: xTitle, - ariaRoleDescription: i18nStrings.xAxisAriaRoleDescription - }; - } - function getYAxisProps(size2, range3) { - const tickCount = getYTickCount(size2); - const scale = new NumericChartScale(yScaleType, yDomain, range3, props2.yDomain ? null : tickCount); - const ticks2 = createYTicks(scale, tickCount); - return { - axis: "y", - tickCount, - scale, - ticks: ticks2, - tickFormatter: yTickFormatter, - title: yTitle, - ariaRoleDescription: i18nStrings.yAxisAriaRoleDescription - }; - } - const bottomAxisProps = !horizontalBars ? getXAxisProps(plotWidth, [0, plotWidth]) : getYAxisProps(plotWidth, [0, plotWidth]); - const bottomLabelsProps = useBottomLabels(Object.assign({}, bottomAxisProps)); - const plotMeasureRef = (0, import_react227.useRef)(null); - const measuredHeight = useHeightMeasure(() => plotMeasureRef.current, !fitHeight); - const plotHeight = fitHeight ? measuredHeight !== null && measuredHeight !== void 0 ? measuredHeight : 0 : explicitPlotHeight; - const leftAxisProps = !horizontalBars ? getYAxisProps(plotHeight, [plotHeight, 0]) : getXAxisProps(plotHeight, [0, plotHeight]); - const xAxisProps = bottomAxisProps.axis === "x" ? bottomAxisProps : leftAxisProps.axis === "x" ? leftAxisProps : null; - const yAxisProps = bottomAxisProps.axis === "y" ? bottomAxisProps : leftAxisProps.axis === "y" ? leftAxisProps : null; - if (!xAxisProps || !yAxisProps) { - throw new Error("Invariant violation: invalid axis props."); - } - const highlightedPointRef = (0, import_react227.useRef)(null); - const highlightedGroupRef = (0, import_react227.useRef)(null); - const x2 = !horizontalBars ? "x" : "y"; - const y2 = !horizontalBars ? "y" : "x"; - const scaledSeries = makeScaledSeries(visibleSeries, xAxisProps.scale, yAxisProps.scale); - const barGroups = makeScaledBarGroups(visibleSeries, xAxisProps.scale, plotWidth, plotHeight, y2); - const { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover } = usePopover(); - const [isHandlersDisabled, setHandlersDisabled] = (0, import_react227.useState)(!isPopoverPinned); - (0, import_react227.useEffect)(() => { - if (isPopoverPinned) { - setHandlersDisabled(true); - } else { - const timeoutId = setTimeout(() => setHandlersDisabled(false), 25); - return () => clearTimeout(timeoutId); - } - }, [isPopoverPinned]); - const highlightSeries = (0, import_react227.useCallback)((series2) => { - if (series2 !== highlightedSeries) { - onHighlightChange(series2); - } - }, [highlightedSeries, onHighlightChange]); - const highlightPoint = (0, import_react227.useCallback)((point6) => { - var _a3, _b2; - setHighlightedGroupIndex(null); - setHighlightedPoint(point6); - if (point6) { - highlightSeries(point6.series); - setVerticalMarkerX({ - scaledX: point6.x, - label: (_b2 = (_a3 = point6.datum) === null || _a3 === void 0 ? void 0 : _a3.x) !== null && _b2 !== void 0 ? _b2 : null - }); - } - }, [setHighlightedGroupIndex, setHighlightedPoint, highlightSeries]); - const clearAllHighlights = (0, import_react227.useCallback)(() => { - setHighlightedPoint(null); - highlightSeries(null); - setHighlightedGroupIndex(null); - }, [highlightSeries, setHighlightedGroupIndex, setHighlightedPoint]); - const highlightX = (0, import_react227.useCallback)((marker) => { - if (marker) { - clearAllHighlights(); - } - setVerticalMarkerX(marker); - }, [clearAllHighlights]); - const highlightGroup = (0, import_react227.useCallback)((groupIndex) => { - highlightSeries(null); - setHighlightedPoint(null); - setHighlightedGroupIndex(groupIndex); - }, [highlightSeries, setHighlightedPoint, setHighlightedGroupIndex]); - const clearHighlightedSeries = (0, import_react227.useCallback)(() => { - clearAllHighlights(); - dismissPopover(); - }, [dismissPopover, clearAllHighlights]); - const _d = useNavigation({ - series, - visibleSeries, - scaledSeries, - barGroups, - xScale: xAxisProps.scale, - yScale: yAxisProps.scale, - highlightedPoint, - highlightedGroupIndex, - highlightedSeries, - isHandlersDisabled, - pinPopover, - highlightSeries, - highlightGroup, - highlightPoint, - highlightX, - clearHighlightedSeries, - verticalMarkerX - }), { isGroupNavigation } = _d, handlers = __rest(_d, ["isGroupNavigation"]); - const { onSVGMouseMove, onSVGMouseOut, onPopoverLeave } = useMouseHover({ - scaledSeries, - barGroups, - plotRef, - popoverRef, - highlightPoint, - highlightGroup, - clearHighlightedSeries, - isGroupNavigation, - isHandlersDisabled, - highlightX - }); - const highlightedX = (0, import_react227.useMemo)(() => { - var _a3, _b2; - if (highlightedGroupIndex !== null) { - return barGroups[highlightedGroupIndex].x; - } - if (verticalMarkerX !== null) { - return verticalMarkerX.label; - } - return (_b2 = (_a3 = highlightedPoint === null || highlightedPoint === void 0 ? void 0 : highlightedPoint.datum) === null || _a3 === void 0 ? void 0 : _a3.x) !== null && _b2 !== void 0 ? _b2 : null; - }, [highlightedPoint, verticalMarkerX, highlightedGroupIndex, barGroups]); - (0, import_react227.useEffect)(() => { - const onKeyDown = (event) => { - if (event.key === "Escape") { - dismissPopover(); - } - }; - document.addEventListener("keydown", onKeyDown); - return () => document.removeEventListener("keydown", onKeyDown); - }, [dismissPopover]); - (0, import_react227.useLayoutEffect)(() => { - if (highlightedX !== null || highlightedPoint !== null) { - showPopover(); - } - }, [highlightedX, highlightedPoint, showPopover]); - const onPopoverDismiss = (outsideClick) => { - dismissPopover(); - if (!outsideClick) { - setTimeout(() => { - var _a3, _b2; - const isSomeElementHighlighted = !!(highlightedPoint || highlightedGroupIndex !== null || verticalMarkerX); - if (isSomeElementHighlighted) { - (_a3 = plotRef.current) === null || _a3 === void 0 ? void 0 : _a3.focusApplication(); - } else { - (_b2 = plotRef.current) === null || _b2 === void 0 ? void 0 : _b2.focusPlot(); - } - }, 0); - } else { - clearAllHighlights(); - setVerticalMarkerX(null); - } - }; - const onSVGClick = (e) => { - if (isPopoverOpen) { - if (isPopoverPinned) { - dismissPopover(); - } else { - pinPopover(); - e.preventDefault(); - } - } else { - showPopover(); - } - }; - const onApplicationFocus = (event, trigger2) => { - if (trigger2 === "keyboard") { - handlers.onFocus(); - } else { - } - }; - const onApplicationBlur = (event) => { - const blurTarget = event.relatedTarget || event.target; - if (blurTarget === null || !(blurTarget instanceof Element) || !nodeBelongs(containerRefObject.current, blurTarget)) { - clearHighlightedSeries(); - setVerticalMarkerX(null); - if (isPopoverOpen && !isPopoverPinned) { - dismissPopover(); - } - } - }; - const onSVGKeyDown = handlers.onKeyDown; - const xOffset = xAxisProps.scale.isCategorical() ? Math.max(0, xAxisProps.scale.d3Scale.bandwidth() - 1) / 2 : 0; - let verticalLineX = null; - if (verticalMarkerX !== null) { - verticalLineX = verticalMarkerX.scaledX; - } else if (isGroupNavigation && highlightedGroupIndex !== null) { - const x3 = (_b = xAxisProps.scale.d3Scale(barGroups[highlightedGroupIndex].x)) !== null && _b !== void 0 ? _b : null; - if (x3 !== null) { - verticalLineX = xOffset + x3; - } - } - const point5 = (0, import_react227.useMemo)(() => highlightedPoint ? { - key: `${highlightedPoint.x}-${highlightedPoint.y}`, - x: highlightedPoint.x, - y: highlightedPoint.y, - color: highlightedPoint.color - } : null, [highlightedPoint]); - const verticalMarkers = (0, import_react227.useMemo)(() => verticalLineX !== null ? scaledSeries.filter(({ x: x3, y: y3 }) => (x3 === verticalLineX || isNaN(x3)) && !isNaN(y3)).map(({ x: x3, y: y3, color: color2 }, index) => ({ - key: `${index}-${x3}-${y3}`, - x: !horizontalBars ? verticalLineX || 0 : y3, - y: !horizontalBars ? y3 : verticalLineX || 0, - color: color2 - })) : [], [scaledSeries, verticalLineX, horizontalBars]); - const highlightedElementRef = isGroupNavigation ? highlightedGroupRef : highlightedPoint ? highlightedPointRef : verticalMarkerRef; - const highlightDetails = (0, import_react227.useMemo)(() => { - if (highlightedX === null) { - return null; - } - if (highlightedPoint) { - const seriesToShow = visibleSeries.filter((series2) => series2.series === (highlightedPoint === null || highlightedPoint === void 0 ? void 0 : highlightedPoint.series) || isXThreshold(series2.series)); - return formatHighlighted({ - position: highlightedX, - series: seriesToShow, - xTickFormatter, - detailPopoverSeriesContent - }); - } - return formatHighlighted({ - position: highlightedX, - series: visibleSeries, - xTickFormatter, - detailPopoverSeriesContent - }); - }, [highlightedX, highlightedPoint, visibleSeries, xTickFormatter, detailPopoverSeriesContent]); - const detailPopoverFooterContent = (0, import_react227.useMemo)(() => detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX) : null, [detailPopoverFooter, highlightedX]); - const activeAriaLabel = highlightDetails && detailsPopoverText ? `${highlightDetails.position}, ${detailsPopoverText}` : ""; - const activeLiveRegion = activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : ""; - const isLineXKeyboardFocused = !highlightedPoint && verticalMarkerX; - const isRefresh = useVisualRefresh(); - return import_react227.default.createElement(CartesianChartContainer, { ref: containerRef, minHeight: explicitPlotHeight + bottomLabelsProps.height, fitHeight: !!fitHeight, leftAxisLabel: import_react227.default.createElement(axis_label_default, { axis: y2, position: "left", title: leftAxisProps.title }), leftAxisLabelMeasure: import_react227.default.createElement(labels_measure_default, { ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, autoWidth: setLeftLabelsWidth, maxLabelsWidth: maxLeftLabelsWidth }), bottomAxisLabel: import_react227.default.createElement(axis_label_default, { axis: x2, position: "bottom", title: bottomAxisProps.title }), chartPlot: import_react227.default.createElement( - chart_plot_default, - { ref: plotRef, width: "100%", height: fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : plotHeight, offsetBottom: bottomLabelsProps.height, isClickable: isPopoverOpen && !isPopoverPinned, ariaLabel, ariaLabelledby, ariaDescription, ariaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.chartAriaRoleDescription, ariaLiveRegion: activeLiveRegion, activeElementRef: highlightedElementRef, activeElementKey: (_c = highlightedGroupIndex === null || highlightedGroupIndex === void 0 ? void 0 : highlightedGroupIndex.toString()) !== null && _c !== void 0 ? _c : isLineXKeyboardFocused ? `point-index-${handlers.xIndex}` : point5 === null || point5 === void 0 ? void 0 : point5.key, activeElementFocusOffset: isGroupNavigation ? 0 : isLineXKeyboardFocused ? { x: 8, y: 0 } : 3, onMouseMove: onSVGMouseMove, onMouseOut: onSVGMouseOut, onClick: onSVGClick, onApplicationFocus, onApplicationBlur, onKeyDown: onSVGKeyDown }, - import_react227.default.createElement("line", { ref: plotMeasureRef, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: "none" } }), - import_react227.default.createElement(left_labels_default, { axis: y2, ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, title: leftAxisProps.title, ariaRoleDescription: leftAxisProps.ariaRoleDescription, maxLabelsWidth: maxLeftLabelsWidth, plotWidth, plotHeight }), - horizontalBars && import_react227.default.createElement(vertical_grid_lines_default, { scale: yAxisProps.scale, ticks: yAxisProps.ticks, height: plotHeight }), - emphasizeBaselineAxis && linesOnly && import_react227.default.createElement(emphasized_baseline_default, { axis: x2, scale: yAxisProps.scale, width: plotWidth, height: plotHeight }), - import_react227.default.createElement(DataSeries2, { axis: x2, plotWidth, plotHeight, highlightedSeries: highlightedSeries !== null && highlightedSeries !== void 0 ? highlightedSeries : null, highlightedGroupIndex, stackedBars, isGroupNavigation, visibleSeries, xScale: xAxisProps.scale, yScale: yAxisProps.scale }), - emphasizeBaselineAxis && !linesOnly && import_react227.default.createElement(emphasized_baseline_default, { axis: x2, scale: yAxisProps.scale, width: plotWidth, height: plotHeight }), - import_react227.default.createElement(vertical_marker_default, { key: verticalLineX || "", height: plotHeight, showPoints: highlightedPoint === null, showLine: !isGroupNavigation, points: verticalMarkers, ref: verticalMarkerRef }), - highlightedPoint && import_react227.default.createElement(highlighted_point_default, { ref: highlightedPointRef, point: point5, role: "button", ariaLabel: activeAriaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned }), - isGroupNavigation && xAxisProps.scale.isCategorical() && import_react227.default.createElement(BarGroups, { ariaLabel: activeAriaLabel, isRefresh, isPopoverPinned, barGroups, highlightedGroupIndex, highlightedGroupRef }), - import_react227.default.createElement(bottom_labels_default, Object.assign({}, bottomLabelsProps, { axis: x2, scale: bottomAxisProps.scale, title: bottomAxisProps.title, ariaRoleDescription: bottomAxisProps.ariaRoleDescription, height: plotHeight, width: plotWidth, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET2, offsetRight: BOTTOM_LABELS_OFFSET2 })) - ), popover: import_react227.default.createElement(chart_popover_default2, { ref: popoverRef, containerRef: containerRefObject, trackRef: highlightedElementRef, isOpen: isPopoverOpen, isPinned: isPopoverPinned, highlightDetails, onDismiss: onPopoverDismiss, size: detailPopoverSize, footer: detailPopoverFooterContent, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onMouseLeave: onPopoverLeave, onBlur: onApplicationBlur, setPopoverText: setDetailsPopoverText }) }); -} - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/internal.js -function InternalMixedLineBarChart(_a2) { - var { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, stackedBars, horizontalBars, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, detailPopoverSeriesContent, emphasizeBaselineAxis, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["fitHeight", "height", "xScaleType", "yScaleType", "xDomain", "yDomain", "xTickFormatter", "yTickFormatter", "highlightedSeries", "visibleSeries", "series", "onFilterChange", "onHighlightChange", "i18nStrings", "ariaLabel", "ariaLabelledby", "ariaDescription", "xTitle", "yTitle", "stackedBars", "horizontalBars", "hideFilter", "additionalFilters", "hideLegend", "legendTitle", "statusType", "detailPopoverSize", "detailPopoverFooter", "detailPopoverSeriesContent", "emphasizeBaselineAxis", "empty", "noMatch", "errorText", "loadingText", "recoveryText", "onRecoveryClick", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const containerRef = (0, import_react228.useRef)(null); - (0, import_react228.useEffect)(() => { - const gotBarSeries = externalSeries.some((s2) => s2.type === "bar"); - const gotLineSeries = externalSeries.some((s2) => s2.type === "line"); - if (xScaleType !== "categorical" && gotBarSeries) { - warnOnce("MixedLineBarChart", `Bar series cannot be used with a ${xScaleType} scale. Use a categorical x axis instead.`); - } - if (horizontalBars && gotLineSeries) { - warnOnce("MixedLineBarChart", `Property horizontalBars can only be used with charts that contain only bar or threshold series.`); - } - for (const s2 of externalSeries) { - if (s2.type === "threshold" && s2.x !== void 0 && s2.y !== void 0) { - warnOnce("MixedLineBarChart", `Series of type "threshold" must contain either x or y property.`); - } - if (s2.type === "threshold" && s2.x === void 0 && s2.y === void 0) { - warnOnce("MixedLineBarChart", `Series of type "threshold" must contain either x or y property.`); - } - } - }, [xScaleType, horizontalBars, externalSeries]); - const series = (0, import_react228.useMemo)(() => { - const colors = createCategoryColorScale(externalSeries, (it) => isYThreshold(it) || isXThreshold(it), (it) => it.color || null); - return externalSeries.map((s2, i) => ({ index: i, color: colors[i], series: s2 })); - }, [externalSeries]); - const [highlightedPoint, setHighlightedPoint] = (0, import_react228.useState)(null); - const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react228.useState)(null); - const [highlightedSeries = null, setHighlightedSeries] = useControllable2(controlledHighlightedSeries, controlledOnHighlightChange, null, { - componentName: "MixedLineBarChart", - controlledProp: "highlightedSeries", - changeHandler: "onHighlightChange" - }); - const [legendSeries, setLegendSeries] = (0, import_react228.useState)(highlightedSeries); - (0, import_react228.useEffect)(() => { - setLegendSeries(controlledHighlightedSeries || null); - }, [controlledHighlightedSeries]); - const [externalVisibleSeries, setExternalVisibleSeries] = useControllable2(controlledVisibleSeries, onFilterChange, externalSeries, { - componentName: "MixedLineBarChart", - controlledProp: "visibleSeries", - changeHandler: "onFilterChange" - }); - if (isDevelopment2) { - const previousSeries = usePrevious(externalSeries); - const hasPrevious = !!(previousSeries && previousSeries.length); - const hasCurrent = !!externalSeries.length; - if (hasPrevious && hasCurrent && externalSeries !== previousSeries && !controlledVisibleSeries && !hideFilter) { - warnOnce("MixedLineBarChart", "The `series` value passed into the component changed. This may cause problems with filtering - we recommend that you make the `series` value constant, or provide a `visibleSeries` value that derives from the current `series` value."); - } - } - const visibleSeries = (0, import_react228.useMemo)(() => series.filter((s2) => (externalVisibleSeries === null || externalVisibleSeries === void 0 ? void 0 : externalVisibleSeries.indexOf(s2.series)) !== -1), [series, externalVisibleSeries]); - const filterChange = (selectedSeries) => { - setExternalVisibleSeries(selectedSeries); - fireNonCancelableEvent(onFilterChange, { - visibleSeries: selectedSeries - }); - }; - const onHighlightChange = (series2) => { - setHighlightedSeries(series2); - fireNonCancelableEvent(controlledOnHighlightChange, { - highlightedSeries: series2 - }); - setLegendSeries(series2); - }; - const onBlur = (event) => { - if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { - highlightedSeries && onHighlightChange(highlightedSeries); - setHighlightedPoint(null); - setHighlightedGroupIndex(null); - setLegendSeries(null); - } - }; - const { isEmpty, isNoMatch, showChart } = getChartStatus({ - externalData: externalSeries, - visibleData: visibleSeries || [], - statusType - }); - const showFilters = statusType === "finished" && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter); - const showLegend = !hideLegend && !isEmpty && statusType === "finished"; - const reserveLegendSpace = !showChart && !hideLegend; - const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters); - const mergedRef = useMergeRefs(containerRef, __internalRootRef); - const filterItems = series.map(({ series: series2, color: color2 }) => ({ - label: series2.title, - type: chartLegendMap[series2.type], - color: color2, - datum: series2 - })); - return import_react228.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default66.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? import_react228.default.createElement(chart_filter_default, { series: filterItems, onChange: filterChange, selectedSeries: externalVisibleSeries || [], i18nStrings }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react228.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty, noMatch, loadingText, errorText, recoveryText, onRecoveryClick }), chart: showChart ? import_react228.default.createElement(ChartContainer2, { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter: xTickFormatter !== null && xTickFormatter !== void 0 ? xTickFormatter : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.xTickFormatter, yTickFormatter: yTickFormatter !== null && yTickFormatter !== void 0 ? yTickFormatter : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.yTickFormatter, emphasizeBaselineAxis, stackedBars, horizontalBars, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverSize, detailPopoverFooter, detailPopoverSeriesContent, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings }) : null, legend: showLegend ? import_react228.default.createElement(InternalChartLegend, { series, visibleSeries: externalVisibleSeries || [], highlightedSeries: legendSeries, onHighlightChange, legendTitle, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.legendAriaLabel, plotContainerRef: containerRef }) : null, onBlur })); -} - -// node_modules/@cloudscape-design/components/bar-chart/index.js -function BarChart(_a2) { - var { series = [], height = 500, xScaleType = "categorical", yScaleType = "linear", stackedBars = false, horizontalBars = false, detailPopoverSize = "medium", statusType = "finished", emphasizeBaselineAxis = true, detailPopoverSeriesContent } = _a2, props2 = __rest(_a2, ["series", "height", "xScaleType", "yScaleType", "stackedBars", "horizontalBars", "detailPopoverSize", "statusType", "emphasizeBaselineAxis", "detailPopoverSeriesContent"]); - const baseComponentProps = useBaseComponent("BarChart", { - props: { - detailPopoverSize, - emphasizeBaselineAxis, - fitHeight: props2.fitHeight, - hideFilter: props2.hideFilter, - hideLegend: props2.hideLegend, - horizontalBars, - stackedBars, - xScaleType, - yScaleType - } - }); - const baseProps = getBaseProps(props2); - const className2 = clsx_m_default(baseProps.className, styles_css_default65.root); - return import_react229.default.createElement(InternalMixedLineBarChart, Object.assign({}, props2, baseComponentProps, { className: className2, height, xScaleType, yScaleType, stackedBars, horizontalBars, series, detailPopoverSize, statusType, emphasizeBaselineAxis, detailPopoverSeriesContent })); -} -applyDisplayName(BarChart, "BarChart"); -var bar_chart_default = BarChart; - -// node_modules/@cloudscape-design/components/box/index.js -var import_react230 = __toESM(require_react()); -function Box(_a2) { - var { variant = "div", margin = {}, padding = {} } = _a2, props2 = __rest(_a2, ["variant", "margin", "padding"]); - const baseComponentProps = useBaseComponent("Box", { - props: { - color: props2.color, - display: props2.display, - float: props2.float, - fontSize: props2.fontSize, - fontWeight: props2.fontWeight, - textAlign: props2.textAlign, - variant - } - }); - return import_react230.default.createElement(InternalBox, Object.assign({ variant, margin, padding }, props2, baseComponentProps)); -} -applyDisplayName(Box, "Box"); - -// node_modules/@cloudscape-design/components/breadcrumb-group/index.js -var import_react234 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/breadcrumb-group/internal.js -var import_react233 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/breadcrumb-group/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/breadcrumb-group/styles.scoped.css"; -var styles_css_default67 = { - "breadcrumb-group": "awsui_breadcrumb-group_d19fg_z6pwg_99", - "item": "awsui_item_d19fg_z6pwg_137", - "breadcrumb-group-list": "awsui_breadcrumb-group-list_d19fg_z6pwg_172", - "ellipsis": "awsui_ellipsis_d19fg_z6pwg_184", - "icon": "awsui_icon_d19fg_z6pwg_194", - "mobile": "awsui_mobile_d19fg_z6pwg_199", - "mobile-short": "awsui_mobile-short_d19fg_z6pwg_212" -}; - -// node_modules/@cloudscape-design/components/breadcrumb-group/item/item.js -var import_react232 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/breadcrumb-group/item/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/breadcrumb-group/item/styles.scoped.css"; -var styles_css_default68 = { - "link": "awsui_link_1kosq_r0i6w_99", - "breadcrumb": "awsui_breadcrumb_1kosq_r0i6w_103", - "icon": "awsui_icon_1kosq_r0i6w_106", - "anchor": "awsui_anchor_1kosq_r0i6w_111", - "last": "awsui_last_1kosq_r0i6w_157", - "compressed": "awsui_compressed_1kosq_r0i6w_167", - "text": "awsui_text_1kosq_r0i6w_171", - "virtual-item": "awsui_virtual-item_1kosq_r0i6w_178" -}; - -// node_modules/@cloudscape-design/components/internal/components/tooltip/index.js -var import_react231 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/tooltip/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/tooltip/styles.scoped.css"; -var styles_css_default69 = { - "root": "awsui_root_1qprf_160mh_5" -}; - -// node_modules/@cloudscape-design/components/internal/components/tooltip/index.js -function Tooltip2({ value, trackRef }) { - return import_react231.default.createElement( - Portal, - null, - import_react231.default.createElement( - "div", - { className: styles_css_default69.root }, - import_react231.default.createElement(Transition2, { in: true }, () => import_react231.default.createElement( - PopoverContainer, - { trackRef, trackKey: value, size: "small", fixedWidth: false, position: "top", arrow: (position) => import_react231.default.createElement( - "div", - { className: clsx_m_default(styles_css_default13.arrow, styles_css_default13[`arrow-position-${position}`]) }, - import_react231.default.createElement("div", { className: styles_css_default13["arrow-outer"] }), - import_react231.default.createElement("div", { className: styles_css_default13["arrow-inner"] }) - ) }, - import_react231.default.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: void 0, onDismiss: void 0, header: void 0 }, value) - )) - ) - ); -} - -// node_modules/@cloudscape-design/components/breadcrumb-group/item/item.js -var BreadcrumbItemWithPopover = (_a2) => { - var { item, isLast, anchorAttributes, funnelAttributes } = _a2, itemAttributes = __rest(_a2, ["item", "isLast", "anchorAttributes", "funnelAttributes"]); - const [showPopover, setShowPopover] = (0, import_react232.useState)(false); - const textRef = (0, import_react232.useRef)(null); - const virtualTextRef = (0, import_react232.useRef)(null); - const isTruncated = (textRef2, virtualTextRef2) => { - if (!textRef2 || !virtualTextRef2 || !textRef2.current || !virtualTextRef2.current) { - return false; - } - const virtualTextWidth = virtualTextRef2.current.getBoundingClientRect().width; - const textWidth = textRef2.current.getBoundingClientRect().width; - if (virtualTextWidth > textWidth) { - return true; - } - return false; - }; - const popoverContent = import_react232.default.createElement(Tooltip2, { trackRef: textRef, value: item.text }); - (0, import_react232.useEffect)(() => { - const onKeyDown = (event) => { - if (event.key === "Escape") { - setShowPopover(false); - } - }; - if (showPopover) { - document.addEventListener("keydown", onKeyDown); - } - return () => { - document.removeEventListener("keydown", onKeyDown); - }; - }, [showPopover]); - return import_react232.default.createElement( - import_react232.default.Fragment, - null, - import_react232.default.createElement( - Item2, - Object.assign({ isLast }, itemAttributes, { onFocus: () => { - isTruncated(textRef, virtualTextRef) && setShowPopover(true); - }, onBlur: () => setShowPopover(false), onMouseEnter: () => { - isTruncated(textRef, virtualTextRef) && setShowPopover(true); - }, onMouseLeave: () => setShowPopover(false), anchorAttributes }), - import_react232.default.createElement("span", Object.assign({}, funnelAttributes, { className: styles_css_default68.text, ref: textRef }), item.text), - import_react232.default.createElement("span", { className: styles_css_default68["virtual-item"], ref: virtualTextRef }, item.text) - ), - showPopover && popoverContent - ); -}; -var Item2 = (_a2) => { - var { anchorAttributes, children: children2, isLast } = _a2, itemAttributes = __rest(_a2, ["anchorAttributes", "children", "isLast"]); - return isLast ? import_react232.default.createElement("span", Object.assign({}, itemAttributes), children2) : import_react232.default.createElement("a", Object.assign({}, itemAttributes, anchorAttributes), children2); -}; -function BreadcrumbItem({ item, onClick, onFollow, isDisplayed, isLast = false, isCompressed = false }) { - const preventDefault3 = (event) => event.preventDefault(); - const onClickHandler = (event) => { - if (isPlainLeftClick(event)) { - fireCancelableEvent(onFollow, getEventDetail(item), event); - } - fireCancelableEvent(onClick, getEventDetail(item), event); - }; - const itemAttributes = { - className: clsx_m_default(styles_css_default68.anchor, { [styles_css_default68.compressed]: isCompressed }) - }; - const anchorAttributes = { - href: item.href || "#", - onClick: isLast ? preventDefault3 : onClickHandler - }; - const funnelAttributes = {}; - if (isLast) { - funnelAttributes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME; - } - return import_react232.default.createElement( - "div", - { className: clsx_m_default(styles_css_default68.breadcrumb, isLast && styles_css_default68.last) }, - isDisplayed && isCompressed ? import_react232.default.createElement(BreadcrumbItemWithPopover, Object.assign({ item, isLast, anchorAttributes, funnelAttributes }, itemAttributes)) : import_react232.default.createElement( - Item2, - Object.assign({ isLast, anchorAttributes }, itemAttributes), - import_react232.default.createElement("span", Object.assign({}, funnelAttributes, { className: styles_css_default68.text }), item.text) - ), - !isLast ? import_react232.default.createElement( - "span", - { className: styles_css_default68.icon }, - import_react232.default.createElement(internal_default, { name: "angle-right" }) - ) : null - ); -} - -// node_modules/@cloudscape-design/components/breadcrumb-group/internal.js -var DEFAULT_EXPAND_ARIA_LABEL = "Show path"; -var getDropdownTrigger = ({ ariaLabel, triggerRef, disabled, testUtilsClass, isOpen, onClick }) => { - return import_react233.default.createElement(InternalButton, { ref: triggerRef, className: testUtilsClass, disabled, onClick: (event) => { - event.preventDefault(); - onClick(); - }, ariaExpanded: isOpen, "aria-haspopup": true, ariaLabel, variant: "breadcrumb-group", formAction: "none" }, "..."); -}; -var EllipsisDropdown = ({ ariaLabel, dropdownItems, onDropdownItemClick, onDropdownItemFollow }) => { - var _a2; - const i18n = useInternalI18n("breadcrumb-group"); - return import_react233.default.createElement( - "li", - { className: styles_css_default67.ellipsis }, - import_react233.default.createElement(internal_default4, { ariaLabel: (_a2 = i18n("expandAriaLabel", ariaLabel)) !== null && _a2 !== void 0 ? _a2 : DEFAULT_EXPAND_ARIA_LABEL, items: dropdownItems, onItemClick: onDropdownItemClick, onItemFollow: onDropdownItemFollow, customTriggerBuilder: getDropdownTrigger }), - import_react233.default.createElement( - "span", - { className: styles_css_default67.icon }, - import_react233.default.createElement(internal_default, { name: "angle-right" }) - ) - ); -}; -var getEventDetail = (item) => ({ - item, - text: item.text, - href: item.href -}); -function InternalBreadcrumbGroup(_a2) { - var { items = [], ariaLabel, expandAriaLabel, onClick, onFollow, __internalRootRef } = _a2, props2 = __rest(_a2, ["items", "ariaLabel", "expandAriaLabel", "onClick", "onFollow", "__internalRootRef"]); - for (const item of items) { - checkSafeUrl("BreadcrumbGroup", item.href); - } - const baseProps = getBaseProps(props2); - const isMobile = useMobile(); - let breadcrumbItems = items.map((item, index) => { - const isLast = index === items.length - 1; - return import_react233.default.createElement( - "li", - { className: styles_css_default67.item, key: index }, - import_react233.default.createElement(BreadcrumbItem, { item, onClick, onFollow, isCompressed: isMobile, isLast, isDisplayed: !isMobile || isLast || index === 0 }) - ); - }); - const getEventItem = (e) => { - const { id } = e.detail; - return items[parseInt(id)]; - }; - if (breadcrumbItems.length >= 2) { - const dropdownItems = items.slice(1, items.length - 1).map((item, index) => ({ - id: (index + 1).toString(), - text: item.text, - href: item.href || "#" - })); - breadcrumbItems = [ - breadcrumbItems[0], - import_react233.default.createElement(EllipsisDropdown, { key: "ellipsis", ariaLabel: expandAriaLabel, dropdownItems, onDropdownItemClick: (e) => fireCancelableEvent(onClick, getEventDetail(getEventItem(e)), e), onDropdownItemFollow: (e) => fireCancelableEvent(onFollow, getEventDetail(getEventItem(e)), e) }), - ...breadcrumbItems.slice(1) - ]; - } - return import_react233.default.createElement( - "nav", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default67["breadcrumb-group"], isMobile && styles_css_default67.mobile, items.length <= 2 && styles_css_default67["mobile-short"], baseProps.className), "aria-label": ariaLabel || void 0, ref: __internalRootRef }), - import_react233.default.createElement("ol", { className: styles_css_default67["breadcrumb-group-list"] }, breadcrumbItems) - ); -} - -// node_modules/@cloudscape-design/components/breadcrumb-group/index.js -function BreadcrumbGroup(_a2) { - var { items = [] } = _a2, props2 = __rest(_a2, ["items"]); - const baseComponentProps = useBaseComponent("BreadcrumbGroup"); - return import_react234.default.createElement(InternalBreadcrumbGroup, Object.assign({ items }, props2, baseComponentProps)); -} -applyDisplayName(BreadcrumbGroup, "BreadcrumbGroup"); - -// node_modules/@cloudscape-design/components/button/index.js -var import_react235 = __toESM(require_react()); -var Button = import_react235.default.forwardRef((_a2, ref) => { - var { children: children2, iconName, iconAlign = "left", iconUrl, iconSvg, iconAlt, variant = "normal", loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = "submit", ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, ariaControls, fullWidth, form } = _a2, props2 = __rest(_a2, ["children", "iconName", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "onClick", "onFollow", "ariaExpanded", "ariaControls", "fullWidth", "form"]); - const baseComponentProps = useBaseComponent("Button", { - props: { formAction, fullWidth, iconAlign, iconName, rel, target, variant, wrapText } - }); - const baseProps = getBaseProps(props2); - return import_react235.default.createElement(InternalButton, Object.assign({}, baseProps, baseComponentProps, { ref, iconName, iconAlign, iconUrl, iconSvg, iconAlt, variant, loading, loadingText, disabled, wrapText, href, target, rel, download, formAction, ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, ariaControls, fullWidth, form }), children2); -}); -applyDisplayName(Button, "Button"); -var button_default = Button; - -// node_modules/@cloudscape-design/components/button-dropdown/index.js -var import_react236 = __toESM(require_react()); -var ButtonDropdown = import_react236.default.forwardRef((_a2, ref) => { - var { items, variant = "normal", loading = false, loadingText, disabled = false, expandableGroups = false, expandToViewport = false, ariaLabel, children: children2, onItemClick, onItemFollow, mainAction } = _a2, props2 = __rest(_a2, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "expandToViewport", "ariaLabel", "children", "onItemClick", "onItemFollow", "mainAction"]); - const baseComponentProps = useBaseComponent("ButtonDropdown", { - props: { expandToViewport, expandableGroups, variant } - }); - const baseProps = getBaseProps(props2); - return import_react236.default.createElement(internal_default4, Object.assign({}, baseProps, baseComponentProps, { ref, items, variant, loading, loadingText, disabled, expandableGroups, expandToViewport, ariaLabel, onItemClick, onItemFollow, mainAction }), children2); -}); -applyDisplayName(ButtonDropdown, "ButtonDropdown"); -var button_dropdown_default = ButtonDropdown; - -// node_modules/@cloudscape-design/components/calendar/index.js -var import_react244 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/calendar/internal.js -var import_react243 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/calendar/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/calendar/styles.scoped.css"; -var styles_css_default70 = { - "calendar": "awsui_calendar_1ykar_1boof_99", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1ykar_1boof_1", - "root": "awsui_root_1ykar_1boof_130", - "calendar-inner": "awsui_calendar-inner_1ykar_1boof_171", - "calendar-header": "awsui_calendar-header_1ykar_1boof_175", - "calendar-header-title": "awsui_calendar-header-title_1ykar_1boof_180", - "calendar-next-btn": "awsui_calendar-next-btn_1ykar_1boof_188", - "calendar-prev-btn": "awsui_calendar-prev-btn_1ykar_1boof_191", - "calendar-grid": "awsui_calendar-grid_1ykar_1boof_194", - "calendar-grid-dense": "awsui_calendar-grid-dense_1ykar_1boof_198", - "calendar-grid-cell": "awsui_calendar-grid-cell_1ykar_1boof_206", - "calendar-date-header": "awsui_calendar-date-header_1ykar_1boof_211", - "calendar-date": "awsui_calendar-date_1ykar_1boof_211", - "calendar-date-enabled": "awsui_calendar-date-enabled_1ykar_1boof_231", - "calendar-date-current-page": "awsui_calendar-date-current-page_1ykar_1boof_241", - "calendar-date-selected": "awsui_calendar-date-selected_1ykar_1boof_252", - "calendar-date-current": "awsui_calendar-date-current_1ykar_1boof_241", - "calendar-date-dense": "awsui_calendar-date-dense_1ykar_1boof_273", - "date-inner": "awsui_date-inner_1ykar_1boof_281", - "calendar-row": "awsui_calendar-row_1ykar_1boof_356" -}; - -// node_modules/@cloudscape-design/components/calendar/header/index.js -var import_react238 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/calendar/header/header-button.js -var import_react237 = __toESM(require_react()); -function HeaderPrevButton({ ariaLabel, onChange }) { - return import_react237.default.createElement(InternalButton, { iconName: "angle-left", ariaLabel, variant: "icon", onClick: () => onChange(-1), formAction: "none", className: styles_css_default70["calendar-prev-btn"] }); -} -function HeaderNextButton({ ariaLabel, onChange }) { - return import_react237.default.createElement(InternalButton, { iconName: "angle-right", ariaLabel, variant: "icon", onClick: () => onChange(1), formAction: "none", className: styles_css_default70["calendar-next-btn"] }); -} - -// node_modules/@cloudscape-design/components/calendar/header/index.js -var CalendarHeader = ({ formattedDate, onChange, previousLabel, nextLabel, headingId }) => { - return import_react238.default.createElement( - "div", - { className: styles_css_default70["calendar-header"] }, - import_react238.default.createElement(HeaderPrevButton, { ariaLabel: previousLabel, onChange }), - import_react238.default.createElement("h2", { className: styles_css_default70["calendar-header-title"], id: headingId }, formattedDate), - import_react238.default.createElement(HeaderNextButton, { ariaLabel: nextLabel, onChange }) - ); -}; -var header_default = CalendarHeader; - -// node_modules/@cloudscape-design/components/calendar/grid/index.js -var import_react239 = __toESM(require_react()); -function Grid({ isDateEnabled, focusedDate, focusableDate, onSelectDate, selectedDate, ariaLabelledby, header, rows, isCurrentPage, renderDate, renderDateAnnouncement, isSameDate, onGridKeyDownHandler }) { - const focusedDateRef = (0, import_react239.useRef)(null); - useEffectOnUpdate(() => { - if (focusedDate && focusedDateRef.current) { - focusedDateRef.current.focus(); - } - }, [focusedDate]); - const rowLength = rows[0].length; - const denseGrid = rowLength > 3; - return import_react239.default.createElement( - "table", - { role: "grid", className: clsx_m_default(styles_css_default70["calendar-grid"], denseGrid && styles_css_default70["calendar-grid-dense"]), "aria-labelledby": ariaLabelledby }, - header, - import_react239.default.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, rows.map((row, rowIndex) => import_react239.default.createElement("tr", { key: rowIndex, className: styles_css_default70["calendar-row"] }, row.map((date2, dateIndex) => { - const isFocusable = !!focusableDate && isSameDate(date2, focusableDate); - const isSelected = !!selectedDate && isSameDate(date2, selectedDate); - const isEnabled = !isDateEnabled || isDateEnabled(date2); - const isCurrentDate = isSameDate(date2, /* @__PURE__ */ new Date()); - let tabIndex = void 0; - if (isFocusable && isEnabled) { - tabIndex = 0; - } else if (isEnabled) { - tabIndex = -1; - } - return import_react239.default.createElement( - "td", - { - key: `${rowIndex}:${dateIndex}`, - ref: tabIndex === 0 ? focusedDateRef : void 0, - tabIndex, - "aria-current": isCurrentDate ? "date" : void 0, - "aria-selected": isEnabled ? isSelected : void 0, - "aria-disabled": !isEnabled, - // Do not attach click event when the date is disabled, otherwise VO+safari announces clickable - onClick: isEnabled ? () => onSelectDate(date2) : void 0, - className: clsx_m_default(styles_css_default70["calendar-grid-cell"], styles_css_default70["calendar-date"], { - [styles_css_default70["calendar-date-current-page"]]: isCurrentPage(date2), - [styles_css_default70["calendar-date-enabled"]]: isEnabled, - [styles_css_default70["calendar-date-selected"]]: isSelected, - [styles_css_default70["calendar-date-current"]]: isCurrentDate, - [styles_css_default70["calendar-date-dense"]]: denseGrid - }) - }, - import_react239.default.createElement("span", { className: styles_css_default70["date-inner"], "aria-hidden": "true" }, renderDate(date2)), - import_react239.default.createElement(ScreenreaderOnly, null, renderDateAnnouncement(date2, isCurrentDate)) - ); - })))) - ); -} - -// node_modules/@cloudscape-design/components/internal/utils/locale/merge-locales.js -function mergeLocales(locale2, fullLocale) { - const isShort = locale2.length === 2; - if (isShort && fullLocale.indexOf(locale2) === 0) { - return fullLocale; - } - return locale2; -} - -// node_modules/@cloudscape-design/components/internal/utils/locale/normalize-locale.js -function normalizeLocale(component, locale2) { - var _a2; - locale2 = checkLocale(component, locale2); - const browserLocale = getBrowserLocale(); - if (locale2) { - return mergeLocales(locale2, browserLocale); - } - const htmlLocale = checkLocale(component, (_a2 = getHtmlElement()) === null || _a2 === void 0 ? void 0 : _a2.getAttribute("lang")); - if (htmlLocale) { - return mergeLocales(htmlLocale, browserLocale); - } - return browserLocale; -} -function checkLocale(component, locale2) { - if (!locale2 || locale2 === "") { - return ""; - } - locale2 = locale2 && locale2.replace(/^([a-z]{2})_/, "$1-"); - if (locale2 && !locale2.match(/^[a-z]{2}(-[A-Z]{2})?$/)) { - warnOnce(component, `Invalid locale provided: ${locale2}. Falling back to default`); - locale2 = ""; - } - return locale2; -} -function getHtmlElement() { - return typeof document !== "undefined" ? document.querySelector("html") : null; -} -function getBrowserLocale() { - return new Intl.DateTimeFormat().resolvedOptions().locale; -} - -// node_modules/weekstart/dist/es-module/api.js -function getWeekStartByRegion(regionCode, regionDayMap2) { - var code = regionDayMap2[typeof regionCode === "string" ? regionCode.toUpperCase() : regionCode]; - return typeof code === "number" ? code : 1; -} -function getWeekStartByLocale(locale2, langRegionMap2, regionDayMap2) { - if (locale2) { - var data = locale2.toLowerCase().split(/[-_]/); - var language = data[0]; - var country; - if (data[1] && data[1].length === 4) { - language += "_" + data[1]; - country = data[2]; - } else { - country = data[1]; - } - if (!country) { - country = langRegionMap2[language]; - } - if (country) { - return getWeekStartByRegion(country.match(/^\d+$/) ? Number(country) : country, regionDayMap2); - } - } - return 1; -} - -// node_modules/weekstart/dist/es-module/langRegionMap.js -var langRegionMap = { - en: "US", - zh: "CN", - zh_hans: "CN", - hans: "CN", - wuu: "CN", - hsn: "CN", - hak: "CN", - nan: "CN", - gan: "CN", - hi: "IN", - te: "IN", - mr: "IN", - ta: "IN", - gu: "IN", - kn: "IN", - or: "IN", - ml: "IN", - pa_guru: "IN", - bho: "IN", - awa: "IN", - as: "IN", - mwr: "IN", - mai: "IN", - mag: "IN", - bgc: "IN", - hne: "IN", - dcc: "IN", - dz: "BT", - tn: "BW", - am: "ET", - om: "ET", - quc: "GT", - id: "ID", - jv: "ID", - su: "ID", - mad: "ID", - ms_arab: "ID", - ga: "IE", - he: "IL", - jam: "JM", - ja: "JP", - km: "KH", - ko: "KR", - lo: "LA", - mh: "MH", - my: "MM", - mt: "MT", - ne: "NP", - fil: "PH", - ceb: "PH", - ilo: "PH", - ur: "PK", - pa: "PK", - pa_arab: "PK", - arab: "PK", - lah: "PK", - ps: "PK", - sd: "PK", - sd_arab: "PK", - skr: "PK", - gn: "PY", - th: "TH", - tts: "TH", - aeb: "TN", - zh_hant: "TW", - hant: "TW", - sm: "WS", - zu: "ZA", - sn: "ZW", - arq: "DZ", - ar: "EG", - arz: "EG", - fa: "IR", - az_arab: "IR", - ary: "MA", - bn: "BD", - rkt: "BD", - dv: "MV" -}; -var langRegionMap_default = langRegionMap; - -// node_modules/weekstart/dist/es-module/regionDayMap.js -var regionDayMap = { - AG: 0, - ATG: 0, - 28: 0, - AR: 0, - ARG: 0, - 32: 0, - AS: 0, - ASM: 0, - 16: 0, - AU: 0, - AUS: 0, - 36: 0, - BR: 0, - BRA: 0, - 76: 0, - BS: 0, - BHS: 0, - 44: 0, - BT: 0, - BTN: 0, - 64: 0, - BW: 0, - BWA: 0, - 72: 0, - BZ: 0, - BLZ: 0, - 84: 0, - CA: 0, - CAN: 0, - 124: 0, - CN: 0, - CHN: 0, - 156: 0, - CO: 0, - COL: 0, - 170: 0, - DM: 0, - DMA: 0, - 212: 0, - DO: 0, - DOM: 0, - 214: 0, - ET: 0, - ETH: 0, - 231: 0, - GT: 0, - GTM: 0, - 320: 0, - GU: 0, - GUM: 0, - 316: 0, - HK: 0, - HKG: 0, - 344: 0, - HN: 0, - HND: 0, - 340: 0, - ID: 0, - IDN: 0, - 360: 0, - IE: 0, - IRL: 0, - 372: 0, - IL: 0, - ISR: 0, - 376: 0, - IN: 0, - IND: 0, - 356: 0, - JM: 0, - JAM: 0, - 388: 0, - JP: 0, - JPN: 0, - 392: 0, - KE: 0, - KEN: 0, - 404: 0, - KH: 0, - KHM: 0, - 116: 0, - KR: 0, - KOR: 0, - 410: 0, - LA: 0, - LA0: 0, - 418: 0, - MH: 0, - MHL: 0, - 584: 0, - MM: 0, - MMR: 0, - 104: 0, - MO: 0, - MAC: 0, - 446: 0, - MT: 0, - MLT: 0, - 470: 0, - MX: 0, - MEX: 0, - 484: 0, - MZ: 0, - MOZ: 0, - 508: 0, - NI: 0, - NIC: 0, - 558: 0, - NP: 0, - NPL: 0, - 524: 0, - NZ: 0, - NZL: 0, - 554: 0, - PA: 0, - PAN: 0, - 591: 0, - PE: 0, - PER: 0, - 604: 0, - PH: 0, - PHL: 0, - 608: 0, - PK: 0, - PAK: 0, - 586: 0, - PR: 0, - PRI: 0, - 630: 0, - PY: 0, - PRY: 0, - 600: 0, - SA: 0, - SAU: 0, - 682: 0, - SG: 0, - SGP: 0, - 702: 0, - SV: 0, - SLV: 0, - 222: 0, - TH: 0, - THA: 0, - 764: 0, - TN: 0, - TUN: 0, - 788: 0, - TT: 0, - TTO: 0, - 780: 0, - TW: 0, - TWN: 0, - 158: 0, - UM: 0, - UMI: 0, - 581: 0, - US: 0, - USA: 0, - 840: 0, - VE: 0, - VEN: 0, - 862: 0, - VI: 0, - VIR: 0, - 850: 0, - WS: 0, - WSM: 0, - 882: 0, - YE: 0, - YEM: 0, - 887: 0, - ZA: 0, - ZAF: 0, - 710: 0, - ZW: 0, - ZWE: 0, - 716: 0, - AE: 6, - ARE: 6, - 784: 6, - AF: 6, - AFG: 6, - 4: 6, - BH: 6, - BHR: 6, - 48: 6, - DJ: 6, - DJI: 6, - 262: 6, - DZ: 6, - DZA: 6, - 12: 6, - EG: 6, - EGY: 6, - 818: 6, - IQ: 6, - IRQ: 6, - 368: 6, - IR: 6, - IRN: 6, - 364: 6, - JO: 6, - JOR: 6, - 400: 6, - KW: 6, - KWT: 6, - 414: 6, - LY: 6, - LBY: 6, - 434: 6, - MA: 6, - MAR: 6, - 504: 6, - OM: 6, - OMN: 6, - 512: 6, - QA: 6, - QAT: 6, - 634: 6, - SD: 6, - SDN: 6, - 729: 6, - SY: 6, - SYR: 6, - 760: 6, - BD: 5, - BGD: 5, - 50: 5, - MV: 5, - MDV: 5, - 462: 5 -}; -var regionDayMap_default = regionDayMap; - -// node_modules/weekstart/dist/es-module/main.js -function getWeekStartByLocale$1(locale2) { - return getWeekStartByLocale(locale2, langRegionMap_default, regionDayMap_default); -} - -// node_modules/@cloudscape-design/components/internal/utils/locale/normalize-start-of-week.js -function normalizeStartOfWeek(startOfWeek2, locale2) { - return typeof startOfWeek2 === "number" ? startOfWeek2 % 7 : getWeekStartByLocale$1(locale2); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/display-format.js -function isoToDisplay(value) { - return value.replace(/-/g, "/"); -} -function displayToIso(value) { - return value.replace(/\//g, "-"); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/is-iso-date-only.js -var dateRegex = /^\d{4}-\d{2}-\d{2}$/; -function isIsoDateOnly(dateString) { - return dateRegex.test(dateString); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-time-offset.js -function formatTimeOffsetISO(isoDate, offsetInMinutes) { - offsetInMinutes = defaultToLocal(isoDate, offsetInMinutes); - const { hours, minutes } = getMinutesAndHours(offsetInMinutes); - const sign2 = offsetInMinutes < 0 ? "-" : "+"; - const formattedOffset = `${sign2}${formatISO2Digits(hours)}:${formatISO2Digits(minutes)}`; - return formattedOffset; -} -function formatTimeOffsetLocalized(isoDate, offsetInMinutes) { - offsetInMinutes = defaultToLocal(isoDate, offsetInMinutes); - if (offsetInMinutes === 0) { - return "(UTC)"; - } - const { hours, minutes } = getMinutesAndHours(offsetInMinutes); - const sign2 = offsetInMinutes < 0 ? "-" : "+"; - const formattedMinutes = minutes === 0 ? "" : `:${minutes}`; - const formattedOffset = `(UTC${sign2}${hours}${formattedMinutes})`; - return formattedOffset; -} -function defaultToLocal(isoDate, offsetInMinutes) { - return offsetInMinutes !== null && offsetInMinutes !== void 0 ? offsetInMinutes : 0 - new Date(isoDate).getTimezoneOffset(); -} -function getMinutesAndHours(minutes) { - return { hours: Math.floor(Math.abs(minutes) / 60), minutes: Math.abs(minutes % 60) }; -} -function formatISO2Digits(n) { - return padLeftZeros(n.toFixed(0), 2); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-date-iso.js -function format_date_iso_default({ date: isoDate, hideTimeOffset, isDateOnly: isDateOnly2, timeOffset }) { - const formattedOffset = hideTimeOffset || isDateOnly2 ? "" : formatTimeOffsetISO(isoDate, timeOffset); - return isoDate + formattedOffset; -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-date-localized.js -function formatDateLocalized({ date: isoDate, hideTimeOffset, isDateOnly: isDateOnly2, timeOffset, locale: locale2 }) { - const date2 = new Date(isoDate); - const formattedDate = new Intl.DateTimeFormat(locale2, { - day: "numeric", - month: "long", - year: "numeric" - }).format(date2); - if (isDateOnly2) { - return formattedDate; - } - const formattedTime = new Intl.DateTimeFormat(locale2, { - hour: "2-digit", - hourCycle: "h23", - minute: "2-digit", - second: "2-digit" - }).format(date2); - const formattedDateTime = formattedDate + getDateTimeSeparator(locale2) + formattedTime; - if (hideTimeOffset) { - return formattedDateTime; - } - const formattedTimeOffset = formatTimeOffsetLocalized(isoDate, timeOffset); - return formattedDateTime + " " + formattedTimeOffset; -} -var languagesWithoutDateTimeSeparator = ["ja", "zh-CN", "zh-TW"]; -function getDateTimeSeparator(locale2) { - return locale2 && languagesWithoutDateTimeSeparator.includes(locale2) ? " " : ", "; -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-date-range.js -function formatDateRange({ startDate, endDate, timeOffset, hideTimeOffset, format: format3, locale: locale2 }) { - const isDateOnly2 = isIsoDateOnly(startDate) && isIsoDateOnly(endDate); - return formatDate({ - date: startDate, - format: format3, - hideTimeOffset, - isDateOnly: isDateOnly2, - timeOffset: timeOffset.startDate, - locale: locale2 - }) + " — " + formatDate({ - date: endDate, - format: format3, - hideTimeOffset, - isDateOnly: isDateOnly2, - timeOffset: timeOffset.endDate, - locale: locale2 - }); -} -function formatDate({ date: date2, format: format3, hideTimeOffset, isDateOnly: isDateOnly2, timeOffset, locale: locale2 }) { - switch (format3) { - case "long-localized": { - return formatDateLocalized({ date: date2, hideTimeOffset, isDateOnly: isDateOnly2, locale: locale2, timeOffset }); - } - default: { - return format_date_iso_default({ date: date2, hideTimeOffset, isDateOnly: isDateOnly2, timeOffset }); - } - } -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-date.js -function formatDate2(value, granularity = "day") { - const year = value.getFullYear(); - const month = padLeftZeros(`${value.getMonth() + 1}`, 2); - if (granularity === "month") { - return `${year}-${month}`; - } - const date2 = padLeftZeros(`${value.getDate()}`, 2); - return `${year}-${month}-${date2}`; -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-time.js -var formatTime = (value) => { - const hours = padLeftZeros(`${value.getHours()}`, 2); - const minutes = padLeftZeros(`${value.getMinutes()}`, 2); - const seconds = padLeftZeros(`${value.getSeconds()}`, 2); - return `${hours}:${minutes}:${seconds}`; -}; - -// node_modules/@cloudscape-design/components/internal/utils/date-time/format-date-time.js -function formatDateTime(date2) { - return formatDate2(date2) + "T" + formatTime(date2); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/join-date-time.js -function normalizeTimeString(timeString) { - const parts = timeString.split(":"); - while (parts.length < 3) { - parts.push("00"); - } - return parts.join(":"); -} -function joinDateTime(dateString, timeString) { - return `${dateString}T${timeString}`; -} -function splitDateTime(dateStr) { - const [date2 = "", time3 = ""] = dateStr.split("T"); - return { date: date2, time: time3 }; -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/parse-date.js -function parseDate(value, strict = false) { - const [yearString, monthString, dayString] = value.split("-"); - const year = Number(yearString); - const month = Number(monthString); - const day = Number(dayString); - if (strict) { - if (isNaN(year) || isNaN(month) || isNaN(day)) { - return null; - } - } - return new Date(year, (month || 1) - 1, day || 1); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/parse-timezone-offset.js -function parseTimezoneOffset(isoDate) { - const [, time3 = ""] = isoDate.split("T"); - const [, signCharacter, offsetPart] = time3.split(/(-|\+)/); - if (signCharacter && offsetPart) { - const [offsetHours, offsetMinutes] = offsetPart.split(":"); - return Number(signCharacter + "1") * (Number(offsetHours) * 60 + Number(offsetMinutes)); - } - const utcTimezoneIndicator = isoDate.indexOf("Z"); - if (utcTimezoneIndicator !== -1) { - return 0; - } - const date2 = new Date(isoDate); - return 0 - date2.getTimezoneOffset(); -} - -// node_modules/@cloudscape-design/components/internal/utils/date-time/shift-timezone-offset.js -function shiftTimezoneOffset(dateString, targetTimezoneOffset) { - const [datePart, timeAndOffsetPart = ""] = dateString.split("T"); - const [timePart] = timeAndOffsetPart.split(/-|\+|Z/); - const valueWithoutOffset = joinDateTime(datePart, timePart); - const originalTimezoneOffset = parseTimezoneOffset(dateString); - const date2 = new Date(valueWithoutOffset); - targetTimezoneOffset = targetTimezoneOffset !== null && targetTimezoneOffset !== void 0 ? targetTimezoneOffset : 0 - date2.getTimezoneOffset(); - const adjustedDate = addMinutes(date2, targetTimezoneOffset - originalTimezoneOffset); - return joinDateTime(formatDate2(adjustedDate), formatTime(adjustedDate)); -} - -// node_modules/@cloudscape-design/components/calendar/utils/navigation.js -function moveNextDay(startDate, isDateEnabled) { - return moveDay(startDate, isDateEnabled, 1); -} -function movePrevDay(startDate, isDateEnabled) { - return moveDay(startDate, isDateEnabled, -1); -} -function moveNextWeek(startDate, isDateEnabled) { - return moveDay(startDate, isDateEnabled, 7); -} -function movePrevWeek(startDate, isDateEnabled) { - return moveDay(startDate, isDateEnabled, -7); -} -function moveNextMonth(startDate, isDateEnabled) { - return moveMonth(startDate, isDateEnabled, 1); -} -function movePrevMonth(startDate, isDateEnabled) { - return moveMonth(startDate, isDateEnabled, -1); -} -function moveMonthDown(startDate, isDateEnabled) { - return moveMonth(startDate, isDateEnabled, 3); -} -function moveMonthUp(startDate, isDateEnabled) { - return moveMonth(startDate, isDateEnabled, -3); -} -function getBaseDay(date2, isDateEnabled) { - return getBaseDate({ date: date2, isDateEnabled, granularity: "day" }); -} -function getBaseMonth(date2, isDateEnabled) { - return getBaseDate({ date: date2, isDateEnabled, granularity: "month" }); -} -function getBaseDate({ date: date2, granularity, isDateEnabled }) { - const isMonthGranularity = granularity === "month"; - const getStartDate = isMonthGranularity ? startOfYear : startOfMonth; - const moveDate2 = isMonthGranularity ? moveMonth : moveDay; - const isSamePage = isMonthGranularity ? isSameYear : isSameMonth; - const startDate = getStartDate(date2); - if (isDateEnabled(startDate)) { - return startDate; - } - const firstEnabledDate = moveDate2(startDate, isDateEnabled, 1); - return isSamePage(startDate, firstEnabledDate) ? firstEnabledDate : startDate; -} -function moveDay(startDate, isDateEnabled, step2) { - return moveDate({ startDate, granularity: "day", isDateEnabled, step: step2 }); -} -function moveMonth(startDate, isDateEnabled, step2) { - return moveDate({ startDate, granularity: "month", isDateEnabled, step: step2 }); -} -function moveDate({ startDate, granularity, isDateEnabled, step: step2 }) { - const isMonthGranularity = granularity === "month"; - const addSteps = isMonthGranularity ? addMonths : addDays; - const limitYears = isMonthGranularity ? 1 : 10; - let current = addSteps(startDate, step2); - while (!isDateEnabled(current)) { - if (Math.abs(differenceInYears(startDate, current)) > limitYears) { - return startDate; - } - current = addSteps(current, step2); - } - return current; -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-date-cache/index.js -var import_react240 = __toESM(require_react()); -function useDateCache() { - const cacheRef = (0, import_react240.useRef)(/* @__PURE__ */ new Map()); - return (date2) => { - const current = cacheRef.current.get(date2.getTime()); - if (current) { - return current; - } - cacheRef.current.set(date2.getTime(), date2); - return date2; - }; -} - -// node_modules/@cloudscape-design/components/calendar/utils/intl.js -function setDayIndex(date2, dayIndex) { - const diff = dayIndex - date2.getDay(); - date2.setDate(date2.getDate() + diff); -} -function renderDayName(locale2, dayIndex, mode) { - const tempDate = /* @__PURE__ */ new Date(); - setDayIndex(tempDate, dayIndex); - return tempDate.toLocaleDateString(locale2, { weekday: mode }); -} -function renderMonthAndYear(locale2, baseDate) { - const result = baseDate.toLocaleDateString(locale2, { - year: "numeric", - month: "long" - }); - return result; -} -function renderYear(locale2, date2) { - return date2.toLocaleDateString(locale2, { - year: "numeric" - }); -} -var dayLabelCache = /* @__PURE__ */ new Map(); -function getDateLabel(locale2, date2, mode = "full") { - const cacheKey = locale2 + date2.getTime() + mode; - const cachedValue = dayLabelCache.get(cacheKey); - if (cachedValue) { - return cachedValue; - } - const value = date2.toLocaleDateString(locale2, { - weekday: mode === "full" ? "long" : void 0, - month: "long", - day: "numeric", - year: "numeric" - }); - dayLabelCache.set(cacheKey, value); - return value; -} -function renderTimeLabel(locale2, date2, format3) { - let options = {}; - if (format3 === "hh") { - options = { hour: "2-digit" }; - } - if (format3 === "hh:mm") { - options = { hour: "2-digit", minute: "2-digit" }; - } - const value = date2.toLocaleTimeString(locale2, options); - return value; -} - -// node_modules/@cloudscape-design/components/calendar/use-calendar-labels.js -function useCalendarLabels({ granularity, locale: locale2, i18nStrings, previousMonthAriaLabel, nextMonthAriaLabel, todayAriaLabel }) { - var _a2, _b, _c; - const i18n = useInternalI18n("calendar"); - const isMonthPicker = granularity === "month"; - const previousButtonLabel = isMonthPicker ? i18n("i18nStrings.previousYearAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousYearAriaLabel) : i18n("previousMonthAriaLabel", (_a2 = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel) !== null && _a2 !== void 0 ? _a2 : previousMonthAriaLabel); - const nextButtonLabel = isMonthPicker ? i18n("i18nStrings.nextYearAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextYearAriaLabel) : i18n("nextMonthAriaLabel", (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel) !== null && _b !== void 0 ? _b : nextMonthAriaLabel); - const currentDateLabel = isMonthPicker ? i18n("i18nStrings.currentMonthAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.currentMonthAriaLabel) : i18n("todayAriaLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel) !== null && _c !== void 0 ? _c : todayAriaLabel); - const renderDate = (date2) => isMonthPicker ? date2.toLocaleString(locale2, { month: "short" }) : date2.getDate().toString(); - const renderDateAnnouncement = (date2, isCurrentDate) => { - const formattedDate = isMonthPicker ? renderMonthAndYear(locale2, date2) : getDateLabel(locale2, date2, "short"); - if (isCurrentDate && currentDateLabel) { - return formattedDate + ". " + currentDateLabel; - } - return formattedDate; - }; - const renderHeaderText = (date2) => isMonthPicker ? date2.getFullYear().toString() : renderMonthAndYear(locale2, date2); - return { - previousButtonLabel, - nextButtonLabel, - renderDate, - renderDateAnnouncement, - renderHeaderText - }; -} - -// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-rows.js -var import_react241 = __toESM(require_react()); - -// node_modules/mnth/web/add-days.js -var addDays2 = function addDays3(date2, days) { - var result = new Date(date2); - result.setDate(result.getDate() + days); - return result; -}; - -// node_modules/mnth/web/set-date.js -var setDate2 = function setDate3(date2, day) { - var result = new Date(date2); - result.setDate(day); - return result; -}; - -// node_modules/mnth/web/index.js -function ownKeys(object2, enumerableOnly) { - var keys = Object.keys(object2); - if (Object.getOwnPropertySymbols) { - var symbols2 = Object.getOwnPropertySymbols(object2); - if (enumerableOnly) symbols2 = symbols2.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object2, sym).enumerable; - }); - keys.push.apply(keys, symbols2); - } - return keys; -} -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function(key2) { - _defineProperty(target, key2, source[key2]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function(key2) { - Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); - }); - } - } - return target; -} -var DAYS_IN_WEEK = 7; -var getCalendarMonth = function getCalendarMonth2(date2, options) { - var _firstDayOfWeek$optio = _objectSpread({ - firstDayOfWeek: 1 - }, options), firstDayOfWeek = _firstDayOfWeek$optio.firstDayOfWeek; - var firstDateOfMonth = new Date(date2.getFullYear(), date2.getMonth(), 1); - var lastDateOfMonth = new Date(date2.getFullYear(), date2.getMonth() + 1, 0); - var firstWeekdayOfMonth = firstDateOfMonth.getDay(); - var lastWeekdayOfMonth = lastDateOfMonth.getDay(); - var daysInMonth = lastDateOfMonth.getDate(); - var daysToPrepend = (firstWeekdayOfMonth - firstDayOfWeek + DAYS_IN_WEEK) % DAYS_IN_WEEK; - var daysToAppend = (DAYS_IN_WEEK - 1 - lastWeekdayOfMonth + firstDayOfWeek) % DAYS_IN_WEEK; - var month = []; - var week = []; - for (var i = 1 - daysToPrepend; i <= daysInMonth + daysToAppend + 1; i++) { - if (i <= 0) { - week.push(addDays2(firstDateOfMonth, i - 1)); - } else if (i > daysInMonth) { - week.push(addDays2(lastDateOfMonth, i - daysInMonth)); - } else { - week.push(setDate2(date2, i)); - } - if (week.length === 7) { - month.push(week); - week = []; - } - } - return month; -}; - -// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-rows.js -function useCalendarGridRows({ baseDate, granularity, locale: locale2, startOfWeek: startOfWeek2 }) { - const isMonthPicker = granularity === "month"; - const rows = (0, import_react241.useMemo)(() => isMonthPicker ? getCalendarYear(baseDate) : getCalendarMonth(baseDate, { firstDayOfWeek: normalizeStartOfWeek(startOfWeek2, locale2) }), [baseDate, isMonthPicker, startOfWeek2, locale2]); - return rows; -} -function getCalendarYear(date2) { - const year = date2.getFullYear(); - return new Array(4).fill(0).map((_, i) => new Array(3).fill(0).map((_2, j) => new Date(year, i * 3 + j))); -} - -// node_modules/@cloudscape-design/components/internal/utils/handle-key.js -function handleKey(event, { onActivate, onBlockEnd, onBlockStart, onEnd, onHome, onInlineEnd, onInlineStart, onPageDown, onPageUp }) { - switch (event.keyCode) { - case KeyCode.down: - onBlockEnd === null || onBlockEnd === void 0 ? void 0 : onBlockEnd(); - break; - case KeyCode.end: - onEnd === null || onEnd === void 0 ? void 0 : onEnd(); - break; - case KeyCode.enter: - case KeyCode.space: - onActivate === null || onActivate === void 0 ? void 0 : onActivate(); - break; - case KeyCode.home: - onHome === null || onHome === void 0 ? void 0 : onHome(); - break; - case KeyCode.left: - isRtl(event.currentTarget) ? onInlineEnd === null || onInlineEnd === void 0 ? void 0 : onInlineEnd() : onInlineStart === null || onInlineStart === void 0 ? void 0 : onInlineStart(); - break; - case KeyCode.pageDown: - onPageDown === null || onPageDown === void 0 ? void 0 : onPageDown(); - break; - case KeyCode.pageUp: - onPageUp === null || onPageUp === void 0 ? void 0 : onPageUp(); - break; - case KeyCode.right: - isRtl(event.currentTarget) ? onInlineStart === null || onInlineStart === void 0 ? void 0 : onInlineStart() : onInlineEnd === null || onInlineEnd === void 0 ? void 0 : onInlineEnd(); - break; - case KeyCode.up: - onBlockStart === null || onBlockStart === void 0 ? void 0 : onBlockStart(); - break; - } -} - -// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-keyboard-navigation.js -function useCalendarGridKeyboardNavigation({ baseDate, focusableDate, granularity, isDateEnabled, onChangePage, onFocusDate, onSelectDate }) { - const isMonthPicker = granularity === "month"; - const moveDown = isMonthPicker ? moveMonthDown : moveNextWeek; - const moveLeft = isMonthPicker ? movePrevMonth : movePrevDay; - const moveRight = isMonthPicker ? moveNextMonth : moveNextDay; - const moveUp = isMonthPicker ? moveMonthUp : movePrevWeek; - const isSamePage = isMonthPicker ? isSameYear : isSameMonth; - const onGridKeyDownHandler = (event) => { - let updatedFocusDate; - const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter]; - if (focusableDate === null || keys.indexOf(event.keyCode) === -1) { - return; - } - event.preventDefault(); - handleKey(event, { - onActivate: () => { - onFocusDate(null); - onSelectDate(focusableDate); - }, - onBlockEnd: () => updatedFocusDate = moveDown(focusableDate, isDateEnabled), - onBlockStart: () => updatedFocusDate = moveUp(focusableDate, isDateEnabled), - onInlineStart: () => updatedFocusDate = moveLeft(focusableDate, isDateEnabled), - onInlineEnd: () => updatedFocusDate = moveRight(focusableDate, isDateEnabled) - }); - if (!updatedFocusDate) { - return; - } - if (!isSamePage(updatedFocusDate, baseDate)) { - onChangePage(updatedFocusDate); - } - onFocusDate(updatedFocusDate); - }; - return onGridKeyDownHandler; -} - -// node_modules/@cloudscape-design/components/calendar/grid/calendar-grid-header.js -var import_react242 = __toESM(require_react()); -function CalendarGridHeader({ locale: locale2, rows }) { - return import_react242.default.createElement( - "thead", - null, - import_react242.default.createElement("tr", null, rows[0].map((date2) => date2.getDay()).map((dayIndex) => import_react242.default.createElement( - "th", - { key: dayIndex, scope: "col", className: clsx_m_default(styles_css_default70["calendar-grid-cell"], styles_css_default70["calendar-date-header"]) }, - import_react242.default.createElement("span", { "aria-hidden": "true" }, renderDayName(locale2, dayIndex, "short")), - import_react242.default.createElement(ScreenreaderOnly, null, renderDayName(locale2, dayIndex, "long")) - ))) - ); -} - -// node_modules/@cloudscape-design/components/calendar/internal.js -function Calendar(_a2) { - var { value, locale: locale2 = "", startOfWeek: startOfWeek2, isDateEnabled = () => true, ariaLabel, ariaLabelledby, ariaDescribedby, onChange, __internalRootRef, i18nStrings, granularity = "day", previousMonthAriaLabel, nextMonthAriaLabel, todayAriaLabel } = _a2, rest = __rest(_a2, ["value", "locale", "startOfWeek", "isDateEnabled", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "onChange", "__internalRootRef", "i18nStrings", "granularity", "previousMonthAriaLabel", "nextMonthAriaLabel", "todayAriaLabel"]); - checkControlled("Calendar", "value", value, "onChange", onChange); - const baseProps = getBaseProps(rest); - const normalizedLocale = normalizeLocale("Calendar", locale2); - const gridWrapperRef = (0, import_react243.useRef)(null); - const [focusedDate, setFocusedDate] = (0, import_react243.useState)(null); - const valueDateCache = useDateCache(); - const focusedDateCache = useDateCache(); - const parsedValue = value && value.length >= 4 ? parseDate(value) : null; - const memoizedValue = parsedValue ? valueDateCache(parsedValue) : null; - const defaultDisplayedDate = memoizedValue !== null && memoizedValue !== void 0 ? memoizedValue : /* @__PURE__ */ new Date(); - const [displayedDate, setDisplayedDate] = (0, import_react243.useState)(defaultDisplayedDate); - const headingId = useUniqueId("calendar-heading"); - const isMonthPicker = granularity === "month"; - const baseDate = isMonthPicker ? getBaseMonth(displayedDate, isDateEnabled) : getBaseDay(displayedDate, isDateEnabled); - const isSameDate = isMonthPicker ? isSameMonth : isSameDay; - const isSamePage = isMonthPicker ? isSameYear : isSameMonth; - const isCurrentPage = (date2) => isMonthPicker || isSameMonth(date2, baseDate); - const { previousButtonLabel, nextButtonLabel, renderDate, renderDateAnnouncement, renderHeaderText } = useCalendarLabels({ - granularity, - i18nStrings, - locale: normalizedLocale, - previousMonthAriaLabel, - nextMonthAriaLabel, - todayAriaLabel - }); - const gridRows = useCalendarGridRows({ baseDate, granularity, startOfWeek: startOfWeek2, locale: normalizedLocale }); - (0, import_react243.useEffect)(() => { - memoizedValue && setDisplayedDate((prev) => prev.getTime() !== memoizedValue.getTime() ? memoizedValue : prev); - }, [memoizedValue]); - const selectFocusedDate = (selected, baseDate2) => { - if (selected && isDateEnabled(selected) && isSamePage(selected, baseDate2)) { - return selected; - } - const today = /* @__PURE__ */ new Date(); - if (isDateEnabled(today) && isSamePage(today, baseDate2)) { - return today; - } - if (isDateEnabled(baseDate2)) { - return baseDate2; - } - return null; - }; - const focusableDate = focusedDate || selectFocusedDate(memoizedValue, baseDate); - const onHeaderChangePageHandler = (amount) => { - const movePage = isMonthPicker ? addYears : addMonths; - const newDate2 = movePage(baseDate, amount); - onChangePageHandler(newDate2); - }; - const onChangePageHandler = (newDate2) => { - setDisplayedDate(newDate2); - setFocusedDate(null); - }; - const onGridFocusDateHandler = (date2) => { - if (date2) { - setFocusedDate(date2 ? focusedDateCache(date2) : null); - } - }; - const onGridSelectDateHandler = (date2) => { - fireNonCancelableEvent(onChange, { value: formatDate2(date2, granularity) }); - setFocusedDate(null); - }; - const onGridBlur = (event) => { - var _a3; - const newFocusTargetIsInGrid = event.relatedTarget && ((_a3 = gridWrapperRef.current) === null || _a3 === void 0 ? void 0 : _a3.contains(event.relatedTarget)); - if (!newFocusTargetIsInGrid) { - setFocusedDate(null); - } - }; - const onGridKeyDownHandler = useCalendarGridKeyboardNavigation({ - baseDate, - focusableDate, - granularity, - isDateEnabled, - onChangePage: onChangePageHandler, - onFocusDate: onGridFocusDateHandler, - onSelectDate: onGridSelectDateHandler - }); - const headerText = renderHeaderText(baseDate); - return import_react243.default.createElement( - "div", - Object.assign({ ref: __internalRootRef }, baseProps, { role: "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: clsx_m_default(styles_css_default70.root, styles_css_default70.calendar, baseProps.className) }), - import_react243.default.createElement( - "div", - { className: styles_css_default70["calendar-inner"] }, - import_react243.default.createElement(header_default, { formattedDate: headerText, onChange: onHeaderChangePageHandler, previousLabel: previousButtonLabel, nextLabel: nextButtonLabel, headingId }), - import_react243.default.createElement( - "div", - { onBlur: onGridBlur, ref: gridWrapperRef }, - import_react243.default.createElement(Grid, { isDateEnabled, focusedDate, focusableDate, onSelectDate: onGridSelectDateHandler, onFocusDate: onGridFocusDateHandler, onChangePage: onChangePageHandler, selectedDate: memoizedValue, ariaLabelledby: headingId, header: isMonthPicker ? null : import_react243.default.createElement(CalendarGridHeader, { locale: normalizedLocale, rows: gridRows }), rows: gridRows, isCurrentPage, renderDate, renderDateAnnouncement, isSameDate, onGridKeyDownHandler }) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/calendar/index.js -function Calendar2(_a2) { - var { locale: locale2 = "", isDateEnabled = () => true, granularity = "day" } = _a2, props2 = __rest(_a2, ["locale", "isDateEnabled", "granularity"]); - const baseComponentProps = useBaseComponent("Calendar"); - return import_react244.default.createElement(Calendar, Object.assign({}, props2, baseComponentProps, { locale: locale2, isDateEnabled, granularity })); -} -applyDisplayName(Calendar2, "Calendar"); - -// node_modules/@cloudscape-design/components/cards/index.js -var import_react252 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/cards/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/cards/styles.scoped.css"; -var styles_css_default71 = { - "card-inner": "awsui_card-inner_p8a6i_6eu0b_103", - "root": "awsui_root_p8a6i_6eu0b_139", - "header-variant-full-page": "awsui_header-variant-full-page_p8a6i_6eu0b_181", - "header-refresh": "awsui_header-refresh_p8a6i_6eu0b_181", - "list": "awsui_list_p8a6i_6eu0b_190", - "list-grid-1": "awsui_list-grid-1_p8a6i_6eu0b_201", - "card": "awsui_card_p8a6i_6eu0b_103", - "list-grid-2": "awsui_list-grid-2_p8a6i_6eu0b_204", - "list-grid-3": "awsui_list-grid-3_p8a6i_6eu0b_207", - "list-grid-4": "awsui_list-grid-4_p8a6i_6eu0b_210", - "list-grid-5": "awsui_list-grid-5_p8a6i_6eu0b_213", - "list-grid-6": "awsui_list-grid-6_p8a6i_6eu0b_216", - "list-grid-7": "awsui_list-grid-7_p8a6i_6eu0b_219", - "list-grid-8": "awsui_list-grid-8_p8a6i_6eu0b_222", - "list-grid-9": "awsui_list-grid-9_p8a6i_6eu0b_225", - "list-grid-10": "awsui_list-grid-10_p8a6i_6eu0b_228", - "list-grid-11": "awsui_list-grid-11_p8a6i_6eu0b_231", - "list-grid-12": "awsui_list-grid-12_p8a6i_6eu0b_234", - "list-grid-13": "awsui_list-grid-13_p8a6i_6eu0b_237", - "list-grid-14": "awsui_list-grid-14_p8a6i_6eu0b_240", - "list-grid-15": "awsui_list-grid-15_p8a6i_6eu0b_243", - "list-grid-16": "awsui_list-grid-16_p8a6i_6eu0b_246", - "list-grid-17": "awsui_list-grid-17_p8a6i_6eu0b_249", - "list-grid-18": "awsui_list-grid-18_p8a6i_6eu0b_252", - "list-grid-19": "awsui_list-grid-19_p8a6i_6eu0b_255", - "list-grid-20": "awsui_list-grid-20_p8a6i_6eu0b_258", - "selection-control": "awsui_selection-control_p8a6i_6eu0b_262", - "loading": "awsui_loading_p8a6i_6eu0b_272", - "empty": "awsui_empty_p8a6i_6eu0b_273", - "has-header": "awsui_has-header_p8a6i_6eu0b_280", - "refresh": "awsui_refresh_p8a6i_6eu0b_283", - "remove-high-contrast-header": "awsui_remove-high-contrast-header_p8a6i_6eu0b_283", - "card-header": "awsui_card-header_p8a6i_6eu0b_354", - "card-header-inner": "awsui_card-header-inner_p8a6i_6eu0b_362", - "card-selectable": "awsui_card-selectable_p8a6i_6eu0b_366", - "card-selected": "awsui_card-selected_p8a6i_6eu0b_369", - "section": "awsui_section_p8a6i_6eu0b_377", - "section-header": "awsui_section-header_p8a6i_6eu0b_385", - "section-content": "awsui_section-content_p8a6i_6eu0b_391", - "footer-pagination": "awsui_footer-pagination_p8a6i_6eu0b_401" -}; - -// node_modules/@cloudscape-design/components/cards/cards-layout-helper.js -var WIDTHS = [1920, 1400, 1200, 992, 768]; -var defaultCardsPerRow = WIDTHS.map((value, index, widths) => ({ - minWidth: value, - cards: widths.length + 1 - index -})); -var getCardsPerRow = (width, config) => { - if (config.length === 0) { - config = defaultCardsPerRow; - } - let cardsPerRow = 1; - const sortedConfig = config.slice().map((value) => ({ - minWidth: value.minWidth || 0, - cards: value.cards - })).sort((a2, b) => b.minWidth - a2.minWidth); - sortedConfig.some((layout) => { - if (width >= layout.minWidth) { - cardsPerRow = layout.cards; - return true; - } - }); - return cardsPerRow; -}; - -// node_modules/@cloudscape-design/components/table/tools-header.js -var import_react245 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/styles.scoped.css"; -var styles_css_default72 = { - "root": "awsui_root_wih1l_qzfuf_103", - "tools": "awsui_tools_wih1l_qzfuf_114", - "tools-filtering": "awsui_tools-filtering_wih1l_qzfuf_122", - "tools-align-right": "awsui_tools-align-right_wih1l_qzfuf_136", - "tools-pagination": "awsui_tools-pagination_wih1l_qzfuf_140", - "tools-preferences": "awsui_tools-preferences_wih1l_qzfuf_140", - "tools-small": "awsui_tools-small_wih1l_qzfuf_146", - "table": "awsui_table_wih1l_qzfuf_152", - "table-layout-fixed": "awsui_table-layout-fixed_wih1l_qzfuf_158", - "wrapper": "awsui_wrapper_wih1l_qzfuf_162", - "variant-stacked": "awsui_variant-stacked_wih1l_qzfuf_169", - "wrapper-content-measure": "awsui_wrapper-content-measure_wih1l_qzfuf_169", - "variant-container": "awsui_variant-container_wih1l_qzfuf_169", - "has-footer": "awsui_has-footer_wih1l_qzfuf_172", - "has-header": "awsui_has-header_wih1l_qzfuf_175", - "cell-merged": "awsui_cell-merged_wih1l_qzfuf_192", - "cell-merged-content": "awsui_cell-merged-content_wih1l_qzfuf_204", - "empty": "awsui_empty_wih1l_qzfuf_222", - "loading": "awsui_loading_wih1l_qzfuf_226", - "selection-control": "awsui_selection-control_wih1l_qzfuf_235", - "selection-control-header": "awsui_selection-control-header_wih1l_qzfuf_242", - "dark-header": "awsui_dark-header_wih1l_qzfuf_252", - "header-secondary": "awsui_header-secondary_wih1l_qzfuf_257", - "table-has-header": "awsui_table-has-header_wih1l_qzfuf_275", - "header-controls": "awsui_header-controls_wih1l_qzfuf_279", - "variant-full-page": "awsui_variant-full-page_wih1l_qzfuf_282", - "variant-embedded": "awsui_variant-embedded_wih1l_qzfuf_288", - "variant-borderless": "awsui_variant-borderless_wih1l_qzfuf_288", - "footer-wrapper": "awsui_footer-wrapper_wih1l_qzfuf_293", - "footer": "awsui_footer_wih1l_qzfuf_293", - "footer-with-pagination": "awsui_footer-with-pagination_wih1l_qzfuf_301", - "footer-pagination": "awsui_footer-pagination_wih1l_qzfuf_309", - "thead-active": "awsui_thead-active_wih1l_qzfuf_313", - "row": "awsui_row_wih1l_qzfuf_314", - "row-selected": "awsui_row-selected_wih1l_qzfuf_315" -}; - -// node_modules/@cloudscape-design/components/table/tools-header.js -function ToolsHeader({ header, filter, pagination, preferences }) { - const [breakpoint, ref] = useContainerBreakpoints(["xs"]); - const isHeaderString = typeof header === "string"; - const assignHeaderId = (0, import_react245.useContext)(CollectionLabelContext).assignId; - const headingId = useUniqueId("heading"); - if (assignHeaderId !== void 0 && isHeaderString) { - assignHeaderId(headingId); - } - const isSmall = breakpoint === "default"; - const hasTools = filter || pagination || preferences; - return import_react245.default.createElement( - import_react245.default.Fragment, - null, - isHeaderString ? import_react245.default.createElement("span", { id: headingId }, header) : header, - hasTools && import_react245.default.createElement( - "div", - { ref, className: clsx_m_default(styles_css_default72.tools, isSmall && styles_css_default72["tools-small"]) }, - filter && import_react245.default.createElement("div", { className: styles_css_default72["tools-filtering"] }, filter), - import_react245.default.createElement( - "div", - { className: styles_css_default72["tools-align-right"] }, - pagination && import_react245.default.createElement("div", { className: styles_css_default72["tools-pagination"] }, pagination), - preferences && import_react245.default.createElement("div", { className: styles_css_default72["tools-preferences"] }, preferences) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/table/utils.js -var applyTrackBy = (trackBy, item) => { - if (typeof trackBy === "function") { - return trackBy(item); - } - return item[trackBy]; -}; -var getItemKey = (trackBy, item, index) => { - if (!trackBy) { - return index; - } - return applyTrackBy(trackBy, item); -}; -var getTrackableValue = (trackBy, item) => { - if (!trackBy) { - return item; - } - return applyTrackBy(trackBy, item); -}; -var getColumnKey = (column, index) => { - return column.id || index; -}; -var toContainerVariant = (variant) => { - const isDefaultVariant = !variant || variant === "container"; - return isDefaultVariant ? "default" : variant === "borderless" ? "embedded" : variant; -}; -function checkSortingState(columnDefinitions, sortingComparator) { - const matchedColumn = columnDefinitions.filter((column) => column.sortingComparator === sortingComparator)[0]; - if (!matchedColumn) { - warnOnce("Table", "Currently active sorting comparator was not found in any columns. Make sure to provide the same comparator function instance on each render."); - } -} -function getVisibleColumnDefinitions({ columnDisplay, visibleColumns, columnDefinitions }) { - if (columnDisplay) { - return getVisibleColumnDefinitionsFromColumnDisplay({ columnDisplay, columnDefinitions }); - } else if (visibleColumns) { - return getVisibleColumnDefinitionsFromVisibleColumns({ visibleColumns, columnDefinitions }); - } else { - return columnDefinitions; - } -} -function getVisibleColumnDefinitionsFromColumnDisplay({ columnDisplay, columnDefinitions }) { - const columnDefinitionsById = columnDefinitions.reduce((accumulator, item) => item.id === void 0 ? accumulator : Object.assign(Object.assign({}, accumulator), { [item.id]: item }), {}); - return columnDisplay.filter((item) => item.visible).map((item) => columnDefinitionsById[item.id]).filter(Boolean); -} -function getVisibleColumnDefinitionsFromVisibleColumns({ visibleColumns, columnDefinitions }) { - const ids2 = new Set(visibleColumns); - return columnDefinitions.filter(({ id }) => id !== void 0 && ids2.has(id)); -} -function getStickyClassNames(styles, props2) { - return { - [styles["sticky-cell"]]: !!props2, - [styles["sticky-cell-pad-left"]]: !!(props2 === null || props2 === void 0 ? void 0 : props2.padLeft), - [styles["sticky-cell-last-left"]]: !!(props2 === null || props2 === void 0 ? void 0 : props2.lastLeft), - [styles["sticky-cell-last-right"]]: !!(props2 === null || props2 === void 0 ? void 0 : props2.lastRight) - }; -} - -// node_modules/@cloudscape-design/components/table/selection/selection-control.js -var import_react249 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/checkbox/internal.js -var import_react247 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/abstract-switch/index.js -var import_react246 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/abstract-switch/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/abstract-switch/styles.scoped.css"; -var styles_css_default73 = { - "content": "awsui_content_1wepg_11g7b_99", - "description": "awsui_description_1wepg_11g7b_100", - "label": "awsui_label_1wepg_11g7b_101", - "outline": "awsui_outline_1wepg_11g7b_109", - "show-outline": "awsui_show-outline_1wepg_11g7b_112", - "native-input": "awsui_native-input_1wepg_11g7b_116", - "wrapper": "awsui_wrapper_1wepg_11g7b_120", - "label-wrapper": "awsui_label-wrapper_1wepg_11g7b_126", - "empty-content": "awsui_empty-content_1wepg_11g7b_137", - "description-bottom-padding": "awsui_description-bottom-padding_1wepg_11g7b_147", - "label-disabled": "awsui_label-disabled_1wepg_11g7b_155", - "description-disabled": "awsui_description-disabled_1wepg_11g7b_156", - "control": "awsui_control_1wepg_11g7b_161" -}; - -// node_modules/@cloudscape-design/components/internal/components/abstract-switch/index.js -function joinString(values2) { - return values2.filter((value) => !!value).join(" "); -} -function AbstractSwitch(_a2) { - var { controlId, controlClassName, outlineClassName, showOutline: showOutline2, disabled, nativeControl, styledControl, label, description, descriptionBottomPadding, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onClick, __internalRootRef } = _a2, rest = __rest(_a2, ["controlId", "controlClassName", "outlineClassName", "showOutline", "disabled", "nativeControl", "styledControl", "label", "description", "descriptionBottomPadding", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaControls", "onClick", "__internalRootRef"]); - const uniqueId = useUniqueId(); - const id = controlId || uniqueId; - const labelId = `${id}-label`; - const descriptionId = `${id}-description`; - const ariaLabelledByIds = []; - if (label && !ariaLabel) { - ariaLabelledByIds.push(labelId); - } - if (ariaLabelledby) { - ariaLabelledByIds.push(ariaLabelledby); - } - const ariaDescriptions = []; - if (ariaDescribedby) { - ariaDescriptions.push(ariaDescribedby); - } - if (description) { - ariaDescriptions.push(descriptionId); - } - return import_react246.default.createElement( - "span", - Object.assign({}, rest, { className: clsx_m_default(styles_css_default73.wrapper, rest.className), ref: __internalRootRef }), - import_react246.default.createElement( - "span", - { className: styles_css_default73["label-wrapper"], "aria-disabled": disabled ? "true" : void 0, onClick: disabled ? void 0 : onClick }, - import_react246.default.createElement( - "span", - { className: clsx_m_default(styles_css_default73.control, controlClassName) }, - styledControl, - nativeControl({ - id, - disabled, - className: styles_css_default73["native-input"], - "aria-describedby": ariaDescriptions.length ? joinString(ariaDescriptions) : void 0, - "aria-labelledby": ariaLabelledByIds.length ? joinString(ariaLabelledByIds) : void 0, - "aria-label": ariaLabel, - "aria-controls": ariaControls - }), - import_react246.default.createElement("span", { className: clsx_m_default(styles_css_default73.outline, outlineClassName, showOutline2 && styles_css_default73["show-outline"]) }) - ), - import_react246.default.createElement( - "span", - { className: clsx_m_default(styles_css_default73.content, !label && !description && styles_css_default73["empty-content"]) }, - label && import_react246.default.createElement("span", { id: labelId, className: clsx_m_default(styles_css_default73.label, { [styles_css_default73["label-disabled"]]: disabled }) }, label), - description && import_react246.default.createElement("span", { id: descriptionId, className: clsx_m_default(styles_css_default73.description, { - [styles_css_default73["description-disabled"]]: disabled, - [styles_css_default73["description-bottom-padding"]]: descriptionBottomPadding - }) }, description) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/checkbox/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/checkbox/styles.scoped.css"; -var styles_css_default74 = { - "root": "awsui_root_k2y2q_16s24_99", - "checkbox-control": "awsui_checkbox-control_k2y2q_16s24_135", - "outline": "awsui_outline_k2y2q_16s24_143" -}; - -// node_modules/@cloudscape-design/components/checkbox/internal.js -var InternalCheckbox = import_react247.default.forwardRef((_a2, ref) => { - var { controlId, name, checked, disabled, ariaRequired, indeterminate, children: children2, description, ariaLabel, onFocus, onBlur, onChange, tabIndex: explicitTabIndex, showOutline: showOutline2, ariaControls, __internalRootRef } = _a2, rest = __rest(_a2, ["controlId", "name", "checked", "disabled", "ariaRequired", "indeterminate", "children", "description", "ariaLabel", "onFocus", "onBlur", "onChange", "tabIndex", "showOutline", "ariaControls", "__internalRootRef"]); - const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest); - const baseProps = getBaseProps(rest); - const checkboxRef = (0, import_react247.useRef)(null); - useForwardFocus(ref, checkboxRef); - (0, import_react247.useEffect)(() => { - if (checkboxRef.current) { - checkboxRef.current.indeterminate = Boolean(indeterminate); - } - }); - const { tabIndex } = useSingleTabStopNavigation(checkboxRef, { tabIndex: explicitTabIndex }); - return import_react247.default.createElement(AbstractSwitch, Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default74.root, baseProps.className), controlClassName: styles_css_default74["checkbox-control"], outlineClassName: styles_css_default74.outline, controlId, disabled, label: children2, description, descriptionBottomPadding: true, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, showOutline: showOutline2, nativeControl: (nativeControlProps) => import_react247.default.createElement("input", Object.assign({}, nativeControlProps, { - ref: checkboxRef, - type: "checkbox", - checked, - name, - "aria-required": ariaRequired ? "true" : void 0, - tabIndex, - onFocus: () => fireNonCancelableEvent(onFocus), - onBlur: () => fireNonCancelableEvent(onBlur), - // empty handler to suppress React controllability warning - onChange: () => { - } - })), onClick: () => { - var _a3; - (_a3 = checkboxRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - fireNonCancelableEvent( - onChange, - // for deterministic transitions "indeterminate" -> "checked" -> "unchecked" - indeterminate ? { checked: true, indeterminate: false } : { checked: !checked, indeterminate: false } - ); - }, styledControl: import_react247.default.createElement(checkbox_icon_default, { checked, indeterminate, disabled }), __internalRootRef })); -}); -var internal_default11 = InternalCheckbox; - -// node_modules/@cloudscape-design/components/radio-group/radio-button.js -var import_react248 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/radio-group/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/radio-group/styles.scoped.css"; -var styles_css_default75 = { - "root": "awsui_root_1mabk_kpa3a_99", - "radio": "awsui_radio_1mabk_kpa3a_135", - "radio--has-description": "awsui_radio--has-description_1mabk_kpa3a_143", - "radio-control": "awsui_radio-control_1mabk_kpa3a_147", - "outline": "awsui_outline_1mabk_kpa3a_155", - "styled-circle-border": "awsui_styled-circle-border_1mabk_kpa3a_177", - "styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_kpa3a_181", - "styled-circle-fill": "awsui_styled-circle-fill_1mabk_kpa3a_186", - "styled-circle-checked": "awsui_styled-circle-checked_1mabk_kpa3a_192" -}; - -// node_modules/@cloudscape-design/components/radio-group/radio-button.js -var radio_button_default = import_react248.default.forwardRef(function RadioButton({ name, label, value, checked, description, disabled, controlId, onChange }, ref) { - const isVisualRefresh = useVisualRefresh(); - const radioButtonRef = (0, import_react248.useRef)(null); - const mergedRefs = useMergeRefs(radioButtonRef, ref); - const { tabIndex } = useSingleTabStopNavigation(radioButtonRef); - return import_react248.default.createElement(AbstractSwitch, { className: clsx_m_default(styles_css_default75.radio, description && styles_css_default75["radio--has-description"]), controlClassName: styles_css_default75["radio-control"], outlineClassName: styles_css_default75.outline, label, description, disabled, controlId, nativeControl: (nativeControlProps) => import_react248.default.createElement("input", Object.assign({}, nativeControlProps, { - tabIndex, - type: "radio", - ref: mergedRefs, - name, - value, - checked, - // empty handler to suppress React controllability warning - onChange: () => { - } - })), onClick: () => { - var _a2; - (_a2 = radioButtonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - if (checked) { - return; - } - fireNonCancelableEvent(onChange, { value }); - }, styledControl: import_react248.default.createElement( - "svg", - { viewBox: "0 0 100 100", focusable: "false", "aria-hidden": "true" }, - import_react248.default.createElement("circle", { className: clsx_m_default(styles_css_default75["styled-circle-border"], { [styles_css_default75["styled-circle-disabled"]]: disabled }), strokeWidth: isVisualRefresh ? 12 : 8, cx: 50, cy: 50, r: isVisualRefresh ? 44 : 46 }), - import_react248.default.createElement("circle", { className: clsx_m_default(styles_css_default75["styled-circle-fill"], { - [styles_css_default75["styled-circle-disabled"]]: disabled, - [styles_css_default75["styled-circle-checked"]]: checked - }), strokeWidth: 30, cx: 50, cy: 50, r: 35 }) - ) }); -}); - -// node_modules/@cloudscape-design/components/table/selection/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/selection/styles.scoped.css"; -var styles_css_default76 = { - "root": "awsui_root_1s55x_d36ci_99", - "label": "awsui_label_1s55x_d36ci_103", - "stud": "awsui_stud_1s55x_d36ci_117" -}; - -// node_modules/@cloudscape-design/components/table/selection/selection-control.js -function SelectionControl(_a2) { - var { selectionType, indeterminate = false, onShiftToggle, onFocusUp, onFocusDown, name, ariaLabel, focusedComponent } = _a2, sharedProps = __rest(_a2, ["selectionType", "indeterminate", "onShiftToggle", "onFocusUp", "onFocusDown", "name", "ariaLabel", "focusedComponent"]); - const controlId = useUniqueId(); - const isMultiSelection = selectionType === "multi"; - const { navigationActive } = (0, import_react249.useContext)(SingleTabStopNavigationContext); - const setShiftState = (event) => { - if (isMultiSelection) { - onShiftToggle && onShiftToggle(event.shiftKey); - } - }; - const onMouseDownHandler = (event) => { - setShiftState(event); - if (isMultiSelection) { - event.preventDefault(); - } - }; - const handleKeyDown = (event) => { - setShiftState(event); - if (isMultiSelection && !navigationActive) { - if (event.keyCode === KeyCode.up) { - event.preventDefault(); - onFocusUp && onFocusUp(event); - } - if (event.keyCode === KeyCode.down) { - event.preventDefault(); - onFocusDown && onFocusDown(event); - } - } - }; - const handleClick = (event) => { - const target = event.currentTarget; - const nativeInput = target.tagName === "INPUT" ? target : target.querySelector("input"); - nativeInput === null || nativeInput === void 0 ? void 0 : nativeInput.focus(); - }; - const selector = isMultiSelection ? import_react249.default.createElement(internal_default11, Object.assign({}, sharedProps, { showOutline: focusedComponent === "selection-control", controlId, "data-focus-id": "selection-control", indeterminate })) : import_react249.default.createElement(radio_button_default, Object.assign({}, sharedProps, { controlId, name, value: "", label: "" })); - return import_react249.default.createElement( - import_react249.default.Fragment, - null, - import_react249.default.createElement("label", { onKeyDown: handleKeyDown, onKeyUp: setShiftState, onMouseDown: onMouseDownHandler, onMouseUp: setShiftState, onClick: handleClick, htmlFor: controlId, className: clsx_m_default(styles_css_default76.label, styles_css_default76.root), "aria-label": ariaLabel, title: ariaLabel }, selector), - import_react249.default.createElement("span", { className: clsx_m_default(styles_css_default76.stud), "aria-hidden": true }, " ") - ); -} - -// node_modules/@cloudscape-design/components/table/selection/utils.js -var SELECTION_ITEM = "selection-item"; -var SELECTION_ROOT = "selection-root"; -var ItemSet = class { - constructor(trackBy, items) { - this.map = /* @__PURE__ */ new Map(); - this.put = (item) => this.map.set.call(this.map, getTrackableValue(this.trackBy, item), item); - this.has = (item) => this.map.has.call(this.map, getTrackableValue(this.trackBy, item)); - this.forEach = this.map.forEach.bind(this.map); - this.trackBy = trackBy; - items.forEach(this.put); - } -}; -var focusMarkers = { - item: { ["data-" + SELECTION_ITEM]: "item" }, - all: { ["data-" + SELECTION_ITEM]: "all" }, - root: { ["data-" + SELECTION_ROOT]: "true" } -}; - -// node_modules/@cloudscape-design/components/table/selection/use-selection-focus-move.js -function useSelectionFocusMove(selectionType, totalItems) { - if (selectionType !== "multi") { - return {}; - } - function moveFocus(sourceElement, fromIndex, direction) { - let index = fromIndex; - const rootContainer = findRootContainer(sourceElement); - while (index >= -1 && index < totalItems) { - index += direction; - const control = findSelectionControlByIndex(rootContainer, index); - if (control && !control.disabled) { - control.focus(); - break; - } - } - } - const [moveFocusDown, moveFocusUp] = [1, -1].map((direction) => { - return (event) => { - const target = event.currentTarget; - const itemNode = findUpUntil2(target, (node) => node.dataset.selectionItem === "item"); - const fromIndex = Array.prototype.indexOf.call(itemNode.parentElement.children, itemNode); - moveFocus(target, fromIndex, direction); - }; - }); - return { - moveFocusDown, - moveFocusUp, - moveFocus - }; -} -function findSelectionControlByIndex(rootContainer, index) { - if (index === -1) { - return rootContainer.querySelector(`[data-${SELECTION_ITEM}="all"] .${styles_css_default76.root} input`); - } - return rootContainer.querySelectorAll(`[data-${SELECTION_ITEM}="item"] .${styles_css_default76.root} input`)[index]; -} -function findRootContainer(element) { - return findUpUntil2(element, (node) => node.dataset.selectionRoot === "true"); -} - -// node_modules/@cloudscape-design/components/table/selection/use-selection.js -var import_react250 = __toESM(require_react()); -function useSelection({ items, selectedItems = [], selectionType, isItemDisabled = () => false, trackBy, onSelectionChange, ariaLabels, loading }) { - const [shiftPressed, setShiftPressed] = (0, import_react250.useState)(false); - const [lastClickedItem, setLastClickedItem] = (0, import_react250.useState)(null); - const selectionName = useUniqueId(); - const finalSelectedItems = selectionType === "single" ? selectedItems.slice(0, 1) : selectedItems; - const selectedSet = new ItemSet(trackBy, finalSelectedItems); - const itemIndexesMap = /* @__PURE__ */ new Map(); - items.forEach((item, i) => itemIndexesMap.set(getTrackableValue(trackBy, item), i)); - const isItemSelected = selectedSet.has.bind(selectedSet); - const getItemState = (item) => ({ - disabled: isItemDisabled(item), - selected: isItemSelected(item) - }); - const [allDisabled, allEnabledSelected] = selectionType ? items.reduce(([allDisabled2, allEnabledSelected2], item) => { - const { disabled, selected } = getItemState(item); - return [ - // all items are disabled (or none are present) - allDisabled2 && disabled, - // all enabled items are selected (or none are present) - allEnabledSelected2 && (selected || disabled) - ]; - }, [true, true]) : [true, true]; - const hasSelected = finalSelectedItems.length > 0; - const handleToggleAll = () => { - const requestedItems = new ItemSet(trackBy, items); - const newSelectedItems = allEnabledSelected ? deselectItems(requestedItems) : selectItems(requestedItems); - fireNonCancelableEvent(onSelectionChange, { selectedItems: newSelectedItems }); - }; - const getRequestedItems = (item) => { - const requestedItems = new ItemSet(trackBy, [item]); - let lastClickedItemIndex = lastClickedItem ? itemIndexesMap.get(getTrackableValue(trackBy, lastClickedItem)) : -1; - if (lastClickedItemIndex === void 0) { - lastClickedItemIndex = -1; - } - if (shiftPressed && lastClickedItemIndex !== -1) { - const currentItemIndex = itemIndexesMap.get(getTrackableValue(trackBy, item)); - const start = Math.min(currentItemIndex, lastClickedItemIndex); - const end = Math.max(currentItemIndex, lastClickedItemIndex); - items.slice(start, end + 1).forEach((item2) => requestedItems.put(item2)); - } - return requestedItems; - }; - const deselectItems = (requestedItems) => { - const newSelectedItems = []; - selectedItems.forEach((selectedItem) => { - const toUnselect = requestedItems.has(selectedItem); - if (!toUnselect || isItemDisabled(selectedItem)) { - newSelectedItems.push(selectedItem); - } - }); - return newSelectedItems; - }; - const selectItems = (requestedItems) => { - const newSelectedItems = [...selectedItems]; - requestedItems.forEach((newItem) => { - const { selected, disabled } = getItemState(newItem); - if (!selected && !disabled) { - newSelectedItems.push(newItem); - } - }); - return newSelectedItems; - }; - const handleToggleItem = (item) => () => { - const { disabled, selected } = getItemState(item); - if (disabled || selectionType === "single" && selected) { - return; - } - if (selectionType === "single") { - fireNonCancelableEvent(onSelectionChange, { selectedItems: [item] }); - } else { - const requestedItems = getRequestedItems(item); - const selectedItems2 = selected ? deselectItems(requestedItems) : selectItems(requestedItems); - fireNonCancelableEvent(onSelectionChange, { selectedItems: selectedItems2 }); - setLastClickedItem(item); - } - }; - return { - isItemSelected, - getSelectAllProps: () => { - var _a2; - if (!selectionType) { - throw new Error("Invariant violation: calling selection props with missing selection type."); - } - return { - name: selectionName, - disabled: allDisabled || !!loading, - selectionType, - indeterminate: hasSelected && !allEnabledSelected, - checked: hasSelected && allEnabledSelected, - onChange: handleToggleAll, - ariaLabel: joinStrings(ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel, (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.allItemsSelectionLabel) === null || _a2 === void 0 ? void 0 : _a2.call(ariaLabels, { selectedItems })) - }; - }, - getItemSelectionProps: (item) => { - var _a2; - if (!selectionType) { - throw new Error("Invariant violation: calling selection props with missing selection type."); - } - return { - name: selectionName, - selectionType, - ariaLabel: joinStrings(ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel, (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.itemSelectionLabel) === null || _a2 === void 0 ? void 0 : _a2.call(ariaLabels, { selectedItems }, item)), - onChange: handleToggleItem(item), - checked: isItemSelected(item), - disabled: isItemDisabled(item) - }; - }, - updateShiftToggle: (value) => { - setShiftPressed(value); - } - }; -} - -// node_modules/@cloudscape-design/components/table/sticky-scrolling.js -function stickyScrolling(containerRef, stickyRef) { - const scrollToTop = () => { - if (!containerRef.current || !stickyRef.current) { - return; - } - const scrollingOffset = calculateScrollingOffset(containerRef.current, stickyRef.current); - if (scrollingOffset > 0) { - scrollUpBy(scrollingOffset, containerRef.current); - } - }; - const scrollToItem = (item) => { - if (!item || !containerRef.current || !stickyRef.current) { - return; - } - const stickyBottom = stickyRef.current.getBoundingClientRect().bottom; - const scrollingOffset = stickyBottom - item.getBoundingClientRect().top; - if (scrollingOffset > 0) { - scrollUpBy(scrollingOffset, containerRef.current); - } - }; - return { - scrollToTop, - scrollToItem - }; -} -function calculateScrollingOffset(container, sticky) { - const stickyRect = sticky.getBoundingClientRect(); - const containerRect = container.getBoundingClientRect(); - return stickyRect.top - containerRect.top; -} -function scrollUpBy(amount, container) { - const parent = getOverflowParents(container); - if (parent.length) { - parent[0].scrollTop -= amount; - } else { - window.scrollTo({ top: window.pageYOffset - amount }); - } -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-mouse-down-target.js -var import_react251 = __toESM(require_react()); -var useEventListenersSingleton = createSingletonHandler((setTarget) => { - function handleMouseDown(event) { - setTarget(event.target); - } - function handleKeyDown() { - setTarget(null); - } - window.addEventListener("mousedown", handleMouseDown); - window.addEventListener("keydown", handleKeyDown); - return () => { - window.removeEventListener("mousedown", handleMouseDown); - window.removeEventListener("keydown", handleKeyDown); - }; -}); -function useMouseDownTarget() { - const mouseDownTargetRef = (0, import_react251.useRef)(null); - useEventListenersSingleton((target) => { - mouseDownTargetRef.current = target; - }); - return () => mouseDownTargetRef.current; -} - -// node_modules/@cloudscape-design/components/cards/index.js -var Cards = import_react252.default.forwardRef(function(_a2, ref) { - var { items = [], cardDefinition, cardsPerRow = [], header, filter, pagination, preferences, empty, loading, loadingText, trackBy, selectedItems, selectionType, isItemDisabled, onSelectionChange, ariaLabels, visibleSections, stickyHeader, stickyHeaderVerticalOffset, variant = "container", renderAriaLive, firstIndex, totalItemsCount, entireCardClickable } = _a2, rest = __rest(_a2, ["items", "cardDefinition", "cardsPerRow", "header", "filter", "pagination", "preferences", "empty", "loading", "loadingText", "trackBy", "selectedItems", "selectionType", "isItemDisabled", "onSelectionChange", "ariaLabels", "visibleSections", "stickyHeader", "stickyHeaderVerticalOffset", "variant", "renderAriaLive", "firstIndex", "totalItemsCount", "entireCardClickable"]); - const { __internalRootRef } = useBaseComponent("Cards", { - props: { entireCardClickable, selectionType, stickyHeader, variant } - }); - const baseProps = getBaseProps(rest); - const isRefresh = useVisualRefresh(); - const isMobile = useMobile(); - const computedVariant = isRefresh ? variant : "container"; - const headerIdRef = (0, import_react252.useRef)(void 0); - const setHeaderRef = (0, import_react252.useCallback)((id) => { - headerIdRef.current = id; - }, []); - const isLabelledByHeader = !(ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.cardsLabel) && !!header; - const [columns, measureRef] = useContainerQuery(({ contentBoxWidth }) => getCardsPerRow(contentBoxWidth, cardsPerRow), [cardsPerRow]); - const refObject = (0, import_react252.useRef)(null); - const mergedRef = useMergeRefs(measureRef, refObject, __internalRootRef); - const getMouseDownTarget = useMouseDownTarget(); - const i18n = useInternalI18n("cards"); - const { isItemSelected, getItemSelectionProps, updateShiftToggle } = useSelection({ - items, - trackBy, - selectedItems, - selectionType, - isItemDisabled, - onSelectionChange, - ariaLabels: { - itemSelectionLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.itemSelectionLabel, - selectionGroupLabel: i18n("ariaLabels.selectionGroupLabel", ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel) - } - }); - const hasToolsHeader = header || filter || pagination || preferences; - const hasFooterPagination = isMobile && variant === "full-page" && !!pagination; - const headerRef = (0, import_react252.useRef)(null); - const { scrollToTop, scrollToItem } = stickyScrolling(refObject, headerRef); - stickyHeader = supportsStickyPosition() && !isMobile && stickyHeader; - const onCardFocus = (event) => { - if (stickyHeader && !event.currentTarget.contains(getMouseDownTarget())) { - scrollToItem(event.currentTarget); - } - }; - (0, import_react252.useImperativeHandle)(ref, () => ({ - scrollToTop: () => { - if (stickyHeader) { - scrollToTop(); - } - } - }), [stickyHeader, scrollToTop]); - let status; - if (loading) { - status = import_react252.default.createElement( - "div", - { className: styles_css_default71.loading }, - import_react252.default.createElement( - StatusIndicator, - { type: "loading" }, - import_react252.default.createElement(live_region_default, { visible: true }, loadingText) - ) - ); - } else if (empty && !items.length) { - status = import_react252.default.createElement("div", { className: styles_css_default71.empty }, empty); - } - return import_react252.default.createElement( - LinkDefaultVariantContext.Provider, - { value: { defaultVariant: "primary" } }, - import_react252.default.createElement( - AnalyticsFunnelSubStep, - null, - import_react252.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default71.root), ref: mergedRef }), - import_react252.default.createElement( - InternalContainerAsSubstep, - { header: hasToolsHeader && import_react252.default.createElement( - "div", - { className: clsx_m_default(styles_css_default71.header, isRefresh && styles_css_default71["header-refresh"], styles_css_default71[`header-variant-${computedVariant}`], shouldRemoveHighContrastHeader() && styles_css_default71["remove-high-contrast-header"]) }, - import_react252.default.createElement( - CollectionLabelContext.Provider, - { value: { assignId: setHeaderRef } }, - import_react252.default.createElement(ToolsHeader, { header, filter, pagination, preferences }) - ) - ), footer: hasFooterPagination && import_react252.default.createElement("div", { className: styles_css_default71["footer-pagination"] }, pagination), disableContentPaddings: true, disableHeaderPaddings: computedVariant === "full-page", variant: computedVariant === "container" ? "cards" : computedVariant, __stickyHeader: stickyHeader, __stickyOffset: stickyHeaderVerticalOffset, __headerRef: headerRef, __darkHeader: computedVariant === "full-page", __disableFooterDivider: true }, - import_react252.default.createElement( - "div", - { className: clsx_m_default(hasToolsHeader && styles_css_default71["has-header"], isRefresh && styles_css_default71.refresh, styles_css_default71[`header-variant-${computedVariant}`], shouldRemoveHighContrastHeader() && styles_css_default71["remove-high-contrast-header"]) }, - !!renderAriaLive && !!firstIndex && import_react252.default.createElement( - live_region_default, - null, - import_react252.default.createElement("span", null, renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })) - ), - status !== null && status !== void 0 ? status : import_react252.default.createElement(CardsList, { items, cardDefinition, trackBy, selectionType, columns, isItemSelected, getItemSelectionProps, visibleSections, updateShiftToggle, onFocus: onCardFocus, ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.cardsLabel, ariaLabelledby: isLabelledByHeader && headerIdRef.current ? headerIdRef.current : void 0, entireCardClickable }) - ) - ) - ) - ) - ); -}); -var cards_default = Cards; -var CardsList = ({ items, cardDefinition, trackBy, selectionType, columns, isItemSelected, getItemSelectionProps, visibleSections, updateShiftToggle, onFocus, ariaLabelledby, ariaLabel, entireCardClickable }) => { - const selectable = !!selectionType; - const canClickEntireCard = selectable && entireCardClickable; - const isRefresh = useVisualRefresh(); - const { moveFocusDown, moveFocusUp } = useSelectionFocusMove(selectionType, items.length); - let visibleSectionsDefinition = cardDefinition.sections || []; - visibleSectionsDefinition = visibleSections ? visibleSectionsDefinition.filter((section) => section.id && visibleSections.indexOf(section.id) !== -1) : visibleSectionsDefinition; - let listRole = void 0; - let listItemRole = void 0; - if (selectable) { - listRole = "group"; - listItemRole = "presentation"; - } - return import_react252.default.createElement("ol", Object.assign({ className: clsx_m_default(styles_css_default71.list, styles_css_default71[`list-grid-${columns || 1}`]), role: listRole, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel }, focusMarkers && focusMarkers.root), items.map((item, index) => import_react252.default.createElement( - "li", - Object.assign({ className: clsx_m_default(styles_css_default71.card, { - [styles_css_default71["card-selectable"]]: selectable, - [styles_css_default71["card-selected"]]: selectable && isItemSelected(item) - }), key: getItemKey(trackBy, item, index), onFocus }, focusMarkers && focusMarkers.item, { role: listItemRole }), - import_react252.default.createElement( - "div", - { className: clsx_m_default(styles_css_default71["card-inner"], isRefresh && styles_css_default71.refresh), onClick: canClickEntireCard ? (event) => { - var _a2; - getItemSelectionProps(item).onChange(); - (_a2 = event.currentTarget.querySelector("input")) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } : void 0 }, - import_react252.default.createElement( - "div", - { className: styles_css_default71["card-header"] }, - import_react252.default.createElement("div", { className: styles_css_default71["card-header-inner"] }, cardDefinition.header ? cardDefinition.header(item) : ""), - selectable && import_react252.default.createElement( - "div", - { className: styles_css_default71["selection-control"] }, - import_react252.default.createElement(SelectionControl, Object.assign({ onFocusDown: moveFocusDown, onFocusUp: moveFocusUp, onShiftToggle: updateShiftToggle }, getItemSelectionProps(item))) - ) - ), - visibleSectionsDefinition.map(({ width = 100, header, content, id }, index2) => import_react252.default.createElement( - "div", - { key: id || index2, className: styles_css_default71.section, style: { width: `${width}%` } }, - header ? import_react252.default.createElement("div", { className: styles_css_default71["section-header"] }, header) : "", - content ? import_react252.default.createElement("div", { className: styles_css_default71["section-content"] }, content(item)) : "" - )) - ) - ))); -}; -applyDisplayName(Cards, "Cards"); - -// node_modules/@cloudscape-design/components/checkbox/index.js -var import_react253 = __toESM(require_react()); -var Checkbox = import_react253.default.forwardRef((_a2, ref) => { - var props2 = __rest(_a2, []); - const baseComponentProps = useBaseComponent("Checkbox"); - return import_react253.default.createElement(internal_default11, Object.assign({}, props2, baseComponentProps, { ref })); -}); -applyDisplayName(Checkbox, "Checkbox"); -var checkbox_default = Checkbox; - -// node_modules/@cloudscape-design/components/code-editor/index.js -var import_react267 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/code-editor/pane.js -var import_react255 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/code-editor/resizable-box/index.js -var import_react254 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/code-editor/resizable-box/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/code-editor/resizable-box/styles.scoped.css"; -var styles_css_default77 = { - "resizable-box": "awsui_resizable-box_cufu9_1kvmu_17", - "resizable-box-handle": "awsui_resizable-box-handle_cufu9_1kvmu_22", - "resize-active": "awsui_resize-active_cufu9_1kvmu_49" -}; - -// node_modules/@cloudscape-design/components/code-editor/resizable-box/index.js -function ResizableBox({ children: children2, height, minHeight, onResize }) { - const [dragOffset, setDragOffset] = (0, import_react254.useState)(null); - const onResizeStable = useStableCallback(onResize); - const containerRef = (0, import_react254.useRef)(null); - const onMouseDown = (event) => { - if (event.button !== 0 || !containerRef.current) { - return; - } - const containerBottom = containerRef.current.getBoundingClientRect().bottom; - setDragOffset(containerBottom - event.clientY); - }; - (0, import_react254.useEffect)(() => { - if (dragOffset === null || !containerRef.current) { - return; - } - const container = containerRef.current; - const onMouseMove = (event) => { - const { top } = container.getBoundingClientRect(); - const cursor = event.clientY; - onResizeStable(Math.max(cursor + dragOffset - top, minHeight)); - }; - const onMouseUp = () => { - setDragOffset(null); - }; - document.body.classList.add(styles_css_default77["resize-active"]); - document.addEventListener("mousemove", onMouseMove); - document.addEventListener("mouseup", onMouseUp); - return () => { - document.removeEventListener("mousemove", onMouseMove); - document.removeEventListener("mouseup", onMouseUp); - document.body.classList.remove(styles_css_default77["resize-active"]); - }; - }, [dragOffset, minHeight, onResizeStable]); - return import_react254.default.createElement( - "div", - { ref: containerRef, className: styles_css_default77["resizable-box"], style: { height } }, - children2, - import_react254.default.createElement("span", { className: styles_css_default77["resizable-box-handle"], onMouseDown }) - ); -} - -// node_modules/@cloudscape-design/components/code-editor/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/code-editor/styles.scoped.css"; -var styles_css_default78 = { - "code-editor-refresh": "awsui_code-editor-refresh_1gl9c_162o6_104", - "code-editor": "awsui_code-editor_1gl9c_162o6_104", - "pane": "awsui_pane_1gl9c_162o6_450", - "pane__close-container": "awsui_pane__close-container_1gl9c_162o6_461", - "pane__list": "awsui_pane__list_1gl9c_162o6_466", - "pane__table": "awsui_pane__table_1gl9c_162o6_473", - "pane__item": "awsui_pane__item_1gl9c_162o6_479", - "pane__cell": "awsui_pane__cell_1gl9c_162o6_479", - "pane__item--highlighted": "awsui_pane__item--highlighted_1gl9c_162o6_493", - "pane__location": "awsui_pane__location_1gl9c_162o6_514", - "pane__description": "awsui_pane__description_1gl9c_162o6_514", - "focus-lock": "awsui_focus-lock_1gl9c_162o6_529", - "editor": "awsui_editor_1gl9c_162o6_580", - "editor-refresh": "awsui_editor-refresh_1gl9c_162o6_608", - "status-bar": "awsui_status-bar_1gl9c_162o6_613", - "status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-pane_1gl9c_162o6_621", - "status-bar__left": "awsui_status-bar__left_1gl9c_162o6_625", - "status-bar__left-virtual": "awsui_status-bar__left-virtual_1gl9c_162o6_632", - "status-bar__right": "awsui_status-bar__right_1gl9c_162o6_636", - "status-bar__language-mode": "awsui_status-bar__language-mode_1gl9c_162o6_640", - "status-bar__cursor-position": "awsui_status-bar__cursor-position_1gl9c_162o6_640", - "status-bar__cog-button": "awsui_status-bar__cog-button_1gl9c_162o6_646", - "status-bar-virtual": "awsui_status-bar-virtual_1gl9c_162o6_651", - "tab-button": "awsui_tab-button_1gl9c_162o6_657", - "tab-button--refresh": "awsui_tab-button--refresh_1gl9c_162o6_689", - "tab-button--warnings": "awsui_tab-button--warnings_1gl9c_162o6_692", - "tab-button--active": "awsui_tab-button--active_1gl9c_162o6_701", - "tab-button--disabled": "awsui_tab-button--disabled_1gl9c_162o6_717", - "tab-button--divider": "awsui_tab-button--divider_1gl9c_162o6_750", - "tab-button--errors": "awsui_tab-button--errors_1gl9c_162o6_757", - "loading-screen": "awsui_loading-screen_1gl9c_162o6_761", - "error-screen": "awsui_error-screen_1gl9c_162o6_762" -}; - -// node_modules/@cloudscape-design/components/code-editor/ace-modes.js -var AceModes = [ - { value: "abap", label: "ABAP" }, - { value: "abc", label: "ABC" }, - { value: "actionscript", label: "ActionScript" }, - { value: "ada", label: "ADA" }, - { value: "alda", label: "Alda" }, - { value: "apache_conf", label: "Apache Conf" }, - { value: "apex", label: "Apex" }, - { value: "aql", label: "AQL" }, - { value: "asciidoc", label: "AsciiDoc" }, - { value: "asl", label: "ASL" }, - { value: "assembly_x86", label: "Assembly x86" }, - { value: "autohotkey", label: "AutoHotkey/AutoIt" }, - { value: "batchfile", label: "BatchFile" }, - { value: "c_cpp", label: "C/C++" }, - { value: "c9search", label: "C9Search" }, - { value: "cirru", label: "Cirru" }, - { value: "clojure", label: "Clojure" }, - { value: "cobol", label: "Cobol" }, - { value: "coffee", label: "CoffeeScript" }, - { value: "coldfusion", label: "ColdFusion" }, - { value: "crystal", label: "Crystal" }, - { value: "csharp", label: "C#" }, - { value: "csound_document", label: "Csound Document" }, - { value: "csound_orchestra", label: "Csound" }, - { value: "csound_score", label: "Csound Score" }, - { value: "css", label: "CSS" }, - { value: "curly", label: "Curly" }, - { value: "d", label: "D" }, - { value: "dart", label: "Dart" }, - { value: "diff", label: "Diff" }, - { value: "django", label: "Django" }, - { value: "dockerfile", label: "Dockerfile" }, - { value: "dot", label: "Dot" }, - { value: "drools", label: "Drools" }, - { value: "edifact", label: "Edifact" }, - { value: "eiffel", label: "Eiffel" }, - { value: "ejs", label: "EJS" }, - { value: "elixir", label: "Elixir" }, - { value: "elm", label: "Elm" }, - { value: "erlang", label: "Erlang" }, - { value: "forth", label: "Forth" }, - { value: "fortran", label: "Fortran" }, - { value: "fsharp", label: "FSharp" }, - { value: "fsl", label: "FSL" }, - { value: "ftl", label: "FreeMarker" }, - { value: "gcode", label: "Gcode" }, - { value: "gherkin", label: "Gherkin" }, - { value: "gitignore", label: "Gitignore" }, - { value: "glsl", label: "Glsl" }, - { value: "gobstones", label: "Gobstones" }, - { value: "golang", label: "Go" }, - { value: "graphqlschema", label: "GraphQLSchema" }, - { value: "groovy", label: "Groovy" }, - { value: "haml", label: "HAML" }, - { value: "handlebars", label: "Handlebars" }, - { value: "haskell", label: "Haskell" }, - { value: "haskell_cabal", label: "Haskell Cabal" }, - { value: "haxe", label: "haXe" }, - { value: "hjson", label: "Hjson" }, - { value: "html", label: "HTML" }, - { value: "html_elixir", label: "HTML (Elixir)" }, - { value: "html_ruby", label: "HTML (Ruby)" }, - { value: "ini", label: "INI" }, - { value: "io", label: "Io" }, - { value: "jack", label: "Jack" }, - { value: "jade", label: "Jade" }, - { value: "java", label: "Java" }, - { value: "javascript", label: "JavaScript" }, - { value: "json", label: "JSON" }, - { value: "json5", label: "JSON5" }, - { value: "jsoniq", label: "JSONiq" }, - { value: "jsp", label: "JSP" }, - { value: "jssm", label: "JSSM" }, - { value: "jsx", label: "JSX" }, - { value: "julia", label: "Julia" }, - { value: "kotlin", label: "Kotlin" }, - { value: "latex", label: "LaTeX" }, - { value: "less", label: "LESS" }, - { value: "liquid", label: "Liquid" }, - { value: "lisp", label: "Lisp" }, - { value: "livescript", label: "LiveScript" }, - { value: "logiql", label: "LogiQL" }, - { value: "lsl", label: "LSL" }, - { value: "lua", label: "Lua" }, - { value: "luapage", label: "LuaPage" }, - { value: "lucene", label: "Lucene" }, - { value: "makefile", label: "Makefile" }, - { value: "markdown", label: "Markdown" }, - { value: "mask", label: "Mask" }, - { value: "matlab", label: "MATLAB" }, - { value: "maze", label: "Maze" }, - { value: "mediawiki", label: "MediaWiki" }, - { value: "mel", label: "MEL" }, - { value: "mixal", label: "MIXAL" }, - { value: "mushcode", label: "MUSHCode" }, - { value: "mysql", label: "MySQL" }, - { value: "nginx", label: "Nginx" }, - { value: "nim", label: "Nim" }, - { value: "nix", label: "Nix" }, - { value: "nsis", label: "NSIS" }, - { value: "nunjucks", label: "Nunjucks" }, - { value: "objectivec", label: "Objective-C" }, - { value: "ocaml", label: "OCaml" }, - { value: "pascal", label: "Pascal" }, - { value: "perl", label: "Perl" }, - { value: "perl6", label: "Perl 6" }, - { value: "pgsql", label: "pgSQL" }, - { value: "php", label: "PHP" }, - { value: "php_laravel_blade", label: "PHP (Blade Template)" }, - { value: "pig", label: "Pig" }, - { value: "powershell", label: "Powershell" }, - { value: "praat", label: "Praat" }, - { value: "prisma", label: "Prisma" }, - { value: "prolog", label: "Prolog" }, - { value: "properties", label: "Properties" }, - { value: "protobuf", label: "Protobuf" }, - { value: "puppet", label: "Puppet" }, - { value: "python", label: "Python" }, - { value: "qml", label: "QML" }, - { value: "r", label: "R" }, - { value: "razor", label: "Razor" }, - { value: "rdoc", label: "RDoc" }, - { value: "red", label: "Red" }, - { value: "rhtml", label: "RHTML" }, - { value: "rst", label: "RST" }, - { value: "ruby", label: "Ruby" }, - { value: "rust", label: "Rust" }, - { value: "sass", label: "SASS" }, - { value: "scad", label: "SCAD" }, - { value: "scala", label: "Scala" }, - { value: "scheme", label: "Scheme" }, - { value: "scss", label: "SCSS" }, - { value: "sh", label: "SH" }, - { value: "sjs", label: "SJS" }, - { value: "slim", label: "Slim" }, - { value: "smarty", label: "Smarty" }, - { value: "snippets", label: "snippets" }, - { value: "soy_template", label: "Soy Template" }, - { value: "space", label: "Space" }, - { value: "sql", label: "SQL" }, - { value: "sqlserver", label: "SQLServer" }, - { value: "stylus", label: "Stylus" }, - { value: "svg", label: "SVG" }, - { value: "swift", label: "Swift" }, - { value: "tcl", label: "Tcl" }, - { value: "terraform", label: "Terraform" }, - { value: "tex", label: "Tex" }, - { value: "text", label: "Text" }, - { value: "textile", label: "Textile" }, - { value: "toml", label: "Toml" }, - { value: "tsx", label: "TSX" }, - { value: "twig", label: "Twig" }, - { value: "typescript", label: "TypeScript" }, - { value: "vala", label: "Vala" }, - { value: "vbscript", label: "VBScript" }, - { value: "velocity", label: "Velocity" }, - { value: "verilog", label: "Verilog" }, - { value: "vhdl", label: "VHDL" }, - { value: "visualforce", label: "Visualforce" }, - { value: "wollok", label: "Wollok" }, - { value: "xml", label: "XML" }, - { value: "xquery", label: "XQuery" }, - { value: "yaml", label: "YAML" }, - { value: "zeek", label: "Zeek" } -]; - -// node_modules/@cloudscape-design/components/code-editor/ace-themes.js -var LightThemes = [ - { value: "chrome", label: "Chrome" }, - { value: "clouds", label: "Clouds" }, - { value: "crimson_editor", label: "Crimson Editor" }, - { value: "dawn", label: "Dawn" }, - { value: "dreamweaver", label: "Dreamweaver" }, - { value: "eclipse", label: "Eclipse" }, - { value: "github", label: "GitHub" }, - { value: "iplastic", label: "IPlastic" }, - { value: "solarized_light", label: "Solarized Light" }, - { value: "textmate", label: "TextMate" }, - { value: "tomorrow", label: "Tomorrow" }, - { value: "xcode", label: "Xcode" }, - { value: "kuroir", label: "Kuroir" }, - { value: "katzenmilch", label: "KatzenMilch" }, - { value: "sqlserver", label: "SQL Server" }, - { value: "cloud_editor", label: "CloudEditor" } -]; -var DarkThemes = [ - { value: "ambiance", label: "Ambiance" }, - { value: "chaos", label: "Chaos" }, - { value: "clouds_midnight", label: "Clouds Midnight" }, - { value: "dracula", label: "Dracula" }, - { value: "cobalt", label: "Cobalt" }, - { value: "gruvbox", label: "Gruvbox" }, - { value: "gob", label: "Green on Black" }, - { value: "idle_fingers", label: "idle Fingers" }, - { value: "kr_theme", label: "krTheme" }, - { value: "merbivore", label: "Merbivore" }, - { value: "merbivore_soft", label: "Merbivore Soft" }, - { value: "mono_industrial", label: "Mono Industrial" }, - { value: "monokai", label: "Monokai" }, - { value: "nord_dark", label: "Nord Dark" }, - { value: "pastel_on_dark", label: "Pastel on dark" }, - { value: "solarized_dark", label: "Solarized Dark" }, - { value: "terminal", label: "Terminal" }, - { value: "tomorrow_night", label: "Tomorrow Night" }, - { value: "tomorrow_night_blue", label: "Tomorrow Night Blue" }, - { value: "tomorrow_night_bright", label: "Tomorrow Night Bright" }, - { value: "tomorrow_night_eighties", label: "Tomorrow Night 80s" }, - { value: "twilight", label: "Twilight" }, - { value: "vibrant_ink", label: "Vibrant Ink" }, - { value: "cloud_editor_dark", label: "CloudEditor Dark" } -]; - -// node_modules/@cloudscape-design/components/code-editor/util.js -var CLOUD_EDITOR_LIGHT_THEME = "cloud_editor"; -var CLOUD_EDITOR_DARK_THEME = "cloud_editor_dark"; -var FALLBACK_LIGHT_THEME = "dawn"; -var FALLBACK_DARK_THEME = "tomorrow_night_bright"; -var DEFAULT_AVAILABLE_THEMES = { - light: LightThemes.map((theme2) => theme2.value).filter((value) => value !== CLOUD_EDITOR_LIGHT_THEME), - dark: DarkThemes.map((theme2) => theme2.value).filter((value) => value !== CLOUD_EDITOR_DARK_THEME) -}; -function isAceVersionAtLeast(ace, minVersion) { - var _a2; - const semanticVersion = (_a2 = ace === null || ace === void 0 ? void 0 : ace.version) === null || _a2 === void 0 ? void 0 : _a2.split(".").map((part) => { - const parsed = parseInt(part); - return Number.isNaN(parsed) ? part : parsed; - }); - return !!semanticVersion && typeof semanticVersion[0] === "number" && semanticVersion[0] >= minVersion[0] && typeof semanticVersion[1] === "number" && semanticVersion[1] >= minVersion[1] && typeof semanticVersion[2] === "number" && semanticVersion[2] >= minVersion[2]; -} -function supportsKeyboardAccessibility(ace) { - return isAceVersionAtLeast(ace, [1, 23, 0]); -} -function getDefaultConfig(ace) { - return Object.assign({ behavioursEnabled: true }, supportsKeyboardAccessibility(ace) ? { enableKeyboardAccessibility: true } : {}); -} -function getDefaultTheme(mode, themes) { - if (mode === "light") { - return (themes === null || themes === void 0 ? void 0 : themes.light.some((value) => value === CLOUD_EDITOR_LIGHT_THEME)) ? CLOUD_EDITOR_LIGHT_THEME : FALLBACK_LIGHT_THEME; - } else { - return (themes === null || themes === void 0 ? void 0 : themes.dark.some((value) => value === CLOUD_EDITOR_DARK_THEME)) ? CLOUD_EDITOR_DARK_THEME : FALLBACK_DARK_THEME; - } -} -function getAceTheme(theme2) { - return `ace/theme/${theme2}`; -} -function getLanguageLabel(language) { - var _a2; - return ((_a2 = AceModes.filter((mode) => mode.value === language)[0]) === null || _a2 === void 0 ? void 0 : _a2.label) || language; -} -function getStatusButtonId({ paneId, paneStatus }) { - return paneId ? `${paneId}-button-${paneStatus}` : void 0; -} - -// node_modules/@cloudscape-design/components/code-editor/pane.js -var ANNOTATION_ITEM_HEIGHT = 31; -var PANE_ANNOTATIONS_PADDING = 12; -var MIN_HEIGHT = 3 * ANNOTATION_ITEM_HEIGHT + 2 * PANE_ANNOTATIONS_PADDING; -var Pane = ({ id, paneStatus, visible, annotations, highlighted, onClose, onAnnotationClick, onAnnotationClear, cursorPositionLabel, closeButtonAriaLabel }) => { - const [paneHeight, setPaneHeight] = (0, import_react255.useState)(MIN_HEIGHT); - const listRef = (0, import_react255.useRef)(null); - (0, import_react255.useEffect)(() => { - var _a2; - if (!highlighted) { - return; - } - const { row, column } = highlighted; - const highlightedAnnotationIndex = annotations.indexOf(annotations.filter((a2) => a2.row === row && a2.column === column)[0]); - if (highlightedAnnotationIndex > -1) { - const errorItem = (_a2 = listRef.current) === null || _a2 === void 0 ? void 0 : _a2.children[highlightedAnnotationIndex]; - errorItem === null || errorItem === void 0 ? void 0 : errorItem.focus(); - } - }, [highlighted, annotations]); - const onItemClick = (annotation) => { - onAnnotationClick(annotation); - }; - const onItemKeyDown = (annotation, event) => { - if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) { - event.preventDefault(); - onAnnotationClick(annotation); - } - }; - const onEscKeyDown = (event) => { - if (event.keyCode === KeyCode.escape) { - event.preventDefault(); - onClose(); - } - }; - const ariaLabelledBy = getStatusButtonId({ paneId: id, paneStatus }); - if (!visible) { - return null; - } - return import_react255.default.createElement( - "div", - { id, className: styles_css_default78.pane, onKeyDown: onEscKeyDown, role: "tabpanel", "aria-labelledby": ariaLabelledBy }, - import_react255.default.createElement( - ResizableBox, - { height: paneHeight, minHeight: MIN_HEIGHT, onResize: (newHeight) => setPaneHeight(newHeight) }, - import_react255.default.createElement( - focus_lock_default, - { className: styles_css_default78["focus-lock"], autoFocus: true, restoreFocus: true }, - import_react255.default.createElement( - "div", - { className: styles_css_default78.pane__list, tabIndex: -1 }, - import_react255.default.createElement( - "table", - { className: styles_css_default78.pane__table, role: "presentation" }, - import_react255.default.createElement( - "colgroup", - null, - import_react255.default.createElement("col", { - style: { width: 1 } - /* shrink to fit content */ - }), - import_react255.default.createElement("col", { style: { width: "auto" } }) - ), - import_react255.default.createElement("tbody", { ref: listRef }, annotations.map((annotation, i) => { - var _a2; - return import_react255.default.createElement( - "tr", - { key: i, role: "link", className: styles_css_default78.pane__item, onMouseOver: onAnnotationClear, onClick: onItemClick.bind(null, annotation), onKeyDown: onItemKeyDown.bind(null, annotation), tabIndex: 0 }, - import_react255.default.createElement("td", { className: clsx_m_default(styles_css_default78.pane__location, styles_css_default78.pane__cell), tabIndex: -1 }, (_a2 = cursorPositionLabel === null || cursorPositionLabel === void 0 ? void 0 : cursorPositionLabel((annotation.row || 0) + 1, (annotation.column || 0) + 1)) !== null && _a2 !== void 0 ? _a2 : ""), - import_react255.default.createElement("td", { className: clsx_m_default(styles_css_default78.pane__description, styles_css_default78.pane__cell), tabIndex: -1 }, annotation.text) - ); - })) - ) - ), - import_react255.default.createElement( - "div", - { className: styles_css_default78["pane__close-container"] }, - import_react255.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "close", onClick: onClose, ariaLabel: closeButtonAriaLabel }) - ) - ) - ) - ); -}; - -// node_modules/@cloudscape-design/components/code-editor/listeners.js -var import_react256 = __toESM(require_react()); -function useChangeEffect(editor, onChange, onDelayedChange) { - const debouncedChangeHandler = useDebounceCallback((detail) => { - fireNonCancelableEvent(onDelayedChange, detail); - }, 0); - const handleChange = useStableCallback(() => { - const changeDetail = { value: (editor === null || editor === void 0 ? void 0 : editor.getValue()) || "" }; - fireNonCancelableEvent(onChange, changeDetail); - debouncedChangeHandler(changeDetail); - }); - (0, import_react256.useEffect)(() => { - if (!editor) { - return; - } - editor.on("change", handleChange); - return () => editor.off("change", handleChange); - }, [editor, handleChange]); -} - -// node_modules/@cloudscape-design/components/code-editor/setup-editor.js -function setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus) { - setEditorDefaults(ace, editor); - editor.session.selection.on("changeCursor", () => { - setCursorPosition(editor.getCursorPosition()); - }); - editor.session.on("changeAnnotation", () => { - const editorAnnotations = editor.session.getAnnotations(); - const newAnnotations = editorAnnotations.filter((a2) => a2.type !== "info"); - if (editorAnnotations.length !== newAnnotations.length) { - editor.session.setAnnotations(newAnnotations); - } - setAnnotations(newAnnotations); - }); - const moveCursorToAnnotation = (a2) => { - if (typeof a2.row === "number") { - editor.gotoLine(a2.row + 1, a2.column || 0, false); - } - }; - const openAnnotation = (row) => { - const currentAnnotations = editor.session.getAnnotations().filter((a2) => a2.row === row && a2.type !== "info"); - const errors = currentAnnotations.filter((a2) => a2.type === "error"); - if (errors.length > 0) { - setHighlightedAnnotation(errors[0]); - setPaneStatus("error"); - moveCursorToAnnotation(errors[0]); - } else if (currentAnnotations.length > 0) { - setHighlightedAnnotation(currentAnnotations[0]); - setPaneStatus("warning"); - moveCursorToAnnotation(currentAnnotations[0]); - } else { - setHighlightedAnnotation(void 0); - setPaneStatus("hidden"); - editor.gotoLine(row + 1, 0, false); - } - }; - editor.on("gutterclick", (e) => { - const { row } = e.getDocumentPosition(); - openAnnotation(row); - }); - editor.on("gutterkeydown", (e) => { - if (e.isInAnnotationLane() && (e.getKey() === "space" || e.getKey() === "return")) { - const row = e.getRow(); - openAnnotation(row); - } - }); - editor.on("change", () => { - if (editor.getValue().length === 0) { - editor.session.clearAnnotations(); - } - }); -} -function setEditorDefaults(ace, editor) { - ace.config.loadModule("ace/ext/language_tools", function() { - editor.setOptions({ - displayIndentGuides: false, - enableSnippets: true, - enableBasicAutocompletion: true - }); - }); - editor.setAutoScrollEditorIntoView(true); - if (!supportsKeyboardAccessibility(ace)) { - editor.commands.addCommand({ - name: "exitCodeEditor", - bindKey: "Esc", - exec: () => { - editor.container.focus(); - } - }); - } - editor.on("focus", () => { - editor.textInput.getElement().setAttribute("tabindex", 0); - }); - editor.on("blur", () => { - editor.textInput.getElement().setAttribute("tabindex", -1); - }); - editor.textInput.getElement().setAttribute("tabindex", -1); - editor.commands.removeCommand("showSettingsMenu", false); - editor.on("guttermousedown", (e) => { - e.stop(); - }); - editor.setHighlightActiveLine(false); - editor.$updateHighlightActiveLine = function() { - const session = this.getSession(); - let highlight; - if (this.$highlightActiveLine) { - if (this.$selectionStyle !== "line" || !this.selection.isMultiLine()) { - highlight = this.getCursorPosition(); - } - if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) { - highlight = false; - } - } - if (session.$highlightLineMarker && !highlight) { - session.removeMarker(session.$highlightLineMarker.id); - session.$highlightLineMarker = null; - } else if (!session.$highlightLineMarker && highlight) { - const range3 = new ace.Range(highlight.row, 0, highlight.row, Infinity); - range3.id = session.addMarker(range3, "ace_active-line", "fullLine"); - session.$highlightLineMarker = range3; - } else if (highlight) { - session.$highlightLineMarker.start.row = highlight.row; - session.$highlightLineMarker.end.row = highlight.row; - session.$highlightLineMarker.start.column = 0; - session._signal("changeBackMarker"); - } - }; - editor.setHighlightActiveLine(true); - editor.on("showGutterTooltip", (tooltip) => { - tooltip.hide(); - }); -} - -// node_modules/@cloudscape-design/components/code-editor/preferences-modal.js -var import_react261 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/modal/internal.js -var import_react259 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/modal/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/modal/styles.scoped.css"; -var styles_css_default79 = { - "dialog": "awsui_dialog_1d2i7_exyuv_111", - "modal-slide-up": "awsui_modal-slide-up_1d2i7_exyuv_1", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1d2i7_exyuv_1", - "refresh": "awsui_refresh_1d2i7_exyuv_134", - "awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_1d2i7_exyuv_1", - "root": "awsui_root_1d2i7_exyuv_167", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_1d2i7_exyuv_1", - "hidden": "awsui_hidden_1d2i7_exyuv_251", - "focus-lock": "awsui_focus-lock_1d2i7_exyuv_255", - "small": "awsui_small_1d2i7_exyuv_275", - "medium": "awsui_medium_1d2i7_exyuv_278", - "large": "awsui_large_1d2i7_exyuv_281", - "max": "awsui_max_1d2i7_exyuv_284", - "breakpoint-xs": "awsui_breakpoint-xs_1d2i7_exyuv_284", - "container": "awsui_container_1d2i7_exyuv_290", - "content": "awsui_content_1d2i7_exyuv_334", - "no-paddings": "awsui_no-paddings_1d2i7_exyuv_339", - "header": "awsui_header_1d2i7_exyuv_344", - "header--text": "awsui_header--text_1d2i7_exyuv_356", - "footer": "awsui_footer_1d2i7_exyuv_360", - "footer--stuck": "awsui_footer--stuck_1d2i7_exyuv_369", - "dismiss-control": "awsui_dismiss-control_1d2i7_exyuv_381", - "modal-open": "awsui_modal-open_1d2i7_exyuv_385" -}; - -// node_modules/@cloudscape-design/components/internal/utils/browser-scrollbar-size.js -var browserScrollbarSize = calculateOnce(() => { - if (typeof document === "undefined") { - return { width: 0, height: 0 }; - } - const scrollDiv = document.createElement("div"); - scrollDiv.style.overflow = "scroll"; - scrollDiv.style.height = "100px"; - scrollDiv.style.width = "100px"; - scrollDiv.style.position = "absolute"; - scrollDiv.style.top = "-9999px"; - scrollDiv.style.left = "-9999px"; - document.body.appendChild(scrollDiv); - const width = scrollDiv.offsetWidth - scrollDiv.clientWidth; - const height = scrollDiv.offsetHeight - scrollDiv.clientHeight; - document.body.removeChild(scrollDiv); - return { width, height }; -}); - -// node_modules/@cloudscape-design/components/modal/body-scroll.js -var initialBodyPaddingRightStyle = void 0; -function disableBodyScrolling() { - setBodyScrollbarPadding(); - document.body.classList.add(styles_css_default79["modal-open"]); -} -function enableBodyScrolling() { - document.body.classList.remove(styles_css_default79["modal-open"]); - restoreBodyScrollbarPadding(); -} -function setBodyScrollbarPadding() { - if (bodyHasScrollbar()) { - initialBodyPaddingRightStyle = document.body.style.paddingRight; - const initialBodyPaddingRight = computedBodyPaddingRightPixels(); - const scrollbarWidth = browserScrollbarSize().width; - const newBodyPaddingRight = initialBodyPaddingRight + scrollbarWidth; - document.body.style.paddingRight = newBodyPaddingRight + "px"; - } -} -function computedBodyPaddingRightPixels() { - return parseInt(window.getComputedStyle(document.body).paddingRight, 10); -} -function restoreBodyScrollbarPadding() { - if (initialBodyPaddingRightStyle) { - document.body.style.setProperty("padding-right", initialBodyPaddingRightStyle); - } else { - document.body.style.removeProperty("padding-right"); - } - initialBodyPaddingRightStyle = void 0; -} -function bodyHasScrollbar() { - return document.body.clientWidth < window.innerWidth; -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-intersection-observer/index.js -var import_react257 = __toESM(require_react()); -function useIntersectionObserver() { - const observerRef = (0, import_react257.useRef)(null); - const [isIntersecting, setIsIntersecting] = (0, import_react257.useState)(false); - const ref = (0, import_react257.useCallback)((targetElement) => { - if (typeof IntersectionObserver === "undefined") { - return; - } - if (observerRef.current) { - observerRef.current.disconnect(); - } - if (targetElement) { - observerRef.current = new IntersectionObserver(([entry]) => setIsIntersecting(entry.isIntersecting)); - observerRef.current.observe(targetElement); - } - }, []); - return { ref, isIntersecting }; -} - -// node_modules/@cloudscape-design/components/internal/context/reset-contexts-for-modal.js -var import_react258 = __toESM(require_react()); -var ResetContextsForModal = ({ children: children2 }) => import_react258.default.createElement( - AppLayoutContext.Provider, - { value: defaultValue3 }, - import_react258.default.createElement( - ButtonContext.Provider, - { value: { onClick: () => { - } } }, - import_react258.default.createElement( - CollectionLabelContext.Provider, - { value: { assignId: () => { - } } }, - import_react258.default.createElement( - FormFieldContext.Provider, - { value: {} }, - import_react258.default.createElement( - InfoLinkLabelContext.Provider, - { value: "" }, - import_react258.default.createElement( - LinkDefaultVariantContext.Provider, - { value: defaultValue2 }, - import_react258.default.createElement(SingleTabStopNavigationContext.Provider, { value: defaultValue }, children2) - ) - ) - ) - ) - ) -); -var reset_contexts_for_modal_default = ResetContextsForModal; - -// node_modules/@cloudscape-design/components/modal/internal.js -function InternalModal(_a2) { - var { modalRoot, getModalRoot, removeModalRoot } = _a2, rest = __rest(_a2, ["modalRoot", "getModalRoot", "removeModalRoot"]); - return import_react259.default.createElement( - Portal, - { container: modalRoot, getContainer: getModalRoot, removeContainer: removeModalRoot }, - import_react259.default.createElement(PortaledModal, Object.assign({}, rest)) - ); -} -function PortaledModal(_a2) { - var _b; - var { size: size2, visible, header, children: children2, footer, disableContentPaddings, onDismiss, __internalRootRef = null } = _a2, rest = __rest(_a2, ["size", "visible", "header", "children", "footer", "disableContentPaddings", "onDismiss", "__internalRootRef"]); - const instanceUniqueId = useUniqueId(); - const headerId = `${rest.id || instanceUniqueId}-header`; - const lastMouseDownElementRef = (0, import_react259.useRef)(null); - const [breakpoint, breakpointsRef] = useContainerBreakpoints(["xs"]); - const i18n = useInternalI18n("modal"); - const closeAriaLabel = i18n("closeAriaLabel", rest.closeAriaLabel); - const refObject = (0, import_react259.useRef)(null); - const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef); - const isRefresh = useVisualRefresh(); - const baseProps = getBaseProps(rest); - (0, import_react259.useEffect)(() => { - return () => { - enableBodyScrolling(); - }; - }, []); - (0, import_react259.useEffect)(() => { - if (visible) { - disableBodyScrolling(); - } else { - enableBodyScrolling(); - } - }, [visible]); - (0, import_react259.useEffect)(() => { - if (visible && refObject.current) { - refObject.current.scrollTop = 0; - } - }, [visible]); - const dismiss = (reason) => fireNonCancelableEvent(onDismiss, { reason }); - const onOverlayMouseDown = (event) => { - lastMouseDownElementRef.current = event.target; - }; - const onOverlayClick = (event) => { - const overlay = refObject.current; - const lastClicked = lastMouseDownElementRef.current; - if (event.target === overlay && lastClicked === overlay) { - dismiss("overlay"); - } - }; - const onCloseButtonClick = () => dismiss("closeButton"); - const escKeyHandler = (event) => { - if (event.keyCode === KeyCode.escape) { - dismiss("keyboard"); - } - }; - const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver(); - const [footerHeight, footerRef] = useContainerQuery((rect) => rect.borderBoxHeight); - const { subStepRef } = useFunnelSubStep(); - return import_react259.default.createElement( - FunnelNameSelectorContext.Provider, - { value: `.${styles_css_default79["header--text"]}` }, - import_react259.default.createElement( - reset_contexts_for_modal_default, - null, - import_react259.default.createElement( - ModalContext.Provider, - { value: { isInModal: true } }, - import_react259.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default79.root, { [styles_css_default79.hidden]: !visible }, baseProps.className, isRefresh && styles_css_default79.refresh), role: "dialog", "aria-modal": true, "aria-labelledby": headerId, onMouseDown: onOverlayMouseDown, onClick: onOverlayClick, ref: mergedRef, style: footerHeight ? { scrollPaddingBottom: footerHeight } : void 0, "data-awsui-referrer-id": (_b = subStepRef.current) === null || _b === void 0 ? void 0 : _b.id }), - import_react259.default.createElement( - focus_lock_default, - { disabled: !visible, autoFocus: true, restoreFocus: true, className: styles_css_default79["focus-lock"] }, - import_react259.default.createElement( - "div", - { className: clsx_m_default(styles_css_default79.dialog, styles_css_default79[size2], styles_css_default79[`breakpoint-${breakpoint}`], isRefresh && styles_css_default79.refresh), onKeyDown: escKeyHandler }, - import_react259.default.createElement( - "div", - { className: styles_css_default79.container }, - import_react259.default.createElement( - "div", - { className: styles_css_default79.header }, - import_react259.default.createElement( - InternalHeader, - { variant: "h2", __disableActionsWrapping: true, actions: import_react259.default.createElement(InternalButton, { ariaLabel: closeAriaLabel, className: styles_css_default79["dismiss-control"], variant: "modal-dismiss", iconName: "close", formAction: "none", onClick: onCloseButtonClick }) }, - import_react259.default.createElement("span", { id: headerId, className: styles_css_default79["header--text"] }, header) - ) - ), - import_react259.default.createElement( - "div", - { className: clsx_m_default(styles_css_default79.content, { [styles_css_default79["no-paddings"]]: disableContentPaddings }) }, - children2, - import_react259.default.createElement("div", { ref: stickySentinelRef }) - ), - footer && import_react259.default.createElement("div", { ref: footerRef, className: clsx_m_default(styles_css_default79.footer, footerStuck && styles_css_default79["footer--stuck"]) }, footer) - ) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/select/internal.js -var import_react260 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/select/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/select/styles.scoped.css"; -var styles_css_default80 = { - "root": "awsui_root_r2vco_wvvus_99" -}; - -// node_modules/@cloudscape-design/components/select/internal.js -var InternalSelect = import_react260.default.forwardRef((_a2, externalRef) => { - var _b; - var { options, filteringType = "none", filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, filteringResultsText, ariaRequired, placeholder, disabled, ariaLabel, statusType = "finished", empty, loadingText, finishedText, errorText, noMatch, triggerVariant = "label", renderHighlightedAriaLive, selectedOption, onBlur, onFocus, onLoadItems, onChange, virtualScroll, expandToViewport, autoFocus, __inFilteringToken, __internalRootRef = null } = _a2, restProps = __rest(_a2, ["options", "filteringType", "filteringPlaceholder", "filteringAriaLabel", "filteringClearAriaLabel", "filteringResultsText", "ariaRequired", "placeholder", "disabled", "ariaLabel", "statusType", "empty", "loadingText", "finishedText", "errorText", "noMatch", "triggerVariant", "renderHighlightedAriaLive", "selectedOption", "onBlur", "onFocus", "onLoadItems", "onChange", "virtualScroll", "expandToViewport", "autoFocus", "__inFilteringToken", "__internalRootRef"]); - const baseProps = getBaseProps(restProps); - const formFieldContext = useFormFieldContext(restProps); - const i18n = useInternalI18n("select"); - const errorIconAriaLabel = i18n("errorIconAriaLabel", restProps.errorIconAriaLabel); - const selectedAriaLabel = i18n("selectedAriaLabel", restProps.selectedAriaLabel); - const recoveryText = i18n("recoveryText", restProps.recoveryText); - if (restProps.recoveryText && !onLoadItems) { - warnOnce("Select", "`onLoadItems` must be provided for `recoveryText` to be displayed."); - } - const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({ - onLoadItems, - options, - statusType - }); - checkControlled("Select", "selectedOption", selectedOption, "onChange", onChange); - checkOptionValueField("Select", "options", options); - const [filteringValue, setFilteringValue] = (0, import_react260.useState)(""); - const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(options, filteringType, filteringValue); - const rootRef = (0, import_react260.useRef)(null); - const triggerRef = (0, import_react260.useRef)(null); - const selfControlId = useUniqueId("trigger"); - const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId; - const scrollToIndex = (0, import_react260.useRef)(null); - const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps: getOptionProps2, highlightOption, selectOption, announceSelected } = useSelect({ - selectedOptions: selectedOption ? [selectedOption] : [], - updateSelectedOption: (option) => fireNonCancelableEvent(onChange, { selectedOption: option }), - options: filteredOptions, - filteringType, - onBlur, - onFocus, - externalRef, - fireLoadItems, - setFilteringValue, - statusType - }); - const handleNativeSearch = useNativeSearch({ - isEnabled: filteringType === "none", - options: filteredOptions, - highlightOption: !isOpen ? selectOption : highlightOption, - highlightedOption: !isOpen ? selectedOption : highlightedOption === null || highlightedOption === void 0 ? void 0 : highlightedOption.option - }); - const selectAriaLabelId = useUniqueId("select-arialabel-"); - const footerId = useUniqueId("footer"); - (0, import_react260.useEffect)(() => { - var _a3; - (_a3 = scrollToIndex.current) === null || _a3 === void 0 ? void 0 : _a3.call(scrollToIndex, highlightedIndex); - }, [highlightedIndex]); - const filter = import_react260.default.createElement(filter_default, Object.assign({ clearAriaLabel: filteringClearAriaLabel, filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired, value: filteringValue }, getFilterProps())); - const trigger2 = import_react260.default.createElement(trigger_default, Object.assign({ ref: triggerRef, placeholder, disabled, triggerVariant, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption, isOpen, inFilteringToken: __inFilteringToken }, formFieldContext, { controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId) })); - const isEmpty = !options || options.length === 0; - const isNoMatch = filteredOptions && filteredOptions.length === 0; - const isFiltered = filteringType !== "none" && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0; - const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(matchesCount, totalCount) : void 0; - const dropdownStatus = useDropdownStatus({ - statusType, - empty, - loadingText, - finishedText, - errorText, - recoveryText, - isEmpty, - isNoMatch, - noMatch, - isFiltered, - filteringResultsText: filteredText, - errorIconAriaLabel, - onRecoveryClick: handleRecoveryClick, - hasRecoveryCallback: !!onLoadItems - }); - const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(selectAriaLabelId, controlId), ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); - const announcement = useAnnouncement({ - announceSelected, - highlightedOption, - getParent: (option) => { - var _a3; - return (_a3 = parentMap.get(option)) === null || _a3 === void 0 ? void 0 : _a3.option; - }, - selectedAriaLabel, - renderHighlightedAriaLive - }); - const ListComponent = virtualScroll ? virtual_list_default : plain_list_default; - const handleMouseDown = (event) => { - const target = event.target; - if (target !== document.activeElement) { - event.preventDefault(); - } - }; - const mergedRef = useMergeRefs(rootRef, __internalRootRef); - const dropdownProps = getDropdownProps(); - return import_react260.default.createElement( - "div", - Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(styles_css_default80.root, baseProps.className), onKeyDown: handleNativeSearch }), - import_react260.default.createElement( - dropdown_default, - Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : void 0, ariaDescribedby: dropdownProps.dropdownContentRole ? dropdownStatus.content ? footerId : void 0 : void 0, open: isOpen, stretchTriggerHeight: __inFilteringToken, stretchBeyondTriggerWidth: true, trigger: trigger2, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? import_react260.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, expandToViewport }), - import_react260.default.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? import_react260.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, screenReaderContent: announcement, highlightType }) - ), - import_react260.default.createElement(ScreenreaderOnly, { id: selectAriaLabelId }, ariaLabel) - ); -}); -var internal_default12 = InternalSelect; - -// node_modules/@cloudscape-design/components/code-editor/preferences-modal.js -function filterThemes(allThemes, available) { - return allThemes.filter((theme2) => available.indexOf(theme2.value) > -1); -} -var preferences_modal_default = (props2) => { - var _a2, _b, _c, _d; - const [wrapLines, setWrapLines] = (0, import_react261.useState)((_b = (_a2 = props2.preferences) === null || _a2 === void 0 ? void 0 : _a2.wrapLines) !== null && _b !== void 0 ? _b : true); - const [theme2, setTheme2] = (0, import_react261.useState)((_d = (_c = props2.preferences) === null || _c === void 0 ? void 0 : _c.theme) !== null && _d !== void 0 ? _d : props2.defaultTheme); - const themeOptions = [ - { - label: props2.i18nStrings.lightThemes, - options: filterThemes(LightThemes, props2.themes.light) - }, - { - label: props2.i18nStrings.darkThemes, - options: filterThemes(DarkThemes, props2.themes.dark) - } - ]; - const [selectedThemeOption, setSelectedThemeOption] = (0, import_react261.useState)(() => [...LightThemes, ...DarkThemes].filter((t) => t.value === theme2)[0]); - const onThemeSelected = (e) => { - setTheme2(e.detail.selectedOption.value); - setSelectedThemeOption(e.detail.selectedOption); - }; - return import_react261.default.createElement( - InternalModal, - { size: "medium", visible: true, getModalRoot: props2.getModalRoot, removeModalRoot: props2.removeModalRoot, onDismiss: props2.onDismiss, header: props2.i18nStrings.header, closeAriaLabel: props2.i18nStrings.cancel, footer: import_react261.default.createElement( - InternalBox, - { float: "right" }, - import_react261.default.createElement( - InternalSpaceBetween, - { direction: "horizontal", size: "xs" }, - import_react261.default.createElement(InternalButton, { onClick: props2.onDismiss }, props2.i18nStrings.cancel), - import_react261.default.createElement(InternalButton, { onClick: () => props2.onConfirm({ wrapLines, theme: theme2 }), variant: "primary" }, props2.i18nStrings.confirm) - ) - ) }, - import_react261.default.createElement( - ColumnLayout, - { columns: 2, variant: "text-grid" }, - import_react261.default.createElement( - "div", - null, - import_react261.default.createElement(internal_default11, { checked: wrapLines, onChange: (e) => setWrapLines(e.detail.checked) }, props2.i18nStrings.wrapLines) - ), - import_react261.default.createElement( - "div", - null, - import_react261.default.createElement( - InternalFormField, - { label: props2.i18nStrings.theme }, - import_react261.default.createElement(internal_default12, { selectedOption: selectedThemeOption, onChange: onThemeSelected, options: themeOptions, filteringType: "auto", filteringAriaLabel: props2.i18nStrings.themeFilteringAriaLabel, filteringClearAriaLabel: props2.i18nStrings.themeFilteringClearAriaLabel, filteringPlaceholder: props2.i18nStrings.themeFilteringPlaceholder }) - ) - ) - ) - ); -}; - -// node_modules/@cloudscape-design/components/code-editor/loading-screen.js -var import_react262 = __toESM(require_react()); -var loading_screen_default = (props2) => import_react262.default.createElement( - "div", - { className: styles_css_default78["loading-screen"] }, - import_react262.default.createElement(InternalSpinner, { size: "normal", variant: "normal" }), - " ", - props2.children -); - -// node_modules/@cloudscape-design/components/code-editor/error-screen.js -var import_react263 = __toESM(require_react()); -var error_screen_default = ({ children: children2, recoveryText, onRecoveryClick }) => { - const onFollow = (0, import_react263.useCallback)(() => fireNonCancelableEvent(onRecoveryClick), [onRecoveryClick]); - return import_react263.default.createElement( - "div", - { className: styles_css_default78["error-screen"] }, - import_react263.default.createElement(internal_default, { name: "status-negative", variant: "error" }), - " ", - children2, - " ", - import_react263.default.createElement(internal_default5, { variant: "recovery", onFollow }, recoveryText) - ); -}; - -// node_modules/@cloudscape-design/components/code-editor/status-bar.js -var import_react265 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/code-editor/tab-button.js -var import_react264 = __toESM(require_react()); -var TabButton = import_react264.default.forwardRef(({ active, disabled, iconName, onClick, onFocus, onBlur, tabIndex, ariaHidden, ariaLabel, paneId, isRefresh, text, className: className2, id }, ref) => { - return import_react264.default.createElement( - "button", - { className: clsx_m_default([styles_css_default78["tab-button"], className2], { - [styles_css_default78["tab-button--active"]]: active, - [styles_css_default78["tab-button--disabled"]]: disabled, - [styles_css_default78["tab-button--refresh"]]: isRefresh - }), id, type: "button", onClick, onFocus, onBlur, disabled, ref, tabIndex, role: "tab", "aria-selected": active, "aria-controls": paneId, "aria-hidden": ariaHidden, "aria-label": ariaLabel }, - import_react264.default.createElement(internal_default, { name: iconName }), - " ", - text - ); -}); - -// node_modules/@cloudscape-design/components/code-editor/status-bar.js -function InternalStatusBar({ languageLabel, cursorPosition, paneStatus, onErrorPaneToggle, onWarningPaneToggle, onTabFocus, onTabBlur, errorsTabRef, warningsTabRef, isTabFocused, paneId, onPreferencesOpen, i18nStrings, errorCount, warningCount, leftBarRef, isVirtual, minifyCounters, isRefresh }) { - const i18n = useInternalI18n("code-editor"); - const errorText = `${i18n("i18nStrings.errorsTab", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorsTab)}: ${errorCount}`; - const warningText = `${i18n("i18nStrings.warningsTab", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningsTab)}: ${warningCount}`; - const errorButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: "error" }) : void 0; - const warningButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: "warning" }) : void 0; - return import_react265.default.createElement( - "div", - { className: clsx_m_default(styles_css_default78["status-bar"], { - [styles_css_default78["status-bar-with-hidden-pane"]]: paneStatus === "hidden", - [styles_css_default78["status-bar-virtual"]]: isVirtual - }), "aria-hidden": isVirtual }, - import_react265.default.createElement( - "div", - { className: clsx_m_default(styles_css_default78["status-bar__left"], { - [styles_css_default78["status-bar__left-virtual"]]: isVirtual - }), ref: leftBarRef }, - import_react265.default.createElement("span", { className: styles_css_default78["status-bar__language-mode"] }, languageLabel), - import_react265.default.createElement("span", { className: styles_css_default78["status-bar__cursor-position"] }, cursorPosition), - import_react265.default.createElement( - "div", - { role: "tablist" }, - import_react265.default.createElement(TabButton, { id: errorButtonId, text: minifyCounters ? ` ${errorCount}` : errorText, className: styles_css_default78["tab-button--errors"], iconName: "status-negative", disabled: errorCount === 0 || isVirtual, active: paneStatus === "error", onClick: onErrorPaneToggle, onFocus: onTabFocus, onBlur: onTabBlur, ref: errorsTabRef, ariaLabel: errorText, paneId, isRefresh }), - import_react265.default.createElement("span", { className: styles_css_default78["tab-button--divider"] }), - import_react265.default.createElement(TabButton, { id: warningButtonId, text: minifyCounters ? ` ${warningCount}` : warningText, className: styles_css_default78["tab-button--warnings"], iconName: "status-warning", disabled: warningCount === 0 || isVirtual, active: paneStatus === "warning", onClick: onWarningPaneToggle, onFocus: onTabFocus, onBlur: onTabBlur, ref: warningsTabRef, tabIndex: paneStatus === "error" && isTabFocused ? -1 : void 0, ariaHidden: paneStatus === "error" && isTabFocused ? true : void 0, ariaLabel: warningText, paneId, isRefresh }) - ), - import_react265.default.createElement( - live_region_default, - { assertive: true }, - import_react265.default.createElement( - "span", - null, - errorText, - " " - ), - import_react265.default.createElement("span", null, warningText) - ) - ), - import_react265.default.createElement( - "div", - { className: styles_css_default78["status-bar__right"] }, - import_react265.default.createElement( - "div", - { className: styles_css_default78["status-bar__cog-button"] }, - import_react265.default.createElement(InternalButton, { disabled: isVirtual, formAction: "none", variant: "icon", iconName: "settings", iconAlt: "Settings", ariaLabel: i18n("i18nStrings.preferencesButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesButtonAriaLabel), onClick: onPreferencesOpen, __nativeAttributes: { - tabIndex: paneStatus !== "hidden" && isTabFocused ? -1 : void 0, - "aria-hidden": paneStatus !== "hidden" && isTabFocused ? true : void 0 - } }) - ) - ) - ); -} -var StatusBar = (_a2) => { - var { errorsTabRef, warningsTabRef } = _a2, restProps = __rest(_a2, ["errorsTabRef", "warningsTabRef"]); - const [realWidth, statusLeftBarRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const [virtualWidth, virtualStatusLeftBarRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const minifyCounters = virtualWidth !== null && realWidth !== null && virtualWidth > realWidth; - return import_react265.default.createElement( - import_react265.default.Fragment, - null, - import_react265.default.createElement(InternalStatusBar, Object.assign({}, restProps, { isVirtual: false, leftBarRef: statusLeftBarRef, errorsTabRef, warningsTabRef, minifyCounters })), - import_react265.default.createElement(InternalStatusBar, Object.assign({}, restProps, { isVirtual: true, leftBarRef: virtualStatusLeftBarRef, minifyCounters: false })) - ); -}; - -// node_modules/@cloudscape-design/components/code-editor/use-editor.js -var import_react266 = __toESM(require_react()); -function useEditor(ace, themes, loading) { - const editorRef = (0, import_react266.useRef)(null); - const [editor, setEditor] = (0, import_react266.useState)(null); - const [initialTheme] = (0, import_react266.useState)(getAceTheme(getDefaultTheme(useCurrentMode(editorRef), themes))); - (0, import_react266.useEffect)(() => { - const elem = editorRef.current; - if (!ace || !elem) { - return; - } - const config = getDefaultConfig(ace); - setEditor(ace.edit(elem, Object.assign(Object.assign({}, config), { theme: initialTheme }))); - }, [ace, loading, initialTheme]); - return { editorRef, editor }; -} -function useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby }) { - (0, import_react266.useEffect)(() => { - if (!editor) { - return; - } - const { textarea } = editor.renderer; - if (!textarea) { - return; - } - const updateAttribute = (attribute, value) => value ? textarea.setAttribute(attribute, value) : textarea.removeAttribute(attribute); - updateAttribute("id", controlId); - updateAttribute("aria-label", ariaLabel); - updateAttribute("aria-labelledby", ariaLabelledby); - updateAttribute("aria-describedby", ariaDescribedby); - }, [ariaLabel, ariaDescribedby, ariaLabelledby, controlId, editor]); -} -function useSyncEditorSize(editor, { width, height }) { - (0, import_react266.useEffect)(() => { - editor === null || editor === void 0 ? void 0 : editor.resize(); - }, [editor, width, height]); - const onResize = (0, import_react266.useCallback)(() => { - editor === null || editor === void 0 ? void 0 : editor.resize(); - }, [editor]); - return { onResize }; -} -function useSyncEditorValue(editor, value) { - (0, import_react266.useEffect)(() => { - if (!editor) { - return; - } - if (value === editor.getValue()) { - return; - } - const pos = editor.session.selection.toJSON(); - editor.setValue(value, -1); - editor.session.selection.fromJSON(pos); - }, [editor, value]); -} -function useSyncEditorLanguage(editor, language) { - (0, import_react266.useEffect)(() => { - editor === null || editor === void 0 ? void 0 : editor.session.setMode(`ace/mode/${language}`); - }, [editor, language]); -} -function useSyncEditorWrapLines(editor, wrapLines) { - (0, import_react266.useEffect)(() => { - editor === null || editor === void 0 ? void 0 : editor.session.setUseWrapMode(wrapLines !== null && wrapLines !== void 0 ? wrapLines : true); - }, [editor, wrapLines]); -} -function useSyncEditorTheme(editor, theme2) { - (0, import_react266.useEffect)(() => { - editor === null || editor === void 0 ? void 0 : editor.setTheme(getAceTheme(theme2)); - }, [editor, theme2]); -} - -// node_modules/@cloudscape-design/components/code-editor/index.js -var CodeEditor = (0, import_react267.forwardRef)((props2, ref) => { - var _a2, _b; - const { ace, value, language, i18nStrings, editorContentHeight, onEditorContentResize, ariaLabel, languageLabel: customLanguageLabel, preferences, loading, themes, getModalRoot, removeModalRoot } = props2, rest = __rest(props2, ["ace", "value", "language", "i18nStrings", "editorContentHeight", "onEditorContentResize", "ariaLabel", "languageLabel", "preferences", "loading", "themes", "getModalRoot", "removeModalRoot"]); - const { __internalRootRef } = useBaseComponent("CodeEditor", { props: { language } }); - const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props2); - const [editorHeight = 480, setEditorHeight] = useControllable2(editorContentHeight, onEditorContentResize, 480, { - componentName: "code-editor", - changeHandler: "onEditorContentResize", - controlledProp: "editorContentHeight" - }); - const mode = useCurrentMode(__internalRootRef); - const isRefresh = useVisualRefresh(); - const baseProps = getBaseProps(rest); - const i18n = useInternalI18n("code-editor"); - const errorsTabRef = (0, import_react267.useRef)(null); - const warningsTabRef = (0, import_react267.useRef)(null); - const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const mergedRef = useMergeRefs(codeEditorMeasureRef, __internalRootRef); - const paneId = useUniqueId("code-editor-pane"); - const [paneStatus, setPaneStatus] = (0, import_react267.useState)("hidden"); - const [annotations, setAnnotations] = (0, import_react267.useState)([]); - const [highlightedAnnotation, setHighlightedAnnotation] = (0, import_react267.useState)(); - const [cursorPosition, setCursorPosition] = (0, import_react267.useState)({ row: 0, column: 0 }); - const [isTabFocused, setTabFocused] = (0, import_react267.useState)(false); - const { editorRef, editor } = useEditor(ace, themes, loading); - useForwardFocus(ref, editorRef); - (0, import_react267.useEffect)(() => { - if (!ace || !editor) { - return; - } - setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus); - return () => { - editor === null || editor === void 0 ? void 0 : editor.destroy(); - }; - }, [ace, editor]); - useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby }); - const { onResize } = useSyncEditorSize(editor, { width: codeEditorWidth, height: editorContentHeight }); - useSyncEditorValue(editor, value); - useSyncEditorLanguage(editor, language); - useSyncEditorWrapLines(editor, preferences === null || preferences === void 0 ? void 0 : preferences.wrapLines); - const defaultTheme = getDefaultTheme(mode, themes); - useSyncEditorTheme(editor, (_a2 = preferences === null || preferences === void 0 ? void 0 : preferences.theme) !== null && _a2 !== void 0 ? _a2 : defaultTheme); - useChangeEffect(editor, props2.onChange, props2.onDelayedChange); - (0, import_react267.useEffect)(() => { - if (annotations.length === 0) { - setPaneStatus("hidden"); - } - if (props2.onValidate) { - fireNonCancelableEvent(props2.onValidate, { annotations }); - } - }, [annotations, props2.onValidate]); - const languageLabel = customLanguageLabel !== null && customLanguageLabel !== void 0 ? customLanguageLabel : getLanguageLabel(language); - const errorCount = annotations.filter((a2) => a2.type === "error").length; - const warningCount = annotations.filter((a2) => a2.type === "warning").length; - const currentAnnotations = (0, import_react267.useMemo)(() => annotations.filter((a2) => a2.type === paneStatus), [annotations, paneStatus]); - const onEditorKeydown = (0, import_react267.useCallback)((e) => { - if (editor && e.target === editor.container && e.keyCode === KeyCode.enter) { - e.stopPropagation(); - e.preventDefault(); - editor.focus(); - } - }, [editor]); - const onTabFocus = (0, import_react267.useCallback)(() => setTabFocused(true), []); - const onTabBlur = (0, import_react267.useCallback)(() => setTabFocused(false), []); - const onErrorPaneToggle = (0, import_react267.useCallback)(() => { - setPaneStatus(paneStatus !== "error" ? "error" : "hidden"); - }, [paneStatus]); - const onWarningPaneToggle = (0, import_react267.useCallback)(() => { - setPaneStatus(paneStatus !== "warning" ? "warning" : "hidden"); - }, [paneStatus]); - const onPaneClose = () => { - setPaneStatus("hidden"); - }; - const onAnnotationClick = ({ row = 0, column = 0 }) => { - if (!editor) { - return; - } - editor.focus(); - editor.gotoLine(row + 1, column, false); - setHighlightedAnnotation(void 0); - }; - const onAnnotationClear = (0, import_react267.useCallback)(() => { - setHighlightedAnnotation(void 0); - }, []); - const [isPreferencesModalVisible, setPreferencesModalVisible] = (0, import_react267.useState)(false); - const onPreferencesOpen = () => setPreferencesModalVisible(true); - const onPreferencesConfirm = (p) => { - fireNonCancelableEvent(props2.onPreferencesChange, p); - setPreferencesModalVisible(false); - }; - const onPreferencesDismiss = () => setPreferencesModalVisible(false); - const isPaneVisible = paneStatus !== "hidden"; - return import_react267.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default78["code-editor"], baseProps.className, { [styles_css_default78["code-editor-refresh"]]: isRefresh }), ref: mergedRef }), - loading && import_react267.default.createElement( - loading_screen_default, - null, - import_react267.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loadingState", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingState)) - ), - !ace && !loading && import_react267.default.createElement(error_screen_default, { recoveryText: i18n("i18nStrings.errorStateRecovery", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorStateRecovery), onRecoveryClick: props2.onRecoveryClick }, i18n("i18nStrings.errorState", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorState)), - ace && !loading && import_react267.default.createElement( - import_react267.default.Fragment, - null, - import_react267.default.createElement( - ResizableBox, - { height: Math.max(editorHeight, 20), minHeight: 20, onResize: (height) => { - setEditorHeight(height); - onResize(); - fireNonCancelableEvent(onEditorContentResize, { height }); - } }, - import_react267.default.createElement("div", { ref: editorRef, className: clsx_m_default(styles_css_default78.editor, styles_css_default78.ace, isRefresh && styles_css_default78["editor-refresh"]), onKeyDown: onEditorKeydown, tabIndex: 0, role: "group", "aria-label": i18n("i18nStrings.editorGroupAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.editorGroupAriaLabel) }) - ), - import_react267.default.createElement( - "div", - { role: "group", "aria-label": i18n("i18nStrings.statusBarGroupAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.statusBarGroupAriaLabel) }, - import_react267.default.createElement(StatusBar, { languageLabel, cursorPosition: i18n("i18nStrings.cursorPosition", (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cursorPosition) === null || _b === void 0 ? void 0 : _b.call(i18nStrings, cursorPosition.row + 1, cursorPosition.column + 1), (format3) => format3({ row: cursorPosition.row + 1, column: cursorPosition.column + 1 })), errorCount, warningCount, paneStatus, onErrorPaneToggle, onWarningPaneToggle, onTabFocus, onTabBlur, errorsTabRef, warningsTabRef, i18nStrings, isTabFocused, paneId: isPaneVisible ? paneId : void 0, onPreferencesOpen, isRefresh }), - import_react267.default.createElement(Pane, { id: paneId, paneStatus, visible: isPaneVisible, annotations: currentAnnotations, highlighted: highlightedAnnotation, onAnnotationClick, onAnnotationClear, onClose: onPaneClose, cursorPositionLabel: i18n("i18nStrings.cursorPosition", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cursorPosition, (format3) => (row, column) => format3({ row, column })), closeButtonAriaLabel: i18n("i18nStrings.paneCloseButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.paneCloseButtonAriaLabel) }) - ), - isPreferencesModalVisible && import_react267.default.createElement(preferences_modal_default, { getModalRoot, removeModalRoot, onConfirm: onPreferencesConfirm, onDismiss: onPreferencesDismiss, themes: themes !== null && themes !== void 0 ? themes : DEFAULT_AVAILABLE_THEMES, preferences, defaultTheme, i18nStrings: { - header: i18n("i18nStrings.preferencesModalHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalHeader), - cancel: i18n("i18nStrings.preferencesModalCancel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalCancel), - confirm: i18n("i18nStrings.preferencesModalConfirm", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalConfirm), - wrapLines: i18n("i18nStrings.preferencesModalWrapLines", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalWrapLines), - theme: i18n("i18nStrings.preferencesModalTheme", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalTheme), - lightThemes: i18n("i18nStrings.preferencesModalLightThemes", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalLightThemes), - darkThemes: i18n("i18nStrings.preferencesModalDarkThemes", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalDarkThemes), - themeFilteringAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringAriaLabel, - themeFilteringClearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringClearAriaLabel, - themeFilteringPlaceholder: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringPlaceholder - } }) - ) - ); -}); -applyDisplayName(CodeEditor, "CodeEditor"); -var code_editor_default = CodeEditor; - -// node_modules/@cloudscape-design/components/collection-preferences/index.js -var import_react284 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/collection-preferences/utils.js -var import_react270 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/radio-group/internal.js -var import_react269 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/hooks/forward-focus/radio-group.js -var import_react268 = __toESM(require_react()); -function useRadioGroupForwardFocus(forwardedRef, items, value) { - const itemRef = (0, import_react268.useRef)(null); - const itemIndex = items && findIndex2(items, (item) => item.value === value); - (0, import_react268.useImperativeHandle)(forwardedRef, () => ({ - focus() { - var _a2; - (_a2 = itemRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - })); - return [itemRef, itemIndex !== void 0 && itemIndex !== -1 ? itemIndex : 0]; -} -function findIndex2(items, predicate) { - for (let i = 0; i < items.length; i++) { - if (predicate(items[i])) { - return i; - } - } - return -1; -} - -// node_modules/@cloudscape-design/components/radio-group/internal.js -var InternalRadioGroup = import_react269.default.forwardRef((_a2, ref) => { - var { name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "onChange", "__internalRootRef"]); - const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props2); - const baseProps = getBaseProps(props2); - const generatedName = useUniqueId("awsui-radio-"); - const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value); - return import_react269.default.createElement("div", Object.assign({ role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default75.root), ref: __internalRootRef }), items && items.map((item, index) => import_react269.default.createElement(radio_button_default, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : void 0, checked: item.value === value, name: name || generatedName, value: item.value, label: item.label, description: item.description, disabled: item.disabled, onChange, controlId: item.controlId }))); -}); -var internal_default13 = InternalRadioGroup; - -// node_modules/@cloudscape-design/components/collection-preferences/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/collection-preferences/styles.scoped.css"; -var styles_css_default81 = { - "visible-content": "awsui_visible-content_tc96w_5j4hz_197", - "visible-content-toggle": "awsui_visible-content-toggle_tc96w_5j4hz_198", - "visible-content-groups": "awsui_visible-content-groups_tc96w_5j4hz_199", - "visible-content-group": "awsui_visible-content-group_tc96w_5j4hz_199", - "visible-content-title": "awsui_visible-content-title_tc96w_5j4hz_204", - "visible-content-group-label": "awsui_visible-content-group-label_tc96w_5j4hz_214", - "visible-content-option": "awsui_visible-content-option_tc96w_5j4hz_220", - "visible-content-option-label": "awsui_visible-content-option-label_tc96w_5j4hz_233", - "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_5j4hz_436", - "content-display-option-content": "awsui_content-display-option-content_tc96w_5j4hz_440", - "content-display-option": "awsui_content-display-option_tc96w_5j4hz_436", - "placeholder": "awsui_placeholder_tc96w_5j4hz_490", - "sorting": "awsui_sorting_tc96w_5j4hz_490", - "content-display-option-label": "awsui_content-display-option-label_tc96w_5j4hz_517", - "drag-overlay": "awsui_drag-overlay_tc96w_5j4hz_524", - "content-display": "awsui_content-display_tc96w_5j4hz_436", - "content-display-title": "awsui_content-display-title_tc96w_5j4hz_557", - "content-display-description": "awsui_content-display-description_tc96w_5j4hz_566", - "content-display-option-list": "awsui_content-display-option-list_tc96w_5j4hz_574", - "root": "awsui_root_tc96w_5j4hz_581", - "modal-root": "awsui_modal-root_tc96w_5j4hz_582", - "trigger-button": "awsui_trigger-button_tc96w_5j4hz_583", - "cancel-button": "awsui_cancel-button_tc96w_5j4hz_584", - "confirm-button": "awsui_confirm-button_tc96w_5j4hz_585", - "custom": "awsui_custom_tc96w_5j4hz_586", - "second-column-small": "awsui_second-column-small_tc96w_5j4hz_590", - "wrap-lines": "awsui_wrap-lines_tc96w_5j4hz_594", - "striped-rows": "awsui_striped-rows_tc96w_5j4hz_595", - "content-density": "awsui_content-density_tc96w_5j4hz_596", - "page-size": "awsui_page-size_tc96w_5j4hz_597", - "page-size-form-field": "awsui_page-size-form-field_tc96w_5j4hz_598", - "page-size-radio-group": "awsui_page-size-radio-group_tc96w_5j4hz_599", - "sticky-columns": "awsui_sticky-columns_tc96w_5j4hz_600", - "sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_5j4hz_601", - "sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_5j4hz_602", - "sticky-columns-first": "awsui_sticky-columns-first_tc96w_5j4hz_603", - "sticky-columns-last": "awsui_sticky-columns-last_tc96w_5j4hz_604" -}; - -// node_modules/@cloudscape-design/components/collection-preferences/utils.js -var copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom: custom8 }) => ({ - pageSize, - wrapLines, - stripedRows, - contentDensity, - visibleContent, - contentDisplay, - stickyColumns, - custom: custom8 -}); -var mergePreferences = (newPref, oldPref) => { - const newObj = Object.assign({}, oldPref); - const prefNames = [ - "pageSize", - "wrapLines", - "stripedRows", - "contentDensity", - "visibleContent", - "custom", - "contentDisplay", - "stickyColumns" - ]; - for (const prefName of prefNames) { - if (newPref[prefName] !== void 0) { - newObj[prefName] = newPref[prefName]; - } - } - return newObj; -}; -var ModalContentLayout = ({ left, right }) => { - const [breakpoint, ref] = useContainerBreakpoints(["xs"]); - const smallContainer = breakpoint === "default"; - if (smallContainer) { - return import_react270.default.createElement( - "div", - { ref }, - left && import_react270.default.createElement("div", null, left), - right && import_react270.default.createElement("div", { className: clsx_m_default(left && styles_css_default81["second-column-small"]) }, right) - ); - } - const columns = left && right ? 2 : 1; - return import_react270.default.createElement( - "div", - { ref }, - import_react270.default.createElement( - ColumnLayout, - { columns, variant: "text-grid" }, - left && import_react270.default.createElement("div", null, left), - right && import_react270.default.createElement("div", null, right) - ) - ); -}; -var PageSizePreference = ({ title, options, value, onChange }) => { - const i18n = useInternalI18n("collection-preferences"); - return import_react270.default.createElement( - "div", - { className: styles_css_default81["page-size"] }, - import_react270.default.createElement( - InternalFormField, - { label: i18n("pageSizePreference.title", title), stretch: true, className: styles_css_default81["page-size-form-field"] }, - import_react270.default.createElement(internal_default13, { className: styles_css_default81["page-size-radio-group"], value: `${value}`, items: options.map(({ label, value: value2 }) => ({ label, value: `${value2}` })), onChange: ({ detail }) => onChange(parseInt(detail.value, 10)) }) - ) - ); -}; -var WrapLinesPreference = ({ label, description, value, onChange }) => { - const i18n = useInternalI18n("collection-preferences"); - return import_react270.default.createElement(internal_default11, { checked: !!value, description: i18n("wrapLinesPreference.description", description), onChange: ({ detail }) => onChange(detail.checked), className: styles_css_default81["wrap-lines"] }, i18n("wrapLinesPreference.label", label)); -}; -function StripedRowsPreference({ label, description, value, onChange }) { - const i18n = useInternalI18n("collection-preferences"); - return import_react270.default.createElement(internal_default11, { checked: !!value, description: i18n("stripedRowsPreference.description", description), onChange: ({ detail }) => onChange(detail.checked), className: styles_css_default81["striped-rows"] }, i18n("stripedRowsPreference.label", label)); -} -var ContentDensityPreference = ({ label, description, value, onChange }) => { - const i18n = useInternalI18n("collection-preferences"); - return import_react270.default.createElement(internal_default11, { checked: value === "compact", description: i18n("contentDensityPreference.description", description), onChange: ({ detail }) => onChange(detail.checked ? "compact" : "comfortable"), className: styles_css_default81["content-density"] }, i18n("contentDensityPreference.label", label)); -}; -var StickyPreference = ({ firstOrLast, preference, value, onChange }) => { - const { title, description, options } = preference; - return import_react270.default.createElement( - "div", - { className: styles_css_default81[`sticky-columns-${firstOrLast}`] }, - import_react270.default.createElement( - InternalFormField, - { className: styles_css_default81["sticky-columns-form-field"], label: title, description }, - import_react270.default.createElement(internal_default13, { className: styles_css_default81["sticky-columns-radio-group"], value: typeof value !== "undefined" ? `${value}` : null, items: options.map(({ label, value: value2 }) => ({ label, value: `${value2}` })), onChange: ({ detail }) => onChange(Number(detail.value)) }) - ) - ); -}; -var StickyColumnsPreference = ({ firstColumns, lastColumns, onChange, value }) => { - return import_react270.default.createElement( - InternalSpaceBetween, - { className: styles_css_default81["sticky-columns"], size: "l" }, - firstColumns && import_react270.default.createElement(StickyPreference, { firstOrLast: "first", preference: firstColumns, value: value === null || value === void 0 ? void 0 : value.first, onChange: (newValue) => onChange(Object.assign(Object.assign({}, value), { first: newValue })) }), - lastColumns && import_react270.default.createElement(StickyPreference, { firstOrLast: "last", preference: lastColumns, value: value === null || value === void 0 ? void 0 : value.last, onChange: (newValue) => onChange(Object.assign(Object.assign({}, value), { last: newValue })) }) - ); -}; -var CustomPreference = ({ value, customPreference, onChange }) => { - const [customState, setCustomState] = (0, import_react270.useState)(value); - if (customPreference) { - return import_react270.default.createElement("div", { className: styles_css_default81.custom }, customPreference(customState, (value2) => { - setCustomState(() => value2); - onChange(value2); - })); - } - return null; -}; - -// node_modules/@cloudscape-design/components/collection-preferences/visible-content.js -var import_react272 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/toggle/internal.js -var import_react271 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/toggle/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/toggle/styles.scoped.css"; -var styles_css_default82 = { - "root": "awsui_root_4yi2u_11uib_99", - "outline": "awsui_outline_4yi2u_11uib_135", - "toggle-control": "awsui_toggle-control_4yi2u_11uib_157", - "toggle-control-checked": "awsui_toggle-control-checked_4yi2u_11uib_170", - "toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_11uib_173", - "toggle-handle": "awsui_toggle-handle_4yi2u_11uib_180", - "toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_11uib_195", - "toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_11uib_201" -}; - -// node_modules/@cloudscape-design/components/toggle/internal.js -var InternalToggle = import_react271.default.forwardRef((_a2, ref) => { - var { controlId, checked, name, disabled, children: children2, description, ariaLabel, ariaControls, onFocus, onBlur, onChange, __internalRootRef = null } = _a2, rest = __rest(_a2, ["controlId", "checked", "name", "disabled", "children", "description", "ariaLabel", "ariaControls", "onFocus", "onBlur", "onChange", "__internalRootRef"]); - const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest); - const baseProps = getBaseProps(rest); - const checkboxRef = (0, import_react271.useRef)(null); - useForwardFocus(ref, checkboxRef); - return import_react271.default.createElement(AbstractSwitch, Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default82.root, baseProps.className), controlClassName: clsx_m_default(styles_css_default82["toggle-control"], { - [styles_css_default82["toggle-control-checked"]]: checked, - [styles_css_default82["toggle-control-disabled"]]: disabled - }), outlineClassName: styles_css_default82.outline, controlId, disabled, label: children2, description, descriptionBottomPadding: true, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, nativeControl: (nativeControlProps) => import_react271.default.createElement("input", Object.assign({}, nativeControlProps, { - ref: checkboxRef, - type: "checkbox", - checked, - name, - onFocus: () => fireNonCancelableEvent(onFocus), - onBlur: () => fireNonCancelableEvent(onBlur), - // empty handler to suppress React controllability warning - onChange: () => { - } - })), onClick: () => { - var _a3; - (_a3 = checkboxRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - fireNonCancelableEvent(onChange, { checked: !checked }); - }, styledControl: ( - /*Using span, not div for HTML validity*/ - import_react271.default.createElement("span", { className: clsx_m_default(styles_css_default82["toggle-handle"], { - [styles_css_default82["toggle-handle-checked"]]: checked, - [styles_css_default82["toggle-handle-disabled"]]: disabled - }) }) - ), __internalRootRef })); -}); -var internal_default14 = InternalToggle; - -// node_modules/@cloudscape-design/components/collection-preferences/visible-content.js -var isVisible = (id, visibleIds) => visibleIds.indexOf(id) !== -1; -var className = (suffix) => ({ - className: styles_css_default81[`visible-content-${suffix}`] -}); -function VisibleContentPreference({ title, options, value = [], onChange }) { - const idPrefix = useUniqueId("visible-content"); - const flatOptionsIds = options.reduce((ids2, group) => [...ids2, ...group.options.reduce((groupIds, option) => [...groupIds, option.id], [])], []); - const onToggle = (id) => { - if (!isVisible(id, value)) { - onChange([...value, id].sort((firstId, secondId) => flatOptionsIds.indexOf(firstId) - flatOptionsIds.indexOf(secondId))); - } else { - onChange(value.filter((currentId) => currentId !== id)); - } - }; - const selectionOption = (option, optionGroupIndex, optionIndex) => { - const labelId = `${idPrefix}-${optionGroupIndex}-${optionIndex}`; - return import_react272.default.createElement( - "div", - Object.assign({ key: optionIndex }, className("option")), - import_react272.default.createElement("label", Object.assign({}, className("option-label"), { htmlFor: labelId }), option.label), - import_react272.default.createElement( - "div", - Object.assign({}, className("toggle")), - import_react272.default.createElement(internal_default14, { checked: isVisible(option.id, value), onChange: () => onToggle(option.id), disabled: option.editable === false, controlId: labelId }) - ) - ); - }; - const outerGroupLabelId = `${idPrefix}-outer`; - return import_react272.default.createElement( - "div", - { className: styles_css_default81["visible-content"] }, - import_react272.default.createElement("h3", Object.assign({}, className("title"), { id: outerGroupLabelId }), title), - import_react272.default.createElement(InternalSpaceBetween, Object.assign({}, className("groups"), { size: "xs" }), options.map((optionGroup, optionGroupIndex) => { - const groupLabelId = `${idPrefix}-${optionGroupIndex}`; - return import_react272.default.createElement( - "div", - Object.assign({ key: optionGroupIndex }, className("group"), { role: "group", "aria-labelledby": `${outerGroupLabelId} ${groupLabelId}` }), - import_react272.default.createElement("div", Object.assign({}, className("group-label"), { id: groupLabelId }), optionGroup.label), - import_react272.default.createElement("div", null, optionGroup.options.map((option, optionIndex) => selectionOption(option, optionGroupIndex, optionIndex))) - ); - })) - ); -} - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/index.js -var import_react283 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/utils.js -function getSortedOptions({ options, contentDisplay }) { - const optionsById = options.reduce((currentValue, option) => Object.assign(Object.assign({}, currentValue), { [option.id]: option }), {}); - return contentDisplay.map(({ id, visible }) => Object.assign(Object.assign({}, optionsById[id]), { visible })).filter(Boolean); -} - -// node_modules/@dnd-kit/core/dist/core.esm.js -var import_react275 = __toESM(require_react()); -var import_react_dom7 = __toESM(require_react_dom()); - -// node_modules/@dnd-kit/utilities/dist/utilities.esm.js -var import_react273 = __toESM(require_react()); -function useCombinedRefs() { - for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { - refs[_key] = arguments[_key]; - } - return (0, import_react273.useMemo)( - () => (node) => { - refs.forEach((ref) => ref(node)); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - refs - ); -} -var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; -function isWindow(element) { - const elementString = Object.prototype.toString.call(element); - return elementString === "[object Window]" || // In Electron context the Window object serializes to [object global] - elementString === "[object global]"; -} -function isNode(node) { - return "nodeType" in node; -} -function getWindow(target) { - var _target$ownerDocument, _target$ownerDocument2; - if (!target) { - return window; - } - if (isWindow(target)) { - return target; - } - if (!isNode(target)) { - return window; - } - return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; -} -function isDocument(node) { - const { - Document - } = getWindow(node); - return node instanceof Document; -} -function isHTMLElement(node) { - if (isWindow(node)) { - return false; - } - return node instanceof getWindow(node).HTMLElement; -} -function isSVGElement(node) { - return node instanceof getWindow(node).SVGElement; -} -function getOwnerDocument(target) { - if (!target) { - return document; - } - if (isWindow(target)) { - return target.document; - } - if (!isNode(target)) { - return document; - } - if (isDocument(target)) { - return target; - } - if (isHTMLElement(target) || isSVGElement(target)) { - return target.ownerDocument; - } - return document; -} -var useIsomorphicLayoutEffect2 = canUseDOM ? import_react273.useLayoutEffect : import_react273.useEffect; -function useEvent(handler) { - const handlerRef = (0, import_react273.useRef)(handler); - useIsomorphicLayoutEffect2(() => { - handlerRef.current = handler; - }); - return (0, import_react273.useCallback)(function() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return handlerRef.current == null ? void 0 : handlerRef.current(...args); - }, []); -} -function useInterval() { - const intervalRef = (0, import_react273.useRef)(null); - const set2 = (0, import_react273.useCallback)((listener, duration) => { - intervalRef.current = setInterval(listener, duration); - }, []); - const clear = (0, import_react273.useCallback)(() => { - if (intervalRef.current !== null) { - clearInterval(intervalRef.current); - intervalRef.current = null; - } - }, []); - return [set2, clear]; -} -function useLatestValue(value, dependencies) { - if (dependencies === void 0) { - dependencies = [value]; - } - const valueRef = (0, import_react273.useRef)(value); - useIsomorphicLayoutEffect2(() => { - if (valueRef.current !== value) { - valueRef.current = value; - } - }, dependencies); - return valueRef; -} -function useLazyMemo(callback, dependencies) { - const valueRef = (0, import_react273.useRef)(); - return (0, import_react273.useMemo)( - () => { - const newValue = callback(valueRef.current); - valueRef.current = newValue; - return newValue; - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [...dependencies] - ); -} -function useNodeRef(onChange) { - const onChangeHandler = useEvent(onChange); - const node = (0, import_react273.useRef)(null); - const setNodeRef = (0, import_react273.useCallback)( - (element) => { - if (element !== node.current) { - onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); - } - node.current = element; - }, - //eslint-disable-next-line - [] - ); - return [node, setNodeRef]; -} -function usePrevious2(value) { - const ref = (0, import_react273.useRef)(); - (0, import_react273.useEffect)(() => { - ref.current = value; - }, [value]); - return ref.current; -} -var ids = {}; -function useUniqueId2(prefix, value) { - return (0, import_react273.useMemo)(() => { - if (value) { - return value; - } - const id = ids[prefix] == null ? 0 : ids[prefix] + 1; - ids[prefix] = id; - return prefix + "-" + id; - }, [prefix, value]); -} -function createAdjustmentFn(modifier) { - return function(object2) { - for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - adjustments[_key - 1] = arguments[_key]; - } - return adjustments.reduce((accumulator, adjustment) => { - const entries = Object.entries(adjustment); - for (const [key2, valueAdjustment] of entries) { - const value = accumulator[key2]; - if (value != null) { - accumulator[key2] = value + modifier * valueAdjustment; - } - } - return accumulator; - }, { - ...object2 - }); - }; -} -var add2 = createAdjustmentFn(1); -var subtract = createAdjustmentFn(-1); -function hasViewportRelativeCoordinates(event) { - return "clientX" in event && "clientY" in event; -} -function isKeyboardEvent(event) { - if (!event) { - return false; - } - const { - KeyboardEvent - } = getWindow(event.target); - return KeyboardEvent && event instanceof KeyboardEvent; -} -function isTouchEvent(event) { - if (!event) { - return false; - } - const { - TouchEvent - } = getWindow(event.target); - return TouchEvent && event instanceof TouchEvent; -} -function getEventCoordinates(event) { - if (isTouchEvent(event)) { - if (event.touches && event.touches.length) { - const { - clientX: x2, - clientY: y2 - } = event.touches[0]; - return { - x: x2, - y: y2 - }; - } else if (event.changedTouches && event.changedTouches.length) { - const { - clientX: x2, - clientY: y2 - } = event.changedTouches[0]; - return { - x: x2, - y: y2 - }; - } - } - if (hasViewportRelativeCoordinates(event)) { - return { - x: event.clientX, - y: event.clientY - }; - } - return null; -} -var CSS2 = Object.freeze({ - Translate: { - toString(transform) { - if (!transform) { - return; - } - const { - x: x2, - y: y2 - } = transform; - return "translate3d(" + (x2 ? Math.round(x2) : 0) + "px, " + (y2 ? Math.round(y2) : 0) + "px, 0)"; - } - }, - Scale: { - toString(transform) { - if (!transform) { - return; - } - const { - scaleX, - scaleY - } = transform; - return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; - } - }, - Transform: { - toString(transform) { - if (!transform) { - return; - } - return [CSS2.Translate.toString(transform), CSS2.Scale.toString(transform)].join(" "); - } - }, - Transition: { - toString(_ref) { - let { - property, - duration, - easing - } = _ref; - return property + " " + duration + "ms " + easing; - } - } -}); -var SELECTOR = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]"; -function findFirstFocusableNode(element) { - if (element.matches(SELECTOR)) { - return element; - } - return element.querySelector(SELECTOR); -} - -// node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js -var import_react274 = __toESM(require_react()); -var hiddenStyles = { - display: "none" -}; -function HiddenText(_ref) { - let { - id, - value - } = _ref; - return import_react274.default.createElement("div", { - id, - style: hiddenStyles - }, value); -} -function LiveRegion2(_ref) { - let { - id, - announcement, - ariaLiveType = "assertive" - } = _ref; - const visuallyHidden = { - position: "fixed", - width: 1, - height: 1, - margin: -1, - border: 0, - padding: 0, - overflow: "hidden", - clip: "rect(0 0 0 0)", - clipPath: "inset(100%)", - whiteSpace: "nowrap" - }; - return import_react274.default.createElement("div", { - id, - style: visuallyHidden, - role: "status", - "aria-live": ariaLiveType, - "aria-atomic": true - }, announcement); -} -function useAnnouncement2() { - const [announcement, setAnnouncement] = (0, import_react274.useState)(""); - const announce = (0, import_react274.useCallback)((value) => { - if (value != null) { - setAnnouncement(value); - } - }, []); - return { - announce, - announcement - }; -} - -// node_modules/@dnd-kit/core/dist/core.esm.js -var DndMonitorContext = (0, import_react275.createContext)(null); -function useDndMonitor(listener) { - const registerListener = (0, import_react275.useContext)(DndMonitorContext); - (0, import_react275.useEffect)(() => { - if (!registerListener) { - throw new Error("useDndMonitor must be used within a children of "); - } - const unsubscribe = registerListener(listener); - return unsubscribe; - }, [listener, registerListener]); -} -function useDndMonitorProvider() { - const [listeners] = (0, import_react275.useState)(() => /* @__PURE__ */ new Set()); - const registerListener = (0, import_react275.useCallback)((listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }, [listeners]); - const dispatch = (0, import_react275.useCallback)((_ref) => { - let { - type, - event - } = _ref; - listeners.forEach((listener) => { - var _listener$type; - return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); - }); - }, [listeners]); - return [dispatch, registerListener]; -} -var defaultScreenReaderInstructions = { - draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " -}; -var defaultAnnouncements = { - onDragStart(_ref) { - let { - active - } = _ref; - return "Picked up draggable item " + active.id + "."; - }, - onDragOver(_ref2) { - let { - active, - over - } = _ref2; - if (over) { - return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; - } - return "Draggable item " + active.id + " is no longer over a droppable area."; - }, - onDragEnd(_ref3) { - let { - active, - over - } = _ref3; - if (over) { - return "Draggable item " + active.id + " was dropped over droppable area " + over.id; - } - return "Draggable item " + active.id + " was dropped."; - }, - onDragCancel(_ref4) { - let { - active - } = _ref4; - return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; - } -}; -function Accessibility(_ref) { - let { - announcements = defaultAnnouncements, - container, - hiddenTextDescribedById, - screenReaderInstructions = defaultScreenReaderInstructions - } = _ref; - const { - announce, - announcement - } = useAnnouncement2(); - const liveRegionId = useUniqueId2("DndLiveRegion"); - const [mounted, setMounted] = (0, import_react275.useState)(false); - (0, import_react275.useEffect)(() => { - setMounted(true); - }, []); - useDndMonitor((0, import_react275.useMemo)(() => ({ - onDragStart(_ref2) { - let { - active - } = _ref2; - announce(announcements.onDragStart({ - active - })); - }, - onDragMove(_ref3) { - let { - active, - over - } = _ref3; - if (announcements.onDragMove) { - announce(announcements.onDragMove({ - active, - over - })); - } - }, - onDragOver(_ref4) { - let { - active, - over - } = _ref4; - announce(announcements.onDragOver({ - active, - over - })); - }, - onDragEnd(_ref5) { - let { - active, - over - } = _ref5; - announce(announcements.onDragEnd({ - active, - over - })); - }, - onDragCancel(_ref6) { - let { - active, - over - } = _ref6; - announce(announcements.onDragCancel({ - active, - over - })); - } - }), [announce, announcements])); - if (!mounted) { - return null; - } - const markup = import_react275.default.createElement(import_react275.default.Fragment, null, import_react275.default.createElement(HiddenText, { - id: hiddenTextDescribedById, - value: screenReaderInstructions.draggable - }), import_react275.default.createElement(LiveRegion2, { - id: liveRegionId, - announcement - })); - return container ? (0, import_react_dom7.createPortal)(markup, container) : markup; -} -var Action; -(function(Action2) { - Action2["DragStart"] = "dragStart"; - Action2["DragMove"] = "dragMove"; - Action2["DragEnd"] = "dragEnd"; - Action2["DragCancel"] = "dragCancel"; - Action2["DragOver"] = "dragOver"; - Action2["RegisterDroppable"] = "registerDroppable"; - Action2["SetDroppableDisabled"] = "setDroppableDisabled"; - Action2["UnregisterDroppable"] = "unregisterDroppable"; -})(Action || (Action = {})); -function noop2() { -} -function useSensor(sensor, options) { - return (0, import_react275.useMemo)( - () => ({ - sensor, - options: options != null ? options : {} - }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [sensor, options] - ); -} -function useSensors() { - for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { - sensors[_key] = arguments[_key]; - } - return (0, import_react275.useMemo)( - () => [...sensors].filter((sensor) => sensor != null), - // eslint-disable-next-line react-hooks/exhaustive-deps - [...sensors] - ); -} -var defaultCoordinates = Object.freeze({ - x: 0, - y: 0 -}); -function distanceBetween(p1, p2) { - return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); -} -function getRelativeTransformOrigin(event, rect) { - const eventCoordinates = getEventCoordinates(event); - if (!eventCoordinates) { - return "0 0"; - } - const transformOrigin = { - x: (eventCoordinates.x - rect.left) / rect.width * 100, - y: (eventCoordinates.y - rect.top) / rect.height * 100 - }; - return transformOrigin.x + "% " + transformOrigin.y + "%"; -} -function sortCollisionsAsc(_ref, _ref2) { - let { - data: { - value: a2 - } - } = _ref; - let { - data: { - value: b - } - } = _ref2; - return a2 - b; -} -function sortCollisionsDesc(_ref3, _ref4) { - let { - data: { - value: a2 - } - } = _ref3; - let { - data: { - value: b - } - } = _ref4; - return b - a2; -} -function getFirstCollision(collisions, property) { - if (!collisions || collisions.length === 0) { - return null; - } - const [firstCollision] = collisions; - return property ? firstCollision[property] : firstCollision; -} -function centerOfRectangle(rect, left, top) { - if (left === void 0) { - left = rect.left; - } - if (top === void 0) { - top = rect.top; - } - return { - x: left + rect.width * 0.5, - y: top + rect.height * 0.5 - }; -} -var closestCenter = (_ref) => { - let { - collisionRect, - droppableRects, - droppableContainers - } = _ref; - const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); - const collisions = []; - for (const droppableContainer of droppableContainers) { - const { - id - } = droppableContainer; - const rect = droppableRects.get(id); - if (rect) { - const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); - collisions.push({ - id, - data: { - droppableContainer, - value: distBetween - } - }); - } - } - return collisions.sort(sortCollisionsAsc); -}; -function getIntersectionRatio(entry, target) { - const top = Math.max(target.top, entry.top); - const left = Math.max(target.left, entry.left); - const right = Math.min(target.left + target.width, entry.left + entry.width); - const bottom = Math.min(target.top + target.height, entry.top + entry.height); - const width = right - left; - const height = bottom - top; - if (left < right && top < bottom) { - const targetArea = target.width * target.height; - const entryArea = entry.width * entry.height; - const intersectionArea = width * height; - const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); - return Number(intersectionRatio.toFixed(4)); - } - return 0; -} -var rectIntersection = (_ref) => { - let { - collisionRect, - droppableRects, - droppableContainers - } = _ref; - const collisions = []; - for (const droppableContainer of droppableContainers) { - const { - id - } = droppableContainer; - const rect = droppableRects.get(id); - if (rect) { - const intersectionRatio = getIntersectionRatio(rect, collisionRect); - if (intersectionRatio > 0) { - collisions.push({ - id, - data: { - droppableContainer, - value: intersectionRatio - } - }); - } - } - } - return collisions.sort(sortCollisionsDesc); -}; -function adjustScale(transform, rect1, rect2) { - return { - ...transform, - scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, - scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 - }; -} -function getRectDelta(rect1, rect2) { - return rect1 && rect2 ? { - x: rect1.left - rect2.left, - y: rect1.top - rect2.top - } : defaultCoordinates; -} -function createRectAdjustmentFn(modifier) { - return function adjustClientRect(rect) { - for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - adjustments[_key - 1] = arguments[_key]; - } - return adjustments.reduce((acc, adjustment) => ({ - ...acc, - top: acc.top + modifier * adjustment.y, - bottom: acc.bottom + modifier * adjustment.y, - left: acc.left + modifier * adjustment.x, - right: acc.right + modifier * adjustment.x - }), { - ...rect - }); - }; -} -var getAdjustedRect = createRectAdjustmentFn(1); -function parseTransform(transform) { - if (transform.startsWith("matrix3d(")) { - const transformArray = transform.slice(9, -1).split(/, /); - return { - x: +transformArray[12], - y: +transformArray[13], - scaleX: +transformArray[0], - scaleY: +transformArray[5] - }; - } else if (transform.startsWith("matrix(")) { - const transformArray = transform.slice(7, -1).split(/, /); - return { - x: +transformArray[4], - y: +transformArray[5], - scaleX: +transformArray[0], - scaleY: +transformArray[3] - }; - } - return null; -} -function inverseTransform(rect, transform, transformOrigin) { - const parsedTransform = parseTransform(transform); - if (!parsedTransform) { - return rect; - } - const { - scaleX, - scaleY, - x: translateX, - y: translateY - } = parsedTransform; - const x2 = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); - const y2 = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ") + 1)); - const w = scaleX ? rect.width / scaleX : rect.width; - const h = scaleY ? rect.height / scaleY : rect.height; - return { - width: w, - height: h, - top: y2, - right: x2 + w, - bottom: y2 + h, - left: x2 - }; -} -var defaultOptions2 = { - ignoreTransform: false -}; -function getClientRect(element, options) { - if (options === void 0) { - options = defaultOptions2; - } - let rect = element.getBoundingClientRect(); - if (options.ignoreTransform) { - const { - transform, - transformOrigin - } = getWindow(element).getComputedStyle(element); - if (transform) { - rect = inverseTransform(rect, transform, transformOrigin); - } - } - const { - top, - left, - width, - height, - bottom, - right - } = rect; - return { - top, - left, - width, - height, - bottom, - right - }; -} -function getTransformAgnosticClientRect(element) { - return getClientRect(element, { - ignoreTransform: true - }); -} -function getWindowClientRect(element) { - const width = element.innerWidth; - const height = element.innerHeight; - return { - top: 0, - left: 0, - right: width, - bottom: height, - width, - height - }; -} -function isFixed(node, computedStyle) { - if (computedStyle === void 0) { - computedStyle = getWindow(node).getComputedStyle(node); - } - return computedStyle.position === "fixed"; -} -function isScrollable(element, computedStyle) { - if (computedStyle === void 0) { - computedStyle = getWindow(element).getComputedStyle(element); - } - const overflowRegex = /(auto|scroll|overlay)/; - const properties2 = ["overflow", "overflowX", "overflowY"]; - return properties2.some((property) => { - const value = computedStyle[property]; - return typeof value === "string" ? overflowRegex.test(value) : false; - }); -} -function getScrollableAncestors(element, limit) { - const scrollParents = []; - function findScrollableAncestors(node) { - if (limit != null && scrollParents.length >= limit) { - return scrollParents; - } - if (!node) { - return scrollParents; - } - if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { - scrollParents.push(node.scrollingElement); - return scrollParents; - } - if (!isHTMLElement(node) || isSVGElement(node)) { - return scrollParents; - } - if (scrollParents.includes(node)) { - return scrollParents; - } - const computedStyle = getWindow(element).getComputedStyle(node); - if (node !== element) { - if (isScrollable(node, computedStyle)) { - scrollParents.push(node); - } - } - if (isFixed(node, computedStyle)) { - return scrollParents; - } - return findScrollableAncestors(node.parentNode); - } - if (!element) { - return scrollParents; - } - return findScrollableAncestors(element); -} -function getFirstScrollableAncestor(node) { - const [firstScrollableAncestor] = getScrollableAncestors(node, 1); - return firstScrollableAncestor != null ? firstScrollableAncestor : null; -} -function getScrollableElement(element) { - if (!canUseDOM || !element) { - return null; - } - if (isWindow(element)) { - return element; - } - if (!isNode(element)) { - return null; - } - if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) { - return window; - } - if (isHTMLElement(element)) { - return element; - } - return null; -} -function getScrollXCoordinate(element) { - if (isWindow(element)) { - return element.scrollX; - } - return element.scrollLeft; -} -function getScrollYCoordinate(element) { - if (isWindow(element)) { - return element.scrollY; - } - return element.scrollTop; -} -function getScrollCoordinates(element) { - return { - x: getScrollXCoordinate(element), - y: getScrollYCoordinate(element) - }; -} -var Direction; -(function(Direction2) { - Direction2[Direction2["Forward"] = 1] = "Forward"; - Direction2[Direction2["Backward"] = -1] = "Backward"; -})(Direction || (Direction = {})); -function isDocumentScrollingElement(element) { - if (!canUseDOM || !element) { - return false; - } - return element === document.scrollingElement; -} -function getScrollPosition(scrollingContainer) { - const minScroll = { - x: 0, - y: 0 - }; - const dimensions = isDocumentScrollingElement(scrollingContainer) ? { - height: window.innerHeight, - width: window.innerWidth - } : { - height: scrollingContainer.clientHeight, - width: scrollingContainer.clientWidth - }; - const maxScroll = { - x: scrollingContainer.scrollWidth - dimensions.width, - y: scrollingContainer.scrollHeight - dimensions.height - }; - const isTop = scrollingContainer.scrollTop <= minScroll.y; - const isLeft = scrollingContainer.scrollLeft <= minScroll.x; - const isBottom = scrollingContainer.scrollTop >= maxScroll.y; - const isRight = scrollingContainer.scrollLeft >= maxScroll.x; - return { - isTop, - isLeft, - isBottom, - isRight, - maxScroll, - minScroll - }; -} -var defaultThreshold = { - x: 0.2, - y: 0.2 -}; -function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { - let { - top, - left, - right, - bottom - } = _ref; - if (acceleration === void 0) { - acceleration = 10; - } - if (thresholdPercentage === void 0) { - thresholdPercentage = defaultThreshold; - } - const { - isTop, - isBottom, - isLeft, - isRight - } = getScrollPosition(scrollContainer); - const direction = { - x: 0, - y: 0 - }; - const speed = { - x: 0, - y: 0 - }; - const threshold = { - height: scrollContainerRect.height * thresholdPercentage.y, - width: scrollContainerRect.width * thresholdPercentage.x - }; - if (!isTop && top <= scrollContainerRect.top + threshold.height) { - direction.y = Direction.Backward; - speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); - } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { - direction.y = Direction.Forward; - speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); - } - if (!isRight && right >= scrollContainerRect.right - threshold.width) { - direction.x = Direction.Forward; - speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); - } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { - direction.x = Direction.Backward; - speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); - } - return { - direction, - speed - }; -} -function getScrollElementRect(element) { - if (element === document.scrollingElement) { - const { - innerWidth, - innerHeight - } = window; - return { - top: 0, - left: 0, - right: innerWidth, - bottom: innerHeight, - width: innerWidth, - height: innerHeight - }; - } - const { - top, - left, - right, - bottom - } = element.getBoundingClientRect(); - return { - top, - left, - right, - bottom, - width: element.clientWidth, - height: element.clientHeight - }; -} -function getScrollOffsets(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return add2(acc, getScrollCoordinates(node)); - }, defaultCoordinates); -} -function getScrollXOffset(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return acc + getScrollXCoordinate(node); - }, 0); -} -function getScrollYOffset(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return acc + getScrollYCoordinate(node); - }, 0); -} -function scrollIntoViewIfNeeded(element, measure) { - if (measure === void 0) { - measure = getClientRect; - } - if (!element) { - return; - } - const { - top, - left, - bottom, - right - } = measure(element); - const firstScrollableAncestor = getFirstScrollableAncestor(element); - if (!firstScrollableAncestor) { - return; - } - if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { - element.scrollIntoView({ - block: "center", - inline: "center" - }); - } -} -var properties = [["x", ["left", "right"], getScrollXOffset], ["y", ["top", "bottom"], getScrollYOffset]]; -var Rect = class { - constructor(rect, element) { - this.rect = void 0; - this.width = void 0; - this.height = void 0; - this.top = void 0; - this.bottom = void 0; - this.right = void 0; - this.left = void 0; - const scrollableAncestors = getScrollableAncestors(element); - const scrollOffsets = getScrollOffsets(scrollableAncestors); - this.rect = { - ...rect - }; - this.width = rect.width; - this.height = rect.height; - for (const [axis, keys, getScrollOffset] of properties) { - for (const key2 of keys) { - Object.defineProperty(this, key2, { - get: () => { - const currentOffsets = getScrollOffset(scrollableAncestors); - const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; - return this.rect[key2] + scrollOffsetsDeltla; - }, - enumerable: true - }); - } - } - Object.defineProperty(this, "rect", { - enumerable: false - }); - } -}; -var Listeners = class { - constructor(target) { - this.target = void 0; - this.listeners = []; - this.removeAll = () => { - this.listeners.forEach((listener) => { - var _this$target; - return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); - }); - }; - this.target = target; - } - add(eventName, handler, options) { - var _this$target2; - (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); - this.listeners.push([eventName, handler, options]); - } -}; -function getEventListenerTarget(target) { - const { - EventTarget - } = getWindow(target); - return target instanceof EventTarget ? target : getOwnerDocument(target); -} -function hasExceededDistance(delta, measurement) { - const dx = Math.abs(delta.x); - const dy = Math.abs(delta.y); - if (typeof measurement === "number") { - return Math.sqrt(dx ** 2 + dy ** 2) > measurement; - } - if ("x" in measurement && "y" in measurement) { - return dx > measurement.x && dy > measurement.y; - } - if ("x" in measurement) { - return dx > measurement.x; - } - if ("y" in measurement) { - return dy > measurement.y; - } - return false; -} -var EventName; -(function(EventName3) { - EventName3["Click"] = "click"; - EventName3["DragStart"] = "dragstart"; - EventName3["Keydown"] = "keydown"; - EventName3["ContextMenu"] = "contextmenu"; - EventName3["Resize"] = "resize"; - EventName3["SelectionChange"] = "selectionchange"; - EventName3["VisibilityChange"] = "visibilitychange"; -})(EventName || (EventName = {})); -function preventDefault(event) { - event.preventDefault(); -} -function stopPropagation(event) { - event.stopPropagation(); -} -var KeyboardCode; -(function(KeyboardCode3) { - KeyboardCode3["Space"] = "Space"; - KeyboardCode3["Down"] = "ArrowDown"; - KeyboardCode3["Right"] = "ArrowRight"; - KeyboardCode3["Left"] = "ArrowLeft"; - KeyboardCode3["Up"] = "ArrowUp"; - KeyboardCode3["Esc"] = "Escape"; - KeyboardCode3["Enter"] = "Enter"; -})(KeyboardCode || (KeyboardCode = {})); -var defaultKeyboardCodes = { - start: [KeyboardCode.Space, KeyboardCode.Enter], - cancel: [KeyboardCode.Esc], - end: [KeyboardCode.Space, KeyboardCode.Enter] -}; -var defaultKeyboardCoordinateGetter = (event, _ref) => { - let { - currentCoordinates - } = _ref; - switch (event.code) { - case KeyboardCode.Right: - return { - ...currentCoordinates, - x: currentCoordinates.x + 25 - }; - case KeyboardCode.Left: - return { - ...currentCoordinates, - x: currentCoordinates.x - 25 - }; - case KeyboardCode.Down: - return { - ...currentCoordinates, - y: currentCoordinates.y + 25 - }; - case KeyboardCode.Up: - return { - ...currentCoordinates, - y: currentCoordinates.y - 25 - }; - } - return void 0; -}; -var KeyboardSensor = class { - constructor(props2) { - this.props = void 0; - this.autoScrollEnabled = false; - this.referenceCoordinates = void 0; - this.listeners = void 0; - this.windowListeners = void 0; - this.props = props2; - const { - event: { - target - } - } = props2; - this.props = props2; - this.listeners = new Listeners(getOwnerDocument(target)); - this.windowListeners = new Listeners(getWindow(target)); - this.handleKeyDown = this.handleKeyDown.bind(this); - this.handleCancel = this.handleCancel.bind(this); - this.attach(); - } - attach() { - this.handleStart(); - this.windowListeners.add(EventName.Resize, this.handleCancel); - this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); - setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); - } - handleStart() { - const { - activeNode, - onStart - } = this.props; - const node = activeNode.node.current; - if (node) { - scrollIntoViewIfNeeded(node); - } - onStart(defaultCoordinates); - } - handleKeyDown(event) { - if (isKeyboardEvent(event)) { - const { - active, - context, - options - } = this.props; - const { - keyboardCodes = defaultKeyboardCodes, - coordinateGetter = defaultKeyboardCoordinateGetter, - scrollBehavior = "smooth" - } = options; - const { - code - } = event; - if (keyboardCodes.end.includes(code)) { - this.handleEnd(event); - return; - } - if (keyboardCodes.cancel.includes(code)) { - this.handleCancel(event); - return; - } - const { - collisionRect - } = context.current; - const currentCoordinates = collisionRect ? { - x: collisionRect.left, - y: collisionRect.top - } : defaultCoordinates; - if (!this.referenceCoordinates) { - this.referenceCoordinates = currentCoordinates; - } - const newCoordinates = coordinateGetter(event, { - active, - context: context.current, - currentCoordinates - }); - if (newCoordinates) { - const coordinatesDelta = subtract(newCoordinates, currentCoordinates); - const scrollDelta = { - x: 0, - y: 0 - }; - const { - scrollableAncestors - } = context.current; - for (const scrollContainer of scrollableAncestors) { - const direction = event.code; - const { - isTop, - isRight, - isLeft, - isBottom, - maxScroll, - minScroll - } = getScrollPosition(scrollContainer); - const scrollElementRect = getScrollElementRect(scrollContainer); - const clampedCoordinates = { - x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), - y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) - }; - const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; - const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; - if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { - const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; - const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; - if (canScrollToNewCoordinates && !coordinatesDelta.y) { - scrollContainer.scrollTo({ - left: newScrollCoordinates, - behavior: scrollBehavior - }); - return; - } - if (canScrollToNewCoordinates) { - scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; - } else { - scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; - } - if (scrollDelta.x) { - scrollContainer.scrollBy({ - left: -scrollDelta.x, - behavior: scrollBehavior - }); - } - break; - } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { - const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; - const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; - if (canScrollToNewCoordinates && !coordinatesDelta.x) { - scrollContainer.scrollTo({ - top: newScrollCoordinates, - behavior: scrollBehavior - }); - return; - } - if (canScrollToNewCoordinates) { - scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; - } else { - scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; - } - if (scrollDelta.y) { - scrollContainer.scrollBy({ - top: -scrollDelta.y, - behavior: scrollBehavior - }); - } - break; - } - } - this.handleMove(event, add2(subtract(newCoordinates, this.referenceCoordinates), scrollDelta)); - } - } - } - handleMove(event, coordinates) { - const { - onMove - } = this.props; - event.preventDefault(); - onMove(coordinates); - } - handleEnd(event) { - const { - onEnd - } = this.props; - event.preventDefault(); - this.detach(); - onEnd(); - } - handleCancel(event) { - const { - onCancel - } = this.props; - event.preventDefault(); - this.detach(); - onCancel(); - } - detach() { - this.listeners.removeAll(); - this.windowListeners.removeAll(); - } -}; -KeyboardSensor.activators = [{ - eventName: "onKeyDown", - handler: (event, _ref, _ref2) => { - let { - keyboardCodes = defaultKeyboardCodes, - onActivation - } = _ref; - let { - active - } = _ref2; - const { - code - } = event.nativeEvent; - if (keyboardCodes.start.includes(code)) { - const activator = active.activatorNode.current; - if (activator && event.target !== activator) { - return false; - } - event.preventDefault(); - onActivation == null ? void 0 : onActivation({ - event: event.nativeEvent - }); - return true; - } - return false; - } -}]; -function isDistanceConstraint(constraint) { - return Boolean(constraint && "distance" in constraint); -} -function isDelayConstraint(constraint) { - return Boolean(constraint && "delay" in constraint); -} -var AbstractPointerSensor = class { - constructor(props2, events3, listenerTarget) { - var _getEventCoordinates; - if (listenerTarget === void 0) { - listenerTarget = getEventListenerTarget(props2.event.target); - } - this.props = void 0; - this.events = void 0; - this.autoScrollEnabled = true; - this.document = void 0; - this.activated = false; - this.initialCoordinates = void 0; - this.timeoutId = null; - this.listeners = void 0; - this.documentListeners = void 0; - this.windowListeners = void 0; - this.props = props2; - this.events = events3; - const { - event - } = props2; - const { - target - } = event; - this.props = props2; - this.events = events3; - this.document = getOwnerDocument(target); - this.documentListeners = new Listeners(this.document); - this.listeners = new Listeners(listenerTarget); - this.windowListeners = new Listeners(getWindow(target)); - this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates; - this.handleStart = this.handleStart.bind(this); - this.handleMove = this.handleMove.bind(this); - this.handleEnd = this.handleEnd.bind(this); - this.handleCancel = this.handleCancel.bind(this); - this.handleKeydown = this.handleKeydown.bind(this); - this.removeTextSelection = this.removeTextSelection.bind(this); - this.attach(); - } - attach() { - const { - events: events3, - props: { - options: { - activationConstraint, - bypassActivationConstraint - } - } - } = this; - this.listeners.add(events3.move.name, this.handleMove, { - passive: false - }); - this.listeners.add(events3.end.name, this.handleEnd); - this.windowListeners.add(EventName.Resize, this.handleCancel); - this.windowListeners.add(EventName.DragStart, preventDefault); - this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); - this.windowListeners.add(EventName.ContextMenu, preventDefault); - this.documentListeners.add(EventName.Keydown, this.handleKeydown); - if (activationConstraint) { - if (bypassActivationConstraint != null && bypassActivationConstraint({ - event: this.props.event, - activeNode: this.props.activeNode, - options: this.props.options - })) { - return this.handleStart(); - } - if (isDelayConstraint(activationConstraint)) { - this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); - return; - } - if (isDistanceConstraint(activationConstraint)) { - return; - } - } - this.handleStart(); - } - detach() { - this.listeners.removeAll(); - this.windowListeners.removeAll(); - setTimeout(this.documentListeners.removeAll, 50); - if (this.timeoutId !== null) { - clearTimeout(this.timeoutId); - this.timeoutId = null; - } - } - handleStart() { - const { - initialCoordinates - } = this; - const { - onStart - } = this.props; - if (initialCoordinates) { - this.activated = true; - this.documentListeners.add(EventName.Click, stopPropagation, { - capture: true - }); - this.removeTextSelection(); - this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); - onStart(initialCoordinates); - } - } - handleMove(event) { - var _getEventCoordinates2; - const { - activated, - initialCoordinates, - props: props2 - } = this; - const { - onMove, - options: { - activationConstraint - } - } = props2; - if (!initialCoordinates) { - return; - } - const coordinates = (_getEventCoordinates2 = getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates; - const delta = subtract(initialCoordinates, coordinates); - if (!activated && activationConstraint) { - if (isDistanceConstraint(activationConstraint)) { - if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { - return this.handleCancel(); - } - if (hasExceededDistance(delta, activationConstraint.distance)) { - return this.handleStart(); - } - } - if (isDelayConstraint(activationConstraint)) { - if (hasExceededDistance(delta, activationConstraint.tolerance)) { - return this.handleCancel(); - } - } - return; - } - if (event.cancelable) { - event.preventDefault(); - } - onMove(coordinates); - } - handleEnd() { - const { - onEnd - } = this.props; - this.detach(); - onEnd(); - } - handleCancel() { - const { - onCancel - } = this.props; - this.detach(); - onCancel(); - } - handleKeydown(event) { - if (event.code === KeyboardCode.Esc) { - this.handleCancel(); - } - } - removeTextSelection() { - var _this$document$getSel; - (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); - } -}; -var events2 = { - move: { - name: "pointermove" - }, - end: { - name: "pointerup" - } -}; -var PointerSensor = class extends AbstractPointerSensor { - constructor(props2) { - const { - event - } = props2; - const listenerTarget = getOwnerDocument(event.target); - super(props2, events2, listenerTarget); - } -}; -PointerSensor.activators = [{ - eventName: "onPointerDown", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - if (!event.isPrimary || event.button !== 0) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var events$1 = { - move: { - name: "mousemove" - }, - end: { - name: "mouseup" - } -}; -var MouseButton; -(function(MouseButton2) { - MouseButton2[MouseButton2["RightClick"] = 2] = "RightClick"; -})(MouseButton || (MouseButton = {})); -var MouseSensor = class extends AbstractPointerSensor { - constructor(props2) { - super(props2, events$1, getOwnerDocument(props2.event.target)); - } -}; -MouseSensor.activators = [{ - eventName: "onMouseDown", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - if (event.button === MouseButton.RightClick) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var events$2 = { - move: { - name: "touchmove" - }, - end: { - name: "touchend" - } -}; -var TouchSensor = class extends AbstractPointerSensor { - constructor(props2) { - super(props2, events$2); - } - static setup() { - window.addEventListener(events$2.move.name, noop4, { - capture: false, - passive: false - }); - return function teardown() { - window.removeEventListener(events$2.move.name, noop4); - }; - function noop4() { - } - } -}; -TouchSensor.activators = [{ - eventName: "onTouchStart", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - const { - touches - } = event; - if (touches.length > 1) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var AutoScrollActivator; -(function(AutoScrollActivator2) { - AutoScrollActivator2[AutoScrollActivator2["Pointer"] = 0] = "Pointer"; - AutoScrollActivator2[AutoScrollActivator2["DraggableRect"] = 1] = "DraggableRect"; -})(AutoScrollActivator || (AutoScrollActivator = {})); -var TraversalOrder; -(function(TraversalOrder2) { - TraversalOrder2[TraversalOrder2["TreeOrder"] = 0] = "TreeOrder"; - TraversalOrder2[TraversalOrder2["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; -})(TraversalOrder || (TraversalOrder = {})); -function useAutoScroller(_ref) { - let { - acceleration, - activator = AutoScrollActivator.Pointer, - canScroll, - draggingRect, - enabled, - interval = 5, - order = TraversalOrder.TreeOrder, - pointerCoordinates, - scrollableAncestors, - scrollableAncestorRects, - delta, - threshold - } = _ref; - const scrollIntent = useScrollIntent({ - delta, - disabled: !enabled - }); - const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval(); - const scrollSpeed = (0, import_react275.useRef)({ - x: 0, - y: 0 - }); - const scrollDirection = (0, import_react275.useRef)({ - x: 0, - y: 0 - }); - const rect = (0, import_react275.useMemo)(() => { - switch (activator) { - case AutoScrollActivator.Pointer: - return pointerCoordinates ? { - top: pointerCoordinates.y, - bottom: pointerCoordinates.y, - left: pointerCoordinates.x, - right: pointerCoordinates.x - } : null; - case AutoScrollActivator.DraggableRect: - return draggingRect; - } - }, [activator, draggingRect, pointerCoordinates]); - const scrollContainerRef = (0, import_react275.useRef)(null); - const autoScroll = (0, import_react275.useCallback)(() => { - const scrollContainer = scrollContainerRef.current; - if (!scrollContainer) { - return; - } - const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; - const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; - scrollContainer.scrollBy(scrollLeft, scrollTop); - }, []); - const sortedScrollableAncestors = (0, import_react275.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); - (0, import_react275.useEffect)( - () => { - if (!enabled || !scrollableAncestors.length || !rect) { - clearAutoScrollInterval(); - return; - } - for (const scrollContainer of sortedScrollableAncestors) { - if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { - continue; - } - const index = scrollableAncestors.indexOf(scrollContainer); - const scrollContainerRect = scrollableAncestorRects[index]; - if (!scrollContainerRect) { - continue; - } - const { - direction, - speed - } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); - for (const axis of ["x", "y"]) { - if (!scrollIntent[axis][direction[axis]]) { - speed[axis] = 0; - direction[axis] = 0; - } - } - if (speed.x > 0 || speed.y > 0) { - clearAutoScrollInterval(); - scrollContainerRef.current = scrollContainer; - setAutoScrollInterval(autoScroll, interval); - scrollSpeed.current = speed; - scrollDirection.current = direction; - return; - } - } - scrollSpeed.current = { - x: 0, - y: 0 - }; - scrollDirection.current = { - x: 0, - y: 0 - }; - clearAutoScrollInterval(); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [ - acceleration, - autoScroll, - canScroll, - clearAutoScrollInterval, - enabled, - interval, - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(rect), - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(scrollIntent), - setAutoScrollInterval, - scrollableAncestors, - sortedScrollableAncestors, - scrollableAncestorRects, - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(threshold) - ] - ); -} -var defaultScrollIntent = { - x: { - [Direction.Backward]: false, - [Direction.Forward]: false - }, - y: { - [Direction.Backward]: false, - [Direction.Forward]: false - } -}; -function useScrollIntent(_ref2) { - let { - delta, - disabled - } = _ref2; - const previousDelta = usePrevious2(delta); - return useLazyMemo((previousIntent) => { - if (disabled || !previousDelta || !previousIntent) { - return defaultScrollIntent; - } - const direction = { - x: Math.sign(delta.x - previousDelta.x), - y: Math.sign(delta.y - previousDelta.y) - }; - return { - x: { - [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, - [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 - }, - y: { - [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, - [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 - } - }; - }, [disabled, delta, previousDelta]); -} -function useCachedNode(draggableNodes, id) { - const draggableNode = id !== null ? draggableNodes.get(id) : void 0; - const node = draggableNode ? draggableNode.node.current : null; - return useLazyMemo((cachedNode) => { - var _ref; - if (id === null) { - return null; - } - return (_ref = node != null ? node : cachedNode) != null ? _ref : null; - }, [node, id]); -} -function useCombineActivators(sensors, getSyntheticHandler) { - return (0, import_react275.useMemo)(() => sensors.reduce((accumulator, sensor) => { - const { - sensor: Sensor - } = sensor; - const sensorActivators = Sensor.activators.map((activator) => ({ - eventName: activator.eventName, - handler: getSyntheticHandler(activator.handler, sensor) - })); - return [...accumulator, ...sensorActivators]; - }, []), [sensors, getSyntheticHandler]); -} -var MeasuringStrategy; -(function(MeasuringStrategy2) { - MeasuringStrategy2[MeasuringStrategy2["Always"] = 0] = "Always"; - MeasuringStrategy2[MeasuringStrategy2["BeforeDragging"] = 1] = "BeforeDragging"; - MeasuringStrategy2[MeasuringStrategy2["WhileDragging"] = 2] = "WhileDragging"; -})(MeasuringStrategy || (MeasuringStrategy = {})); -var MeasuringFrequency; -(function(MeasuringFrequency2) { - MeasuringFrequency2["Optimized"] = "optimized"; -})(MeasuringFrequency || (MeasuringFrequency = {})); -var defaultValue4 = /* @__PURE__ */ new Map(); -function useDroppableMeasuring(containers, _ref) { - let { - dragging, - dependencies, - config - } = _ref; - const [queue, setQueue] = (0, import_react275.useState)(null); - const { - frequency, - measure, - strategy - } = config; - const containersRef = (0, import_react275.useRef)(containers); - const disabled = isDisabled(); - const disabledRef = useLatestValue(disabled); - const measureDroppableContainers = (0, import_react275.useCallback)(function(ids2) { - if (ids2 === void 0) { - ids2 = []; - } - if (disabledRef.current) { - return; - } - setQueue((value) => { - if (value === null) { - return ids2; - } - return value.concat(ids2.filter((id) => !value.includes(id))); - }); - }, [disabledRef]); - const timeoutId = (0, import_react275.useRef)(null); - const droppableRects = useLazyMemo((previousValue) => { - if (disabled && !dragging) { - return defaultValue4; - } - if (!previousValue || previousValue === defaultValue4 || containersRef.current !== containers || queue != null) { - const map2 = /* @__PURE__ */ new Map(); - for (let container of containers) { - if (!container) { - continue; - } - if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { - map2.set(container.id, container.rect.current); - continue; - } - const node = container.node.current; - const rect = node ? new Rect(measure(node), node) : null; - container.rect.current = rect; - if (rect) { - map2.set(container.id, rect); - } - } - return map2; - } - return previousValue; - }, [containers, queue, dragging, disabled, measure]); - (0, import_react275.useEffect)(() => { - containersRef.current = containers; - }, [containers]); - (0, import_react275.useEffect)( - () => { - if (disabled) { - return; - } - measureDroppableContainers(); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [dragging, disabled] - ); - (0, import_react275.useEffect)( - () => { - if (queue && queue.length > 0) { - setQueue(null); - } - }, - //eslint-disable-next-line react-hooks/exhaustive-deps - [JSON.stringify(queue)] - ); - (0, import_react275.useEffect)( - () => { - if (disabled || typeof frequency !== "number" || timeoutId.current !== null) { - return; - } - timeoutId.current = setTimeout(() => { - measureDroppableContainers(); - timeoutId.current = null; - }, frequency); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [frequency, disabled, measureDroppableContainers, ...dependencies] - ); - return { - droppableRects, - measureDroppableContainers, - measuringScheduled: queue != null - }; - function isDisabled() { - switch (strategy) { - case MeasuringStrategy.Always: - return false; - case MeasuringStrategy.BeforeDragging: - return dragging; - default: - return !dragging; - } - } -} -function useInitialValue(value, computeFn) { - return useLazyMemo((previousValue) => { - if (!value) { - return null; - } - if (previousValue) { - return previousValue; - } - return typeof computeFn === "function" ? computeFn(value) : value; - }, [computeFn, value]); -} -function useInitialRect(node, measure) { - return useInitialValue(node, measure); -} -function useMutationObserver2(_ref) { - let { - callback, - disabled - } = _ref; - const handleMutations = useEvent(callback); - const mutationObserver = (0, import_react275.useMemo)(() => { - if (disabled || typeof window === "undefined" || typeof window.MutationObserver === "undefined") { - return void 0; - } - const { - MutationObserver: MutationObserver2 - } = window; - return new MutationObserver2(handleMutations); - }, [handleMutations, disabled]); - (0, import_react275.useEffect)(() => { - return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); - }, [mutationObserver]); - return mutationObserver; -} -function useResizeObserver2(_ref) { - let { - callback, - disabled - } = _ref; - const handleResize = useEvent(callback); - const resizeObserver = (0, import_react275.useMemo)( - () => { - if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") { - return void 0; - } - const { - ResizeObserver: ResizeObserver2 - } = window; - return new ResizeObserver2(handleResize); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [disabled] - ); - (0, import_react275.useEffect)(() => { - return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); - }, [resizeObserver]); - return resizeObserver; -} -function defaultMeasure(element) { - return new Rect(getClientRect(element), element); -} -function useRect2(element, measure, fallbackRect) { - if (measure === void 0) { - measure = defaultMeasure; - } - const [rect, measureRect] = (0, import_react275.useReducer)(reducer2, null); - const mutationObserver = useMutationObserver2({ - callback(records) { - if (!element) { - return; - } - for (const record of records) { - const { - type, - target - } = record; - if (type === "childList" && target instanceof HTMLElement && target.contains(element)) { - measureRect(); - break; - } - } - } - }); - const resizeObserver = useResizeObserver2({ - callback: measureRect - }); - useIsomorphicLayoutEffect2(() => { - measureRect(); - if (element) { - resizeObserver == null ? void 0 : resizeObserver.observe(element); - mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { - childList: true, - subtree: true - }); - } else { - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - mutationObserver == null ? void 0 : mutationObserver.disconnect(); - } - }, [element]); - return rect; - function reducer2(currentRect) { - if (!element) { - return null; - } - if (element.isConnected === false) { - var _ref; - return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; - } - const newRect = measure(element); - if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { - return currentRect; - } - return newRect; - } -} -function useRectDelta(rect) { - const initialRect = useInitialValue(rect); - return getRectDelta(rect, initialRect); -} -var defaultValue$1 = []; -function useScrollableAncestors(node) { - const previousNode = (0, import_react275.useRef)(node); - const ancestors = useLazyMemo((previousValue) => { - if (!node) { - return defaultValue$1; - } - if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { - return previousValue; - } - return getScrollableAncestors(node); - }, [node]); - (0, import_react275.useEffect)(() => { - previousNode.current = node; - }, [node]); - return ancestors; -} -function useScrollOffsets(elements) { - const [scrollCoordinates, setScrollCoordinates] = (0, import_react275.useState)(null); - const prevElements = (0, import_react275.useRef)(elements); - const handleScroll = (0, import_react275.useCallback)((event) => { - const scrollingElement = getScrollableElement(event.target); - if (!scrollingElement) { - return; - } - setScrollCoordinates((scrollCoordinates2) => { - if (!scrollCoordinates2) { - return null; - } - scrollCoordinates2.set(scrollingElement, getScrollCoordinates(scrollingElement)); - return new Map(scrollCoordinates2); - }); - }, []); - (0, import_react275.useEffect)(() => { - const previousElements = prevElements.current; - if (elements !== previousElements) { - cleanup(previousElements); - const entries = elements.map((element) => { - const scrollableElement = getScrollableElement(element); - if (scrollableElement) { - scrollableElement.addEventListener("scroll", handleScroll, { - passive: true - }); - return [scrollableElement, getScrollCoordinates(scrollableElement)]; - } - return null; - }).filter((entry) => entry != null); - setScrollCoordinates(entries.length ? new Map(entries) : null); - prevElements.current = elements; - } - return () => { - cleanup(elements); - cleanup(previousElements); - }; - function cleanup(elements2) { - elements2.forEach((element) => { - const scrollableElement = getScrollableElement(element); - scrollableElement == null ? void 0 : scrollableElement.removeEventListener("scroll", handleScroll); - }); - } - }, [handleScroll, elements]); - return (0, import_react275.useMemo)(() => { - if (elements.length) { - return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add2(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); - } - return defaultCoordinates; - }, [elements, scrollCoordinates]); -} -function useScrollOffsetsDelta(scrollOffsets, dependencies) { - if (dependencies === void 0) { - dependencies = []; - } - const initialScrollOffsets = (0, import_react275.useRef)(null); - (0, import_react275.useEffect)( - () => { - initialScrollOffsets.current = null; - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - dependencies - ); - (0, import_react275.useEffect)(() => { - const hasScrollOffsets = scrollOffsets !== defaultCoordinates; - if (hasScrollOffsets && !initialScrollOffsets.current) { - initialScrollOffsets.current = scrollOffsets; - } - if (!hasScrollOffsets && initialScrollOffsets.current) { - initialScrollOffsets.current = null; - } - }, [scrollOffsets]); - return initialScrollOffsets.current ? subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; -} -function useSensorSetup(sensors) { - (0, import_react275.useEffect)( - () => { - if (!canUseDOM) { - return; - } - const teardownFns = sensors.map((_ref) => { - let { - sensor - } = _ref; - return sensor.setup == null ? void 0 : sensor.setup(); - }); - return () => { - for (const teardown of teardownFns) { - teardown == null ? void 0 : teardown(); - } - }; - }, - // TO-DO: Sensors length could theoretically change which would not be a valid dependency - // eslint-disable-next-line react-hooks/exhaustive-deps - sensors.map((_ref2) => { - let { - sensor - } = _ref2; - return sensor; - }) - ); -} -function useSyntheticListeners(listeners, id) { - return (0, import_react275.useMemo)(() => { - return listeners.reduce((acc, _ref) => { - let { - eventName, - handler - } = _ref; - acc[eventName] = (event) => { - handler(event, id); - }; - return acc; - }, {}); - }, [listeners, id]); -} -function useWindowRect(element) { - return (0, import_react275.useMemo)(() => element ? getWindowClientRect(element) : null, [element]); -} -var defaultValue$2 = []; -function useRects(elements, measure) { - if (measure === void 0) { - measure = getClientRect; - } - const [firstElement] = elements; - const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null); - const [rects, measureRects] = (0, import_react275.useReducer)(reducer2, defaultValue$2); - const resizeObserver = useResizeObserver2({ - callback: measureRects - }); - if (elements.length > 0 && rects === defaultValue$2) { - measureRects(); - } - useIsomorphicLayoutEffect2(() => { - if (elements.length) { - elements.forEach((element) => resizeObserver == null ? void 0 : resizeObserver.observe(element)); - } else { - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - measureRects(); - } - }, [elements]); - return rects; - function reducer2() { - if (!elements.length) { - return defaultValue$2; - } - return elements.map((element) => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); - } -} -function getMeasurableNode(node) { - if (!node) { - return null; - } - if (node.children.length > 1) { - return node; - } - const firstChild = node.children[0]; - return isHTMLElement(firstChild) ? firstChild : node; -} -function useDragOverlayMeasuring(_ref) { - let { - measure - } = _ref; - const [rect, setRect] = (0, import_react275.useState)(null); - const handleResize = (0, import_react275.useCallback)((entries) => { - for (const { - target - } of entries) { - if (isHTMLElement(target)) { - setRect((rect2) => { - const newRect = measure(target); - return rect2 ? { - ...rect2, - width: newRect.width, - height: newRect.height - } : newRect; - }); - break; - } - } - }, [measure]); - const resizeObserver = useResizeObserver2({ - callback: handleResize - }); - const handleNodeChange = (0, import_react275.useCallback)((element) => { - const node = getMeasurableNode(element); - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - if (node) { - resizeObserver == null ? void 0 : resizeObserver.observe(node); - } - setRect(node ? measure(node) : null); - }, [measure, resizeObserver]); - const [nodeRef, setRef] = useNodeRef(handleNodeChange); - return (0, import_react275.useMemo)(() => ({ - nodeRef, - rect, - setRef - }), [rect, nodeRef, setRef]); -} -var defaultSensors = [{ - sensor: PointerSensor, - options: {} -}, { - sensor: KeyboardSensor, - options: {} -}]; -var defaultData = { - current: {} -}; -var defaultMeasuringConfiguration = { - draggable: { - measure: getTransformAgnosticClientRect - }, - droppable: { - measure: getTransformAgnosticClientRect, - strategy: MeasuringStrategy.WhileDragging, - frequency: MeasuringFrequency.Optimized - }, - dragOverlay: { - measure: getClientRect - } -}; -var DroppableContainersMap = class extends Map { - get(id) { - var _super$get; - return id != null ? (_super$get = super.get(id)) != null ? _super$get : void 0 : void 0; - } - toArray() { - return Array.from(this.values()); - } - getEnabled() { - return this.toArray().filter((_ref) => { - let { - disabled - } = _ref; - return !disabled; - }); - } - getNodeFor(id) { - var _this$get$node$curren, _this$get; - return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : void 0; - } -}; -var defaultPublicContext = { - activatorEvent: null, - active: null, - activeNode: null, - activeNodeRect: null, - collisions: null, - containerNodeRect: null, - draggableNodes: /* @__PURE__ */ new Map(), - droppableRects: /* @__PURE__ */ new Map(), - droppableContainers: new DroppableContainersMap(), - over: null, - dragOverlay: { - nodeRef: { - current: null - }, - rect: null, - setRef: noop2 - }, - scrollableAncestors: [], - scrollableAncestorRects: [], - measuringConfiguration: defaultMeasuringConfiguration, - measureDroppableContainers: noop2, - windowRect: null, - measuringScheduled: false -}; -var defaultInternalContext = { - activatorEvent: null, - activators: [], - active: null, - activeNodeRect: null, - ariaDescribedById: { - draggable: "" - }, - dispatch: noop2, - draggableNodes: /* @__PURE__ */ new Map(), - over: null, - measureDroppableContainers: noop2 -}; -var InternalContext = (0, import_react275.createContext)(defaultInternalContext); -var PublicContext = (0, import_react275.createContext)(defaultPublicContext); -function getInitialState() { - return { - draggable: { - active: null, - initialCoordinates: { - x: 0, - y: 0 - }, - nodes: /* @__PURE__ */ new Map(), - translate: { - x: 0, - y: 0 - } - }, - droppable: { - containers: new DroppableContainersMap() - } - }; -} -function reducer(state, action) { - switch (action.type) { - case Action.DragStart: - return { - ...state, - draggable: { - ...state.draggable, - initialCoordinates: action.initialCoordinates, - active: action.active - } - }; - case Action.DragMove: - if (!state.draggable.active) { - return state; - } - return { - ...state, - draggable: { - ...state.draggable, - translate: { - x: action.coordinates.x - state.draggable.initialCoordinates.x, - y: action.coordinates.y - state.draggable.initialCoordinates.y - } - } - }; - case Action.DragEnd: - case Action.DragCancel: - return { - ...state, - draggable: { - ...state.draggable, - active: null, - initialCoordinates: { - x: 0, - y: 0 - }, - translate: { - x: 0, - y: 0 - } - } - }; - case Action.RegisterDroppable: { - const { - element - } = action; - const { - id - } = element; - const containers = new DroppableContainersMap(state.droppable.containers); - containers.set(id, element); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - case Action.SetDroppableDisabled: { - const { - id, - key: key2, - disabled - } = action; - const element = state.droppable.containers.get(id); - if (!element || key2 !== element.key) { - return state; - } - const containers = new DroppableContainersMap(state.droppable.containers); - containers.set(id, { - ...element, - disabled - }); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - case Action.UnregisterDroppable: { - const { - id, - key: key2 - } = action; - const element = state.droppable.containers.get(id); - if (!element || key2 !== element.key) { - return state; - } - const containers = new DroppableContainersMap(state.droppable.containers); - containers.delete(id); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - default: { - return state; - } - } -} -function RestoreFocus(_ref) { - let { - disabled - } = _ref; - const { - active, - activatorEvent, - draggableNodes - } = (0, import_react275.useContext)(InternalContext); - const previousActivatorEvent = usePrevious2(activatorEvent); - const previousActiveId = usePrevious2(active == null ? void 0 : active.id); - (0, import_react275.useEffect)(() => { - if (disabled) { - return; - } - if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { - if (!isKeyboardEvent(previousActivatorEvent)) { - return; - } - if (document.activeElement === previousActivatorEvent.target) { - return; - } - const draggableNode = draggableNodes.get(previousActiveId); - if (!draggableNode) { - return; - } - const { - activatorNode, - node - } = draggableNode; - if (!activatorNode.current && !node.current) { - return; - } - requestAnimationFrame(() => { - for (const element of [activatorNode.current, node.current]) { - if (!element) { - continue; - } - const focusableNode = findFirstFocusableNode(element); - if (focusableNode) { - focusableNode.focus(); - break; - } - } - }); - } - }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); - return null; -} -function applyModifiers(modifiers, _ref) { - let { - transform, - ...args - } = _ref; - return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { - return modifier({ - transform: accumulator, - ...args - }); - }, transform) : transform; -} -function useMeasuringConfiguration(config) { - return (0, import_react275.useMemo)( - () => ({ - draggable: { - ...defaultMeasuringConfiguration.draggable, - ...config == null ? void 0 : config.draggable - }, - droppable: { - ...defaultMeasuringConfiguration.droppable, - ...config == null ? void 0 : config.droppable - }, - dragOverlay: { - ...defaultMeasuringConfiguration.dragOverlay, - ...config == null ? void 0 : config.dragOverlay - } - }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay] - ); -} -function useLayoutShiftScrollCompensation(_ref) { - let { - activeNode, - measure, - initialRect, - config = true - } = _ref; - const initialized = (0, import_react275.useRef)(false); - const { - x: x2, - y: y2 - } = typeof config === "boolean" ? { - x: config, - y: config - } : config; - useIsomorphicLayoutEffect2(() => { - const disabled = !x2 && !y2; - if (disabled || !activeNode) { - initialized.current = false; - return; - } - if (initialized.current || !initialRect) { - return; - } - const node = activeNode == null ? void 0 : activeNode.node.current; - if (!node || node.isConnected === false) { - return; - } - const rect = measure(node); - const rectDelta = getRectDelta(rect, initialRect); - if (!x2) { - rectDelta.x = 0; - } - if (!y2) { - rectDelta.y = 0; - } - initialized.current = true; - if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { - const firstScrollableAncestor = getFirstScrollableAncestor(node); - if (firstScrollableAncestor) { - firstScrollableAncestor.scrollBy({ - top: rectDelta.y, - left: rectDelta.x - }); - } - } - }, [activeNode, x2, y2, initialRect, measure]); -} -var ActiveDraggableContext = (0, import_react275.createContext)({ - ...defaultCoordinates, - scaleX: 1, - scaleY: 1 -}); -var Status; -(function(Status2) { - Status2[Status2["Uninitialized"] = 0] = "Uninitialized"; - Status2[Status2["Initializing"] = 1] = "Initializing"; - Status2[Status2["Initialized"] = 2] = "Initialized"; -})(Status || (Status = {})); -var DndContext = (0, import_react275.memo)(function DndContext2(_ref) { - var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; - let { - id, - accessibility, - autoScroll = true, - children: children2, - sensors = defaultSensors, - collisionDetection = rectIntersection, - measuring, - modifiers, - ...props2 - } = _ref; - const store = (0, import_react275.useReducer)(reducer, void 0, getInitialState); - const [state, dispatch] = store; - const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); - const [status, setStatus] = (0, import_react275.useState)(Status.Uninitialized); - const isInitialized = status === Status.Initialized; - const { - draggable: { - active: activeId, - nodes: draggableNodes, - translate - }, - droppable: { - containers: droppableContainers - } - } = state; - const node = activeId ? draggableNodes.get(activeId) : null; - const activeRects = (0, import_react275.useRef)({ - initial: null, - translated: null - }); - const active = (0, import_react275.useMemo)(() => { - var _node$data; - return activeId != null ? { - id: activeId, - // It's possible for the active node to unmount while dragging - data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, - rect: activeRects - } : null; - }, [activeId, node]); - const activeRef = (0, import_react275.useRef)(null); - const [activeSensor, setActiveSensor] = (0, import_react275.useState)(null); - const [activatorEvent, setActivatorEvent] = (0, import_react275.useState)(null); - const latestProps = useLatestValue(props2, Object.values(props2)); - const draggableDescribedById = useUniqueId2("DndDescribedBy", id); - const enabledDroppableContainers = (0, import_react275.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]); - const measuringConfiguration = useMeasuringConfiguration(measuring); - const { - droppableRects, - measureDroppableContainers, - measuringScheduled - } = useDroppableMeasuring(enabledDroppableContainers, { - dragging: isInitialized, - dependencies: [translate.x, translate.y], - config: measuringConfiguration.droppable - }); - const activeNode = useCachedNode(draggableNodes, activeId); - const activationCoordinates = (0, import_react275.useMemo)(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]); - const autoScrollOptions = getAutoScrollerOptions(); - const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); - useLayoutShiftScrollCompensation({ - activeNode: activeId ? draggableNodes.get(activeId) : null, - config: autoScrollOptions.layoutShiftCompensation, - initialRect: initialActiveNodeRect, - measure: measuringConfiguration.draggable.measure - }); - const activeNodeRect = useRect2(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); - const containerNodeRect = useRect2(activeNode ? activeNode.parentElement : null); - const sensorContext = (0, import_react275.useRef)({ - activatorEvent: null, - active: null, - activeNode, - collisionRect: null, - collisions: null, - droppableRects, - draggableNodes, - draggingNode: null, - draggingNodeRect: null, - droppableContainers, - over: null, - scrollableAncestors: [], - scrollAdjustedTranslate: null - }); - const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); - const dragOverlay = useDragOverlayMeasuring({ - measure: measuringConfiguration.dragOverlay.measure - }); - const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; - const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; - const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); - const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); - const windowRect = useWindowRect(draggingNode ? getWindow(draggingNode) : null); - const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); - const scrollableAncestorRects = useRects(scrollableAncestors); - const modifiedTranslate = applyModifiers(modifiers, { - transform: { - x: translate.x - nodeRectDelta.x, - y: translate.y - nodeRectDelta.y, - scaleX: 1, - scaleY: 1 - }, - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggingNodeRect, - over: sensorContext.current.over, - overlayNodeRect: dragOverlay.rect, - scrollableAncestors, - scrollableAncestorRects, - windowRect - }); - const pointerCoordinates = activationCoordinates ? add2(activationCoordinates, translate) : null; - const scrollOffsets = useScrollOffsets(scrollableAncestors); - const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); - const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); - const scrollAdjustedTranslate = add2(modifiedTranslate, scrollAdjustment); - const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; - const collisions = active && collisionRect ? collisionDetection({ - active, - collisionRect, - droppableRects, - droppableContainers: enabledDroppableContainers, - pointerCoordinates - }) : null; - const overId = getFirstCollision(collisions, "id"); - const [over, setOver] = (0, import_react275.useState)(null); - const appliedTranslate = usesDragOverlay ? modifiedTranslate : add2(modifiedTranslate, activeNodeScrollDelta); - const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); - const instantiateSensor = (0, import_react275.useCallback)( - (event, _ref2) => { - let { - sensor: Sensor, - options - } = _ref2; - if (activeRef.current == null) { - return; - } - const activeNode2 = draggableNodes.get(activeRef.current); - if (!activeNode2) { - return; - } - const activatorEvent2 = event.nativeEvent; - const sensorInstance = new Sensor({ - active: activeRef.current, - activeNode: activeNode2, - event: activatorEvent2, - options, - // Sensors need to be instantiated with refs for arguments that change over time - // otherwise they are frozen in time with the stale arguments - context: sensorContext, - onStart(initialCoordinates) { - const id2 = activeRef.current; - if (id2 == null) { - return; - } - const draggableNode = draggableNodes.get(id2); - if (!draggableNode) { - return; - } - const { - onDragStart - } = latestProps.current; - const event2 = { - active: { - id: id2, - data: draggableNode.data, - rect: activeRects - } - }; - (0, import_react_dom7.unstable_batchedUpdates)(() => { - onDragStart == null ? void 0 : onDragStart(event2); - setStatus(Status.Initializing); - dispatch({ - type: Action.DragStart, - initialCoordinates, - active: id2 - }); - dispatchMonitorEvent({ - type: "onDragStart", - event: event2 - }); - }); - }, - onMove(coordinates) { - dispatch({ - type: Action.DragMove, - coordinates - }); - }, - onEnd: createHandler(Action.DragEnd), - onCancel: createHandler(Action.DragCancel) - }); - (0, import_react_dom7.unstable_batchedUpdates)(() => { - setActiveSensor(sensorInstance); - setActivatorEvent(event.nativeEvent); - }); - function createHandler(type) { - return async function handler() { - const { - active: active2, - collisions: collisions2, - over: over2, - scrollAdjustedTranslate: scrollAdjustedTranslate2 - } = sensorContext.current; - let event2 = null; - if (active2 && scrollAdjustedTranslate2) { - const { - cancelDrop - } = latestProps.current; - event2 = { - activatorEvent: activatorEvent2, - active: active2, - collisions: collisions2, - delta: scrollAdjustedTranslate2, - over: over2 - }; - if (type === Action.DragEnd && typeof cancelDrop === "function") { - const shouldCancel = await Promise.resolve(cancelDrop(event2)); - if (shouldCancel) { - type = Action.DragCancel; - } - } - } - activeRef.current = null; - (0, import_react_dom7.unstable_batchedUpdates)(() => { - dispatch({ - type - }); - setStatus(Status.Uninitialized); - setOver(null); - setActiveSensor(null); - setActivatorEvent(null); - const eventName = type === Action.DragEnd ? "onDragEnd" : "onDragCancel"; - if (event2) { - const handler2 = latestProps.current[eventName]; - handler2 == null ? void 0 : handler2(event2); - dispatchMonitorEvent({ - type: eventName, - event: event2 - }); - } - }); - }; - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [draggableNodes] - ); - const bindActivatorToSensorInstantiator = (0, import_react275.useCallback)((handler, sensor) => { - return (event, active2) => { - const nativeEvent = event.nativeEvent; - const activeDraggableNode = draggableNodes.get(active2); - if ( - // Another sensor is already instantiating - activeRef.current !== null || // No active draggable - !activeDraggableNode || // Event has already been captured - nativeEvent.dndKit || nativeEvent.defaultPrevented - ) { - return; - } - const activationContext = { - active: activeDraggableNode - }; - const shouldActivate = handler(event, sensor.options, activationContext); - if (shouldActivate === true) { - nativeEvent.dndKit = { - capturedBy: sensor.sensor - }; - activeRef.current = active2; - instantiateSensor(event, sensor); - } - }; - }, [draggableNodes, instantiateSensor]); - const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); - useSensorSetup(sensors); - useIsomorphicLayoutEffect2(() => { - if (activeNodeRect && status === Status.Initializing) { - setStatus(Status.Initialized); - } - }, [activeNodeRect, status]); - (0, import_react275.useEffect)( - () => { - const { - onDragMove - } = latestProps.current; - const { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - over: over2 - } = sensorContext.current; - if (!active2 || !activatorEvent2) { - return; - } - const event = { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - delta: { - x: scrollAdjustedTranslate.x, - y: scrollAdjustedTranslate.y - }, - over: over2 - }; - (0, import_react_dom7.unstable_batchedUpdates)(() => { - onDragMove == null ? void 0 : onDragMove(event); - dispatchMonitorEvent({ - type: "onDragMove", - event - }); - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y] - ); - (0, import_react275.useEffect)( - () => { - const { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - droppableContainers: droppableContainers2, - scrollAdjustedTranslate: scrollAdjustedTranslate2 - } = sensorContext.current; - if (!active2 || activeRef.current == null || !activatorEvent2 || !scrollAdjustedTranslate2) { - return; - } - const { - onDragOver - } = latestProps.current; - const overContainer = droppableContainers2.get(overId); - const over2 = overContainer && overContainer.rect.current ? { - id: overContainer.id, - rect: overContainer.rect.current, - data: overContainer.data, - disabled: overContainer.disabled - } : null; - const event = { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - delta: { - x: scrollAdjustedTranslate2.x, - y: scrollAdjustedTranslate2.y - }, - over: over2 - }; - (0, import_react_dom7.unstable_batchedUpdates)(() => { - setOver(over2); - onDragOver == null ? void 0 : onDragOver(event); - dispatchMonitorEvent({ - type: "onDragOver", - event - }); - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [overId] - ); - useIsomorphicLayoutEffect2(() => { - sensorContext.current = { - activatorEvent, - active, - activeNode, - collisionRect, - collisions, - droppableRects, - draggableNodes, - draggingNode, - draggingNodeRect, - droppableContainers, - over, - scrollableAncestors, - scrollAdjustedTranslate - }; - activeRects.current = { - initial: draggingNodeRect, - translated: collisionRect - }; - }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); - useAutoScroller({ - ...autoScrollOptions, - delta: translate, - draggingRect: collisionRect, - pointerCoordinates, - scrollableAncestors, - scrollableAncestorRects - }); - const publicContext = (0, import_react275.useMemo)(() => { - const context = { - active, - activeNode, - activeNodeRect, - activatorEvent, - collisions, - containerNodeRect, - dragOverlay, - draggableNodes, - droppableContainers, - droppableRects, - over, - measureDroppableContainers, - scrollableAncestors, - scrollableAncestorRects, - measuringConfiguration, - measuringScheduled, - windowRect - }; - return context; - }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); - const internalContext = (0, import_react275.useMemo)(() => { - const context = { - activatorEvent, - activators, - active, - activeNodeRect, - ariaDescribedById: { - draggable: draggableDescribedById - }, - dispatch, - draggableNodes, - over, - measureDroppableContainers - }; - return context; - }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); - return import_react275.default.createElement(DndMonitorContext.Provider, { - value: registerMonitorListener - }, import_react275.default.createElement(InternalContext.Provider, { - value: internalContext - }, import_react275.default.createElement(PublicContext.Provider, { - value: publicContext - }, import_react275.default.createElement(ActiveDraggableContext.Provider, { - value: transform - }, children2)), import_react275.default.createElement(RestoreFocus, { - disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false - })), import_react275.default.createElement(Accessibility, { - ...accessibility, - hiddenTextDescribedById: draggableDescribedById - })); - function getAutoScrollerOptions() { - const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; - const autoScrollGloballyDisabled = typeof autoScroll === "object" ? autoScroll.enabled === false : autoScroll === false; - const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; - if (typeof autoScroll === "object") { - return { - ...autoScroll, - enabled - }; - } - return { - enabled - }; - } -}); -var NullContext = (0, import_react275.createContext)(null); -var defaultRole = "button"; -var ID_PREFIX = "Droppable"; -function useDraggable(_ref) { - let { - id, - data, - disabled = false, - attributes - } = _ref; - const key2 = useUniqueId2(ID_PREFIX); - const { - activators, - activatorEvent, - active, - activeNodeRect, - ariaDescribedById, - draggableNodes, - over - } = (0, import_react275.useContext)(InternalContext); - const { - role = defaultRole, - roleDescription = "draggable", - tabIndex = 0 - } = attributes != null ? attributes : {}; - const isDragging = (active == null ? void 0 : active.id) === id; - const transform = (0, import_react275.useContext)(isDragging ? ActiveDraggableContext : NullContext); - const [node, setNodeRef] = useNodeRef(); - const [activatorNode, setActivatorNodeRef] = useNodeRef(); - const listeners = useSyntheticListeners(activators, id); - const dataRef = useLatestValue(data); - useIsomorphicLayoutEffect2( - () => { - draggableNodes.set(id, { - id, - key: key2, - node, - activatorNode, - data: dataRef - }); - return () => { - const node2 = draggableNodes.get(id); - if (node2 && node2.key === key2) { - draggableNodes.delete(id); - } - }; - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [draggableNodes, id] - ); - const memoizedAttributes = (0, import_react275.useMemo)(() => ({ - role, - tabIndex, - "aria-disabled": disabled, - "aria-pressed": isDragging && role === defaultRole ? true : void 0, - "aria-roledescription": roleDescription, - "aria-describedby": ariaDescribedById.draggable - }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); - return { - active, - activatorEvent, - activeNodeRect, - attributes: memoizedAttributes, - isDragging, - listeners: disabled ? void 0 : listeners, - node, - over, - setNodeRef, - setActivatorNodeRef, - transform - }; -} -function useDndContext() { - return (0, import_react275.useContext)(PublicContext); -} -var ID_PREFIX$1 = "Droppable"; -var defaultResizeObserverConfig = { - timeout: 25 -}; -function useDroppable(_ref) { - let { - data, - disabled = false, - id, - resizeObserverConfig - } = _ref; - const key2 = useUniqueId2(ID_PREFIX$1); - const { - active, - dispatch, - over, - measureDroppableContainers - } = (0, import_react275.useContext)(InternalContext); - const previous = (0, import_react275.useRef)({ - disabled - }); - const resizeObserverConnected = (0, import_react275.useRef)(false); - const rect = (0, import_react275.useRef)(null); - const callbackId = (0, import_react275.useRef)(null); - const { - disabled: resizeObserverDisabled, - updateMeasurementsFor, - timeout: resizeObserverTimeout - } = { - ...defaultResizeObserverConfig, - ...resizeObserverConfig - }; - const ids2 = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id); - const handleResize = (0, import_react275.useCallback)( - () => { - if (!resizeObserverConnected.current) { - resizeObserverConnected.current = true; - return; - } - if (callbackId.current != null) { - clearTimeout(callbackId.current); - } - callbackId.current = setTimeout(() => { - measureDroppableContainers(Array.isArray(ids2.current) ? ids2.current : [ids2.current]); - callbackId.current = null; - }, resizeObserverTimeout); - }, - //eslint-disable-next-line react-hooks/exhaustive-deps - [resizeObserverTimeout] - ); - const resizeObserver = useResizeObserver2({ - callback: handleResize, - disabled: resizeObserverDisabled || !active - }); - const handleNodeChange = (0, import_react275.useCallback)((newElement, previousElement) => { - if (!resizeObserver) { - return; - } - if (previousElement) { - resizeObserver.unobserve(previousElement); - resizeObserverConnected.current = false; - } - if (newElement) { - resizeObserver.observe(newElement); - } - }, [resizeObserver]); - const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange); - const dataRef = useLatestValue(data); - (0, import_react275.useEffect)(() => { - if (!resizeObserver || !nodeRef.current) { - return; - } - resizeObserver.disconnect(); - resizeObserverConnected.current = false; - resizeObserver.observe(nodeRef.current); - }, [nodeRef, resizeObserver]); - useIsomorphicLayoutEffect2( - () => { - dispatch({ - type: Action.RegisterDroppable, - element: { - id, - key: key2, - disabled, - node: nodeRef, - rect, - data: dataRef - } - }); - return () => dispatch({ - type: Action.UnregisterDroppable, - key: key2, - id - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [id] - ); - (0, import_react275.useEffect)(() => { - if (disabled !== previous.current.disabled) { - dispatch({ - type: Action.SetDroppableDisabled, - id, - key: key2, - disabled - }); - previous.current.disabled = disabled; - } - }, [id, key2, disabled, dispatch]); - return { - active, - rect, - isOver: (over == null ? void 0 : over.id) === id, - node: nodeRef, - over, - setNodeRef - }; -} -function AnimationManager(_ref) { - let { - animation, - children: children2 - } = _ref; - const [clonedChildren, setClonedChildren] = (0, import_react275.useState)(null); - const [element, setElement] = (0, import_react275.useState)(null); - const previousChildren = usePrevious2(children2); - if (!children2 && !clonedChildren && previousChildren) { - setClonedChildren(previousChildren); - } - useIsomorphicLayoutEffect2(() => { - if (!element) { - return; - } - const key2 = clonedChildren == null ? void 0 : clonedChildren.key; - const id = clonedChildren == null ? void 0 : clonedChildren.props.id; - if (key2 == null || id == null) { - setClonedChildren(null); - return; - } - Promise.resolve(animation(id, element)).then(() => { - setClonedChildren(null); - }); - }, [animation, clonedChildren, element]); - return import_react275.default.createElement(import_react275.default.Fragment, null, children2, clonedChildren ? (0, import_react275.cloneElement)(clonedChildren, { - ref: setElement - }) : null); -} -var defaultTransform = { - x: 0, - y: 0, - scaleX: 1, - scaleY: 1 -}; -function NullifiedContextProvider(_ref) { - let { - children: children2 - } = _ref; - return import_react275.default.createElement(InternalContext.Provider, { - value: defaultInternalContext - }, import_react275.default.createElement(ActiveDraggableContext.Provider, { - value: defaultTransform - }, children2)); -} -var baseStyles = { - position: "fixed", - touchAction: "none" -}; -var defaultTransition = (activatorEvent) => { - const isKeyboardActivator = isKeyboardEvent(activatorEvent); - return isKeyboardActivator ? "transform 250ms ease" : void 0; -}; -var PositionedOverlay = (0, import_react275.forwardRef)((_ref, ref) => { - let { - as, - activatorEvent, - adjustScale: adjustScale2, - children: children2, - className: className2, - rect, - style, - transform, - transition = defaultTransition - } = _ref; - if (!rect) { - return null; - } - const scaleAdjustedTransform = adjustScale2 ? transform : { - ...transform, - scaleX: 1, - scaleY: 1 - }; - const styles = { - ...baseStyles, - width: rect.width, - height: rect.height, - top: rect.top, - left: rect.left, - transform: CSS2.Transform.toString(scaleAdjustedTransform), - transformOrigin: adjustScale2 && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : void 0, - transition: typeof transition === "function" ? transition(activatorEvent) : transition, - ...style - }; - return import_react275.default.createElement(as, { - className: className2, - style: styles, - ref - }, children2); -}); -var defaultDropAnimationSideEffects = (options) => (_ref) => { - let { - active, - dragOverlay - } = _ref; - const originalStyles = {}; - const { - styles, - className: className2 - } = options; - if (styles != null && styles.active) { - for (const [key2, value] of Object.entries(styles.active)) { - if (value === void 0) { - continue; - } - originalStyles[key2] = active.node.style.getPropertyValue(key2); - active.node.style.setProperty(key2, value); - } - } - if (styles != null && styles.dragOverlay) { - for (const [key2, value] of Object.entries(styles.dragOverlay)) { - if (value === void 0) { - continue; - } - dragOverlay.node.style.setProperty(key2, value); - } - } - if (className2 != null && className2.active) { - active.node.classList.add(className2.active); - } - if (className2 != null && className2.dragOverlay) { - dragOverlay.node.classList.add(className2.dragOverlay); - } - return function cleanup() { - for (const [key2, value] of Object.entries(originalStyles)) { - active.node.style.setProperty(key2, value); - } - if (className2 != null && className2.active) { - active.node.classList.remove(className2.active); - } - }; -}; -var defaultKeyframeResolver = (_ref2) => { - let { - transform: { - initial, - final - } - } = _ref2; - return [{ - transform: CSS2.Transform.toString(initial) - }, { - transform: CSS2.Transform.toString(final) - }]; -}; -var defaultDropAnimationConfiguration = { - duration: 250, - easing: "ease", - keyframes: defaultKeyframeResolver, - sideEffects: defaultDropAnimationSideEffects({ - styles: { - active: { - opacity: "0" - } - } - }) -}; -function useDropAnimation(_ref3) { - let { - config, - draggableNodes, - droppableContainers, - measuringConfiguration - } = _ref3; - return useEvent((id, node) => { - if (config === null) { - return; - } - const activeDraggable = draggableNodes.get(id); - if (!activeDraggable) { - return; - } - const activeNode = activeDraggable.node.current; - if (!activeNode) { - return; - } - const measurableNode = getMeasurableNode(node); - if (!measurableNode) { - return; - } - const { - transform - } = getWindow(node).getComputedStyle(node); - const parsedTransform = parseTransform(transform); - if (!parsedTransform) { - return; - } - const animation = typeof config === "function" ? config : createDefaultDropAnimation(config); - scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); - return animation({ - active: { - id, - data: activeDraggable.data, - node: activeNode, - rect: measuringConfiguration.draggable.measure(activeNode) - }, - draggableNodes, - dragOverlay: { - node, - rect: measuringConfiguration.dragOverlay.measure(measurableNode) - }, - droppableContainers, - measuringConfiguration, - transform: parsedTransform - }); - }); -} -function createDefaultDropAnimation(options) { - const { - duration, - easing, - sideEffects, - keyframes - } = { - ...defaultDropAnimationConfiguration, - ...options - }; - return (_ref4) => { - let { - active, - dragOverlay, - transform, - ...rest - } = _ref4; - if (!duration) { - return; - } - const delta = { - x: dragOverlay.rect.left - active.rect.left, - y: dragOverlay.rect.top - active.rect.top - }; - const scale = { - scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, - scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 - }; - const finalTransform = { - x: transform.x - delta.x, - y: transform.y - delta.y, - ...scale - }; - const animationKeyframes = keyframes({ - ...rest, - active, - dragOverlay, - transform: { - initial: transform, - final: finalTransform - } - }); - const [firstKeyframe] = animationKeyframes; - const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; - if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { - return; - } - const cleanup = sideEffects == null ? void 0 : sideEffects({ - active, - dragOverlay, - ...rest - }); - const animation = dragOverlay.node.animate(animationKeyframes, { - duration, - easing, - fill: "forwards" - }); - return new Promise((resolve) => { - animation.onfinish = () => { - cleanup == null ? void 0 : cleanup(); - resolve(); - }; - }); - }; -} -var key = 0; -function useKey(id) { - return (0, import_react275.useMemo)(() => { - if (id == null) { - return; - } - key++; - return key; - }, [id]); -} -var DragOverlay = import_react275.default.memo((_ref) => { - let { - adjustScale: adjustScale2 = false, - children: children2, - dropAnimation: dropAnimationConfig, - style, - transition, - modifiers, - wrapperElement = "div", - className: className2, - zIndex = 999 - } = _ref; - const { - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggableNodes, - droppableContainers, - dragOverlay, - over, - measuringConfiguration, - scrollableAncestors, - scrollableAncestorRects, - windowRect - } = useDndContext(); - const transform = (0, import_react275.useContext)(ActiveDraggableContext); - const key2 = useKey(active == null ? void 0 : active.id); - const modifiedTransform = applyModifiers(modifiers, { - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggingNodeRect: dragOverlay.rect, - over, - overlayNodeRect: dragOverlay.rect, - scrollableAncestors, - scrollableAncestorRects, - transform, - windowRect - }); - const initialRect = useInitialValue(activeNodeRect); - const dropAnimation = useDropAnimation({ - config: dropAnimationConfig, - draggableNodes, - droppableContainers, - measuringConfiguration - }); - const ref = initialRect ? dragOverlay.setRef : void 0; - return import_react275.default.createElement(NullifiedContextProvider, null, import_react275.default.createElement(AnimationManager, { - animation: dropAnimation - }, active && key2 ? import_react275.default.createElement(PositionedOverlay, { - key: key2, - id: active.id, - ref, - as: wrapperElement, - activatorEvent, - adjustScale: adjustScale2, - className: className2, - transition, - rect: initialRect, - style: { - zIndex, - ...style - }, - transform: modifiedTransform - }, children2) : null)); -}); - -// node_modules/@dnd-kit/sortable/dist/sortable.esm.js -var import_react276 = __toESM(require_react()); -function arrayMove(array, from, to) { - const newArray = array.slice(); - newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); - return newArray; -} -function getSortedRects(items, rects) { - return items.reduce((accumulator, id, index) => { - const rect = rects.get(id); - if (rect) { - accumulator[index] = rect; - } - return accumulator; - }, Array(items.length)); -} -function isValidIndex(index) { - return index !== null && index >= 0; -} -function itemsEqual(a2, b) { - if (a2 === b) { - return true; - } - if (a2.length !== b.length) { - return false; - } - for (let i = 0; i < a2.length; i++) { - if (a2[i] !== b[i]) { - return false; - } - } - return true; -} -function normalizeDisabled(disabled) { - if (typeof disabled === "boolean") { - return { - draggable: disabled, - droppable: disabled - }; - } - return disabled; -} -var rectSortingStrategy = (_ref) => { - let { - rects, - activeIndex, - overIndex, - index - } = _ref; - const newRects = arrayMove(rects, overIndex, activeIndex); - const oldRect = rects[index]; - const newRect = newRects[index]; - if (!newRect || !oldRect) { - return null; - } - return { - x: newRect.left - oldRect.left, - y: newRect.top - oldRect.top, - scaleX: newRect.width / oldRect.width, - scaleY: newRect.height / oldRect.height - }; -}; -var defaultScale$1 = { - scaleX: 1, - scaleY: 1 -}; -var verticalListSortingStrategy = (_ref) => { - var _rects$activeIndex; - let { - activeIndex, - activeNodeRect: fallbackActiveRect, - index, - rects, - overIndex - } = _ref; - const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; - if (!activeNodeRect) { - return null; - } - if (index === activeIndex) { - const overIndexRect = rects[overIndex]; - if (!overIndexRect) { - return null; - } - return { - x: 0, - y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, - ...defaultScale$1 - }; - } - const itemGap = getItemGap$1(rects, index, activeIndex); - if (index > activeIndex && index <= overIndex) { - return { - x: 0, - y: -activeNodeRect.height - itemGap, - ...defaultScale$1 - }; - } - if (index < activeIndex && index >= overIndex) { - return { - x: 0, - y: activeNodeRect.height + itemGap, - ...defaultScale$1 - }; - } - return { - x: 0, - y: 0, - ...defaultScale$1 - }; -}; -function getItemGap$1(clientRects, index, activeIndex) { - const currentRect = clientRects[index]; - const previousRect = clientRects[index - 1]; - const nextRect = clientRects[index + 1]; - if (!currentRect) { - return 0; - } - if (activeIndex < index) { - return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; - } - return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; -} -var ID_PREFIX2 = "Sortable"; -var Context = import_react276.default.createContext({ - activeIndex: -1, - containerId: ID_PREFIX2, - disableTransforms: false, - items: [], - overIndex: -1, - useDragOverlay: false, - sortedRects: [], - strategy: rectSortingStrategy, - disabled: { - draggable: false, - droppable: false - } -}); -function SortableContext(_ref) { - let { - children: children2, - id, - items: userDefinedItems, - strategy = rectSortingStrategy, - disabled: disabledProp = false - } = _ref; - const { - active, - dragOverlay, - droppableRects, - over, - measureDroppableContainers - } = useDndContext(); - const containerId = useUniqueId2(ID_PREFIX2, id); - const useDragOverlay = Boolean(dragOverlay.rect !== null); - const items = (0, import_react276.useMemo)(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]); - const isDragging = active != null; - const activeIndex = active ? items.indexOf(active.id) : -1; - const overIndex = over ? items.indexOf(over.id) : -1; - const previousItemsRef = (0, import_react276.useRef)(items); - const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); - const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; - const disabled = normalizeDisabled(disabledProp); - useIsomorphicLayoutEffect2(() => { - if (itemsHaveChanged && isDragging) { - measureDroppableContainers(items); - } - }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]); - (0, import_react276.useEffect)(() => { - previousItemsRef.current = items; - }, [items]); - const contextValue = (0, import_react276.useMemo)( - () => ({ - activeIndex, - containerId, - disabled, - disableTransforms, - items, - overIndex, - useDragOverlay, - sortedRects: getSortedRects(items, droppableRects), - strategy - }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy] - ); - return import_react276.default.createElement(Context.Provider, { - value: contextValue - }, children2); -} -var defaultNewIndexGetter = (_ref) => { - let { - id, - items, - activeIndex, - overIndex - } = _ref; - return arrayMove(items, activeIndex, overIndex).indexOf(id); -}; -var defaultAnimateLayoutChanges = (_ref2) => { - let { - containerId, - isSorting, - wasDragging, - index, - items, - newIndex, - previousItems, - previousContainerId, - transition - } = _ref2; - if (!transition || !wasDragging) { - return false; - } - if (previousItems !== items && index === newIndex) { - return false; - } - if (isSorting) { - return true; - } - return newIndex !== index && containerId === previousContainerId; -}; -var defaultTransition2 = { - duration: 200, - easing: "ease" -}; -var transitionProperty = "transform"; -var disabledTransition = CSS2.Transition.toString({ - property: transitionProperty, - duration: 0, - easing: "linear" -}); -var defaultAttributes = { - roleDescription: "sortable" -}; -function useDerivedTransform(_ref) { - let { - disabled, - index, - node, - rect - } = _ref; - const [derivedTransform, setDerivedtransform] = (0, import_react276.useState)(null); - const previousIndex = (0, import_react276.useRef)(index); - useIsomorphicLayoutEffect2(() => { - if (!disabled && index !== previousIndex.current && node.current) { - const initial = rect.current; - if (initial) { - const current = getClientRect(node.current, { - ignoreTransform: true - }); - const delta = { - x: initial.left - current.left, - y: initial.top - current.top, - scaleX: initial.width / current.width, - scaleY: initial.height / current.height - }; - if (delta.x || delta.y) { - setDerivedtransform(delta); - } - } - } - if (index !== previousIndex.current) { - previousIndex.current = index; - } - }, [disabled, index, node, rect]); - (0, import_react276.useEffect)(() => { - if (derivedTransform) { - setDerivedtransform(null); - } - }, [derivedTransform]); - return derivedTransform; -} -function useSortable(_ref) { - let { - animateLayoutChanges = defaultAnimateLayoutChanges, - attributes: userDefinedAttributes, - disabled: localDisabled, - data: customData, - getNewIndex = defaultNewIndexGetter, - id, - strategy: localStrategy, - resizeObserverConfig, - transition = defaultTransition2 - } = _ref; - const { - items, - containerId, - activeIndex, - disabled: globalDisabled, - disableTransforms, - sortedRects, - overIndex, - useDragOverlay, - strategy: globalStrategy - } = (0, import_react276.useContext)(Context); - const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); - const index = items.indexOf(id); - const data = (0, import_react276.useMemo)(() => ({ - sortable: { - containerId, - index, - items - }, - ...customData - }), [containerId, customData, index, items]); - const itemsAfterCurrentSortable = (0, import_react276.useMemo)(() => items.slice(items.indexOf(id)), [items, id]); - const { - rect, - node, - isOver, - setNodeRef: setDroppableNodeRef - } = useDroppable({ - id, - data, - disabled: disabled.droppable, - resizeObserverConfig: { - updateMeasurementsFor: itemsAfterCurrentSortable, - ...resizeObserverConfig - } - }); - const { - active, - activatorEvent, - activeNodeRect, - attributes, - setNodeRef: setDraggableNodeRef, - listeners, - isDragging, - over, - setActivatorNodeRef, - transform - } = useDraggable({ - id, - data, - attributes: { - ...defaultAttributes, - ...userDefinedAttributes - }, - disabled: disabled.draggable - }); - const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef); - const isSorting = Boolean(active); - const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); - const shouldDisplaceDragSource = !useDragOverlay && isDragging; - const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; - const strategy = localStrategy != null ? localStrategy : globalStrategy; - const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ - rects: sortedRects, - activeNodeRect, - activeIndex, - overIndex, - index - }) : null; - const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ - id, - items, - activeIndex, - overIndex - }) : index; - const activeId = active == null ? void 0 : active.id; - const previous = (0, import_react276.useRef)({ - activeId, - items, - newIndex, - containerId - }); - const itemsHaveChanged = items !== previous.current.items; - const shouldAnimateLayoutChanges = animateLayoutChanges({ - active, - containerId, - isDragging, - isSorting, - id, - index, - items, - newIndex: previous.current.newIndex, - previousItems: previous.current.items, - previousContainerId: previous.current.containerId, - transition, - wasDragging: previous.current.activeId != null - }); - const derivedTransform = useDerivedTransform({ - disabled: !shouldAnimateLayoutChanges, - index, - node, - rect - }); - (0, import_react276.useEffect)(() => { - if (isSorting && previous.current.newIndex !== newIndex) { - previous.current.newIndex = newIndex; - } - if (containerId !== previous.current.containerId) { - previous.current.containerId = containerId; - } - if (items !== previous.current.items) { - previous.current.items = items; - } - }, [isSorting, newIndex, containerId, items]); - (0, import_react276.useEffect)(() => { - if (activeId === previous.current.activeId) { - return; - } - if (activeId && !previous.current.activeId) { - previous.current.activeId = activeId; - return; - } - const timeoutId = setTimeout(() => { - previous.current.activeId = activeId; - }, 50); - return () => clearTimeout(timeoutId); - }, [activeId]); - return { - active, - activeIndex, - attributes, - data, - rect, - index, - newIndex, - items, - isOver, - isSorting, - isDragging, - listeners, - node, - overIndex, - over, - setNodeRef, - setActivatorNodeRef, - setDroppableNodeRef, - setDraggableNodeRef, - transform: derivedTransform != null ? derivedTransform : finalTransform, - transition: getTransition() - }; - function getTransition() { - if ( - // Temporarily disable transitions for a single frame to set up derived transforms - derivedTransform || // Or to prevent items jumping to back to their "new" position when items change - itemsHaveChanged && previous.current.newIndex === index - ) { - return disabledTransition; - } - if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { - return void 0; - } - if (isSorting || shouldAnimateLayoutChanges) { - return CSS2.Transition.toString({ - ...transition, - property: transitionProperty - }); - } - return void 0; - } -} -function normalizeLocalDisabled(localDisabled, globalDisabled) { - var _localDisabled$dragga, _localDisabled$droppa; - if (typeof localDisabled === "boolean") { - return { - draggable: localDisabled, - // Backwards compatibility - droppable: false - }; - } - return { - draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, - droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable - }; -} -function hasSortableData(entry) { - if (!entry) { - return false; - } - const data = entry.data.current; - if (data && "sortable" in data && typeof data.sortable === "object" && "containerId" in data.sortable && "items" in data.sortable && "index" in data.sortable) { - return true; - } - return false; -} -var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/draggable-option.js -var import_react280 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/drag-handle/index.js -var import_react278 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/handle/index.js -var import_react277 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/handle/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/handle/styles.scoped.css"; -var styles_css_default83 = { - "handle": "awsui_handle_iykw5_1lvye_99", - "hide-focus": "awsui_hide-focus_iykw5_1lvye_113" -}; - -// node_modules/@cloudscape-design/components/internal/components/handle/index.js -function Handle(props2) { - return import_react277.default.createElement("div", Object.assign({ role: "button", tabIndex: 0 }, props2, { onPointerDown: props2.onPointerDown, className: clsx_m_default(styles_css_default83.handle, props2.className) })); -} - -// node_modules/@cloudscape-design/components/internal/components/drag-handle/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/drag-handle/styles.scoped.css"; -var styles_css_default84 = { - "handle": "awsui_handle_sdha6_1v8zk_5" -}; - -// node_modules/@cloudscape-design/components/internal/components/drag-handle/index.js -function DragHandle({ attributes, hideFocus, listeners }) { - return import_react278.default.createElement( - Handle, - Object.assign({ className: clsx_m_default(styles_css_default84.handle, hideFocus && styles_css_default83["hide-focus"]) }, attributes, listeners), - import_react278.default.createElement(internal_default, { name: "drag-indicator" }) - ); -} - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/content-display-option.js -var import_react279 = __toESM(require_react()); -var componentPrefix = "content-display-option"; -var getClassName = (suffix) => styles_css_default81[[componentPrefix, suffix].filter(Boolean).join("-")]; -var ContentDisplayOption = (0, import_react279.forwardRef)(({ dragHandleAriaLabel, listeners, onToggle, option }, ref) => { - const idPrefix = useUniqueId(componentPrefix); - const controlId = `${idPrefix}-control-${option.id}`; - const dragHandleAttributes = { - ["aria-label"]: [dragHandleAriaLabel, option.label].join(", ") - }; - return import_react279.default.createElement( - "div", - { ref, className: getClassName("content") }, - import_react279.default.createElement(DragHandle, { attributes: dragHandleAttributes, listeners }), - import_react279.default.createElement("label", { className: getClassName("label"), htmlFor: controlId }, option.label), - import_react279.default.createElement( - "div", - { className: getClassName("toggle") }, - import_react279.default.createElement(internal_default14, { checked: !!option.visible, onChange: () => onToggle && onToggle(option), disabled: option.alwaysVisible === true, controlId }) - ) - ); -}); -var content_display_option_default = ContentDisplayOption; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/draggable-option.js -function DraggableOption({ dragHandleAriaLabel, onKeyDown, onToggle, option }) { - const { isDragging, isSorting, listeners, setNodeRef, transform } = useSortable({ - id: option.id - }); - const style = { - transform: CSS2.Translate.toString(transform) - }; - const combinedListeners = Object.assign(Object.assign({}, listeners), { onKeyDown: (event) => { - if (onKeyDown) { - onKeyDown(event); - } - if (listeners === null || listeners === void 0 ? void 0 : listeners.onKeyDown) { - listeners.onKeyDown(event); - } - } }); - return import_react280.default.createElement( - "li", - { className: clsx_m_default(getClassName(), isDragging && styles_css_default81.placeholder, isSorting && styles_css_default81.sorting), style }, - import_react280.default.createElement(content_display_option_default, { ref: setNodeRef, listeners: combinedListeners, dragHandleAriaLabel, onToggle, option }) - ); -} - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/use-drag-and-drop-reorder.js -var import_react281 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/keyboard-sensor/utilities/scroll.js -function isDocumentScrollingElement2(element) { - if (!canUseDOM || !element) { - return false; - } - return element === document.scrollingElement; -} -function getScrollPosition2(scrollingContainer) { - const minScroll = { - x: 0, - y: 0 - }; - const dimensions = isDocumentScrollingElement2(scrollingContainer) ? { - height: window.innerHeight, - width: window.innerWidth - } : { - height: scrollingContainer.clientHeight, - width: scrollingContainer.clientWidth - }; - const maxScroll = { - x: scrollingContainer.scrollWidth - dimensions.width, - y: scrollingContainer.scrollHeight - dimensions.height - }; - const isTop = scrollingContainer.scrollTop <= minScroll.y; - const isLeft = scrollingContainer.scrollLeft <= minScroll.x; - const isBottom = scrollingContainer.scrollTop >= maxScroll.y; - const isRight = scrollingContainer.scrollLeft >= maxScroll.x; - return { - isTop, - isLeft, - isBottom, - isRight, - maxScroll, - minScroll - }; -} -function getScrollElementRect2(element) { - if (element === document.scrollingElement) { - const { innerWidth, innerHeight } = window; - return { - top: 0, - left: 0, - right: innerWidth, - bottom: innerHeight, - width: innerWidth, - height: innerHeight - }; - } - const { top, left, right, bottom } = element.getBoundingClientRect(); - return { - top, - left, - right, - bottom, - width: element.clientWidth, - height: element.clientHeight - }; -} -function applyScroll({ currentCoordinates, direction, newCoordinates, scrollableAncestors }) { - for (const scrollContainer of scrollableAncestors) { - const coordinatesDelta = subtract(newCoordinates, currentCoordinates); - const { isTop, isBottom, maxScroll, minScroll } = getScrollPosition2(scrollContainer); - const scrollElementRect = getScrollElementRect2(scrollContainer); - const clampedCoordinates = { - y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) - }; - const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; - if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { - const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; - const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; - if (canScrollToNewCoordinates) { - scrollContainer.scrollTo({ - top: newScrollCoordinates, - behavior: "smooth" - }); - return true; - } - break; - } - } - return false; -} - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/keyboard-sensor/utilities/events.js -var EventName2; -(function(EventName3) { - EventName3["Blur"] = "blur"; - EventName3["Click"] = "click"; - EventName3["DragStart"] = "dragstart"; - EventName3["Keydown"] = "keydown"; - EventName3["ContextMenu"] = "contextmenu"; - EventName3["Resize"] = "resize"; - EventName3["SelectionChange"] = "selectionchange"; - EventName3["VisibilityChange"] = "visibilitychange"; -})(EventName2 || (EventName2 = {})); - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/keyboard-sensor/utilities/listeners.js -var Listeners2 = class { - constructor(target) { - this.target = target; - this.listeners = []; - this.removeAll = () => { - this.listeners.forEach((listener) => { - var _a2; - return (_a2 = this.target) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(...listener); - }); - }; - } - add(eventName, handler, options) { - var _a2; - (_a2 = this.target) === null || _a2 === void 0 ? void 0 : _a2.addEventListener(eventName, handler, options); - this.listeners.push([eventName, handler, options]); - } -}; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/keyboard-sensor/defaults.js -var defaultKeyboardCodes2 = { - start: [KeyboardCode.Space, KeyboardCode.Enter], - cancel: [KeyboardCode.Esc], - end: [KeyboardCode.Space, KeyboardCode.Enter] -}; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/keyboard-sensor/index.js -var KeyboardSensor2 = class { - constructor(props2) { - this.props = props2; - this.autoScrollEnabled = false; - const { event: { target } } = props2; - this.props = props2; - this.listeners = new Listeners2(getOwnerDocument(target)); - this.windowListeners = new Listeners2(getWindow(target)); - this.handleKeyDown = this.handleKeyDown.bind(this); - this.handleCancel = this.handleCancel.bind(this); - this.attach(); - } - attach() { - var _a2; - this.handleStart(); - this.windowListeners.add(EventName2.Resize, this.handleCancel); - this.windowListeners.add(EventName2.VisibilityChange, this.handleCancel); - (_a2 = this.props.event.target) === null || _a2 === void 0 ? void 0 : _a2.addEventListener(EventName2.Blur, this.handleCancel); - setTimeout(() => this.listeners.add(EventName2.Keydown, this.handleKeyDown)); - } - handleStart() { - const { activeNode, onStart } = this.props; - const node = activeNode.node.current; - if (node) { - scrollElementIntoView(node); - } - onStart(defaultCoordinates); - } - handleKeyDown(event) { - if (isKeyboardEvent(event)) { - const { active, context, options } = this.props; - const { keyboardCodes = defaultKeyboardCodes2, coordinateGetter } = options; - const { code } = event; - if (keyboardCodes.end.indexOf(code) !== -1) { - this.handleEnd(event); - return; - } - if (keyboardCodes.cancel.indexOf(code) !== -1) { - this.handleCancel(event); - return; - } - const { collisionRect } = context.current; - const currentCoordinates = collisionRect ? { x: collisionRect.left, y: collisionRect.top } : defaultCoordinates; - if (!this.referenceCoordinates) { - this.referenceCoordinates = currentCoordinates; - } - if (!coordinateGetter) { - return; - } - const newCoordinates = coordinateGetter(event, { - active, - context: context.current, - currentCoordinates - }); - if (newCoordinates) { - const { scrollableAncestors } = context.current; - const direction = event.code; - const scrolled = applyScroll({ currentCoordinates, direction, newCoordinates, scrollableAncestors }); - if (!scrolled) { - this.handleMove(event, subtract(newCoordinates, this.referenceCoordinates)); - } - } - } - } - handleMove(event, coordinates) { - const { onMove } = this.props; - event.preventDefault(); - onMove(coordinates); - } - handleEnd(event) { - const { onEnd } = this.props; - event.preventDefault(); - this.detach(); - onEnd(); - } - handleCancel(event) { - const { onCancel } = this.props; - if (event.type !== EventName2.Blur) { - event.preventDefault(); - } - this.detach(); - onCancel(); - } - detach() { - var _a2; - (_a2 = this.props.event.target) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(EventName2.Blur, this.handleCancel); - this.listeners.removeAll(); - this.windowListeners.removeAll(); - } -}; -KeyboardSensor2.activators = [ - { - eventName: "onKeyDown", - handler: (event, { keyboardCodes = defaultKeyboardCodes2, onActivation }, { active }) => { - const { code } = event.nativeEvent; - if (keyboardCodes.start.indexOf(code) !== -1) { - const activator = active.activatorNode.current; - if (activator && event.target !== activator) { - return false; - } - event.preventDefault(); - onActivation === null || onActivation === void 0 ? void 0 : onActivation({ event: event.nativeEvent }); - return true; - } - return false; - } - } -]; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/use-drag-and-drop-reorder.js -var KeyboardCode2; -(function(KeyboardCode3) { - KeyboardCode3["Space"] = "Space"; - KeyboardCode3["Down"] = "ArrowDown"; - KeyboardCode3["Right"] = "ArrowRight"; - KeyboardCode3["Left"] = "ArrowLeft"; - KeyboardCode3["Up"] = "ArrowUp"; - KeyboardCode3["Esc"] = "Escape"; - KeyboardCode3["Enter"] = "Enter"; -})(KeyboardCode2 || (KeyboardCode2 = {})); -function useDragAndDropReorder({ sortedOptions }) { - const isKeyboard = (0, import_react281.useRef)(false); - const positionDelta = (0, import_react281.useRef)(0); - const [activeItemId, setActiveItemId] = (0, import_react281.useState)(null); - const setActiveItem = (id) => { - setActiveItemId(id); - if (!id) { - isKeyboard.current = false; - positionDelta.current = 0; - } - }; - const handleKeyDown = (event) => { - if (isKeyboard.current && activeItemId) { - const currentTargetIndex = sortedOptions.findIndex(({ id }) => id === activeItemId) + positionDelta.current; - if (event.key === "ArrowDown" && currentTargetIndex < sortedOptions.length - 1) { - positionDelta.current += 1; - } else if (event.key === "ArrowUp" && currentTargetIndex > 0) { - positionDelta.current -= 1; - } - } - if (activeItemId && isEscape2(event.key)) { - event.stopPropagation(); - } - }; - const getClosestId = (active) => { - if (positionDelta.current === 0) { - return active.id; - } - const currentIndex = sortedOptions.findIndex(({ id }) => id === active.id); - const newIndex = Math.max(0, Math.min(sortedOptions.length - 1, currentIndex + positionDelta.current)); - return sortedOptions[newIndex].id; - }; - const collisionDetection = ({ active, collisionRect, droppableContainers, droppableRects, pointerCoordinates }) => { - if (isKeyboard.current) { - const collidingContainer = getCollidingContainer({ - activeId: active.id, - closestId: getClosestId(active), - droppableContainers - }); - return collidingContainer ? [collidingContainer] : []; - } else { - return closestCenter({ active, collisionRect, droppableRects, droppableContainers, pointerCoordinates }); - } - }; - const coordinateGetter = (event, { context: { active, collisionRect, droppableRects, droppableContainers } }) => { - if (event.code === KeyboardCode2.Up || event.code === KeyboardCode2.Down) { - event.preventDefault(); - if (!active || !collisionRect) { - return; - } - const closestId = getClosestId(active); - if (closestId !== null) { - const activeDroppable = droppableContainers.get(active.id); - const newDroppable = droppableContainers.get(closestId); - const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; - const newNode = newDroppable === null || newDroppable === void 0 ? void 0 : newDroppable.node.current; - if (newNode && newRect && activeDroppable && newDroppable) { - const isAfterActive = isAfter2(activeDroppable, newDroppable); - const offset = { - x: isAfterActive ? collisionRect.width - newRect.width : 0, - y: isAfterActive ? collisionRect.height - newRect.height : 0 - }; - const rectCoordinates = { - x: newRect.left, - y: newRect.top - }; - return { - x: rectCoordinates.x - offset.x, - y: rectCoordinates.y - offset.y - }; - } - } - } - }; - const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor2, { - coordinateGetter, - onActivation: () => { - isKeyboard.current = true; - } - })); - return { - activeItem: activeItemId, - collisionDetection, - coordinateGetter, - handleKeyDown, - sensors, - setActiveItem - }; -} -function isAfter2(a2, b) { - return hasSortableData(a2) && hasSortableData(b) && a2.data.current.sortable.index < b.data.current.sortable.index; -} -function getCollidingContainer({ activeId, closestId, droppableContainers }) { - if (closestId === activeId) { - return; - } - const collidingContainer = droppableContainers.find(({ id }) => id === closestId); - if (collidingContainer) { - return { - id: collidingContainer.id, - data: { - droppableContainer: collidingContainer, - value: 0 - } - }; - } -} -var isEscape2 = (key2) => key2 === "Escape" || key2 === "Esc"; - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/use-live-announcements.js -var import_react282 = __toESM(require_react()); -function useLiveAnnouncements({ isDragging, liveAnnouncementDndStarted, liveAnnouncementDndItemReordered, liveAnnouncementDndItemCommitted, liveAnnouncementDndDiscarded, sortedOptions }) { - const isFirstAnnouncement = (0, import_react282.useRef)(true); - if (!isDragging) { - isFirstAnnouncement.current = true; - } - return { - onDragStart({ active }) { - if (active && liveAnnouncementDndStarted) { - const index = sortedOptions.findIndex((option) => option.id === active.id); - return liveAnnouncementDndStarted(index + 1, sortedOptions.length); - } - }, - onDragOver({ active, over }) { - if (liveAnnouncementDndItemReordered) { - if (isFirstAnnouncement.current) { - isFirstAnnouncement.current = false; - if (!over || over.id === active.id) { - return; - } - } - const initialIndex = sortedOptions.findIndex((option) => option.id === active.id); - const currentIdex = over ? sortedOptions.findIndex((option) => option.id === over.id) : initialIndex; - return liveAnnouncementDndItemReordered(initialIndex + 1, currentIdex + 1, sortedOptions.length); - } - }, - onDragEnd({ active, over }) { - if (liveAnnouncementDndItemCommitted) { - const initialIndex = sortedOptions.findIndex((option) => option.id === active.id); - const finalIndex = over ? sortedOptions.findIndex((option) => option.id === over.id) : initialIndex; - return liveAnnouncementDndItemCommitted(initialIndex + 1, finalIndex + 1, sortedOptions.length); - } - }, - onDragCancel() { - return liveAnnouncementDndDiscarded; - } - }; -} - -// node_modules/@cloudscape-design/components/collection-preferences/content-display/index.js -var componentPrefix2 = "content-display"; -var getClassName2 = (suffix) => styles_css_default81[`${componentPrefix2}-${suffix}`]; -function ContentDisplayPreference({ title, description, options, value = options.map(({ id }) => ({ - id, - visible: true -})), onChange, liveAnnouncementDndStarted, liveAnnouncementDndItemReordered, liveAnnouncementDndItemCommitted, liveAnnouncementDndDiscarded, dragHandleAriaDescription, dragHandleAriaLabel }) { - const idPrefix = useUniqueId(componentPrefix2); - const i18n = useInternalI18n("collection-preferences"); - const onToggle = (option) => { - onChange(value.map((item) => item.id === option.id ? Object.assign(Object.assign({}, item), { visible: !option.visible }) : item)); - }; - const titleId = `${idPrefix}-title`; - const descriptionId = `${idPrefix}-description`; - const sortedOptions = getSortedOptions({ options, contentDisplay: value }); - const { activeItem, collisionDetection, handleKeyDown, sensors, setActiveItem } = useDragAndDropReorder({ - sortedOptions - }); - const activeOption = activeItem ? sortedOptions.find(({ id }) => id === activeItem) : null; - const announcements = useLiveAnnouncements({ - isDragging: activeItem !== null, - liveAnnouncementDndStarted: i18n("contentDisplayPreference.liveAnnouncementDndStarted", liveAnnouncementDndStarted, (format3) => (position, total) => format3({ position, total })), - liveAnnouncementDndItemReordered: i18n("contentDisplayPreference.liveAnnouncementDndItemReordered", liveAnnouncementDndItemReordered, (format3) => (initialPosition, currentPosition, total) => format3({ currentPosition, total, isInitialPosition: `${initialPosition === currentPosition}` })), - liveAnnouncementDndItemCommitted: i18n("contentDisplayPreference.liveAnnouncementDndItemCommitted", liveAnnouncementDndItemCommitted, (format3) => (initialPosition, finalPosition, total) => format3({ initialPosition, finalPosition, total, isInitialPosition: `${initialPosition === finalPosition}` })), - liveAnnouncementDndDiscarded: i18n("contentDisplayPreference.liveAnnouncementDndDiscarded", liveAnnouncementDndDiscarded), - sortedOptions: value - }); - const renderedDragHandleAriaDescription = i18n("contentDisplayPreference.dragHandleAriaDescription", dragHandleAriaDescription); - return import_react283.default.createElement( - "div", - { className: styles_css_default81[componentPrefix2] }, - import_react283.default.createElement("h3", { className: getClassName2("title"), id: titleId }, i18n("contentDisplayPreference.title", title)), - import_react283.default.createElement("p", { className: getClassName2("description"), id: descriptionId }, i18n("contentDisplayPreference.description", description)), - import_react283.default.createElement( - DndContext, - { sensors, collisionDetection, accessibility: { - announcements, - restoreFocus: false, - screenReaderInstructions: renderedDragHandleAriaDescription ? { draggable: renderedDragHandleAriaDescription } : void 0 - }, onDragStart: ({ active }) => setActiveItem(active.id), onDragEnd: (event) => { - setActiveItem(null); - const { active, over } = event; - if (over && active.id !== over.id) { - const oldIndex = value.findIndex(({ id }) => id === active.id); - const newIndex = value.findIndex(({ id }) => id === over.id); - onChange(arrayMove([...value], oldIndex, newIndex)); - } - }, onDragCancel: () => setActiveItem(null) }, - import_react283.default.createElement( - "ul", - { className: getClassName2("option-list"), "aria-describedby": descriptionId, "aria-labelledby": titleId, role: "list" }, - import_react283.default.createElement(SortableContext, { items: sortedOptions.map(({ id }) => id), strategy: verticalListSortingStrategy }, sortedOptions.map((option) => { - return import_react283.default.createElement(DraggableOption, { dragHandleAriaLabel: i18n("contentDisplayPreference.dragHandleAriaLabel", dragHandleAriaLabel), key: option.id, onKeyDown: handleKeyDown, onToggle, option }); - })) - ), - import_react283.default.createElement( - Portal, - null, - import_react283.default.createElement(DragOverlay, { className: styles_css_default81["drag-overlay"], dropAnimation: null, style: { zIndex: 5e3 } }, activeOption && import_react283.default.createElement(content_display_option_default, { listeners: { onKeyDown: handleKeyDown }, dragHandleAriaLabel: i18n("contentDisplayPreference.dragHandleAriaLabel", dragHandleAriaLabel), onToggle, option: activeOption })) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/collection-preferences/index.js -var componentName2 = "CollectionPreferences"; -function CollectionPreferences(_a2) { - var { title, confirmLabel, cancelLabel, disabled = false, onConfirm, onCancel, visibleContentPreference, contentDisplayPreference, pageSizePreference, wrapLinesPreference, stripedRowsPreference, contentDensityPreference, stickyColumnsPreference, preferences, customPreference, getModalRoot, removeModalRoot } = _a2, rest = __rest(_a2, ["title", "confirmLabel", "cancelLabel", "disabled", "onConfirm", "onCancel", "visibleContentPreference", "contentDisplayPreference", "pageSizePreference", "wrapLinesPreference", "stripedRowsPreference", "contentDensityPreference", "stickyColumnsPreference", "preferences", "customPreference", "getModalRoot", "removeModalRoot"]); - const { __internalRootRef } = useBaseComponent("CollectionPreferences"); - checkControlled("CollectionPreferences", "preferences", preferences, "onConfirm", onConfirm); - const i18n = useInternalI18n("collection-preferences"); - const baseProps = getBaseProps(rest); - const [modalVisible, setModalVisible] = (0, import_react284.useState)(false); - const [temporaryPreferences, setTemporaryPreferences] = (0, import_react284.useState)(copyPreferences(preferences || {})); - const triggerRef = (0, import_react284.useRef)(null); - const dialogPreviouslyOpen = (0, import_react284.useRef)(false); - (0, import_react284.useEffect)(() => { - if (!modalVisible) { - dialogPreviouslyOpen.current && triggerRef.current && triggerRef.current.focus(); - } else { - dialogPreviouslyOpen.current = true; - } - }, [modalVisible]); - const onConfirmListener = () => { - setModalVisible(false); - fireNonCancelableEvent(onConfirm, temporaryPreferences); - }; - const onCancelListener = () => { - fireNonCancelableEvent(onCancel, {}); - setModalVisible(false); - setTemporaryPreferences(copyPreferences(preferences || {})); - }; - const hasContentOnTheLeft = !!(pageSizePreference || wrapLinesPreference || stripedRowsPreference || contentDensityPreference || stickyColumnsPreference || customPreference); - const hasContentOnTheRight = !!(visibleContentPreference || contentDisplayPreference); - const onChange = (changedPreferences) => setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences)); - if (visibleContentPreference && contentDisplayPreference) { - warnOnce(componentName2, "You provided both `visibleContentPreference` and `contentDisplayPreference` props. `visibleContentPreference` will be ignored and only `contentDisplayPreference` will be rendered."); - } - return import_react284.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default81.root), ref: __internalRootRef }), - import_react284.default.createElement(InternalButton, { ref: triggerRef, className: styles_css_default81["trigger-button"], disabled, ariaLabel: i18n("title", title), onClick: () => { - setTemporaryPreferences(copyPreferences(preferences || {})); - setModalVisible(true); - }, variant: "icon", iconName: "settings", formAction: "none" }), - !disabled && modalVisible && import_react284.default.createElement( - InternalModal, - { className: styles_css_default81["modal-root"], visible: true, getModalRoot, removeModalRoot, header: i18n("title", title), footer: import_react284.default.createElement( - InternalBox, - { float: "right" }, - import_react284.default.createElement( - InternalSpaceBetween, - { direction: "horizontal", size: "xs" }, - import_react284.default.createElement(InternalButton, { className: styles_css_default81["cancel-button"], variant: "link", formAction: "none", onClick: onCancelListener }, i18n("cancelLabel", cancelLabel)), - import_react284.default.createElement(InternalButton, { className: styles_css_default81["confirm-button"], variant: "primary", formAction: "none", onClick: onConfirmListener }, i18n("confirmLabel", confirmLabel)) - ) - ), closeAriaLabel: cancelLabel, size: hasContentOnTheLeft && hasContentOnTheRight ? "large" : "medium", onDismiss: onCancelListener }, - import_react284.default.createElement(ModalContentLayout, { left: hasContentOnTheLeft && import_react284.default.createElement( - InternalSpaceBetween, - { size: "l" }, - pageSizePreference && import_react284.default.createElement(PageSizePreference, Object.assign({ value: temporaryPreferences.pageSize }, pageSizePreference, { onChange: (pageSize) => onChange({ pageSize }) })), - wrapLinesPreference && import_react284.default.createElement(WrapLinesPreference, Object.assign({ value: temporaryPreferences.wrapLines }, wrapLinesPreference, { onChange: (wrapLines) => onChange({ wrapLines }) })), - stripedRowsPreference && import_react284.default.createElement(StripedRowsPreference, Object.assign({ value: temporaryPreferences.stripedRows }, stripedRowsPreference, { onChange: (stripedRows) => onChange({ stripedRows }) })), - contentDensityPreference && import_react284.default.createElement(ContentDensityPreference, Object.assign({ value: temporaryPreferences.contentDensity }, contentDensityPreference, { onChange: (contentDensity) => onChange({ contentDensity }) })), - stickyColumnsPreference && import_react284.default.createElement(StickyColumnsPreference, Object.assign({ value: temporaryPreferences.stickyColumns }, stickyColumnsPreference, { onChange: (stickyColumns) => onChange({ stickyColumns }) })), - customPreference && import_react284.default.createElement(CustomPreference, { value: temporaryPreferences.custom, customPreference, onChange: (custom8) => onChange({ custom: custom8 }) }) - ), right: contentDisplayPreference ? import_react284.default.createElement(ContentDisplayPreference, Object.assign({}, contentDisplayPreference, { value: temporaryPreferences.contentDisplay, onChange: (contentDisplay) => onChange({ contentDisplay }) })) : visibleContentPreference && import_react284.default.createElement(VisibleContentPreference, Object.assign({ value: temporaryPreferences.visibleContent }, visibleContentPreference, { onChange: (visibleItems) => onChange({ visibleContent: visibleItems }) })) }) - ) - ); -} -applyDisplayName(CollectionPreferences, componentName2); - -// node_modules/@cloudscape-design/components/column-layout/index.js -var import_react285 = __toESM(require_react()); -function ColumnLayout2(_a2) { - var { columns = 1, variant = "default", borders = "none", disableGutters = false } = _a2, props2 = __rest(_a2, ["columns", "variant", "borders", "disableGutters"]); - const baseComponentProps = useBaseComponent("ColumnLayout", { - props: { borders, columns, disableGutters, minColumnWidth: props2.minColumnWidth, variant } - }); - const externalProps = getExternalProps(props2); - return import_react285.default.createElement(ColumnLayout, Object.assign({ columns, variant, borders, disableGutters }, externalProps, baseComponentProps)); -} -applyDisplayName(ColumnLayout2, "ColumnLayout"); - -// node_modules/@cloudscape-design/components/container/index.js -var import_react286 = __toESM(require_react()); -function Container(_a2) { - var { variant = "default", disableHeaderPaddings = false, disableContentPaddings = false, fitHeight = false } = _a2, props2 = __rest(_a2, ["variant", "disableHeaderPaddings", "disableContentPaddings", "fitHeight"]); - const analyticsMetadata = getAnalyticsMetadataProps(props2); - const baseComponentProps = useBaseComponent("Container", { - props: { disableContentPaddings, disableHeaderPaddings, fitHeight, variant } - }, analyticsMetadata); - const externalProps = getExternalProps(props2); - return import_react286.default.createElement( - AnalyticsFunnelSubStep, - { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext }, - import_react286.default.createElement(InternalContainerAsSubstep, Object.assign({ variant, disableContentPaddings, disableHeaderPaddings, fitHeight }, props2, externalProps, baseComponentProps)) - ); -} -applyDisplayName(Container, "Container"); - -// node_modules/@cloudscape-design/components/content-layout/index.js -var import_react288 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/content-layout/internal.js -var import_react287 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/content-layout/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/content-layout/styles.scoped.css"; -var styles_css_default85 = { - "layout": "awsui_layout_5gtk3_set91_105", - "is-visual-refresh": "awsui_is-visual-refresh_5gtk3_set91_105", - "background": "awsui_background_5gtk3_set91_108", - "header": "awsui_header_5gtk3_set91_111", - "is-overlap-disabled": "awsui_is-overlap-disabled_5gtk3_set91_127", - "content": "awsui_content_5gtk3_set91_135", - "has-header": "awsui_has-header_5gtk3_set91_139" -}; - -// node_modules/@cloudscape-design/components/content-layout/internal.js -function InternalContentLayout(_a2) { - var { children: children2, disableOverlap, header, __internalRootRef } = _a2, rest = __rest(_a2, ["children", "disableOverlap", "header", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const isVisualRefresh = useVisualRefresh(); - const overlapElement = useDynamicOverlap(); - const isOverlapDisabled = !children2 || disableOverlap; - return import_react287.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default85.layout, { - [styles_css_default85["is-overlap-disabled"]]: isOverlapDisabled, - [styles_css_default85["is-visual-refresh"]]: isVisualRefresh, - [styles_css_default85["has-header"]]: !!header - }), ref: __internalRootRef }), - import_react287.default.createElement("div", { className: clsx_m_default(styles_css_default85.background, { [styles_css_default85["is-overlap-disabled"]]: isOverlapDisabled }, getContentHeaderClassName()), ref: overlapElement }), - header && import_react287.default.createElement("div", { className: clsx_m_default(styles_css_default85.header, getContentHeaderClassName()) }, header), - import_react287.default.createElement("div", { className: styles_css_default85.content }, children2) - ); -} - -// node_modules/@cloudscape-design/components/content-layout/index.js -function ContentLayout(props2) { - const baseComponentProps = useBaseComponent("ContentLayout", { - props: { disableOverlap: props2.disableOverlap } - }); - return import_react288.default.createElement(InternalContentLayout, Object.assign({}, props2, baseComponentProps)); -} -applyDisplayName(ContentLayout, "ContentLayout"); - -// node_modules/@cloudscape-design/components/copy-to-clipboard/index.js -var import_react290 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/popover/internal.js -var import_react289 = __toESM(require_react()); -var internal_default15 = import_react289.default.forwardRef(InternalPopover); -function InternalPopover(_a2, ref) { - var { position = "right", size: size2 = "medium", fixedWidth = false, triggerType = "text", dismissButton: dismissButton2 = true, children: children2, header, content, triggerAriaLabel, renderWithPortal = false, __onOpen, __internalRootRef = null } = _a2, restProps = __rest(_a2, ["position", "size", "fixedWidth", "triggerType", "dismissButton", "children", "header", "content", "triggerAriaLabel", "renderWithPortal", "__onOpen", "__internalRootRef"]); - const baseProps = getBaseProps(restProps); - const triggerRef = (0, import_react289.useRef)(null); - const popoverRef = (0, import_react289.useRef)(null); - const clickFrameId = (0, import_react289.useRef)(null); - const i18n = useInternalI18n("popover"); - const dismissAriaLabel = i18n("dismissAriaLabel", restProps.dismissAriaLabel); - const [visible, setVisible] = (0, import_react289.useState)(false); - const focusTrigger = (0, import_react289.useCallback)(() => { - var _a3, _b; - if (triggerType === "text") { - (_a3 = triggerRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } else { - triggerRef.current && ((_b = getFirstFocusable(triggerRef.current)) === null || _b === void 0 ? void 0 : _b.focus()); - } - }, [triggerType]); - const onTriggerClick = (0, import_react289.useCallback)(() => { - fireNonCancelableEvent(__onOpen); - setVisible(true); - }, [__onOpen]); - const onDismiss = (0, import_react289.useCallback)(() => { - setVisible(false); - focusTrigger(); - }, [focusTrigger]); - const onTriggerKeyDown = (0, import_react289.useCallback)((event) => { - const isEscapeKey = event.keyCode === KeyCode.escape; - const isTabKey = event.keyCode === KeyCode.tab; - if (isEscapeKey && visible) { - event.stopPropagation(); - } - if (isTabKey || isEscapeKey) { - setVisible(false); - } - }, [visible]); - (0, import_react289.useImperativeHandle)(ref, () => ({ - dismissPopover: onDismiss - })); - (0, import_react289.useEffect)(() => { - if (!triggerRef.current) { - return; - } - const document2 = triggerRef.current.ownerDocument; - const onDocumentClick = () => { - if (clickFrameId.current === null) { - setVisible(false); - } - }; - document2.addEventListener("mousedown", onDocumentClick, false); - return () => { - document2.removeEventListener("mousedown", onDocumentClick, false); - }; - }, []); - const popoverClasses = usePortalModeClasses(triggerRef); - const triggerProps = { - // https://github.com/microsoft/TypeScript/issues/36659 - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ref: triggerRef, - onClick: onTriggerClick, - onKeyDown: onTriggerKeyDown, - className: clsx_m_default(styles_css_default13.trigger, styles_css_default13[`trigger-type-${triggerType}`]) - }; - const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef); - const referrerId = useUniqueId(); - const popoverContent = import_react289.default.createElement("div", { "aria-live": dismissButton2 ? void 0 : "polite", "aria-atomic": dismissButton2 ? void 0 : true, className: clsx_m_default(popoverClasses, !renderWithPortal && styles_css_default13["popover-inline-content"]), "data-awsui-referrer-id": referrerId }, visible && import_react289.default.createElement( - PopoverContainer, - { size: size2, fixedWidth, position, trackRef: triggerRef, arrow: (position2) => import_react289.default.createElement(arrow_default, { position: position2 }), renderWithPortal, zIndex: renderWithPortal ? 7e3 : void 0 }, - import_react289.default.createElement( - LinkDefaultVariantContext.Provider, - { value: { defaultVariant: "primary" } }, - import_react289.default.createElement(PopoverBody, { dismissButton: dismissButton2, dismissAriaLabel, header, onDismiss, overflowVisible: "both" }, content) - ) - )); - const mergedRef = useMergeRefs(popoverRef, __internalRootRef); - return import_react289.default.createElement( - "span", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default13.root, baseProps.className), ref: mergedRef, onMouseDown: () => { - clickFrameId.current = requestAnimationFrame(() => { - clickFrameId.current = null; - }); - } }), - triggerType === "text" ? import_react289.default.createElement( - "button", - Object.assign({}, triggerProps, { tabIndex: triggerTabIndex, type: "button", "aria-haspopup": "dialog", id: referrerId, "aria-label": triggerAriaLabel }), - import_react289.default.createElement("span", { className: styles_css_default13["trigger-inner-text"] }, children2) - ) : import_react289.default.createElement("span", Object.assign({}, triggerProps, { id: referrerId }), children2), - import_react289.default.createElement(reset_contexts_for_modal_default, null, renderWithPortal ? import_react289.default.createElement(Portal, null, popoverContent) : popoverContent) - ); -} - -// node_modules/@cloudscape-design/components/copy-to-clipboard/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/copy-to-clipboard/styles.scoped.css"; -var styles_css_default86 = { - "root": "awsui_root_5a145_jw759_9", - "inline-container": "awsui_inline-container_5a145_jw759_13", - "inline-container-trigger": "awsui_inline-container-trigger_5a145_jw759_16" -}; - -// node_modules/@cloudscape-design/components/copy-to-clipboard/test-classes/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/copy-to-clipboard/test-classes/styles.scoped.css"; -var styles_css_default87 = { - "root": "awsui_root_ljpwc_1spew_5", - "text-to-copy": "awsui_text-to-copy_ljpwc_1spew_9" -}; - -// node_modules/@cloudscape-design/components/copy-to-clipboard/index.js -function CopyToClipboard(_a2) { - var { variant = "button", copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy } = _a2, restProps = __rest(_a2, ["variant", "copyButtonAriaLabel", "copyButtonText", "copySuccessText", "copyErrorText", "textToCopy"]); - const { __internalRootRef } = useBaseComponent("CopyToClipboard", { - props: { variant } - }); - const baseProps = getBaseProps(restProps); - const copyButtonProps = variant === "button" ? { children: copyButtonText, ariaLabel: copyButtonAriaLabel } : { ariaLabel: copyButtonAriaLabel !== null && copyButtonAriaLabel !== void 0 ? copyButtonAriaLabel : copyButtonText }; - const [status, setStatus] = (0, import_react290.useState)("pending"); - const [statusText, setStatusText] = (0, import_react290.useState)(""); - const onClick = () => { - if (navigator.clipboard) { - setStatus("pending"); - setStatusText(""); - navigator.clipboard.writeText(textToCopy).then(() => { - setStatus("success"); - setStatusText(copySuccessText); - }).catch(() => { - setStatus("error"); - setStatusText(copyErrorText); - }); - } - }; - const triggerVariant = { - button: "normal", - icon: "icon", - inline: "inline-icon" - }[variant]; - const trigger2 = import_react290.default.createElement( - internal_default15, - { size: "medium", position: "top", triggerType: "custom", dismissButton: false, renderWithPortal: true, content: import_react290.default.createElement(StatusIndicator, { type: status }, statusText) }, - import_react290.default.createElement(internal_default2, Object.assign({}, copyButtonProps, { iconName: "copy", onClick, variant: triggerVariant, wrapText: false, formAction: "none" })) - ); - return import_react290.default.createElement("span", Object.assign({ ref: __internalRootRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default86.root, styles_css_default87.root) }), variant === "inline" ? import_react290.default.createElement( - "span", - { className: styles_css_default86["inline-container"] }, - import_react290.default.createElement("span", { className: styles_css_default86["inline-container-trigger"] }, trigger2), - import_react290.default.createElement("span", { className: styles_css_default87["text-to-copy"] }, textToCopy) - ) : trigger2); -} -applyDisplayName(CopyToClipboard, "CopyToClipboard"); - -// node_modules/@cloudscape-design/components/date-input/index.js -var import_react293 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-input/internal.js -var import_react292 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/masked-input/index.js -var import_react291 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/keys.js -var isSpecialCommand = (keyCode) => { - return keyCode > 7 && keyCode < 47 && keyCode !== KeyCode.space; -}; -var isClipboardCommand = (ctrlKey, metaKey) => ctrlKey || metaKey; -var isCommand = (keyCode, ctrlKey, metaKey) => isSpecialCommand(keyCode) || isClipboardCommand(ctrlKey, metaKey); -var isDigit = (char) => !isNaN(parseInt(char, 10)); - -// node_modules/@cloudscape-design/components/internal/components/masked-input/keyboard-handler.js -var backspaceHandler = (initialValue, format3, selectionStart, selectionEnd) => { - const multiCharDelete = selectionStart !== selectionEnd; - if (multiCharDelete) { - const isCursorAtEnd = selectionEnd === initialValue.length; - if (!isCursorAtEnd) { - return format3.replaceDigitsWithZeroes(initialValue, selectionStart, selectionEnd); - } - return { - value: initialValue.slice(0, selectionStart), - position: selectionStart - }; - } - const isSeparator = format3.isSegmentStart(selectionStart); - const atEnd = selectionStart === initialValue.length; - if (!atEnd) { - if (isSeparator) { - return format3.deleteSeparator(initialValue, selectionStart); - } else { - return format3.deleteDigit(initialValue, selectionStart); - } - } - if (isSeparator) { - return { - value: initialValue.slice(0, selectionStart - 2), - position: selectionStart - 2 - }; - } - return { - value: initialValue.slice(0, selectionStart - 1), - position: selectionStart - 1 - }; -}; -var keyHandler = (initialValue, key2, format3, selectionStart, selectionEnd) => { - let value = initialValue; - const position = selectionStart; - if (selectionStart === value.length && value.length === format3.getMaxLength()) { - return { value, position }; - } - if (selectionStart !== value.length && selectionEnd === value.length) { - const sliceEnd = format3.isCursorAtSeparator(selectionStart) ? selectionStart + 1 : selectionStart; - value = initialValue.slice(0, sliceEnd); - } - if (format3.isCursorAtSeparator(position)) { - return { value, position: position + 1 }; - } - return format3.processKey(value, key2, position); -}; -var enterHandler = (value, format3) => { - if (!value) { - return { value: "", position: 0 }; - } - const autoCompletedValue = format3.autoComplete(value); - const position = autoCompletedValue.length; - return { value: autoCompletedValue, position }; -}; - -// node_modules/@cloudscape-design/components/internal/components/masked-input/use-mask.js -var onAutoComplete = (value, onChange, maskFormat) => { - if (!value) { - return; - } - const autoCompletedValue = maskFormat.autoComplete(value); - if (autoCompletedValue !== value) { - onChange(autoCompletedValue); - } -}; -var preventDefault2 = (event, result) => result && event.preventDefault(); -var useMask = ({ value = "", onBlur, onChange, onKeyDown, format: format3, inputRef, autofix = false, disableAutocompleteOnBlur = false, setPosition }) => { - if (!format3.isValid(value)) { - warnOnce("useMask", `Invalid string "${value}" provided`); - } - const onMaskChange = (updatedValue) => { - const autofixedUpdatedValue = autofix ? format3.correctMinMaxValues(updatedValue) : updatedValue; - if (autofixedUpdatedValue === value || !format3.isValid(autofixedUpdatedValue)) { - return; - } - onChange(autofixedUpdatedValue); - }; - const initialValue = autofix ? format3.correctMinMaxValues(value) : value; - const maskedValue = format3.getValidValue(initialValue); - return { - value: maskedValue, - onKeyDown: (event) => { - var _a2, _b; - const selectionStart = ((_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.selectionStart) || 0; - const selectionEnd = ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.selectionEnd) || 0; - let result; - const { keyCode, key: key2, ctrlKey, metaKey } = event.detail; - if (isDigit(key2) || format3.isSeparator(key2)) { - result = keyHandler(maskedValue, key2, format3, selectionStart, selectionEnd); - preventDefault2(event, result); - } else if (keyCode === KeyCode.backspace) { - result = backspaceHandler(maskedValue, format3, selectionStart, selectionEnd); - preventDefault2(event, result); - } else if (keyCode === KeyCode.enter) { - result = enterHandler(maskedValue, format3); - } else if (!isCommand(keyCode, ctrlKey, metaKey)) { - event.preventDefault(); - } - if (result) { - const { value: value2, position } = result; - onMaskChange(value2); - setPosition(position); - } - onKeyDown && onKeyDown(event); - }, - onChange: ({ detail }) => onMaskChange(detail.value), - onBlur: () => { - if (!disableAutocompleteOnBlur) { - onAutoComplete(maskedValue, onChange, format3); - } - onBlur && onBlur(); - }, - onPaste: (event) => { - var _a2, _b; - const text = (event.clipboardData || window.clipboardData).getData("text"); - const selectionStart = ((_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.selectionStart) || 0; - const selectionEnd = ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.selectionEnd) || 0; - const formattedText = format3.formatPastedText(text, maskedValue, selectionStart, selectionEnd); - onMaskChange(formattedText); - } - }; -}; -var use_mask_default = useMask; - -// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/strings.js -var insertAt = (text, toInsert, start, end = start) => text.slice(0, start) + toInsert + text.slice(end); - -// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/mask-format.js -var MaskFormat = class { - constructor({ separator, inputSeparators = [], segments }) { - this.positionFormats = /* @__PURE__ */ new Map(); - this.segments = []; - this.separator = separator; - this.inputSeparators = [...inputSeparators, separator]; - this.enrichSegmentDefinitions(segments); - } - tryAppendSeparator(value) { - const withSeparator = `${value}${this.separator}`; - return this.isValid(withSeparator) ? withSeparator : value; - } - isSeparator(key2) { - return this.inputSeparators.indexOf(key2) !== -1; - } - isValid(value) { - const inputSegments = value.split(this.separator); - if (inputSegments.length > this.segments.length) { - return false; - } - return inputSegments.every((segmentValue, i) => { - const segment = this.segments[i]; - if (segmentValue === "") { - if (i === inputSegments.length - 1) { - return true; - } else { - return false; - } - } - if (!segmentValue.match(/^\d+$/)) { - return false; - } - if (segmentValue.length < segment.length && i !== inputSegments.length - 1) { - return false; - } - const intValue = parseInt(segmentValue, 10); - if (segmentValue.length > segment.length) { - return false; - } - if (intValue < segment.min || intValue > segment.max(value)) { - if (i === inputSegments.length - 1 && segmentValue.length < segment.length) { - return true; - } - return false; - } - return true; - }); - } - getValidValue(value) { - let validValue = value; - do { - if (this.isValid(validValue)) { - return this.tryAppendSeparator(validValue); - } - validValue = validValue.substring(0, validValue.length - 1); - } while (validValue.length > 0); - return ""; - } - autoComplete(value) { - const [lastSegmentValue, ...completeSegmentValues] = value.split(this.separator).reverse(); - const lastSegment = this.segments[completeSegmentValues.length]; - const paddedLastSegmentValue = this.padWithDefaultValue(lastSegmentValue, lastSegment); - const partial = [...completeSegmentValues.reverse(), paddedLastSegmentValue]; - while (partial.length < this.segments.length) { - const nextSegment = this.segments[partial.length]; - const segmentValue = this.padWithDefaultValue("", nextSegment); - partial.push(segmentValue); - } - value = partial.join(this.separator); - value = this.correctMinMaxValues(value); - return value; - } - getSegmentValueWithAddition(position, value, enteredDigit) { - const segment = this.positionFormats.get(position); - const segmentValue = value.substr(segment.start, segment.length); - const segmentPosition = position - segment.start; - const newValue = insertAt(segmentValue, enteredDigit, segmentPosition, segmentPosition + 1); - return parseInt(newValue, 10); - } - replaceDigitsWithZeroes(value, cursorStart, cursorEnd) { - const position = this.isCursorAtSeparator(cursorStart) ? cursorStart + 1 : cursorStart; - if (this.isCursorAtSeparator(cursorStart)) { - cursorStart++; - } - if (!this.isSegmentStart(cursorStart)) { - const segment = this.positionFormats.get(cursorStart); - value = insertAt(value, padLeftZeros("", segment.end - cursorStart), cursorStart, segment.end); - cursorStart = segment.end + 1; - } - let currentSegment; - while (cursorStart < cursorEnd && (currentSegment = this.positionFormats.get(cursorStart + 1))) { - const insertionEnd = Math.min(cursorEnd, currentSegment.end); - value = insertAt(value, padLeftZeros("", insertionEnd - currentSegment.start), currentSegment.start, insertionEnd); - cursorStart = insertionEnd + 1; - } - value = this.correctMinMaxValues(value); - return { - value, - position - }; - } - handleSeparatorInput(value, position) { - if (position === value.length && !this.isSegmentStart(position)) { - const segment = this.positionFormats.get(position); - let segmentValue = value.substr(segment.start, segment.length); - segmentValue = this.padWithDefaultValue(segmentValue, segment); - value = insertAt(value, segmentValue, segment.start, segment.end); - value = this.correctMinMaxValues(value); - return { - value, - position: value.length - }; - } - } - isCursorAtSeparator(position) { - return 0 < position && position < this.getMaxLength() && this.positionFormats.get(position) === void 0; - } - isSegmentStart(position) { - return position === 0 || this.isCursorAtSeparator(position - 1); - } - getSegmentMaxValue(value, position) { - return this.positionFormats.get(position).max(value); - } - getSegmentMinValue(value, position) { - return this.positionFormats.get(position).min; - } - getMaxLength() { - const last = this.segments[this.segments.length - 1]; - return last.start + last.length; - } - deleteSeparator(value, position) { - value = insertAt(value, "0", position - 2, position - 1); - return { - value: this.correctMinMaxValues(value), - position: position - 2 - }; - } - deleteDigit(value, position) { - value = insertAt(value, "0", position - 1, position); - const length = value.length; - if (value.slice(length - 2) === "0:") { - value = value.slice(0, length - 2); - } - return { - value: this.correctMinMaxValues(value), - position: position - 1 - }; - } - correctMinMaxValues(value) { - let segment = this.positionFormats.get(0); - while (segment && value.length >= segment.end) { - const segmentValue = parseInt(value.substr(segment.start, segment.length), 10); - const segmentMax = segment.max(value); - if (segmentValue < segment.min) { - let toInsert = segment.min.toFixed(); - toInsert = padLeftZeros(toInsert, segment.length); - value = insertAt(value, toInsert, segment.start, segment.end); - } - if (segmentValue > segmentMax) { - value = insertAt(value, segmentMax.toFixed(), segment.start, segment.end); - } - segment = this.positionFormats.get(segment.end + 1); - } - return value.substr(0, this.segments[this.segments.length - 1].end); - } - formatPastedText(text, value, cursorStart, cursorEnd) { - const keyArr = text.trim().split(""); - let position = cursorStart; - let formattedValue = value; - if (cursorEnd > cursorStart && cursorEnd === value.length) { - formattedValue = value.slice(0, cursorStart); - } - for (const key2 of keyArr) { - if (position >= this.getMaxLength()) { - break; - } - const result = this.processKey(formattedValue, key2, position); - formattedValue = result.value; - position = result.position; - } - return this.tryAppendSeparator(formattedValue); - } - processKey(initialValue, key2, initialPosition) { - let value = initialValue; - let position = initialPosition; - if (this.isSeparator(key2)) { - const result = this.handleSeparatorInput(value, position); - if (result) { - value = result.value; - position = result.position; - } - } else { - const isCursorAtEnd = position === value.length; - const segmentValue = this.getSegmentValueWithAddition(position, value, key2); - const segmentMaxValue = this.getSegmentMaxValue(value, position); - const segmentMinValue = this.getSegmentMinValue(value, position); - const firstDigitGreater = parseInt(key2, 10) > parseInt(segmentMaxValue.toFixed()[0], 10); - const isValidPosition = isCursorAtEnd || segmentValue.toFixed().length === 1; - const exceedsMaxAtSegmentStart = this.isSegmentStart(position) && isValidPosition && firstDigitGreater; - if (exceedsMaxAtSegmentStart) { - value = insertAt(value, `0${key2}`, position, position + 2); - position += 2; - } else if (segmentValue > segmentMaxValue && this.isSegmentStart(position)) { - value = insertAt(value, segmentMaxValue.toFixed(), position, position + segmentMaxValue.toFixed().length); - position += segmentMaxValue.toFixed().length; - } else if (segmentValue > segmentMaxValue) { - value = insertAt(value, segmentMaxValue.toFixed(), position - 1, position + 1); - position += 1; - } else if (segmentValue < segmentMinValue && !this.isSegmentStart(position)) { - value = insertAt(value, segmentMinValue.toFixed(), position, position + 1); - position += 1; - } else { - value = insertAt(value, key2, position, position + 1); - position += 1; - } - } - value = this.tryAppendSeparator(value); - if (this.isCursorAtSeparator(position)) { - position++; - } - return { value, position }; - } - padWithDefaultValue(segmentValue, segment) { - let defaultValue5 = (segment.default || segment.min).toFixed(); - defaultValue5 = padLeftZeros(defaultValue5, segment.length); - return insertAt(defaultValue5, segmentValue, segment.length - segmentValue.length, segment.length); - } - enrichSegmentDefinitions(segments) { - this.positionFormats = /* @__PURE__ */ new Map(); - this.segments = []; - let position = 0; - for (const segment of segments) { - const max3 = segment.max; - const fullSegment = Object.assign(Object.assign({}, segment), { max: typeof max3 === "number" ? () => max3 : max3, start: position, end: position + segment.length }); - this.segments.push(fullSegment); - for (let j = 0; j < fullSegment.length; j++) { - this.positionFormats.set(position++, fullSegment); - } - position++; - } - } -}; -var mask_format_default = MaskFormat; - -// node_modules/@cloudscape-design/components/internal/components/masked-input/index.js -var MaskedInput = import_react291.default.forwardRef((_a2, ref) => { - var { value, onBlur, onChange, onKeyDown, mask, autofix = false, disableAutocompleteOnBlur = false } = _a2, rest = __rest(_a2, ["value", "onBlur", "onChange", "onKeyDown", "mask", "autofix", "disableAutocompleteOnBlur"]); - const baseProps = getBaseProps(rest); - const formFieldContext = useFormFieldContext(rest); - const inputRef = import_react291.default.useRef(null); - const [cursorPosition, setCursorPosition] = (0, import_react291.useState)(null); - (0, import_react291.useLayoutEffect)(() => { - var _a3; - if (cursorPosition !== null) { - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.setSelectionRange(cursorPosition, cursorPosition); - } - }, [cursorPosition, inputRef]); - const _b = use_mask_default({ - format: new mask_format_default(mask), - value, - inputRef, - autofix, - disableAutocompleteOnBlur, - onChange: (value2) => !rest.readOnly && fireNonCancelableEvent(onChange, { value: value2 }), - onKeyDown: (event) => !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event), - onBlur: () => fireNonCancelableEvent(onBlur), - setPosition: setCursorPosition - }), { onPaste } = _b, maskProps = __rest(_b, ["onPaste"]); - const inputProps = Object.assign(Object.assign(Object.assign(Object.assign({}, rest), baseProps), formFieldContext), maskProps); - const mergedRef = useMergeRefs(ref, inputRef); - return import_react291.default.createElement(internal_default7, Object.assign({}, inputProps, { ref: mergedRef, __nativeAttributes: { - onPaste - } })); -}); -var masked_input_default = MaskedInput; - -// node_modules/@cloudscape-design/components/date-input/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/date-input/styles.scoped.css"; -var styles_css_default88 = { - "root": "awsui_root_yodkx_im8v7_5" -}; - -// node_modules/@cloudscape-design/components/date-input/internal.js -function daysMax(value) { - const baseDate = displayToIso(value).substring(0, 7); - return getDaysInMonth(parseDate(baseDate)); -} -var yearMask = { min: 0, max: 9999, default: 2e3, length: 4 }; -var monthMask = { min: 1, max: 12, length: 2 }; -var dayMask = { min: 1, max: daysMax, length: 2 }; -var InternalDateInput = import_react292.default.forwardRef((_a2, ref) => { - var { value, onChange, granularity, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["value", "onChange", "granularity", "__internalRootRef"]); - const maskArgs = { - separator: "/", - inputSeparators: ["-", ".", " "], - segments: granularity === "month" ? [yearMask, monthMask] : [yearMask, monthMask, dayMask] - }; - return import_react292.default.createElement(masked_input_default, Object.assign({ ref }, props2, { value: isoToDisplay(value || ""), onChange: (event) => fireNonCancelableEvent(onChange, { value: displayToIso(event.detail.value) }), className: clsx_m_default(styles_css_default88.root, props2.className), mask: maskArgs, autofix: true, autoComplete: false, disableAutocompleteOnBlur: false, disableBrowserAutocorrect: true, __internalRootRef })); -}); -var internal_default16 = InternalDateInput; - -// node_modules/@cloudscape-design/components/date-input/index.js -var DateInput = import_react293.default.forwardRef((props2, ref) => { - const baseComponentProps = useBaseComponent("DateInput", { - props: { autoFocus: props2.autoFocus, readOnly: props2.readOnly } - }); - return import_react293.default.createElement(internal_default16, Object.assign({}, props2, baseComponentProps, { ref })); -}); -applyDisplayName(DateInput, "DateInput"); -var date_input_default = DateInput; - -// node_modules/@cloudscape-design/components/date-picker/index.js -var import_react295 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-picker/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/date-picker/styles.scoped.css"; -var styles_css_default89 = { - "root": "awsui_root_145pa_ot559_99", - "focus-lock": "awsui_focus-lock_145pa_ot559_134", - "calendar": "awsui_calendar_145pa_ot559_138", - "date-picker-container": "awsui_date-picker-container_145pa_ot559_154", - "date-picker-trigger": "awsui_date-picker-trigger_145pa_ot559_159", - "date-picker-input": "awsui_date-picker-input_145pa_ot559_163", - "open-calendar-button": "awsui_open-calendar-button_145pa_ot559_168" -}; - -// node_modules/@cloudscape-design/components/internal/hooks/use-focus-tracker.js -var import_react294 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/focus-tracker.js -var FocusTracker = class { - constructor(node, { onFocusEnter, onFocusLeave }) { - this.node = node; - this.currentlyFocused = false; - this.focusInListener = (event) => { - const focusIsInside = nodeBelongs(this.node, event.target); - if (!this.currentlyFocused && focusIsInside) { - this.triggerFocus(); - } - }; - this.focusOutListener = (event) => { - const nextFocused = event.relatedTarget; - const isNextFocusedInParent = !nodeBelongs(this.node, nextFocused); - if (this.currentlyFocused && (nextFocused === null || isNextFocusedInParent)) { - this.triggerBlur(); - } - }; - this.onFocusEnter = onFocusEnter; - this.onFocusLeave = onFocusLeave; - } - initialize() { - this.currentlyFocused = nodeBelongs(this.node, document.activeElement); - document.addEventListener("focusin", this.focusInListener); - document.addEventListener("focusout", this.focusOutListener); - } - destroy() { - document.removeEventListener("focusin", this.focusInListener); - document.removeEventListener("focusout", this.focusOutListener); - } - triggerBlur() { - this.currentlyFocused = false; - this.onFocusLeave(); - } - triggerFocus() { - this.currentlyFocused = true; - this.onFocusEnter(); - } -}; - -// node_modules/@cloudscape-design/components/internal/hooks/use-focus-tracker.js -var useFocusTracker = ({ rootRef, onBlur, onFocus }) => { - const focusTracker = (0, import_react294.useRef)(null); - (0, import_react294.useEffect)(() => { - if (!rootRef.current) { - return; - } - focusTracker.current = new FocusTracker(rootRef.current, { - onFocusLeave: () => { - fireNonCancelableEvent(onBlur); - }, - onFocusEnter: () => { - fireNonCancelableEvent(onFocus); - } - }); - focusTracker.current.initialize(); - return () => { - var _a2; - (_a2 = focusTracker.current) === null || _a2 === void 0 ? void 0 : _a2.destroy(); - }; - }, [rootRef, onBlur, onFocus]); -}; - -// node_modules/@cloudscape-design/components/date-picker/utils.js -function isValidFullDate({ date: date2, granularity }) { - const regex = granularity === "month" ? /^\d{4}-\d{2}(-\d{2})?$/ : /^\d{4}-\d{2}-\d{2}$/; - return !!date2.match(regex); -} -function getSelectedDateLabel({ date: date2, granularity, locale: locale2 }) { - return granularity === "month" ? renderMonthAndYear(locale2, date2) : getDateLabel(locale2, date2); -} -function getBaseDateLabel({ date: date2, granularity, locale: locale2 }) { - return granularity === "month" ? renderYear(locale2, date2) : renderMonthAndYear(locale2, date2); -} - -// node_modules/@cloudscape-design/components/date-picker/index.js -var DatePicker = import_react295.default.forwardRef((_a2, ref) => { - var _b, _c, _d; - var { locale: locale2 = "", startOfWeek: startOfWeek2, isDateEnabled, nextMonthAriaLabel, previousMonthAriaLabel, todayAriaLabel, i18nStrings, placeholder = "", value = "", readOnly = false, disabled = false, onBlur, autoFocus = false, onChange, onFocus, name, ariaLabel, ariaRequired, controlId, invalid, openCalendarAriaLabel, expandToViewport, granularity = "day" } = _a2, restProps = __rest(_a2, ["locale", "startOfWeek", "isDateEnabled", "nextMonthAriaLabel", "previousMonthAriaLabel", "todayAriaLabel", "i18nStrings", "placeholder", "value", "readOnly", "disabled", "onBlur", "autoFocus", "onChange", "onFocus", "name", "ariaLabel", "ariaRequired", "controlId", "invalid", "openCalendarAriaLabel", "expandToViewport", "granularity"]); - const { __internalRootRef } = useBaseComponent("DatePicker", { - props: { autoFocus, expandToViewport, granularity, readOnly } - }); - checkControlled("DatePicker", "value", value, "onChange", onChange); - const contextLocale = useLocale(); - const normalizedLocale = normalizeLocale("DatePicker", locale2 || contextLocale); - const baseProps = getBaseProps(restProps); - const [isDropDownOpen, setIsDropDownOpen] = (0, import_react295.useState)(false); - const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps); - const internalInputRef = (0, import_react295.useRef)(null); - const buttonRef = (0, import_react295.useRef)(null); - useForwardFocus(ref, internalInputRef); - const rootRef = (0, import_react295.useRef)(null); - const dropdownId = useUniqueId("calender"); - const calendarDescriptionId = useUniqueId("calendar-description-"); - const mergedRef = useMergeRefs(rootRef, __internalRootRef); - useFocusTracker({ rootRef, onBlur, onFocus }); - const onDropdownCloseHandler = (0, import_react295.useCallback)(() => setIsDropDownOpen(false), [setIsDropDownOpen]); - const onButtonClickHandler = () => { - if (!isDropDownOpen) { - setIsDropDownOpen(true); - } - }; - const onWrapperKeyDownHandler = (event) => { - var _a3; - if (event.keyCode === KeyCode.escape && isDropDownOpen) { - event.stopPropagation(); - (_a3 = buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - setIsDropDownOpen(false); - } - }; - const onInputChangeHandler = (event) => { - fireNonCancelableEvent(onChange, { value: event.detail.value }); - }; - const onInputBlurHandler = () => { - if (!isDropDownOpen) { - setIsDropDownOpen(false); - } - }; - const parsedValue = value && value.length >= 4 ? parseDate(value) : null; - const baseDate = parsedValue || /* @__PURE__ */ new Date(); - const hasFullValue = isValidFullDate({ date: value, granularity }); - const buttonAriaLabel = openCalendarAriaLabel && openCalendarAriaLabel(hasFullValue && parsedValue ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale }) : null); - const trigger2 = import_react295.default.createElement( - "div", - { className: styles_css_default89["date-picker-trigger"] }, - import_react295.default.createElement( - "div", - { className: styles_css_default89["date-picker-input"] }, - import_react295.default.createElement(internal_default16, { name, invalid, controlId, ariaLabelledby, ariaDescribedby, ariaLabel, ariaRequired, value, disabled, readOnly, onChange: onInputChangeHandler, onBlur: onInputBlurHandler, placeholder, ref: internalInputRef, autoFocus, onFocus: onDropdownCloseHandler, granularity }) - ), - import_react295.default.createElement( - "div", - null, - import_react295.default.createElement(InternalButton, { iconName: "calendar", className: styles_css_default89["open-calendar-button"], onClick: onButtonClickHandler, ref: buttonRef, ariaLabel: buttonAriaLabel, disabled: disabled || readOnly, formAction: "none" }) - ) - ); - baseProps.className = clsx_m_default(baseProps.className, styles_css_default89.root, styles_css_default89["date-picker-container"]); - const handleMouseDown = (event) => { - event.preventDefault(); - }; - return import_react295.default.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : void 0 }), disabled || readOnly ? trigger2 : import_react295.default.createElement(dropdown_default, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, onMouseDown: handleMouseDown, trigger: trigger2, expandToViewport, scrollable: false, dropdownId }, isDropDownOpen && import_react295.default.createElement( - focus_lock_default, - { className: styles_css_default89["focus-lock"], autoFocus: true }, - import_react295.default.createElement( - "div", - { tabIndex: 0, className: styles_css_default89.calendar, role: "dialog", "aria-modal": "true" }, - import_react295.default.createElement(Calendar, { value, onChange: (e) => { - var _a3; - fireNonCancelableEvent(onChange, e.detail); - (_a3 = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - setIsDropDownOpen(false); - }, locale: normalizedLocale, startOfWeek: startOfWeek2, ariaDescribedby: calendarDescriptionId, ariaLabel, ariaLabelledby, granularity, isDateEnabled, i18nStrings: Object.assign(Object.assign({}, i18nStrings), { todayAriaLabel: (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel) !== null && _b !== void 0 ? _b : todayAriaLabel, nextMonthAriaLabel: (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel) !== null && _c !== void 0 ? _c : nextMonthAriaLabel, previousMonthAriaLabel: (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel) !== null && _d !== void 0 ? _d : previousMonthAriaLabel }) }), - import_react295.default.createElement(live_region_default, { id: calendarDescriptionId }, getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })) - ) - ))); -}); -applyDisplayName(DatePicker, "DatePicker"); -var date_picker_default = DatePicker; - -// node_modules/@cloudscape-design/components/date-range-picker/index.js -var import_react309 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/date-range-picker/styles.scoped.css"; -var styles_css_default90 = { - "calendar": "awsui_calendar_mgja0_1vaht_99", - "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_mgja0_1vaht_1", - "root": "awsui_root_mgja0_1vaht_126", - "wide": "awsui_wide_mgja0_1vaht_160", - "focus-lock": "awsui_focus-lock_mgja0_1vaht_167", - "trigger-wrapper": "awsui_trigger-wrapper_mgja0_1vaht_171", - "trigger-flexbox": "awsui_trigger-flexbox_mgja0_1vaht_175", - "calendar-container": "awsui_calendar-container_mgja0_1vaht_179", - "one-grid": "awsui_one-grid_mgja0_1vaht_182", - "calendar-header": "awsui_calendar-header_mgja0_1vaht_186", - "calendar-header-months-wrapper": "awsui_calendar-header-months-wrapper_mgja0_1vaht_192", - "calendar-header-month": "awsui_calendar-header-month_mgja0_1vaht_192", - "calendar-next-month-btn": "awsui_calendar-next-month-btn_mgja0_1vaht_211", - "calendar-prev-month-btn": "awsui_calendar-prev-month-btn_mgja0_1vaht_214", - "first-grid": "awsui_first-grid_mgja0_1vaht_218", - "second-grid": "awsui_second-grid_mgja0_1vaht_219", - "date-and-time-container": "awsui_date-and-time-container_mgja0_1vaht_223", - "date-and-time-wrapper": "awsui_date-and-time-wrapper_mgja0_1vaht_229", - "footer": "awsui_footer_mgja0_1vaht_236", - "has-clear-button": "awsui_has-clear-button_mgja0_1vaht_245", - "footer-button-wrapper": "awsui_footer-button-wrapper_mgja0_1vaht_254", - "icon-wrapper": "awsui_icon-wrapper_mgja0_1vaht_261", - "label": "awsui_label_mgja0_1vaht_266", - "label-enabled": "awsui_label-enabled_mgja0_1vaht_271", - "label-text": "awsui_label-text_mgja0_1vaht_275", - "label-token-nowrap": "awsui_label-token-nowrap_mgja0_1vaht_280", - "mode-switch": "awsui_mode-switch_mgja0_1vaht_284", - "dropdown": "awsui_dropdown_mgja0_1vaht_288", - "dropdown-content": "awsui_dropdown-content_mgja0_1vaht_310", - "start-date-input": "awsui_start-date-input_mgja0_1vaht_319", - "start-time-input": "awsui_start-time-input_mgja0_1vaht_320", - "end-date-input": "awsui_end-date-input_mgja0_1vaht_321", - "end-time-input": "awsui_end-time-input_mgja0_1vaht_322", - "validation-section": "awsui_validation-section_mgja0_1vaht_326", - "validation-error": "awsui_validation-error_mgja0_1vaht_330", - "clear-button": "awsui_clear-button_mgja0_1vaht_334", - "apply-button": "awsui_apply-button_mgja0_1vaht_338", - "cancel-button": "awsui_cancel-button_mgja0_1vaht_342", - "calendar-aria-live": "awsui_calendar-aria-live_mgja0_1vaht_346" -}; - -// node_modules/@cloudscape-design/components/date-range-picker/dropdown.js -var import_react308 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/index.js -var import_react302 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/index.js -var import_react297 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/header-button.js -var import_react296 = __toESM(require_react()); -function PrevMonthButton({ ariaLabel, baseDate, onChangeMonth }) { - return import_react296.default.createElement(InternalButton, { iconName: "angle-left", ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, -1)), formAction: "none", className: styles_css_default90["calendar-prev-month-btn"] }); -} -function NextMonthButton({ ariaLabel, baseDate, onChangeMonth }) { - return import_react296.default.createElement(InternalButton, { iconName: "angle-right", ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, 1)), formAction: "none", className: styles_css_default90["calendar-next-month-btn"] }); -} - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/index.js -function CalendarHeader2({ baseDate, locale: locale2, onChangeMonth, previousMonthLabel, nextMonthLabel, isSingleGrid, headingIdPrefix }) { - const i18n = useInternalI18n("calendar"); - const prevMonthLabel = renderMonthAndYear(locale2, add(baseDate, { months: -1 })); - const currentMonthLabel = renderMonthAndYear(locale2, baseDate); - return import_react297.default.createElement( - import_react297.default.Fragment, - null, - import_react297.default.createElement( - "div", - { className: styles_css_default90["calendar-header"] }, - import_react297.default.createElement(PrevMonthButton, { ariaLabel: i18n("previousMonthAriaLabel", previousMonthLabel), baseDate, onChangeMonth }), - import_react297.default.createElement( - "h2", - { className: styles_css_default90["calendar-header-months-wrapper"] }, - !isSingleGrid && import_react297.default.createElement("span", { className: styles_css_default90["calendar-header-month"], id: `${headingIdPrefix}-prevmonth` }, prevMonthLabel), - import_react297.default.createElement("span", { className: styles_css_default90["calendar-header-month"], id: `${headingIdPrefix}-currentmonth` }, currentMonthLabel) - ), - import_react297.default.createElement(NextMonthButton, { ariaLabel: i18n("nextMonthAriaLabel", nextMonthLabel), baseDate, onChangeMonth }) - ), - import_react297.default.createElement(live_region_default, null, isSingleGrid ? currentMonthLabel : `${prevMonthLabel}, ${currentMonthLabel}`) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/index.js -var import_react299 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/grid.js -var import_react298 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/styles.scoped.css"; -var styles_css_default91 = { - "grid": "awsui_grid_1mfbn_f3jvf_103", - "grid-cell": "awsui_grid-cell_1mfbn_f3jvf_108", - "day-header": "awsui_day-header_1mfbn_f3jvf_115", - "week": "awsui_week_1mfbn_f3jvf_125", - "day": "awsui_day_1mfbn_f3jvf_115", - "day-inner": "awsui_day-inner_1mfbn_f3jvf_172", - "in-first-row": "awsui_in-first-row_1mfbn_f3jvf_177", - "in-previous-month": "awsui_in-previous-month_1mfbn_f3jvf_177", - "last-day-of-month": "awsui_last-day-of-month_1mfbn_f3jvf_181", - "in-next-month": "awsui_in-next-month_1mfbn_f3jvf_185", - "in-first-column": "awsui_in-first-column_1mfbn_f3jvf_189", - "in-current-month": "awsui_in-current-month_1mfbn_f3jvf_192", - "enabled": "awsui_enabled_1mfbn_f3jvf_196", - "in-range": "awsui_in-range_1mfbn_f3jvf_202", - "end-date": "awsui_end-date_1mfbn_f3jvf_202", - "start-date": "awsui_start-date_1mfbn_f3jvf_202", - "no-range": "awsui_no-range_1mfbn_f3jvf_202", - "selected": "awsui_selected_1mfbn_f3jvf_212", - "today": "awsui_today_1mfbn_f3jvf_217", - "range-start-date": "awsui_range-start-date_1mfbn_f3jvf_262", - "in-range-border-bottom": "awsui_in-range-border-bottom_1mfbn_f3jvf_265", - "range-end-date": "awsui_range-end-date_1mfbn_f3jvf_268", - "in-range-border-top": "awsui_in-range-border-top_1mfbn_f3jvf_271", - "in-range-border-block-start": "awsui_in-range-border-block-start_1mfbn_f3jvf_284", - "in-range-border-inline-end": "awsui_in-range-border-inline-end_1mfbn_f3jvf_287", - "in-range-border-block-end": "awsui_in-range-border-block-end_1mfbn_f3jvf_290", - "in-range-border-inline-start": "awsui_in-range-border-inline-start_1mfbn_f3jvf_293" -}; - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/grid.js -function Grid2({ baseDate, selectedStartDate, selectedEndDate, rangeStartDate, rangeEndDate, focusedDate, focusedDateRef, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, isDateEnabled, locale: locale2, startOfWeek: startOfWeek2, todayAriaLabel, ariaLabelledby, className: className2 }) { - const baseDateTime = baseDate === null || baseDate === void 0 ? void 0 : baseDate.getTime(); - const weeks = (0, import_react298.useMemo)( - () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek2 }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [baseDateTime, startOfWeek2] - ); - const weekdays = weeks[0].map((date2) => date2.getDay()); - return import_react298.default.createElement( - "table", - { role: "grid", "aria-labelledby": ariaLabelledby, className: clsx_m_default(styles_css_default91.grid, className2) }, - import_react298.default.createElement( - "thead", - null, - import_react298.default.createElement("tr", null, weekdays.map((dayIndex) => import_react298.default.createElement( - "th", - { key: dayIndex, scope: "col", className: clsx_m_default(styles_css_default91["grid-cell"], styles_css_default91["day-header"]) }, - import_react298.default.createElement("span", { "aria-hidden": "true" }, renderDayName(locale2, dayIndex, "short")), - import_react298.default.createElement(ScreenreaderOnly, null, renderDayName(locale2, dayIndex, "long")) - ))) - ), - import_react298.default.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, weeks.map((week, weekIndex) => { - return import_react298.default.createElement("tr", { key: weekIndex, className: styles_css_default91.week }, week.map((date2, dateIndex) => { - const isStartDate = !!selectedStartDate && isSameDay(date2, selectedStartDate); - const isEndDate = !!selectedEndDate && isSameDay(date2, selectedEndDate); - const isSelected = isStartDate || isEndDate; - const isRangeStartDate = !!rangeStartDate && isSameDay(date2, rangeStartDate); - const isRangeEndDate = !!rangeEndDate && isSameDay(date2, rangeEndDate); - const isFocused = !!focusedDate && isSameDay(date2, focusedDate) && isSameMonth(date2, baseDate); - const dateIsInRange = isStartDate || isEndDate || isInRange(date2, rangeStartDate, rangeEndDate); - const inRangeStartWeek = rangeStartDate && isInRange(date2, rangeStartDate, addDays(addWeeks(rangeStartDate, 1), -1)); - const inRangeEndWeek = rangeEndDate && isInRange(date2, rangeEndDate, addDays(addWeeks(rangeEndDate, -1), 1)); - const onlyOneSelected = !!rangeStartDate && !!rangeEndDate ? isSameDay(rangeStartDate, rangeEndDate) : !selectedStartDate || !selectedEndDate; - const isEnabled = !isDateEnabled || isDateEnabled(date2); - const isFocusable = isFocused && isEnabled; - const baseClasses = { - [styles_css_default91.day]: true, - [styles_css_default91["grid-cell"]]: true, - [styles_css_default91["in-first-row"]]: weekIndex === 0, - [styles_css_default91["in-first-column"]]: dateIndex === 0 - }; - if (!isSameMonth(date2, baseDate)) { - return import_react298.default.createElement("td", { key: `${weekIndex}:${dateIndex}`, ref: isFocused ? focusedDateRef : void 0, className: clsx_m_default(baseClasses, { - [styles_css_default91["in-previous-month"]]: isBefore(date2, baseDate), - [styles_css_default91["last-day-of-month"]]: isLastDayOfMonth(date2), - [styles_css_default91["in-next-month"]]: isAfter(date2, baseDate) - }) }); - } - const handlers = {}; - if (isEnabled) { - handlers.onClick = () => onSelectDate(date2); - handlers.onFocus = () => onFocusedDateChange(date2); - } - let tabIndex = void 0; - if (isFocusable && isEnabled) { - tabIndex = 0; - } else if (isEnabled) { - tabIndex = -1; - } - let dayAnnouncement = getDateLabel(locale2, date2, "short"); - if (isToday(date2)) { - dayAnnouncement += ". " + todayAriaLabel; - } - return import_react298.default.createElement( - "td", - Object.assign({ ref: isFocused ? focusedDateRef : void 0, key: `${weekIndex}:${dateIndex}`, className: clsx_m_default(baseClasses, { - [styles_css_default91["in-current-month"]]: isSameMonth(date2, baseDate), - [styles_css_default91.enabled]: isEnabled, - [styles_css_default91.selected]: isSelected, - [styles_css_default91["start-date"]]: isStartDate, - [styles_css_default91["end-date"]]: isEndDate, - [styles_css_default91["range-start-date"]]: isRangeStartDate, - [styles_css_default91["range-end-date"]]: isRangeEndDate, - [styles_css_default91["no-range"]]: isSelected && onlyOneSelected, - [styles_css_default91["in-range"]]: dateIsInRange, - [styles_css_default91["in-range-border-block-start"]]: !!inRangeStartWeek || date2.getDate() <= 7, - [styles_css_default91["in-range-border-block-end"]]: !!inRangeEndWeek || date2.getDate() > getDaysInMonth(date2) - 7, - [styles_css_default91["in-range-border-inline-start"]]: dateIndex === 0 || date2.getDate() === 1 || isRangeStartDate, - [styles_css_default91["in-range-border-inline-end"]]: dateIndex === week.length - 1 || isLastDayOfMonth(date2) || isRangeEndDate, - [styles_css_default91.today]: isToday(date2) - }), "aria-selected": isEnabled ? isSelected || dateIsInRange : void 0, "aria-current": isToday(date2) ? "date" : void 0, "data-date": formatDate2(date2), "aria-disabled": !isEnabled, tabIndex }, handlers), - import_react298.default.createElement("span", { className: styles_css_default91["day-inner"], "aria-hidden": "true" }, date2.getDate()), - import_react298.default.createElement(ScreenreaderOnly, null, dayAnnouncement) - ); - })); - })) - ); -} -function isInRange(date2, dateOne, dateTwo) { - if (!dateOne || !dateTwo || isSameDay(dateOne, dateTwo)) { - return false; - } - const inRange = isAfter(date2, dateOne) && isBefore(date2, dateTwo) || isAfter(date2, dateTwo) && isBefore(date2, dateOne); - return inRange || isSameDay(date2, dateOne) || isSameDay(date2, dateTwo); -} - -// node_modules/@cloudscape-design/components/internal/utils/has-value.js -function hasValue(value) { - return value !== null && value !== void 0; -} - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/utils.js -function findDateToFocus(selected, baseDate, isDateEnabled) { - if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) { - return selected; - } - const today = /* @__PURE__ */ new Date(); - if (isDateEnabled(today) && isSameMonth(today, baseDate)) { - return today; - } - if (isDateEnabled(baseDate)) { - return baseDate; - } - return null; -} -function findMonthToDisplay(value, isSingleGrid) { - if (value.start.date) { - const startDate = parseDate(value.start.date); - if (isSingleGrid) { - return startOfMonth(startDate); - } - return startOfMonth(addMonths(startDate, 1)); - } - if (value.end.date) { - return startOfMonth(parseDate(value.end.date)); - } - return startOfMonth(Date.now()); -} - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/index.js -function isVisible2(date2, baseDate, isSingleGrid) { - if (isSingleGrid) { - return isSameMonth(date2, baseDate); - } - const previousMonth = addMonths(baseDate, -1); - return isSameMonth(date2, previousMonth) || isSameMonth(date2, baseDate); -} -var Grids = ({ baseDate, selectedStartDate, selectedEndDate, focusedDate, onFocusedDateChange, isDateEnabled, isSingleGrid, onSelectDate, onChangeMonth, locale: locale2, startOfWeek: startOfWeek2, todayAriaLabel, headingIdPrefix }) => { - const containerRef = (0, import_react299.useRef)(null); - const [gridHasFocus, setGridHasFocus] = (0, import_react299.useState)(false); - const focusedDateRef = (0, import_react299.useRef)(null); - const dateCache = useDateCache(); - baseDate = dateCache(baseDate); - focusedDate = focusedDate ? dateCache(focusedDate) : null; - (0, import_react299.useEffect)(() => { - if (focusedDate && !isVisible2(focusedDate, baseDate, isSingleGrid)) { - const direction = isAfter(focusedDate, baseDate) ? -1 : 1; - const newMonth = !isSingleGrid && direction === -1 ? addMonths(baseDate, -1) : baseDate; - const nearestBaseDate = getBaseDay(newMonth, isDateEnabled); - const newFocusedDate = findDateToFocus(focusedDate, nearestBaseDate, isDateEnabled); - onFocusedDateChange(newFocusedDate); - } - }, [baseDate, focusedDate, isSingleGrid, isDateEnabled, onFocusedDateChange]); - const onGridKeyDownHandler = (event) => { - let updatedFocusDate; - const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter]; - if (focusedDate === null || keys.indexOf(event.keyCode) === -1) { - return; - } - event.preventDefault(); - handleKey(event, { - onActivate: () => focusedDate && onSelectDate(focusedDate), - onBlockEnd: () => focusedDate && (updatedFocusDate = moveNextWeek(focusedDate, isDateEnabled)), - onBlockStart: () => focusedDate && (updatedFocusDate = movePrevWeek(focusedDate, isDateEnabled)), - onInlineEnd: () => focusedDate && (updatedFocusDate = moveNextDay(focusedDate, isDateEnabled)), - onInlineStart: () => focusedDate && (updatedFocusDate = movePrevDay(focusedDate, isDateEnabled)) - }); - if (!updatedFocusDate) { - return; - } - const updatedDateIsVisible = isVisible2(updatedFocusDate, baseDate, isSingleGrid); - if (!updatedDateIsVisible) { - const newMonthIsOnLeftSide = !isSingleGrid && isBefore(updatedFocusDate, baseDate); - onChangeMonth(newMonthIsOnLeftSide ? addMonths(updatedFocusDate, 1) : updatedFocusDate); - } - onFocusedDateChange(updatedFocusDate); - }; - (0, import_react299.useEffect)(() => { - if (focusedDate !== null && gridHasFocus) { - if (focusedDateRef.current && focusedDateRef.current !== document.activeElement) { - focusedDateRef.current.focus(); - } - } - }, [focusedDate, gridHasFocus]); - const onGridBlur = (event) => { - var _a2; - const newFocusTarget = event.relatedTarget || document.activeElement; - const newFocusTargetIsInGrid = (_a2 = containerRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(newFocusTarget); - if (newFocusTarget && !newFocusTargetIsInGrid && gridHasFocus) { - setGridHasFocus(false); - } - }; - const onGridFocus = () => { - if (!gridHasFocus) { - setGridHasFocus(true); - } - }; - const isRangeVisible = selectedStartDate && selectedEndDate || gridHasFocus; - const rangeEnds = [selectedStartDate !== null && selectedStartDate !== void 0 ? selectedStartDate : focusedDate, selectedEndDate !== null && selectedEndDate !== void 0 ? selectedEndDate : focusedDate].filter(hasValue); - const rangeStartDate = min2(rangeEnds); - const rangeEndDate = max2(rangeEnds); - return import_react299.default.createElement( - "div", - { ref: containerRef, onFocus: onGridFocus, onBlur: onGridBlur }, - import_react299.default.createElement( - InternalSpaceBetween, - { size: "xs", direction: "horizontal" }, - !isSingleGrid && import_react299.default.createElement(Grid2, { className: styles_css_default90["first-grid"], baseDate: addMonths(baseDate, -1), selectedEndDate, selectedStartDate, rangeStartDate: isRangeVisible ? rangeStartDate : null, rangeEndDate: isRangeVisible ? rangeEndDate : null, focusedDate, focusedDateRef, isDateEnabled, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, locale: locale2, startOfWeek: startOfWeek2, todayAriaLabel, ariaLabelledby: `${headingIdPrefix}-prevmonth` }), - import_react299.default.createElement(Grid2, { className: styles_css_default90["second-grid"], baseDate, selectedEndDate, selectedStartDate, rangeStartDate: isRangeVisible ? rangeStartDate : null, rangeEndDate: isRangeVisible ? rangeEndDate : null, focusedDate, focusedDateRef, isDateEnabled, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, locale: locale2, startOfWeek: startOfWeek2, todayAriaLabel, ariaLabelledby: `${headingIdPrefix}-currentmonth` }) - ) - ); -}; - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/range-inputs.js -var import_react301 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/time-input/internal.js -var import_react300 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/time-input/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/time-input/styles.scoped.css"; -var styles_css_default92 = { - "root": "awsui_root_l809c_im8v7_5" -}; - -// node_modules/@cloudscape-design/components/time-input/internal.js -var getMaskArgs = (format3, use24Hour) => { - const segments = [ - use24Hour ? { min: 0, max: 23, length: 2 } : { min: 1, max: 12, length: 2 }, - { min: 0, max: 59, length: 2 }, - { min: 0, max: 59, length: 2 } - ]; - return { - separator: ":", - segments: segments.slice(0, format3.split(":").length) - }; -}; -var InternalTimeInput = import_react300.default.forwardRef((_a2, ref) => { - var { format: format3 = "hh:mm:ss", use24Hour = true, autoComplete = true, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["format", "use24Hour", "autoComplete", "__internalRootRef"]); - const inputRef = (0, import_react300.useRef)(null); - useForwardFocus(ref, inputRef); - const maskArgs = getMaskArgs(format3, use24Hour); - return import_react300.default.createElement(masked_input_default, Object.assign({}, props2, { __internalRootRef, ref: inputRef, className: clsx_m_default(styles_css_default92.root, props2.className), autoComplete, disableBrowserAutocorrect: true, mask: maskArgs })); -}); -var internal_default17 = InternalTimeInput; - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/range-inputs.js -function RangeInputs({ startDate, onChangeStartDate, startTime, onChangeStartTime, endDate, onChangeEndDate, endTime, onChangeEndTime, i18nStrings, dateOnly, timeInputFormat }) { - const i18n = useInternalI18n("date-range-picker"); - return import_react301.default.createElement( - InternalFormField, - { constraintText: i18n("i18nStrings.dateTimeConstraintText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.dateTimeConstraintText) }, - import_react301.default.createElement( - "div", - { className: styles_css_default90["date-and-time-container"] }, - import_react301.default.createElement( - "div", - { className: styles_css_default90["date-and-time-wrapper"] }, - import_react301.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.startDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startDateLabel), stretch: true }, - import_react301.default.createElement(internal_default16, { value: startDate, className: styles_css_default90["start-date-input"], onChange: (event) => onChangeStartDate(event.detail.value), placeholder: "YYYY/MM/DD" }) - ), - !dateOnly && import_react301.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.startTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startTimeLabel), stretch: true }, - import_react301.default.createElement(internal_default17, { value: startTime, onChange: (event) => onChangeStartTime(event.detail.value), format: timeInputFormat, placeholder: timeInputFormat, className: styles_css_default90["start-time-input"] }) - ) - ), - import_react301.default.createElement( - "div", - { className: styles_css_default90["date-and-time-wrapper"] }, - import_react301.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.endDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endDateLabel), stretch: true }, - import_react301.default.createElement(internal_default16, { value: endDate, className: styles_css_default90["end-date-input"], onChange: (event) => onChangeEndDate(event.detail.value), placeholder: "YYYY/MM/DD" }) - ), - !dateOnly && import_react301.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.endTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endTimeLabel), stretch: true }, - import_react301.default.createElement(internal_default17, { value: endTime, onChange: (event) => onChangeEndTime(event.detail.value), format: timeInputFormat, placeholder: timeInputFormat, className: styles_css_default90["end-time-input"] }) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/calendar/index.js -function DateRangePickerCalendar({ value, setValue, locale: locale2 = "", startOfWeek: startOfWeek2, isDateEnabled = () => true, i18nStrings, dateOnly = false, timeInputFormat = "hh:mm:ss", customAbsoluteRangeControl }) { - const isSingleGrid = useMobile(); - const normalizedLocale = normalizeLocale("DateRangePicker", locale2); - const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek2, normalizedLocale); - const i18n = useInternalI18n("date-range-picker"); - const [announcement, setAnnouncement] = (0, import_react302.useState)(""); - const [currentMonth, setCurrentMonth] = (0, import_react302.useState)(() => findMonthToDisplay(value, isSingleGrid)); - const [focusedDate, setFocusedDate] = (0, import_react302.useState)(() => { - if (value.start.date) { - const startDate = parseDate(value.start.date); - if (isSameMonth(startDate, currentMonth)) { - return startDate; - } - if (!isSingleGrid && isSameMonth(startDate, addMonths(currentMonth, -1))) { - return startDate; - } - } - return findDateToFocus(parseDate(value.start.date), currentMonth, isDateEnabled); - }); - const updateCurrentMonth = (startDate) => { - if (startDate.length >= 8) { - const newCurrentMonth = startOfMonth(parseDate(startDate)); - setCurrentMonth(isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, 1)); - } - }; - const announceStart = (startDate) => { - return i18n("i18nStrings.startDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startDateLabel) + ", " + getDateLabel(normalizedLocale, startDate) + ", " + i18n("i18nStrings.startTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startTimeLabel) + ", " + renderTimeLabel(normalizedLocale, startDate, timeInputFormat) + ". "; - }; - const announceEnd = (endDate) => { - return i18n("i18nStrings.endDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endDateLabel) + ", " + getDateLabel(normalizedLocale, endDate) + ", " + i18n("i18nStrings.endTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endTimeLabel) + ", " + renderTimeLabel(normalizedLocale, endDate, timeInputFormat) + ". "; - }; - const renderSelectedAbsoluteRangeAriaLive = i18n("i18nStrings.renderSelectedAbsoluteRangeAriaLive", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.renderSelectedAbsoluteRangeAriaLive, (format3) => (startDate, endDate) => format3({ startDate, endDate })); - const announceRange = (startDate, endDate) => { - if (!renderSelectedAbsoluteRangeAriaLive) { - return `${getDateLabel(normalizedLocale, startDate)} – ${getDateLabel(normalizedLocale, endDate)}`; - } - return renderSelectedAbsoluteRangeAriaLive(getDateLabel(normalizedLocale, startDate), getDateLabel(normalizedLocale, endDate)); - }; - const onSelectDateHandler = (selectedDate) => { - const { start, end } = value; - let newStart = void 0; - let newEnd = void 0; - let announcement2 = ""; - if (!start.date && !end.date) { - newStart = startOfDay(selectedDate); - announcement2 = announceStart(newStart); - } else if (start.date && end.date) { - newStart = startOfDay(selectedDate); - newEnd = null; - announcement2 = announceStart(newStart); - } else if (start.date && !end.date) { - const parsedStartDate = parseDate(start.date); - if (isBefore(selectedDate, parsedStartDate)) { - newStart = startOfDay(selectedDate); - newEnd = endOfDay(parsedStartDate); - announcement2 = announceStart(newStart) + announceRange(newStart, newEnd); - } else { - newEnd = endOfDay(selectedDate); - announcement2 = announceEnd(newEnd) + announceRange(parsedStartDate, newEnd); - } - } else if (!start.date && end.date) { - const existingEndDate = parseDate(end.date); - if (isAfter(selectedDate, existingEndDate)) { - newStart = startOfDay(existingEndDate); - newEnd = endOfDay(selectedDate); - announcement2 = announceEnd(newEnd) + announceRange(newStart, newEnd); - } else { - newStart = startOfDay(selectedDate); - announcement2 = announceStart(newStart) + announceRange(newStart, existingEndDate); - } - } - const formatValue2 = (date2, previous) => { - if (date2 === null) { - return { date: "", time: "" }; - } else if (date2 === void 0) { - return previous; - } - return splitDateTime(formatDateTime(date2)); - }; - setValue({ - start: formatValue2(newStart, value.start), - end: formatValue2(newEnd, value.end) - }); - setAnnouncement(announcement2); - }; - const onHeaderChangeMonthHandler = (newCurrentMonth) => { - setCurrentMonth(newCurrentMonth); - const newBaseDateMonth = isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, -1); - const newBaseDate = getBaseDay(newBaseDateMonth, isDateEnabled); - setFocusedDate(newBaseDate); - }; - const onChangeStartDate = (value2) => { - setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { start: Object.assign(Object.assign({}, oldValue.start), { date: value2 }) })); - updateCurrentMonth(value2); - }; - const interceptedSetValue = (newValue) => { - setValue((oldValue) => { - const updated = typeof newValue === "function" ? newValue(oldValue) : newValue; - updateCurrentMonth(updated.start.date); - return updated; - }); - }; - const headingIdPrefix = useUniqueId("date-range-picker-calendar-heading"); - return import_react302.default.createElement( - import_react302.default.Fragment, - null, - import_react302.default.createElement( - "div", - { className: clsx_m_default(styles_css_default90["calendar-container"], { - [styles_css_default90["one-grid"]]: isSingleGrid - }) }, - import_react302.default.createElement( - InternalSpaceBetween, - { size: "s" }, - import_react302.default.createElement( - "div", - { className: clsx_m_default(styles_css_default90.calendar, { - [styles_css_default90["one-grid"]]: isSingleGrid - }) }, - import_react302.default.createElement(CalendarHeader2, { baseDate: currentMonth, locale: normalizedLocale, onChangeMonth: onHeaderChangeMonthHandler, previousMonthLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel, nextMonthLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel, isSingleGrid, headingIdPrefix }), - import_react302.default.createElement(Grids, { isSingleGrid, locale: normalizedLocale, baseDate: currentMonth, focusedDate, onFocusedDateChange: setFocusedDate, isDateEnabled, onSelectDate: onSelectDateHandler, onChangeMonth: setCurrentMonth, startOfWeek: normalizedStartOfWeek, todayAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel, selectedStartDate: parseDate(value.start.date, true), selectedEndDate: parseDate(value.end.date, true), headingIdPrefix }) - ), - import_react302.default.createElement(RangeInputs, { startDate: value.start.date, onChangeStartDate, startTime: value.start.time, onChangeStartTime: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { start: Object.assign(Object.assign({}, oldValue.start), { time: value2 }) })), endDate: value.end.date, onChangeEndDate: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { end: Object.assign(Object.assign({}, oldValue.end), { date: value2 }) })), endTime: value.end.time, onChangeEndTime: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { end: Object.assign(Object.assign({}, oldValue.end), { time: value2 }) })), i18nStrings, dateOnly, timeInputFormat }), - customAbsoluteRangeControl && import_react302.default.createElement("div", null, customAbsoluteRangeControl(value, interceptedSetValue)) - ) - ), - import_react302.default.createElement(live_region_default, { className: styles_css_default90["calendar-aria-live"] }, announcement) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/relative-range/index.js -var import_react303 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/date-range-picker/relative-range/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/date-range-picker/relative-range/styles.scoped.css"; -var styles_css_default93 = { - "custom-range": "awsui_custom-range_16zmw_1bi9d_99", - "custom-range--no-padding": "awsui_custom-range--no-padding_16zmw_1bi9d_105", - "custom-range-form-controls": "awsui_custom-range-form-controls_16zmw_1bi9d_109", - "custom-range-duration": "awsui_custom-range-duration_16zmw_1bi9d_113", - "custom-range-unit": "awsui_custom-range-unit_16zmw_1bi9d_114", - "vertical": "awsui_vertical_16zmw_1bi9d_120", - "custom-range-duration-input": "awsui_custom-range-duration-input_16zmw_1bi9d_131", - "custom-range-unit-select": "awsui_custom-range-unit-select_16zmw_1bi9d_132", - "relative-range-radio-group": "awsui_relative-range-radio-group_16zmw_1bi9d_136" -}; - -// node_modules/@cloudscape-design/components/date-range-picker/relative-range/index.js -var dayUnits = ["day", "week", "month", "year"]; -var units = ["second", "minute", "hour", ...dayUnits]; -var CUSTOM_OPTION_SELECT_KEY = "awsui-internal-custom-duration-key"; -function RelativeRangePicker({ dateOnly, options: clientOptions = [], initialSelection: initialRange, onChange: onChangeRangeSize, i18nStrings, isSingleGrid }) { - var _a2; - const i18n = useInternalI18n("date-range-picker"); - const formatRelativeRange = i18n("i18nStrings.formatRelativeRange", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatRelativeRange, (format3) => ({ amount, unit: unit2 }) => format3({ amount, unit: unit2 })); - const formatUnit = i18n("i18nStrings.formatUnit", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatUnit, (format3) => (unit2, amount) => format3({ amount, unit: unit2 })); - const radioOptions = clientOptions.map((option) => ({ - value: option.key, - label: formatRelativeRange === null || formatRelativeRange === void 0 ? void 0 : formatRelativeRange(option) - })); - radioOptions.push({ - value: CUSTOM_OPTION_SELECT_KEY, - label: i18n("i18nStrings.customRelativeRangeOptionLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionLabel), - description: i18n("i18nStrings.customRelativeRangeOptionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription) - }); - const [selectedRadio, setSelectedRadio] = (0, import_react303.useState)(() => { - var _a3; - if (initialRange && !initialRange.key) { - return CUSTOM_OPTION_SELECT_KEY; - } - return (_a3 = initialRange === null || initialRange === void 0 ? void 0 : initialRange.key) !== null && _a3 !== void 0 ? _a3 : null; - }); - const [customDuration, setCustomDuration] = (0, import_react303.useState)(() => { - if (initialRange) { - return initialRange.amount; - } - return NaN; - }); - const initialCustomTimeUnit = dateOnly ? "day" : "minute"; - const [customUnitOfTime, setCustomUnitOfTime] = (0, import_react303.useState)((_a2 = initialRange === null || initialRange === void 0 ? void 0 : initialRange.unit) !== null && _a2 !== void 0 ? _a2 : initialCustomTimeUnit); - const showRadioControl = clientOptions.length > 0; - const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY; - return import_react303.default.createElement( - "div", - null, - import_react303.default.createElement( - InternalSpaceBetween, - { size: "xs", direction: "vertical" }, - showRadioControl && import_react303.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.relativeRangeSelectionHeading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeRangeSelectionHeading) }, - import_react303.default.createElement(internal_default13, { className: styles_css_default93["relative-range-radio-group"], onChange: ({ detail }) => { - setSelectedRadio(detail.value); - if (detail.value === CUSTOM_OPTION_SELECT_KEY) { - setCustomDuration(NaN); - setCustomUnitOfTime(initialCustomTimeUnit); - onChangeRangeSize({ - amount: NaN, - unit: initialCustomTimeUnit, - type: "relative" - }); - } else { - const option = clientOptions.filter((o) => o.key === detail.value)[0]; - onChangeRangeSize(option); - } - }, value: selectedRadio, items: radioOptions }) - ), - showCustomControls && import_react303.default.createElement( - InternalSpaceBetween, - { direction: "vertical", size: "xs" }, - !showRadioControl && import_react303.default.createElement(InternalBox, { fontSize: "body-m", color: "text-body-secondary" }, i18n("i18nStrings.customRelativeRangeOptionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription)), - import_react303.default.createElement( - "div", - { className: clsx_m_default(styles_css_default93["custom-range"], { - [styles_css_default93["custom-range--no-padding"]]: !showRadioControl - }) }, - import_react303.default.createElement( - "div", - { className: clsx_m_default(styles_css_default93["custom-range-form-controls"], { - [styles_css_default93.vertical]: isSingleGrid - }) }, - import_react303.default.createElement( - "div", - { className: styles_css_default93["custom-range-duration"] }, - import_react303.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.customRelativeRangeDurationLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationLabel) }, - import_react303.default.createElement(internal_default7, { type: "number", className: styles_css_default93["custom-range-duration-input"], value: isNaN(customDuration) || customDuration === 0 ? "" : customDuration === null || customDuration === void 0 ? void 0 : customDuration.toString(), onChange: (e) => { - const amount = Number(e.detail.value); - setCustomDuration(amount); - onChangeRangeSize({ amount, unit: customUnitOfTime, type: "relative" }); - }, placeholder: i18n("i18nStrings.customRelativeRangeDurationPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationPlaceholder), __inheritFormFieldProps: true }) - ) - ), - import_react303.default.createElement( - "div", - { className: styles_css_default93["custom-range-unit"] }, - import_react303.default.createElement( - InternalFormField, - { label: i18n("i18nStrings.customRelativeRangeUnitLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeUnitLabel) }, - import_react303.default.createElement(internal_default12, { className: styles_css_default93["custom-range-unit-select"], selectedOption: { - value: customUnitOfTime, - label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(customUnitOfTime, customDuration) - }, onChange: (e) => { - const { value: unit2 } = e.detail.selectedOption; - setCustomUnitOfTime(unit2); - onChangeRangeSize({ amount: customDuration, unit: unit2, type: "relative" }); - }, options: (dateOnly ? dayUnits : units).map((unit2) => ({ - value: unit2, - label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(unit2, customDuration) - })), renderHighlightedAriaLive: (option) => option.label || option.value || "" }) - ) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/mode-switcher.js -var import_react307 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/segmented-control/internal.js -var import_react306 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/segmented-control/internal-segmented-control.js -var import_react305 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/segmented-control/segment.js -var import_react304 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/segmented-control/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/segmented-control/styles.scoped.css"; -var styles_css_default94 = { - "segment": "awsui_segment_8cbea_97spt_103", - "disabled": "awsui_disabled_8cbea_97spt_183", - "selected": "awsui_selected_8cbea_97spt_191", - "icon": "awsui_icon_8cbea_97spt_212", - "with-text": "awsui_with-text_8cbea_97spt_216", - "with-no-text": "awsui_with-no-text_8cbea_97spt_222", - "root": "awsui_root_8cbea_97spt_231", - "segment-part": "awsui_segment-part_8cbea_97spt_266", - "select": "awsui_select_8cbea_97spt_191", - "segment-count-2": "awsui_segment-count-2_8cbea_97spt_285", - "segment-count-3": "awsui_segment-count-3_8cbea_97spt_290", - "segment-count-4": "awsui_segment-count-4_8cbea_97spt_295", - "segment-count-5": "awsui_segment-count-5_8cbea_97spt_300", - "segment-count-6": "awsui_segment-count-6_8cbea_97spt_305" -}; - -// node_modules/@cloudscape-design/components/segmented-control/segment.js -var Segment = import_react304.default.forwardRef(({ disabled, text, iconName, iconAlt, iconUrl, iconSvg, isActive, onClick, onKeyDown, tabIndex }, ref) => { - return import_react304.default.createElement( - "button", - { className: clsx_m_default(styles_css_default94.segment, { [styles_css_default94.disabled]: !!disabled }, { [styles_css_default94.selected]: isActive }), ref, onClick, onKeyDown, disabled, type: "button", tabIndex, "aria-pressed": isActive ? "true" : "false", "aria-label": !text ? iconAlt : void 0 }, - (iconName || iconUrl || iconSvg) && import_react304.default.createElement(internal_default, { className: clsx_m_default(styles_css_default94.icon, text ? styles_css_default94["with-text"] : styles_css_default94["with-no-text"]), name: iconName, url: iconUrl, svg: iconSvg, alt: iconAlt, variant: disabled ? "disabled" : "normal" }), - import_react304.default.createElement("span", null, text) - ); -}); - -// node_modules/@cloudscape-design/components/segmented-control/internal-segmented-control.js -function InternalSegmentedControl({ selectedId, options, label, ariaLabelledby, onChange }) { - const segmentByIdRef = (0, import_react305.useRef)({}); - const selectedOptions = (options || []).filter((option) => { - return option.id === selectedId; - }); - const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null; - const enabledSegments = (options || []).filter((option) => !option.disabled); - const moveHighlight2 = (event, activeIndex) => { - var _a2; - if (event.keyCode !== KeyCode.right && event.keyCode !== KeyCode.left) { - return; - } - let nextIndex = activeIndex; - handleKey(event, { - onInlineStart: () => nextIndex = activeIndex === 0 ? enabledSegments.length - 1 : activeIndex - 1, - onInlineEnd: () => nextIndex = activeIndex + 1 === enabledSegments.length ? 0 : activeIndex + 1 - }); - const nextSegmentId = enabledSegments[nextIndex].id; - (_a2 = segmentByIdRef.current[nextSegmentId]) === null || _a2 === void 0 ? void 0 : _a2.focus(); - }; - return import_react305.default.createElement("div", { className: clsx_m_default(styles_css_default94["segment-part"], styles_css_default94[`segment-count-${options === null || options === void 0 ? void 0 : options.length}`]), "aria-label": label, "aria-labelledby": ariaLabelledby, role: "toolbar" }, options && options.map((option, index) => { - const isActive = selectedId === option.id; - const enabledSegmentIndex = enabledSegments.indexOf(option); - let tabIndex = isActive ? 0 : -1; - if (currentSelectedOption === null && enabledSegmentIndex === 0) { - tabIndex = 0; - } - return import_react305.default.createElement(Segment, { key: index, id: option.id, disabled: !!option.disabled, iconName: option.iconName, iconAlt: option.iconAlt, iconUrl: option.iconUrl, iconSvg: option.iconSvg, text: option.text, isActive, tabIndex, ref: (node) => { - if (node) { - segmentByIdRef.current[option.id] = node; - } else { - delete segmentByIdRef.current[option.id]; - } - }, onClick: () => { - if (selectedId !== option.id) { - fireNonCancelableEvent(onChange, { selectedId: option.id }); - } - }, onKeyDown: (event) => moveHighlight2(event, enabledSegmentIndex) }); - })); -} - -// node_modules/@cloudscape-design/components/segmented-control/internal.js -function InternalSegmentedControl2(_a2) { - var { selectedId, options, label, ariaLabelledby, onChange, __internalRootRef = null } = _a2, props2 = __rest(_a2, ["selectedId", "options", "label", "ariaLabelledby", "onChange", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const selectOptions = (options || []).map((option) => { - const label2 = option.text || option.iconAlt; - return Object.assign(Object.assign({}, option), { label: label2, value: option.id }); - }); - const selectedOptions = selectOptions.filter((option) => { - return option.value === selectedId; - }); - const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null; - const selectProps = { - options: selectOptions, - selectedOption: currentSelectedOption, - triggerVariant: "option", - onChange: (event) => fireNonCancelableEvent(onChange, { selectedId: event.detail.selectedOption.value }) - }; - return import_react306.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default94.root), ref: __internalRootRef }), - import_react306.default.createElement(InternalSegmentedControl, { selectedId, options, label, ariaLabelledby, onChange }), - import_react306.default.createElement( - "div", - { className: styles_css_default94.select }, - ariaLabelledby && import_react306.default.createElement(internal_default12, Object.assign({}, selectProps, { ariaLabelledby })), - !ariaLabelledby && label && import_react306.default.createElement( - InternalFormField, - { label, stretch: true }, - import_react306.default.createElement(internal_default12, Object.assign({}, selectProps)) - ), - !ariaLabelledby && !label && import_react306.default.createElement(internal_default12, Object.assign({}, selectProps)) - ) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/mode-switcher.js -function ModeSwitcher({ i18nStrings, mode, onChange }) { - const i18n = useInternalI18n("date-range-picker"); - return import_react307.default.createElement(InternalSegmentedControl2, { className: styles_css_default90["mode-switch"], selectedId: mode, label: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modeSelectionLabel, options: [ - { id: "relative", text: i18n("i18nStrings.relativeModeTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeModeTitle) }, - { id: "absolute", text: i18n("i18nStrings.absoluteModeTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.absoluteModeTitle) } - ], onChange: (e) => onChange(e.detail.selectedId) }); -} - -// node_modules/@cloudscape-design/components/date-range-picker/time-offset.js -function setTimeOffset(value, timeOffset) { - if (!((value === null || value === void 0 ? void 0 : value.type) === "absolute")) { - return value; - } - return { - type: "absolute", - startDate: value.startDate + formatTimeOffsetISO(value.startDate, timeOffset.startDate), - endDate: value.endDate + formatTimeOffsetISO(value.endDate, timeOffset.endDate) - }; -} -function shiftTimeOffset(value, timeOffset) { - if (!value || value.type !== "absolute") { - return value; - } - const dateTimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?(\.\d{1,3})?(((\+|-)\d{2}(:\d{2})?)|Z)?$/; - if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) { - warnOnce("DateRangePicker", "You have provided a misformatted start or end date. The component will fall back to an empty value. Dates have to be ISO8601-formatted with an optional time zone offset."); - return null; - } - return { - type: "absolute", - startDate: shiftTimezoneOffset(value.startDate, timeOffset.startDate), - endDate: shiftTimezoneOffset(value.endDate, timeOffset.endDate) - }; -} -function normalizeTimeOffset(value, getTimeOffset, timeOffset) { - if (value && value.type === "absolute") { - if (getTimeOffset) { - return { - startDate: getTimeOffset(parseDateUTC(value.startDate)), - endDate: getTimeOffset(parseDateUTC(value.endDate)) - }; - } else if (timeOffset !== void 0) { - return { startDate: timeOffset, endDate: timeOffset }; - } - } - return { startDate: void 0, endDate: void 0 }; -} -function parseDateUTC(isoDateString) { - const date2 = new Date(isoDateString); - return addMinutes(date2, parseTimezoneOffset(isoDateString)); -} - -// node_modules/@cloudscape-design/components/date-range-picker/utils.js -function formatValue(value, { timeOffset, dateOnly }) { - if (!value || value.type === "relative") { - return value; - } - if (dateOnly) { - return { - type: "absolute", - startDate: value.startDate.split("T")[0], - endDate: value.endDate.split("T")[0] - }; - } - return setTimeOffset(value, timeOffset); -} -function getDefaultMode(value, relativeOptions, rangeSelectorMode) { - if (value && value.type) { - return value.type; - } - if (rangeSelectorMode === "relative-only") { - return "relative"; - } - if (rangeSelectorMode === "absolute-only") { - return "absolute"; - } - return relativeOptions.length > 0 ? "relative" : "absolute"; -} -function splitAbsoluteValue(value) { - if (!value) { - return { - start: { date: "", time: "" }, - end: { date: "", time: "" } - }; - } - return { start: splitDateTime(value.startDate), end: splitDateTime(value.endDate) }; -} -function joinAbsoluteValue(value) { - const startTime = normalizeTimeString(value.start.time || "00:00:00"); - const endTime = normalizeTimeString(value.end.time || "23:59:59"); - return { - type: "absolute", - startDate: joinDateTime(value.start.date, startTime), - endDate: joinDateTime(value.end.date, endTime) - }; -} - -// node_modules/@cloudscape-design/components/date-range-picker/dropdown.js -var VALID_RANGE = { valid: true }; -function DateRangePickerDropdown({ locale: locale2 = "", startOfWeek: startOfWeek2, isDateEnabled, isValidRange, value, onClear: clearValue, onApply: applyValue, onDropdownClose, relativeOptions, showClearButton, isSingleGrid, i18nStrings, dateOnly, timeInputFormat, rangeSelectorMode, ariaLabelledby, ariaDescribedby, customAbsoluteRangeControl }) { - const i18n = useInternalI18n("date-range-picker"); - const [rangeSelectionMode, setRangeSelectionMode] = (0, import_react308.useState)(getDefaultMode(value, relativeOptions, rangeSelectorMode)); - const [selectedAbsoluteRange, setSelectedAbsoluteRange] = (0, import_react308.useState)(() => splitAbsoluteValue((value === null || value === void 0 ? void 0 : value.type) === "absolute" ? value : null)); - const [selectedRelativeRange, setSelectedRelativeRange] = (0, import_react308.useState)((value === null || value === void 0 ? void 0 : value.type) === "relative" ? value : null); - const scrollableContainerRef = (0, import_react308.useRef)(null); - const applyButtonRef = (0, import_react308.useRef)(null); - const [applyClicked, setApplyClicked] = (0, import_react308.useState)(false); - const [validationResult, setValidationResult] = (0, import_react308.useState)(VALID_RANGE); - const closeDropdown = () => { - setApplyClicked(false); - onDropdownClose(); - }; - const onClear = () => { - closeDropdown(); - clearValue(); - }; - const onApply = () => { - const newValue = rangeSelectionMode === "relative" ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange); - const newValidationResult = applyValue(newValue); - if (newValidationResult.valid === false) { - setApplyClicked(true); - setValidationResult(newValidationResult); - } else { - setApplyClicked(false); - closeDropdown(); - } - }; - (0, import_react308.useEffect)(() => { - if (applyClicked) { - const visibleRange = rangeSelectionMode === "relative" ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange); - const newValidationResult = isValidRange(visibleRange); - setValidationResult(newValidationResult || VALID_RANGE); - } - }, [ - applyClicked, - isValidRange, - rangeSelectionMode, - selectedRelativeRange, - selectedAbsoluteRange, - setValidationResult - ]); - (0, import_react308.useEffect)(() => { - var _a2; - return (_a2 = scrollableContainerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - }, [scrollableContainerRef]); - return import_react308.default.createElement( - import_react308.default.Fragment, - null, - import_react308.default.createElement( - focus_lock_default, - { className: styles_css_default90["focus-lock"], autoFocus: true }, - import_react308.default.createElement( - "div", - { ref: scrollableContainerRef, className: styles_css_default90.dropdown, tabIndex: 0, role: "dialog", "aria-modal": "true", "aria-label": i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel, "aria-labelledby": ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabelledby, "aria-describedby": ariaDescribedby !== null && ariaDescribedby !== void 0 ? ariaDescribedby : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaDescribedby }, - import_react308.default.createElement( - "div", - { className: clsx_m_default(styles_css_default90["dropdown-content"], { - [styles_css_default90["one-grid"]]: isSingleGrid - }) }, - import_react308.default.createElement( - InternalSpaceBetween, - { size: "l" }, - import_react308.default.createElement( - InternalBox, - { padding: { top: "m", horizontal: "l" } }, - import_react308.default.createElement( - InternalSpaceBetween, - { direction: "vertical", size: "s" }, - rangeSelectorMode === "default" && import_react308.default.createElement(ModeSwitcher, { mode: rangeSelectionMode, onChange: (mode) => { - setRangeSelectionMode(mode); - setApplyClicked(false); - setValidationResult(VALID_RANGE); - }, i18nStrings }), - rangeSelectionMode === "absolute" && import_react308.default.createElement(DateRangePickerCalendar, { value: selectedAbsoluteRange, setValue: setSelectedAbsoluteRange, locale: locale2, startOfWeek: startOfWeek2, isDateEnabled, i18nStrings, dateOnly, timeInputFormat, customAbsoluteRangeControl }), - rangeSelectionMode === "relative" && import_react308.default.createElement(RelativeRangePicker, { isSingleGrid, options: relativeOptions, dateOnly, initialSelection: selectedRelativeRange, onChange: (range3) => setSelectedRelativeRange(range3), i18nStrings }) - ), - import_react308.default.createElement(InternalBox, { className: styles_css_default90["validation-section"], margin: !validationResult.valid ? { top: "s" } : void 0 }, !validationResult.valid && import_react308.default.createElement( - import_react308.default.Fragment, - null, - import_react308.default.createElement( - internal_default3, - { type: "error", statusIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel) }, - import_react308.default.createElement("span", { className: styles_css_default90["validation-error"] }, validationResult.errorMessage) - ), - import_react308.default.createElement(live_region_default, null, validationResult.errorMessage) - )) - ), - import_react308.default.createElement( - "div", - { className: clsx_m_default(styles_css_default90.footer, { - [styles_css_default90["one-grid"]]: isSingleGrid, - [styles_css_default90["has-clear-button"]]: showClearButton - }) }, - showClearButton && import_react308.default.createElement( - "div", - { className: styles_css_default90["footer-button-wrapper"] }, - import_react308.default.createElement(InternalButton, { onClick: onClear, className: styles_css_default90["clear-button"], variant: "link", formAction: "none" }, i18n("i18nStrings.clearButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearButtonLabel)) - ), - import_react308.default.createElement( - "div", - { className: styles_css_default90["footer-button-wrapper"] }, - import_react308.default.createElement( - InternalSpaceBetween, - { size: "xs", direction: "horizontal" }, - import_react308.default.createElement(InternalButton, { onClick: closeDropdown, className: styles_css_default90["cancel-button"], variant: "link", formAction: "none" }, i18n("i18nStrings.cancelButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cancelButtonLabel)), - import_react308.default.createElement(InternalButton, { onClick: onApply, className: styles_css_default90["apply-button"], ref: applyButtonRef, formAction: "none" }, i18n("i18nStrings.applyButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.applyButtonLabel)) - ) - ) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/date-range-picker/index.js -function renderDateRange({ locale: locale2, range: range3, placeholder = "", formatRelativeRange, absoluteFormat, hideTimeOffset, timeOffset }) { - var _a2; - if (!range3) { - return import_react309.default.createElement("span", { className: styles_css_default90["label-text"], "aria-disabled": true }, placeholder); - } - const formatted = range3.type === "relative" ? (_a2 = formatRelativeRange === null || formatRelativeRange === void 0 ? void 0 : formatRelativeRange(range3)) !== null && _a2 !== void 0 ? _a2 : "" : import_react309.default.createElement(BreakSpaces, { text: formatDateRange({ - startDate: range3.startDate, - endDate: range3.endDate, - timeOffset, - hideTimeOffset, - format: absoluteFormat, - locale: locale2 - }) }); - return import_react309.default.createElement(InternalBox, { fontWeight: "normal", display: "inline", color: "inherit", variant: "span" }, formatted); -} -function BreakSpaces({ text }) { - const tokens = text.split(/( )/); - return import_react309.default.createElement(import_react309.default.Fragment, null, tokens.map((token, index) => import_react309.default.createElement( - import_react309.default.Fragment, - { key: index }, - token.length > 1 ? import_react309.default.createElement("span", { className: styles_css_default90["label-token-nowrap"] }, token) : token, - token === " " && import_react309.default.createElement("wbr", null) - ))); -} -function isDateOnly(value) { - if (!value || value.type !== "absolute") { - return false; - } - return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate); -} -var DateRangePicker = import_react309.default.forwardRef((_a2, ref) => { - var _b, _c; - var { locale: locale2 = "", startOfWeek: startOfWeek2, isDateEnabled = () => true, value, placeholder, readOnly = false, disabled = false, onChange, onBlur, onFocus, relativeOptions = [], i18nStrings, isValidRange = () => ({ valid: true }), showClearButton = true, dateOnly = false, timeOffset, getTimeOffset, timeInputFormat = "hh:mm:ss", expandToViewport = false, rangeSelectorMode = "default", customAbsoluteRangeControl, absoluteFormat = "iso", hideTimeOffset } = _a2, rest = __rest(_a2, ["locale", "startOfWeek", "isDateEnabled", "value", "placeholder", "readOnly", "disabled", "onChange", "onBlur", "onFocus", "relativeOptions", "i18nStrings", "isValidRange", "showClearButton", "dateOnly", "timeOffset", "getTimeOffset", "timeInputFormat", "expandToViewport", "rangeSelectorMode", "customAbsoluteRangeControl", "absoluteFormat", "hideTimeOffset"]); - const { __internalRootRef } = useBaseComponent("DateRangePicker", { - props: { - absoluteFormat, - dateOnly, - expandToViewport, - rangeSelectorMode, - readOnly, - showClearButton, - timeInputFormat - } - }); - checkControlled("DateRangePicker", "value", value, "onChange", onChange); - const normalizedTimeOffset = normalizeTimeOffset(value, getTimeOffset, timeOffset); - value = isDateOnly(value) ? value : shiftTimeOffset(value, normalizedTimeOffset); - const baseProps = getBaseProps(rest); - const { invalid, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext(Object.assign({ ariaLabelledby: (_b = rest.ariaLabelledby) !== null && _b !== void 0 ? _b : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabelledby, ariaDescribedby: (_c = rest.ariaDescribedby) !== null && _c !== void 0 ? _c : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaDescribedby }, rest)); - const isSingleGrid = useMobile(); - const triggerRef = (0, import_react309.useRef)(null); - useForwardFocus(ref, triggerRef); - const rootRef = (0, import_react309.useRef)(null); - const dropdownId = useUniqueId("date-range-picker-dropdown"); - const triggerContentId = useUniqueId("date-range-picker-trigger"); - useFocusTracker({ rootRef, onBlur, onFocus }); - const [isDropDownOpen, setIsDropDownOpen] = (0, import_react309.useState)(false); - const normalizedLocale = normalizeLocale("DateRangePicker", locale2); - const closeDropdown = (focusTrigger = false) => { - var _a3; - setIsDropDownOpen(false); - if (focusTrigger) { - (_a3 = triggerRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }; - const onWrapperKeyDownHandler = (event) => { - if (event.keyCode === KeyCode.escape) { - if (isDropDownOpen) { - event.stopPropagation(); - } - closeDropdown(true); - } - }; - const onClear = () => { - fireNonCancelableEvent(onChange, { value: null }); - }; - const onApply = (newValue) => { - const validationResult = isValidRange(newValue); - if ((validationResult === null || validationResult === void 0 ? void 0 : validationResult.valid) === false) { - return validationResult; - } - if (isDevelopment2) { - if ((newValue === null || newValue === void 0 ? void 0 : newValue.type) === "absolute") { - const [startDateWithoutTime] = newValue.startDate.split("T"); - const [endDateWithoutTime] = newValue.endDate.split("T"); - if (!startDateWithoutTime || !endDateWithoutTime) { - warnOnce("DateRangePicker", "You have provided an `isValidRange` prop that did not catch a missing start or end date."); - } - } - } - fireNonCancelableEvent(onChange, { - value: formatValue(newValue, { - dateOnly, - timeOffset: normalizeTimeOffset(newValue, getTimeOffset, timeOffset) - }) - }); - return validationResult || { valid: true }; - }; - const prevDateOnly = usePrevious(dateOnly); - (0, import_react309.useEffect)(() => { - if (prevDateOnly !== void 0 && prevDateOnly !== dateOnly) { - warnOnce("DateRangePicker", `The provided \`dateOnly\` flag has been changed from "${prevDateOnly}" to "${dateOnly}" which can lead to unexpected value format. Consider using separate components.`); - } - }, [prevDateOnly, dateOnly]); - if (value && value.type !== "absolute" && value.type !== "relative") { - warnOnce("DateRangePicker", "You provided an invalid value. Reverting back to default."); - value = null; - } - if ((value === null || value === void 0 ? void 0 : value.type) === "absolute" && rangeSelectorMode === "relative-only" || (value === null || value === void 0 ? void 0 : value.type) === "relative" && rangeSelectorMode === "absolute-only") { - warnOnce("DateRangePicker", "The provided value does not correspond to the current range selector mode. Reverting back to default."); - value = null; - } - const i18n = useInternalI18n("date-range-picker"); - const formatRelativeRange = i18n("i18nStrings.formatRelativeRange", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatRelativeRange, (format3) => ({ amount, unit: unit2 }) => format3({ amount, unit: unit2 })); - if (isDevelopment2) { - if (!formatRelativeRange && rangeSelectorMode !== "absolute-only") { - warnOnce("DateRangePicker", "A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered."); - } - } - const formattedDate = renderDateRange({ - locale: normalizedLocale, - range: value, - placeholder, - formatRelativeRange, - absoluteFormat, - hideTimeOffset, - timeOffset: normalizedTimeOffset - }); - const trigger2 = import_react309.default.createElement( - "div", - { className: styles_css_default90["trigger-wrapper"] }, - import_react309.default.createElement( - button_trigger_default, - { ref: triggerRef, id: controlId, invalid, ariaLabelledby: joinStrings(ariaLabelledby, triggerContentId), ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel, ariaDescribedby, className: clsx_m_default(styles_css_default90.label, { - [styles_css_default90["label-enabled"]]: !readOnly && !disabled - }), hideCaret: true, onClick: () => { - if (!readOnly && !disabled) { - setIsDropDownOpen(true); - } - }, disabled, readOnly, ariaHasPopup: "dialog" }, - import_react309.default.createElement( - "span", - { className: styles_css_default90["trigger-flexbox"] }, - import_react309.default.createElement( - "span", - { className: styles_css_default90["icon-wrapper"] }, - import_react309.default.createElement(internal_default, { name: "calendar", variant: disabled || readOnly ? "disabled" : "normal" }) - ), - import_react309.default.createElement("span", { id: triggerContentId }, formattedDate) - ) - ) - ); - const mergedRef = useMergeRefs(rootRef, __internalRootRef); - return import_react309.default.createElement( - "div", - Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(baseProps.className, styles_css_default90.root, absoluteFormat === "long-localized" && !dateOnly && styles_css_default90.wide), onKeyDown: onWrapperKeyDownHandler }), - import_react309.default.createElement( - dropdown_default, - { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: () => closeDropdown(), trigger: trigger2, stretchToTriggerWidth: false, expandToViewport, dropdownId }, - import_react309.default.createElement(reset_contexts_for_modal_default, null, isDropDownOpen && import_react309.default.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek2, locale: normalizedLocale, isSingleGrid, onDropdownClose: () => closeDropdown(true), value, showClearButton, isDateEnabled, i18nStrings, onClear, onApply, relativeOptions, isValidRange, dateOnly, timeInputFormat, rangeSelectorMode, ariaLabelledby, ariaDescribedby, customAbsoluteRangeControl })) - ) - ); -}); -applyDisplayName(DateRangePicker, "DateRangePicker"); -var date_range_picker_default = DateRangePicker; - -// node_modules/@cloudscape-design/components/drawer/index.js -var import_react310 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/drawer/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/drawer/styles.scoped.css"; -var styles_css_default95 = { - "drawer": "awsui_drawer_1sxt8_1oeyq_100", - "header": "awsui_header_1sxt8_1oeyq_140", - "test-utils-drawer-content": "awsui_test-utils-drawer-content_1sxt8_1oeyq_169" -}; - -// node_modules/@cloudscape-design/components/drawer/index.js -function Drawer2(_a2) { - var { header, children: children2, loading, i18nStrings } = _a2, restProps = __rest(_a2, ["header", "children", "loading", "i18nStrings"]); - const { __internalRootRef } = useBaseComponent("Drawer"); - const baseProps = getBaseProps(restProps); - const i18n = useInternalI18n("drawer"); - const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx_m_default(baseProps.className, styles_css_default95.drawer) }); - return loading ? import_react310.default.createElement( - "div", - Object.assign({}, containerProps, { ref: __internalRootRef }), - import_react310.default.createElement( - StatusIndicator, - { type: "loading" }, - import_react310.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loadingText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingText)) - ) - ) : import_react310.default.createElement( - "div", - Object.assign({}, containerProps, { ref: __internalRootRef }), - header && import_react310.default.createElement("div", { className: clsx_m_default(styles_css_default95.header) }, header), - import_react310.default.createElement("div", { className: clsx_m_default(styles_css_default95["test-utils-drawer-content"]) }, children2) - ); -} -applyDisplayName(Drawer2, "Drawer"); - -// node_modules/@cloudscape-design/components/expandable-section/index.js -var import_react311 = __toESM(require_react()); -function ExpandableSection(_a2) { - var { variant = "default" } = _a2, props2 = __rest(_a2, ["variant"]); - const baseComponentProps = useBaseComponent("ExpandableSection", { - props: { - disableContentPaddings: props2.disableContentPaddings, - headingTagOverride: props2.headingTagOverride, - variant - } - }); - return import_react311.default.createElement(InternalExpandableSection, Object.assign({ variant }, props2, baseComponentProps)); -} -applyDisplayName(ExpandableSection, "ExpandableSection"); - -// node_modules/@cloudscape-design/components/file-upload/index.js -var import_react317 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/file-upload/internal.js -var import_react316 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/file-upload/file-option/index.js -var import_react313 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/file-upload/file-option/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/file-upload/file-option/styles.scoped.css"; -var styles_css_default96 = { - "file-option-name": "awsui_file-option-name_ezgb4_136jz_9", - "file-option-size": "awsui_file-option-size_ezgb4_136jz_10", - "file-option-last-modified": "awsui_file-option-last-modified_ezgb4_136jz_11", - "file-option-thumbnail": "awsui_file-option-thumbnail_ezgb4_136jz_12", - "file-option": "awsui_file-option_ezgb4_136jz_9", - "file-option-thumbnail-image": "awsui_file-option-thumbnail-image_ezgb4_136jz_28", - "file-option-metadata": "awsui_file-option-metadata_ezgb4_136jz_33" -}; - -// node_modules/@cloudscape-design/components/file-upload/default-formatters.js -var KB = 1e3; -var MB = Math.pow(1e3, 2); -var GB = Math.pow(1e3, 3); -var TB = Math.pow(1e3, 4); -function formatFileSize(size2) { - if (size2 < MB) { - return `${(size2 / KB).toFixed(2)} KB`; - } - if (size2 < GB) { - return `${(size2 / MB).toFixed(2)} MB`; - } - if (size2 < TB) { - return `${(size2 / GB).toFixed(2)} GB`; - } - return `${(size2 / TB).toFixed(2)} TB`; -} -function formatFileLastModified(date2) { - return formatDateTime(date2); -} - -// node_modules/@cloudscape-design/components/file-upload/file-option/thumbnail.js -var import_react312 = __toESM(require_react()); -function FileOptionThumbnail({ file }) { - const [imageSrc, setImageSrc] = (0, import_react312.useState)(""); - (0, import_react312.useEffect)(() => { - if (URL.createObjectURL) { - const src = URL.createObjectURL(file); - setImageSrc(src); - return () => { - URL.revokeObjectURL(src); - }; - } - }, [file]); - return import_react312.default.createElement( - "div", - { className: styles_css_default96["file-option-thumbnail"], "aria-hidden": true }, - import_react312.default.createElement("img", { className: styles_css_default96["file-option-thumbnail-image"], alt: file.name, src: imageSrc }) - ); -} - -// node_modules/@cloudscape-design/components/file-upload/file-option/index.js -function FileOption({ file, metadata, i18nStrings }) { - var _a2, _b; - const isImage = file.type.startsWith("image/"); - const formatFileSize2 = (_a2 = i18nStrings.formatFileSize) !== null && _a2 !== void 0 ? _a2 : formatFileSize; - const formatFileLastModified2 = (_b = i18nStrings.formatFileLastModified) !== null && _b !== void 0 ? _b : formatFileLastModified; - return import_react313.default.createElement( - InternalBox, - { className: styles_css_default96["file-option"] }, - metadata.showFileThumbnail && isImage && import_react313.default.createElement(FileOptionThumbnail, { file }), - import_react313.default.createElement( - "div", - { className: styles_css_default96["file-option-metadata"] }, - import_react313.default.createElement( - InternalSpaceBetween, - { direction: "vertical", size: "xxxs" }, - import_react313.default.createElement(InternalBox, { className: styles_css_default96["file-option-name"] }, file.name), - metadata.showFileSize && file.size ? import_react313.default.createElement(InternalBox, { fontSize: "body-s", color: "text-body-secondary", className: styles_css_default96["file-option-size"] }, formatFileSize2(file.size)) : null, - metadata.showFileLastModified && file.lastModified ? import_react313.default.createElement(InternalBox, { fontSize: "body-s", color: "text-body-secondary", className: styles_css_default96["file-option-last-modified"] }, formatFileLastModified2(new Date(file.lastModified))) : null - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/file-upload/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/file-upload/styles.scoped.css"; -var styles_css_default97 = { - "root": "awsui_root_1ubbm_1iir1_9", - "hints": "awsui_hints_1ubbm_1iir1_10" -}; - -// node_modules/@cloudscape-design/components/file-upload/dropzone/index.js -var import_react314 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/file-upload/dropzone/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/file-upload/dropzone/styles.scoped.css"; -var styles_css_default98 = { - "dropzone": "awsui_dropzone_1fham_1gzts_99", - "dropzone-hovered": "awsui_dropzone-hovered_1fham_1gzts_115" -}; - -// node_modules/@cloudscape-design/components/file-upload/dropzone/index.js -function useDropzoneVisible(multiple) { - const [isDropzoneVisible, setDropzoneVisible] = (0, import_react314.useState)(false); - (0, import_react314.useEffect)(() => { - let dragTimer = null; - const onDocumentDragOver = (event) => { - var _a2, _b; - event.preventDefault(); - let files = 0; - for (let item = 0; item < (((_a2 = event.dataTransfer) === null || _a2 === void 0 ? void 0 : _a2.items.length) || 0); item++) { - if (((_b = event.dataTransfer) === null || _b === void 0 ? void 0 : _b.items[item].kind) === "file") { - files++; - } - } - if (files > 0 && (multiple || files === 1)) { - setDropzoneVisible(true); - dragTimer && clearTimeout(dragTimer); - } - }; - const onDocumentDragLeave = (event) => { - event.preventDefault(); - dragTimer = setTimeout(() => setDropzoneVisible(false), 25); - }; - const onDocumentDrop = (event) => { - event.preventDefault(); - dragTimer = setTimeout(() => setDropzoneVisible(false), 25); - }; - document.addEventListener("dragover", onDocumentDragOver, false); - document.addEventListener("dragleave", onDocumentDragLeave, false); - document.addEventListener("drop", onDocumentDrop, false); - return () => { - dragTimer && clearTimeout(dragTimer); - document.removeEventListener("dragover", onDocumentDragOver); - document.removeEventListener("dragleave", onDocumentDragLeave); - document.removeEventListener("drop", onDocumentDrop); - }; - }, [multiple]); - return isDropzoneVisible; -} -function Dropzone({ onChange, children: children2 }) { - const [isDropzoneHovered, setDropzoneHovered] = (0, import_react314.useState)(false); - const onDragOver = (event) => { - event.preventDefault(); - if (event.dataTransfer) { - setDropzoneHovered(true); - event.dataTransfer.dropEffect = "copy"; - } - }; - const onDragLeave = (event) => { - event.preventDefault(); - setDropzoneHovered(false); - if (event.dataTransfer) { - event.dataTransfer.dropEffect = "none"; - } - }; - const onDrop = (event) => { - event.preventDefault(); - setDropzoneHovered(false); - onChange(Array.from(event.dataTransfer.files)); - }; - return import_react314.default.createElement( - "div", - { className: clsx_m_default(styles_css_default98.dropzone, isDropzoneHovered && styles_css_default98["dropzone-hovered"]), onDragOver, onDragLeave, onDrop }, - import_react314.default.createElement(internal_default, { name: "upload" }), - import_react314.default.createElement("span", null, children2) - ); -} - -// node_modules/@cloudscape-design/components/file-upload/file-input/index.js -var import_react315 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/file-upload/file-input/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/file-upload/file-input/styles.scoped.css"; -var styles_css_default99 = { - "upload-button": "awsui_upload-button_4xu1k_lg6er_99", - "upload-input": "awsui_upload-input_4xu1k_lg6er_100", - "file-input-container": "awsui_file-input-container_4xu1k_lg6er_104", - "force-focus-outline": "awsui_force-focus-outline_4xu1k_lg6er_113" -}; - -// node_modules/@cloudscape-design/components/file-upload/file-input/index.js -var file_input_default = import_react315.default.forwardRef(FileInput); -function FileInput(_a2, ref) { - var _b; - var { accept, ariaRequired, multiple, value, onChange, children: children2 } = _a2, restProps = __rest(_a2, ["accept", "ariaRequired", "multiple", "value", "onChange", "children"]); - const uploadInputRef = (0, import_react315.useRef)(null); - const uploadButtonLabelId = useUniqueId("upload-button-label"); - const formFieldContext = useFormFieldContext(restProps); - const selfControlId = useUniqueId("upload-input"); - const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId; - useForwardFocus(ref, uploadInputRef); - const [isFocused, setIsFocused] = (0, import_react315.useState)(false); - const onUploadButtonClick = () => { - var _a3; - return (_a3 = uploadInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.click(); - }; - const onUploadInputFocus = () => setIsFocused(true); - const onUploadInputBlur = () => setIsFocused(false); - const onUploadInputChange = ({ target }) => { - onChange(target.files ? Array.from(target.files) : []); - }; - const nativeAttributes = { - "aria-labelledby": joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId), - "aria-describedby": formFieldContext.ariaDescribedby - }; - if (formFieldContext.invalid) { - nativeAttributes["aria-invalid"] = true; - } - if (ariaRequired) { - nativeAttributes["aria-required"] = true; - } - (0, import_react315.useEffect)(() => { - if (window.DataTransfer) { - const dataTransfer = new DataTransfer(); - for (const file of value) { - dataTransfer.items.add(file); - } - uploadInputRef.current.files = dataTransfer.files; - } - if (uploadInputRef.current) { - uploadInputRef.current.value = ""; - } - }, [value]); - return import_react315.default.createElement( - "div", - { className: styles_css_default99["file-input-container"] }, - import_react315.default.createElement("input", Object.assign({ id: controlId, ref: uploadInputRef, type: "file", hidden: false, multiple, accept, onChange: onUploadInputChange, onFocus: onUploadInputFocus, onBlur: onUploadInputBlur, className: styles_css_default99["upload-input"] }, nativeAttributes)), - import_react315.default.createElement(internal_default2, { iconName: "upload", formAction: "none", onClick: onUploadButtonClick, className: clsx_m_default(styles_css_default99["upload-button"], isFocused && styles_css_default99["force-focus-outline"]), __nativeAttributes: { tabIndex: -1, "aria-hidden": true } }, children2), - import_react315.default.createElement(ScreenreaderOnly, { id: uploadButtonLabelId }, children2) - ); -} - -// node_modules/@cloudscape-design/components/file-upload/internal.js -var internal_default18 = import_react316.default.forwardRef(InternalFileUpload); -function InternalFileUpload(_a2, externalRef) { - var _b; - var { accept, ariaRequired, multiple = false, onChange, value, tokenLimit, showFileSize, showFileLastModified, showFileThumbnail, i18nStrings, __internalRootRef = null, constraintText, errorText, fileErrors } = _a2, restProps = __rest(_a2, ["accept", "ariaRequired", "multiple", "onChange", "value", "tokenLimit", "showFileSize", "showFileLastModified", "showFileThumbnail", "i18nStrings", "__internalRootRef", "constraintText", "errorText", "fileErrors"]); - const baseProps = getBaseProps(restProps); - const metadata = { showFileSize, showFileLastModified, showFileThumbnail }; - const errorId = useUniqueId("error-"); - const constraintTextId = useUniqueId("constraint-text-"); - const fileInputRef = (0, import_react316.useRef)(null); - const ref = useMergeRefs(fileInputRef, externalRef); - const [removedFileIndex, setRemovedFileIndex] = (0, import_react316.useState)(null); - checkControlled("FileUpload", "value", value, "onChange", onChange); - if (!multiple && value.length > 1) { - warnOnce("FileUpload", "Value must be an array of size 0 or 1 when `multiple=false`."); - } - const handleFilesChange = (newFiles) => { - const newValue = multiple ? [...value, ...newFiles] : newFiles[0] ? newFiles : [...value]; - fireNonCancelableEvent(onChange, { value: newValue }); - }; - const onFileRemove = (removeFileIndex) => { - var _a3; - const newValue = value.filter((_, fileIndex) => fileIndex !== removeFileIndex); - fireNonCancelableEvent(onChange, { value: newValue }); - setRemovedFileIndex(removeFileIndex); - if (value.length === 1) { - (_a3 = fileInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }; - const isDropzoneVisible = useDropzoneVisible(multiple); - const formFieldContext = useFormFieldContext(restProps); - const ariaDescribedBy = joinStrings((_b = restProps.ariaDescribedby) !== null && _b !== void 0 ? _b : formFieldContext.ariaDescribedby, errorText ? errorId : void 0, constraintText ? constraintTextId : void 0); - const hasError = Boolean(errorText || (fileErrors === null || fileErrors === void 0 ? void 0 : fileErrors.filter(Boolean).length)); - const invalid = restProps.invalid || formFieldContext.invalid || hasError; - return import_react316.default.createElement( - InternalSpaceBetween, - Object.assign({}, baseProps, { size: "xs", className: clsx_m_default(baseProps.className, styles_css_default97.root), __internalRootRef }), - import_react316.default.createElement( - InternalBox, - null, - isDropzoneVisible ? import_react316.default.createElement(Dropzone, { onChange: handleFilesChange }, i18nStrings.dropzoneText(multiple)) : import_react316.default.createElement(file_input_default, Object.assign({ ref, accept, ariaRequired, multiple, onChange: handleFilesChange, value }, restProps, { ariaDescribedby: ariaDescribedBy, invalid }), i18nStrings.uploadButtonText(multiple)), - (constraintText || errorText) && import_react316.default.createElement( - "div", - { className: styles_css_default97.hints }, - errorText && import_react316.default.createElement(FormFieldError, { id: errorId, errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, errorText), - constraintText && import_react316.default.createElement(ConstraintText, { id: constraintTextId, hasError: !!errorText }, constraintText) - ) - ), - !multiple && value.length > 0 ? import_react316.default.createElement( - InternalBox, - null, - import_react316.default.createElement( - Token, - { ariaLabel: value[0].name, dismissLabel: i18nStrings.removeFileAriaLabel(0), onDismiss: () => onFileRemove(0), errorText: fileErrors === null || fileErrors === void 0 ? void 0 : fileErrors[0], errorIconAriaLabel: i18nStrings.errorIconAriaLabel, "data-index": 0 }, - import_react316.default.createElement(FileOption, { file: value[0], metadata, i18nStrings }) - ) - ) : null, - multiple && value.length > 0 ? import_react316.default.createElement( - InternalBox, - null, - import_react316.default.createElement(TokenList, { alignment: "vertical", items: value, renderItem: (file, fileIndex) => import_react316.default.createElement( - Token, - { ariaLabel: file.name, dismissLabel: i18nStrings.removeFileAriaLabel(fileIndex), onDismiss: () => onFileRemove(fileIndex), errorText: fileErrors === null || fileErrors === void 0 ? void 0 : fileErrors[fileIndex], errorIconAriaLabel: i18nStrings.errorIconAriaLabel, "data-index": fileIndex }, - import_react316.default.createElement(FileOption, { file, metadata, i18nStrings }) - ), limit: tokenLimit, i18nStrings: { - limitShowFewer: i18nStrings.limitShowFewer, - limitShowMore: i18nStrings.limitShowMore - }, moveFocusNextToIndex: removedFileIndex }) - ) : null - ); -} - -// node_modules/@cloudscape-design/components/file-upload/index.js -var FileUpload = import_react317.default.forwardRef((_a2, ref) => { - var { multiple, showFileSize, showFileLastModified, showFileThumbnail } = _a2, restProps = __rest(_a2, ["multiple", "showFileSize", "showFileLastModified", "showFileThumbnail"]); - const baseComponentProps = useBaseComponent("FileUpload", { - props: { multiple, showFileLastModified, showFileSize, showFileThumbnail, tokenLimit: restProps.tokenLimit } - }); - const externalProps = getExternalProps(restProps); - return import_react317.default.createElement(internal_default18, Object.assign({ ref, multiple, showFileSize, showFileLastModified, showFileThumbnail }, externalProps, baseComponentProps)); -}); -applyDisplayName(FileUpload, "FileUpload"); -var file_upload_default = FileUpload; - -// node_modules/@cloudscape-design/components/flashbar/index.js -var import_react322 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/flashbar/collapsible-flashbar.js -var import_react320 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/flashbar/flash.js -var import_react318 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/flashbar/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/flashbar/styles.scoped.css"; -var styles_css_default100 = { - "flash-with-motion": "awsui_flash-with-motion_1q84n_pgrle_99", - "enter": "awsui_enter_1q84n_pgrle_99", - "flash-body": "awsui_flash-body_1q84n_pgrle_113", - "flash-message": "awsui_flash-message_1q84n_pgrle_113", - "flash-header": "awsui_flash-header_1q84n_pgrle_113", - "flash-content": "awsui_flash-content_1q84n_pgrle_114", - "action-button-wrapper": "awsui_action-button-wrapper_1q84n_pgrle_115", - "dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_pgrle_116", - "flash-icon": "awsui_flash-icon_1q84n_pgrle_139", - "entering": "awsui_entering_1q84n_pgrle_152", - "entered": "awsui_entered_1q84n_pgrle_173", - "exiting": "awsui_exiting_1q84n_pgrle_278", - "stack": "awsui_stack_1q84n_pgrle_300", - "animation-running": "awsui_animation-running_1q84n_pgrle_300", - "item": "awsui_item_1q84n_pgrle_300", - "flash-list-item": "awsui_flash-list-item_1q84n_pgrle_301", - "notification-bar": "awsui_notification-bar_1q84n_pgrle_302", - "collapsed": "awsui_collapsed_1q84n_pgrle_322", - "animation-ready": "awsui_animation-ready_1q84n_pgrle_322", - "expanded-only": "awsui_expanded-only_1q84n_pgrle_322", - "expanded": "awsui_expanded_1q84n_pgrle_322", - "flash": "awsui_flash_1q84n_pgrle_99", - "collapsible": "awsui_collapsible_1q84n_pgrle_386", - "short-list": "awsui_short-list_1q84n_pgrle_392", - "visual-refresh": "awsui_visual-refresh_1q84n_pgrle_392", - "status": "awsui_status_1q84n_pgrle_605", - "header": "awsui_header_1q84n_pgrle_605", - "item-count": "awsui_item-count_1q84n_pgrle_606", - "button": "awsui_button_1q84n_pgrle_607", - "type-count": "awsui_type-count_1q84n_pgrle_640", - "count-number": "awsui_count-number_1q84n_pgrle_640", - "icon": "awsui_icon_1q84n_pgrle_674", - "floating": "awsui_floating_1q84n_pgrle_715", - "flashbar": "awsui_flashbar_1q84n_pgrle_723", - "flash-refresh": "awsui_flash-refresh_1q84n_pgrle_798", - "flash-list": "awsui_flash-list_1q84n_pgrle_301", - "flash-focus-container": "awsui_flash-focus-container_1q84n_pgrle_819", - "flash-text": "awsui_flash-text_1q84n_pgrle_849", - "dismiss-button": "awsui_dismiss-button_1q84n_pgrle_116", - "breakpoint-default": "awsui_breakpoint-default_1q84n_pgrle_891", - "action-button": "awsui_action-button_1q84n_pgrle_115", - "action-slot": "awsui_action-slot_1q84n_pgrle_901", - "flash-type-success": "awsui_flash-type-success_1q84n_pgrle_905", - "flash-type-error": "awsui_flash-type-error_1q84n_pgrle_909", - "flash-type-info": "awsui_flash-type-info_1q84n_pgrle_913", - "flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_pgrle_914", - "flash-type-warning": "awsui_flash-type-warning_1q84n_pgrle_918" -}; - -// node_modules/@cloudscape-design/components/flashbar/utils.js -var FOCUS_THROTTLE_DELAY = 2e3; -var typesToColors = { - error: "red", - info: "blue", - "in-progress": "blue", - success: "green", - warning: "yellow" -}; -function getColorFromType(type) { - const defaultColor = "blue"; - return type ? typesToColors[type] || defaultColor : defaultColor; -} -function getItemType(item) { - if (item.loading) { - return "in-progress"; - } else { - return item.type || "info"; - } -} -function getItemColor(item) { - return getColorFromType(getItemType(item)); -} -function getVisibleCollapsedItems(items, desiredLength) { - const itemsOnTop = []; - const itemsToPromote = []; - const addedColors = /* @__PURE__ */ new Set(); - const allPossibleColors = Object.keys(typesToColors).length; - const finalLength = Math.min(items.length, desiredLength); - for (let i = 0; i < items.length; i++) { - const item = items[i]; - const color2 = getItemColor(item); - const isColorRepeated = addedColors.has(color2); - if (i < finalLength) { - itemsOnTop.push({ item: Object.assign(Object.assign({}, item), { expandedIndex: i }), isColorRepeated }); - } else { - if (addedColors.size === allPossibleColors) { - break; - } else if (!isColorRepeated) { - itemsToPromote.push(Object.assign(Object.assign({}, item), { expandedIndex: i })); - } - } - addedColors.add(color2); - } - const reversedInitialSelection = []; - let slotsReservedForPromotions = 0; - for (let j = itemsOnTop.length - 1; j >= 0; j--) { - const item = itemsOnTop[j]; - if (item.isColorRepeated && slotsReservedForPromotions < itemsToPromote.length) { - slotsReservedForPromotions += 1; - } else { - reversedInitialSelection.push(item.item); - } - } - const selectedItems = reversedInitialSelection.reverse(); - for (let k2 = 0; selectedItems.length < desiredLength; k2++) { - selectedItems.push(itemsToPromote[k2]); - } - return selectedItems; -} -function getFlashTypeCount(items) { - const count = { error: 0, info: 0, "in-progress": 0, success: 0, warning: 0 }; - for (const item of items) { - const type = getItemType(item); - count[type] += 1; - } - return count; -} -var counterTypes = [ - { type: "error", labelName: "errorIconAriaLabel", iconName: "status-negative" }, - { type: "warning", labelName: "warningIconAriaLabel", iconName: "status-warning" }, - { type: "success", labelName: "successIconAriaLabel", iconName: "status-positive" }, - { type: "info", labelName: "infoIconAriaLabel", iconName: "status-info" }, - { type: "in-progress", labelName: "inProgressIconAriaLabel", iconName: "status-in-progress" } -]; - -// node_modules/@cloudscape-design/components/flashbar/internal/analytics.js -var metrics = new Metrics(PACKAGE_SOURCE, PACKAGE_VERSION); -var eventContext = "csa_flashbar"; -var sendRenderMetric = (items) => { - const countByType = getFlashTypeCount(items); - metrics.sendPanoramaMetric({ - eventContext, - eventType: "render", - eventValue: items.length.toString(), - eventDetail: countByType - }); -}; -var sendToggleMetric = (itemsCount, expanded) => { - metrics.sendPanoramaMetric({ - eventContext, - eventType: expanded ? "expand" : "collapse", - eventValue: itemsCount.toString() - }); -}; -var sendDismissMetric = (itemType) => { - metrics.sendPanoramaMetric({ - eventContext, - eventType: "dismiss", - eventValue: itemType - }); -}; - -// node_modules/@cloudscape-design/components/flashbar/flash.js -var ICON_TYPES = { - success: "status-positive", - warning: "status-warning", - info: "status-info", - error: "status-negative", - "in-progress": "status-in-progress" -}; -var useDiscoveredAction2 = createUseDiscoveredAction(awsuiPluginsInternal.flashbar.onActionRegistered); -function dismissButton(dismissLabel, onDismiss) { - return import_react318.default.createElement( - "div", - { className: styles_css_default100["dismiss-button-wrapper"] }, - import_react318.default.createElement(InternalButton, { onClick: onDismiss, className: styles_css_default100["dismiss-button"], variant: "flashbar-icon", iconName: "close", formAction: "none", ariaLabel: dismissLabel }) - ); -} -var focusFlashById = throttle((element, itemId) => { - var _a2; - const selector = `[data-itemid="${CSS.escape(itemId)}"] .${styles_css_default100["flash-focus-container"]}`; - (_a2 = element === null || element === void 0 ? void 0 : element.querySelector(selector)) === null || _a2 === void 0 ? void 0 : _a2.focus(); -}, FOCUS_THROTTLE_DELAY, { trailing: false }); -var Flash = import_react318.default.forwardRef((_a2, ref) => { - var { id, header, content, dismissible, dismissLabel, loading, action, buttonText, onButtonClick, onDismiss, className: className2, transitionState, ariaRole, i18nStrings, type = "info" } = _a2, props2 = __rest(_a2, ["id", "header", "content", "dismissible", "dismissLabel", "loading", "action", "buttonText", "onButtonClick", "onDismiss", "className", "transitionState", "ariaRole", "i18nStrings", "type"]); - if (isDevelopment2) { - if (buttonText && !onButtonClick) { - warnOnce("Flashbar", `You provided a \`buttonText\` prop without an \`onButtonClick\` handler. This will render a non-interactive action button.`); - } - if (dismissible && !onDismiss) { - warnOnce("Flashbar", `You have set the \`dismissible\` prop without an \`onDismiss\` handler. This will render a non-interactive dismiss button.`); - } - } - const analyticsMetadata = getAnalyticsMetadataProps(props2); - const elementRef = useComponentMetadata("Flash", PACKAGE_VERSION, Object.assign({}, analyticsMetadata)); - const mergedRef = useMergeRefs(ref, elementRef); - const { discoveredActions, headerRef, contentRef } = useDiscoveredAction2(type); - const iconType = ICON_TYPES[type]; - const icon = loading ? import_react318.default.createElement(InternalSpinner, null) : import_react318.default.createElement(internal_default, { name: iconType }); - const effectiveType = loading ? "info" : type; - const handleDismiss = (event) => { - sendDismissMetric(effectiveType); - onDismiss && onDismiss(event); - }; - const analyticsAttributes = { - [DATA_ATTR_ANALYTICS_FLASHBAR]: effectiveType - }; - const statusIconAriaLabel = props2.statusIconAriaLabel || (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings[`${loading || type === "in-progress" ? "inProgress" : type}IconAriaLabel`]); - return ( - // We're not using "polite" or "assertive" here, just turning default behavior off. - // eslint-disable-next-line @cloudscape-design/prefer-live-region - import_react318.default.createElement( - "div", - Object.assign({ ref: mergedRef, role: ariaRole, "aria-live": ariaRole ? "off" : void 0, "data-itemid": id, className: clsx_m_default(styles_css_default100.flash, styles_css_default100[`flash-type-${effectiveType}`], className2, transitionState && { - [styles_css_default100.enter]: transitionState === "enter", - [styles_css_default100.entering]: transitionState === "entering", - [styles_css_default100.entered]: transitionState === "entered", - [styles_css_default100.exit]: transitionState === "exit", - [styles_css_default100.exiting]: transitionState === "exiting", - [styles_css_default100.exited]: transitionState === "exited" - }, getVisualContextClassname(type === "warning" && !loading ? "flashbar-warning" : "flashbar")) }, analyticsAttributes), - import_react318.default.createElement( - "div", - { className: styles_css_default100["flash-body"] }, - import_react318.default.createElement( - "div", - { className: styles_css_default100["flash-focus-container"], tabIndex: -1 }, - import_react318.default.createElement("div", { className: clsx_m_default(styles_css_default100["flash-icon"], styles_css_default100["flash-text"]), role: "img", "aria-label": statusIconAriaLabel }, icon), - import_react318.default.createElement( - "div", - { className: clsx_m_default(styles_css_default100["flash-message"], styles_css_default100["flash-text"]) }, - import_react318.default.createElement("div", { className: styles_css_default100["flash-header"], ref: headerRef }, header), - import_react318.default.createElement("div", { className: styles_css_default100["flash-content"], ref: contentRef }, content) - ) - ), - import_react318.default.createElement(ActionsWrapper, { className: styles_css_default100["action-button-wrapper"], testUtilClasses: { - actionSlot: styles_css_default100["action-slot"], - actionButton: styles_css_default100["action-button"] - }, action, discoveredActions, buttonText, onButtonClick }) - ), - dismissible && dismissButton(dismissLabel, handleDismiss), - ariaRole === "status" && import_react318.default.createElement(live_region_default, { source: [statusIconAriaLabel, headerRef, contentRef] }) - ) - ); -}); - -// node_modules/@cloudscape-design/components/internal/animate.js -function getDOMRects(elements) { - const rects = {}; - for (const id in elements) { - const element = elements[id]; - if (element) { - rects[id] = element.getBoundingClientRect(); - } - } - return rects; -} -function animate({ oldState, elements, onTransitionsEnd, newElementInitialState }) { - for (const id in elements) { - const element = elements[id]; - const oldRect = oldState[id]; - if (element) { - const newRect = element.getBoundingClientRect(); - const noOpTransform = { scale: 1, x: 0, y: 0 }; - const calculatedInverseTransform = oldRect ? { - scale: oldRect.width / newRect.width, - x: (oldRect.left + oldRect.right) / 2 - (newRect.left + newRect.right) / 2, - y: (oldRect.top + oldRect.bottom) / 2 - (newRect.top + newRect.bottom) / 2 - } : newElementInitialState ? newElementInitialState(newRect) : {}; - const inverseTransform2 = Object.assign(Object.assign({}, noOpTransform), calculatedInverseTransform); - element.style.transitionProperty = "none"; - element.style.transform = `scale(${inverseTransform2.scale}) translate(${inverseTransform2.x}px, ${inverseTransform2.y}px)`; - if (!oldRect) { - element.style.opacity = "0"; - } - } - } - requestAnimationFrame(() => { - const ongoingAnimations = /* @__PURE__ */ new Set(); - for (const id in elements) { - const element = elements[id]; - if (element) { - const oldRect = oldState[id]; - if (oldRect) { - element.style.transitionProperty = `transform`; - element.style.transform = ""; - } else { - element.style.transitionProperty = `transform, opacity`; - element.style.transform = ""; - element.style.opacity = ""; - } - const onTransitionStart = (event) => { - if (event.target === element) { - ongoingAnimations.add(id); - element.removeEventListener("transitionstart", onTransitionStart); - } - }; - const onTransitionEnd = (event) => { - if (event.target === element) { - element.style.transitionProperty = ""; - element.removeEventListener("transitionstart", onTransitionEnd); - if (onTransitionsEnd) { - ongoingAnimations.delete(id); - if (ongoingAnimations.size === 0) { - onTransitionsEnd(); - } - } - } - }; - element.addEventListener("transitionstart", onTransitionStart); - element.addEventListener("transitionend", onTransitionEnd); - } - } - }); -} - -// node_modules/@cloudscape-design/components/flashbar/common.js -var import_react319 = __toESM(require_react()); -function useFlashbar(_a2) { - var { items, onItemsAdded, onItemsChanged, onItemsRemoved } = _a2, restProps = __rest(_a2, ["items", "onItemsAdded", "onItemsChanged", "onItemsRemoved"]); - const { __internalRootRef } = useBaseComponent("Flashbar", { - props: { stackItems: restProps.stackItems } - }); - const allItemsHaveId = (0, import_react319.useMemo)(() => items.every((item) => "id" in item), [items]); - const baseProps = getBaseProps(restProps); - const ref = (0, import_react319.useRef)(null); - const [breakpoint, breakpointRef] = useContainerBreakpoints(["xs"]); - const mergedRef = useMergeRefs(ref, breakpointRef, __internalRootRef); - const isReducedMotion = useReducedMotion(ref); - const isVisualRefresh = useVisualRefresh(); - const [previousItems, setPreviousItems] = (0, import_react319.useState)(items); - const [nextFocusId, setNextFocusId] = (0, import_react319.useState)(null); - if (isDevelopment2) { - if (items === null || items === void 0 ? void 0 : items.some((item) => item.ariaRole === "alert" && !item.id)) { - warnOnce("Flashbar", `You provided \`ariaRole="alert"\` for a flashbar item without providing an \`id\`. Focus will not be moved to the newly added flash message.`); - } - } - if (items) { - const newItems = items.filter(({ id }) => id && !previousItems.some((item) => item.id === id)); - const removedItems = previousItems.filter(({ id }) => id && !items.some((item) => item.id === id)); - if (newItems.length > 0 || removedItems.length > 0) { - setPreviousItems(items); - onItemsAdded === null || onItemsAdded === void 0 ? void 0 : onItemsAdded(newItems); - onItemsRemoved === null || onItemsRemoved === void 0 ? void 0 : onItemsRemoved(removedItems); - onItemsChanged === null || onItemsChanged === void 0 ? void 0 : onItemsChanged({ allItemsHaveId, isReducedMotion }); - const newFocusItems = newItems.filter(({ ariaRole }) => ariaRole === "alert"); - if (newFocusItems.length > 0) { - setNextFocusId(newFocusItems[0].id); - } - } - } - (0, import_react319.useEffect)(() => { - if (nextFocusId) { - focusFlashById(ref.current, nextFocusId); - } - }, [nextFocusId, ref]); - return { - allItemsHaveId, - baseProps, - breakpoint, - isReducedMotion, - isVisualRefresh, - mergedRef, - ref - }; -} - -// node_modules/@cloudscape-design/components/flashbar/collapsible-flashbar.js -var maxNonCollapsibleItems = 1; -var resizeListenerThrottleDelay = 100; -function CollapsibleFlashbar(_a2) { - var { items } = _a2, restProps = __rest(_a2, ["items"]); - const [enteringItems, setEnteringItems] = (0, import_react320.useState)([]); - const [exitingItems, setExitingItems] = (0, import_react320.useState)([]); - const [isFlashbarStackExpanded, setIsFlashbarStackExpanded] = (0, import_react320.useState)(false); - const getElementsToAnimate = (0, import_react320.useCallback)(() => { - const flashElements = isFlashbarStackExpanded ? expandedItemRefs.current : collapsedItemRefs.current; - return Object.assign(Object.assign({}, flashElements), { notificationBar: notificationBarRef.current }); - }, [isFlashbarStackExpanded]); - const prepareAnimations = (0, import_react320.useCallback)(() => { - const rects = getDOMRects(getElementsToAnimate()); - setInitialAnimationState(rects); - }, [getElementsToAnimate]); - const { baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef, ref } = useFlashbar(Object.assign(Object.assign({ items }, restProps), { onItemsAdded: (newItems) => { - setEnteringItems([...enteringItems, ...newItems]); - }, onItemsChanged: (options) => { - if ((options === null || options === void 0 ? void 0 : options.allItemsHaveId) && !(options === null || options === void 0 ? void 0 : options.isReducedMotion)) { - prepareAnimations(); - } - }, onItemsRemoved: (removedItems) => { - setExitingItems([...exitingItems, ...removedItems]); - } })); - const collapsedItemRefs = (0, import_react320.useRef)({}); - const expandedItemRefs = (0, import_react320.useRef)({}); - const [initialAnimationState, setInitialAnimationState] = (0, import_react320.useState)(null); - const listElementRef = (0, import_react320.useRef)(null); - const notificationBarRef = (0, import_react320.useRef)(null); - const [transitioning, setTransitioning] = (0, import_react320.useState)(false); - const flashbarElementId = useUniqueId("flashbar"); - const itemCountElementId = useUniqueId("item-count"); - if (items.length <= maxNonCollapsibleItems && isFlashbarStackExpanded) { - setIsFlashbarStackExpanded(false); - } - const animateFlash = !isReducedMotion; - function toggleCollapseExpand() { - sendToggleMetric(items.length, !isFlashbarStackExpanded); - if (!isReducedMotion) { - prepareAnimations(); - } - setIsFlashbarStackExpanded((prev) => !prev); - } - (0, import_react320.useLayoutEffect)(() => { - if (isFlashbarStackExpanded && (items === null || items === void 0 ? void 0 : items.length)) { - const mostRecentItem = items[0]; - if (mostRecentItem.id !== void 0) { - focusFlashById(ref.current, mostRecentItem.id); - } - } - }, [isFlashbarStackExpanded]); - useEffectOnUpdate(() => { - if (!isFlashbarStackExpanded && notificationBarRef.current) { - scrollElementIntoView(notificationBarRef.current); - } - }, [isFlashbarStackExpanded]); - const updateBottomSpacing = (0, import_react320.useMemo)(() => throttle(() => { - const listElement = listElementRef === null || listElementRef === void 0 ? void 0 : listElementRef.current; - const flashbar = listElement === null || listElement === void 0 ? void 0 : listElement.parentElement; - if (listElement && flashbar) { - flashbar.classList.remove(styles_css_default100.floating); - const windowHeight = window.innerHeight; - const outerElement = findUpUntil2(flashbar, (element) => element.getAttribute("role") === "region") || flashbar; - const applySpacing = isFlashbarStackExpanded && Math.ceil(outerElement.getBoundingClientRect().bottom) >= windowHeight; - if (!applySpacing) { - flashbar.classList.add(styles_css_default100.floating); - } - } - }, resizeListenerThrottleDelay), [isFlashbarStackExpanded]); - (0, import_react320.useLayoutEffect)(() => { - window.addEventListener("resize", updateBottomSpacing); - return () => { - window.removeEventListener("resize", updateBottomSpacing); - updateBottomSpacing.cancel(); - }; - }, [updateBottomSpacing]); - const { i18nStrings } = restProps; - const i18n = useInternalI18n("flashbar"); - const ariaLabel = i18n("i18nStrings.ariaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel); - const notificationBarText = i18n("i18nStrings.notificationBarText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.notificationBarText); - const notificationBarAriaLabel = i18n("i18nStrings.notificationBarAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.notificationBarAriaLabel); - const iconAriaLabels = { - errorIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel), - inProgressIconAriaLabel: i18n("i18nStrings.inProgressIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inProgressIconAriaLabel), - infoIconAriaLabel: i18n("i18nStrings.infoIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.infoIconAriaLabel), - successIconAriaLabel: i18n("i18nStrings.successIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.successIconAriaLabel), - warningIconAriaLabel: i18n("i18nStrings.warningIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel) - }; - (0, import_react320.useLayoutEffect)(() => { - if (initialAnimationState) { - updateBottomSpacing(); - animate({ - elements: getElementsToAnimate(), - oldState: initialAnimationState, - newElementInitialState: ({ top }) => ({ scale: 0.9, y: -0.2 * top }), - onTransitionsEnd: () => setTransitioning(false) - }); - setTransitioning(true); - setInitialAnimationState(null); - } - }, [updateBottomSpacing, getElementsToAnimate, initialAnimationState, isFlashbarStackExpanded]); - const isCollapsible = items.length > maxNonCollapsibleItems; - const countByType = getFlashTypeCount(items); - const numberOfColorsInStack = new Set(items.map(getItemColor)).size; - const maxSlots = Math.max(numberOfColorsInStack, 3); - const stackDepth = Math.min(maxSlots, items.length); - const itemsToShow = isFlashbarStackExpanded ? items.map((item, index) => Object.assign(Object.assign({}, item), { expandedIndex: index })) : getVisibleCollapsedItems(items, stackDepth).map((item, index) => Object.assign(Object.assign({}, item), { collapsedIndex: index })); - const getItemId = (item) => { - var _a3, _b; - return (_b = (_a3 = item.id) !== null && _a3 !== void 0 ? _a3 : item.expandedIndex) !== null && _b !== void 0 ? _b : 0; - }; - const hasEntered = (item) => enteringItems.some((_item) => _item.id && _item.id === item.id); - const hasLeft = (item) => !("expandedIndex" in item); - const hasEnteredOrLeft = (item) => hasEntered(item) || hasLeft(item); - const showInnerContent = (item) => isFlashbarStackExpanded || hasLeft(item) || "expandedIndex" in item && item.expandedIndex === 0; - const shouldUseStandardAnimation = (item, index) => index === 0 && hasEnteredOrLeft(item); - const getAnimationElementId = (item) => `flash-${getItemId(item)}`; - const renderList = () => import_react320.default.createElement( - "ul", - { ref: listElementRef, className: clsx_m_default(styles_css_default100["flash-list"], isFlashbarStackExpanded ? styles_css_default100.expanded : styles_css_default100.collapsed, transitioning && styles_css_default100["animation-running"], initialAnimationState && styles_css_default100["animation-ready"], isVisualRefresh && styles_css_default100["visual-refresh"]), id: flashbarElementId, "aria-label": ariaLabel, "aria-describedby": isCollapsible ? itemCountElementId : void 0, style: !isFlashbarStackExpanded || transitioning ? { - [custom_css_properties_default.flashbarStackDepth]: stackDepth - } : void 0 }, - import_react320.default.createElement(ListWrapper, { withMotion: !isReducedMotion }, itemsToShow.map((item, index) => import_react320.default.createElement(Transition2, { key: getItemId(item), in: !hasLeft(item), onStatusChange: (status) => { - if (status === "entered") { - setEnteringItems([]); - } else if (status === "exited") { - setExitingItems([]); - } - } }, (state, transitionRootElement) => { - var _a3, _b, _c; - return import_react320.default.createElement("li", { "aria-hidden": !showInnerContent(item), className: showInnerContent(item) ? clsx_m_default(styles_css_default100["flash-list-item"], !isFlashbarStackExpanded && styles_css_default100.item, !collapsedItemRefs.current[getAnimationElementId(item)] && styles_css_default100["expanded-only"]) : clsx_m_default(styles_css_default100.flash, styles_css_default100[`flash-type-${(_a3 = item.type) !== null && _a3 !== void 0 ? _a3 : "info"}`], styles_css_default100.item), ref: (element) => { - if (isFlashbarStackExpanded) { - expandedItemRefs.current[getAnimationElementId(item)] = element; - } else { - collapsedItemRefs.current[getAnimationElementId(item)] = element; - } - }, style: !isFlashbarStackExpanded || transitioning ? { - [custom_css_properties_default.flashbarStackIndex]: (_c = (_b = item.collapsedIndex) !== null && _b !== void 0 ? _b : item.expandedIndex) !== null && _c !== void 0 ? _c : index - } : void 0, key: getItemId(item) }, showInnerContent(item) && import_react320.default.createElement( - Flash, - Object.assign({ - // eslint-disable-next-line react/forbid-component-props - className: clsx_m_default(animateFlash && styles_css_default100["flash-with-motion"], isVisualRefresh && styles_css_default100["flash-refresh"]), - key: getItemId(item), - ref: shouldUseStandardAnimation(item, index) ? transitionRootElement : void 0, - transitionState: shouldUseStandardAnimation(item, index) ? state : void 0, - i18nStrings: iconAriaLabels - }, item) - )); - }))) - ); - return import_react320.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default100.flashbar, styles_css_default100[`breakpoint-${breakpoint}`], styles_css_default100.stack, isCollapsible && styles_css_default100.collapsible, items.length === 2 && styles_css_default100["short-list"], isFlashbarStackExpanded && styles_css_default100.expanded, isVisualRefresh && styles_css_default100["visual-refresh"]), ref: mergedRef }), - isFlashbarStackExpanded && renderList(), - isCollapsible && import_react320.default.createElement( - "div", - { className: clsx_m_default( - styles_css_default100["notification-bar"], - isVisualRefresh && styles_css_default100["visual-refresh"], - isFlashbarStackExpanded ? styles_css_default100.expanded : styles_css_default100.collapsed, - transitioning && styles_css_default100["animation-running"], - items.length === 2 && styles_css_default100["short-list"], - getVisualContextClassname("flashbar") - // Visual context is needed for focus ring to be white - ), onClick: toggleCollapseExpand, ref: notificationBarRef }, - import_react320.default.createElement( - "span", - { "aria-live": "polite", className: styles_css_default100.status, role: "status", id: itemCountElementId }, - notificationBarText && import_react320.default.createElement("h2", { className: styles_css_default100.header }, notificationBarText), - import_react320.default.createElement("span", { className: styles_css_default100["item-count"] }, counterTypes.map(({ type, labelName, iconName }) => import_react320.default.createElement(NotificationTypeCount, { key: type, iconName, label: iconAriaLabels[labelName], count: countByType[type] }))) - ), - import_react320.default.createElement( - "button", - { "aria-controls": flashbarElementId, "aria-describedby": itemCountElementId, "aria-expanded": isFlashbarStackExpanded, "aria-label": notificationBarAriaLabel, className: clsx_m_default(styles_css_default100.button, isFlashbarStackExpanded && styles_css_default100.expanded) }, - import_react320.default.createElement(internal_default, { className: styles_css_default100.icon, size: "normal", name: "angle-down" }) - ) - ), - !isFlashbarStackExpanded && renderList() - ); -} -var NotificationTypeCount = ({ iconName, label, count }) => { - return import_react320.default.createElement( - "span", - { className: styles_css_default100["type-count"] }, - import_react320.default.createElement( - "span", - { "aria-label": label, role: "img" }, - import_react320.default.createElement( - "span", - { title: label, "aria-hidden": "true" }, - import_react320.default.createElement(internal_default, { name: iconName }) - ) - ), - import_react320.default.createElement("span", { className: styles_css_default100["count-number"] }, count) - ); -}; -var ListWrapper = ({ children: children2, withMotion }) => withMotion ? import_react320.default.createElement(TransitionGroup_default, { component: null }, children2) : import_react320.default.createElement(import_react320.default.Fragment, null, children2); - -// node_modules/@cloudscape-design/components/flashbar/non-collapsible-flashbar.js -var import_react321 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/flashbar/constant.js -var TIMEOUT_FOR_ENTERING_ANIMATION = 115; - -// node_modules/@cloudscape-design/components/flashbar/non-collapsible-flashbar.js -function NonCollapsibleFlashbar(_a2) { - var { items, i18nStrings } = _a2, restProps = __rest(_a2, ["items", "i18nStrings"]); - const { allItemsHaveId, baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef } = useFlashbar(Object.assign({ items }, restProps)); - const i18n = useInternalI18n("flashbar"); - const ariaLabel = i18n("i18nStrings.ariaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel); - const iconAriaLabels = { - errorIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel), - inProgressIconAriaLabel: i18n("i18nStrings.inProgressIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inProgressIconAriaLabel), - infoIconAriaLabel: i18n("i18nStrings.infoIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.infoIconAriaLabel), - successIconAriaLabel: i18n("i18nStrings.successIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.successIconAriaLabel), - warningIconAriaLabel: i18n("i18nStrings.warningIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel) - }; - const motionDisabled = isReducedMotion || !isVisualRefresh || !allItemsHaveId; - const animateFlash = !isReducedMotion && isVisualRefresh; - function renderFlatItemsWithTransitions() { - if (motionDisabled || !items) { - return; - } - return ( - // This is a proxy for
    , so we're not applying a class to another actual component. - // eslint-disable-next-line react/forbid-component-props - import_react321.default.createElement(TransitionGroup_default, { component: "ul", className: styles_css_default100["flash-list"], "aria-label": ariaLabel }, items.map((item, index) => { - var _a3; - return import_react321.default.createElement(Transition2, { transitionChangeDelay: { entering: TIMEOUT_FOR_ENTERING_ANIMATION }, key: (_a3 = item.id) !== null && _a3 !== void 0 ? _a3 : index, in: true }, (state, transitionRootElement) => { - var _a4; - return import_react321.default.createElement("li", { className: styles_css_default100["flash-list-item"] }, renderItem(item, (_a4 = item.id) !== null && _a4 !== void 0 ? _a4 : index, transitionRootElement, state)); - }); - })) - ); - } - function renderFlatItemsWithoutTransitions() { - if (!motionDisabled || !items) { - return; - } - return import_react321.default.createElement("ul", { className: styles_css_default100["flash-list"], "aria-label": ariaLabel }, items.map((item, index) => { - var _a3, _b; - return import_react321.default.createElement("li", { key: (_a3 = item.id) !== null && _a3 !== void 0 ? _a3 : index, className: styles_css_default100["flash-list-item"] }, renderItem(item, (_b = item.id) !== null && _b !== void 0 ? _b : index)); - })); - } - function renderItem(item, key2, transitionRootElement, transitionState) { - return import_react321.default.createElement( - Flash, - Object.assign({ - // eslint-disable-next-line react/forbid-component-props - className: clsx_m_default(animateFlash && styles_css_default100["flash-with-motion"], isVisualRefresh && styles_css_default100["flash-refresh"]), - key: key2, - ref: transitionRootElement, - transitionState, - i18nStrings: iconAriaLabels - }, item) - ); - } - return import_react321.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default100.flashbar, styles_css_default100[`breakpoint-${breakpoint}`]), ref: mergedRef }), - renderFlatItemsWithTransitions(), - renderFlatItemsWithoutTransitions() - ); -} - -// node_modules/@cloudscape-design/components/flashbar/index.js -function Flashbar(props2) { - (0, import_react322.useEffect)(() => { - if (props2.items.length > 0) { - sendRenderMetric(props2.items); - } - }, [props2.items]); - if (props2.stackItems) { - return import_react322.default.createElement(CollapsibleFlashbar, Object.assign({}, props2)); - } else { - return import_react322.default.createElement(NonCollapsibleFlashbar, Object.assign({}, props2)); - } -} -applyDisplayName(Flashbar, "Flashbar"); - -// node_modules/@cloudscape-design/components/form/index.js -var import_react324 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/form/internal.js -var import_react323 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/form/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/form/styles.scoped.css"; -var styles_css_default101 = { - "root": "awsui_root_1i0s3_19kut_99", - "header": "awsui_header_1i0s3_19kut_134", - "full-page": "awsui_full-page_1i0s3_19kut_134", - "content": "awsui_content_1i0s3_19kut_138", - "error": "awsui_error_1i0s3_19kut_142", - "footer": "awsui_footer_1i0s3_19kut_146", - "actions-section": "awsui_actions-section_1i0s3_19kut_150", - "secondary-actions": "awsui_secondary-actions_1i0s3_19kut_159", - "actions": "awsui_actions_1i0s3_19kut_150" -}; - -// node_modules/@cloudscape-design/components/form/internal.js -function InternalForm(_a2) { - var { children: children2, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, variant, __internalRootRef } = _a2, props2 = __rest(_a2, ["children", "header", "errorText", "errorIconAriaLabel", "actions", "secondaryActions", "variant", "__internalRootRef"]); - const baseProps = getBaseProps(props2); - const i18n = useInternalI18n("form"); - const errorIconAriaLabel = i18n("errorIconAriaLabel", errorIconAriaLabelOverride); - const { funnelInteractionId, submissionAttempt, errorCount } = useFunnel(); - (0, import_react323.useEffect)(() => { - if (funnelInteractionId && errorText) { - errorCount.current++; - FunnelMetrics.funnelError({ funnelInteractionId }); - return () => { - errorCount.current--; - }; - } - }, [funnelInteractionId, errorText, submissionAttempt, errorCount]); - return import_react323.default.createElement( - "div", - Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx_m_default(styles_css_default101.root, baseProps.className) }), - import_react323.default.createElement( - FormLayout, - { header: header && import_react323.default.createElement("div", { className: clsx_m_default(styles_css_default101.header, variant === "full-page" && styles_css_default101["full-page"]) }, header), variant }, - children2 && import_react323.default.createElement("div", { className: styles_css_default101.content }, children2), - errorText && import_react323.default.createElement( - InternalBox, - { margin: { top: "l" } }, - import_react323.default.createElement( - internal_default3, - { type: "error", statusIconAriaLabel: errorIconAriaLabel }, - import_react323.default.createElement("div", { className: styles_css_default101.error }, errorText) - ) - ), - (actions || secondaryActions) && import_react323.default.createElement( - "div", - { className: styles_css_default101.footer }, - import_react323.default.createElement( - "div", - { className: styles_css_default101["actions-section"] }, - actions && import_react323.default.createElement("div", { className: styles_css_default101.actions }, actions), - secondaryActions && import_react323.default.createElement("div", { className: styles_css_default101["secondary-actions"] }, secondaryActions) - ) - ), - errorText && import_react323.default.createElement( - live_region_default, - { assertive: true }, - errorIconAriaLabel, - ", ", - errorText - ) - ) - ); -} -function FormLayout({ children: children2, header, variant }) { - return variant === "full-page" && header ? import_react323.default.createElement(InternalContentLayout, { header }, children2) : import_react323.default.createElement( - import_react323.default.Fragment, - null, - header, - children2 - ); -} - -// node_modules/@cloudscape-design/components/form/index.js -var FormWithAnalytics = (_a2) => { - var { variant = "full-page", actions } = _a2, props2 = __rest(_a2, ["variant", "actions"]); - const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel(); - const { funnelStepProps } = useFunnelStep(); - const handleActionButtonClick = ({ variant: variant2 }) => { - if (variant2 === "primary") { - funnelNextOrSubmitAttempt(); - funnelSubmit(); - } - }; - return import_react324.default.createElement( - ButtonContext.Provider, - { value: { onClick: handleActionButtonClick } }, - import_react324.default.createElement(InternalForm, Object.assign({ variant, actions }, props2, funnelProps, funnelStepProps)) - ); -}; -function Form(_a2) { - var { variant = "full-page" } = _a2, props2 = __rest(_a2, ["variant"]); - const analyticsMetadata = getAnalyticsMetadataProps(props2); - const baseComponentProps = useBaseComponent("Form", { props: { variant } }, analyticsMetadata); - const inheritedFunnelNameSelector = useFunnelNameSelector(); - const funnelNameSelector = inheritedFunnelNameSelector || `.${styles_css_default56["heading-text"]}`; - return import_react324.default.createElement( - AnalyticsFunnel, - { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, flowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelType: "single-page", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [funnelNameSelector, `.${styles_css_default101.header}`] }, - import_react324.default.createElement( - AnalyticsFunnelStep, - { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNumber: 1 }, - import_react324.default.createElement(FormWithAnalytics, Object.assign({ variant }, props2, baseComponentProps)) - ) - ); -} -applyDisplayName(Form, "Form"); - -// node_modules/@cloudscape-design/components/form-field/index.js -var import_react325 = __toESM(require_react()); -function FormField(_a2) { - var { stretch = false } = _a2, props2 = __rest(_a2, ["stretch"]); - const baseComponentProps = useBaseComponent("FormField", { props: { stretch } }, getAnalyticsMetadataProps(props2)); - return import_react325.default.createElement(InternalFormField, Object.assign({ stretch }, props2, { __hideLabel: false }, baseComponentProps)); -} -applyDisplayName(FormField, "FormField"); - -// node_modules/@cloudscape-design/components/grid/index.js -var import_react326 = __toESM(require_react()); -function Grid3(_a2) { - var { gridDefinition = [], disableGutters = false, children: children2 } = _a2, restProps = __rest(_a2, ["gridDefinition", "disableGutters", "children"]); - const baseComponentProps = useBaseComponent("Grid", { - props: { disableGutters } - }); - const baseProps = getBaseProps(restProps); - const [breakpoint, ref] = useContainerBreakpoints(void 0); - return import_react326.default.createElement(internal_default6, Object.assign({}, baseProps, baseComponentProps, { ref, __breakpoint: breakpoint, gridDefinition, disableGutters }), children2); -} -applyDisplayName(Grid3, "Grid"); - -// node_modules/@cloudscape-design/components/header/index.js -var import_react327 = __toESM(require_react()); -function Header2(_a2) { - var { variant = "h2" } = _a2, props2 = __rest(_a2, ["variant"]); - const baseComponentProps = useBaseComponent("Header", { - props: { headingTagOverride: props2.headingTagOverride, variant } - }); - return import_react327.default.createElement(InternalHeader, Object.assign({ variant }, props2, baseComponentProps)); -} -applyDisplayName(Header2, "Header"); - -// node_modules/@cloudscape-design/components/help-panel/index.js -var import_react328 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/help-panel/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/help-panel/styles.scoped.css"; -var styles_css_default102 = { - "help-panel": "awsui_help-panel_1d237_xb6zh_100", - "header": "awsui_header_1d237_xb6zh_269", - "content": "awsui_content_1d237_xb6zh_300", - "footer": "awsui_footer_1d237_xb6zh_346" -}; - -// node_modules/@cloudscape-design/components/help-panel/index.js -function HelpPanel(_a2) { - var { header, footer, children: children2, loading, loadingText } = _a2, restProps = __rest(_a2, ["header", "footer", "children", "loading", "loadingText"]); - const { __internalRootRef } = useBaseComponent("HelpPanel"); - const baseProps = getBaseProps(restProps); - const i18n = useInternalI18n("help-panel"); - const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx_m_default(baseProps.className, styles_css_default102["help-panel"]) }); - return loading ? import_react328.default.createElement( - "div", - Object.assign({}, containerProps, { ref: __internalRootRef }), - import_react328.default.createElement( - StatusIndicator, - { type: "loading" }, - import_react328.default.createElement(live_region_default, { visible: true }, i18n("loadingText", loadingText)) - ) - ) : import_react328.default.createElement( - "div", - Object.assign({}, containerProps, { ref: __internalRootRef }), - header && import_react328.default.createElement("div", { className: clsx_m_default(styles_css_default102.header) }, header), - import_react328.default.createElement( - LinkDefaultVariantContext.Provider, - { value: { defaultVariant: "primary" } }, - import_react328.default.createElement("div", { className: clsx_m_default(styles_css_default102.content) }, children2) - ), - footer && import_react328.default.createElement("div", { className: styles_css_default102.footer }, footer) - ); -} -applyDisplayName(HelpPanel, "HelpPanel"); - -// node_modules/@cloudscape-design/components/hotspot/index.js -var import_react329 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/hotspot/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/hotspot/styles.scoped.css"; -var styles_css_default103 = { - "root": "awsui_root_cqcqk_134pw_99", - "wrapper": "awsui_wrapper_cqcqk_134pw_103", - "elementWrapper": "awsui_elementWrapper_cqcqk_134pw_107", - "markerWrapper": "awsui_markerWrapper_cqcqk_134pw_111", - "placement-right": "awsui_placement-right_cqcqk_134pw_116", - "placement-left": "awsui_placement-left_cqcqk_134pw_121", - "inlineWrapper": "awsui_inlineWrapper_cqcqk_134pw_126" -}; - -// node_modules/@cloudscape-design/components/hotspot/index.js -function Hotspot(_a2) { - var { children: children2, hotspotId, side = "right", direction = "top" } = _a2, restProps = __rest(_a2, ["children", "hotspotId", "side", "direction"]); - const { __internalRootRef } = useBaseComponent("Hotspot", { props: { direction, side } }); - const baseProps = getBaseProps(restProps); - const hotspotContext2 = (0, import_react329.useContext)(hotspotContext); - const content = hotspotContext2.getContentForId(hotspotId, direction); - const { unregisterHotspot, registerHotspot } = hotspotContext2; - (0, import_react329.useEffect)(() => { - registerHotspot(hotspotId); - return () => unregisterHotspot(hotspotId); - }, [hotspotId, unregisterHotspot, registerHotspot]); - if (children2) { - return import_react329.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default103.root, styles_css_default103.wrapper), ref: __internalRootRef }), - import_react329.default.createElement("div", { className: styles_css_default103.elementWrapper }, children2), - import_react329.default.createElement("div", { className: clsx_m_default(styles_css_default103.markerWrapper, styles_css_default103[`placement-${side}`]), onClick: (e) => e.stopPropagation() }, content) - ); - } - return import_react329.default.createElement("span", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default103.root, styles_css_default103.inlineWrapper), ref: __internalRootRef, onClick: (e) => e.stopPropagation() }), content); -} -applyDisplayName(Hotspot, "Hotspot"); - -// node_modules/@cloudscape-design/components/icon/index.js -var import_react330 = __toESM(require_react()); -function Icon(_a2) { - var { size: size2 = "normal", variant = "normal" } = _a2, props2 = __rest(_a2, ["size", "variant"]); - const baseComponentProps = useBaseComponent("Icon", { props: { name: props2.name, size: size2, variant } }); - return import_react330.default.createElement(internal_default, Object.assign({ size: size2, variant }, props2, baseComponentProps)); -} -applyDisplayName(Icon, "Icon"); - -// node_modules/@cloudscape-design/components/input/index.js -var import_react331 = __toESM(require_react()); -var Input = import_react331.default.forwardRef((_a2, ref) => { - var { value, type = "text", step: step2, inputMode, autoComplete = true, spellcheck, disabled, readOnly, disableBrowserAutocorrect, onKeyDown, onKeyUp, onChange, onBlur, onFocus, ariaRequired, name, placeholder, autoFocus, ariaLabel, ariaLabelledby, ariaDescribedby, invalid, controlId, clearAriaLabel } = _a2, rest = __rest(_a2, ["value", "type", "step", "inputMode", "autoComplete", "spellcheck", "disabled", "readOnly", "disableBrowserAutocorrect", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "placeholder", "autoFocus", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "invalid", "controlId", "clearAriaLabel"]); - const baseComponentProps = useBaseComponent("Input", { - props: { autoComplete, autoFocus, disableBrowserAutocorrect, inputMode, readOnly, spellcheck, type } - }); - const baseProps = getBaseProps(rest); - const inputRef = (0, import_react331.useRef)(null); - (0, import_react331.useImperativeHandle)(ref, () => ({ - focus(...args) { - var _a3; - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(...args); - }, - select() { - var _a3; - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.select(); - } - }), [inputRef]); - return import_react331.default.createElement(internal_default7, Object.assign({ ref: inputRef }, Object.assign(Object.assign(Object.assign({}, baseProps), baseComponentProps), { - autoComplete, - ariaLabel, - ariaRequired, - autoFocus, - disabled, - disableBrowserAutocorrect, - name, - onKeyDown, - onKeyUp, - onChange, - onBlur, - onFocus, - placeholder, - readOnly, - type, - step: step2, - inputMode, - spellcheck, - value, - ariaDescribedby, - ariaLabelledby, - invalid, - controlId, - clearAriaLabel - }), { className: clsx_m_default(styles_css_default41.root, baseProps.className), __inheritFormFieldProps: true })); -}); -applyDisplayName(Input, "Input"); -var input_default = Input; - -// node_modules/@cloudscape-design/components/line-chart/index.js -var import_react332 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/line-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/line-chart/styles.scoped.css"; -var styles_css_default104 = { - "root": "awsui_root_g9v3m_im8v7_5" -}; - -// node_modules/@cloudscape-design/components/line-chart/index.js -function LineChart(_a2) { - var { series = [], height = 500, xScaleType = "linear", yScaleType = "linear", detailPopoverSize = "medium", statusType = "finished", emphasizeBaselineAxis = true } = _a2, props2 = __rest(_a2, ["series", "height", "xScaleType", "yScaleType", "detailPopoverSize", "statusType", "emphasizeBaselineAxis"]); - const baseComponentProps = useBaseComponent("LineChart", { - props: { - detailPopoverSize, - emphasizeBaselineAxis, - fitHeight: props2.fitHeight, - hideFilter: props2.hideFilter, - hideLegend: props2.hideLegend, - xScaleType, - yScaleType - } - }); - const baseProps = getBaseProps(props2); - const className2 = clsx_m_default(baseProps.className, styles_css_default104.root); - return import_react332.default.createElement(InternalMixedLineBarChart, Object.assign({}, props2, baseComponentProps, { className: className2, height, xScaleType, yScaleType, stackedBars: false, horizontalBars: false, series, detailPopoverSize, statusType, emphasizeBaselineAxis })); -} -applyDisplayName(LineChart, "LineChart"); -var line_chart_default = LineChart; - -// node_modules/@cloudscape-design/components/link/index.js -var import_react333 = __toESM(require_react()); -var Link = import_react333.default.forwardRef((_a2, ref) => { - var { fontSize = "body-m", color: color2 = "normal", external = false } = _a2, props2 = __rest(_a2, ["fontSize", "color", "external"]); - const baseComponentProps = useBaseComponent("Link", { - props: { color: color2, external, fontSize, rel: props2.rel, target: props2.target, variant: props2.variant } - }); - return import_react333.default.createElement(internal_default5, Object.assign({ fontSize, color: color2, external }, props2, baseComponentProps, { ref })); -}); -applyDisplayName(Link, "Link"); -var link_default = Link; - -// node_modules/@cloudscape-design/components/mixed-line-bar-chart/index.js -var import_react334 = __toESM(require_react()); -function MixedLineBarChart(_a2) { - var { series = [], height = 500, xScaleType = "linear", yScaleType = "linear", stackedBars = false, horizontalBars = false, statusType = "finished", detailPopoverSize = "medium", emphasizeBaselineAxis = true } = _a2, props2 = __rest(_a2, ["series", "height", "xScaleType", "yScaleType", "stackedBars", "horizontalBars", "statusType", "detailPopoverSize", "emphasizeBaselineAxis"]); - const baseComponentProps = useBaseComponent("MixedLineBarChart", { - props: { - detailPopoverSize, - emphasizeBaselineAxis, - fitHeight: props2.fitHeight, - hideFilter: props2.hideFilter, - hideLegend: props2.hideLegend, - horizontalBars, - stackedBars, - xScaleType, - yScaleType - } - }); - return import_react334.default.createElement(InternalMixedLineBarChart, Object.assign({ series, height, xScaleType, yScaleType, stackedBars, horizontalBars, statusType, detailPopoverSize, emphasizeBaselineAxis }, props2, baseComponentProps)); -} -applyDisplayName(MixedLineBarChart, "MixedLineBarChart"); -var mixed_line_bar_chart_default = MixedLineBarChart; - -// node_modules/@cloudscape-design/components/modal/index.js -var import_react335 = __toESM(require_react()); -function Modal(_a2) { - var { size: size2 = "medium" } = _a2, props2 = __rest(_a2, ["size"]); - const baseComponentProps = useBaseComponent("Modal", { - props: { size: size2, disableContentPaddings: props2.disableContentPaddings } - }); - return import_react335.default.createElement(InternalModal, Object.assign({ size: size2 }, props2, baseComponentProps)); -} -applyDisplayName(Modal, "Modal"); - -// node_modules/@cloudscape-design/components/multiselect/index.js -var import_react336 = __toESM(require_react()); -var Multiselect = import_react336.default.forwardRef((_a2, ref) => { - var { options = [], filteringType = "none", statusType = "finished", selectedOptions = [], keepOpen = true, hideTokens = false } = _a2, restProps = __rest(_a2, ["options", "filteringType", "statusType", "selectedOptions", "keepOpen", "hideTokens"]); - const baseComponentProps = useBaseComponent("Multiselect", { - props: { - autoFocus: restProps.autoFocus, - expandToViewport: restProps.expandToViewport, - filteringType, - hideTokens, - keepOpen, - tokenLimit: restProps.tokenLimit, - virtualScroll: restProps.virtualScroll - } - }); - const inlineTokens = Boolean(restProps.inlineTokens); - return import_react336.default.createElement(internal_default8, Object.assign({ options, filteringType, statusType, selectedOptions, keepOpen, hideTokens, inlineTokens }, restProps, baseComponentProps, { ref })); -}); -applyDisplayName(Multiselect, "Multiselect"); -var multiselect_default = Multiselect; - -// node_modules/@cloudscape-design/components/pagination/index.js -var import_react338 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/pagination/internal.js -var import_react337 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/pagination/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/pagination/styles.scoped.css"; -var styles_css_default105 = { - "root": "awsui_root_fvjdu_1lqdy_99", - "button": "awsui_button_fvjdu_1lqdy_142", - "dots": "awsui_dots_fvjdu_1lqdy_143", - "button-disabled": "awsui_button-disabled_fvjdu_1lqdy_171", - "arrow": "awsui_arrow_fvjdu_1lqdy_176", - "page-number": "awsui_page-number_fvjdu_1lqdy_186", - "button-current": "awsui_button-current_fvjdu_1lqdy_192", - "page-item": "awsui_page-item_fvjdu_1lqdy_209", - "root-disabled": "awsui_root-disabled_fvjdu_1lqdy_227" -}; - -// node_modules/@cloudscape-design/components/pagination/utils.js -function range2(from, to) { - const result = []; - for (let i = from; i <= to; i++) { - result.push(i); - } - return result; -} -function getPaginationState(currentPageIndex, totalPagesCount, isOpenEnd) { - const numberOfControls = 7; - const leftDelta = Math.floor(numberOfControls / 2); - let rightDelta = leftDelta; - const lowerLimit = 2; - let upperLimit = totalPagesCount - 1; - if (isOpenEnd) { - rightDelta++; - upperLimit = totalPagesCount + 1; - } - let leftIndex = currentPageIndex - leftDelta; - let rightIndex = currentPageIndex + rightDelta; - if (leftIndex < lowerLimit) { - rightIndex += lowerLimit - leftIndex; - leftIndex = lowerLimit; - } - if (rightIndex > upperLimit) { - leftIndex -= rightIndex - upperLimit; - rightIndex = upperLimit; - } - leftIndex = Math.max(leftIndex, 2); - rightIndex = Math.min(rightIndex, upperLimit); - const leftDots = leftIndex > 2; - const rightDots = isOpenEnd || rightIndex < upperLimit; - if (leftDots) { - leftIndex++; - } - if (rightDots) { - rightIndex--; - } - return { leftDots, rightDots, leftIndex, rightIndex }; -} - -// node_modules/@cloudscape-design/components/pagination/internal.js -var defaultAriaLabels = { - nextPageLabel: "", - paginationLabel: "", - previousPageLabel: "", - pageLabel: (pageNumber) => `${pageNumber}` -}; -function PageButton({ className: className2, ariaLabel, disabled, pageIndex, isCurrent = false, children: children2, onClick }) { - function handleClick(event) { - event.preventDefault(); - onClick(pageIndex); - } - return import_react337.default.createElement( - "li", - { className: styles_css_default105["page-item"] }, - import_react337.default.createElement("button", { className: clsx_m_default(className2, styles_css_default105.button, disabled && styles_css_default105["button-disabled"], isCurrent && styles_css_default105["button-current"]), type: "button", "aria-label": ariaLabel, disabled, onClick: handleClick, "aria-current": isCurrent }, children2) - ); -} -function PageNumber(_a2) { - var { pageIndex } = _a2, rest = __rest(_a2, ["pageIndex"]); - return import_react337.default.createElement(PageButton, Object.assign({ className: styles_css_default105["page-number"], pageIndex }, rest), pageIndex); -} -function InternalPagination(_a2) { - var _b, _c, _d; - var { openEnd, currentPageIndex, ariaLabels, pagesCount, disabled, onChange, onNextPageClick, onPreviousPageClick, __internalRootRef = null } = _a2, rest = __rest(_a2, ["openEnd", "currentPageIndex", "ariaLabels", "pagesCount", "disabled", "onChange", "onNextPageClick", "onPreviousPageClick", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const { leftDots, leftIndex, rightIndex, rightDots } = getPaginationState(currentPageIndex, pagesCount, openEnd); - const i18n = useInternalI18n("pagination"); - const paginationLabel = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.paginationLabel; - const nextPageLabel = (_b = i18n("ariaLabels.nextPageLabel", ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.nextPageLabel)) !== null && _b !== void 0 ? _b : defaultAriaLabels.nextPageLabel; - const previousPageLabel = (_c = i18n("ariaLabels.previousPageLabel", ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.previousPageLabel)) !== null && _c !== void 0 ? _c : defaultAriaLabels.previousPageLabel; - const pageNumberLabelFn = (_d = i18n("ariaLabels.pageLabel", ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.pageLabel, (format3) => (pageNumber) => format3({ pageNumber }))) !== null && _d !== void 0 ? _d : defaultAriaLabels.pageLabel; - function handlePrevPageClick(requestedPageIndex) { - handlePageClick(requestedPageIndex); - fireNonCancelableEvent(onPreviousPageClick, { - requestedPageAvailable: true, - requestedPageIndex - }); - } - function handleNextPageClick(requestedPageIndex) { - handlePageClick(requestedPageIndex); - fireNonCancelableEvent(onNextPageClick, { - requestedPageAvailable: currentPageIndex < pagesCount, - requestedPageIndex - }); - } - function handlePageClick(requestedPageIndex) { - fireNonCancelableEvent(onChange, { currentPageIndex: requestedPageIndex }); - } - return import_react337.default.createElement( - "ul", - Object.assign({ "aria-label": paginationLabel }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default105.root, disabled && styles_css_default105["root-disabled"]), ref: __internalRootRef }), - import_react337.default.createElement( - PageButton, - { className: styles_css_default105.arrow, pageIndex: currentPageIndex - 1, ariaLabel: previousPageLabel !== null && previousPageLabel !== void 0 ? previousPageLabel : defaultAriaLabels.nextPageLabel, disabled: disabled || currentPageIndex === 1, onClick: handlePrevPageClick }, - import_react337.default.createElement(internal_default, { name: "angle-left", variant: disabled ? "disabled" : "normal" }) - ), - import_react337.default.createElement(PageNumber, { pageIndex: 1, isCurrent: currentPageIndex === 1, disabled, ariaLabel: pageNumberLabelFn(1), onClick: handlePageClick }), - leftDots && import_react337.default.createElement("li", { className: styles_css_default105.dots }, "..."), - range2(leftIndex, rightIndex).map((pageIndex) => import_react337.default.createElement(PageNumber, { key: pageIndex, isCurrent: currentPageIndex === pageIndex, pageIndex, disabled, ariaLabel: pageNumberLabelFn(pageIndex), onClick: handlePageClick })), - rightDots && import_react337.default.createElement("li", { className: styles_css_default105.dots }, "..."), - !openEnd && pagesCount > 1 && import_react337.default.createElement(PageNumber, { isCurrent: currentPageIndex === pagesCount, pageIndex: pagesCount, disabled, ariaLabel: pageNumberLabelFn(pagesCount), onClick: handlePageClick }), - import_react337.default.createElement( - PageButton, - { className: styles_css_default105.arrow, pageIndex: currentPageIndex + 1, ariaLabel: nextPageLabel !== null && nextPageLabel !== void 0 ? nextPageLabel : defaultAriaLabels.nextPageLabel, disabled: disabled || !openEnd && (pagesCount === 0 || currentPageIndex === pagesCount), onClick: handleNextPageClick }, - import_react337.default.createElement(internal_default, { name: "angle-right", variant: disabled ? "disabled" : "normal" }) - ) - ); -} - -// node_modules/@cloudscape-design/components/pagination/index.js -function Pagination(props2) { - const baseComponentProps = useBaseComponent("Pagination", { props: { openEnd: props2.openEnd } }); - return import_react338.default.createElement(InternalPagination, Object.assign({}, props2, baseComponentProps)); -} -applyDisplayName(Pagination, "Pagination"); - -// node_modules/@cloudscape-design/components/pie-chart/index.js -var import_react343 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/pie-chart/pie-chart.js -var import_react342 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/pie-chart/labels.js -var import_react340 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/pie-chart/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/pie-chart/styles.scoped.css"; -var styles_css_default106 = { - "segment__path": "awsui_segment__path_1edmh_18vxs_103", - "segment": "awsui_segment_1edmh_18vxs_103", - "segment__hover": "awsui_segment__hover_1edmh_18vxs_130", - "label": "awsui_label_1edmh_18vxs_144", - "root": "awsui_root_1edmh_18vxs_162", - "content": "awsui_content_1edmh_18vxs_166", - "content--small": "awsui_content--small_1edmh_18vxs_166", - "content--fit-height": "awsui_content--fit-height_1edmh_18vxs_169", - "content--without-labels": "awsui_content--without-labels_1edmh_18vxs_172", - "content--medium": "awsui_content--medium_1edmh_18vxs_178", - "content--large": "awsui_content--large_1edmh_18vxs_190", - "status-container": "awsui_status-container_1edmh_18vxs_207", - "chart-container": "awsui_chart-container_1edmh_18vxs_211", - "chart-container--fit-height": "awsui_chart-container--fit-height_1edmh_18vxs_215", - "chart-container-chart-plot": "awsui_chart-container-chart-plot_1edmh_18vxs_220", - "chart-container-chart-plot--fit-height": "awsui_chart-container-chart-plot--fit-height_1edmh_18vxs_223", - "inner-content": "awsui_inner-content_1edmh_18vxs_229", - "segment__highlight": "awsui_segment__highlight_1edmh_18vxs_240", - "segment--dimmed": "awsui_segment--dimmed_1edmh_18vxs_255", - "segment--highlighted": "awsui_segment--highlighted_1edmh_18vxs_258", - "label--dimmed": "awsui_label--dimmed_1edmh_18vxs_275", - "label--align-right": "awsui_label--align-right_1edmh_18vxs_278", - "label-text": "awsui_label-text_1edmh_18vxs_286", - "label__description": "awsui_label__description_1edmh_18vxs_294", - "label-line": "awsui_label-line_1edmh_18vxs_301", - "label--highlighted": "awsui_label--highlighted_1edmh_18vxs_305", - "popover-header": "awsui_popover-header_1edmh_18vxs_309" -}; - -// node_modules/@cloudscape-design/components/pie-chart/utils.js -var minRadius = 30; -var paddingLabels = 44; -var defaultPadding = 12; -var smallPadding = 8; -var minLabelLineAngularPadding = Math.PI / 20; -var dimensionsBySize = { - small: { - innerRadius: 33, - outerRadius: 50, - innerLabelPadding: smallPadding, - padding: smallPadding, - paddingLabels - }, - medium: { - innerRadius: 66, - outerRadius: 100, - innerLabelPadding: defaultPadding, - padding: defaultPadding, - paddingLabels - }, - large: { - innerRadius: 93, - outerRadius: 140, - innerLabelPadding: defaultPadding, - padding: defaultPadding, - paddingLabels - } -}; -var refreshDimensionsBySize = { - small: Object.assign(Object.assign({}, dimensionsBySize.small), { innerRadius: 38, cornerRadius: 3 }), - medium: Object.assign(Object.assign({}, dimensionsBySize.medium), { innerRadius: 75, cornerRadius: 4 }), - large: Object.assign(Object.assign({}, dimensionsBySize.large), { innerRadius: 105, cornerRadius: 5 }) -}; -function getDimensionsBySize({ size: size2, hasLabels, visualRefresh }) { - if (typeof size2 === "string") { - const dimensions = visualRefresh ? refreshDimensionsBySize[size2] : dimensionsBySize[size2]; - return Object.assign(Object.assign({}, dimensions), { size: size2 }); - } - const sizeSpec = visualRefresh ? refreshDimensionsBySize : dimensionsBySize; - const getPixelSize = (d) => d.outerRadius * 2 + d.padding * 2 + (hasLabels ? d.paddingLabels : 0) * 2; - let matchedSize = "small"; - if (size2 > getPixelSize(sizeSpec.medium)) { - matchedSize = "medium"; - } - if (size2 > getPixelSize(sizeSpec.large)) { - matchedSize = "large"; - } - const padding = sizeSpec[matchedSize].padding; - const paddingLabels2 = hasLabels ? sizeSpec[matchedSize].paddingLabels : 0; - const radiiRatio = sizeSpec[matchedSize].outerRadius / sizeSpec[matchedSize].innerRadius; - const outerRadius = Math.max(minRadius, (size2 - 2 * paddingLabels2 - 2 * padding) / 2); - const innerRadius = outerRadius / radiiRatio; - return Object.assign(Object.assign({}, sizeSpec[matchedSize]), { outerRadius, innerRadius, size: matchedSize }); -} -var defaultDetails = (i18n, i18nStrings) => (datum, dataSum) => [ - { key: i18n("i18nStrings.detailsValue", i18nStrings.detailsValue) || "", value: datum.value }, - { - key: i18n("i18nStrings.detailsPercentage", i18nStrings.detailsPercentage) || "", - value: `${(datum.value * 100 / dataSum).toFixed(0)}%` - } -]; -var balanceLabelNodes = (nodes, markers, leftSide, radius) => { - var _a2; - const MARGIN = 10; - let previousBBox = null; - let i = leftSide ? nodes.length - 1 : 0; - while (leftSide && i >= 0 || !leftSide && i < nodes.length) { - const node = nodes[i]; - const x2 = parseFloat(node.getAttribute("data-x") || "0"); - const y2 = parseFloat(node.getAttribute("data-y") || "0"); - const box = { - x: x2, - y: y2, - height: node.getBoundingClientRect().height - }; - const marker = markers[i]; - if (leftSide) { - i--; - } else { - i++; - } - if (!previousBBox) { - previousBBox = box; - node.setAttribute("transform", ""); - continue; - } - if (!leftSide && box.x < 0 || leftSide && box.x >= 0) { - break; - } - node.setAttribute("transform", ""); - const yOffset = previousBBox.y + previousBBox.height + MARGIN - box.y; - if (yOffset > 0) { - const xOffset = computeXOffset(box, yOffset, radius) * (leftSide ? -1 : 1); - node.setAttribute("transform", `translate(${xOffset} ${yOffset})`); - const lineNode = (_a2 = node.parentNode) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`.${styles_css_default106["label-line"]}`); - if (lineNode) { - const { endY, endX } = marker; - lineNode.setAttribute("y2", "" + (endY + yOffset)); - lineNode.setAttribute("x2", "" + (endX + xOffset)); - } - box.y += yOffset; - box.x += xOffset; - } - previousBBox = box; - } -}; -var squareDistance = (edge) => Math.pow(edge[0], 2) + Math.pow(edge[1], 2); -var computeXOffset = (box, yOffset, radius) => { - const upperEdge = [box.x, box.y + yOffset]; - const lowerEdge = [box.x, box.y + box.height + yOffset]; - const closestEdge = squareDistance(upperEdge) < squareDistance(lowerEdge) ? upperEdge : lowerEdge; - if (squareDistance(closestEdge) < Math.pow(radius, 2)) { - return Math.sqrt(Math.pow(radius, 2) - Math.pow(closestEdge[1], 2)) - Math.abs(closestEdge[0]); - } - return 0; -}; -var computeSmartAngle = (startAngle, endAngle, optimize = false) => { - if (!optimize || endAngle - startAngle < 2 * minLabelLineAngularPadding) { - return (endAngle + startAngle) / 2; - } - const paddedStartAngle = startAngle + minLabelLineAngularPadding; - const paddedEndAngle = endAngle - minLabelLineAngularPadding; - if (paddedStartAngle < 0 && paddedEndAngle > 0) { - return 0; - } - if (paddedStartAngle < Math.PI && paddedEndAngle > Math.PI) { - return Math.PI; - } - const endAngleMinDistance = Math.min(paddedEndAngle, Math.abs(Math.PI - paddedEndAngle), 2 * Math.PI - paddedEndAngle); - const startAngleMinDistance = Math.min(paddedStartAngle, Math.abs(Math.PI - paddedStartAngle), 2 * Math.PI - paddedStartAngle); - if (endAngleMinDistance < startAngleMinDistance) { - return paddedEndAngle; - } - return paddedStartAngle; -}; - -// node_modules/@cloudscape-design/components/pie-chart/responsive-text.js -var import_react339 = __toESM(require_react()); -var responsive_text_default2 = (0, import_react339.memo)(ResponsiveText2); -function ResponsiveText2({ x: x2, y: y2, rightSide, className: className2, children: children2, containerBoundaries }) { - const actualRef = (0, import_react339.useRef)(null); - const virtualRef = (0, import_react339.useRef)(null); - (0, import_react339.useEffect)(() => { - const timeoutId = setTimeout(() => { - const groupRect = virtualRef.current.getBoundingClientRect(); - const visibleWidth = containerBoundaries ? getVisibleWidth(groupRect, containerBoundaries) : 0; - renderTextContent(actualRef.current, children2, visibleWidth); - }, 25); - return () => clearTimeout(timeoutId); - }); - return import_react339.default.createElement( - import_react339.default.Fragment, - null, - import_react339.default.createElement("text", { ref: virtualRef, x: x2, y: y2, style: { textAnchor: rightSide ? "start" : "end", visibility: "hidden" }, "aria-hidden": "true", className: className2 }, children2), - import_react339.default.createElement("text", { ref: actualRef, x: x2, y: y2, style: { textAnchor: rightSide ? "start" : "end" }, className: className2 }, children2) - ); -} -function getVisibleWidth(element, container) { - if (element.left < container.left) { - return element.right - container.left; - } else if (element.right > container.right) { - return container.right - element.left; - } else { - return container.right - container.left; - } -} - -// node_modules/@cloudscape-design/components/pie-chart/labels.js -function LabelElement({ x: x2, y: y2, hideTitles, hideDescriptions, rightSide, title, description, containerBoundaries }) { - return ( - // Reset the transform property to prepare for `balanceLabelNodes`. - // The dataset attributes are also needed in the function for IE11 support. - import_react340.default.createElement( - "g", - { className: styles_css_default106["label-text"], transform: "", "data-x": x2, "data-y": y2 }, - !hideTitles && import_react340.default.createElement(responsive_text_default2, { x: x2, y: y2, rightSide, containerBoundaries }, title), - !hideDescriptions && description && import_react340.default.createElement(responsive_text_default2, { x: x2, y: y2 + (hideTitles ? 0 : 18), rightSide, className: styles_css_default106.label__description, containerBoundaries }, description) - ) - ); -} -var labels_default = ({ pieData, dimensions, highlightedSegment, segmentDescription, visibleDataSum, hideTitles, hideDescriptions, containerRef }) => { - const containerBoundaries = useElementBoundaries(containerRef); - const shouldOptimizeLabels = containerBoundaries.right - containerBoundaries.left - (dimensions.outerRadius + dimensions.innerLabelPadding) * 2 < 300; - const markers = (0, import_react340.useMemo)(() => { - const { outerRadius: radius, innerLabelPadding } = dimensions; - const arcMarkerStart = arc_default().innerRadius(radius - 1).outerRadius(radius - 1); - const arcMarkerBreak = arc_default().innerRadius(radius + innerLabelPadding).outerRadius(radius + innerLabelPadding); - return pieData.map((datum, i) => { - const labelDatum = pieData[i]; - const smartAngle = computeSmartAngle(labelDatum.startAngle, labelDatum.endAngle, shouldOptimizeLabels); - const lineExtension = 0.5 * Math.cos(2 * smartAngle) + 0.5; - arcMarkerBreak.outerRadius(radius + 20 * lineExtension); - arcMarkerBreak.innerRadius(radius + 20 * lineExtension); - const [startX, startY] = arcMarkerStart.centroid(Object.assign(Object.assign({}, datum), { startAngle: smartAngle, endAngle: smartAngle })); - const [breakX, breakY] = arcMarkerBreak.centroid(Object.assign(Object.assign({}, datum), { startAngle: smartAngle, endAngle: smartAngle })); - const rightSide = smartAngle < Math.PI; - const endX = shouldOptimizeLabels ? breakX + 20 * (rightSide ? 1 : -1) : (radius + 20) * (rightSide ? 1 : -1); - const textX = endX + 5 * (rightSide ? 1 : -1); - return { - startX, - startY, - breakX, - breakY, - endX, - endY: breakY, - textX, - textY: breakY, - rightSide, - datum - }; - }); - }, [pieData, dimensions, shouldOptimizeLabels]); - const rootRef = (0, import_react340.useRef)(null); - (0, import_react340.useLayoutEffect)(() => { - if (!rootRef.current) { - return; - } - const labelNodes = rootRef.current.querySelectorAll(`.${styles_css_default106["label-text"]}`); - balanceLabelNodes(labelNodes, markers, false, dimensions.outerRadius + dimensions.innerLabelPadding); - balanceLabelNodes(labelNodes, markers, true, dimensions.outerRadius + dimensions.innerLabelPadding); - }, [markers, pieData, dimensions]); - return import_react340.default.createElement("g", { className: styles_css_default106.markers, "aria-hidden": "true", ref: rootRef }, markers.map(({ startX, startY, breakX, breakY, endX, endY, textX, textY, rightSide, datum }) => { - const segment = datum.data.datum; - const description = segmentDescription === null || segmentDescription === void 0 ? void 0 : segmentDescription(segment, visibleDataSum); - if (hideTitles && !description || hideDescriptions && !segment.title) { - return null; - } - return import_react340.default.createElement( - "g", - { key: datum.data.index, className: clsx_m_default(styles_css_default106.label, { - [styles_css_default106["label--highlighted"]]: highlightedSegment === segment, - [styles_css_default106["label--dimmed"]]: highlightedSegment !== null && highlightedSegment !== segment, - [styles_css_default106["label--align-right"]]: !rightSide - }) }, - import_react340.default.createElement("line", { x1: startX, y1: startY, x2: breakX, y2: breakY }), - import_react340.default.createElement("line", { x1: breakX, y1: breakY, x2: endX, y2: endY, className: styles_css_default106["label-line"] }), - import_react340.default.createElement(LabelElement, { x: textX, y: textY, rightSide, title: segment.title, description, hideTitles, hideDescriptions, containerBoundaries }) - ); - })); -}; -function useElementBoundaries(ref) { - const [state, setState] = (0, import_react340.useState)({ left: 0, right: 0 }); - useResizeObserver(ref, (entry) => { - const elementRect = entry.target.getBoundingClientRect(); - setState({ left: elementRect.left, right: elementRect.right }); - }); - return state; -} - -// node_modules/@cloudscape-design/components/pie-chart/segments.js -var import_react341 = __toESM(require_react()); -function Segments({ pieData, highlightedSegment, dimensions, variant, focusedSegmentRef, popoverTrackRef, segmentAriaRoleDescription, onMouseDown, onMouseOver }) { - const i18n = useInternalI18n("pie-chart"); - const { arcFactory, highlightedArcFactory } = (0, import_react341.useMemo)(() => { - const radius = dimensions.outerRadius; - const innerRadius = variant === "pie" ? 0 : dimensions.innerRadius; - const cornerRadius = dimensions.cornerRadius || 0; - const arcFactory2 = arc_default().innerRadius(innerRadius).outerRadius(radius).cornerRadius(cornerRadius); - const highlightedArcFactory2 = arc_default().innerRadius(radius + 4).outerRadius(radius + 6); - return { - arcFactory: arcFactory2, - highlightedArcFactory: highlightedArcFactory2 - }; - }, [dimensions, variant]); - const centroid = (0, import_react341.useMemo)(() => { - for (const datum of pieData) { - if (datum.data.datum === highlightedSegment) { - const [centroidLeft, centroidTop] = arcFactory.centroid(datum); - return { cx: centroidLeft, cy: centroidTop }; - } - } - return null; - }, [highlightedSegment, pieData, arcFactory]); - return import_react341.default.createElement( - "g", - null, - pieData.map((datum) => { - const isHighlighted = highlightedSegment === datum.data.datum; - const isDimmed = highlightedSegment !== null && !isHighlighted; - const arcPath = arcFactory(datum) || void 0; - const highlightedPath = highlightedArcFactory(datum) || void 0; - return import_react341.default.createElement( - "g", - { key: datum.data.index, onMouseDown: (e) => { - onMouseDown(datum.data); - e.preventDefault(); - }, onMouseOver: () => onMouseOver(datum.data), className: clsx_m_default(styles_css_default106.segment, { - [styles_css_default106["segment--highlighted"]]: isHighlighted, - [styles_css_default106["segment--dimmed"]]: isDimmed - }), ref: isHighlighted ? focusedSegmentRef : void 0, "aria-label": `${datum.data.datum.title} (${datum.data.datum.value})`, role: "button", "aria-roledescription": i18n("i18nStrings.segmentAriaRoleDescription", segmentAriaRoleDescription) }, - import_react341.default.createElement("path", { d: arcPath, fill: datum.data.color, className: styles_css_default106.segment__path, "aria-hidden": "true" }), - import_react341.default.createElement("path", { d: highlightedPath, fill: datum.data.color, className: clsx_m_default(styles_css_default106.segment__path, styles_css_default106.segment__highlight), "aria-hidden": "true" }) - ); - }), - import_react341.default.createElement("circle", Object.assign({}, centroid, { ref: popoverTrackRef, r: "1", opacity: "0", "aria-hidden": "true" })) - ); -} - -// node_modules/@cloudscape-design/components/pie-chart/pie-chart.js -var pie_chart_default = ({ fitHeight, height: explicitHeight, variant, size: size2, width, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, innerMetricValue, innerMetricDescription, hideTitles, hideDescriptions, detailPopoverContent, detailPopoverSize, detailPopoverFooter, segmentDescription, highlightedSegment, onHighlightChange, legendSegment, pieData, dataSum }) => { - var _a2, _b; - const [pinnedSegment, setPinnedSegment] = (0, import_react342.useState)(null); - const plotRef = (0, import_react342.useRef)(null); - const containerRef = (0, import_react342.useRef)(null); - const focusedSegmentRef = (0, import_react342.useRef)(null); - const popoverTrackRef = (0, import_react342.useRef)(null); - const popoverRef = (0, import_react342.useRef)(null); - const hasLabels = !(hideTitles && hideDescriptions); - const isRefresh = useVisualRefresh(); - const height = (_a2 = useHeightMeasure(() => { - var _a3, _b2; - return (_b2 = (_a3 = plotRef.current) === null || _a3 === void 0 ? void 0 : _a3.svg) !== null && _b2 !== void 0 ? _b2 : null; - }, !fitHeight)) !== null && _a2 !== void 0 ? _a2 : explicitHeight; - const dimensions = (0, import_react342.useMemo)(() => getDimensionsBySize({ size: fitHeight ? Math.min(height, width) : size2, hasLabels, visualRefresh: isRefresh }), [fitHeight, height, width, size2, hasLabels, isRefresh]); - const hasInnerContent = variant === "donut" && (innerMetricValue || innerMetricDescription && dimensions.size !== "small"); - const innerMetricId = useUniqueId("awsui-pie-chart__inner"); - const [isPopoverOpen, setPopoverOpen] = (0, import_react342.useState)(false); - const [popoverData, setPopoverData] = (0, import_react342.useState)(); - const highlightedSegmentIndex = (0, import_react342.useMemo)(() => { - for (let index = 0; index < pieData.length; index++) { - if (pieData[index].data.datum === highlightedSegment) { - return index; - } - } - return null; - }, [pieData, highlightedSegment]); - const detailPopoverFooterContent = (0, import_react342.useMemo)(() => detailPopoverFooter && highlightedSegment ? detailPopoverFooter(highlightedSegment) : null, [detailPopoverFooter, highlightedSegment]); - const i18n = useInternalI18n("pie-chart"); - const detailFunction = detailPopoverContent || defaultDetails(i18n, i18nStrings); - const details = popoverData ? detailFunction(popoverData.datum, dataSum) : []; - const popoverContentRef = (0, import_react342.useRef)(null); - const popoverContent = popoverData && import_react342.default.createElement(chart_series_details_default, { details, compactList: true, ref: popoverContentRef }); - const popoverDismissedRecently = (0, import_react342.useRef)(false); - const escapePressed = (0, import_react342.useRef)(false); - const highlightSegment = (0, import_react342.useCallback)((internalDatum) => { - const segment = internalDatum.datum; - if (segment !== highlightedSegment) { - onHighlightChange(segment); - } - if (popoverTrackRef.current) { - setPopoverData({ - datum: internalDatum.datum, - series: { - color: internalDatum.color, - index: internalDatum.index, - label: internalDatum.datum.title, - markerType: "rectangle" - }, - trackRef: popoverTrackRef - }); - setPopoverOpen(true); - } - }, [highlightedSegment, setPopoverOpen, onHighlightChange]); - const clearHighlightedSegment = (0, import_react342.useCallback)(() => { - setPopoverOpen(false); - onHighlightChange(null); - }, [onHighlightChange, setPopoverOpen]); - const checkMouseLeave = (event) => { - if (pinnedSegment !== null) { - return; - } - if (nodeContains(popoverRef.current, event.relatedTarget) || nodeContains(focusedSegmentRef.current, event.relatedTarget)) { - return; - } - clearHighlightedSegment(); - }; - (0, import_react342.useEffect)(() => { - const onKeyDown2 = (event) => { - if (event.key === "Escape") { - clearHighlightedSegment(); - escapePressed.current = true; - } - }; - document.addEventListener("keydown", onKeyDown2); - return () => document.removeEventListener("keydown", onKeyDown2); - }, [clearHighlightedSegment]); - const onMouseDown = (0, import_react342.useCallback)((internalDatum) => { - if (pinnedSegment === internalDatum.datum) { - setPinnedSegment(null); - clearHighlightedSegment(); - } else { - setPinnedSegment(internalDatum.datum); - highlightSegment(internalDatum); - } - }, [pinnedSegment, clearHighlightedSegment, setPinnedSegment, highlightSegment]); - const onMouseOver = (0, import_react342.useCallback)((internalDatum) => { - if (escapePressed.current) { - escapePressed.current = false; - return; - } - if (pinnedSegment !== null) { - return; - } - highlightSegment(internalDatum); - }, [pinnedSegment, highlightSegment]); - const onKeyDown = (0, import_react342.useCallback)((event) => { - const keyCode = event.keyCode; - if (keyCode !== KeyCode.right && keyCode !== KeyCode.left && keyCode !== KeyCode.enter && keyCode !== KeyCode.space) { - return; - } - event.preventDefault(); - let nextIndex = highlightedSegmentIndex || 0; - const MAX = pieData.length - 1; - if (keyCode === KeyCode.right) { - nextIndex++; - if (nextIndex > MAX) { - nextIndex = 0; - } - } else if (keyCode === KeyCode.left) { - nextIndex--; - if (nextIndex < 0) { - nextIndex = MAX; - } - } - if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { - setPinnedSegment(pieData[nextIndex].data.datum); - } - highlightSegment(pieData[nextIndex].data); - }, [setPinnedSegment, highlightSegment, pieData, highlightedSegmentIndex]); - const onApplicationFocus = (0, import_react342.useCallback)((_event, target) => { - if (pinnedSegment !== null || popoverDismissedRecently.current || target === "mouse") { - return; - } - const segment = highlightedSegment || legendSegment || pieData[0].data.datum; - const matched = pieData.filter((d) => d.data.datum === segment); - highlightSegment(matched[0].data); - }, [pinnedSegment, pieData, highlightSegment, highlightedSegment, legendSegment]); - const onApplicationBlur = (0, import_react342.useCallback)((event) => { - const blurTarget = event.relatedTarget || event.target; - if (blurTarget === null || !(blurTarget instanceof Element) || !nodeBelongs(containerRef.current, blurTarget)) { - setPopoverOpen(false); - setPinnedSegment(null); - } - }, [setPinnedSegment]); - const onPopoverDismiss = (outsideClick) => { - setPopoverOpen(false); - setPinnedSegment(null); - if (!outsideClick) { - setTimeout(() => { - popoverDismissedRecently.current = true; - plotRef.current.focusApplication(); - popoverDismissedRecently.current = false; - }, 0); - } else { - onHighlightChange(null); - } - }; - return import_react342.default.createElement( - "div", - { className: clsx_m_default(styles_css_default106["chart-container"], fitHeight && styles_css_default106["chart-container--fit-height"]), ref: containerRef }, - import_react342.default.createElement( - "div", - { className: clsx_m_default(styles_css_default106["chart-container-chart-plot"], fitHeight && styles_css_default106["chart-container-chart-plot--fit-height"]) }, - import_react342.default.createElement( - chart_plot_default, - { ref: plotRef, width: "100%", height: fitHeight ? "100%" : height, transform: `translate(${width / 2} ${height / 2})`, isPrecise: true, isClickable: !isPopoverOpen, ariaLabel, ariaLabelledby, ariaDescription, ariaDescribedby: hasInnerContent ? innerMetricId : void 0, ariaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.chartAriaRoleDescription, activeElementRef: focusedSegmentRef, activeElementKey: highlightedSegmentIndex === null || highlightedSegmentIndex === void 0 ? void 0 : highlightedSegmentIndex.toString(), onApplicationFocus, onApplicationBlur, onKeyDown, onMouseOut: checkMouseLeave }, - import_react342.default.createElement(Segments, { pieData, dimensions, variant, focusedSegmentRef, popoverTrackRef, highlightedSegment, segmentAriaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.segmentAriaRoleDescription, onMouseDown, onMouseOver }), - hasLabels && import_react342.default.createElement(labels_default, { pieData, dimensions, segmentDescription, visibleDataSum: dataSum, hideTitles, hideDescriptions, highlightedSegment, containerRef }) - ) - ), - hasInnerContent && import_react342.default.createElement( - "div", - { className: styles_css_default106["inner-content"], id: innerMetricId }, - innerMetricValue && import_react342.default.createElement(InternalBox, { variant: dimensions.size === "small" ? "h3" : "h1", tagOverride: "div", color: "inherit", padding: "n" }, innerMetricValue), - innerMetricDescription && dimensions.size !== "small" && import_react342.default.createElement(InternalBox, { variant: "h3", color: "text-body-secondary", tagOverride: "div", padding: "n" }, innerMetricDescription) - ), - isPopoverOpen && popoverData && import_react342.default.createElement( - chart_popover_default, - { ref: popoverRef, title: popoverData.series && import_react342.default.createElement( - InternalBox, - { className: styles_css_default106["popover-header"], variant: "strong" }, - import_react342.default.createElement(chart_series_marker_default, { color: popoverData.series.color, type: popoverData.series.markerType }), - " ", - popoverData.series.label - ), trackRef: popoverData.trackRef, trackKey: popoverData.series.index, dismissButton: pinnedSegment !== null, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onDismiss: onPopoverDismiss, container: ((_b = plotRef.current) === null || _b === void 0 ? void 0 : _b.svg) || null, size: detailPopoverSize, onMouseLeave: checkMouseLeave, onBlur: onApplicationBlur }, - popoverContent, - detailPopoverFooterContent && import_react342.default.createElement(ChartPopoverFooter, null, detailPopoverFooterContent) - ), - import_react342.default.createElement(live_region_default, { source: [popoverContentRef] }) - ); -}; - -// node_modules/@cloudscape-design/components/pie-chart/index.js -var PieChart = function PieChart2(_a2) { - var { fitHeight, variant = "pie", size: size2 = "medium", hideTitles = false, hideDescriptions = false, hideLegend = false, hideFilter = false, statusType = "finished", data: externalData = [], i18nStrings = {}, highlightedSegment: controlledHighlightedSegment, visibleSegments: controlledVisibleSegments, onHighlightChange: controlledOnHighlightChange, onFilterChange, additionalFilters, legendTitle, detailPopoverSize = "medium" } = _a2, props2 = __rest(_a2, ["fitHeight", "variant", "size", "hideTitles", "hideDescriptions", "hideLegend", "hideFilter", "statusType", "data", "i18nStrings", "highlightedSegment", "visibleSegments", "onHighlightChange", "onFilterChange", "additionalFilters", "legendTitle", "detailPopoverSize"]); - const { __internalRootRef = null } = useBaseComponent("PieChart", { - props: { - fitHeight, - variant, - size: size2, - hideTitles, - hideDescriptions, - hideLegend, - hideFilter, - detailPopoverSize - } - }); - const baseProps = getBaseProps(props2); - const containerRef = (0, import_react343.useRef)(null); - const [containerWidth, measureRef] = useContainerWidth(); - const data = (0, import_react343.useMemo)(() => { - const colors = createCategoryColorScale(externalData, void 0, (it) => it.color || null); - return externalData.map((datum, i) => ({ - index: i, - color: colors[i], - datum - })); - }, [externalData]); - const [highlightedSegment = null, setHighlightedSegment] = useControllable2(controlledHighlightedSegment, controlledOnHighlightChange, null, { - componentName: "PieChart", - controlledProp: "highlightedSegment", - changeHandler: "onHighlightChange" - }); - const [legendSegment, setLegendSegment] = (0, import_react343.useState)(highlightedSegment); - (0, import_react343.useEffect)(() => { - setLegendSegment(controlledHighlightedSegment || null); - }, [controlledHighlightedSegment]); - const [visibleSegments, setVisibleSegments] = useControllable2(controlledVisibleSegments, onFilterChange, externalData, { - componentName: "PieChart", - controlledProp: "visibleSegments", - changeHandler: "onFilterChange" - }); - const visibleData = (0, import_react343.useMemo)(() => data.filter((d) => (visibleSegments === null || visibleSegments === void 0 ? void 0 : visibleSegments.indexOf(d.datum)) !== -1), [data, visibleSegments]); - const filterItems = data === null || data === void 0 ? void 0 : data.map((data2) => ({ - label: data2.datum.title, - color: data2.color, - type: "rectangle", - datum: data2.datum - })); - const legendItems = filterItems.filter((d) => (visibleSegments === null || visibleSegments === void 0 ? void 0 : visibleSegments.indexOf(d.datum)) !== -1); - const filterChange = (0, import_react343.useCallback)((selectedSeries) => { - setVisibleSegments(selectedSeries); - fireNonCancelableEvent(onFilterChange, { - visibleSegments: selectedSeries - }); - }, [setVisibleSegments, onFilterChange]); - const onHighlightChange = (0, import_react343.useCallback)((segment) => { - setLegendSegment(segment); - setHighlightedSegment(segment); - fireNonCancelableEvent(controlledOnHighlightChange, { highlightedSegment: segment }); - }, [controlledOnHighlightChange, setHighlightedSegment]); - const onBlur = (event) => { - if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { - highlightedSegment && onHighlightChange(null); - setLegendSegment(null); - } - }; - const mergedRef = useMergeRefs(containerRef, measureRef, __internalRootRef); - const { pieData, dataSum } = (0, import_react343.useMemo)(() => { - const dataSum2 = visibleData.reduce((sum2, d) => sum2 + d.datum.value, 0); - const pieFactory = pie_default().value((d) => d.datum.value < dataSum2 / 100 ? dataSum2 / 100 : d.datum.value).sort(null); - const pieData2 = pieFactory(visibleData.filter((d) => d.datum.value > 0)); - return { pieData: pieData2, dataSum: dataSum2 }; - }, [visibleData]); - const hasNoData = !externalData || externalData.length === 0; - const { isEmpty, showChart } = getChartStatus({ externalData: data, visibleData: pieData, statusType }); - const isNoMatch = isEmpty && visibleData.length !== data.length; - const showFilters = statusType === "finished" && !hasNoData && (additionalFilters || !hideFilter); - const reserveLegendSpace = !showChart && !hideLegend; - const reserveFilterSpace = statusType !== "finished" && !isNoMatch && (!hideFilter || additionalFilters); - const hasLabels = !(hideTitles && hideDescriptions); - const isRefresh = useVisualRefresh(); - const defaultDimensions = getDimensionsBySize({ size: size2, hasLabels, visualRefresh: isRefresh }); - const radius = defaultDimensions.outerRadius; - const height = 2 * (radius + defaultDimensions.padding + (hasLabels ? defaultDimensions.paddingLabels : 0)); - return import_react343.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef, fitHeight: !!fitHeight }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default106.root), contentClassName: clsx_m_default(styles_css_default106.content, styles_css_default106[`content--${defaultDimensions.size}`], { - [styles_css_default106["content--without-labels"]]: !hasLabels, - [styles_css_default106["content--fit-height"]]: fitHeight - }), defaultFilter: showFilters && !hideFilter ? import_react343.default.createElement(chart_filter_default, { series: filterItems, onChange: filterChange, selectedSeries: visibleSegments, i18nStrings }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react343.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty: props2.empty, noMatch: props2.noMatch, loadingText: props2.loadingText, errorText: props2.errorText, recoveryText: props2.recoveryText, onRecoveryClick: props2.onRecoveryClick }), chart: showChart ? import_react343.default.createElement(pie_chart_default, Object.assign({}, props2, { variant, size: size2, height, fitHeight, data: externalData, width: containerWidth, hideTitles, hideDescriptions, i18nStrings, onHighlightChange, highlightedSegment, legendSegment, detailPopoverSize, pieData, dataSum })) : null, legend: !hideLegend && !hasNoData && statusType === "finished" && import_react343.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: legendSegment, legendTitle, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.legendAriaLabel, onHighlightChange, plotContainerRef: containerRef }), onBlur })); -}; -applyDisplayName(PieChart, "PieChart"); -var pie_chart_default2 = PieChart; - -// node_modules/@cloudscape-design/components/popover/index.js -var import_react344 = __toESM(require_react()); -function Popover(_a2) { - var { position = "right", size: size2 = "medium", fixedWidth = false, triggerType = "text", dismissButton: dismissButton2 = true, renderWithPortal = false, header } = _a2, rest = __rest(_a2, ["position", "size", "fixedWidth", "triggerType", "dismissButton", "renderWithPortal", "header"]); - if (isDevelopment2) { - if (dismissButton2 && !header) { - warnOnce("Popover", `You should provide a \`header\` when \`dismissButton\` is true.`); - } - } - const baseComponentProps = useBaseComponent("Popover", { - props: { dismissButton: dismissButton2, fixedWidth, position, renderWithPortal, size: size2, triggerType } - }); - const externalProps = getExternalProps(rest); - return import_react344.default.createElement(internal_default15, Object.assign({ header, position, size: size2, fixedWidth, triggerType, dismissButton: dismissButton2, renderWithPortal }, externalProps, baseComponentProps)); -} -applyDisplayName(Popover, "Popover"); - -// node_modules/@cloudscape-design/components/progress-bar/index.js -var import_react346 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/progress-bar/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/progress-bar/styles.scoped.css"; -var styles_css_default107 = { - "progress": "awsui_progress_11huc_1ah81_197", - "result-state": "awsui_result-state_11huc_1ah81_211", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_1ah81_1", - "root": "awsui_root_11huc_1ah81_233", - "with-result-button": "awsui_with-result-button_11huc_1ah81_268", - "result-text": "awsui_result-text_11huc_1ah81_272", - "result-container-error": "awsui_result-container-error_11huc_1ah81_276", - "result-container-success": "awsui_result-container-success_11huc_1ah81_276", - "result-button": "awsui_result-button_11huc_1ah81_280", - "word-wrap": "awsui_word-wrap_11huc_1ah81_286", - "label-flash": "awsui_label-flash_11huc_1ah81_291", - "label-key-value": "awsui_label-key-value_11huc_1ah81_295", - "flash": "awsui_flash_11huc_1ah81_303", - "progress-container": "awsui_progress-container_11huc_1ah81_307", - "percentage-container": "awsui_percentage-container_11huc_1ah81_314", - "percentage": "awsui_percentage_11huc_1ah81_314", - "complete": "awsui_complete_11huc_1ah81_360", - "progress-in-flash": "awsui_progress-in-flash_11huc_1ah81_388" -}; - -// node_modules/@cloudscape-design/components/progress-bar/internal.js -var import_react345 = __toESM(require_react()); -var MAX_VALUE = 100; -var clamp2 = (value, lowerLimit, upperLimit) => { - return Math.max(Math.min(value, upperLimit), lowerLimit); -}; -var Progress = ({ value, isInFlash, ariaLabel, ariaLabelledby }) => { - const roundedValue = Math.round(value); - const progressValue = clamp2(roundedValue, 0, MAX_VALUE); - return import_react345.default.createElement( - "div", - { className: styles_css_default107["progress-container"] }, - import_react345.default.createElement("progress", { className: clsx_m_default(styles_css_default107.progress, progressValue >= MAX_VALUE && styles_css_default107.complete, isInFlash && styles_css_default107["progress-in-flash"]), max: MAX_VALUE, value: progressValue, "aria-label": ariaLabel, "aria-labelledby": !ariaLabel ? ariaLabelledby : void 0 }), - import_react345.default.createElement( - "span", - { "aria-hidden": "true", className: styles_css_default107["percentage-container"] }, - import_react345.default.createElement(InternalBox, { className: styles_css_default107.percentage, variant: "small", color: isInFlash ? "inherit" : void 0 }, `${progressValue}%`) - ) - ); -}; -var SmallText = ({ color: color2, children: children2 }) => { - return import_react345.default.createElement(InternalBox, { className: styles_css_default107["word-wrap"], variant: "small", display: "block", color: color2 }, children2); -}; -var ResultButton = ({ onClick, children: children2 }) => { - return import_react345.default.createElement( - "div", - { className: styles_css_default107["result-button"] }, - import_react345.default.createElement(InternalButton, { formAction: "none", onClick }, children2) - ); -}; -var ResultState = ({ isInFlash, resultText, resultButtonText, status, onClick }) => { - const hasResultButton = !!resultButtonText; - if (isInFlash) { - return import_react345.default.createElement( - "div", - { className: styles_css_default107[`result-container-${status}`], "aria-live": "polite", "aria-atomic": "true" }, - import_react345.default.createElement("span", { className: styles_css_default107["result-text"] }, resultText) - ); - } - return import_react345.default.createElement( - "div", - { className: styles_css_default107[`result-container-${status}`], "aria-live": "polite", "aria-atomic": "true" }, - import_react345.default.createElement( - "span", - { className: clsx_m_default(hasResultButton && styles_css_default107["with-result-button"]) }, - import_react345.default.createElement( - StatusIndicator, - { type: status === "success" ? "success" : "error" }, - import_react345.default.createElement("span", { className: styles_css_default107["result-text"] }, resultText) - ) - ), - hasResultButton && import_react345.default.createElement(ResultButton, { onClick }, resultButtonText) - ); -}; - -// node_modules/@cloudscape-design/components/progress-bar/index.js -var ASSERTION_FREQUENCY = 5e3; -function ProgressBar(_a2) { - var { value = 0, status = "in-progress", variant = "standalone", resultButtonText, label, ariaLabel, ariaLabelledby, description, additionalInfo, resultText, onResultButtonClick } = _a2, rest = __rest(_a2, ["value", "status", "variant", "resultButtonText", "label", "ariaLabel", "ariaLabelledby", "description", "additionalInfo", "resultText", "onResultButtonClick"]); - const { __internalRootRef } = useBaseComponent("ProgressBar", { - props: { variant } - }); - const baseProps = getBaseProps(rest); - const generatedName = useUniqueId("awsui-progress-bar-"); - const labelId = `${generatedName}-label`; - const isInFlash = variant === "flash"; - const isInProgressState = status === "in-progress"; - const [announcedValue, setAnnouncedValue] = (0, import_react346.useState)(""); - const throttledAssertion = (0, import_react346.useMemo)(() => { - return throttle((value2) => { - setAnnouncedValue(`${value2}%`); - }, ASSERTION_FREQUENCY); - }, []); - (0, import_react346.useEffect)(() => { - throttledAssertion(value); - }, [throttledAssertion, value]); - if (isInFlash && resultButtonText) { - warnOnce("ProgressBar", 'The `resultButtonText` is ignored if you set `variant="flash"`, and the result button is not displayed. Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item in which the progress bar component is embedded.'); - } - return import_react346.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default107.root, variant && styles_css_default107[variant]), ref: __internalRootRef }), - import_react346.default.createElement( - "div", - { className: isInFlash ? styles_css_default107["flash-container"] : void 0 }, - import_react346.default.createElement("div", { className: clsx_m_default(styles_css_default107["word-wrap"], styles_css_default107[`label-${variant}`]), id: labelId }, label), - description && import_react346.default.createElement(SmallText, { color: isInFlash ? "inherit" : void 0 }, description), - import_react346.default.createElement("div", null, isInProgressState ? import_react346.default.createElement( - import_react346.default.Fragment, - null, - import_react346.default.createElement(Progress, { value, ariaLabel, ariaLabelledby: joinStrings(labelId, ariaLabelledby), isInFlash }), - import_react346.default.createElement( - live_region_default, - { delay: 0 }, - label, - label ? ": " : null, - announcedValue - ) - ) : import_react346.default.createElement(ResultState, { resultText, isInFlash, resultButtonText, status, onClick: () => { - fireNonCancelableEvent(onResultButtonClick); - } })) - ), - additionalInfo && import_react346.default.createElement(SmallText, { color: isInFlash ? "inherit" : void 0 }, additionalInfo) - ); -} -applyDisplayName(ProgressBar, "ProgressBar"); - -// node_modules/@cloudscape-design/components/property-filter/index.js -var import_react354 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/property-filter/token.js -var import_react350 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/property-filter/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/property-filter/styles.scoped.css"; -var styles_css_default108 = { - "root": "awsui_root_1wzqe_d6xov_99", - "search-field": "awsui_search-field_1wzqe_d6xov_134", - "input-wrapper": "awsui_input-wrapper_1wzqe_d6xov_140", - "add-token": "awsui_add-token_1wzqe_d6xov_144", - "tokens": "awsui_tokens_1wzqe_d6xov_151", - "token-operator": "awsui_token-operator_1wzqe_d6xov_156", - "property-editor": "awsui_property-editor_1wzqe_d6xov_160", - "token-editor": "awsui_token-editor_1wzqe_d6xov_161", - "property-editor-form": "awsui_property-editor-form_1wzqe_d6xov_166", - "token-editor-form": "awsui_token-editor-form_1wzqe_d6xov_167", - "property-editor-field-property": "awsui_property-editor-field-property_1wzqe_d6xov_170", - "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_d6xov_171", - "property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_d6xov_174", - "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_d6xov_175", - "property-editor-field-value": "awsui_property-editor-field-value_1wzqe_d6xov_178", - "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_d6xov_179", - "property-editor-cancel": "awsui_property-editor-cancel_1wzqe_d6xov_182", - "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_d6xov_183", - "property-editor-submit": "awsui_property-editor-submit_1wzqe_d6xov_186", - "token-editor-submit": "awsui_token-editor-submit_1wzqe_d6xov_187", - "property-editor-actions": "awsui_property-editor-actions_1wzqe_d6xov_190", - "token-editor-actions": "awsui_token-editor-actions_1wzqe_d6xov_191", - "custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_d6xov_209", - "custom-control": "awsui_custom-control_1wzqe_d6xov_213", - "input": "awsui_input_1wzqe_d6xov_140", - "results": "awsui_results_1wzqe_d6xov_221", - "token-trigger": "awsui_token-trigger_1wzqe_d6xov_226", - "remove-all": "awsui_remove-all_1wzqe_d6xov_231", - "token-label": "awsui_token-label_1wzqe_d6xov_232", - "join-operation": "awsui_join-operation_1wzqe_d6xov_233", - "custom-filter-actions": "awsui_custom-filter-actions_1wzqe_d6xov_234" -}; - -// node_modules/@cloudscape-design/components/property-filter/token-editor.js -var import_react348 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/property-filter/use-load-items.js -var import_react347 = __toESM(require_react()); -var useLoadItems2 = (onLoadItems, focusFilteringText, currentFilteringProperty, currentFilteringText, currentFilteringOperator) => { - const focusIn = (0, import_react347.useRef)(false); - const handleBlur = () => { - focusIn.current = true; - }; - const fireLoadItems = (detail) => { - var _a2; - fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, detail), { filteringText: (_a2 = currentFilteringText !== null && currentFilteringText !== void 0 ? currentFilteringText : detail.filteringText) !== null && _a2 !== void 0 ? _a2 : "", filteringProperty: currentFilteringProperty, filteringOperator: currentFilteringOperator })); - focusIn.current = false; - }; - const handleFocus = () => { - if (focusIn.current) { - fireLoadItems({ firstPage: true, samePage: false, filteringText: focusFilteringText }); - } - }; - const handleLoadItems = ({ detail }) => fireLoadItems(detail); - return { - onBlur: handleBlur, - onFocus: handleFocus, - onLoadItems: handleLoadItems - }; -}; - -// node_modules/@cloudscape-design/components/property-filter/utils.js -function matchFilteringProperty(filteringProperties, filteringText) { - let maxLength = 0; - let matchedProperty = null; - for (const property of filteringProperties) { - if (property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel) || property.propertyLabel.length > maxLength && startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase())) { - maxLength = property.propertyLabel.length; - matchedProperty = property; - } - } - return matchedProperty; -} -function matchOperator(allowedOperators, filteringText) { - filteringText = filteringText.toLowerCase(); - let maxLength = 0; - let matchedOperator = null; - for (const operator of allowedOperators) { - if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) { - maxLength = operator.length; - matchedOperator = operator; - } - } - return matchedOperator; -} -function matchOperatorPrefix(allowedOperators, filteringText) { - if (filteringText.trim().length === 0) { - return ""; - } - for (const operator of allowedOperators) { - if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) { - return filteringText; - } - } - return null; -} -function matchTokenValue({ property, operator, value }, filteringOptions) { - var _a2, _b; - const propertyOptions = filteringOptions.filter((option) => option.property === property); - const bestMatch = { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value }; - for (const option of propertyOptions) { - if (option.label && option.label === value || !option.label && option.value === value) { - return { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value: option.value }; - } - if (typeof value === "string" && value.toLowerCase() === ((_b = (_a2 = option.label) !== null && _a2 !== void 0 ? _a2 : option.value) !== null && _b !== void 0 ? _b : "").toLowerCase()) { - bestMatch.value = option.value; - } - } - return bestMatch; -} -function getFormattedToken(token) { - var _a2; - const valueFormatter = (_a2 = token.property) === null || _a2 === void 0 ? void 0 : _a2.getValueFormatter(token.operator); - const propertyLabel = token.property && token.property.propertyLabel; - const tokenValue = valueFormatter ? valueFormatter(token.value) : token.value; - const label = `${propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : ""} ${token.operator} ${tokenValue}`; - return { property: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : "", operator: token.operator, value: tokenValue, label }; -} -function trimStart(source) { - let spacesLength = 0; - for (let i = 0; i < source.length; i++) { - if (source[i] === " ") { - spacesLength++; - } else { - break; - } - } - return source.slice(spacesLength); -} -function trimFirstSpace(source) { - return source[0] === " " ? source.slice(1) : source; -} -function removeOperator(source, operator) { - const operatorLastIndex = source.indexOf(operator) + operator.length; - const textWithoutOperator = source.slice(operatorLastIndex); - return trimFirstSpace(textWithoutOperator); -} -function startsWith(source, target) { - return source.indexOf(target) === 0; -} - -// node_modules/@cloudscape-design/components/property-filter/controller.js -var getQueryActions = (query, onChange, inputRef) => { - const { tokens, operation } = query; - const fireOnChange = (tokens2, operation2) => fireNonCancelableEvent(onChange, { tokens: tokens2, operation: operation2 }); - const setToken = (index, newToken) => { - const newTokens = [...tokens]; - if (newTokens && index < newTokens.length) { - newTokens[index] = newToken; - } - fireOnChange(newTokens, operation); - }; - const removeToken = (index) => { - var _a2; - const newTokens = tokens.filter((_, i) => i !== index); - fireOnChange(newTokens, operation); - (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventDropdown: true }); - }; - const removeAllTokens = () => { - var _a2; - fireOnChange([], operation); - (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventDropdown: true }); - }; - const addToken = (newToken) => { - const newTokens = [...tokens]; - newTokens.push(newToken); - fireOnChange(newTokens, operation); - }; - const setOperation = (newOperation) => { - fireOnChange(tokens, newOperation); - }; - return { - setToken, - removeToken, - removeAllTokens, - addToken, - setOperation - }; -}; -var getAllowedOperators = (property) => { - const { operators = [], defaultOperator } = property; - const operatorOrder = ["=", "!=", ":", "!:", "^", "!^", ">=", "<=", "<", ">"]; - const operatorSet = /* @__PURE__ */ new Set([defaultOperator, ...operators]); - return operatorOrder.filter((op) => operatorSet.has(op)); -}; -var parseText = (filteringText, filteringProperties, freeTextFiltering) => { - const property = matchFilteringProperty(filteringProperties, filteringText); - if (!property) { - if (!freeTextFiltering.disabled) { - const freeTextOperators = freeTextFiltering.operators.indexOf("!:") >= 0 ? ["!", ...freeTextFiltering.operators] : freeTextFiltering.operators; - const operator2 = matchOperator(freeTextOperators, filteringText); - if (operator2) { - return { - step: "free-text", - operator: operator2 === "!" ? "!:" : operator2, - value: removeOperator(filteringText, operator2) - }; - } - } - return { - step: "free-text", - value: filteringText - }; - } - const allowedOps = getAllowedOperators(property); - const textWithoutProperty = filteringText.substring(property.propertyLabel.length); - const operator = matchOperator(allowedOps, trimStart(textWithoutProperty)); - if (operator) { - return { - step: "property", - property, - operator, - value: removeOperator(textWithoutProperty, operator) - }; - } - const operatorPrefix = matchOperatorPrefix(allowedOps, trimStart(textWithoutProperty)); - if (operatorPrefix !== null) { - return { step: "operator", property, operatorPrefix }; - } - return { - step: "free-text", - value: filteringText - }; -}; -var getAllValueSuggestions = (filteringOptions, operator = "=", i18nStrings, customGroupsText) => { - var _a2; - const defaultGroup = { - label: (_a2 = i18nStrings.groupValuesText) !== null && _a2 !== void 0 ? _a2 : "", - options: [] - }; - const customGroups = {}; - filteringOptions.forEach((filteringOption) => { - const property = filteringOption.property; - if (!property) { - return; - } - if (getAllowedOperators(property).indexOf(operator) === -1) { - return; - } - if (property.propertyGroup && !customGroups[property.propertyGroup]) { - const label = customGroupsText.reduce((acc, customGroup) => customGroup.group === property.propertyGroup ? customGroup.values : acc, ""); - customGroups[property.propertyGroup] = { - label, - options: [] - }; - } - const propertyGroup = property.propertyGroup ? customGroups[property.propertyGroup] : defaultGroup; - propertyGroup.options.push({ - value: property.propertyLabel + " " + (operator || "=") + " " + filteringOption.value, - label: filteringOption.label, - __labelPrefix: property.propertyLabel + " " + (operator || "=") - }); - }); - return [defaultGroup, ...Object.keys(customGroups).map((group) => customGroups[group])]; -}; -function createPropertiesCompatibilityMap(filteringProperties) { - const lookup = {}; - for (const property of filteringProperties) { - lookup[property.propertyKey] = (property.operators || []).map((operator) => ({ operator, form: property.getValueFormRenderer(operator) })).sort((a2, b) => a2.operator.localeCompare(b.operator)); - } - return (propertyA, propertyB) => { - if (lookup[propertyA].length !== lookup[propertyB].length) { - return false; - } - for (let i = 0; i < lookup[propertyA].length; i++) { - if (lookup[propertyA][i].operator !== lookup[propertyB][i].operator) { - return false; - } - if (lookup[propertyA][i].form !== lookup[propertyB][i].form) { - return false; - } - } - return true; - }; -} -var filteringPropertyToAutosuggestOption = (filteringProperty) => ({ - value: filteringProperty.propertyLabel, - label: filteringProperty.propertyLabel, - keepOpenOnSelect: true -}); -function getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToOption) { - var _a2; - const defaultGroup = { - label: (_a2 = i18nStrings.groupPropertiesText) !== null && _a2 !== void 0 ? _a2 : "", - options: [] - }; - const customGroups = {}; - filteringProperties.forEach((filteringProperty) => { - const { propertyGroup } = filteringProperty; - let optionsGroup = defaultGroup; - if (propertyGroup) { - if (!customGroups[propertyGroup]) { - const label = customGroupsText.reduce((acc, customGroup) => customGroup.group === propertyGroup ? customGroup.properties : acc, ""); - customGroups[propertyGroup] = { options: [], label }; - } - optionsGroup = customGroups[propertyGroup]; - } - optionsGroup.options.push(filteringPropertyToOption(filteringProperty)); - }); - const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : []; - const customGroupsArray = Object.keys(customGroups).map((groupKey) => customGroups[groupKey]); - return [...defaultGroupArray, ...customGroupsArray]; -} -var getAutosuggestOptions = (parsedText, filteringProperties, filteringOptions, customGroupsText, i18nStrings) => { - switch (parsedText.step) { - case "property": { - const { propertyLabel, groupValuesLabel } = parsedText.property; - const options = filteringOptions.filter((o) => o.property === parsedText.property); - return { - filterText: parsedText.value, - options: [ - { - options: options.map(({ label, value }) => ({ - value: propertyLabel + " " + parsedText.operator + " " + value, - label, - __labelPrefix: propertyLabel + " " + parsedText.operator - })), - label: groupValuesLabel - } - ] - }; - } - case "operator": { - return { - filterText: parsedText.property.propertyLabel + " " + parsedText.operatorPrefix, - options: [ - ...getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToAutosuggestOption), - { - options: getAllowedOperators(parsedText.property).map((value) => ({ - value: parsedText.property.propertyLabel + " " + value + " ", - label: parsedText.property.propertyLabel + " " + value, - description: operatorToDescription(value, i18nStrings), - keepOpenOnSelect: true - })), - label: i18nStrings.operatorsText - } - ] - }; - } - case "free-text": { - const needsValueSuggestions = !!parsedText.value; - const needsPropertySuggestions = !(parsedText.step === "free-text" && parsedText.operator === "!:"); - return { - filterText: parsedText.value, - options: [ - ...needsPropertySuggestions ? getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToAutosuggestOption) : [], - ...needsValueSuggestions ? getAllValueSuggestions(filteringOptions, parsedText.operator, i18nStrings, customGroupsText) : [] - ] - }; - } - } -}; -var operatorToDescription = (operator, i18nStrings) => { - switch (operator) { - case "<": - return i18nStrings.operatorLessText; - case "<=": - return i18nStrings.operatorLessOrEqualText; - case ">": - return i18nStrings.operatorGreaterText; - case ">=": - return i18nStrings.operatorGreaterOrEqualText; - case ":": - return i18nStrings.operatorContainsText; - case "!:": - return i18nStrings.operatorDoesNotContainText; - case "=": - return i18nStrings.operatorEqualsText; - case "!=": - return i18nStrings.operatorDoesNotEqualText; - case "^": - return i18nStrings.operatorStartsWithText; - case "!^": - return i18nStrings.operatorDoesNotStartWithText; - default: - return ""; - } -}; - -// node_modules/@cloudscape-design/components/property-filter/token-editor.js -function PropertyInput({ property, onChangePropertyKey, asyncProps, filteringProperties, onLoadItems, customGroupsText, i18nStrings, freeTextFiltering }) { - var _a2; - const propertySelectHandlers = useLoadItems2(onLoadItems); - const asyncPropertySelectProps = asyncProps ? Object.assign(Object.assign({}, asyncProps), propertySelectHandlers) : {}; - const propertyOptions = getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, ({ propertyKey, propertyLabel }) => ({ - value: propertyKey, - label: propertyLabel, - dontCloseOnSelect: true - })); - const checkPropertiesCompatible = createPropertiesCompatibilityMap(filteringProperties); - propertyOptions.forEach((optionGroup) => { - if ("options" in optionGroup) { - optionGroup.options.forEach((option) => { - if ((property === null || property === void 0 ? void 0 : property.propertyKey) && option.value) { - option.disabled = !checkPropertiesCompatible(option.value, property.propertyKey); - } - }); - } - }); - const allPropertiesOption = { - label: i18nStrings.allPropertiesLabel, - value: void 0 - }; - if (!freeTextFiltering.disabled) { - propertyOptions.unshift(allPropertiesOption); - } - return import_react348.default.createElement(internal_default12, Object.assign({ options: propertyOptions, selectedOption: property ? { - value: (_a2 = property.propertyKey) !== null && _a2 !== void 0 ? _a2 : void 0, - label: property.propertyLabel - } : allPropertiesOption, onChange: (e) => onChangePropertyKey(e.detail.selectedOption.value) }, asyncPropertySelectProps)); -} -function OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering }) { - const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map((operator2) => ({ - value: operator2, - label: operator2, - description: operatorToDescription(operator2, i18nStrings) - })); - return import_react348.default.createElement(internal_default12, { options: operatorOptions, triggerVariant: "option", selectedOption: operator ? { - value: operator, - label: operator, - description: operatorToDescription(operator, i18nStrings) - } : null, onChange: (e) => onChangeOperator(e.detail.selectedOption.value) }); -} -function ValueInput({ property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings }) { - var _a2, _b, _c; - const valueOptions = property ? filteringOptions.filter((option) => { - var _a3; - return ((_a3 = option.property) === null || _a3 === void 0 ? void 0 : _a3.propertyKey) === property.propertyKey; - }).map(({ label, value: value2 }) => ({ label, value: value2 })) : []; - const valueAutosuggestHandlers = useLoadItems2(onLoadItems, "", property === null || property === void 0 ? void 0 : property.externalProperty); - const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey) ? Object.assign(Object.assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty }; - const [matchedOption] = valueOptions.filter((option) => option.value === value); - const OperatorForm = (property === null || property === void 0 ? void 0 : property.propertyKey) && operator && (property === null || property === void 0 ? void 0 : property.getValueFormRenderer(operator)); - return OperatorForm ? import_react348.default.createElement(OperatorForm, { value, onChange: onChangeValue, operator }) : import_react348.default.createElement(internal_default10, Object.assign({ enteredTextLabel: (_a2 = i18nStrings.enteredTextLabel) !== null && _a2 !== void 0 ? _a2 : (value2) => value2, value: (_c = (_b = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : "", clearAriaLabel: i18nStrings.clearAriaLabel, onChange: (e) => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })); -} -function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, expandToViewport, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, token, triggerComponent }) { - const [temporaryToken, setTemporaryToken] = (0, import_react348.useState)(token); - const popoverRef = (0, import_react348.useRef)(null); - const closePopover = () => { - popoverRef.current && popoverRef.current.dismissPopover(); - }; - const property = temporaryToken.property; - const onChangePropertyKey = (newPropertyKey) => { - var _a2; - const filteringProperty = filteringProperties.reduce((acc, property2) => property2.propertyKey === newPropertyKey ? property2 : acc, void 0); - const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators; - const operator2 = temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1 ? temporaryToken.operator : allowedOperators[0]; - const matchedProperty = (_a2 = filteringProperties.find((property2) => property2.propertyKey === newPropertyKey)) !== null && _a2 !== void 0 ? _a2 : null; - setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { property: matchedProperty, operator: operator2 })); - }; - const operator = temporaryToken.operator; - const onChangeOperator = (newOperator) => { - setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { operator: newOperator })); - }; - const value = temporaryToken.value; - const onChangeValue = (newValue) => { - setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { value: newValue })); - }; - return import_react348.default.createElement(internal_default15, { ref: popoverRef, className: styles_css_default108["token-label"], triggerType: "text", header: i18nStrings.editTokenHeader, size: "large", position: "right", dismissAriaLabel: i18nStrings.dismissAriaLabel, __onOpen: () => setTemporaryToken(token), renderWithPortal: expandToViewport, content: import_react348.default.createElement( - "div", - { className: styles_css_default108["token-editor"] }, - import_react348.default.createElement( - "div", - { className: styles_css_default108["token-editor-form"] }, - import_react348.default.createElement( - InternalFormField, - { label: i18nStrings.propertyText, className: styles_css_default108["token-editor-field-property"] }, - import_react348.default.createElement(PropertyInput, { property, onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties, onLoadItems, customGroupsText, i18nStrings, freeTextFiltering }) - ), - import_react348.default.createElement( - InternalFormField, - { label: i18nStrings.operatorText, className: styles_css_default108["token-editor-field-operator"] }, - import_react348.default.createElement(OperatorInput, { property, operator, onChangeOperator, i18nStrings, freeTextFiltering }) - ), - import_react348.default.createElement( - InternalFormField, - { label: i18nStrings.valueText, className: styles_css_default108["token-editor-field-value"] }, - import_react348.default.createElement(ValueInput, { property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings }) - ) - ), - import_react348.default.createElement( - "div", - { className: styles_css_default108["token-editor-actions"] }, - import_react348.default.createElement(internal_default2, { formAction: "none", variant: "link", className: styles_css_default108["token-editor-cancel"], onClick: closePopover }, i18nStrings.cancelActionText), - import_react348.default.createElement(internal_default2, { className: styles_css_default108["token-editor-submit"], formAction: "none", onClick: () => { - setToken(matchTokenValue(temporaryToken, filteringOptions)); - closePopover(); - } }, i18nStrings.applyActionText) - ) - ) }, triggerComponent); -} - -// node_modules/@cloudscape-design/components/internal/components/filtering-token/index.js -var import_react349 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/filtering-token/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/filtering-token/styles.scoped.css"; -var styles_css_default109 = { - "root": "awsui_root_10m3l_ilcbp_103", - "token": "awsui_token_10m3l_ilcbp_108", - "show-operation": "awsui_show-operation_10m3l_ilcbp_123", - "select": "awsui_select_10m3l_ilcbp_129", - "token-content": "awsui_token-content_10m3l_ilcbp_133", - "dismiss-button": "awsui_dismiss-button_10m3l_ilcbp_138", - "token-disabled": "awsui_token-disabled_10m3l_ilcbp_180" -}; - -// node_modules/@cloudscape-design/components/internal/components/filtering-token/index.js -function FilteringToken({ ariaLabel, showOperation, operation, andText, orText, dismissAriaLabel, operatorAriaLabel, disabled, children: children2, onChange, onDismiss }) { - return import_react349.default.createElement( - "div", - { className: styles_css_default109.root, role: "group", "aria-label": ariaLabel }, - showOperation && import_react349.default.createElement(internal_default12, { __inFilteringToken: true, className: styles_css_default109.select, options: [ - { value: "and", label: andText }, - { value: "or", label: orText } - ], selectedOption: { value: operation, label: operation === "and" ? andText : orText }, onChange: (e) => onChange(e.detail.selectedOption.value), disabled, ariaLabel: operatorAriaLabel }), - import_react349.default.createElement( - "div", - { className: clsx_m_default(styles_css_default109.token, showOperation && styles_css_default109["show-operation"], disabled && styles_css_default109["token-disabled"]), "aria-disabled": disabled }, - import_react349.default.createElement("div", { className: styles_css_default109["token-content"] }, children2), - import_react349.default.createElement( - "button", - { type: "button", className: styles_css_default109["dismiss-button"], "aria-label": dismissAriaLabel, onClick: onDismiss, disabled }, - import_react349.default.createElement(internal_default, { name: "close" }) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/property-filter/token.js -var TokenButton = ({ token, operation = "and", first, removeToken, setToken, setOperation, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport }) => { - var _a2, _b, _c, _d; - const externalToken = Object.assign(Object.assign({}, token), { propertyKey: (_a2 = token.property) === null || _a2 === void 0 ? void 0 : _a2.propertyKey }); - const formattedToken = getFormattedToken(token); - return import_react350.default.createElement( - FilteringToken, - { ariaLabel: formattedToken.label, showOperation: !first && !hideOperations, operation, andText: (_b = i18nStrings.operationAndText) !== null && _b !== void 0 ? _b : "", orText: (_c = i18nStrings.operationOrText) !== null && _c !== void 0 ? _c : "", dismissAriaLabel: (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeTokenButtonAriaLabel) === null || _d === void 0 ? void 0 : _d.call(i18nStrings, externalToken), operatorAriaLabel: i18nStrings.tokenOperatorAriaLabel, onChange: setOperation, onDismiss: removeToken, disabled }, - import_react350.default.createElement(TokenEditor, { setToken, triggerComponent: import_react350.default.createElement( - "span", - { className: styles_css_default108["token-trigger"] }, - import_react350.default.createElement(TokenTrigger, { property: formattedToken.property, operator: token.operator, value: formattedToken.value }) - ), filteringProperties, filteringOptions, token, asyncProps, onLoadItems, i18nStrings, asyncProperties, customGroupsText, freeTextFiltering, expandToViewport }) - ); -}; -var TokenTrigger = ({ property, operator, value }) => { - if (property) { - property += " "; - } - const freeTextContainsToken = operator === ":" && !property; - const operatorText = freeTextContainsToken ? "" : operator + " "; - return import_react350.default.createElement( - import_react350.default.Fragment, - null, - property, - import_react350.default.createElement("span", { className: styles_css_default108["token-operator"] }, operatorText), - value - ); -}; - -// node_modules/@cloudscape-design/components/property-filter/property-filter-autosuggest.js -var import_react351 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/property-filter/filter-options.js -function filterOptions3(options, searchText = "") { - if (!searchText) { - return options; - } - const filtered = []; - for (const option of options) { - if (isGroup4(option)) { - const childOptions = filterOptions3(option.options, searchText); - if (childOptions.length > 0) { - filtered.push(Object.assign(Object.assign({}, option), { options: childOptions })); - } - } else if (matchSingleOption2(option, searchText)) { - filtered.push(option); - } - } - return filtered; -} -function isGroup4(optionOrGroup) { - return "options" in optionOrGroup; -} -function matchSingleOption2(option, searchText) { - var _a2, _b; - searchText = searchText.toLowerCase(); - const label = ((_a2 = option.label) !== null && _a2 !== void 0 ? _a2 : "").toLowerCase(); - const labelPrefix = (_b = option.__labelPrefix) !== null && _b !== void 0 ? _b : ""; - const value = (option.value ? option.value.slice(labelPrefix.length) : "").toLowerCase(); - return label.indexOf(searchText) !== -1 || value.indexOf(searchText) !== -1; -} - -// node_modules/@cloudscape-design/components/property-filter/property-filter-autosuggest.js -var DROPDOWN_WIDTH_OPTIONS_LIST = 300; -var DROPDOWN_WIDTH_CUSTOM_FORM = 200; -var PropertyFilterAutosuggest = import_react351.default.forwardRef((props2, ref) => { - var _a2; - const { value, onChange, onFocus, onBlur, onLoadItems, options, statusType = "finished", placeholder, disabled, ariaLabel, enteredTextLabel, onKeyDown, virtualScroll, expandToViewport, customForm, filterText, onOptionClick, hideEnteredTextOption, searchResultsId } = props2, rest = __rest(props2, ["value", "onChange", "onFocus", "onBlur", "onLoadItems", "options", "statusType", "placeholder", "disabled", "ariaLabel", "enteredTextLabel", "onKeyDown", "virtualScroll", "expandToViewport", "customForm", "filterText", "onOptionClick", "hideEnteredTextOption", "searchResultsId"]); - const highlightText = filterText === void 0 ? value : filterText; - const customFormRef = (0, import_react351.useRef)(null); - const autosuggestInputRef = (0, import_react351.useRef)(null); - const mergedRef = useMergeRefs(autosuggestInputRef, ref); - const filteredOptions = (0, import_react351.useMemo)(() => filterOptions3(options || [], highlightText), [options, highlightText]); - const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({ - options: filteredOptions, - filterValue: value, - filterText: highlightText, - filteringType: "manual", - enteredTextLabel, - hideEnteredTextLabel: hideEnteredTextOption, - onSelectItem: (option) => { - var _a3; - const value2 = option.value || ""; - fireNonCancelableEvent(onChange, { value: value2 }); - const selectedCancelled = fireCancelableEvent(onOptionClick, option); - if (!selectedCancelled) { - (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.close(); - } else { - autosuggestItemsHandlers.resetHighlightWithKeyboard(); - } - } - }); - const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({ - options, - statusType, - onLoadItems: (detail) => fireNonCancelableEvent(onLoadItems, detail) - }); - const handleChange = (event) => { - autosuggestItemsHandlers.resetHighlightWithKeyboard(); - fireNonCancelableEvent(onChange, event.detail); - }; - const handleDelayedInput = (event) => { - autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value); - }; - const handleFocus = () => { - autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus(); - fireCancelableEvent(onFocus, null); - }; - const handleBlur = () => { - fireCancelableEvent(onBlur, null); - }; - const handleKeyDown = (e) => { - fireCancelableEvent(onKeyDown, e.detail); - }; - const handlePressArrowDown = () => { - var _a3; - autosuggestItemsHandlers.moveHighlightWithKeyboard(1); - if (customFormRef.current) { - (_a3 = getFirstFocusable(customFormRef.current)) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }; - const handlePressArrowUp = () => { - autosuggestItemsHandlers.moveHighlightWithKeyboard(-1); - }; - const handlePressEnter = () => { - return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard(); - }; - const handleCloseDropdown = () => { - autosuggestItemsHandlers.resetHighlightWithKeyboard(); - }; - const handleRecoveryClick = () => { - var _a3; - autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick(); - (_a3 = autosuggestInputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }; - const selfControlId = useUniqueId("input"); - const controlId = (_a2 = rest.controlId) !== null && _a2 !== void 0 ? _a2 : selfControlId; - const listId = useUniqueId("list"); - const footerId = useUniqueId("footer"); - const highlightedOptionIdSource = useUniqueId(); - const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : void 0; - const isEmpty = !value && !autosuggestItemsState.items.length; - const dropdownStatus = useDropdownStatus(Object.assign(Object.assign({}, props2), { isEmpty, onRecoveryClick: handleRecoveryClick, hasRecoveryCallback: !!onLoadItems })); - let content = null; - if (customForm) { - content = import_react351.default.createElement("div", { ref: customFormRef, className: styles_css_default108["custom-content-wrapper"] }, customForm); - } else if (autosuggestItemsState.items.length > 0) { - content = import_react351.default.createElement(AutosuggestOptionsList, { statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText, listId, controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll, listBottom: !dropdownStatus.isSticky ? import_react351.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, id: footerId }) : null, ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); - } - return import_react351.default.createElement(autosuggest_input_default, Object.assign({ ref: mergedRef }, rest, { className: clsx_m_default(styles_css_default62.root, styles_css_default108.input), value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, controlId, placeholder, disabled, ariaLabel, expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, ariaDescribedby: joinStrings(searchResultsId, rest.ariaDescribedby), dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null || !!customForm, dropdownContentKey: customForm ? "custom" : "options", dropdownContent: content, dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? import_react351.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1, id: footerId }) : null, dropdownWidth: customForm ? DROPDOWN_WIDTH_CUSTOM_FORM : DROPDOWN_WIDTH_OPTIONS_LIST, dropdownContentFocusable: !!customForm, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })); -}); -var property_filter_autosuggest_default = PropertyFilterAutosuggest; - -// node_modules/@cloudscape-design/components/property-filter/property-editor.js -var import_react352 = __toESM(require_react()); -function PropertyEditor({ property, operator, filter, operatorForm, onCancel, onSubmit, i18nStrings }) { - const [value, onChange] = (0, import_react352.useState)(null); - const submitToken = () => onSubmit({ propertyKey: property.propertyKey, operator, value }); - return import_react352.default.createElement( - "div", - { className: styles_css_default108["property-editor"] }, - import_react352.default.createElement( - "div", - { className: styles_css_default108["property-editor-form"] }, - import_react352.default.createElement(InternalFormField, { label: property.groupValuesLabel }, operatorForm({ value, onChange, operator, filter })) - ), - import_react352.default.createElement( - "div", - { className: styles_css_default108["property-editor-actions"] }, - import_react352.default.createElement(internal_default2, { variant: "link", className: styles_css_default108["property-editor-cancel"], onClick: onCancel }, i18nStrings.cancelActionText), - import_react352.default.createElement(internal_default2, { className: styles_css_default108["property-editor-submit"], onClick: submitToken }, i18nStrings.applyActionText) - ) - ); -} - -// node_modules/@cloudscape-design/components/text-filter/search-results.js -var import_react353 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/text-filter/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/text-filter/styles.scoped.css"; -var styles_css_default110 = { - "root": "awsui_root_1sdq3_ms42k_99", - "input": "awsui_input_1sdq3_ms42k_137", - "results": "awsui_results_1sdq3_ms42k_141" -}; - -// node_modules/@cloudscape-design/components/text-filter/search-results.js -var LIVE_REGION_DELAY = 2e3; -function SearchResults({ id, children: children2 }) { - return import_react353.default.createElement( - "span", - { className: styles_css_default110.results }, - import_react353.default.createElement( - live_region_default, - { delay: LIVE_REGION_DELAY, visible: true }, - import_react353.default.createElement("span", { id }, children2) - ) - ); -} - -// node_modules/@cloudscape-design/components/property-filter/index.js -function getOperatorI18nString(operator) { - switch (operator) { - case "=": - return "equals"; - case "!=": - return "not_equals"; - case ">": - return "greater_than"; - case ">=": - return "greater_than_equal"; - case "<": - return "less_than"; - case "<=": - return "less_than_equal"; - case ":": - return "contains"; - case "!:": - return "not_contains"; - case "^": - return "starts_with"; - case "!^": - return "not_starts_with"; - default: - return operator; - } -} -var PropertyFilter = import_react354.default.forwardRef((_a2, ref) => { - var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; - var { disabled, countText, query, hideOperations, onChange, filteringProperties, filteringOptions = [], customGroupsText = [], disableFreeTextFiltering = false, freeTextFiltering, onLoadItems, virtualScroll, customControl, customFilterActions, filteringPlaceholder, filteringAriaLabel, filteringEmpty, filteringLoadingText, filteringFinishedText, filteringErrorText, filteringRecoveryText, filteringStatusType, asyncProperties, tokenLimit, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel } = _a2, rest = __rest(_a2, ["disabled", "countText", "query", "hideOperations", "onChange", "filteringProperties", "filteringOptions", "customGroupsText", "disableFreeTextFiltering", "freeTextFiltering", "onLoadItems", "virtualScroll", "customControl", "customFilterActions", "filteringPlaceholder", "filteringAriaLabel", "filteringEmpty", "filteringLoadingText", "filteringFinishedText", "filteringErrorText", "filteringRecoveryText", "filteringStatusType", "asyncProperties", "tokenLimit", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel"]); - const { __internalRootRef } = useBaseComponent("PropertyFilter", { - props: { asyncProperties, disableFreeTextFiltering, expandToViewport, hideOperations, tokenLimit, virtualScroll } - }); - const [removedTokenIndex, setRemovedTokenIndex] = (0, import_react354.useState)(null); - const inputRef = (0, import_react354.useRef)(null); - const baseProps = getBaseProps(rest); - const i18n = useInternalI18n("property-filter"); - const i18nStrings = Object.assign(Object.assign({}, rest.i18nStrings), { allPropertiesLabel: i18n("i18nStrings.allPropertiesLabel", (_b = rest.i18nStrings) === null || _b === void 0 ? void 0 : _b.allPropertiesLabel), applyActionText: i18n("i18nStrings.applyActionText", (_c = rest.i18nStrings) === null || _c === void 0 ? void 0 : _c.applyActionText), cancelActionText: i18n("i18nStrings.cancelActionText", (_d = rest.i18nStrings) === null || _d === void 0 ? void 0 : _d.cancelActionText), clearFiltersText: i18n("i18nStrings.clearFiltersText", (_e = rest.i18nStrings) === null || _e === void 0 ? void 0 : _e.clearFiltersText), editTokenHeader: i18n("i18nStrings.editTokenHeader", (_f = rest.i18nStrings) === null || _f === void 0 ? void 0 : _f.editTokenHeader), groupPropertiesText: i18n("i18nStrings.groupPropertiesText", (_g = rest.i18nStrings) === null || _g === void 0 ? void 0 : _g.groupPropertiesText), groupValuesText: i18n("i18nStrings.groupValuesText", (_h = rest.i18nStrings) === null || _h === void 0 ? void 0 : _h.groupValuesText), operationAndText: i18n("i18nStrings.operationAndText", (_j = rest.i18nStrings) === null || _j === void 0 ? void 0 : _j.operationAndText), operationOrText: i18n("i18nStrings.operationOrText", (_k = rest.i18nStrings) === null || _k === void 0 ? void 0 : _k.operationOrText), operatorContainsText: i18n("i18nStrings.operatorContainsText", (_l = rest.i18nStrings) === null || _l === void 0 ? void 0 : _l.operatorContainsText), operatorDoesNotContainText: i18n("i18nStrings.operatorDoesNotContainText", (_m = rest.i18nStrings) === null || _m === void 0 ? void 0 : _m.operatorDoesNotContainText), operatorDoesNotEqualText: i18n("i18nStrings.operatorDoesNotEqualText", (_o = rest.i18nStrings) === null || _o === void 0 ? void 0 : _o.operatorDoesNotEqualText), operatorEqualsText: i18n("i18nStrings.operatorEqualsText", (_p = rest.i18nStrings) === null || _p === void 0 ? void 0 : _p.operatorEqualsText), operatorGreaterOrEqualText: i18n("i18nStrings.operatorGreaterOrEqualText", (_q = rest.i18nStrings) === null || _q === void 0 ? void 0 : _q.operatorGreaterOrEqualText), operatorGreaterText: i18n("i18nStrings.operatorGreaterText", (_r = rest.i18nStrings) === null || _r === void 0 ? void 0 : _r.operatorGreaterText), operatorLessOrEqualText: i18n("i18nStrings.operatorLessOrEqualText", (_s = rest.i18nStrings) === null || _s === void 0 ? void 0 : _s.operatorLessOrEqualText), operatorLessText: i18n("i18nStrings.operatorLessText", (_t = rest.i18nStrings) === null || _t === void 0 ? void 0 : _t.operatorLessText), operatorStartsWithText: i18n("i18nStrings.operatorStartsWithText", (_u = rest.i18nStrings) === null || _u === void 0 ? void 0 : _u.operatorStartsWithText), operatorDoesNotStartWithText: i18n("i18nStrings.operatorDoesNotStartWithText", (_v = rest.i18nStrings) === null || _v === void 0 ? void 0 : _v.operatorDoesNotStartWithText), operatorText: i18n("i18nStrings.operatorText", (_w = rest.i18nStrings) === null || _w === void 0 ? void 0 : _w.operatorText), operatorsText: i18n("i18nStrings.operatorsText", (_x = rest.i18nStrings) === null || _x === void 0 ? void 0 : _x.operatorsText), propertyText: i18n("i18nStrings.propertyText", (_y = rest.i18nStrings) === null || _y === void 0 ? void 0 : _y.propertyText), tokenLimitShowFewer: i18n("i18nStrings.tokenLimitShowFewer", (_z = rest.i18nStrings) === null || _z === void 0 ? void 0 : _z.tokenLimitShowFewer), tokenLimitShowMore: i18n("i18nStrings.tokenLimitShowMore", (_0 = rest.i18nStrings) === null || _0 === void 0 ? void 0 : _0.tokenLimitShowMore), valueText: i18n("i18nStrings.valueText", (_1 = rest.i18nStrings) === null || _1 === void 0 ? void 0 : _1.valueText), removeTokenButtonAriaLabel: i18n("i18nStrings.removeTokenButtonAriaLabel", (_2 = rest.i18nStrings) === null || _2 === void 0 ? void 0 : _2.removeTokenButtonAriaLabel, (format3) => (token) => { - var _a3; - return format3({ - token__operator: getOperatorI18nString(token.operator), - token__propertyKey: (_a3 = token.propertyKey) !== null && _a3 !== void 0 ? _a3 : "", - token__value: token.value - }); - }) }); - (0, import_react354.useImperativeHandle)(ref, () => ({ focus: () => { - var _a3; - return (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } }), []); - const showResults = !!((_3 = query.tokens) === null || _3 === void 0 ? void 0 : _3.length) && !disabled && !!countText; - const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(query, onChange, inputRef); - const [filteringText, setFilteringText] = (0, import_react354.useState)(""); - const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => { - var _a3, _b2; - const propertyByKey = filteringProperties.reduce((acc, property) => { - var _a4, _b3, _c2, _d2, _e2; - const extendedOperators = ((_a4 = property === null || property === void 0 ? void 0 : property.operators) !== null && _a4 !== void 0 ? _a4 : []).reduce((acc2, operator) => typeof operator === "object" ? acc2.set(operator.operator, operator) : acc2, /* @__PURE__ */ new Map()); - acc.set(property.key, { - propertyKey: property.key, - propertyLabel: (_b3 = property === null || property === void 0 ? void 0 : property.propertyLabel) !== null && _b3 !== void 0 ? _b3 : "", - groupValuesLabel: (_c2 = property === null || property === void 0 ? void 0 : property.groupValuesLabel) !== null && _c2 !== void 0 ? _c2 : "", - propertyGroup: property === null || property === void 0 ? void 0 : property.group, - operators: ((_d2 = property === null || property === void 0 ? void 0 : property.operators) !== null && _d2 !== void 0 ? _d2 : []).map((op) => typeof op === "string" ? op : op.operator), - defaultOperator: (_e2 = property === null || property === void 0 ? void 0 : property.defaultOperator) !== null && _e2 !== void 0 ? _e2 : "=", - getValueFormatter: (operator) => { - var _a5, _b4; - return operator ? (_b4 = (_a5 = extendedOperators.get(operator)) === null || _a5 === void 0 ? void 0 : _a5.format) !== null && _b4 !== void 0 ? _b4 : null : null; - }, - getValueFormRenderer: (operator) => { - var _a5, _b4; - return operator ? (_b4 = (_a5 = extendedOperators.get(operator)) === null || _a5 === void 0 ? void 0 : _a5.form) !== null && _b4 !== void 0 ? _b4 : null : null; - }, - externalProperty: property - }); - return acc; - }, /* @__PURE__ */ new Map()); - const getProperty = (propertyKey) => { - var _a4; - return (_a4 = propertyByKey.get(propertyKey)) !== null && _a4 !== void 0 ? _a4 : null; - }; - const internalOptions2 = filteringOptions.map((option) => { - var _a4, _b3; - return { - property: getProperty(option.propertyKey), - value: option.value, - label: (_b3 = (_a4 = option.label) !== null && _a4 !== void 0 ? _a4 : option.value) !== null && _b3 !== void 0 ? _b3 : "" - }; - }); - const internalQuery2 = { - operation: query.operation, - tokens: query.tokens.map((token) => ({ - property: token.propertyKey ? getProperty(token.propertyKey) : null, - operator: token.operator, - value: token.value - })) - }; - const internalFreeText2 = { - disabled: disableFreeTextFiltering, - operators: (_a3 = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.operators) !== null && _a3 !== void 0 ? _a3 : [":", "!:"], - defaultOperator: (_b2 = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.defaultOperator) !== null && _b2 !== void 0 ? _b2 : ":" - }; - return { internalProperties: [...propertyByKey.values()], internalOptions: internalOptions2, internalQuery: internalQuery2, internalFreeText: internalFreeText2 }; - })(); - const parsedText = parseText(filteringText, internalProperties, internalFreeText); - const autosuggestOptions = getAutosuggestOptions(parsedText, internalProperties, internalOptions, customGroupsText, i18nStrings); - const createToken = (currentText) => { - const parsedText2 = parseText(currentText, internalProperties, internalFreeText); - let newToken; - switch (parsedText2.step) { - case "property": { - newToken = matchTokenValue({ - property: parsedText2.property, - operator: parsedText2.operator, - value: parsedText2.value - }, internalOptions); - break; - } - case "free-text": { - newToken = { - operator: parsedText2.operator || internalFreeText.defaultOperator, - value: parsedText2.value - }; - break; - } - case "operator": { - newToken = { - operator: internalFreeText.defaultOperator, - value: currentText - }; - break; - } - } - if (internalFreeText.disabled && !("propertyKey" in newToken)) { - return; - } - addToken(newToken); - setFilteringText(""); - }; - const ignoreKeyDown = (0, import_react354.useRef)(false); - const handleKeyDown = (event) => { - if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) { - createToken(filteringText); - } - }; - const getLoadMoreDetail = (parsedText2, filteringText2) => { - const loadMoreDetail2 = { - filteringProperty: void 0, - filteringText: filteringText2, - filteringOperator: void 0 - }; - if (parsedText2.step === "property") { - loadMoreDetail2.filteringProperty = parsedText2.property.externalProperty; - loadMoreDetail2.filteringText = parsedText2.value; - loadMoreDetail2.filteringOperator = parsedText2.operator; - } - return loadMoreDetail2; - }; - const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText); - const inputLoadItemsHandlers = useLoadItems2(onLoadItems, loadMoreDetail.filteringText, loadMoreDetail.filteringProperty, loadMoreDetail.filteringText, loadMoreDetail.filteringOperator); - const asyncProps = { - empty: filteringEmpty, - loadingText: filteringLoadingText, - finishedText: filteringFinishedText, - errorText: filteringErrorText, - recoveryText: filteringRecoveryText, - statusType: filteringStatusType - }; - const asyncAutosuggestProps = !!filteringText.length || asyncProperties ? Object.assign(Object.assign({}, inputLoadItemsHandlers), asyncProps) : {}; - const handleSelected = (event) => { - var _a3; - ignoreKeyDown.current = true; - setTimeout(() => { - ignoreKeyDown.current = false; - }, 0); - const { detail: option } = event; - const value = option.value || ""; - if (!("keepOpenOnSelect" in option)) { - createToken(value); - return; - } - event.preventDefault(); - const parsedText2 = parseText(value, internalProperties, internalFreeText); - const loadMoreDetail2 = getLoadMoreDetail(parsedText2, value); - if (parsedText2.step === "operator") { - const operators = getAllowedOperators(parsedText2.property); - if (value.trim() === parsedText2.property.propertyLabel && operators.length === 1) { - loadMoreDetail2.filteringProperty = (_a3 = parsedText2.property.externalProperty) !== null && _a3 !== void 0 ? _a3 : void 0; - loadMoreDetail2.filteringOperator = operators[0]; - loadMoreDetail2.filteringText = ""; - setFilteringText(parsedText2.property.propertyLabel + " " + operators[0] + " "); - } - } - fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, loadMoreDetail2), { firstPage: true, samePage: false })); - }; - const operatorForm = parsedText.step === "property" && parsedText.property.getValueFormRenderer(parsedText.operator); - const searchResultsId = useUniqueId("property-filter-search-results"); - return import_react354.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default108.root), ref: __internalRootRef }), - import_react354.default.createElement( - "div", - { className: styles_css_default108["search-field"] }, - customControl && import_react354.default.createElement("div", { className: styles_css_default108["custom-control"] }, customControl), - import_react354.default.createElement(property_filter_autosuggest_default, Object.assign({ ref: inputRef, virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, ariaLabel: filteringAriaLabel !== null && filteringAriaLabel !== void 0 ? filteringAriaLabel : i18nStrings.filteringAriaLabel, placeholder: filteringPlaceholder !== null && filteringPlaceholder !== void 0 ? filteringPlaceholder : i18nStrings.filteringPlaceholder, ariaLabelledby: rest.ariaLabelledby, ariaDescribedby: rest.ariaDescribedby, controlId: rest.controlId, value: filteringText, disabled, onKeyDown: handleKeyDown }, autosuggestOptions, { onChange: (event) => setFilteringText(event.detail.value), empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport, onOptionClick: handleSelected, customForm: operatorForm && import_react354.default.createElement(PropertyEditor, { property: parsedText.property, operator: parsedText.operator, filter: parsedText.value, operatorForm, i18nStrings, onCancel: () => { - var _a3, _b2; - setFilteringText(""); - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.close(); - (_b2 = inputRef.current) === null || _b2 === void 0 ? void 0 : _b2.focus({ preventDropdown: true }); - }, onSubmit: (token) => { - var _a3, _b2; - addToken(token); - setFilteringText(""); - (_a3 = inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus({ preventDropdown: true }); - (_b2 = inputRef.current) === null || _b2 === void 0 ? void 0 : _b2.close(); - } }), hideEnteredTextOption: internalFreeText.disabled && parsedText.step !== "property", clearAriaLabel: i18nStrings.clearAriaLabel, searchResultsId: showResults ? searchResultsId : void 0 })), - showResults ? import_react354.default.createElement( - "div", - { className: styles_css_default108.results }, - import_react354.default.createElement(SearchResults, { id: searchResultsId }, countText) - ) : null - ), - internalQuery.tokens && internalQuery.tokens.length > 0 && import_react354.default.createElement( - "div", - { className: styles_css_default108.tokens }, - import_react354.default.createElement( - InternalSpaceBetween, - { size: "xs", direction: "horizontal" }, - import_react354.default.createElement(TokenList, { alignment: "inline", limit: tokenLimit, items: internalQuery.tokens, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, renderItem: (token, tokenIndex) => import_react354.default.createElement(TokenButton, { token, first: tokenIndex === 0, operation: internalQuery.operation, removeToken: () => { - removeToken(tokenIndex); - setRemovedTokenIndex(tokenIndex); - }, setToken: (newToken) => setToken(tokenIndex, newToken), setOperation, filteringProperties: internalProperties, filteringOptions: internalOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, freeTextFiltering: internalFreeText, disabled, expandToViewport }), i18nStrings: { - limitShowFewer: i18nStrings.tokenLimitShowFewer, - limitShowMore: i18nStrings.tokenLimitShowMore - }, after: customFilterActions ? import_react354.default.createElement("div", { className: styles_css_default108["custom-filter-actions"] }, customFilterActions) : import_react354.default.createElement(InternalButton, { formAction: "none", onClick: removeAllTokens, className: styles_css_default108["remove-all"], disabled }, i18nStrings.clearFiltersText), moveFocusNextToIndex: removedTokenIndex }) - ) - ) - ); -}); -applyDisplayName(PropertyFilter, "PropertyFilter"); -var property_filter_default = PropertyFilter; - -// node_modules/@cloudscape-design/components/radio-group/index.js -var import_react355 = __toESM(require_react()); -var RadioGroup = import_react355.default.forwardRef((props2, ref) => { - const baseComponentProps = useBaseComponent("RadioGroup"); - return import_react355.default.createElement(internal_default13, Object.assign({ ref }, props2, baseComponentProps)); -}); -applyDisplayName(RadioGroup, "RadioGroup"); -var radio_group_default = RadioGroup; - -// node_modules/@cloudscape-design/components/s3-resource-selector/index.js -var import_react391 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/index.js -var import_react358 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/use-versions-fetch.js -var import_react356 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/utils/promises.js -var PromiseCancelledSignal = class { -}; -function makeCancellable(promise) { - let cancelled = false; - const wrapped = promise.then((value) => { - if (cancelled) { - throw new PromiseCancelledSignal(); - } - return value; - }, (err) => { - if (cancelled) { - throw new PromiseCancelledSignal(); - } - throw err; - }); - return { - promise: wrapped, - cancel: () => { - cancelled = true; - }, - isCancelled: () => cancelled - }; -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/validation.js -var SCHEME = "s3://"; -var BUCKET_FIRST_CHAR = /^[a-z0-9]{1}/; -var CAPITAL_LETTER = /[A-Z]/; -var DNS_NAME = /^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/; -function checkBucketNameLength(bucketName) { - return 3 <= bucketName.length && bucketName.length <= 63; -} -function extractBucketName(uri) { - const [bucketName, ...rest] = uri.replace(SCHEME, "").split("/"); - return [bucketName, rest.join("/")]; -} -function validate(uri) { - if (uri === "") { - return void 0; - } - if (uri.slice(0, SCHEME.length) !== SCHEME) { - return "validationPathMustBegin"; - } - const [bucketName] = extractBucketName(uri); - if (!BUCKET_FIRST_CHAR.test(bucketName)) { - return "validationBucketLowerCase"; - } - if (CAPITAL_LETTER.test(bucketName)) { - return "validationBucketMustNotContain"; - } - if (!checkBucketNameLength(bucketName)) { - return "validationBucketLength"; - } - if (!DNS_NAME.test(bucketName)) { - return "validationBucketMustComplyDns"; - } - return void 0; -} -function getErrorText(i18n, i18nStrings, errorCode) { - return errorCode ? i18n(`i18nStrings.${errorCode}`, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings[errorCode]) : void 0; -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/use-versions-fetch.js -function useVersionsFetch(fetchVersions) { - const [loading, setLoading] = (0, import_react356.useState)(false); - const [lastFetchedValue, setLastFetched] = (0, import_react356.useState)(""); - const [versions, setVersions] = (0, import_react356.useState)([]); - const loadVersions = (uri) => { - if (uri === lastFetchedValue) { - return; - } - setLastFetched(uri); - const errorCode = validate(uri); - const [bucketName, prefix] = extractBucketName(uri); - if (errorCode || !bucketName || !prefix || prefix.slice(-1) === "/") { - return; - } - setLoading(true); - const result = makeCancellable(fetchVersions(bucketName, prefix)); - result.promise.then((versions2) => { - setLoading(false); - setVersions(versions2.map((version) => ({ - value: version.VersionId, - label: version.LastModified - }))); - }, (err) => { - if (!(err instanceof PromiseCancelledSignal)) { - setLoading(false); - } - }); - return result; - }; - return { - loading, - versions, - resetVersions: () => setVersions([]), - // this function is a dependency of useEffect - loadVersions: useStableCallback(loadVersions) - }; -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.scoped.css"; -var styles_css_default111 = { - "root": "awsui_root_1vtzr_19vlz_9", - "view-button": "awsui_view-button_1vtzr_19vlz_13", - "browse-button": "awsui_browse-button_1vtzr_19vlz_17", - "layout": "awsui_layout_1vtzr_19vlz_21", - "layout-uri": "awsui_layout-uri_1vtzr_19vlz_33", - "layout-version": "awsui_layout-version_1vtzr_19vlz_37", - "layout-divider": "awsui_layout-divider_1vtzr_19vlz_42" -}; - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/search-input.js -var import_react357 = __toESM(require_react()); -var SearchInput = import_react357.default.forwardRef((props2, ref) => { - const formFieldContext = useFormFieldContext(props2); - return import_react357.default.createElement(internal_default7, Object.assign({ type: "search" }, props2, formFieldContext, { ref })); -}); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/index.js -var S3InContext = import_react358.default.forwardRef(({ i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, selectableItemsTypes, fetchVersions, onChange, onBrowse }, ref) => { - const i18n = useInternalI18n("s3-resource-selector"); - const isInputBlurredRef = (0, import_react358.useRef)(true); - const [isInputTouched, setInputTouched] = (0, import_react358.useState)(false); - const { versions, loading, loadVersions, resetVersions } = useVersionsFetch(fetchVersions); - const inputRef = (0, import_react358.useRef)(null); - useForwardFocus(ref, inputRef); - const uri = resource.uri; - const supportsVersions = selectableItemsTypes && selectableItemsTypes.indexOf("versions") > -1; - const selectedVersion = versions.filter((version) => version.value === resource.versionId)[0] || null; - function handleUriChange(event) { - const uri2 = event.detail.value; - const errorCode = isInputTouched ? validate(uri2) : void 0; - resetVersions(); - onChange({ uri: uri2 }, getErrorText(i18n, i18nStrings, errorCode)); - } - function handleUriBlur() { - isInputBlurredRef.current = true; - setInputTouched(true); - const errorCode = validate(resource.uri); - onChange(resource, getErrorText(i18n, i18nStrings, errorCode)); - if (supportsVersions) { - loadVersions(resource.uri); - } - } - (0, import_react358.useEffect)(() => { - var _a2; - if (!isInputBlurredRef.current || !supportsVersions) { - return; - } - const { cancel } = (_a2 = loadVersions(uri)) !== null && _a2 !== void 0 ? _a2 : {}; - return cancel; - }, [uri, supportsVersions, loadVersions]); - return import_react358.default.createElement( - "div", - { className: styles_css_default111.root }, - import_react358.default.createElement( - "div", - { className: styles_css_default111.layout }, - import_react358.default.createElement( - InternalFormField, - { className: styles_css_default111["layout-uri"], label: i18n("i18nStrings.inContextUriLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextUriLabel), stretch: true }, - import_react358.default.createElement(SearchInput, { ref: inputRef, value: uri, ariaDescribedby: inputAriaDescribedby, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputClearAriaLabel, placeholder: inputPlaceholder !== null && inputPlaceholder !== void 0 ? inputPlaceholder : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputPlaceholder, onChange: handleUriChange, invalid, onFocus: () => isInputBlurredRef.current = false, onBlur: handleUriBlur }) - ), - supportsVersions && import_react358.default.createElement( - InternalFormField, - { className: styles_css_default111["layout-version"], label: i18n("i18nStrings.inContextVersionSelectLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextVersionSelectLabel), stretch: true }, - import_react358.default.createElement(internal_default12, { selectedOption: selectedVersion, placeholder: i18n("i18nStrings.inContextSelectPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextSelectPlaceholder), disabled: versions.length === 0, options: versions, onChange: (event) => onChange(Object.assign(Object.assign({}, resource), { versionId: event.detail.selectedOption.value }), void 0), invalid: false }) - ), - import_react358.default.createElement( - "div", - null, - import_react358.default.createElement(InternalButton, { className: styles_css_default111["view-button"], disabled: !viewHref, href: viewHref, target: "_blank", iconName: "external", iconAlign: "right", formAction: "none", ariaLabel: i18n("i18nStrings.inContextViewButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButtonAriaLabel) }, i18n("i18nStrings.inContextViewButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButton)) - ), - import_react358.default.createElement("div", { className: styles_css_default111["layout-divider"] }), - import_react358.default.createElement( - "div", - null, - import_react358.default.createElement(InternalButton, { className: styles_css_default111["browse-button"], disabled: loading, formAction: "none", onClick: onBrowse }, i18n("i18nStrings.inContextBrowseButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextBrowseButton)) - ) - ), - import_react358.default.createElement("div", { role: "alert", "aria-live": "assertive", "aria-atomic": "true" }, loading && import_react358.default.createElement( - InternalBox, - { margin: { top: "s" } }, - import_react358.default.createElement( - StatusIndicator, - { type: "loading" }, - import_react358.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.inContextLoadingText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextLoadingText)) - ) - )) - ); -}); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/index.js -var import_react390 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/buckets-table.js -var import_react387 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/table-utils.js -function includes(array, item) { - return !!array && array.indexOf(item) > -1; -} -var compareDates = (itemA, itemB) => { - const timeA = itemA ? new Date(itemA).getTime() : 0; - const timeB = itemB ? new Date(itemB).getTime() : 0; - return timeA - timeB; -}; -function getColumnAriaLabel(i18n, i18nStrings, columnName = "") { - return ({ sorted, descending: descending2 }) => { - var _a2, _b, _c, _d, _e, _f; - if (!sorted) { - return (_b = i18n("i18nStrings.labelNotSorted", (_a2 = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelNotSorted) === null || _a2 === void 0 ? void 0 : _a2.call(i18nStrings, columnName), (format3) => format3({ columnName }))) !== null && _b !== void 0 ? _b : ""; - } - if (descending2) { - return (_d = i18n("i18nStrings.labelSortedDescending", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelSortedDescending) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, columnName), (format3) => format3({ columnName }))) !== null && _d !== void 0 ? _d : ""; - } - return (_f = i18n("i18nStrings.labelSortedAscending", (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelSortedAscending) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, columnName), (format3) => format3({ columnName }))) !== null && _f !== void 0 ? _f : ""; - }; -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/column-formats.js -var BYTES_BASE = 1024; -var BYTES_DECIMALS = 2; -var BYTES_SIZES = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; -function formatDefault(value) { - return value ? value : "-"; -} -function formatSize(bytes) { - if (bytes === void 0) { - return "-"; - } - if (bytes === 0) { - return `0 ${BYTES_SIZES[0]}`; - } - const i = Math.floor(Math.log(bytes) / Math.log(BYTES_BASE)); - return parseFloat((bytes / Math.pow(BYTES_BASE, i)).toFixed(BYTES_DECIMALS)) + " " + BYTES_SIZES[i]; -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/basic-table.js -var import_react386 = __toESM(require_react()); - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/use-collection.js -var import_react360 = __toESM(require_react(), 1); - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/filter.js -function defaultFilteringFunction(item, filteringText, filteringFields) { - if (filteringText.length === 0) { - return true; - } - filteringFields = filteringFields || Object.keys(item); - var lowFilteringText = filteringText.toLowerCase(); - return filteringFields.some(function(key2) { - return String(item[key2]).toLowerCase().indexOf(lowFilteringText) > -1; - }); -} -function createFilterPredicate(filtering, filteringText) { - var _a2; - if (filteringText === void 0) { - filteringText = ""; - } - if (!filtering) { - return null; - } - var filteringFunction = (_a2 = filtering.filteringFunction) !== null && _a2 !== void 0 ? _a2 : defaultFilteringFunction; - return function(item) { - return filteringFunction(item, filteringText, filtering.fields); - }; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/date-utils/parse-iso-date.js -function parseIsoDate(isoDate) { - if (typeof isoDate === "string") { - if (isoDate.includes("T")) { - return new Date(isoDate); - } else { - return /* @__PURE__ */ new Date(isoDate + "T00:00:00"); - } - } - return /* @__PURE__ */ new Date(NaN); -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/date-utils/compare-dates.js -function compareDates2(date2, dateToCompare) { - if (date2 instanceof Date && typeof dateToCompare === "string") { - return startOfDay2(date2).getTime() - startOfDay2(parseIsoDate(dateToCompare)).getTime(); - } - return NaN; -} -function compareTimestamps(date2, dateToCompare) { - if (date2 instanceof Date && typeof dateToCompare === "string") { - return date2.getTime() - parseIsoDate(dateToCompare).getTime(); - } - return NaN; -} -function startOfDay2(date2) { - var copy2 = new Date(date2.getTime()); - copy2.setHours(0, 0, 0, 0); - return copy2; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/property-filter.js -var filterUsingOperator = function(itemValue, tokenValue, _a2) { - var operator = _a2.operator, match2 = _a2.match; - if (match2 === "date" || match2 === "datetime") { - var comparator = match2 === "date" ? compareDates2 : compareTimestamps; - var comparisonResult = comparator(itemValue, tokenValue); - switch (operator) { - case "<": - return comparisonResult < 0; - case "<=": - return comparisonResult <= 0; - case ">": - return comparisonResult > 0; - case ">=": - return comparisonResult >= 0; - case "=": - return comparisonResult === 0; - case "!=": - return comparisonResult !== 0; - default: - return false; - } - } else if (typeof match2 === "function") { - return match2(itemValue, tokenValue); - } else if (match2) { - throw new Error("Unsupported `operator.match` type given."); - } - switch (operator) { - case "<": - return itemValue < tokenValue; - case "<=": - return itemValue <= tokenValue; - case ">": - return itemValue > tokenValue; - case ">=": - return itemValue >= tokenValue; - case "=": - return itemValue == tokenValue; - case "!=": - return itemValue != tokenValue; - case ":": - return (itemValue + "").toLowerCase().indexOf((tokenValue + "").toLowerCase()) > -1; - case "!:": - return (itemValue + "").toLowerCase().indexOf((tokenValue + "").toLowerCase()) === -1; - case "^": - return (itemValue + "").toLowerCase().startsWith((tokenValue + "").toLowerCase()); - default: - throw new Error("Unsupported operator given."); - } -}; -function freeTextFilter(value, item, operator, filteringPropertiesMap) { - var matches = Object.keys(filteringPropertiesMap).some(function(propertyKey) { - var operators = filteringPropertiesMap[propertyKey].operators; - return !!operators[operator] && filterUsingOperator(item[propertyKey], value, { operator: ":" }); - }); - return operator === ":" ? matches : !matches; -} -function filterByToken(token, item, filteringPropertiesMap) { - if (token.propertyKey) { - if (!(token.propertyKey in filteringPropertiesMap) || !(token.operator in filteringPropertiesMap[token.propertyKey].operators)) { - return false; - } - var operator = filteringPropertiesMap[token.propertyKey].operators[token.operator]; - var itemValue = (operator === null || operator === void 0 ? void 0 : operator.match) ? item[token.propertyKey] : fixupFalsyValues(item[token.propertyKey]); - return filterUsingOperator(itemValue, token.value, operator !== null && operator !== void 0 ? operator : { operator: token.operator }); - } - return freeTextFilter(token.value, item, token.operator, filteringPropertiesMap); -} -function defaultFilteringFunction2(filteringPropertiesMap) { - return function(item, _a2) { - var tokens = _a2.tokens, operation = _a2.operation; - var result = operation === "and" ? true : !tokens.length; - for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { - var token = tokens_1[_i]; - result = operation === "and" ? result && filterByToken(token, item, filteringPropertiesMap) : result || filterByToken(token, item, filteringPropertiesMap); - } - return result; - }; -} -function createPropertyFilterPredicate(propertyFiltering, query) { - if (query === void 0) { - query = { tokens: [], operation: "and" }; - } - if (!propertyFiltering) { - return null; - } - var filteringPropertiesMap = propertyFiltering.filteringProperties.reduce(function(acc, _a2) { - var _b; - var key2 = _a2.key, operators = _a2.operators, defaultOperator = _a2.defaultOperator; - var operatorMap = (_b = {}, _b[defaultOperator !== null && defaultOperator !== void 0 ? defaultOperator : "="] = { operator: defaultOperator !== null && defaultOperator !== void 0 ? defaultOperator : "=" }, _b); - operators === null || operators === void 0 ? void 0 : operators.forEach(function(op) { - if (typeof op === "string") { - operatorMap[op] = { operator: op }; - } else { - operatorMap[op.operator] = { operator: op.operator, match: op.match }; - } - }); - acc[key2] = { - operators: operatorMap - }; - return acc; - }, {}); - var filteringFunction = propertyFiltering.filteringFunction || defaultFilteringFunction2(filteringPropertiesMap); - return function(item) { - return filteringFunction(item, query); - }; -} -var fixupFalsyValues = function(value) { - if (typeof value === "boolean") { - return value + ""; - } - if (value || value === 0) { - return value; - } - return ""; -}; - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/sort.js -function getSorter(sortingField) { - if (!sortingField) { - return null; - } - return function(row1, row2) { - var _a2, _b; - var value1 = (_a2 = row1[sortingField]) !== null && _a2 !== void 0 ? _a2 : ""; - var value2 = (_b = row2[sortingField]) !== null && _b !== void 0 ? _b : ""; - if (typeof value1 === "string" && typeof value2 === "string") { - return value1.localeCompare(value2); - } - return value1 < value2 ? -1 : value1 == value2 ? 0 : 1; - }; -} -function createComparator(sorting, state) { - var _a2; - if (!sorting || !state) { - return null; - } - var direction = state.isDescending ? -1 : 1; - var comparator = (_a2 = state.sortingColumn.sortingComparator) !== null && _a2 !== void 0 ? _a2 : getSorter(state.sortingColumn.sortingField); - return comparator ? function(a2, b) { - return comparator(a2, b) * direction; - } : null; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/pagination.js -var DEFAULT_PAGE_SIZE = 10; -function createPageProps(pagination, currentPageIndex, items) { - var _a2; - if (!pagination) { - return null; - } - var pageSize = (_a2 = pagination.pageSize) !== null && _a2 !== void 0 ? _a2 : DEFAULT_PAGE_SIZE; - var pagesCount = Math.ceil(items.length / pageSize); - var pageIndex = currentPageIndex !== null && currentPageIndex !== void 0 ? currentPageIndex : 1; - if (pageIndex < 1 || pageIndex > pagesCount || Number.isNaN(pageIndex)) { - pageIndex = 1; - } - return { pageSize, pagesCount, pageIndex }; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/compose-filters.js -function composeFilters() { - var predicates = []; - for (var _i = 0; _i < arguments.length; _i++) { - predicates[_i] = arguments[_i]; - } - return predicates.some(Boolean) ? function(item) { - for (var _i2 = 0, predicates_1 = predicates; _i2 < predicates_1.length; _i2++) { - var predicate = predicates_1[_i2]; - if (predicate && !predicate(item)) { - return false; - } - } - return true; - } : null; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/operations/index.js -function processItems(items, _a2, _b) { - var filteringText = _a2.filteringText, sortingState = _a2.sortingState, currentPageIndex = _a2.currentPageIndex, propertyFilteringQuery = _a2.propertyFilteringQuery; - var filtering = _b.filtering, sorting = _b.sorting, pagination = _b.pagination, propertyFiltering = _b.propertyFiltering; - var filterPredicate = composeFilters(createPropertyFilterPredicate(propertyFiltering, propertyFilteringQuery), createFilterPredicate(filtering, filteringText)); - if (filterPredicate) { - items = items.filter(filterPredicate); - } - var filteredItemsCount = filterPredicate ? items.length : void 0; - var comparator = createComparator(sorting, sortingState); - if (comparator) { - items = items.slice().sort(comparator); - } - var allPageItems = items; - var pageProps = createPageProps(pagination, currentPageIndex, items); - if (pageProps) { - items = items.slice((pageProps.pageIndex - 1) * pageProps.pageSize, pageProps.pageIndex * pageProps.pageSize); - } - return { - items, - allPageItems, - filteredItemsCount, - pagesCount: pageProps === null || pageProps === void 0 ? void 0 : pageProps.pagesCount, - actualPageIndex: pageProps === null || pageProps === void 0 ? void 0 : pageProps.pageIndex - }; -} -var getTrackableValue2 = function(trackBy, item) { - if (!trackBy) { - return item; - } - if (typeof trackBy === "function") { - return trackBy(item); - } - return item[trackBy]; -}; -var processSelectedItems = function(items, selectedItems, trackBy) { - var selectedSet = /* @__PURE__ */ new Set(); - selectedItems.forEach(function(item) { - return selectedSet.add(getTrackableValue2(trackBy, item)); - }); - return items.filter(function(item) { - return selectedSet.has(getTrackableValue2(trackBy, item)); - }); -}; -var itemsAreEqual = function(items1, items2, trackBy) { - if (items1.length !== items2.length) { - return false; - } - var set1 = /* @__PURE__ */ new Set(); - items1.forEach(function(item) { - return set1.add(getTrackableValue2(trackBy, item)); - }); - return items2.every(function(item) { - return set1.has(getTrackableValue2(trackBy, item)); - }); -}; - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/utils.js -var __assign2 = function() { - __assign2 = Object.assign || function(t) { - for (var s2, i = 1, n = arguments.length; i < n; i++) { - s2 = arguments[i]; - for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p)) - t[p] = s2[p]; - } - return t; - }; - return __assign2.apply(this, arguments); -}; -function collectionReducer(state, action) { - var newState = __assign2({}, state); - switch (action.type) { - case "selection": - newState.selectedItems = action.selectedItems; - break; - case "filtering": - newState.currentPageIndex = 1; - newState.filteringText = action.filteringText; - break; - case "sorting": - newState.currentPageIndex = 1; - newState.sortingState = action.sortingState; - break; - case "pagination": - newState.currentPageIndex = action.pageIndex; - break; - case "property-filtering": - newState.currentPageIndex = 1; - newState.propertyFilteringQuery = action.query; - break; - } - return newState; -} -function createActions(_a2) { - var dispatch = _a2.dispatch, collectionRef = _a2.collectionRef; - return { - setFiltering: function(filteringText) { - dispatch({ type: "filtering", filteringText }); - collectionRef.current && collectionRef.current.scrollToTop(); - }, - setSorting: function(state) { - dispatch({ type: "sorting", sortingState: state }); - collectionRef.current && collectionRef.current.scrollToTop(); - }, - setCurrentPage: function(pageIndex) { - dispatch({ type: "pagination", pageIndex }); - collectionRef.current && collectionRef.current.scrollToTop(); - }, - setSelectedItems: function(selectedItems) { - dispatch({ type: "selection", selectedItems }); - }, - setPropertyFiltering: function(query) { - dispatch({ type: "property-filtering", query }); - collectionRef.current && collectionRef.current.scrollToTop(); - } - }; -} -function createSyncProps(options, _a2, actions, collectionRef, _b) { - var _c, _d; - var filteringText = _a2.filteringText, sortingState = _a2.sortingState, selectedItems = _a2.selectedItems, currentPageIndex = _a2.currentPageIndex, propertyFilteringQuery = _a2.propertyFilteringQuery; - var pagesCount = _b.pagesCount, actualPageIndex = _b.actualPageIndex, allItems = _b.allItems, allPageItems = _b.allPageItems; - var empty = options.filtering ? allItems.length ? options.filtering.noMatch : options.filtering.empty : null; - empty = options.propertyFiltering ? allItems.length ? options.propertyFiltering.noMatch : options.propertyFiltering.empty : empty; - var filteringOptions = options.propertyFiltering ? options.propertyFiltering.filteringProperties.reduce(function(acc, property) { - Object.keys(allItems.reduce(function(acc2, item) { - acc2["" + fixupFalsyValues(item[property.key])] = true; - return acc2; - }, {})).forEach(function(value) { - if (value !== "") { - acc.push({ - propertyKey: property.key, - value - }); - } - }); - return acc; - }, []) : []; - return { - collectionProps: __assign2(__assign2(__assign2(__assign2({ empty }, options.sorting ? { - onSortingChange: function(_a3) { - var detail = _a3.detail; - actions.setSorting(detail); - }, - sortingColumn: sortingState === null || sortingState === void 0 ? void 0 : sortingState.sortingColumn, - sortingDescending: sortingState === null || sortingState === void 0 ? void 0 : sortingState.isDescending - } : {}), options.selection ? { - onSelectionChange: function(_a3) { - var selectedItems2 = _a3.detail.selectedItems; - actions.setSelectedItems(selectedItems2); - }, - selectedItems, - trackBy: options.selection.trackBy - } : {}), { ref: collectionRef }), ((_c = options.pagination) === null || _c === void 0 ? void 0 : _c.pageSize) ? { - totalItemsCount: allPageItems.length, - firstIndex: ((actualPageIndex !== null && actualPageIndex !== void 0 ? actualPageIndex : currentPageIndex) - 1) * options.pagination.pageSize + 1 - } : {}), - filterProps: { - filteringText, - onChange: function(_a3) { - var filteringText2 = _a3.detail.filteringText; - actions.setFiltering(filteringText2); - } - }, - propertyFilterProps: { - query: propertyFilteringQuery, - onChange: function(_a3) { - var query = _a3.detail; - actions.setPropertyFiltering(query); - }, - filteringProperties: ((_d = options.propertyFiltering) === null || _d === void 0 ? void 0 : _d.filteringProperties) || [], - filteringOptions - }, - paginationProps: { - currentPageIndex: actualPageIndex !== null && actualPageIndex !== void 0 ? actualPageIndex : currentPageIndex, - // pagesCount is always calculated when options.pagination is present - pagesCount, - onChange: function(_a3) { - var currentPageIndex2 = _a3.detail.currentPageIndex; - actions.setCurrentPage(currentPageIndex2); - } - } - }; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/use-collection-state.js -var import_react359 = __toESM(require_react(), 1); -function useCollectionState(options, collectionRef) { - var _a2, _b, _c, _d, _e, _f, _g, _h, _j; - var _k = (0, import_react359.useReducer)(collectionReducer, { - selectedItems: (_b = (_a2 = options.selection) === null || _a2 === void 0 ? void 0 : _a2.defaultSelectedItems) !== null && _b !== void 0 ? _b : [], - sortingState: (_c = options.sorting) === null || _c === void 0 ? void 0 : _c.defaultState, - currentPageIndex: (_e = (_d = options.pagination) === null || _d === void 0 ? void 0 : _d.defaultPage) !== null && _e !== void 0 ? _e : 1, - filteringText: (_g = (_f = options.filtering) === null || _f === void 0 ? void 0 : _f.defaultFilteringText) !== null && _g !== void 0 ? _g : "", - propertyFilteringQuery: (_j = (_h = options.propertyFiltering) === null || _h === void 0 ? void 0 : _h.defaultQuery) !== null && _j !== void 0 ? _j : { tokens: [], operation: "and" } - }), state = _k[0], dispatch = _k[1]; - return [ - state, - createActions({ - dispatch, - collectionRef - }) - ]; -} - -// node_modules/@cloudscape-design/collection-hooks/dist/mjs/use-collection.js -var __assign3 = function() { - __assign3 = Object.assign || function(t) { - for (var s2, i = 1, n = arguments.length; i < n; i++) { - s2 = arguments[i]; - for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p)) - t[p] = s2[p]; - } - return t; - }; - return __assign3.apply(this, arguments); -}; -function useCollection(allItems, options) { - var collectionRef = (0, import_react360.useRef)(null); - var _a2 = useCollectionState(options, collectionRef), state = _a2[0], actions = _a2[1]; - var _b = processItems(allItems, state, options), items = _b.items, allPageItems = _b.allPageItems, pagesCount = _b.pagesCount, filteredItemsCount = _b.filteredItemsCount, actualPageIndex = _b.actualPageIndex; - if (options.selection && !options.selection.keepSelection) { - var newSelectedItems = processSelectedItems(items, state.selectedItems, options.selection.trackBy); - if (!itemsAreEqual(newSelectedItems, state.selectedItems, options.selection.trackBy)) { - actions.setSelectedItems(newSelectedItems); - } - } - return __assign3({ items, allPageItems, filteredItemsCount, actions }, createSyncProps(options, state, actions, collectionRef, { - actualPageIndex, - pagesCount, - allItems, - allPageItems - })); -} - -// node_modules/@cloudscape-design/components/table/internal.js -var import_react383 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/thead.js -var import_react368 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/header-cell/index.js -var import_react367 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/header-cell/utils.js -var stateToIcon = { - sortable: "caret-down", - ascending: "caret-up-filled", - descending: "caret-down-filled" -}; -var getSortingStatus = (sortable, sorted, descending2, disabled) => { - if (sorted) { - if (descending2) { - return "descending"; - } - return "ascending"; - } - if (sortable && !disabled) { - return "sortable"; - } - return void 0; -}; -var getSortingIconName = (sortingState) => stateToIcon[sortingState]; -var isSorted = (column, sortingColumn) => column === sortingColumn || column.sortingField !== void 0 && column.sortingField === sortingColumn.sortingField || column.sortingComparator !== void 0 && column.sortingComparator === sortingColumn.sortingComparator; - -// node_modules/@cloudscape-design/components/table/header-cell/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/header-cell/styles.scoped.css"; -var styles_css_default112 = { - "header-cell": "awsui_header-cell_1spae_1sbf1_99", - "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_1sbf1_133", - "header-cell-sticky": "awsui_header-cell-sticky_1spae_1sbf1_154", - "header-cell-stuck": "awsui_header-cell-stuck_1spae_1sbf1_157", - "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_1sbf1_157", - "header-cell-hidden": "awsui_header-cell-hidden_1spae_1sbf1_160", - "header-cell-sortable": "awsui_header-cell-sortable_1spae_1sbf1_163", - "sticky-cell": "awsui_sticky-cell_1spae_1sbf1_166", - "sticky-cell-pad-left": "awsui_sticky-cell-pad-left_1spae_1sbf1_174", - "has-selection": "awsui_has-selection_1spae_1sbf1_174", - "sticky-cell-last-left": "awsui_sticky-cell-last-left_1spae_1sbf1_177", - "resize-divider": "awsui_resize-divider_1spae_1sbf1_181", - "sticky-cell-last-right": "awsui_sticky-cell-last-right_1spae_1sbf1_184", - "sorting-icon": "awsui_sorting-icon_1spae_1sbf1_199", - "edit-icon": "awsui_edit-icon_1spae_1sbf1_207", - "header-cell-content": "awsui_header-cell-content_1spae_1sbf1_213", - "header-cell-content-expandable": "awsui_header-cell-content-expandable_1spae_1sbf1_219", - "header-cell-disabled": "awsui_header-cell-disabled_1spae_1sbf1_271", - "header-cell-sorted": "awsui_header-cell-sorted_1spae_1sbf1_271", - "header-cell-text": "awsui_header-cell-text_1spae_1sbf1_285", - "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_1sbf1_289", - "header-cell-ascending": "awsui_header-cell-ascending_1spae_1sbf1_295", - "header-cell-descending": "awsui_header-cell-descending_1spae_1sbf1_296", - "is-visual-refresh": "awsui_is-visual-refresh_1spae_1sbf1_306", - "has-striped-rows": "awsui_has-striped-rows_1spae_1sbf1_320" -}; - -// node_modules/@cloudscape-design/components/table/resizer/index.js -var import_react362 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/resizer/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/resizer/styles.scoped.css"; -var styles_css_default113 = { - "resize-active": "awsui_resize-active_x7peu_sqn6e_99", - "resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_sqn6e_99", - "divider": "awsui_divider_x7peu_sqn6e_104", - "divider-disabled": "awsui_divider-disabled_x7peu_sqn6e_118", - "divider-active": "awsui_divider-active_x7peu_sqn6e_121", - "resizer": "awsui_resizer_x7peu_sqn6e_125", - "has-focus": "awsui_has-focus_x7peu_sqn6e_182", - "tracker": "awsui_tracker_x7peu_sqn6e_205" -}; - -// node_modules/@cloudscape-design/components/table/use-column-widths.js -var import_react361 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/column-widths-utils.js -function checkColumnWidths(columnDefinitions) { - for (const column of columnDefinitions) { - checkProperty(column, "minWidth"); - checkProperty(column, "width"); - } -} -function setElementWidths(element, styles) { - function setProperty(property) { - const value = styles[property]; - let widthCssValue = ""; - if (typeof value === "number") { - widthCssValue = value + "px"; - } - if (typeof value === "string") { - widthCssValue = value; - } - if (element.style[property] !== widthCssValue) { - element.style[property] = widthCssValue; - } - } - setProperty("width"); - setProperty("minWidth"); - setProperty("maxWidth"); -} -function checkProperty(column, name) { - const value = column[name]; - if (typeof value !== "number" && typeof value !== "undefined") { - warnOnce("Table", `resizableColumns feature requires ${name} property to be a number, got ${value}. The component may work incorrectly.`); - } -} - -// node_modules/@cloudscape-design/components/table/use-column-widths.js -var DEFAULT_COLUMN_WIDTH = 120; -function readWidths(getCell, visibleColumns) { - var _a2; - const result = /* @__PURE__ */ new Map(); - for (let index = 0; index < visibleColumns.length; index++) { - const column = visibleColumns[index]; - let width = column.width || 0; - const minWidth = column.minWidth || width || DEFAULT_COLUMN_WIDTH; - if (!width && // read width from the DOM if it is missing in the config - index !== visibleColumns.length - 1) { - const colEl = getCell(column.id); - width = (_a2 = colEl === null || colEl === void 0 ? void 0 : colEl.getBoundingClientRect().width) !== null && _a2 !== void 0 ? _a2 : DEFAULT_COLUMN_WIDTH; - } - result.set(column.id, Math.max(width, minWidth)); - } - return result; -} -function updateWidths(visibleColumns, oldWidths, newWidth, columnId) { - const column = visibleColumns.find((column2) => column2.id === columnId); - const minWidth = typeof (column === null || column === void 0 ? void 0 : column.minWidth) === "number" ? column.minWidth : DEFAULT_COLUMN_WIDTH; - newWidth = Math.max(newWidth, minWidth); - if (oldWidths.get(columnId) === newWidth) { - return oldWidths; - } - const newWidths = new Map(oldWidths); - newWidths.set(columnId, newWidth); - return newWidths; -} -var WidthsContext = (0, import_react361.createContext)({ - getColumnStyles: () => ({}), - columnWidths: /* @__PURE__ */ new Map(), - updateColumn: () => { - }, - setCell: () => { - } -}); -function ColumnWidthsProvider({ visibleColumns, resizableColumns, containerRef, children: children2 }) { - const visibleColumnsRef = (0, import_react361.useRef)(null); - const containerWidthRef = (0, import_react361.useRef)(0); - const [columnWidths, setColumnWidths] = (0, import_react361.useState)(null); - const cellsRef = (0, import_react361.useRef)(/* @__PURE__ */ new Map()); - const stickyCellsRef = (0, import_react361.useRef)(/* @__PURE__ */ new Map()); - const getCell = (columnId) => { - var _a2; - return (_a2 = cellsRef.current.get(columnId)) !== null && _a2 !== void 0 ? _a2 : null; - }; - const setCell = (sticky, columnId, node) => { - const ref = sticky ? stickyCellsRef : cellsRef; - if (node) { - ref.current.set(columnId, node); - } else { - ref.current.delete(columnId); - } - }; - const getColumnStyles = (sticky, columnId) => { - var _a2, _b, _c; - const column = visibleColumns.find((column2) => column2.id === columnId); - if (!column) { - return {}; - } - if (sticky) { - return { width: ((_a2 = cellsRef.current.get(column.id)) === null || _a2 === void 0 ? void 0 : _a2.offsetWidth) || ((_b = columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths.get(column.id)) !== null && _b !== void 0 ? _b : column.width) }; - } - if (resizableColumns && columnWidths) { - const isLastColumn = column.id === ((_c = visibleColumns[visibleColumns.length - 1]) === null || _c === void 0 ? void 0 : _c.id); - const totalWidth = visibleColumns.reduce((sum2, { id }) => sum2 + (columnWidths.get(id) || DEFAULT_COLUMN_WIDTH), 0); - if (isLastColumn && containerWidthRef.current > totalWidth) { - return { width: "auto", minWidth: column === null || column === void 0 ? void 0 : column.minWidth }; - } else { - return { width: columnWidths.get(column.id), minWidth: column === null || column === void 0 ? void 0 : column.minWidth }; - } - } - return { - width: column.width, - minWidth: column.minWidth, - maxWidth: !resizableColumns ? column.maxWidth : void 0 - }; - }; - const updateColumnWidths = useStableCallback(() => { - for (const { id } of visibleColumns) { - const element = cellsRef.current.get(id); - if (element) { - setElementWidths(element, getColumnStyles(false, id)); - } - } - for (const { id } of visibleColumns) { - const element = stickyCellsRef.current.get(id); - if (element) { - setElementWidths(element, getColumnStyles(true, id)); - } - } - }); - useResizeObserver(containerRef, ({ contentBoxWidth: containerWidth }) => { - containerWidthRef.current = containerWidth; - updateColumnWidths(); - }); - (0, import_react361.useEffect)(() => { - updateColumnWidths(); - if (!resizableColumns) { - return; - } - let updated = false; - const newColumnWidths = new Map(columnWidths); - const lastVisible = visibleColumnsRef.current; - if (lastVisible) { - for (let index = 0; index < visibleColumns.length; index++) { - const column = visibleColumns[index]; - if (!(columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths.get(column.id)) && lastVisible.indexOf(column.id) === -1) { - updated = true; - newColumnWidths.set(column.id, column.width || DEFAULT_COLUMN_WIDTH); - } - } - if (updated) { - setColumnWidths(newColumnWidths); - } - } - visibleColumnsRef.current = visibleColumns.map((column) => column.id); - }, [columnWidths, resizableColumns, visibleColumns, updateColumnWidths]); - (0, import_react361.useEffect)(() => { - if (!resizableColumns) { - return; - } - setColumnWidths(() => readWidths(getCell, visibleColumns)); - }, []); - function updateColumn(columnId, newWidth) { - setColumnWidths((columnWidths2) => updateWidths(visibleColumns, columnWidths2 !== null && columnWidths2 !== void 0 ? columnWidths2 : /* @__PURE__ */ new Map(), newWidth, columnId)); - } - return import_react361.default.createElement(WidthsContext.Provider, { value: { getColumnStyles, columnWidths: columnWidths !== null && columnWidths !== void 0 ? columnWidths : /* @__PURE__ */ new Map(), updateColumn, setCell } }, children2); -} -function useColumnWidths() { - return (0, import_react361.useContext)(WidthsContext); -} - -// node_modules/@cloudscape-design/components/table/resizer/resizer-lookup.js -function getResizerElements(resizerElement) { - if (!resizerElement) { - return null; - } - const header = findUpUntil(resizerElement, (element) => element.tagName.toLowerCase() === "th"); - if (!header) { - return null; - } - const tableRoot = findUpUntil(header, (element) => element.className.indexOf(styles_css_default72.root) > -1); - if (!tableRoot) { - return null; - } - const table = tableRoot.querySelector(`table`); - if (!table) { - return null; - } - const tracker = tableRoot.querySelector(`.${styles_css_default113.tracker}`); - if (!tracker) { - return null; - } - const scrollParent = getOverflowParents(header)[0]; - if (!scrollParent) { - return null; - } - return { header, table, tracker, scrollParent }; -} -function getHeaderWidth(resizerElement) { - var _a2; - const header = resizerElement && findUpUntil(resizerElement, (element) => element.tagName.toLowerCase() === "th"); - return (_a2 = header === null || header === void 0 ? void 0 : header.getBoundingClientRect().width) !== null && _a2 !== void 0 ? _a2 : 0; -} - -// node_modules/@cloudscape-design/components/table/resizer/index.js -var AUTO_GROW_START_TIME = 10; -var AUTO_GROW_INTERVAL = 10; -var AUTO_GROW_INCREMENT = 5; -function Divider2({ className: className2 }) { - return import_react362.default.createElement("span", { className: clsx_m_default(styles_css_default113.divider, styles_css_default113["divider-disabled"], className2) }); -} -function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, minWidth = DEFAULT_COLUMN_WIDTH, tabIndex, showFocusRing, focusId, roleDescription }) { - onWidthUpdate = useStableCallback(onWidthUpdate); - onWidthUpdateCommit = useStableCallback(onWidthUpdateCommit); - const separatorId = useUniqueId(); - const resizerToggleRef = (0, import_react362.useRef)(null); - const resizerSeparatorRef = (0, import_react362.useRef)(null); - const [isDragging, setIsDragging] = (0, import_react362.useState)(false); - const [isKeyboardDragging, setIsKeyboardDragging] = (0, import_react362.useState)(false); - const autoGrowTimeout = (0, import_react362.useRef)(); - const [resizerHasFocus, setResizerHasFocus] = (0, import_react362.useState)(false); - const [headerCellWidth, setHeaderCellWidth] = (0, import_react362.useState)(0); - (0, import_react362.useEffect)(() => { - setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current)); - }, []); - (0, import_react362.useEffect)(() => { - const elements = getResizerElements(resizerToggleRef.current); - if (!isDragging && !resizerHasFocus || !elements) { - return; - } - const { left: leftEdge, right: rightEdge } = elements.scrollParent.getBoundingClientRect(); - const updateTrackerPosition = (newOffset) => { - const { left: scrollParentLeft } = elements.table.getBoundingClientRect(); - elements.tracker.style.top = elements.header.getBoundingClientRect().height + "px"; - elements.tracker.style.left = newOffset - scrollParentLeft - 1 + "px"; - }; - const updateColumnWidth = (newWidth) => { - const { right, width } = elements.header.getBoundingClientRect(); - const updatedWidth = newWidth < minWidth ? minWidth : newWidth; - updateTrackerPosition(right + updatedWidth - width); - if (newWidth >= minWidth) { - setHeaderCellWidth(newWidth); - } - onWidthUpdate(newWidth); - }; - const resizeColumn = (offset) => { - if (offset > leftEdge) { - const cellLeft = elements.header.getBoundingClientRect().left; - const newWidth = offset - cellLeft; - updateColumnWidth(newWidth); - } - }; - const onAutoGrow = () => { - const width = elements.header.getBoundingClientRect().width; - autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_INTERVAL); - updateColumnWidth(width + AUTO_GROW_INCREMENT); - elements.scrollParent.scrollLeft += AUTO_GROW_INCREMENT; - }; - const onMouseMove = (event) => { - clearTimeout(autoGrowTimeout.current); - const offset = event.pageX; - if (offset > rightEdge) { - autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_START_TIME); - } else { - resizeColumn(offset); - } - }; - const onMouseUp = (event) => { - resizeColumn(event.pageX); - setIsDragging(false); - onWidthUpdateCommit(); - clearTimeout(autoGrowTimeout.current); - }; - const onKeyDown = (event) => { - var _a2, _b; - if (isKeyboardDragging) { - if (event.keyCode === KeyCode.left) { - event.preventDefault(); - updateColumnWidth(elements.header.getBoundingClientRect().width - 10); - } - if (event.keyCode === KeyCode.right) { - event.preventDefault(); - updateColumnWidth(elements.header.getBoundingClientRect().width + 10); - } - if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space || event.keyCode === KeyCode.escape) { - event.preventDefault(); - setIsKeyboardDragging(false); - (_a2 = resizerToggleRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - } else if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) { - event.preventDefault(); - setIsKeyboardDragging(true); - (_b = resizerSeparatorRef.current) === null || _b === void 0 ? void 0 : _b.focus(); - } - }; - updateTrackerPosition(elements.header.getBoundingClientRect().right); - if (isDragging) { - document.body.classList.add(styles_css_default113["resize-active"]); - document.addEventListener("mousemove", onMouseMove); - document.addEventListener("mouseup", onMouseUp); - } - if (resizerHasFocus) { - document.body.classList.add(styles_css_default113["resize-active-with-focus"]); - elements.header.addEventListener("keydown", onKeyDown); - } - if (isKeyboardDragging) { - document.body.classList.add(styles_css_default113["resize-active"]); - } - return () => { - clearTimeout(autoGrowTimeout.current); - document.body.classList.remove(styles_css_default113["resize-active"]); - document.body.classList.remove(styles_css_default113["resize-active-with-focus"]); - document.removeEventListener("mousemove", onMouseMove); - document.removeEventListener("mouseup", onMouseUp); - elements.header.removeEventListener("keydown", onKeyDown); - }; - }, [minWidth, isDragging, isKeyboardDragging, resizerHasFocus, onWidthUpdate, onWidthUpdateCommit]); - const { tabIndex: resizerTabIndex } = useSingleTabStopNavigation(resizerToggleRef, { tabIndex }); - return import_react362.default.createElement( - import_react362.default.Fragment, - null, - import_react362.default.createElement("button", { ref: resizerToggleRef, className: clsx_m_default(styles_css_default113.resizer, (resizerHasFocus || showFocusRing || isKeyboardDragging) && styles_css_default113["has-focus"]), onMouseDown: (event) => { - if (event.button !== 0) { - return; - } - event.preventDefault(); - setIsDragging(true); - }, onClick: () => { - var _a2; - setIsDragging(false); - setResizerHasFocus(true); - setIsKeyboardDragging(true); - (_a2 = resizerSeparatorRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - }, onFocus: () => { - setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current)); - setResizerHasFocus(true); - }, onBlur: (event) => { - if (event.relatedTarget !== resizerSeparatorRef.current) { - setResizerHasFocus(false); - } - }, "aria-roledescription": roleDescription, "aria-labelledby": ariaLabelledby, tabIndex: resizerTabIndex, "data-focus-id": focusId }), - import_react362.default.createElement("span", { className: clsx_m_default(styles_css_default113.divider, isDragging && styles_css_default113["divider-active"]), "data-awsui-table-suppress-navigation": true, ref: resizerSeparatorRef, id: separatorId, role: "separator", tabIndex: -1, "aria-hidden": !isKeyboardDragging, "aria-orientation": "vertical", "aria-valuenow": headerCellWidth, "aria-valuetext": headerCellWidth.toFixed(0), "aria-valuemin": minWidth, "data-focus-id": focusId, onBlur: () => { - setResizerHasFocus(false); - if (isKeyboardDragging) { - setIsKeyboardDragging(false); - } - onWidthUpdateCommit(); - } }) - ); -} -function ResizeTracker() { - return import_react362.default.createElement("span", { className: styles_css_default113.tracker }); -} - -// node_modules/@cloudscape-design/components/table/header-cell/th-element.js -var import_react366 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/sticky-columns/use-sticky-columns.js -var import_react363 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/sticky-columns/utils.js -function isCellStatesEqual(s1, s2) { - if (s1 && s2) { - return s1.padLeft === s2.padLeft && s1.lastLeft === s2.lastLeft && s1.lastRight === s2.lastRight && s1.offset.left === s2.offset.left && s1.offset.right === s2.offset.right; - } - return s1 === s2; -} -function isWrapperStatesEqual(s1, s2) { - return s1.scrollPaddingLeft === s2.scrollPaddingLeft && s1.scrollPaddingRight === s2.scrollPaddingRight; -} -function updateCellOffsets(cells, props2) { - var _a2, _b, _c, _d, _e, _f; - const totalColumns = props2.visibleColumns.length; - const firstColumnsWidths = []; - for (let i = 0; i < Math.min(totalColumns, props2.stickyColumnsFirst); i++) { - const element = cells.get(props2.visibleColumns[i]); - const cellWidth = (_a2 = element === null || element === void 0 ? void 0 : element.getBoundingClientRect().width) !== null && _a2 !== void 0 ? _a2 : 0; - firstColumnsWidths[i] = ((_b = firstColumnsWidths[i - 1]) !== null && _b !== void 0 ? _b : 0) + cellWidth; - } - const lastColumnsWidths = []; - for (let i = 0; i < Math.min(totalColumns, props2.stickyColumnsLast); i++) { - const element = cells.get(props2.visibleColumns[totalColumns - 1 - i]); - const cellWidth = (_c = element === null || element === void 0 ? void 0 : element.getBoundingClientRect().width) !== null && _c !== void 0 ? _c : 0; - lastColumnsWidths[i] = ((_d = lastColumnsWidths[i - 1]) !== null && _d !== void 0 ? _d : 0) + cellWidth; - } - const stickyWidthLeft = (_e = firstColumnsWidths[props2.stickyColumnsFirst - 1]) !== null && _e !== void 0 ? _e : 0; - const stickyWidthRight = (_f = lastColumnsWidths[props2.stickyColumnsLast - 1]) !== null && _f !== void 0 ? _f : 0; - const offsets = props2.visibleColumns.reduce((map2, columnId, columnIndex) => { - var _a3, _b2; - return map2.set(columnId, { - first: (_a3 = firstColumnsWidths[columnIndex - 1]) !== null && _a3 !== void 0 ? _a3 : 0, - last: (_b2 = lastColumnsWidths[totalColumns - 1 - columnIndex - 1]) !== null && _b2 !== void 0 ? _b2 : 0 - }); - }, /* @__PURE__ */ new Map()); - return { offsets, stickyWidthLeft, stickyWidthRight }; -} - -// node_modules/@cloudscape-design/components/table/sticky-columns/use-sticky-columns.js -var MINIMUM_SCROLLABLE_SPACE = 148; -function useStickyColumns({ visibleColumns, stickyColumnsFirst, stickyColumnsLast }) { - const store = (0, import_react363.useMemo)(() => new StickyColumnsStore(), []); - const wrapperRef = (0, import_react363.useRef)(null); - const tableRef = (0, import_react363.useRef)(null); - const cellsRef = (0, import_react363.useRef)(/* @__PURE__ */ new Map()); - const hasStickyColumns = stickyColumnsFirst + stickyColumnsLast > 0; - const updateStickyStyles = useStableCallback(() => { - if (wrapperRef.current && tableRef.current) { - store.updateCellStyles({ - wrapper: wrapperRef.current, - table: tableRef.current, - cells: cellsRef.current, - visibleColumns, - stickyColumnsFirst, - stickyColumnsLast - }); - } - }); - useResizeObserver(wrapperRef, updateStickyStyles); - useResizeObserver(tableRef, updateStickyStyles); - (0, import_react363.useEffect)(() => { - if (wrapperRef.current && tableRef.current) { - store.updateCellStyles({ - wrapper: wrapperRef.current, - table: tableRef.current, - cells: cellsRef.current, - visibleColumns, - stickyColumnsFirst, - stickyColumnsLast - }); - } - }, [store, stickyColumnsFirst, stickyColumnsLast, visibleColumns]); - (0, import_react363.useEffect)(() => { - if (!hasStickyColumns) { - return; - } - const selector = (state) => state.wrapperState; - const updateWrapperStyles = (state, prev) => { - if (isWrapperStatesEqual(state, prev)) { - return; - } - if (wrapperRef.current) { - wrapperRef.current.style.scrollPaddingLeft = state.scrollPaddingLeft + "px"; - wrapperRef.current.style.scrollPaddingRight = state.scrollPaddingRight + "px"; - } - }; - const unsubscribe = store.subscribe(selector, (newState, prevState) => updateWrapperStyles(selector(newState), selector(prevState))); - return unsubscribe; - }, [store, hasStickyColumns]); - const setWrapper = (0, import_react363.useCallback)((node) => { - if (wrapperRef.current) { - wrapperRef.current.removeEventListener("scroll", updateStickyStyles); - } - if (node && hasStickyColumns) { - node.addEventListener("scroll", updateStickyStyles); - } - wrapperRef.current = node; - }, [hasStickyColumns, updateStickyStyles]); - const setTable = (0, import_react363.useCallback)((node) => { - tableRef.current = node; - }, []); - const setCell = (0, import_react363.useCallback)((columnId, node) => { - if (node) { - cellsRef.current.set(columnId, node); - } else { - cellsRef.current.delete(columnId); - } - }, []); - return { - store, - style: { - // Provide wrapper styles as props so that a re-render won't cause invalidation. - wrapper: hasStickyColumns ? Object.assign({}, store.get().wrapperState) : void 0 - }, - refs: { wrapper: setWrapper, table: setTable, cell: setCell } - }; -} -function useStickyCellStyles({ stickyColumns, columnId, getClassName: getClassName4 }) { - var _a2; - const setCell = stickyColumns.refs.cell; - const unsubscribeRef = (0, import_react363.useRef)(null); - const refCallback = (0, import_react363.useCallback)( - (cellElement) => { - if (unsubscribeRef.current) { - unsubscribeRef.current(); - } - setCell(columnId, cellElement); - const selector = (state) => { - var _a3; - return (_a3 = state.cellState.get(columnId)) !== null && _a3 !== void 0 ? _a3 : null; - }; - const updateCellStyles = (state, prev) => { - if (isCellStatesEqual(state, prev)) { - return; - } - const className2 = getClassName4(state); - if (cellElement) { - Object.keys(className2).forEach((key2) => { - if (className2[key2]) { - cellElement.classList.add(key2); - } else { - cellElement.classList.remove(key2); - } - }); - cellElement.style.left = (state === null || state === void 0 ? void 0 : state.offset.left) !== void 0 ? `${state.offset.left}px` : ""; - cellElement.style.right = (state === null || state === void 0 ? void 0 : state.offset.right) !== void 0 ? `${state.offset.right}px` : ""; - } - }; - if (cellElement) { - unsubscribeRef.current = stickyColumns.store.subscribe(selector, (newState, prevState) => { - updateCellStyles(selector(newState), selector(prevState)); - }); - } - }, - // getClassName is expected to be pure - // eslint-disable-next-line react-hooks/exhaustive-deps - [columnId, setCell, stickyColumns.store] - ); - const cellStyles = stickyColumns.store.get().cellState.get(columnId); - return { - ref: refCallback, - className: cellStyles ? clsx_m_default(getClassName4(cellStyles)) : void 0, - style: (_a2 = cellStyles === null || cellStyles === void 0 ? void 0 : cellStyles.offset) !== null && _a2 !== void 0 ? _a2 : void 0 - }; -} -var StickyColumnsStore = class extends AsyncStore { - constructor() { - super({ cellState: /* @__PURE__ */ new Map(), wrapperState: { scrollPaddingLeft: 0, scrollPaddingRight: 0 } }); - this.cellOffsets = { - offsets: /* @__PURE__ */ new Map(), - stickyWidthLeft: 0, - stickyWidthRight: 0 - }; - this.isStuckToTheLeft = false; - this.isStuckToTheRight = false; - this.padLeft = false; - this.generateCellStyles = (props2) => { - const isEnabled = this.isEnabled(props2); - const lastLeftStickyColumnIndex = props2.stickyColumnsFirst - 1; - const lastRightStickyColumnIndex = props2.visibleColumns.length - props2.stickyColumnsLast; - return props2.visibleColumns.reduce((acc, columnId, index) => { - var _a2, _b, _c, _d; - let stickySide = "non-sticky"; - if (index < props2.stickyColumnsFirst) { - stickySide = "left"; - } else if (index >= props2.visibleColumns.length - props2.stickyColumnsLast) { - stickySide = "right"; - } - if (!isEnabled || stickySide === "non-sticky") { - return acc; - } - const isFirstColumn = index === 0; - const stickyColumnOffsetLeft = (_b = (_a2 = this.cellOffsets.offsets.get(columnId)) === null || _a2 === void 0 ? void 0 : _a2.first) !== null && _b !== void 0 ? _b : 0; - const stickyColumnOffsetRight = (_d = (_c = this.cellOffsets.offsets.get(columnId)) === null || _c === void 0 ? void 0 : _c.last) !== null && _d !== void 0 ? _d : 0; - acc.set(columnId, { - padLeft: isFirstColumn && this.padLeft, - lastLeft: this.isStuckToTheLeft && lastLeftStickyColumnIndex === index, - lastRight: this.isStuckToTheRight && lastRightStickyColumnIndex === index, - offset: { - left: stickySide === "left" ? stickyColumnOffsetLeft : void 0, - right: stickySide === "right" ? stickyColumnOffsetRight : void 0 - } - }); - return acc; - }, /* @__PURE__ */ new Map()); - }; - this.updateCellOffsets = (props2) => { - this.cellOffsets = updateCellOffsets(props2.cells, props2); - }; - this.isEnabled = (props2) => { - const noStickyColumns = props2.stickyColumnsFirst + props2.stickyColumnsLast === 0; - if (noStickyColumns) { - return false; - } - const wrapperWidth = props2.wrapper.getBoundingClientRect().width; - const tableWidth = props2.table.getBoundingClientRect().width; - const isWrapperScrollable = tableWidth > wrapperWidth; - if (!isWrapperScrollable) { - return false; - } - const totalStickySpace = this.cellOffsets.stickyWidthLeft + this.cellOffsets.stickyWidthRight; - const tablePaddingLeft = parseFloat(getComputedStyle(props2.table).paddingLeft) || 0; - const tablePaddingRight = parseFloat(getComputedStyle(props2.table).paddingRight) || 0; - const hasEnoughScrollableSpace = totalStickySpace + MINIMUM_SCROLLABLE_SPACE + tablePaddingLeft + tablePaddingRight < wrapperWidth; - if (!hasEnoughScrollableSpace) { - return false; - } - return true; - }; - } - updateCellStyles(props2) { - const hasStickyColumns = props2.stickyColumnsFirst + props2.stickyColumnsLast > 0; - const hadStickyColumns = this.cellOffsets.offsets.size > 0; - if (hasStickyColumns || hadStickyColumns) { - this.updateScroll(props2); - this.updateCellOffsets(props2); - this.set(() => ({ - cellState: this.generateCellStyles(props2), - wrapperState: { - scrollPaddingLeft: this.cellOffsets.stickyWidthLeft, - scrollPaddingRight: this.cellOffsets.stickyWidthRight - } - })); - } - } - updateScroll(props2) { - const wrapperScrollLeft = props2.wrapper.scrollLeft; - const wrapperScrollWidth = props2.wrapper.scrollWidth; - const wrapperClientWidth = props2.wrapper.clientWidth; - const tablePaddingLeft = parseFloat(getComputedStyle(props2.table).paddingLeft) || 0; - const tablePaddingRight = parseFloat(getComputedStyle(props2.table).paddingRight) || 0; - this.isStuckToTheLeft = wrapperScrollLeft > tablePaddingLeft; - this.isStuckToTheRight = Math.ceil(wrapperScrollLeft) < wrapperScrollWidth - wrapperClientWidth - tablePaddingRight; - this.padLeft = tablePaddingLeft !== 0 && this.isStuckToTheLeft; - } -}; - -// node_modules/@cloudscape-design/components/table/table-role/table-role-helper.js -var stateToAriaSort = { - sortable: "none", - ascending: "ascending", - descending: "descending" -}; -var getAriaSort = (sortingState) => stateToAriaSort[sortingState]; -function getTableRoleProps(options) { - const nativeProps = {}; - nativeProps.role = options.tableRole === "grid-default" ? "grid" : options.tableRole; - nativeProps["aria-label"] = options.ariaLabel; - nativeProps["aria-labelledby"] = options.ariaLabelledBy; - nativeProps["aria-rowcount"] = options.totalItemsCount ? options.totalItemsCount + 1 : -1; - if (options.tableRole === "grid" || options.tableRole === "treegrid") { - nativeProps["aria-colcount"] = options.totalColumnsCount; - } - if (options.tableRole === "grid" || options.tableRole === "treegrid") { - nativeProps.tabIndex = -1; - } - return nativeProps; -} -function getTableWrapperRoleProps(options) { - const nativeProps = {}; - if (options.isScrollable) { - nativeProps.role = "region"; - nativeProps.tabIndex = 0; - nativeProps["aria-label"] = options.ariaLabel; - } - return nativeProps; -} -function getTableHeaderRowRoleProps(options) { - const nativeProps = {}; - if (options.tableRole === "grid" || options.tableRole === "grid-default" || options.tableRole === "treegrid") { - nativeProps["aria-rowindex"] = 1; - } - return nativeProps; -} -function getTableRowRoleProps(options) { - const nativeProps = {}; - if (options.tableRole === "grid" || options.tableRole === "treegrid") { - nativeProps["aria-rowindex"] = (options.firstIndex || 1) + options.rowIndex + 1; - } else if (options.firstIndex !== void 0) { - nativeProps["aria-rowindex"] = options.firstIndex + options.rowIndex + 1; - } - if (options.tableRole === "treegrid" && options.level && options.level !== 0) { - nativeProps["aria-level"] = options.level; - } - if (options.tableRole === "treegrid" && options.setSize) { - nativeProps["aria-setsize"] = options.setSize; - } - if (options.tableRole === "treegrid" && options.posInSet) { - nativeProps["aria-posinset"] = options.posInSet; - } - return nativeProps; -} -function getTableColHeaderRoleProps(options) { - const nativeProps = {}; - nativeProps.scope = "col"; - if (options.tableRole === "grid" || options.tableRole === "treegrid") { - nativeProps["aria-colindex"] = options.colIndex + 1; - } - if (options.sortingStatus) { - nativeProps["aria-sort"] = getAriaSort(options.sortingStatus); - } - return nativeProps; -} -function getTableCellRoleProps(options) { - const nativeProps = {}; - if (options.tableRole === "grid" || options.tableRole === "treegrid") { - nativeProps["aria-colindex"] = options.colIndex + 1; - } - if (options.isRowHeader) { - nativeProps.scope = "row"; - } - return nativeProps; -} - -// node_modules/@cloudscape-design/components/table/table-role/grid-navigation.js -var import_react364 = __toESM(require_react()); -var import_react365 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/table-role/utils.js -function getClosestCell(element) { - return element.closest("td,th"); -} -function isElementDisabled(element) { - if (element instanceof HTMLInputElement || element instanceof HTMLButtonElement) { - return element.disabled; - } - return false; -} -function defaultIsSuppressed(target) { - let current = target; - while (current) { - if (isTableCell(current)) { - return false; - } - if (current.getAttribute("role") === "dialog" || current.getAttribute("data-awsui-table-suppress-navigation") === "true") { - return true; - } - current = current.parentElement; - } - return false; -} -function findTableRowByAriaRowIndex(table, targetAriaRowIndex, delta) { - var _a2; - let targetRow = null; - const rowElements = Array.from(table.querySelectorAll("tr[aria-rowindex]")); - if (delta < 0) { - rowElements.reverse(); - } - for (const element of rowElements) { - const rowIndex = parseInt((_a2 = element.getAttribute("aria-rowindex")) !== null && _a2 !== void 0 ? _a2 : ""); - targetRow = element; - if (rowIndex === targetAriaRowIndex) { - break; - } - if (delta >= 0 && rowIndex > targetAriaRowIndex) { - break; - } - if (delta < 0 && rowIndex < targetAriaRowIndex) { - break; - } - } - return targetRow; -} -function findTableRowCellByAriaColIndex(tableRow, targetAriaColIndex, delta) { - var _a2; - let targetCell = null; - const cellElements = Array.from(tableRow.querySelectorAll("td[aria-colindex],th[aria-colindex]")); - if (delta < 0) { - cellElements.reverse(); - } - for (const element of cellElements) { - const columnIndex = parseInt((_a2 = element.getAttribute("aria-colindex")) !== null && _a2 !== void 0 ? _a2 : ""); - targetCell = element; - if (columnIndex === targetAriaColIndex) { - break; - } - if (delta >= 0 && columnIndex > targetAriaColIndex) { - break; - } - if (delta < 0 && columnIndex < targetAriaColIndex) { - break; - } - } - return targetCell; -} -function isTableCell(element) { - return element.tagName === "TD" || element.tagName === "TH"; -} - -// node_modules/@cloudscape-design/components/table/table-role/grid-navigation.js -function GridNavigationProvider({ keyboardNavigation, pageSize, getTable, children: children2 }) { - const gridNavigation = (0, import_react365.useMemo)(() => new GridNavigationProcessor(), []); - const getTableStable = useStableCallback(getTable); - (0, import_react365.useEffect)(() => { - if (keyboardNavigation) { - const table = getTableStable(); - table && gridNavigation.init(table); - } - return () => gridNavigation.cleanup(); - }, [keyboardNavigation, gridNavigation, getTableStable]); - (0, import_react365.useEffect)(() => { - gridNavigation.update({ pageSize }); - }, [gridNavigation, pageSize]); - (0, import_react365.useEffect)(() => { - if (keyboardNavigation) { - gridNavigation.refresh(); - } - }); - return import_react364.default.createElement(SingleTabStopNavigationContext.Provider, { value: { - navigationActive: keyboardNavigation, - registerFocusable: gridNavigation.registerFocusable - } }, children2); -} -var GridNavigationProcessor = class { - constructor() { - this._pageSize = 0; - this._table = null; - this.focusedCell = null; - this.keepUserIndex = false; - this.focusables = /* @__PURE__ */ new Set(); - this.focusHandlers = /* @__PURE__ */ new Map(); - this.focusablesState = /* @__PURE__ */ new WeakMap(); - this.focusTarget = null; - this.registerFocusable = (focusableElement, changeHandler) => { - var _a2, _b; - this.focusables.add(focusableElement); - this.focusHandlers.set(focusableElement, changeHandler); - const isFocusable = (_a2 = this.focusablesState.get(focusableElement)) !== null && _a2 !== void 0 ? _a2 : false; - const newIsFocusable = this.focusTarget === focusableElement || this.isSuppressed(focusableElement); - if (newIsFocusable !== isFocusable) { - this.focusablesState.set(focusableElement, newIsFocusable); - changeHandler(newIsFocusable); - } - const focusedElement = (_b = this.focusedCell) === null || _b === void 0 ? void 0 : _b.element; - if (focusedElement && isTableCell(focusedElement) && focusedElement.contains(focusableElement)) { - focusableElement.focus({ preventScroll: true }); - } - return () => this.unregisterFocusable(focusableElement); - }; - this.unregisterFocusable = (focusable) => { - this.focusables.delete(focusable); - this.focusHandlers.delete(focusable); - }; - this.onFocusin = (event) => { - if (!(event.target instanceof HTMLElement)) { - return; - } - this.updateFocusedCell(event.target); - if (!this.focusedCell) { - return; - } - this.updateFocusTarget(); - const focusedElement = this.focusedCell.element; - const nextTarget = isTableCell(focusedElement) ? this.getFocusablesFrom(focusedElement)[0] : null; - if (nextTarget) { - nextTarget.focus({ preventScroll: true }); - } else { - this.keepUserIndex = false; - } - }; - this.onFocusout = () => { - setTimeout(() => { - if (this.focusedCell && !nodeBelongs(this.table, this.focusedCell.element)) { - this.moveFocusBy(this.focusedCell, { x: 0, y: 0 }); - } - }, 0); - }; - this.onKeydown = (event) => { - if (!this.focusedCell) { - return; - } - const ctrlKey = event.ctrlKey ? 1 : 0; - const altKey = event.altKey ? 1 : 0; - const shiftKey = event.shiftKey ? 1 : 0; - const metaKey = event.metaKey ? 1 : 0; - const numModifiersPressed = ctrlKey + altKey + shiftKey + metaKey; - let key2 = event.keyCode; - if (numModifiersPressed === 1 && event.ctrlKey) { - key2 = -key2; - } else if (numModifiersPressed) { - return; - } - const from = this.focusedCell; - if (this.isSuppressed(document.activeElement) || !this.isRegistered(document.activeElement)) { - return; - } - switch (key2) { - case KeyCode.up: - event.preventDefault(); - return this.moveFocusBy(from, { y: -1, x: 0 }); - case KeyCode.down: - event.preventDefault(); - return this.moveFocusBy(from, { y: 1, x: 0 }); - case KeyCode.left: - event.preventDefault(); - return this.moveFocusBy(from, { y: 0, x: -1 }); - case KeyCode.right: - event.preventDefault(); - return this.moveFocusBy(from, { y: 0, x: 1 }); - case KeyCode.pageUp: - event.preventDefault(); - return this.moveFocusBy(from, { y: -this.pageSize, x: 0 }); - case KeyCode.pageDown: - event.preventDefault(); - return this.moveFocusBy(from, { y: this.pageSize, x: 0 }); - case KeyCode.home: - event.preventDefault(); - return this.moveFocusBy(from, { y: 0, x: -Infinity }); - case KeyCode.end: - event.preventDefault(); - return this.moveFocusBy(from, { y: 0, x: Infinity }); - case -KeyCode.home: - event.preventDefault(); - return this.moveFocusBy(from, { y: -Infinity, x: -Infinity }); - case -KeyCode.end: - event.preventDefault(); - return this.moveFocusBy(from, { y: Infinity, x: Infinity }); - default: - return; - } - }; - } - init(table) { - this._table = table; - this.table.addEventListener("focusin", this.onFocusin); - this.table.addEventListener("focusout", this.onFocusout); - this.table.addEventListener("keydown", this.onKeydown); - this.updateFocusTarget(); - this.cleanup = () => { - this.table.removeEventListener("focusin", this.onFocusin); - this.table.removeEventListener("focusout", this.onFocusout); - this.table.removeEventListener("keydown", this.onKeydown); - this.focusables.forEach(this.unregisterFocusable); - }; - } - cleanup() { - } - update({ pageSize }) { - this._pageSize = pageSize; - } - refresh() { - setTimeout(() => { - var _a2; - if (this._table) { - this.updateFocusedCell((_a2 = this.focusedCell) === null || _a2 === void 0 ? void 0 : _a2.element); - this.updateFocusTarget(); - } - }, 0); - } - get pageSize() { - return this._pageSize; - } - get table() { - if (!this._table) { - throw new Error("Invariant violation: GridNavigationProcessor is used before initialization."); - } - return this._table; - } - moveFocusBy(cell, delta) { - var _a2; - if (delta.y !== 0 && delta.x === 0) { - this.keepUserIndex = true; - } - (_a2 = this.getNextFocusable(cell, delta)) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - updateFocusTarget() { - var _a2; - this.focusTarget = this.getSingleFocusable(); - for (const focusableElement of this.focusables) { - const isFocusable = (_a2 = this.focusablesState.get(focusableElement)) !== null && _a2 !== void 0 ? _a2 : false; - const newIsFocusable = this.focusTarget === focusableElement || this.isSuppressed(focusableElement); - if (newIsFocusable !== isFocusable) { - this.focusablesState.set(focusableElement, newIsFocusable); - this.focusHandlers.get(focusableElement)(newIsFocusable); - } - } - } - isSuppressed(element) { - if (!this.focusedCell) { - return false; - } - return !element || defaultIsSuppressed(element); - } - isRegistered(element) { - return !element || this.focusables.has(element); - } - updateFocusedCell(focusedElement) { - var _a2, _b, _c, _d, _e, _f; - if (!focusedElement) { - return; - } - const cellElement = getClosestCell(focusedElement); - const rowElement = cellElement === null || cellElement === void 0 ? void 0 : cellElement.closest("tr"); - if (!cellElement || !rowElement) { - return; - } - const colIndex = parseInt((_a2 = cellElement.getAttribute("aria-colindex")) !== null && _a2 !== void 0 ? _a2 : ""); - const rowIndex = parseInt((_b = rowElement.getAttribute("aria-rowindex")) !== null && _b !== void 0 ? _b : ""); - if (isNaN(colIndex) || isNaN(rowIndex)) { - return; - } - const cellFocusables = this.getFocusablesFrom(cellElement); - const elementIndex = cellFocusables.indexOf(focusedElement); - const prevColIndex = (_d = (_c = this.focusedCell) === null || _c === void 0 ? void 0 : _c.colIndex) !== null && _d !== void 0 ? _d : -1; - const prevElementIndex = (_f = (_e = this.focusedCell) === null || _e === void 0 ? void 0 : _e.elementIndex) !== null && _f !== void 0 ? _f : -1; - this.focusedCell = { - rowIndex, - colIndex: this.keepUserIndex && prevColIndex !== -1 ? prevColIndex : colIndex, - elementIndex: this.keepUserIndex && prevElementIndex !== -1 ? prevElementIndex : elementIndex, - element: focusedElement - }; - } - getNextFocusable(from, delta) { - var _a2; - const targetAriaRowIndex = from.rowIndex + delta.y; - const targetRow = findTableRowByAriaRowIndex(this.table, targetAriaRowIndex, delta.y); - if (!targetRow) { - return null; - } - const cellElement = getClosestCell(from.element); - const cellFocusables = cellElement ? this.getFocusablesFrom(cellElement) : []; - const nextElementIndex = from.elementIndex + delta.x; - const isValidDirection = !!delta.x; - const isValidIndex2 = from.elementIndex !== -1 && 0 <= nextElementIndex && nextElementIndex < cellFocusables.length; - const isTargetDifferent = from.element !== cellFocusables[nextElementIndex]; - if (isValidDirection && isValidIndex2 && isTargetDifferent) { - return cellFocusables[nextElementIndex]; - } - const targetAriaColIndex = from.colIndex + delta.x; - const targetCell = findTableRowCellByAriaColIndex(targetRow, targetAriaColIndex, delta.x); - if (!targetCell) { - return null; - } - if (targetCell === cellElement && delta.x !== 0) { - return null; - } - const targetCellFocusables = this.getFocusablesFrom(targetCell); - let focusIndex = from.elementIndex; - if (isFinite(delta.x) && delta.x > 0 || delta.x === -Infinity) { - focusIndex = 0; - } - if (isFinite(delta.x) && delta.x < 0 || delta.x === Infinity) { - focusIndex = targetCellFocusables.length - 1; - } - return (_a2 = targetCellFocusables[focusIndex]) !== null && _a2 !== void 0 ? _a2 : targetCell; - } - getSingleFocusable() { - var _a2; - const cell = this.focusedCell; - const firstTableCell = this.table.querySelector("td,th"); - let focusTarget = (_a2 = firstTableCell && this.getFocusablesFrom(firstTableCell)[0]) !== null && _a2 !== void 0 ? _a2 : firstTableCell; - if (cell) { - focusTarget = this.getNextFocusable(cell, { x: 0, y: 0 }); - } - return focusTarget; - } - getFocusablesFrom(target) { - return getAllFocusables(target).filter((el) => this.focusables.has(el) && !isElementDisabled(el)); - } -}; - -// node_modules/@cloudscape-design/components/table/header-cell/th-element.js -function TableThElement({ className: className2, style, sortingStatus, sortingDisabled, focusedComponent, hidden, colIndex, columnId, stickyState, cellRef, tableRole, children: children2 }) { - const stickyStyles = useStickyCellStyles({ - stickyColumns: stickyState, - columnId, - getClassName: (props2) => getStickyClassNames(styles_css_default112, props2) - }); - const cellRefObject = (0, import_react366.useRef)(null); - const mergedRef = useMergeRefs(stickyStyles.ref, cellRef, cellRefObject); - const { tabIndex: cellTabIndex } = useSingleTabStopNavigation(cellRefObject); - return import_react366.default.createElement("th", Object.assign({ "data-focus-id": `header-${String(columnId)}`, className: clsx_m_default(className2, { - [styles_css_default112["header-cell-fake-focus"]]: focusedComponent === `header-${String(columnId)}`, - [styles_css_default112["header-cell-sortable"]]: sortingStatus, - [styles_css_default112["header-cell-sorted"]]: sortingStatus === "ascending" || sortingStatus === "descending", - [styles_css_default112["header-cell-disabled"]]: sortingDisabled, - [styles_css_default112["header-cell-ascending"]]: sortingStatus === "ascending", - [styles_css_default112["header-cell-descending"]]: sortingStatus === "descending", - [styles_css_default112["header-cell-hidden"]]: hidden - }, stickyStyles.className), style: Object.assign(Object.assign({}, style), stickyStyles.style), ref: mergedRef }, getTableColHeaderRoleProps({ tableRole, sortingStatus, colIndex }), { tabIndex: cellTabIndex }), children2); -} - -// node_modules/@cloudscape-design/components/table/header-cell/index.js -function TableHeaderCell({ className: className2, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, resizerRoleDescription, isExpandable }) { - var _a2; - const i18n = useInternalI18n("table"); - const sortable = !!column.sortingComparator || !!column.sortingField; - const sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn); - const sortingStatus = getSortingStatus(sortable, sorted, !!sortingDescending, !!sortingDisabled); - const handleClick = () => onClick({ - sortingColumn: column, - isDescending: sorted ? !sortingDescending : false - }); - const handleKeyPress = ({ nativeEvent: e }) => { - if (e.keyCode === KeyCode.enter || e.keyCode === KeyCode.space) { - e.preventDefault(); - handleClick(); - } - }; - const headerId = useUniqueId("table-header-"); - const clickableHeaderRef = (0, import_react367.useRef)(null); - const { tabIndex: clickableHeaderTabIndex } = useSingleTabStopNavigation(clickableHeaderRef, { tabIndex }); - return import_react367.default.createElement( - TableThElement, - { className: className2, style, cellRef, sortingStatus, sortingDisabled, focusedComponent, hidden, colIndex, columnId, stickyState, tableRole }, - import_react367.default.createElement( - "div", - Object.assign({ ref: clickableHeaderRef, "data-focus-id": `sorting-control-${String(columnId)}`, className: clsx_m_default(styles_css_default112["header-cell-content"], { - [styles_css_default112["header-cell-fake-focus"]]: focusedComponent === `sorting-control-${String(columnId)}`, - [styles_css_default112["header-cell-content-expandable"]]: isExpandable - }), "aria-label": column.ariaLabel ? column.ariaLabel({ - sorted, - descending: sorted && !!sortingDescending, - disabled: !!sortingDisabled - }) : void 0 }, sortingStatus && !sortingDisabled ? { - onKeyPress: handleKeyPress, - tabIndex: clickableHeaderTabIndex, - role: "button", - onClick: handleClick - } : {}), - import_react367.default.createElement( - "div", - { className: clsx_m_default(styles_css_default112["header-cell-text"], wrapLines && styles_css_default112["header-cell-text-wrap"]), id: headerId }, - column.header, - isEditable && !isExpandable ? import_react367.default.createElement( - "span", - { className: styles_css_default112["edit-icon"], role: "img", "aria-label": i18n("columnDefinitions.editConfig.editIconAriaLabel", (_a2 = column.editConfig) === null || _a2 === void 0 ? void 0 : _a2.editIconAriaLabel) }, - import_react367.default.createElement(internal_default, { name: "edit" }) - ) : null - ), - sortingStatus && import_react367.default.createElement( - "span", - { className: styles_css_default112["sorting-icon"] }, - import_react367.default.createElement(internal_default, { name: getSortingIconName(sortingStatus) }) - ) - ), - resizableColumns ? import_react367.default.createElement(Resizer, { tabIndex, focusId: `resize-control-${String(columnId)}`, showFocusRing: focusedComponent === `resize-control-${String(columnId)}`, onWidthUpdate: (newWidth) => updateColumn(columnId, newWidth), onWidthUpdateCommit: onResizeFinish, ariaLabelledby: headerId, minWidth: typeof column.minWidth === "string" ? parseInt(column.minWidth) : column.minWidth, roleDescription: i18n("ariaLabels.resizerRoleDescription", resizerRoleDescription) }) : import_react367.default.createElement(Divider2, { className: styles_css_default112["resize-divider"] }) - ); -} - -// node_modules/@cloudscape-design/components/table/thead.js -var Thead = import_react368.default.forwardRef(({ selectionType, getSelectAllProps, columnDefinitions, sortingColumn, sortingDisabled, sortingDescending, resizableColumns, variant, wrapLines, onFocusMove, onSortingChange, onResizeFinish, singleSelectionHeaderAriaLabel, stripedRows, sticky = false, hidden = false, stuck = false, stickyState, selectionColumnId: selectionColumnId2, focusedComponent, onFocusedComponentChange, tableRole, resizerRoleDescription, isExpandable }, outerRef) => { - const isVisualRefresh = useVisualRefresh(); - const headerCellClass = clsx_m_default(styles_css_default112["header-cell"], styles_css_default112[`header-cell-variant-${variant}`], sticky && styles_css_default112["header-cell-sticky"], stuck && styles_css_default112["header-cell-stuck"], stripedRows && styles_css_default112["has-striped-rows"], isVisualRefresh && styles_css_default112["is-visual-refresh"]); - const selectionCellClass = clsx_m_default(styles_css_default72["selection-control"], styles_css_default72["selection-control-header"], isVisualRefresh && styles_css_default72["is-visual-refresh"]); - const { getColumnStyles, columnWidths, updateColumn, setCell } = useColumnWidths(); - return import_react368.default.createElement( - "thead", - { className: clsx_m_default(!hidden && styles_css_default72["thead-active"]) }, - import_react368.default.createElement( - "tr", - Object.assign({}, focusMarkers.all, { ref: outerRef, "aria-rowindex": 1 }, getTableHeaderRowRoleProps({ tableRole }), { onFocus: (event) => { - var _a2; - const focusControlElement = findUpUntil(event.target, (element) => !!element.getAttribute("data-focus-id")); - const focusId = (_a2 = focusControlElement === null || focusControlElement === void 0 ? void 0 : focusControlElement.getAttribute("data-focus-id")) !== null && _a2 !== void 0 ? _a2 : null; - onFocusedComponentChange === null || onFocusedComponentChange === void 0 ? void 0 : onFocusedComponentChange(focusId); - }, onBlur: () => onFocusedComponentChange === null || onFocusedComponentChange === void 0 ? void 0 : onFocusedComponentChange(null) }), - selectionType ? import_react368.default.createElement( - TableThElement, - { className: clsx_m_default(headerCellClass, selectionCellClass, hidden && styles_css_default112["header-cell-hidden"]), hidden, tableRole, colIndex: 0, focusedComponent, columnId: selectionColumnId2, stickyState }, - selectionType === "multi" ? import_react368.default.createElement(SelectionControl, Object.assign({ onFocusDown: (event) => { - onFocusMove(event.target, -1, 1); - }, focusedComponent }, getSelectAllProps(), sticky ? { tabIndex: -1 } : {})) : import_react368.default.createElement(ScreenreaderOnly, null, singleSelectionHeaderAriaLabel), - import_react368.default.createElement(Divider2, { className: styles_css_default72["resize-divider"] }) - ) : null, - columnDefinitions.map((column, colIndex) => { - const columnId = getColumnKey(column, colIndex); - return import_react368.default.createElement(TableHeaderCell, { - key: columnId, - style: getColumnStyles(sticky, columnId), - className: headerCellClass, - tabIndex: sticky ? -1 : 0, - focusedComponent, - column, - activeSortingColumn: sortingColumn, - sortingDescending, - sortingDisabled, - wrapLines, - hidden, - colIndex: selectionType ? colIndex + 1 : colIndex, - columnId, - updateColumn, - onResizeFinish: () => onResizeFinish(columnWidths), - resizableColumns, - onClick: (detail) => fireNonCancelableEvent(onSortingChange, detail), - isEditable: !!column.editConfig, - stickyState, - cellRef: (node) => setCell(sticky, columnId, node), - tableRole, - resizerRoleDescription, - // Expandable option is only applicable to the first data column of the table. - // When present, the header content receives extra padding to match the first offset in the data cells. - isExpandable: colIndex === 0 && isExpandable - }); - }) - ) - ); -}); -var thead_default = Thead; - -// node_modules/@cloudscape-design/components/table/body-cell/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/body-cell/styles.scoped.css"; -var styles_css_default114 = { - "expandable-toggle-wrapper": "awsui_expandable-toggle-wrapper_c6tup_1ls9v_99", - "body-cell": "awsui_body-cell_c6tup_1ls9v_107", - "body-cell-content": "awsui_body-cell-content_c6tup_1ls9v_121", - "body-cell-wrap": "awsui_body-cell-wrap_c6tup_1ls9v_124", - "is-visual-refresh": "awsui_is-visual-refresh_c6tup_1ls9v_136", - "has-striped-rows": "awsui_has-striped-rows_c6tup_1ls9v_148", - "body-cell-expandable-level-1": "awsui_body-cell-expandable-level-1_c6tup_1ls9v_151", - "body-cell-expandable-level-2": "awsui_body-cell-expandable-level-2_c6tup_1ls9v_154", - "body-cell-expandable-level-3": "awsui_body-cell-expandable-level-3_c6tup_1ls9v_157", - "body-cell-expandable-level-4": "awsui_body-cell-expandable-level-4_c6tup_1ls9v_160", - "body-cell-expandable-level-5": "awsui_body-cell-expandable-level-5_c6tup_1ls9v_163", - "body-cell-expandable-level-6": "awsui_body-cell-expandable-level-6_c6tup_1ls9v_166", - "body-cell-expandable-level-7": "awsui_body-cell-expandable-level-7_c6tup_1ls9v_169", - "body-cell-expandable-level-8": "awsui_body-cell-expandable-level-8_c6tup_1ls9v_172", - "body-cell-expandable-level-9": "awsui_body-cell-expandable-level-9_c6tup_1ls9v_175", - "body-cell-expandable-level-next": "awsui_body-cell-expandable-level-next_c6tup_1ls9v_178", - "body-cell-edit-active": "awsui_body-cell-edit-active_c6tup_1ls9v_181", - "body-cell-interactive": "awsui_body-cell-interactive_c6tup_1ls9v_181", - "body-cell-editable": "awsui_body-cell-editable_c6tup_1ls9v_181", - "has-striped-rows-sticky-cell-pad-left": "awsui_has-striped-rows-sticky-cell-pad-left_c6tup_1ls9v_247", - "has-selection": "awsui_has-selection_c6tup_1ls9v_280", - "body-cell-first-row": "awsui_body-cell-first-row_c6tup_1ls9v_316", - "body-cell-last-row": "awsui_body-cell-last-row_c6tup_1ls9v_319", - "body-cell-selected": "awsui_body-cell-selected_c6tup_1ls9v_319", - "has-footer": "awsui_has-footer_c6tup_1ls9v_319", - "body-cell-shaded": "awsui_body-cell-shaded_c6tup_1ls9v_329", - "sticky-cell": "awsui_sticky-cell_c6tup_1ls9v_355", - "sticky-cell-pad-left": "awsui_sticky-cell-pad-left_c6tup_1ls9v_363", - "sticky-cell-last-right": "awsui_sticky-cell-last-right_c6tup_1ls9v_410", - "sticky-cell-last-left": "awsui_sticky-cell-last-left_c6tup_1ls9v_414", - "body-cell-next-selected": "awsui_body-cell-next-selected_c6tup_1ls9v_437", - "body-cell-prev-selected": "awsui_body-cell-prev-selected_c6tup_1ls9v_441", - "body-cell-editor-wrapper": "awsui_body-cell-editor-wrapper_c6tup_1ls9v_465", - "body-cell-success": "awsui_body-cell-success_c6tup_1ls9v_472", - "body-cell-editor": "awsui_body-cell-editor_c6tup_1ls9v_465", - "body-cell-editor-disabled": "awsui_body-cell-editor-disabled_c6tup_1ls9v_499", - "body-cell-editor-form": "awsui_body-cell-editor-form_c6tup_1ls9v_508", - "body-cell-editor-row": "awsui_body-cell-editor-row_c6tup_1ls9v_518", - "body-cell-editor-controls": "awsui_body-cell-editor-controls_c6tup_1ls9v_528", - "body-cell-expandable": "awsui_body-cell-expandable_c6tup_1ls9v_151", - "expandable-cell-content": "awsui_expandable-cell-content_c6tup_1ls9v_552", - "body-cell-edit-disabled-popover": "awsui_body-cell-edit-disabled-popover_c6tup_1ls9v_600", - "body-cell-has-success": "awsui_body-cell-has-success_c6tup_1ls9v_604" -}; - -// node_modules/@cloudscape-design/components/table/body-cell/index.js -var import_react374 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/body-cell/td-element.js -var import_react370 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/expandable-rows/expand-toggle-button.js -var import_react369 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/expandable-rows/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/expandable-rows/styles.scoped.css"; -var styles_css_default115 = { - "expand-toggle-icon": "awsui_expand-toggle-icon_1ss49_1izvf_99", - "expand-toggle-icon-expanded": "awsui_expand-toggle-icon-expanded_1ss49_1izvf_120", - "expand-toggle": "awsui_expand-toggle_1ss49_1izvf_99" -}; - -// node_modules/@cloudscape-design/components/table/expandable-rows/expand-toggle-button.js -function ExpandToggleButton({ isExpanded, onExpandableItemToggle, expandButtonLabel, collapseButtonLabel }) { - const buttonRef = (0, import_react369.useRef)(null); - const { tabIndex } = useSingleTabStopNavigation(buttonRef); - return import_react369.default.createElement( - "button", - { ref: buttonRef, tabIndex, "aria-label": isExpanded ? collapseButtonLabel : expandButtonLabel, "aria-expanded": isExpanded, className: styles_css_default115["expand-toggle"], onClick: onExpandableItemToggle }, - import_react369.default.createElement(internal_default, { size: "small", name: "caret-down-filled", className: clsx_m_default(styles_css_default115["expand-toggle-icon"], isExpanded && styles_css_default115["expand-toggle-icon-expanded"]) }) - ); -} - -// node_modules/@cloudscape-design/components/table/body-cell/td-element.js -var TableTdElement = import_react370.default.forwardRef(({ className: className2, style, children: children2, wrapLines, isRowHeader, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, nativeAttributes, onClick, onMouseEnter, onMouseLeave, isEvenRow, stripedRows, isVisualRefresh, hasSelection, hasFooter, columnId, colIndex, stickyState, tableRole, level, isExpandable, isExpanded, onExpandableItemToggle, expandButtonLabel, collapseButtonLabel }, ref) => { - const Element2 = isRowHeader ? "th" : "td"; - nativeAttributes = Object.assign(Object.assign({}, nativeAttributes), getTableCellRoleProps({ tableRole, isRowHeader, colIndex })); - const stickyStyles = useStickyCellStyles({ - stickyColumns: stickyState, - columnId, - getClassName: (props2) => getStickyClassNames(styles_css_default114, props2) - }); - const cellRefObject = (0, import_react370.useRef)(null); - const mergedRef = useMergeRefs(stickyStyles.ref, ref, cellRefObject); - const { tabIndex: cellTabIndex } = useSingleTabStopNavigation(cellRefObject); - return import_react370.default.createElement( - Element2, - Object.assign({ style: Object.assign(Object.assign({}, style), stickyStyles.style), className: clsx_m_default(className2, styles_css_default114["body-cell"], wrapLines && styles_css_default114["body-cell-wrap"], isFirstRow && styles_css_default114["body-cell-first-row"], isLastRow && styles_css_default114["body-cell-last-row"], isSelected && styles_css_default114["body-cell-selected"], isNextSelected && styles_css_default114["body-cell-next-selected"], isPrevSelected && styles_css_default114["body-cell-prev-selected"], !isEvenRow && stripedRows && styles_css_default114["body-cell-shaded"], stripedRows && styles_css_default114["has-striped-rows"], isVisualRefresh && styles_css_default114["is-visual-refresh"], hasSelection && styles_css_default114["has-selection"], hasFooter && styles_css_default114["has-footer"], level !== void 0 && styles_css_default114["body-cell-expandable"], level !== void 0 && styles_css_default114[`body-cell-expandable-level-${getLevelClassSuffix(level)}`], stickyStyles.className), onClick, onMouseEnter, onMouseLeave, ref: mergedRef }, nativeAttributes, { tabIndex: cellTabIndex }), - level !== void 0 && isExpandable && import_react370.default.createElement( - "div", - { className: styles_css_default114["expandable-toggle-wrapper"] }, - import_react370.default.createElement(ExpandToggleButton, { isExpanded, onExpandableItemToggle, expandButtonLabel, collapseButtonLabel }) - ), - import_react370.default.createElement("span", { className: styles_css_default114["body-cell-content"] }, children2) - ); -}); -function getLevelClassSuffix(level) { - return 1 <= level && level <= 9 ? level : "next"; -} - -// node_modules/@cloudscape-design/components/table/body-cell/inline-editor.js -var import_react372 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/body-cell/click-away.js -var import_react371 = __toESM(require_react()); -function useClickAway(onClick) { - const awayRef = (0, import_react371.useRef)(null); - const onClickStable = useStableCallback(onClick); - (0, import_react371.useEffect)(() => { - function handleClick(event) { - if (!nodeBelongs(awayRef.current, event.target)) { - onClickStable(); - } - } - document.addEventListener("click", handleClick, { capture: true }); - return () => document.removeEventListener("click", handleClick, { capture: true }); - }, [onClickStable]); - return awayRef; -} - -// node_modules/@cloudscape-design/components/table/body-cell/inline-editor.js -var noop3 = () => void 0; -function InlineEditor({ ariaLabels, item, column, onEditEnd, submitEdit, __onRender }) { - var _a2, _b, _c, _d; - const [currentEditLoading, setCurrentEditLoading] = (0, import_react372.useState)(false); - const [currentEditValue, setCurrentEditValue] = (0, import_react372.useState)(); - const i18n = useInternalI18n("table"); - const focusLockRef = (0, import_react372.useRef)(null); - const cellContext = { - currentValue: currentEditValue, - setValue: setCurrentEditValue - }; - function finishEdit({ cancelled = false, refocusCell = true } = {}) { - if (!cancelled) { - setCurrentEditValue(void 0); - } - onEditEnd({ cancelled, refocusCell }); - } - function onSubmitClick(evt) { - var _a3; - return __awaiter(this, void 0, void 0, function* () { - evt.preventDefault(); - if (currentEditValue === void 0) { - finishEdit(); - return; - } - setCurrentEditLoading(true); - try { - yield submitEdit(item, column, currentEditValue); - setCurrentEditLoading(false); - finishEdit(); - } catch (e) { - setCurrentEditLoading(false); - (_a3 = focusLockRef.current) === null || _a3 === void 0 ? void 0 : _a3.focusFirst(); - } - }); - } - function onCancel({ reFocusEditedCell = true } = {}) { - if (currentEditLoading) { - return; - } - finishEdit({ cancelled: true, refocusCell: reFocusEditedCell }); - } - function handleEscape(event) { - if (event.key === "Escape") { - onCancel(); - } - } - const clickAwayRef = useClickAway(() => onCancel({ reFocusEditedCell: false })); - (0, import_react372.useEffect)(() => { - if (__onRender) { - const timer = setTimeout(__onRender, 1); - return () => clearTimeout(timer); - } - }, [__onRender]); - const { ariaLabel = void 0, validation = noop3, errorIconAriaLabel, constraintText, editingCell } = column.editConfig; - return import_react372.default.createElement( - focus_lock_default, - { restoreFocus: true, ref: focusLockRef }, - import_react372.default.createElement( - "div", - { role: "dialog", ref: clickAwayRef, "aria-label": (_a2 = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.activateEditLabel) === null || _a2 === void 0 ? void 0 : _a2.call(ariaLabels, column, item), onKeyDown: handleEscape }, - import_react372.default.createElement( - "form", - { onSubmit: onSubmitClick, className: styles_css_default114["body-cell-editor-form"] }, - import_react372.default.createElement( - InternalFormField, - { stretch: true, label: ariaLabel, constraintText, __hideLabel: true, __disableGutters: true, i18nStrings: { errorIconAriaLabel }, errorText: validation(item, currentEditValue) }, - import_react372.default.createElement( - "div", - { className: styles_css_default114["body-cell-editor-row"] }, - editingCell(item, cellContext), - import_react372.default.createElement( - "span", - { className: styles_css_default114["body-cell-editor-controls"] }, - import_react372.default.createElement( - InternalSpaceBetween, - { direction: "horizontal", size: "xxs" }, - !currentEditLoading ? import_react372.default.createElement(internal_default2, { ariaLabel: (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.cancelEditLabel) === null || _b === void 0 ? void 0 : _b.call(ariaLabels, column), formAction: "none", iconName: "close", variant: "inline-icon", onClick: () => onCancel() }) : null, - import_react372.default.createElement(internal_default2, { ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.submitEditLabel) === null || _c === void 0 ? void 0 : _c.call(ariaLabels, column), formAction: "submit", iconName: "check", variant: "inline-icon", loading: currentEditLoading }) - ), - import_react372.default.createElement(live_region_default, null, currentEditLoading ? i18n("ariaLabels.submittingEditText", (_d = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.submittingEditText) === null || _d === void 0 ? void 0 : _d.call(ariaLabels, column)) : "") - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/table/body-cell/disabled-inline-editor.js -var import_react373 = __toESM(require_react()); -function DisabledInlineEditor(_a2) { - var _b; - var { className: className2, item, column, ariaLabels, isEditing, onEditStart, onEditEnd, editDisabledReason, isVisualRefresh, interactiveCell = true } = _a2, rest = __rest(_a2, ["className", "item", "column", "ariaLabels", "isEditing", "onEditStart", "onEditEnd", "editDisabledReason", "isVisualRefresh", "interactiveCell"]); - const clickAwayRef = useClickAway(() => { - if (isEditing) { - onEditEnd(true); - } - }); - const [hasHover, setHasHover] = (0, import_react373.useState)(false); - const [hasFocus, setHasFocus] = (0, import_react373.useState)(false); - const showIcon = hasHover || hasFocus || isEditing || !interactiveCell; - const iconRef = (0, import_react373.useRef)(null); - const buttonRef = (0, import_react373.useRef)(null); - const portalRef = (0, import_react373.useRef)(null); - function handleEscape(event) { - if (event.key === "Escape") { - onEditEnd(true); - } - } - const onClick = () => { - var _a3; - onEditStart(); - (_a3 = buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }; - const { targetProps, descriptionEl } = useHiddenDescription(editDisabledReason); - const portalClasses = usePortalModeClasses(portalRef); - const { tabIndex } = useSingleTabStopNavigation(buttonRef); - return import_react373.default.createElement( - TableTdElement, - Object.assign({}, rest, { nativeAttributes: { "data-inline-editing-active": isEditing.toString() }, className: clsx_m_default(className2, styles_css_default114["body-cell-editable"], interactiveCell && styles_css_default114["body-cell-interactive"], isEditing && styles_css_default114["body-cell-edit-disabled-popover"], isVisualRefresh && styles_css_default114["is-visual-refresh"]), onClick: interactiveCell && !isEditing ? onClick : void 0, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false), ref: clickAwayRef }), - column.cell(item), - import_react373.default.createElement( - "div", - { className: styles_css_default114["body-cell-editor-wrapper"] }, - import_react373.default.createElement( - "button", - Object.assign({ ref: buttonRef, tabIndex, className: clsx_m_default(styles_css_default114["body-cell-editor"], styles_css_default114["body-cell-editor-disabled"]), "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.activateEditLabel) === null || _b === void 0 ? void 0 : _b.call(ariaLabels, column, item), "aria-haspopup": "dialog", "aria-disabled": "true", onClick: !interactiveCell && !isEditing ? onClick : void 0, onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), onKeyDown: handleEscape }, targetProps), - showIcon && import_react373.default.createElement(internal_default, { name: "lock-private", variant: "normal", __internalRootRef: iconRef }), - descriptionEl - ) - ), - isEditing && import_react373.default.createElement( - "span", - { ref: portalRef }, - import_react373.default.createElement( - Portal, - null, - import_react373.default.createElement( - "span", - { className: portalClasses }, - import_react373.default.createElement( - PopoverContainer, - { size: "medium", fixedWidth: false, position: "top", trackRef: iconRef, arrow: (position) => import_react373.default.createElement(arrow_default, { position }), renderWithPortal: true, zIndex: 2e3 }, - import_react373.default.createElement( - PopoverBody, - { dismissButton: false, dismissAriaLabel: void 0, header: null, onDismiss: () => { - }, overflowVisible: "both" }, - import_react373.default.createElement("span", { "aria-live": "polite" }, editDisabledReason) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/table/body-cell/index.js -var submitHandlerFallback = () => { - throw new Error("The function `handleSubmit` is required for editable columns"); -}; -function TableCellEditable(_a2) { - var _b, _c, _d; - var { className: className2, item, column, isEditing, onEditStart, onEditEnd, submitEdit, ariaLabels, isVisualRefresh, successfulEdit = false, interactiveCell = true } = _a2, rest = __rest(_a2, ["className", "item", "column", "isEditing", "onEditStart", "onEditEnd", "submitEdit", "ariaLabels", "isVisualRefresh", "successfulEdit", "interactiveCell"]); - const i18n = useInternalI18n("table"); - const editActivateRef = (0, import_react374.useRef)(null); - const tdNativeAttributes = { - "data-inline-editing-active": isEditing.toString() - }; - const isFocusMoveNeededRef = (0, import_react374.useRef)(false); - (0, import_react374.useEffect)(() => { - if (!isEditing && editActivateRef.current && isFocusMoveNeededRef.current) { - isFocusMoveNeededRef.current = false; - editActivateRef.current.focus(); - } - }, [isEditing]); - const [hasHover, setHasHover] = (0, import_react374.useState)(false); - const [hasFocus, setHasFocus] = (0, import_react374.useState)(false); - const showIcon = hasHover || hasFocus || !interactiveCell; - const prevSuccessfulEdit = usePrevious(successfulEdit); - const prevHasFocus = usePrevious(hasFocus); - const [showSuccessIcon, setShowSuccessIcon] = (0, import_react374.useState)(false); - (0, import_react374.useEffect)(() => { - if (successfulEdit && prevSuccessfulEdit && !hasFocus && prevHasFocus) { - setShowSuccessIcon(false); - } - if (successfulEdit && !prevSuccessfulEdit) { - setShowSuccessIcon(true); - } - }, [hasFocus, successfulEdit, prevHasFocus, prevSuccessfulEdit]); - const { tabIndex: editActivateTabIndex } = useSingleTabStopNavigation(editActivateRef); - return import_react374.default.createElement(TableTdElement, Object.assign({}, rest, { nativeAttributes: tdNativeAttributes, className: clsx_m_default(className2, styles_css_default114["body-cell-editable"], interactiveCell && styles_css_default114["body-cell-interactive"], isEditing && styles_css_default114["body-cell-edit-active"], showSuccessIcon && showIcon && styles_css_default114["body-cell-has-success"], isVisualRefresh && styles_css_default114["is-visual-refresh"]), onClick: interactiveCell && !isEditing ? onEditStart : void 0, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false) }), isEditing ? import_react374.default.createElement(InlineEditor, { ariaLabels, column, item, onEditEnd: (options) => { - setShowSuccessIcon(false); - isFocusMoveNeededRef.current = options.refocusCell; - onEditEnd(options.cancelled); - }, submitEdit: submitEdit !== null && submitEdit !== void 0 ? submitEdit : submitHandlerFallback }) : import_react374.default.createElement( - import_react374.default.Fragment, - null, - column.cell(item), - showSuccessIcon && showIcon && import_react374.default.createElement( - import_react374.default.Fragment, - null, - import_react374.default.createElement( - "span", - { className: styles_css_default114["body-cell-success"], "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.successfulEditLabel) === null || _b === void 0 ? void 0 : _b.call(ariaLabels, column), role: "img", onMouseDown: (e) => { - e.preventDefault(); - } }, - import_react374.default.createElement(internal_default, { name: "status-positive", variant: "success" }) - ), - import_react374.default.createElement(live_region_default, null, i18n("ariaLabels.successfulEditLabel", (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.successfulEditLabel) === null || _c === void 0 ? void 0 : _c.call(ariaLabels, column))) - ), - import_react374.default.createElement( - "div", - { className: styles_css_default114["body-cell-editor-wrapper"] }, - import_react374.default.createElement("button", { className: styles_css_default114["body-cell-editor"], "aria-label": (_d = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.activateEditLabel) === null || _d === void 0 ? void 0 : _d.call(ariaLabels, column, item), ref: editActivateRef, onClick: !interactiveCell && !isEditing ? onEditStart : void 0, onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), tabIndex: editActivateTabIndex }, showIcon && import_react374.default.createElement(internal_default, { name: "edit" })) - ) - )); -} -function TableBodyCell(_a2) { - var _b, _c; - var { isEditable } = _a2, rest = __rest(_a2, ["isEditable"]); - const isExpandableColumnCell = rest.level !== void 0; - const editDisabledReason = (_c = (_b = rest.column.editConfig) === null || _b === void 0 ? void 0 : _b.disabledReason) === null || _c === void 0 ? void 0 : _c.call(_b, rest.item); - if (editDisabledReason && !isExpandableColumnCell) { - return import_react374.default.createElement(DisabledInlineEditor, Object.assign({ editDisabledReason }, rest)); - } - if ((isEditable || rest.isEditing) && !isExpandableColumnCell) { - return import_react374.default.createElement(TableCellEditable, Object.assign({}, rest)); - } - const { column, item } = rest; - return import_react374.default.createElement(TableTdElement, Object.assign({}, rest), column.cell(item)); -} - -// node_modules/@cloudscape-design/components/table/use-row-events.js -function useRowEvents({ onRowClick, onRowContextMenu }) { - const onRowClickHandler = (rowIndex, item, event) => { - const tableCell = findUpUntil2(event.target, (element) => element.tagName.toLowerCase() === "td"); - if (!tableCell || !tableCell.classList.contains(styles_css_default72["selection-control"])) { - const details = { rowIndex, item }; - fireNonCancelableEvent(onRowClick, details); - } - }; - const onRowContextMenuHandler = (rowIndex, item, event) => { - const details = { - rowIndex, - item, - clientX: event.clientX, - clientY: event.clientY - }; - fireCancelableEvent(onRowContextMenu, details, event); - }; - return { - onRowClickHandler: onRowClick && onRowClickHandler, - onRowContextMenuHandler: onRowContextMenu && onRowContextMenuHandler - }; -} - -// node_modules/@cloudscape-design/components/internal/hooks/use-scroll-sync/index.js -var import_react375 = __toESM(require_react()); -function useScrollSync(refs, disabled = !supportsStickyPosition()) { - const activeElement = (0, import_react375.useRef)(null); - const onScroll = (event) => { - const targetElement = event.currentTarget; - if (targetElement && (activeElement.current === null || activeElement.current === targetElement)) { - requestAnimationFrame(() => { - activeElement.current = targetElement; - refs.forEach((ref) => { - const element = ref.current; - if (element && element !== targetElement) { - element.scrollLeft = targetElement.scrollLeft; - } - }); - requestAnimationFrame(() => { - activeElement.current = null; - }); - }); - } - }; - return !disabled ? onScroll : void 0; -} - -// node_modules/@cloudscape-design/components/table/sticky-header.js -var import_react377 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/use-sticky-header.js -var import_react376 = __toESM(require_react()); -var useStickyHeader2 = (tableRef, theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef) => { - const isMobile = useMobile(); - const syncColumnHeaderWidths = (0, import_react376.useCallback)(() => { - if (tableRef.current && theadRef.current && secondaryTheadRef.current && secondaryTableRef.current && tableWrapperRef.current) { - secondaryTableRef.current.style.width = `${tableRef.current.offsetWidth}px`; - tableWrapperRef.current.style.marginTop = `-${theadRef.current.offsetHeight}px`; - } - }, [theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef, tableRef]); - (0, import_react376.useLayoutEffect)(() => { - syncColumnHeaderWidths(); - }); - useResizeObserver(theadRef, syncColumnHeaderWidths); - const scrollToTop = () => { - if (!isMobile && theadRef.current && secondaryTheadRef.current && tableWrapperRef.current) { - const scrollDist = calculateScrollingOffset(theadRef.current, secondaryTheadRef.current); - if (scrollDist > 0) { - scrollUpBy(scrollDist, tableWrapperRef.current); - } - } - }; - const { scrollToItem } = stickyScrolling(tableWrapperRef, secondaryTheadRef); - const scrollToRow = (itemNode) => { - if (!isMobile) { - scrollToItem(itemNode); - } - }; - return { scrollToRow, scrollToTop }; -}; - -// node_modules/@cloudscape-design/components/table/sticky-header.js -var sticky_header_default = (0, import_react377.forwardRef)(StickyHeader); -function StickyHeader({ variant, theadProps, wrapperRef, theadRef, secondaryWrapperRef, onScroll, tableRef, tableHasHeader, contentDensity, tableRole }, ref) { - const secondaryTheadRef = (0, import_react377.useRef)(null); - const secondaryTableRef = (0, import_react377.useRef)(null); - const { isStuck } = (0, import_react377.useContext)(StickyHeaderContext); - const [focusedComponent, setFocusedComponent] = (0, import_react377.useState)(null); - const { scrollToRow, scrollToTop } = useStickyHeader2(tableRef, theadRef, secondaryTheadRef, secondaryTableRef, wrapperRef); - (0, import_react377.useImperativeHandle)(ref, () => ({ - scrollToTop, - scrollToRow, - setFocus: setFocusedComponent - })); - return import_react377.default.createElement( - "div", - { - className: clsx_m_default(styles_css_default72["header-secondary"], styles_css_default72[`variant-${variant}`], { - [styles_css_default72.stuck]: isStuck, - [styles_css_default72["table-has-header"]]: tableHasHeader - }), - "aria-hidden": true, - // Prevents receiving focus in Firefox. Focus on the overflowing table is sufficient - // to scroll the table horizontally - tabIndex: -1, - ref: secondaryWrapperRef, - onScroll - }, - import_react377.default.createElement( - "table", - Object.assign({ className: clsx_m_default(styles_css_default72.table, styles_css_default72["table-layout-fixed"], contentDensity === "compact" && getVisualContextClassname("compact-table")), ref: secondaryTableRef }, getTableRoleProps({ tableRole })), - import_react377.default.createElement(thead_default, Object.assign({ ref: secondaryTheadRef, sticky: true, stuck: isStuck, focusedComponent }, theadProps)) - ) - ); -} - -// node_modules/@cloudscape-design/components/table/use-table-focus-navigation.js -var import_react378 = __toESM(require_react()); -function iterateTableCells(table, func) { - table.querySelectorAll("tr").forEach((row, rowIndex) => { - row.querySelectorAll("td").forEach((cell, cellIndex) => { - func(cell, rowIndex, cellIndex); - }); - }); -} -function useTableFocusNavigation({ enableKeyboardNavigation, selectionType, tableRoot, columnDefinitions, numRows }) { - const focusableColumns = (0, import_react378.useMemo)(() => { - const cols = columnDefinitions.map((column) => !!column.editConfig); - if (selectionType) { - cols.unshift(false); - } - return cols; - }, [columnDefinitions, selectionType]); - const maxColumnIndex = focusableColumns.length - 1; - const minColumnIndex = selectionType ? 1 : 0; - const focusCell = (0, import_react378.useCallback)((rowIndex, columnIndex) => { - if (tableRoot === null || tableRoot === void 0 ? void 0 : tableRoot.current) { - iterateTableCells(tableRoot.current, (cell, rIndex, cIndex) => { - var _a2; - if (rIndex === rowIndex && cIndex === columnIndex) { - const editButton = cell.querySelector("button:last-child"); - if (editButton) { - (_a2 = editButton.focus) === null || _a2 === void 0 ? void 0 : _a2.call(editButton); - scrollElementIntoView(editButton); - } - } - }); - } - }, [tableRoot]); - const shiftFocus = (0, import_react378.useCallback)((vertical, horizontal) => { - var _a2; - const focusedCell = (_a2 = tableRoot.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector("td:focus-within"); - if (!focusedCell) { - return; - } - const columnIndex = focusedCell.cellIndex; - const rowIndex = focusedCell.parentElement.rowIndex; - let newRowIndex = rowIndex; - let newColumnIndex = columnIndex; - if (vertical !== 0) { - newRowIndex = Math.min(numRows, Math.max(rowIndex + vertical, 0)); - } - if (horizontal !== 0) { - while (newColumnIndex <= maxColumnIndex && newColumnIndex >= minColumnIndex) { - newColumnIndex += horizontal; - if (focusableColumns[newColumnIndex]) { - break; - } - } - } - if ((rowIndex !== newRowIndex || columnIndex !== newColumnIndex) && tableRoot.current) { - focusCell(newRowIndex, newColumnIndex); - } - }, [focusCell, focusableColumns, maxColumnIndex, minColumnIndex, numRows, tableRoot]); - const handleArrowKeyEvents = (0, import_react378.useCallback)((event) => { - var _a2, _b; - const abort = !!((_a2 = tableRoot.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector('[data-inline-editing-active = "true"]')) || !((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.closest("[data-inline-editing-active]")); - if (abort) { - return; - } - switch (event.key) { - case "ArrowUp": - event.preventDefault(); - shiftFocus(-1, 0); - break; - case "ArrowDown": - event.preventDefault(); - shiftFocus(1, 0); - break; - case "ArrowLeft": - event.preventDefault(); - shiftFocus(0, -1); - break; - case "ArrowRight": - event.preventDefault(); - shiftFocus(0, 1); - break; - default: - return; - } - }, [shiftFocus, tableRoot]); - (0, import_react378.useEffect)(() => { - if (!tableRoot.current || enableKeyboardNavigation) { - return; - } - const tableElement = tableRoot.current; - tableRoot.current.addEventListener("keydown", handleArrowKeyEvents); - return () => tableElement && tableElement.removeEventListener("keydown", handleArrowKeyEvents); - }, [enableKeyboardNavigation, focusableColumns, handleArrowKeyEvents, tableRoot]); -} -var use_table_focus_navigation_default = useTableFocusNavigation; - -// node_modules/@cloudscape-design/components/table/sticky-scrollbar/sticky-scrollbar.js -var import_react380 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/sticky-scrollbar/use-sticky-scrollbar.js -var import_react379 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/table/sticky-scrollbar/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/table/sticky-scrollbar/styles.scoped.css"; -var styles_css_default116 = { - "sticky-scrollbar": "awsui_sticky-scrollbar_faqt8_xxk3x_99", - "sticky-scrollbar-content": "awsui_sticky-scrollbar-content_faqt8_xxk3x_108", - "sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_faqt8_xxk3x_111", - "sticky-scrollbar-native-invisible": "awsui_sticky-scrollbar-native-invisible_faqt8_xxk3x_114", - "sticky-scrollbar-offset": "awsui_sticky-scrollbar-offset_faqt8_xxk3x_117", - "is-visual-refresh": "awsui_is-visual-refresh_faqt8_xxk3x_120" -}; - -// node_modules/@cloudscape-design/components/table/sticky-scrollbar/use-sticky-scrollbar.js -var updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, hasContainingBlock, consideredFooterHeight) => { - if (!tableEl || !scrollbarEl || !wrapperEl) { - return; - } - const { width: tableWidth } = tableEl.getBoundingClientRect(); - const { width: wrapperWidth } = wrapperEl.getBoundingClientRect(); - const scrollbarHeight = browserScrollbarSize().height; - const areaIsScrollable = tableWidth > wrapperWidth; - if (!areaIsScrollable) { - scrollbarEl.classList.remove(styles_css_default116["sticky-scrollbar-visible"]); - } else { - if (!scrollbarEl.classList.contains(styles_css_default116["sticky-scrollbar-visible"])) { - requestAnimationFrame(() => { - scrollbarEl.scrollLeft = wrapperEl.scrollLeft; - }); - } - scrollbarEl.classList.add(styles_css_default116["sticky-scrollbar-visible"]); - if (!scrollbarHeight) { - scrollbarEl.classList.add(styles_css_default116["sticky-scrollbar-native-invisible"]); - } - } - if (scrollbarHeight && scrollbarEl && scrollbarContentEl) { - scrollbarEl.style.height = `${scrollbarHeight}px`; - scrollbarContentEl.style.height = `${scrollbarHeight}px`; - } - if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) { - const wrapperElRect = wrapperEl.getBoundingClientRect(); - const tableElRect = tableEl.getBoundingClientRect(); - scrollbarEl.style.width = `${wrapperElRect.width}px`; - scrollbarContentEl.style.width = `${tableElRect.width}px`; - scrollbarEl.style.bottom = hasContainingBlock ? "0px" : `${consideredFooterHeight}px`; - } -}; -function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, footerHeight, offsetScrollbar) { - const [hasContainingBlock, setHasContainingBlock] = (0, import_react379.useState)(false); - const [hasOverflowParent, setHasOverflowParent] = (0, import_react379.useState)(false); - const consideredFooterHeight = hasContainingBlock || hasOverflowParent ? 0 : footerHeight; - const wrapperEl = wrapperRef.current; - (0, import_react379.useEffect)(() => { - if (wrapperEl && supportsStickyPosition()) { - setHasContainingBlock(!!getContainingBlock(wrapperEl)); - setHasOverflowParent(!!getOverflowParents(wrapperEl)[0]); - } - }, [wrapperEl]); - (0, import_react379.useEffect)(() => { - if (supportsStickyPosition() && wrapperRef.current && tableRef.current) { - const observer = new ResizeObserver(() => { - if (scrollbarContentRef.current) { - updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, hasContainingBlock, consideredFooterHeight); - } - }); - observer.observe(wrapperRef.current); - observer.observe(tableRef.current); - return () => { - observer.disconnect(); - }; - } - }, [ - scrollbarContentRef, - scrollbarRef, - tableRef, - wrapperRef, - consideredFooterHeight, - hasContainingBlock, - offsetScrollbar - ]); - (0, import_react379.useEffect)(() => { - if (supportsStickyPosition()) { - const resizeHandler = () => { - updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, hasContainingBlock, consideredFooterHeight); - }; - resizeHandler(); - window.addEventListener("resize", resizeHandler); - return () => { - window.removeEventListener("resize", resizeHandler); - }; - } - }, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, hasContainingBlock, consideredFooterHeight]); -} - -// node_modules/@cloudscape-design/components/table/sticky-scrollbar/sticky-scrollbar.js -var sticky_scrollbar_default = (0, import_react380.forwardRef)(StickyScrollbar); -function StickyScrollbar({ wrapperRef, tableRef, onScroll, hasStickyColumns }, ref) { - const isVisualRefresh = useVisualRefresh(); - const scrollbarRef = import_react380.default.useRef(null); - const scrollbarContentRef = import_react380.default.useRef(null); - const mergedRef = useMergeRefs(ref, scrollbarRef); - const offsetScrollbar = hasStickyColumns || browserScrollbarSize().height === 0; - const { stickyOffsetBottom } = useAppLayoutContext(); - useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, stickyOffsetBottom, offsetScrollbar); - return import_react380.default.createElement( - "div", - { ref: mergedRef, className: clsx_m_default(styles_css_default116["sticky-scrollbar"], offsetScrollbar && styles_css_default116["sticky-scrollbar-offset"], isVisualRefresh && styles_css_default116["is-visual-refresh"]), onScroll }, - import_react380.default.createElement("div", { ref: scrollbarContentRef, className: styles_css_default116["sticky-scrollbar-content"] }) - ); -} - -// node_modules/@cloudscape-design/components/table/use-cell-editing.js -var import_react381 = __toESM(require_react()); -function useCellEditing({ onCancel, onSubmit }) { - const [currentEditCell, setCurrentEditCell] = (0, import_react381.useState)(null); - const [lastSuccessfulEditCell, setLastSuccessfulEditCell] = (0, import_react381.useState)(null); - const [currentEditLoading, setCurrentEditLoading] = (0, import_react381.useState)(false); - const startEdit = (cellId) => { - setLastSuccessfulEditCell(null); - setCurrentEditCell(cellId); - }; - const cancelEdit = (0, import_react381.useCallback)(() => setCurrentEditCell(null), []); - const completeEdit = (cellId, editCancelled) => { - const eventCancelled = fireCancelableEvent(onCancel, {}); - if (!eventCancelled) { - setCurrentEditCell(null); - if (!editCancelled) { - setLastSuccessfulEditCell(cellId); - } - } - }; - const checkEditing = ({ rowIndex, colIndex }) => rowIndex === (currentEditCell === null || currentEditCell === void 0 ? void 0 : currentEditCell.rowIndex) && colIndex === currentEditCell.colIndex; - const checkLastSuccessfulEdit = ({ rowIndex, colIndex }) => rowIndex === (lastSuccessfulEditCell === null || lastSuccessfulEditCell === void 0 ? void 0 : lastSuccessfulEditCell.rowIndex) && colIndex === lastSuccessfulEditCell.colIndex; - const submitEdit = onSubmit ? (...args) => __awaiter(this, void 0, void 0, function* () { - setCurrentEditLoading(true); - try { - yield onSubmit(...args); - } finally { - setCurrentEditLoading(false); - } - }) : void 0; - return { - isLoading: currentEditLoading, - startEdit, - cancelEdit, - checkEditing, - checkLastSuccessfulEdit, - completeEdit, - submitEdit - }; -} - -// node_modules/@cloudscape-design/components/table/no-data-cell.js -var import_react382 = __toESM(require_react()); -function NoDataCell({ totalColumnsCount, hasFooter, loading, loadingText, empty, tableRef, containerRef }) { - const cellContentRef = (0, import_react382.useRef)(null); - useResizeObserver(containerRef, ({ contentBoxWidth: containerWidth }) => { - if (tableRef.current && cellContentRef.current && supportsStickyPosition()) { - const tablePaddingLeft = parseFloat(getComputedStyle(tableRef.current).paddingLeft) || 0; - const tablePaddingRight = parseFloat(getComputedStyle(tableRef.current).paddingRight) || 0; - const contentWidth = containerWidth + tablePaddingLeft + tablePaddingRight; - cellContentRef.current.style.width = Math.floor(contentWidth) + "px"; - } - }); - return import_react382.default.createElement( - "td", - { colSpan: totalColumnsCount, className: clsx_m_default(styles_css_default72["cell-merged"], hasFooter && styles_css_default72["has-footer"]) }, - import_react382.default.createElement("div", { ref: cellContentRef, className: styles_css_default72["cell-merged-content"], "data-awsui-table-suppress-navigation": true }, loading ? import_react382.default.createElement( - StatusIndicator, - { type: "loading", className: styles_css_default72.loading, wrapText: true }, - import_react382.default.createElement(live_region_default, { visible: true }, loadingText) - ) : import_react382.default.createElement("div", { className: styles_css_default72.empty }, empty)) - ); -} - -// node_modules/@cloudscape-design/components/table/expandable-rows/expandable-rows-utils.js -function useExpandableTableProps({ items, expandableRows, trackBy, ariaLabels }) { - var _a2; - const i18n = useInternalI18n("table"); - const isExpandable = !!expandableRows; - const expandedSet = new ItemSet(trackBy, (_a2 = expandableRows === null || expandableRows === void 0 ? void 0 : expandableRows.expandedItems) !== null && _a2 !== void 0 ? _a2 : []); - let allItems = items; - const itemToPlacement = /* @__PURE__ */ new Map(); - const getItemLevel = (item) => { - var _a3, _b; - return (_b = (_a3 = itemToPlacement.get(item)) === null || _a3 === void 0 ? void 0 : _a3.level) !== null && _b !== void 0 ? _b : 0; - }; - if (isExpandable) { - const visibleItems = new Array(); - const traverse = (item, placement) => { - itemToPlacement.set(item, placement); - visibleItems.push(item); - if (expandedSet.has(item)) { - const children2 = expandableRows.getItemChildren(item); - expandableRows.getItemChildren(item).forEach((child, index) => traverse(child, { level: placement.level + 1, setSize: children2.length, posInSet: index + 1 })); - } - }; - items.forEach((item, index) => traverse(item, { level: 1, setSize: items.length, posInSet: index + 1 })); - for (let index = 0; index < visibleItems.length; index++) { - const item = visibleItems[index]; - if (expandedSet.has(item)) { - let insertionIndex = index + 1; - for (insertionIndex; insertionIndex < visibleItems.length; insertionIndex++) { - const insertionItem = visibleItems[insertionIndex]; - if (getItemLevel(item) >= getItemLevel(insertionItem)) { - break; - } - } - insertionIndex--; - } - } - allItems = visibleItems; - } - const getExpandableItemProps = (item) => { - var _a3, _b, _c, _d; - const { level, setSize, posInSet } = (_a3 = itemToPlacement.get(item)) !== null && _a3 !== void 0 ? _a3 : { level: 1, setSize: 1, posInSet: 1 }; - return { - level, - setSize, - posInSet, - isExpandable: (_b = expandableRows === null || expandableRows === void 0 ? void 0 : expandableRows.isItemExpandable(item)) !== null && _b !== void 0 ? _b : true, - isExpanded: expandedSet.has(item), - onExpandableItemToggle: () => fireNonCancelableEvent(expandableRows === null || expandableRows === void 0 ? void 0 : expandableRows.onExpandableItemToggle, { item, expanded: !expandedSet.has(item) }), - expandButtonLabel: i18n("ariaLabels.expandButtonLabel", (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.expandButtonLabel) === null || _c === void 0 ? void 0 : _c.call(ariaLabels, item)), - collapseButtonLabel: i18n("ariaLabels.collapseButtonLabel", (_d = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.collapseButtonLabel) === null || _d === void 0 ? void 0 : _d.call(ariaLabels, item)) - }; - }; - return { isExpandable, allItems, getExpandableItemProps }; -} - -// node_modules/@cloudscape-design/components/table/internal.js -var GRID_NAVIGATION_PAGE_SIZE = 10; -var SELECTION_COLUMN_WIDTH = 54; -var selectionColumnId = Symbol("selection-column-id"); -var InternalTableAsSubstep = import_react383.default.forwardRef((props2, ref) => { - const { funnelSubStepProps } = useFunnelSubStep(); - const tableProps = Object.assign(Object.assign({}, props2), { __funnelSubStepProps: funnelSubStepProps }); - return import_react383.default.createElement(InternalTable, Object.assign({}, tableProps, { ref })); -}); -var InternalTable = import_react383.default.forwardRef((_a2, ref) => { - var _b, _c, _d, _e, _f; - var { header, footer, empty, filter, pagination, preferences, items, columnDefinitions, trackBy, loading, loadingText, selectionType, selectedItems, isItemDisabled, ariaLabels, onSelectionChange, onSortingChange, sortingColumn, sortingDescending, sortingDisabled, visibleColumns, stickyHeader, stickyHeaderVerticalOffset, onRowClick, onRowContextMenu, wrapLines, stripedRows, contentDensity, submitEdit, onEditCancel, resizableColumns, onColumnWidthsChange, variant, __internalRootRef, totalItemsCount, firstIndex, renderAriaLive, stickyColumns, columnDisplay, enableKeyboardNavigation, expandableRows, __funnelSubStepProps } = _a2, rest = __rest(_a2, ["header", "footer", "empty", "filter", "pagination", "preferences", "items", "columnDefinitions", "trackBy", "loading", "loadingText", "selectionType", "selectedItems", "isItemDisabled", "ariaLabels", "onSelectionChange", "onSortingChange", "sortingColumn", "sortingDescending", "sortingDisabled", "visibleColumns", "stickyHeader", "stickyHeaderVerticalOffset", "onRowClick", "onRowContextMenu", "wrapLines", "stripedRows", "contentDensity", "submitEdit", "onEditCancel", "resizableColumns", "onColumnWidthsChange", "variant", "__internalRootRef", "totalItemsCount", "firstIndex", "renderAriaLive", "stickyColumns", "columnDisplay", "enableKeyboardNavigation", "expandableRows", "__funnelSubStepProps"]); - if (expandableRows && enableKeyboardNavigation === void 0) { - enableKeyboardNavigation = true; - } - const baseProps = getBaseProps(rest); - stickyHeader = stickyHeader && supportsStickyPosition(); - const isMobile = useMobile(); - const { isExpandable, allItems, getExpandableItemProps } = useExpandableTableProps({ - items, - expandableRows, - trackBy, - ariaLabels - }); - const [containerWidth, wrapperMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const wrapperMeasureRefObject = (0, import_react383.useRef)(null); - const wrapperMeasureMergedRef = useMergeRefs(wrapperMeasureRef, wrapperMeasureRefObject); - const [tableWidth, tableMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const tableRefObject = (0, import_react383.useRef)(null); - const secondaryWrapperRef = import_react383.default.useRef(null); - const theadRef = (0, import_react383.useRef)(null); - const stickyHeaderRef = import_react383.default.useRef(null); - const scrollbarRef = import_react383.default.useRef(null); - const _g = useCellEditing({ onCancel: onEditCancel, onSubmit: submitEdit }), { cancelEdit } = _g, cellEditing = __rest(_g, ["cancelEdit"]); - usePerformanceMarks("table", true, tableRefObject, () => { - var _a3, _b2, _c2, _d2; - const headerText = (_c2 = (_b2 = (_a3 = toolsHeaderWrapper.current) === null || _a3 === void 0 ? void 0 : _a3.querySelector(`.${styles_css_default56["heading-text"]}`)) === null || _b2 === void 0 ? void 0 : _b2.innerText) !== null && _c2 !== void 0 ? _c2 : (_d2 = toolsHeaderWrapper.current) === null || _d2 === void 0 ? void 0 : _d2.innerText; - return { - loading: loading !== null && loading !== void 0 ? loading : false, - header: headerText - }; - }, [loading]); - (0, import_react383.useImperativeHandle)(ref, () => { - var _a3; - return { - scrollToTop: ((_a3 = stickyHeaderRef.current) === null || _a3 === void 0 ? void 0 : _a3.scrollToTop) || (() => void 0), - cancelEdit - }; - }, [cancelEdit]); - const wrapperRefObject = (0, import_react383.useRef)(null); - const handleScroll = useScrollSync([wrapperRefObject, scrollbarRef, secondaryWrapperRef]); - const { moveFocusDown, moveFocusUp, moveFocus } = useSelectionFocusMove(selectionType, allItems.length); - const { onRowClickHandler, onRowContextMenuHandler } = useRowEvents({ onRowClick, onRowContextMenu }); - const visibleColumnDefinitions = getVisibleColumnDefinitions({ - columnDefinitions, - columnDisplay, - visibleColumns - }); - const { isItemSelected, getSelectAllProps, getItemSelectionProps, updateShiftToggle } = useSelection({ - items: allItems, - trackBy, - selectedItems, - selectionType, - isItemDisabled, - onSelectionChange, - ariaLabels, - loading - }); - if (isDevelopment2) { - if (resizableColumns) { - checkColumnWidths(columnDefinitions); - } - if (sortingColumn === null || sortingColumn === void 0 ? void 0 : sortingColumn.sortingComparator) { - checkSortingState(columnDefinitions, sortingColumn.sortingComparator); - } - } - const isVisualRefresh = useVisualRefresh(); - const computedVariant = isVisualRefresh ? variant : ["embedded", "full-page"].indexOf(variant) > -1 ? "container" : variant; - const hasHeader = !!(header || filter || pagination || preferences); - const hasSelection = !!selectionType; - const hasFooterPagination = isMobile && variant === "full-page" && !!pagination; - const hasFooter = !!footer || hasFooterPagination; - const headerIdRef = (0, import_react383.useRef)(void 0); - const isLabelledByHeader = !(ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tableLabel) && !!header; - const setHeaderRef = (0, import_react383.useCallback)((id) => { - headerIdRef.current = id; - }, []); - const visibleColumnWidthsWithSelection = []; - const visibleColumnIdsWithSelection = []; - if (hasSelection) { - visibleColumnWidthsWithSelection.push({ id: selectionColumnId, width: SELECTION_COLUMN_WIDTH }); - visibleColumnIdsWithSelection.push(selectionColumnId); - } - for (let columnIndex = 0; columnIndex < visibleColumnDefinitions.length; columnIndex++) { - const columnId = getColumnKey(visibleColumnDefinitions[columnIndex], columnIndex); - visibleColumnWidthsWithSelection.push(Object.assign(Object.assign({}, visibleColumnDefinitions[columnIndex]), { id: columnId })); - visibleColumnIdsWithSelection.push(columnId); - } - const stickyState = useStickyColumns({ - visibleColumns: visibleColumnIdsWithSelection, - stickyColumnsFirst: ((_b = stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.first) !== null && _b !== void 0 ? _b : 0) + ((stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.first) && hasSelection ? 1 : 0), - stickyColumnsLast: (stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.last) || 0 - }); - const hasStickyColumns = !!(((_c = stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.first) !== null && _c !== void 0 ? _c : 0) + ((_d = stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.last) !== null && _d !== void 0 ? _d : 0) > 0); - const hasEditableCells = !!columnDefinitions.find((col) => col.editConfig); - let tableRole = "table"; - if (isExpandable) { - tableRole = "treegrid"; - } else if (enableKeyboardNavigation) { - tableRole = "grid"; - } else if (hasEditableCells) { - tableRole = "grid-default"; - } - const theadProps = { - selectionType, - getSelectAllProps, - columnDefinitions: visibleColumnDefinitions, - variant: computedVariant, - wrapLines, - resizableColumns, - sortingColumn, - sortingDisabled, - sortingDescending, - onSortingChange, - onFocusMove: moveFocus, - onResizeFinish(newWidth) { - const widthsDetail = columnDefinitions.map((column, index) => newWidth.get(getColumnKey(column, index)) || column.width || DEFAULT_COLUMN_WIDTH); - const widthsChanged = widthsDetail.some((width, index) => columnDefinitions[index].width !== width); - if (widthsChanged) { - fireNonCancelableEvent(onColumnWidthsChange, { widths: widthsDetail }); - } - }, - singleSelectionHeaderAriaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel, - resizerRoleDescription: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.resizerRoleDescription, - stripedRows, - stickyState, - selectionColumnId, - tableRole, - isExpandable - }; - const wrapperRef = useMergeRefs(wrapperRefObject, stickyState.refs.wrapper); - const tableRef = useMergeRefs(tableMeasureRef, tableRefObject, stickyState.refs.table); - const wrapperProps = getTableWrapperRoleProps({ - tableRole, - isScrollable: !!(tableWidth && containerWidth && tableWidth > containerWidth), - ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tableLabel - }); - const getMouseDownTarget = useMouseDownTarget(); - const hasDynamicHeight = computedVariant === "full-page"; - const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight }); - use_table_focus_navigation_default({ - enableKeyboardNavigation, - selectionType, - tableRoot: tableRefObject, - columnDefinitions: visibleColumnDefinitions, - numRows: allItems === null || allItems === void 0 ? void 0 : allItems.length - }); - const toolsHeaderWrapper = (0, import_react383.useRef)(null); - const toolsHeaderHeight = (_f = (_e = toolsHeaderWrapper === null || toolsHeaderWrapper === void 0 ? void 0 : toolsHeaderWrapper.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().height) !== null && _f !== void 0 ? _f : 0; - const colIndexOffset = selectionType ? 1 : 0; - const totalColumnsCount = visibleColumnDefinitions.length + colIndexOffset; - return import_react383.default.createElement( - LinkDefaultVariantContext.Provider, - { value: { defaultVariant: "primary" } }, - import_react383.default.createElement( - ColumnWidthsProvider, - { visibleColumns: visibleColumnWidthsWithSelection, resizableColumns, containerRef: wrapperMeasureRefObject }, - import_react383.default.createElement( - InternalContainer, - Object.assign({}, baseProps, { __internalRootRef, className: clsx_m_default(baseProps.className, styles_css_default72.root), __funnelSubStepProps, header: import_react383.default.createElement( - import_react383.default.Fragment, - null, - hasHeader && import_react383.default.createElement( - "div", - { ref: overlapElement, className: clsx_m_default(hasDynamicHeight && [styles_css_default72["dark-header"], getContentHeaderClassName()]) }, - import_react383.default.createElement( - "div", - { ref: toolsHeaderWrapper, className: clsx_m_default(styles_css_default72["header-controls"], styles_css_default72[`variant-${computedVariant}`]) }, - import_react383.default.createElement( - CollectionLabelContext.Provider, - { value: { assignId: setHeaderRef } }, - import_react383.default.createElement(ToolsHeader, { header, filter, pagination, preferences }) - ) - ) - ), - stickyHeader && import_react383.default.createElement(sticky_header_default, { ref: stickyHeaderRef, variant: computedVariant, theadProps, wrapperRef: wrapperRefObject, theadRef, secondaryWrapperRef, tableRef: tableRefObject, onScroll: handleScroll, tableHasHeader: hasHeader, contentDensity, tableRole }) - ), disableHeaderPaddings: true, disableContentPaddings: true, variant: toContainerVariant(computedVariant), __disableFooterPaddings: true, __disableFooterDivider: true, __disableStickyMobile: false, footer: hasFooter ? import_react383.default.createElement( - "div", - { className: clsx_m_default(styles_css_default72["footer-wrapper"], styles_css_default72[`variant-${computedVariant}`]) }, - import_react383.default.createElement( - "div", - { className: clsx_m_default(styles_css_default72.footer, hasFooterPagination && styles_css_default72["footer-with-pagination"]) }, - footer && import_react383.default.createElement("span", null, footer), - hasFooterPagination && import_react383.default.createElement("div", { className: styles_css_default72["footer-pagination"] }, pagination) - ) - ) : null, __stickyHeader: stickyHeader, __mobileStickyOffset: toolsHeaderHeight, __stickyOffset: stickyHeaderVerticalOffset }, focusMarkers.root), - import_react383.default.createElement( - "div", - Object.assign({ ref: wrapperRef, className: clsx_m_default(styles_css_default72.wrapper, styles_css_default72[`variant-${computedVariant}`], { - [styles_css_default72["has-footer"]]: hasFooter, - [styles_css_default72["has-header"]]: hasHeader - }), style: stickyState.style.wrapper, onScroll: handleScroll }, wrapperProps), - import_react383.default.createElement("div", { className: styles_css_default72["wrapper-content-measure"], ref: wrapperMeasureMergedRef }), - !!renderAriaLive && !!firstIndex && import_react383.default.createElement( - live_region_default, - null, - import_react383.default.createElement("span", null, renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })) - ), - import_react383.default.createElement( - GridNavigationProvider, - { keyboardNavigation: !!enableKeyboardNavigation, pageSize: GRID_NAVIGATION_PAGE_SIZE, getTable: () => tableRefObject.current }, - import_react383.default.createElement( - "table", - Object.assign({ ref: tableRef, className: clsx_m_default(styles_css_default72.table, resizableColumns && styles_css_default72["table-layout-fixed"], contentDensity === "compact" && getVisualContextClassname("compact-table")) }, getTableRoleProps({ - tableRole, - totalItemsCount, - totalColumnsCount, - ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tableLabel, - ariaLabelledBy: isLabelledByHeader && headerIdRef.current ? headerIdRef.current : void 0 - })), - import_react383.default.createElement(thead_default, Object.assign({ ref: theadRef, hidden: stickyHeader, onFocusedComponentChange: (focusId) => { - var _a3; - return (_a3 = stickyHeaderRef.current) === null || _a3 === void 0 ? void 0 : _a3.setFocus(focusId); - } }, theadProps)), - import_react383.default.createElement("tbody", null, loading || allItems.length === 0 ? import_react383.default.createElement( - "tr", - null, - import_react383.default.createElement(NoDataCell, { totalColumnsCount, hasFooter, loading, loadingText, empty, tableRef: tableRefObject, containerRef: wrapperMeasureRefObject }) - ) : allItems.map((item, rowIndex) => { - const isFirstRow = rowIndex === 0; - const isLastRow = rowIndex === allItems.length - 1; - const sharedCellProps = { - isFirstRow, - isLastRow, - isVisualRefresh, - isSelected: hasSelection && isItemSelected(item), - isPrevSelected: hasSelection && !isFirstRow && isItemSelected(allItems[rowIndex - 1]), - isNextSelected: hasSelection && !isLastRow && isItemSelected(allItems[rowIndex + 1]), - isEvenRow: rowIndex % 2 === 0, - hasFooter, - stripedRows, - stickyState, - tableRole - }; - const expandableItemProps = getExpandableItemProps(item); - return import_react383.default.createElement( - "tr", - Object.assign({ key: getItemKey(trackBy, item, rowIndex), className: clsx_m_default(styles_css_default72.row, sharedCellProps.isSelected && styles_css_default72["row-selected"]), onFocus: ({ currentTarget }) => { - var _a3; - if (!currentTarget.contains(getMouseDownTarget())) { - (_a3 = stickyHeaderRef.current) === null || _a3 === void 0 ? void 0 : _a3.scrollToRow(currentTarget); - } - } }, focusMarkers.item, { onClick: onRowClickHandler && onRowClickHandler.bind(null, rowIndex, item), onContextMenu: onRowContextMenuHandler && onRowContextMenuHandler.bind(null, rowIndex, item) }, getTableRowRoleProps(Object.assign({ tableRole, firstIndex, rowIndex }, expandableItemProps))), - hasSelection && import_react383.default.createElement( - TableTdElement, - Object.assign({}, sharedCellProps, { className: clsx_m_default(styles_css_default72["selection-control"]), wrapLines: false, hasSelection: true, columnId: selectionColumnId, colIndex: 0 }), - import_react383.default.createElement(SelectionControl, Object.assign({ onFocusDown: moveFocusDown, onFocusUp: moveFocusUp, onShiftToggle: updateShiftToggle }, getItemSelectionProps(item))) - ), - visibleColumnDefinitions.map((column, colIndex) => { - var _a3; - const isEditing = cellEditing.checkEditing({ rowIndex, colIndex }); - const successfulEdit = cellEditing.checkLastSuccessfulEdit({ rowIndex, colIndex }); - const isEditable = !!column.editConfig && !cellEditing.isLoading; - const expandableCellProps = isExpandable && colIndex === 0 ? expandableItemProps : void 0; - return import_react383.default.createElement(TableBodyCell, Object.assign({ key: getColumnKey(column, colIndex) }, sharedCellProps, { style: resizableColumns ? {} : { - width: column.width, - minWidth: column.minWidth, - maxWidth: column.maxWidth - }, ariaLabels, column, item, wrapLines, isEditable, isEditing, isRowHeader: column.isRowHeader, successfulEdit, onEditStart: () => cellEditing.startEdit({ rowIndex, colIndex }), onEditEnd: (editCancelled) => cellEditing.completeEdit({ rowIndex, colIndex }, editCancelled), submitEdit: cellEditing.submitEdit, columnId: (_a3 = column.id) !== null && _a3 !== void 0 ? _a3 : colIndex, colIndex: colIndex + colIndexOffset }, expandableCellProps)); - }) - ); - })) - ) - ), - resizableColumns && import_react383.default.createElement(ResizeTracker, null) - ), - import_react383.default.createElement(sticky_scrollbar_default, { ref: scrollbarRef, wrapperRef: wrapperRefObject, tableRef: tableRefObject, onScroll: handleScroll, hasStickyColumns }) - ) - ) - ); -}); -var internal_default19 = InternalTable; - -// node_modules/@cloudscape-design/components/text-filter/internal.js -var import_react384 = __toESM(require_react()); -var InternalTextFilter = import_react384.default.forwardRef((_a2, ref) => { - var { filteringText, filteringAriaLabel, filteringPlaceholder, filteringClearAriaLabel, controlId, ariaLabelledby, ariaDescribedby, disabled, countText, onChange, onDelayedChange, __internalRootRef } = _a2, rest = __rest(_a2, ["filteringText", "filteringAriaLabel", "filteringPlaceholder", "filteringClearAriaLabel", "controlId", "ariaLabelledby", "ariaDescribedby", "disabled", "countText", "onChange", "onDelayedChange", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const inputRef = (0, import_react384.useRef)(null); - useForwardFocus(ref, inputRef); - const searchResultsId = useUniqueId("text-filter-search-results"); - const showResults = filteringText && countText && !disabled; - return import_react384.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default110.root), ref: __internalRootRef }), - import_react384.default.createElement(internal_default7, { __inheritFormFieldProps: true, ref: inputRef, className: styles_css_default110.input, type: "search", ariaLabel: filteringAriaLabel, placeholder: filteringPlaceholder, value: filteringText, disabled, controlId, ariaLabelledby, ariaDescribedby: joinStrings(showResults ? searchResultsId : void 0, ariaDescribedby), autoComplete: false, clearAriaLabel: filteringClearAriaLabel, onChange: (event) => fireNonCancelableEvent(onChange, { filteringText: event.detail.value }), __onDelayedInput: (event) => fireNonCancelableEvent(onDelayedChange, { filteringText: event.detail.value }) }), - showResults ? import_react384.default.createElement(SearchResults, { id: searchResultsId }, countText) : null - ); -}); -var internal_default20 = InternalTextFilter; - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/empty-state.js -var import_react385 = __toESM(require_react()); -function EmptyState({ title, subtitle, action }) { - return import_react385.default.createElement( - InternalBox, - { textAlign: "center", color: "inherit" }, - import_react385.default.createElement(InternalBox, { variant: "strong", textAlign: "center", color: "inherit" }, title), - import_react385.default.createElement(InternalBox, { variant: "p", padding: { bottom: "s" }, color: "inherit" }, subtitle), - action - ); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/basic-table.js -function getSharedI18Strings(i18n, i18nStrings) { - return { - filteringCounterText: i18n("i18nStrings.filteringCounterText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCounterText, (format3) => (count) => format3({ count })), - labelRefresh: i18n("i18nStrings.labelRefresh", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelRefresh), - labelsPagination: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsPagination, - noMatchTitle: i18n("i18nStrings.filteringNoMatches", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringNoMatches), - noMatchSubtitle: i18n("i18nStrings.filteringCantFindMatch", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCantFindMatch), - clearFilterButtonText: i18n("i18nStrings.clearFilterButtonText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearFilterButtonText), - filteringClearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelClearFilter - }; -} -function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, trackBy, i18nStrings = {}, isVisualRefresh, visibleColumns, isItemDisabled, onSelect }) { - var _a2; - const [loading, setLoading] = (0, import_react386.useState)(false); - const [allItems, setAllItems] = (0, import_react386.useState)([]); - const textFilterRef = (0, import_react386.useRef)(null); - const onSelectLatest = useStableCallback(onSelect); - function loadData() { - setLoading(true); - fetchData().then((items2) => { - setAllItems(items2); - setLoading(false); - }).catch(() => { - setLoading(false); - }); - } - (0, import_react386.useEffect)(() => { - loadData(); - }, []); - useForwardFocus(forwardFocusRef, textFilterRef); - const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(allItems, { - selection: { trackBy }, - filtering: { - empty: i18nStrings.emptyText, - noMatch: import_react386.default.createElement(EmptyState, { title: i18nStrings.noMatchTitle, subtitle: i18nStrings.noMatchSubtitle, action: import_react386.default.createElement(InternalButton, { onClick: () => actions.setFiltering("") }, i18nStrings.clearFilterButtonText) }) - }, - pagination: {}, - sorting: {} - }); - const selectedItem = (_a2 = collectionProps.selectedItems) === null || _a2 === void 0 ? void 0 : _a2[0]; - (0, import_react386.useEffect)(() => { - onSelectLatest(selectedItem); - }, [selectedItem, onSelectLatest]); - return import_react386.default.createElement(internal_default19, Object.assign({ variant: isVisualRefresh ? "borderless" : "container" }, collectionProps, { header: import_react386.default.createElement(InternalHeader, { variant: isVisualRefresh ? "h3" : "h2", headingTagOverride: "h3", actions: import_react386.default.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: loadData }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy, filter: import_react386.default.createElement(internal_default20, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringClearAriaLabel: i18nStrings.filteringClearAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : "" })), pagination: import_react386.default.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading, loadingText: i18nStrings.loadingText, items, visibleColumns, isItemDisabled, columnDefinitions, enableKeyboardNavigation: true })); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/buckets-table.js -function BucketsTable({ forwardFocusRef, i18nStrings, isVisualRefresh, isItemDisabled, selectableItemsTypes, fetchData, visibleColumns, onDrilldown, onSelect }) { - var _a2, _b, _c, _d; - const i18n = useInternalI18n("s3-resource-selector"); - return import_react387.default.createElement(BasicS3Table, { forwardFocusRef, trackBy: "Name", fetchData, visibleColumns, isItemDisabled: isItemDisabled || (() => !includes(selectableItemsTypes, "buckets")), i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionBuckets", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBuckets), loadingText: i18n("i18nStrings.selectionBucketsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsLoading), filteringAriaLabel: (_a2 = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format3) => (itemsType) => format3({ itemsType }))) === null || _a2 === void 0 ? void 0 : _a2((_b = i18n("i18nStrings.selectionBuckets", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBuckets)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionBucketsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionBucketsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsBucketsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsBucketsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format3) => (data, item) => { - var _a3; - return format3({ item__Name: (_a3 = item.Name) !== null && _a3 !== void 0 ? _a3 : "" }); - }) }) }), isVisualRefresh, columnDefinitions: [ - { - id: "Name", - header: i18n("i18nStrings.columnBucketName", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketName), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketName", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketName)), - sortingField: "Name", - cell: (item) => { - const isClickable = includes(selectableItemsTypes, "objects") || includes(selectableItemsTypes, "versions"); - return isClickable ? import_react387.default.createElement(internal_default5, { onFollow: () => item.Name && onDrilldown(item.Name), variant: "link" }, item.Name) : item.Name; - }, - minWidth: "250px" - }, - { - id: "CreationDate", - header: i18n("i18nStrings.columnBucketCreationDate", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketCreationDate), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketCreationDate", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketCreationDate)), - sortingComparator: (a2, b) => compareDates(a2.CreationDate, b.CreationDate), - cell: (item) => formatDefault(item.CreationDate) - }, - { - id: "Region", - header: i18n("i18nStrings.columnBucketRegion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketRegion), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketRegion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketRegion)), - sortingField: "Region", - cell: (item) => formatDefault(item.Region), - minWidth: "150px" - } - ], onSelect: (item) => { - var _a3; - return onSelect((_a3 = item === null || item === void 0 ? void 0 : item.Name) !== null && _a3 !== void 0 ? _a3 : ""); - } }); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/objects-table.js -var import_react388 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/s3-resource-selector/utils.js -function joinObjectPath(segments) { - return segments.reduce((prev, next) => { - if (prev && prev[prev.length - 1] !== "/") { - prev = prev + "/"; - } - return prev + next; - }, ""); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/objects-table.js -function ObjectsTable({ forwardFocusRef, pathSegments, i18nStrings, isVisualRefresh, isItemDisabled, selectableItemsTypes, fetchData, visibleColumns, onDrilldown, onSelect }) { - var _a2, _b, _c, _d; - const i18n = useInternalI18n("s3-resource-selector"); - return import_react388.default.createElement(BasicS3Table, { - // remount fresh component every we change the path to reset the inner state (e.g. selection/filtering) - key: pathSegments.join("/"), - forwardFocusRef, - trackBy: "Key", - fetchData: () => { - const [bucketName, ...rest] = pathSegments; - return fetchData(bucketName, joinObjectPath(rest)); - }, - i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionObjects", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjects), loadingText: i18n("i18nStrings.selectionObjectsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsLoading), filteringAriaLabel: (_a2 = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format3) => (itemsType) => format3({ itemsType }))) === null || _a2 === void 0 ? void 0 : _a2((_b = i18n("i18nStrings.selectionObjects", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjects)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionObjectsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionObjectsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsObjectsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsObjectsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format3) => (data, item) => { - var _a3; - return format3({ item__Key: (_a3 = item.Key) !== null && _a3 !== void 0 ? _a3 : "" }); - }) }) }), - isVisualRefresh, - visibleColumns, - isItemDisabled: isItemDisabled || (() => !includes(selectableItemsTypes, "objects")), - columnDefinitions: [ - { - id: "Key", - header: i18n("i18nStrings.columnObjectKey", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectKey), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectKey", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectKey)), - sortingField: "Key", - cell: (item) => { - const isClickable = item.IsFolder || includes(selectableItemsTypes, "versions"); - return import_react388.default.createElement( - import_react388.default.Fragment, - null, - import_react388.default.createElement(internal_default, { name: item.IsFolder ? "folder" : "file" }), - " ", - isClickable ? import_react388.default.createElement(internal_default5, { onFollow: () => item.Key && onDrilldown(item), variant: "link" }, item.Key) : item.Key - ); - }, - minWidth: "250px" - }, - { - id: "LastModified", - header: i18n("i18nStrings.columnObjectLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectLastModified), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectLastModified)), - sortingComparator: (a2, b) => compareDates(a2.LastModified, b.LastModified), - cell: (item) => formatDefault(item.LastModified) - }, - { - id: "Size", - header: i18n("i18nStrings.columnObjectSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectSize), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectSize)), - sortingField: "Size", - cell: (item) => formatSize(item.Size) - } - ], - onSelect: (item) => { - var _a3; - return onSelect((_a3 = item === null || item === void 0 ? void 0 : item.Key) !== null && _a3 !== void 0 ? _a3 : ""); - } - }); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/versions-table.js -var import_react389 = __toESM(require_react()); -function VersionsTable({ forwardFocusRef, pathSegments, i18nStrings, isVisualRefresh, isItemDisabled, fetchData, visibleColumns, onSelect }) { - var _a2, _b, _c, _d; - const i18n = useInternalI18n("s3-resource-selector"); - return import_react389.default.createElement(BasicS3Table, { forwardFocusRef, trackBy: "VersionId", fetchData: () => { - const [bucketName, ...rest] = pathSegments; - return fetchData(bucketName, joinObjectPath(rest)); - }, i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionVersions", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersions), loadingText: i18n("i18nStrings.selectionVersionsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsLoading), filteringAriaLabel: (_a2 = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format3) => (itemsType) => format3({ itemsType }))) === null || _a2 === void 0 ? void 0 : _a2((_b = i18n("i18nStrings.selectionVersions", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersions)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionVersionsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionVersionsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsVersionsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsVersionsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format3) => (data, item) => { - var _a3; - return format3({ item__VersionId: (_a3 = item.VersionId) !== null && _a3 !== void 0 ? _a3 : "" }); - }) }) }), isVisualRefresh, visibleColumns, isItemDisabled, columnDefinitions: [ - { - id: "ID", - header: i18n("i18nStrings.columnVersionID", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionID), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionID", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionID)), - sortingField: "VersionId", - cell: (item) => item.VersionId, - minWidth: "250px" - }, - { - id: "LastModified", - header: i18n("i18nStrings.columnVersionLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionLastModified), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionLastModified)), - sortingComparator: (a2, b) => compareDates(a2.LastModified, b.LastModified), - cell: (item) => formatDefault(item.LastModified) - }, - { - id: "Size", - header: i18n("i18nStrings.columnVersionSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionSize), - ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionSize)), - sortingField: "Size", - cell: (item) => formatSize(item.Size) - } - ], onSelect: (item) => { - var _a3; - return onSelect((_a3 = item === null || item === void 0 ? void 0 : item.VersionId) !== null && _a3 !== void 0 ? _a3 : ""); - } }); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/styles.scoped.css"; -var styles_css_default117 = { - "modal-actions": "awsui_modal-actions_12hyz_1p88p_5", - "submit-button": "awsui_submit-button_12hyz_1p88p_9" -}; - -// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/index.js -function assertNever(_value) { - return null; -} -var initialBrowseState = { - selectedItem: null, - currentView: "buckets", - breadcrumbs: [] -}; -function s3BrowseReducer(state, action) { - switch (action.type) { - case "browse-buckets": - return initialBrowseState; - case "browse-objects": - return { - selectedItem: null, - currentView: "objects", - breadcrumbs: action.breadcrumbs - }; - case "browse-versions": - return { - selectedItem: null, - currentView: "versions", - breadcrumbs: action.breadcrumbs - }; - case "select-item": - return Object.assign(Object.assign({}, state), { selectedItem: action.item }); - default: - assertNever(action); - } - return state; -} -function createResourceInfo({ currentView, breadcrumbs, selectedItem }) { - const prefix = "s3://"; - if (currentView === "versions") { - return { uri: prefix + joinObjectPath(breadcrumbs), versionId: selectedItem !== null && selectedItem !== void 0 ? selectedItem : void 0 }; - } - return { uri: prefix + joinObjectPath([...breadcrumbs, selectedItem]) }; -} -function S3Modal({ i18nStrings, alert, selectableItemsTypes, fetchBuckets, bucketsVisibleColumns, bucketsIsItemDisabled, fetchObjects, objectsVisibleColumns, objectsIsItemDisabled, fetchVersions, versionsVisibleColumns, versionsIsItemDisabled, getModalRoot, removeModalRoot, onSubmit, onDismiss }) { - var _a2; - const [{ currentView, breadcrumbs, selectedItem }, dispatch] = (0, import_react390.useReducer)(s3BrowseReducer, initialBrowseState); - const forwardFocusRef = (0, import_react390.useRef)(null); - const i18n = useInternalI18n("s3-resource-selector"); - const isVisualRefresh = useVisualRefresh(); - useEffectOnUpdate(() => { - var _a3; - (_a3 = forwardFocusRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }, [breadcrumbs]); - return import_react390.default.createElement( - "div", - null, - import_react390.default.createElement( - InternalModal, - { visible: true, size: "max", getModalRoot, removeModalRoot, closeAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelModalDismiss, onDismiss, header: i18n("i18nStrings.modalTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalTitle), footer: import_react390.default.createElement( - InternalSpaceBetween, - { className: styles_css_default117["modal-actions"], size: "xs", direction: "horizontal" }, - import_react390.default.createElement(InternalButton, { variant: "link", formAction: "none", onClick: onDismiss }, i18n("i18nStrings.modalCancelButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalCancelButton)), - import_react390.default.createElement(InternalButton, { variant: "primary", className: styles_css_default117["submit-button"], disabled: !selectedItem, formAction: "none", onClick: () => onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem })) }, i18n("i18nStrings.modalSubmitButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalSubmitButton)) - ) }, - import_react390.default.createElement( - InternalSpaceBetween, - { size: isVisualRefresh ? "xxs" : "xs" }, - import_react390.default.createElement(InternalBreadcrumbGroup, { ariaLabel: i18n("i18nStrings.labelBreadcrumbs", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelBreadcrumbs), expandAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelExpandBreadcrumbs, onFollow: (event) => { - event.preventDefault(); - event.detail.item.meta.onClick(); - }, items: [ - { - text: (_a2 = i18n("i18nStrings.modalBreadcrumbRootItem", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalBreadcrumbRootItem)) !== null && _a2 !== void 0 ? _a2 : "", - href: "", - meta: { onClick: () => dispatch({ type: "browse-buckets" }) } - }, - ...breadcrumbs.map((segment, index) => ({ - text: segment, - href: "", - meta: { - onClick: () => dispatch({ - type: "browse-objects", - breadcrumbs: breadcrumbs.slice(0, index + 1) - }) - } - })) - ] }), - alert, - currentView === "buckets" ? import_react390.default.createElement(BucketsTable, { forwardFocusRef, fetchData: fetchBuckets, visibleColumns: bucketsVisibleColumns, isItemDisabled: bucketsIsItemDisabled, selectableItemsTypes, i18nStrings, isVisualRefresh, onDrilldown: (path2) => dispatch({ - type: "browse-objects", - breadcrumbs: [path2] - }), onSelect: (item) => dispatch({ type: "select-item", item }) }) : currentView === "objects" ? import_react390.default.createElement(ObjectsTable, { forwardFocusRef, pathSegments: breadcrumbs, fetchData: fetchObjects, visibleColumns: objectsVisibleColumns, isItemDisabled: objectsIsItemDisabled, selectableItemsTypes, i18nStrings, isVisualRefresh, onDrilldown: (item) => { - dispatch({ - type: item.IsFolder ? "browse-objects" : "browse-versions", - breadcrumbs: [...breadcrumbs, item.Key] - }); - }, onSelect: (item) => dispatch({ type: "select-item", item }) }) : currentView === "versions" ? import_react390.default.createElement(VersionsTable, { forwardFocusRef, pathSegments: breadcrumbs, fetchData: fetchVersions, visibleColumns: versionsVisibleColumns, isItemDisabled: versionsIsItemDisabled, i18nStrings, isVisualRefresh, onSelect: (item) => dispatch({ type: "select-item", item }) }) : assertNever(currentView) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/s3-resource-selector/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/s3-resource-selector/styles.scoped.css"; -var styles_css_default118 = { - "root": "awsui_root_1u0yw_rfo7y_5", - "alert": "awsui_alert_1u0yw_rfo7y_9" -}; - -// node_modules/@cloudscape-design/components/s3-resource-selector/index.js -var S3ResourceSelector = import_react391.default.forwardRef((_a2, ref) => { - var { i18nStrings, inputPlaceholder, alert, resource, viewHref, invalid, selectableItemsTypes = [], inputAriaDescribedby, bucketsVisibleColumns = ["Name", "CreationDate"], bucketsIsItemDisabled, fetchBuckets, fetchObjects, objectsVisibleColumns = ["Key", "LastModified", "Size"], objectsIsItemDisabled, fetchVersions, versionsVisibleColumns = ["ID", "LastModified", "Size"], versionsIsItemDisabled, onChange, ariaLabel, getModalRoot, removeModalRoot } = _a2, rest = __rest(_a2, ["i18nStrings", "inputPlaceholder", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange", "ariaLabel", "getModalRoot", "removeModalRoot"]); - checkSafeUrl("S3ResourceSelector", viewHref); - const { __internalRootRef } = useBaseComponent("S3ResourceSelector"); - const [modalOpen, setModalOpen] = (0, import_react391.useState)(false); - const inContextRef = (0, import_react391.useRef)(null); - const modalWasSubmitted = (0, import_react391.useRef)(false); - useForwardFocus(ref, inContextRef); - const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(rest); - (0, import_react391.useEffect)(() => { - var _a3; - if (!modalOpen && modalWasSubmitted.current) { - modalWasSubmitted.current = false; - (_a3 = inContextRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }, [modalOpen]); - const baseProps = getBaseProps(rest); - const modalProps = { - alert, - i18nStrings, - fetchBuckets, - selectableItemsTypes, - bucketsVisibleColumns, - bucketsIsItemDisabled, - fetchObjects, - objectsVisibleColumns, - objectsIsItemDisabled, - fetchVersions, - versionsVisibleColumns, - versionsIsItemDisabled, - getModalRoot, - removeModalRoot, - onSubmit: (resource2) => { - fireNonCancelableEvent(onChange, { resource: resource2 }); - setModalOpen(false); - modalWasSubmitted.current = true; - }, - onDismiss: () => setModalOpen(false) - }; - return import_react391.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default118.root, baseProps.className), ref: __internalRootRef, role: "group", "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-label": ariaLabel }), - import_react391.default.createElement(S3InContext, { ref: inContextRef, selectableItemsTypes, i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, fetchVersions, onBrowse: () => setModalOpen(true), onChange: (resource2, errorText) => fireNonCancelableEvent(onChange, { resource: resource2, errorText }) }), - !modalOpen && alert && import_react391.default.createElement(InternalBox, { className: styles_css_default118.alert, margin: { top: "s" } }, alert), - modalOpen && import_react391.default.createElement(S3Modal, Object.assign({}, modalProps)) - ); -}); -applyDisplayName(S3ResourceSelector, "S3ResourceSelector"); -var s3_resource_selector_default = S3ResourceSelector; - -// node_modules/@cloudscape-design/components/segmented-control/index.js -var import_react392 = __toESM(require_react()); -function SegmentedControl(props2) { - const baseComponentProps = useBaseComponent("SegmentedControl"); - return import_react392.default.createElement(InternalSegmentedControl2, Object.assign({}, props2, baseComponentProps)); -} -applyDisplayName(SegmentedControl, "SegmentedControl"); - -// node_modules/@cloudscape-design/components/select/index.js -var import_react393 = __toESM(require_react()); -var Select = import_react393.default.forwardRef((_a2, ref) => { - var { options = [], filteringType = "none", statusType = "finished", triggerVariant = "label" } = _a2, restProps = __rest(_a2, ["options", "filteringType", "statusType", "triggerVariant"]); - const baseComponentProps = useBaseComponent("Select", { - props: { - autoFocus: restProps.autoFocus, - expandToViewport: restProps.expandToViewport, - filteringType, - triggerVariant, - virtualScroll: restProps.virtualScroll - } - }); - const externalProps = getExternalProps(restProps); - return import_react393.default.createElement(internal_default12, Object.assign({ options, filteringType, statusType, triggerVariant }, externalProps, baseComponentProps, { ref })); -}); -applyDisplayName(Select, "Select"); -var select_default = Select; - -// node_modules/@cloudscape-design/components/side-navigation/index.js -var import_react395 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/side-navigation/internal.js -var import_react394 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/side-navigation/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/side-navigation/styles.scoped.css"; -var styles_css_default119 = { - "root": "awsui_root_l0dv0_s3klw_99", - "header": "awsui_header_l0dv0_s3klw_136", - "header-link": "awsui_header-link_l0dv0_s3klw_149", - "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_s3klw_159", - "header-link-text": "awsui_header-link-text_l0dv0_s3klw_159", - "header-logo": "awsui_header-logo_l0dv0_s3klw_164", - "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_s3klw_170", - "list-container": "awsui_list-container_l0dv0_s3klw_175", - "list": "awsui_list_l0dv0_s3klw_175", - "list-variant-root": "awsui_list-variant-root_l0dv0_s3klw_187", - "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_s3klw_194", - "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_s3klw_198", - "list-item": "awsui_list-item_l0dv0_s3klw_202", - "section": "awsui_section_l0dv0_s3klw_210", - "expandable-link-group": "awsui_expandable-link-group_l0dv0_s3klw_211", - "section--no-ident": "awsui_section--no-ident_l0dv0_s3klw_214", - "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_s3klw_215", - "refresh": "awsui_refresh_l0dv0_s3klw_223", - "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_s3klw_231", - "section-group": "awsui_section-group_l0dv0_s3klw_238", - "section-group-title": "awsui_section-group-title_l0dv0_s3klw_249", - "link": "awsui_link_l0dv0_s3klw_253", - "link-active": "awsui_link-active_l0dv0_s3klw_262", - "info": "awsui_info_l0dv0_s3klw_299", - "external-icon": "awsui_external-icon_l0dv0_s3klw_303", - "divider": "awsui_divider_l0dv0_s3klw_307", - "divider-default": "awsui_divider-default_l0dv0_s3klw_313", - "divider-header": "awsui_divider-header_l0dv0_s3klw_318" -}; - -// node_modules/@cloudscape-design/components/side-navigation/util.js -function hasActiveLink(items, activeHref) { - for (const item of items) { - if ((item.type === "link" || item.type === "link-group" || item.type === "expandable-link-group") && item.href === activeHref) { - return true; - } - if ((item.type === "section" || item.type === "link-group" || item.type === "expandable-link-group") && hasActiveLink(item.items, activeHref)) { - return true; - } - } - return false; -} -function generateExpandableItemsMapping(items, mapping = /* @__PURE__ */ new WeakMap(), expandableParents = []) { - items.forEach((item) => { - const nextLevelParents = expandableParents.slice(); - if (item.type === "section" || item.type === "expandable-link-group") { - mapping.set(item, expandableParents); - nextLevelParents.unshift(item); - } - if (item.type === "section" || item.type === "link-group" || item.type === "expandable-link-group") { - generateExpandableItemsMapping(item.items, mapping, nextLevelParents); - } - }); - return mapping; -} -function checkDuplicateHrefs(items) { - const hrefs = /* @__PURE__ */ new Set(); - const queue = items.slice(); - while (queue.length > 0) { - const item = queue.shift(); - if ("href" in item) { - if (hrefs.has(item.href)) { - warnOnce("SideNavigation", `duplicate href in "${item.text}": ${item.href}`); - } - hrefs.add(item.href); - } - if ("items" in item) { - queue.push(...item.items); - } - } -} - -// node_modules/@cloudscape-design/components/side-navigation/internal.js -function Header3({ definition, activeHref, fireFollow }) { - checkSafeUrl("SideNavigation", definition.href); - const onClick = (0, import_react394.useCallback)((event) => { - if (isPlainLeftClick(event)) { - fireFollow(definition, event); - } - }, [fireFollow, definition]); - return import_react394.default.createElement( - import_react394.default.Fragment, - null, - import_react394.default.createElement( - "h2", - { className: styles_css_default119.header }, - import_react394.default.createElement( - "a", - { href: definition.href, className: clsx_m_default(styles_css_default119["header-link"], { [styles_css_default119["header-link--has-logo"]]: !!definition.logo }), "aria-current": definition.href === activeHref ? "page" : void 0, onClick }, - definition.logo && import_react394.default.createElement("img", Object.assign({ className: clsx_m_default(styles_css_default119["header-logo"], { - [styles_css_default119["header-logo--stretched"]]: !definition.text - }) }, definition.logo)), - import_react394.default.createElement("span", { className: styles_css_default119["header-link-text"] }, definition.text) - ) - ), - import_react394.default.createElement(Divider3, { isPresentational: true, variant: "header" }) - ); -} -function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }) { - const lists = []; - let currentListIndex = 0; - lists[currentListIndex] = { - listVariant: variant, - items: [] - }; - items.forEach((item, index) => { - var _a2, _b, _c, _d, _e; - const itemid = index + 1; - switch (item.type) { - case "divider": { - const dividerIndex = lists.length; - lists[dividerIndex] = { - element: import_react394.default.createElement( - "div", - { "data-itemid": `item-${itemid}` }, - import_react394.default.createElement(Divider3, { variant: "default" }) - ) - }; - currentListIndex = lists.length; - lists[currentListIndex] = { - listVariant: variant, - items: [] - }; - return; - } - case "link": { - (_a2 = lists[currentListIndex].items) === null || _a2 === void 0 ? void 0 : _a2.push({ - element: import_react394.default.createElement( - "li", - { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default119["list-item"] }, - import_react394.default.createElement(Link2, { definition: item, activeHref, fireChange, fireFollow }) - ) - }); - return; - } - case "section": { - (_b = lists[currentListIndex].items) === null || _b === void 0 ? void 0 : _b.push({ - element: import_react394.default.createElement( - "li", - { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default119["list-item"] }, - import_react394.default.createElement(Section, { definition: item, activeHref, variant, fireChange, fireFollow }) - ) - }); - return; - } - case "section-group": { - (_c = lists[currentListIndex].items) === null || _c === void 0 ? void 0 : _c.push({ - element: import_react394.default.createElement( - "li", - { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default119["list-item"] }, - import_react394.default.createElement(SectionGroup, { definition: item, activeHref, fireChange, fireFollow }) - ) - }); - return; - } - case "link-group": { - (_d = lists[currentListIndex].items) === null || _d === void 0 ? void 0 : _d.push({ - element: import_react394.default.createElement( - "li", - { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default119["list-item"] }, - import_react394.default.createElement(LinkGroup, { definition: item, activeHref, fireChange, fireFollow }) - ) - }); - return; - } - case "expandable-link-group": { - (_e = lists[currentListIndex].items) === null || _e === void 0 ? void 0 : _e.push({ - element: import_react394.default.createElement( - "li", - { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default119["list-item"] }, - import_react394.default.createElement(ExpandableLinkGroup, { definition: item, activeHref, fireChange, fireFollow, variant }) - ) - }); - return; - } - } - }); - const lastListIndex = lists.length - 1; - return import_react394.default.createElement(import_react394.default.Fragment, null, lists.map((list, index) => { - if (!list.items || list.items.length === 0) { - return import_react394.default.createElement("div", { key: `hr-${index}`, className: clsx_m_default(styles_css_default119.list, styles_css_default119[`list-variant-${variant}`], { - [styles_css_default119["list-variant-root--last"]]: list.listVariant === "root" && index === lastListIndex - }) }, list.element); - } else { - return import_react394.default.createElement("ul", { key: `list-${index}`, className: clsx_m_default(styles_css_default119.list, styles_css_default119[`list-variant-${list.listVariant}`], { - [styles_css_default119["list-variant-root--last"]]: list.listVariant === "root" && index === lastListIndex - }) }, list.items.map((item) => item.element)); - } - })); -} -function Divider3({ variant = "default", isPresentational = false }) { - return import_react394.default.createElement("hr", { className: clsx_m_default(styles_css_default119.divider, styles_css_default119[`divider-${variant}`]), role: isPresentational ? "presentation" : void 0 }); -} -function Link2({ definition, expanded, activeHref, fireFollow }) { - checkSafeUrl("SideNavigation", definition.href); - const isActive = definition.href === activeHref; - const onClick = (0, import_react394.useCallback)((event) => { - if (isPlainLeftClick(event)) { - fireFollow(definition, event); - } - }, [fireFollow, definition]); - return import_react394.default.createElement( - import_react394.default.Fragment, - null, - import_react394.default.createElement( - "a", - { href: definition.href, className: clsx_m_default(styles_css_default119.link, { [styles_css_default119["link-active"]]: isActive }), target: definition.external ? "_blank" : void 0, rel: definition.external ? "noopener noreferrer" : void 0, "aria-expanded": expanded, "aria-current": definition.href === activeHref ? "page" : void 0, onClick }, - definition.text, - definition.external && import_react394.default.createElement( - "span", - { "aria-label": definition.externalIconAriaLabel, role: definition.externalIconAriaLabel ? "img" : void 0 }, - import_react394.default.createElement(internal_default, { name: "external", className: styles_css_default119["external-icon"] }) - ) - ), - definition.info && import_react394.default.createElement("span", { className: styles_css_default119.info }, definition.info) - ); -} -function Section({ definition, activeHref, fireFollow, fireChange, variant }) { - var _a2; - const [expanded, setExpanded] = (0, import_react394.useState)((_a2 = definition.defaultExpanded) !== null && _a2 !== void 0 ? _a2 : true); - const isVisualRefresh = useVisualRefresh(); - const onExpandedChange = (0, import_react394.useCallback)((e) => { - fireChange(definition, e.detail.expanded); - setExpanded(e.detail.expanded); - }, [definition, fireChange]); - (0, import_react394.useEffect)(() => { - var _a3; - setExpanded((_a3 = definition.defaultExpanded) !== null && _a3 !== void 0 ? _a3 : true); - }, [definition]); - return import_react394.default.createElement( - InternalExpandableSection, - { variant: "footer", expanded, onChange: onExpandedChange, className: clsx_m_default(styles_css_default119.section, variant === "section-group" && styles_css_default119["section--no-ident"], isVisualRefresh && styles_css_default119.refresh), headerText: definition.text }, - import_react394.default.createElement(NavigationItemsList, { variant: "section", items: definition.items, fireFollow, fireChange, activeHref }) - ); -} -function SectionGroup({ definition, activeHref, fireFollow, fireChange }) { - return import_react394.default.createElement( - "div", - { className: styles_css_default119["section-group"] }, - import_react394.default.createElement(InternalBox, { className: styles_css_default119["section-group-title"], variant: "h3" }, definition.title), - import_react394.default.createElement(NavigationItemsList, { variant: "section-group", items: definition.items, fireFollow, fireChange, activeHref }) - ); -} -function LinkGroup({ definition, activeHref, fireFollow, fireChange }) { - checkSafeUrl("SideNavigation", definition.href); - return import_react394.default.createElement( - import_react394.default.Fragment, - null, - import_react394.default.createElement(Link2, { definition: { type: "link", href: definition.href, text: definition.text, info: definition.info }, fireFollow: (_, event) => fireFollow(definition, event), fireChange, activeHref }), - import_react394.default.createElement(NavigationItemsList, { variant: "link-group", items: definition.items, fireFollow, fireChange, activeHref }) - ); -} -function ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }) { - const containsActiveLink = (0, import_react394.useMemo)(() => { - return activeHref ? hasActiveLink(definition.items, activeHref) : false; - }, [activeHref, definition.items]); - const [expanded, setExpanded] = (0, import_react394.useState)(() => { - var _a2; - return (_a2 = definition.defaultExpanded) !== null && _a2 !== void 0 ? _a2 : definition.href === activeHref || containsActiveLink; - }); - const [userExpanded, setUserExpanded] = (0, import_react394.useState)(); - (0, import_react394.useEffect)(() => setUserExpanded(void 0), [definition]); - (0, import_react394.useEffect)(() => { - setExpanded(definition.href === activeHref || containsActiveLink); - }, [definition.href, containsActiveLink, activeHref]); - (0, import_react394.useEffect)(() => { - if (definition.defaultExpanded !== void 0) { - setExpanded(definition.defaultExpanded); - } - }, [definition]); - const onExpandedChange = (0, import_react394.useCallback)((e) => { - fireChange(definition, e.detail.expanded); - setUserExpanded(e.detail.expanded); - }, [definition, fireChange]); - const onHeaderFollow = (_, event) => { - fireFollow(definition, event); - setUserExpanded(true); - if (!expanded) { - fireChange(definition, true); - } - }; - return import_react394.default.createElement( - InternalExpandableSection, - { className: clsx_m_default(styles_css_default119["expandable-link-group"], variant === "section-group" && styles_css_default119["expandable-link-group--no-ident"]), variant: "navigation", expanded: userExpanded !== null && userExpanded !== void 0 ? userExpanded : expanded, onChange: onExpandedChange, headerText: import_react394.default.createElement(Link2, { definition: { type: "link", href: definition.href, text: definition.text }, expanded: userExpanded !== null && userExpanded !== void 0 ? userExpanded : expanded, fireFollow: onHeaderFollow, fireChange, activeHref }) }, - import_react394.default.createElement(NavigationItemsList, { variant: "expandable-link-group", items: definition.items, fireFollow, fireChange, activeHref }) - ); -} - -// node_modules/@cloudscape-design/components/side-navigation/index.js -function SideNavigation(_a2) { - var { header, activeHref, items = [], onFollow, onChange } = _a2, props2 = __rest(_a2, ["header", "activeHref", "items", "onFollow", "onChange"]); - const { __internalRootRef } = useBaseComponent("SideNavigation"); - const baseProps = getBaseProps(props2); - const parentMap = (0, import_react395.useMemo)(() => generateExpandableItemsMapping(items), [items]); - if (isDevelopment2) { - (0, import_react395.useEffect)(() => checkDuplicateHrefs(items), [items]); - } - const onChangeHandler = (0, import_react395.useCallback)((item, expanded) => { - fireNonCancelableEvent(onChange, { item, expanded, expandableParents: parentMap.get(item) }); - }, [onChange, parentMap]); - const onFollowHandler = (0, import_react395.useCallback)((item, sourceEvent) => { - fireCancelableEvent(onFollow, item, sourceEvent); - }, [onFollow]); - return import_react395.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default119.root, baseProps.className), ref: __internalRootRef }), - header && import_react395.default.createElement(Header3, { definition: header, activeHref, fireChange: onChangeHandler, fireFollow: onFollowHandler }), - items && import_react395.default.createElement( - "div", - { className: styles_css_default119["list-container"] }, - import_react395.default.createElement(NavigationItemsList, { variant: "root", items, fireFollow: onFollowHandler, fireChange: onChangeHandler, activeHref }) - ) - ); -} -applyDisplayName(SideNavigation, "SideNavigation"); - -// node_modules/@cloudscape-design/components/space-between/index.js -var import_react396 = __toESM(require_react()); -function SpaceBetween(_a2) { - var { direction = "vertical" } = _a2, props2 = __rest(_a2, ["direction"]); - const baseComponentProps = useBaseComponent("SpaceBetween", { - props: { alignItems: props2.alignItems, direction, size: props2.size } - }); - return import_react396.default.createElement(InternalSpaceBetween, Object.assign({ direction }, props2, baseComponentProps)); -} -applyDisplayName(SpaceBetween, "SpaceBetween"); - -// node_modules/@cloudscape-design/components/spinner/index.js -var import_react397 = __toESM(require_react()); -function Spinner(_a2) { - var { size: size2 = "normal", variant = "normal" } = _a2, props2 = __rest(_a2, ["size", "variant"]); - const baseComponentProps = useBaseComponent("Spinner", { - props: { size: size2, variant } - }); - return import_react397.default.createElement(InternalSpinner, Object.assign({ size: size2, variant }, props2, baseComponentProps)); -} -applyDisplayName(Spinner, "Spinner"); - -// node_modules/@cloudscape-design/components/split-panel/index.js -var import_react409 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/split-panel/widget.js -var import_react408 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/split-panel/implementation.js -var import_react407 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/split-panel/preferences-modal.js -var import_react404 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tiles/internal.js -var import_react399 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tiles/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tiles/styles.scoped.css"; -var styles_css_default120 = { - "column-layout": "awsui_column-layout_vj6p7_147sx_99", - "grid": "awsui_grid_vj6p7_147sx_134", - "grid-no-gutters": "awsui_grid-no-gutters_vj6p7_147sx_140", - "grid-variant-text-grid": "awsui_grid-variant-text-grid_vj6p7_147sx_144", - "grid-breakpoint-default": "awsui_grid-breakpoint-default_vj6p7_147sx_152", - "grid-columns-1": "awsui_grid-columns-1_vj6p7_147sx_155", - "grid-breakpoint-xxs": "awsui_grid-breakpoint-xxs_vj6p7_147sx_155", - "grid-breakpoint-xs": "awsui_grid-breakpoint-xs_vj6p7_147sx_158", - "grid-columns-2": "awsui_grid-columns-2_vj6p7_147sx_161", - "grid-columns-3": "awsui_grid-columns-3_vj6p7_147sx_167", - "grid-columns-4": "awsui_grid-columns-4_vj6p7_147sx_173", - "grid-vertical-borders": "awsui_grid-vertical-borders_vj6p7_147sx_189", - "grid-horizontal-borders": "awsui_grid-horizontal-borders_vj6p7_147sx_222", - "root": "awsui_root_vj6p7_147sx_276", - "tile-container": "awsui_tile-container_vj6p7_147sx_314", - "refresh": "awsui_refresh_vj6p7_147sx_329", - "has-metadata": "awsui_has-metadata_vj6p7_147sx_333", - "selected": "awsui_selected_vj6p7_147sx_339", - "disabled": "awsui_disabled_vj6p7_147sx_344", - "columns": "awsui_columns_vj6p7_147sx_360", - "column-1": "awsui_column-1_vj6p7_147sx_366", - "breakpoint-xs": "awsui_breakpoint-xs_vj6p7_147sx_374", - "breakpoint-xxs": "awsui_breakpoint-xxs_vj6p7_147sx_379", - "column-2": "awsui_column-2_vj6p7_147sx_384", - "column-3": "awsui_column-3_vj6p7_147sx_402", - "column-4": "awsui_column-4_vj6p7_147sx_420", - "control": "awsui_control_vj6p7_147sx_439", - "no-image": "awsui_no-image_vj6p7_147sx_443", - "image": "awsui_image_vj6p7_147sx_447" -}; - -// node_modules/@cloudscape-design/components/tiles/tile.js -var import_react398 = __toESM(require_react()); -var Tile = import_react398.default.forwardRef(({ item, selected, name, breakpoint, onChange }, forwardedRef) => { - const internalRef = (0, import_react398.useRef)(null); - const isVisualRefresh = useVisualRefresh(); - const mergedRef = useMergeRefs(internalRef, forwardedRef); - return import_react398.default.createElement( - "div", - { className: clsx_m_default(styles_css_default120["tile-container"], { [styles_css_default120["has-metadata"]]: item.description || item.image }, { [styles_css_default120.selected]: selected }, { [styles_css_default120.disabled]: !!item.disabled }, { [styles_css_default120.refresh]: isVisualRefresh }, styles_css_default120[`breakpoint-${breakpoint}`]), "data-value": item.value, onClick: () => { - var _a2; - if (item.disabled) { - return; - } - (_a2 = internalRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - if (!selected) { - fireNonCancelableEvent(onChange, { value: item.value }); - } - } }, - import_react398.default.createElement( - "div", - { className: clsx_m_default(styles_css_default120.control, { [styles_css_default120["no-image"]]: !item.image }) }, - import_react398.default.createElement(radio_button_default, { checked: selected, ref: mergedRef, name, value: item.value, label: item.label, description: item.description, disabled: item.disabled, controlId: item.controlId }) - ), - item.image && import_react398.default.createElement("div", { className: clsx_m_default(styles_css_default120.image, { [styles_css_default120.disabled]: !!item.disabled }) }, item.image) - ); -}); - -// node_modules/@cloudscape-design/components/tiles/internal.js -var COLUMN_TRIGGERS2 = ["default", "xxs", "xs"]; -var InternalTiles = import_react399.default.forwardRef((_a2, ref) => { - var { name, value, items, ariaLabel, ariaRequired, ariaControls, columns, onChange, __internalRootRef = null } = _a2, rest = __rest(_a2, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "columns", "onChange", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest); - const generatedName = useUniqueId("awsui-tiles-"); - const [tileRef, tileRefIndex] = useRadioGroupForwardFocus(ref, items, value); - const [breakpoint, breakpointRef] = useContainerBreakpoints(COLUMN_TRIGGERS2); - const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); - const columnCount = getColumnCount(items, columns); - return import_react399.default.createElement( - "div", - Object.assign({ role: "radiogroup", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default120.root), ref: mergedRef }), - import_react399.default.createElement("div", { className: clsx_m_default(styles_css_default120.columns, styles_css_default120[`column-${columnCount}`]) }, items && items.map((item, index) => import_react399.default.createElement(Tile, { ref: index === tileRefIndex ? tileRef : void 0, key: item.value, item, selected: item.value === value, name: name || generatedName, breakpoint, onChange }))) - ); -}); -function getColumnCount(items, columns) { - if (columns) { - return columns; - } - const nItems = items ? items.length : 0; - const columnsLookup = { - 0: 1, - 1: 1, - 2: 2, - 4: 2, - 8: 2 - }; - return columnsLookup[nItems] || 3; -} -var internal_default21 = InternalTiles; - -// node_modules/@cloudscape-design/components/split-panel/icons/side-position.js -var import_react400 = __toESM(require_react()); -var sidePositionIcon = import_react400.default.createElement( - "svg", - { focusable: false, viewBox: "0 0 239 134", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, - import_react400.default.createElement( - "g", - { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, - import_react400.default.createElement( - "g", - null, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--layout-border"], strokeWidth: "2", x: "1", y: "1", width: "223", height: "125", rx: "2" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--layout-background"], x: "11.25", y: "0", width: "203.4375", height: "125" }), - import_react400.default.createElement("path", { className: styles_css_default27["preference-icon--layout-header"], d: "M2,0 L223,0 C224.104569,-2.02906125e-16 225,0.8954305 225,2 L225,10 L225,10 L0,10 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(20.000000, 22.000000)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "182", height: "110", rx: "2" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--primary-button"], x: "152", y: "6", width: "26", height: "10" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "122", y: "6", width: "26", height: "10" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "92", y: "6", width: "26", height: "10" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "122", y: "29", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "92", y: "29", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "19 29 49 29 49 32 19 32" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "10 10 40 10 40 13 10 13" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "10 29 13 29 13 32 10 32" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "3", y1: "22.7619048", x2: "181", y2: "22.7619048", strokeWidth: "2", strokeLinecap: "square" }), - import_react400.default.createElement( - "g", - { transform: "translate(3.000000, 37.285714)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(3.000000, 51.714286)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(3.000000, 80.571429)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(3.000000, 66.142857)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(3.000000, 95.000000)" }, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react400.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ) - ), - import_react400.default.createElement( - "g", - { transform: "translate(182.000000, 28.000000)" }, - import_react400.default.createElement( - "g", - null, - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "55", height: "97", rx: "2" }), - import_react400.default.createElement("rect", { className: styles_css_default27["preference-icon--secondary"], x: "39.5474354", y: "5.86666667", width: "14", height: "6.41666667" }), - import_react400.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "3.62672811 7.88333333 24.6267281 7.88333333 24.6267281 10.6333333 3.62672811 10.6333333" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(4.000000, 22.000000)", className: styles_css_default27["preference-icon--secondary"] }, - import_react400.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), - import_react400.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(4.000000, 32.000000)", className: styles_css_default27["preference-icon--secondary"] }, - import_react400.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), - import_react400.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(4.000000, 43.000000)", className: styles_css_default27["preference-icon--secondary"] }, - import_react400.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), - import_react400.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) - ), - import_react400.default.createElement( - "g", - { transform: "translate(4.000000, 51.000000)", className: styles_css_default27["preference-icon--secondary"] }, - import_react400.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), - import_react400.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) - ) - ) - ) -); -var side_position_default = sidePositionIcon; - -// node_modules/@cloudscape-design/components/split-panel/icons/bottom-icon.js -var import_react401 = __toESM(require_react()); -var bottomPositionIcon = import_react401.default.createElement( - "svg", - { focusable: false, viewBox: "0 0 240 134", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, - import_react401.default.createElement( - "g", - { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, - import_react401.default.createElement( - "g", - null, - import_react401.default.createElement( - "g", - null, - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--layout-border"], strokeWidth: "2", x: "1", y: "1", width: "238", height: "125", rx: "2" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--layout-background"], x: "12", y: "0", width: "217", height: "126" }), - import_react401.default.createElement("path", { className: styles_css_default27["preference-icon--layout-header"], d: "M2,0 L238,0 C239.104569,-1.58997828e-14 240,0.8954305 240,2 L240,10 L240,10 L0,10 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" }) - ), - import_react401.default.createElement( - "g", - { transform: "translate(28.000000, 22.000000)" }, - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "182", height: "110", rx: "2" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--primary-button"], x: "152", y: "6", width: "26", height: "10" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "122", y: "6", width: "26", height: "10" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "92", y: "6", width: "26", height: "10" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "122", y: "29", width: "55", height: "3" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "92", y: "29", width: "26", height: "3" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "19 29 49 29 49 32 19 32" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "10 10 40 10 40 13 10 13" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "10 29 13 29 13 32 10 32" }), - import_react401.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "3", y1: "22.7619048", x2: "181", y2: "22.7619048", strokeWidth: "2", strokeLinecap: "square" }), - import_react401.default.createElement( - "g", - { transform: "translate(3.000000, 37.285714)" }, - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), - import_react401.default.createElement("line", { className: styles_css_default27["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) - ) - ), - import_react401.default.createElement( - "g", - { transform: "translate(12.000000, 74.000000)" }, - import_react401.default.createElement( - "g", - null, - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "215", height: "58", rx: "2" }), - import_react401.default.createElement("rect", { className: styles_css_default27["preference-icon--secondary"], x: "177", y: "8", width: "30.6630435", height: "10" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "10 12 45.3804348 12 45.3804348 15 10 15" }) - ), - import_react401.default.createElement( - "g", - { className: styles_css_default27["preference-icon--secondary"], transform: "translate(9.000000, 40.000000)" }, - import_react401.default.createElement("polygon", { points: "-3.55271368e-15 0 39 0 39 3 -3.55271368e-15 3" }), - import_react401.default.createElement("polygon", { points: "53 0 92 0 92 3 53 3" }), - import_react401.default.createElement("polygon", { points: "107 0 146 0 146 3 107 3" }), - import_react401.default.createElement("polygon", { points: "160 0 199 0 199 3 160 3" }), - import_react401.default.createElement("polygon", { points: "-3.55271368e-15 9 39 9 39 12 -3.55271368e-15 12" }), - import_react401.default.createElement("polygon", { points: "53 9 92 9 92 12 53 12" }), - import_react401.default.createElement("polygon", { points: "107 9 146 9 146 12 107 12" }), - import_react401.default.createElement("polygon", { points: "160 9 199 9 199 12 160 12" }) - ), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--focus-text"], points: "10 23 32 23 32 26 10 26" }), - import_react401.default.createElement("polygon", { className: styles_css_default27["preference-icon--secondary"], points: "40 23 62 23 62 26 40 26" }) - ) - ) - ) -); -var bottom_icon_default = bottomPositionIcon; - -// node_modules/@cloudscape-design/components/split-panel/icons/side-position-refresh.js -var import_react402 = __toESM(require_react()); -var getClassName3 = (suffix) => styles_css_default27[`preference-icon-refresh--${suffix}`]; -var TableRow = ({ offset, separator = true, isHeader }) => { - const offsetTop = 0.4482; - const offsetBottom = 3.4482; - return import_react402.default.createElement( - "g", - { transform: `translate(0, ${offset})`, className: getClassName3(isHeader ? "column-header" : "disabled") }, - import_react402.default.createElement("path", { d: `M19 ${offsetTop}2H22V${offsetBottom}H19V${offsetTop}Z` }), - import_react402.default.createElement("path", { d: `M27 ${offsetTop}H51V${offsetBottom}H27V${offsetTop}Z`, className: !isHeader ? getClassName3("secondary") : void 0 }), - import_react402.default.createElement("path", { d: `M90 ${offsetTop}H110V${offsetBottom}H90V${offsetTop}Z` }), - import_react402.default.createElement("path", { d: `M113 ${offsetTop}H157V${offsetBottom}H113V${offsetTop}Z` }), - separator && import_react402.default.createElement("path", { d: "M14 8H159.387", className: getClassName3("separator"), strokeLinecap: "square" }) - ); -}; -var SidePanelRow = ({ offset }) => { - return import_react402.default.createElement( - "g", - { transform: `translate(0, ${offset})`, className: getClassName3("secondary") }, - import_react402.default.createElement("path", { d: "M177 0H190V3H177V0Z" }), - import_react402.default.createElement("path", { d: "M195 0H208V3H195V0Z" }) - ); -}; -var bottomPositionIcon2 = import_react402.default.createElement( - "svg", - { focusable: false, viewBox: "0 0 230 128", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, - import_react402.default.createElement("path", { d: "M2 1H214C214.552 1 215 1.44772 215 2V126C215 126.552 214.552 127 214 127H2.00001C1.44772 127 1 126.552 1 126V2C1 1.44772 1.44772 1 2 1Z", className: getClassName3("window"), strokeWidth: "2" }), - import_react402.default.createElement( - "g", - { className: "awsui-context-top-navigation" }, - import_react402.default.createElement("rect", { x: "2", y: "2", width: "212", height: "6", className: getClassName3("layout-top") }) - ), - import_react402.default.createElement( - "g", - { className: getContentHeaderClassName() }, - import_react402.default.createElement("path", { d: "M2 8H214V23H2V8Z", className: getClassName3("layout-main") }), - import_react402.default.createElement( - "g", - { className: getClassName3("default") }, - import_react402.default.createElement("path", { d: "M9 15.5C9 16.8807 7.88071 18 6.5 18C5.11929 18 4 16.8807 4 15.5C4 14.1193 5.11929 13 6.5 13C7.88071 13 9 14.1193 9 15.5Z", className: getClassName3("disabled") }), - import_react402.default.createElement("path", { d: "M16 14H46.1484V17H16V14Z" }), - import_react402.default.createElement("path", { d: "M92 15.5C92 13.567 93.567 12 95.5 12H108.86C110.793 12 112.36 13.567 112.36 15.5C112.36 17.433 110.793 19 108.86 19H95.5C93.567 19 92 17.433 92 15.5Z" }), - import_react402.default.createElement("path", { d: "M116 15.5C116 13.567 117.567 12 119.5 12H132.86C134.793 12 136.36 13.567 136.36 15.5C136.36 17.433 134.793 19 132.86 19H119.5C117.567 19 116 17.433 116 15.5Z" }), - import_react402.default.createElement("path", { d: "M139 15.5C139 13.567 140.567 12 142.5 12H155.86C157.793 12 159.36 13.567 159.36 15.5C159.36 17.433 157.793 19 155.86 19H142.5C140.567 19 139 17.433 139 15.5Z", className: getClassName3("primary") }) - ) - ), - import_react402.default.createElement(TableRow, { offset: 27, isHeader: true }), - import_react402.default.createElement(TableRow, { offset: 39 }), - import_react402.default.createElement(TableRow, { offset: 51 }), - import_react402.default.createElement(TableRow, { offset: 63 }), - import_react402.default.createElement(TableRow, { offset: 75 }), - import_react402.default.createElement(TableRow, { offset: 87 }), - import_react402.default.createElement(TableRow, { offset: 99 }), - import_react402.default.createElement(TableRow, { offset: 111, separator: false }), - import_react402.default.createElement("rect", { x: "166", y: "13", width: "62", height: "108", rx: "5", className: getClassName3("window"), strokeWidth: "2" }), - import_react402.default.createElement("rect", { x: "169", y: "62", width: "3", height: "8", rx: "1.5", className: getClassName3("input-default") }), - import_react402.default.createElement("path", { d: "M216 14V120", className: getClassName3("separator") }), - import_react402.default.createElement( - "g", - { className: getClassName3("disabled") }, - import_react402.default.createElement("path", { d: "M224 19.5C224 20.8807 222.881 22 221.5 22C220.119 22 219 20.8807 219 19.5C219 18.1193 220.119 17 221.5 17C222.881 17 224 18.1193 224 19.5Z" }), - import_react402.default.createElement("path", { d: "M224 27.5C224 28.8807 222.881 30 221.5 30C220.119 30 219 28.8807 219 27.5C219 26.1193 220.119 25 221.5 25C222.881 25 224 26.1193 224 27.5Z" }) - ), - import_react402.default.createElement("path", { d: "M177 23H191V28H177V23Z", className: getClassName3("heading") }), - import_react402.default.createElement( - "g", - { className: getClassName3("secondary") }, - import_react402.default.createElement("path", { d: "M207 23H212V28H207V23Z" }), - import_react402.default.createElement("path", { d: "M199 23H204V28H199V23Z" }) - ), - import_react402.default.createElement(SidePanelRow, { offset: 36 }), - import_react402.default.createElement(SidePanelRow, { offset: 48 }), - import_react402.default.createElement(SidePanelRow, { offset: 60 }), - import_react402.default.createElement(SidePanelRow, { offset: 72 }) -); -var side_position_refresh_default = bottomPositionIcon2; - -// node_modules/@cloudscape-design/components/split-panel/icons/bottom-icon-refresh.js -var import_react403 = __toESM(require_react()); -var TableRow2 = ({ offset, isHeader }) => { - const offsetTop = 0.4482; - const offsetBottom = 3.4482; - return import_react403.default.createElement( - "g", - { transform: `translate(0, ${offset})`, className: getClassName3(isHeader ? "column-header" : "disabled") }, - import_react403.default.createElement("path", { d: `M31 ${offsetTop}H34V${offsetBottom}H31V${offsetTop}Z` }), - import_react403.default.createElement("path", { d: `M39 ${offsetTop}H63V${offsetBottom}H39V${offsetTop}Z`, className: !isHeader ? getClassName3("secondary") : void 0 }), - import_react403.default.createElement("path", { d: `M135 ${offsetTop}H155V${offsetBottom}H135V${offsetTop}Z` }), - import_react403.default.createElement("path", { d: `M158 ${offsetTop}H202V${offsetBottom}H158V${offsetTop}Z` }), - import_react403.default.createElement("path", { d: "M26 8H204.388", className: getClassName3("separator"), strokeLinecap: "square" }) - ); -}; -var SidePanelRow2 = ({ offset }) => { - return import_react403.default.createElement( - "g", - { transform: `translate(0, ${offset})`, className: getClassName3("secondary") }, - import_react403.default.createElement("path", { d: "M27 0H59V3H27V0Z" }), - import_react403.default.createElement("path", { d: "M75 0H107V3H75V0Z" }), - import_react403.default.createElement("path", { d: "M123 0H155V3H123V0Z" }), - import_react403.default.createElement("path", { d: "M171 0H203V3H171V0Z" }) - ); -}; -var bottomPositionIcon3 = import_react403.default.createElement( - "svg", - { focusable: false, viewBox: "0 0 230 128", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, - import_react403.default.createElement("path", { d: "M2 1H228C228.552 1 229 1.44772 229 2V117C229 117.552 228.552 118 228 118H2C1.44772 118 1 117.552 1 117V2C1 1.44772 1.44772 1 2 1Z", className: getClassName3("window"), strokeWidth: "2" }), - import_react403.default.createElement( - "g", - { className: "awsui-context-top-navigation" }, - import_react403.default.createElement("rect", { x: "2", y: "2", width: "226", height: "6", className: getClassName3("layout-top") }) - ), - import_react403.default.createElement( - "g", - { className: getContentHeaderClassName() }, - import_react403.default.createElement("path", { d: "M2 8H228V23H2V8Z", className: getClassName3("layout-main") }), - import_react403.default.createElement( - "g", - { className: getClassName3("default") }, - import_react403.default.createElement("path", { d: "M9 15.5C9 16.8807 7.88071 18 6.5 18C5.11929 18 4 16.8807 4 15.5C4 14.1193 5.11929 13 6.5 13C7.88071 13 9 14.1193 9 15.5Z", className: getClassName3("disabled") }), - import_react403.default.createElement("path", { d: "M26 14H56.1484V17H26V14Z" }), - import_react403.default.createElement("path", { d: "M139 15.5C139 13.567 140.567 12 142.5 12H155.86C157.793 12 159.36 13.567 159.36 15.5C159.36 17.433 157.793 19 155.86 19H142.5C140.567 19 139 17.433 139 15.5Z" }), - import_react403.default.createElement("path", { d: "M163 15.5C163 13.567 164.567 12 166.5 12H179.86C181.793 12 183.36 13.567 183.36 15.5C183.36 17.433 181.793 19 179.86 19H166.5C164.567 19 163 17.433 163 15.5Z" }), - import_react403.default.createElement("path", { d: "M186 15.5C186 13.567 187.567 12 189.5 12H202.86C204.793 12 206.36 13.567 206.36 15.5C206.36 17.433 204.793 19 202.86 19H189.5C187.567 19 186 17.433 186 15.5Z", className: getClassName3("primary") }), - import_react403.default.createElement("circle", { cx: "223.5", cy: "15.5", r: "2.5", className: getClassName3("disabled") }) - ) - ), - import_react403.default.createElement(TableRow2, { offset: 27, isHeader: true }), - import_react403.default.createElement(TableRow2, { offset: 39 }), - import_react403.default.createElement(TableRow2, { offset: 51 }), - import_react403.default.createElement(TableRow2, { offset: 63 }), - import_react403.default.createElement("rect", { x: "8", y: "75", width: "214", height: "52", rx: "5", className: getClassName3("window"), strokeWidth: "2" }), - import_react403.default.createElement("rect", { x: "111", y: "79", width: "8", height: "3", rx: "1.5", className: getClassName3("input-default") }), - import_react403.default.createElement("path", { d: "M27 87H57V92H27V87Z", className: getClassName3("heading") }), - import_react403.default.createElement( - "g", - { className: getClassName3("secondary") }, - import_react403.default.createElement("path", { d: "M198 87H203V92H198V87Z" }), - import_react403.default.createElement("path", { d: "M190 87H195V92H190V87Z" }) - ), - import_react403.default.createElement(SidePanelRow2, { offset: 99 }), - import_react403.default.createElement(SidePanelRow2, { offset: 106 }), - import_react403.default.createElement(SidePanelRow2, { offset: 113 }) -); -var bottom_icon_refresh_default = bottomPositionIcon3; - -// node_modules/@cloudscape-design/components/split-panel/preferences-modal.js -var preferences_modal_default2 = (props2) => { - const [position, setPosition] = (0, import_react404.useState)(props2.preferences.position); - const onCancel = () => { - setPosition(props2.preferences.position); - props2.onDismiss(); - }; - const onConfirm = () => { - props2.onConfirm({ position }); - }; - return import_react404.default.createElement( - InternalModal, - { size: "medium", visible: props2.visible, onDismiss: props2.onDismiss, header: props2.i18nStrings.header, closeAriaLabel: props2.i18nStrings.cancel, footer: import_react404.default.createElement( - InternalBox, - { float: "right" }, - import_react404.default.createElement( - InternalSpaceBetween, - { direction: "horizontal", size: "xs" }, - import_react404.default.createElement(InternalButton, { onClick: onCancel, formAction: "none", variant: "link" }, props2.i18nStrings.cancel), - import_react404.default.createElement(InternalButton, { onClick: onConfirm, variant: "primary" }, props2.i18nStrings.confirm) - ) - ), __internalRootRef: props2.__internalRootRef }, - import_react404.default.createElement( - InternalFormField, - { label: props2.i18nStrings.positionLabel, description: props2.i18nStrings.positionDescription }, - import_react404.default.createElement(internal_default21, { onChange: (e) => setPosition(e.detail.value), value: position, columns: 2, items: [ - { - label: props2.i18nStrings.positionBottom, - image: props2.isRefresh ? bottom_icon_refresh_default : bottom_icon_default, - value: "bottom" - }, - { - label: props2.i18nStrings.positionSide, - image: props2.isRefresh ? side_position_refresh_default : side_position_default, - value: "side", - disabled: props2.disabledSidePosition - } - ] }) - ) - ); -}; - -// node_modules/@cloudscape-design/components/split-panel/side.js -var import_react405 = __toESM(require_react()); -function SplitPanelContentSide({ baseProps, splitPanelRef, toggleRef, header, children: children2, resizeHandle, isOpen, cappedSize, openButtonAriaLabel, panelHeaderId, onToggle }) { - const { topOffset, bottomOffset } = useSplitPanelContext(); - const isRefresh = useVisualRefresh(); - return import_react405.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default27.drawer, styles_css_default27.root, styles_css_default27["position-side"], { - [styles_css_default27["drawer-closed"]]: !isOpen - }), style: { - width: isOpen && isRefresh ? cappedSize : void 0, - maxWidth: isRefresh ? "100%" : void 0 - }, ref: splitPanelRef }), - import_react405.default.createElement( - "div", - { className: clsx_m_default(styles_css_default27["drawer-content-side"]), style: { - top: topOffset, - bottom: bottomOffset - }, onClick: () => !isOpen && onToggle(), "aria-labelledby": panelHeaderId, role: "region" }, - isOpen ? import_react405.default.createElement("div", { className: styles_css_default27["slider-wrapper-side"] }, resizeHandle) : import_react405.default.createElement(internal_default2, { className: clsx_m_default(styles_css_default27["open-button"], styles_css_default27["open-button-side"]), iconName: "angle-left", variant: "icon", formAction: "none", ariaLabel: openButtonAriaLabel, ariaExpanded: isOpen, ref: isRefresh ? null : toggleRef }), - import_react405.default.createElement( - "div", - { className: styles_css_default27["content-side"], "aria-hidden": !isOpen }, - import_react405.default.createElement("div", { className: clsx_m_default(styles_css_default27["pane-header-wrapper-side"]) }, header), - import_react405.default.createElement("div", { className: clsx_m_default(styles_css_default27["pane-content-wrapper-side"]) }, children2) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/split-panel/bottom.js -var import_react406 = __toESM(require_react()); -function SplitPanelContentBottom({ baseProps, isOpen, state, transitioningElementRef, splitPanelRef, cappedSize, header, resizeHandle, children: children2, appLayoutMaxWidth, panelHeaderId, onToggle }) { - const isRefresh = useVisualRefresh(); - const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } = useSplitPanelContext(); - const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef); - const isMobile = useMobile(); - const headerRef = (0, import_react406.useRef)(null); - useResizeObserver(headerRef, (entry) => reportHeaderHeight(entry.borderBoxHeight)); - (0, import_react406.useEffect)(() => { - return () => reportHeaderHeight(0); - }, []); - const centeredMaxWidthClasses = clsx_m_default({ - [styles_css_default27["pane-bottom-center-align"]]: isRefresh, - [styles_css_default27["pane-bottom-content-nav-padding"]]: contentWrapperPaddings === null || contentWrapperPaddings === void 0 ? void 0 : contentWrapperPaddings.closedNav, - [styles_css_default27["pane-bottom-content-tools-padding"]]: contentWrapperPaddings === null || contentWrapperPaddings === void 0 ? void 0 : contentWrapperPaddings.closedTools - }); - return import_react406.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default27.root, styles_css_default27.drawer, styles_css_default27["position-bottom"], { - [styles_css_default27["drawer-closed"]]: !isOpen, - [styles_css_default27["drawer-mobile"]]: isMobile, - [styles_css_default27["drawer-disable-content-paddings"]]: disableContentPaddings, - [styles_css_default27.animating]: isRefresh && (state === "entering" || state === "exiting"), - [styles_css_default27.refresh]: isRefresh - }), onClick: () => !isOpen && onToggle(), style: { - bottom: bottomOffset, - left: leftOffset, - right: rightOffset, - height: isOpen ? cappedSize : void 0 - }, ref: transitionContentBottomRef }), - isOpen && import_react406.default.createElement("div", { className: styles_css_default27["slider-wrapper-bottom"] }, resizeHandle), - import_react406.default.createElement( - "div", - { className: styles_css_default27["drawer-content-bottom"], "aria-labelledby": panelHeaderId, role: "region" }, - import_react406.default.createElement("div", { className: clsx_m_default(styles_css_default27["pane-header-wrapper-bottom"], centeredMaxWidthClasses), ref: headerRef }, header), - import_react406.default.createElement( - "div", - { className: clsx_m_default(styles_css_default27["content-bottom"], centeredMaxWidthClasses), "aria-hidden": !isOpen }, - import_react406.default.createElement("div", { className: clsx_m_default({ [styles_css_default27["content-bottom-max-width"]]: isRefresh }), style: appLayoutMaxWidth }, children2) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/split-panel/implementation.js -var SplitPanelImplementation = import_react407.default.forwardRef((_a2, __internalRootRef) => { - var { header, children: children2, hidePreferencesButton = false, closeBehavior = "collapse", i18nStrings } = _a2, restProps = __rest(_a2, ["header", "children", "hidePreferencesButton", "closeBehavior", "i18nStrings"]); - const isRefresh = useVisualRefresh(); - const { position, topOffset, bottomOffset, rightOffset, contentWidthStyles, isOpen, isForcedPosition, onPreferencesChange, onResize, onToggle, size: size2, relativeSize, setSplitPanelToggle, refs } = useSplitPanelContext(); - const baseProps = getBaseProps(restProps); - const i18n = useInternalI18n("split-panel"); - const [isPreferencesOpen, setPreferencesOpen] = (0, import_react407.useState)(false); - const appLayoutMaxWidth = isRefresh && position === "bottom" ? contentWidthStyles : void 0; - const openButtonAriaLabel = i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel); - (0, import_react407.useEffect)(() => { - setSplitPanelToggle({ displayed: closeBehavior === "collapse", ariaLabel: openButtonAriaLabel }); - }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]); - const splitPanelRefObject = (0, import_react407.useRef)(null); - const sizeControlProps = { - position, - panelRef: splitPanelRefObject, - handleRef: refs.slider, - onResize - }; - const onSliderPointerDown = usePointerEvents(sizeControlProps); - const onKeyDown = useKeyboardEvents(sizeControlProps); - const wrappedChildren = import_react407.default.createElement(AppLayoutContext.Provider, { value: { - stickyOffsetTop: topOffset, - stickyOffsetBottom: bottomOffset - } }, children2); - const panelHeaderId = useUniqueId("split-panel-header"); - const wrappedHeader = import_react407.default.createElement( - "div", - { className: styles_css_default27.header, style: appLayoutMaxWidth }, - import_react407.default.createElement("h2", { className: styles_css_default27["header-text"], id: panelHeaderId }, header), - import_react407.default.createElement( - "div", - { className: styles_css_default27["header-actions"] }, - !hidePreferencesButton && isOpen && import_react407.default.createElement( - import_react407.default.Fragment, - null, - import_react407.default.createElement(InternalButton, { className: styles_css_default27["preferences-button"], iconName: "settings", variant: "icon", onClick: () => setPreferencesOpen(true), formAction: "none", ariaLabel: i18n("i18nStrings.preferencesTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesTitle), ref: refs.preferences }), - import_react407.default.createElement("span", { className: styles_css_default27.divider }) - ), - isOpen ? import_react407.default.createElement(InternalButton, { className: styles_css_default27["close-button"], iconName: isRefresh && closeBehavior === "collapse" ? position === "side" ? "angle-right" : "angle-down" : "close", variant: "icon", onClick: onToggle, formAction: "none", ariaLabel: i18n("i18nStrings.closeButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.closeButtonAriaLabel), ariaExpanded: isOpen }) : position === "side" ? null : import_react407.default.createElement(InternalButton, { className: styles_css_default27["open-button"], iconName: "angle-up", variant: "icon", formAction: "none", ariaLabel: i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel), ref: refs.toggle, ariaExpanded: isOpen }) - ) - ); - const resizeHandle = import_react407.default.createElement( - "div", - { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": i18n("i18nStrings.resizeHandleAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleAriaLabel), "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": position === "bottom" ? relativeSize : 100 - relativeSize, className: clsx_m_default(styles_css_default27.slider, styles_css_default27[`slider-${position}`]), onKeyDown, onPointerDown: onSliderPointerDown }, - import_react407.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default27["slider-icon"], styles_css_default27[`slider-icon-${position}`]) }) - ); - (0, import_react407.useLayoutEffect)(() => { - const root = splitPanelRefObject.current; - if (root) { - const property = "transform"; - const temporaryValue = "translateZ(0)"; - const valueBefore = root.style[property]; - root.style[property] = temporaryValue; - void root.offsetHeight; - root.style[property] = valueBefore; - } - }, [rightOffset, __internalRootRef]); - const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef); - if (closeBehavior === "hide" && !isOpen) { - return import_react407.default.createElement(import_react407.default.Fragment, null); - } - if (isRefresh && !isOpen && position === "side") { - return import_react407.default.createElement(import_react407.default.Fragment, null); - } - return import_react407.default.createElement(Transition2, { in: isOpen !== null && isOpen !== void 0 ? isOpen : false }, (state, transitioningElementRef) => import_react407.default.createElement( - import_react407.default.Fragment, - null, - position === "side" && import_react407.default.createElement(SplitPanelContentSide, { resizeHandle, baseProps, isOpen, splitPanelRef: mergedRef, cappedSize: size2, onToggle, openButtonAriaLabel: i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel), toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId }, wrappedChildren), - position === "bottom" && import_react407.default.createElement(SplitPanelContentBottom, { resizeHandle, baseProps, isOpen, splitPanelRef: mergedRef, cappedSize: size2, onToggle, header: wrappedHeader, panelHeaderId, state, transitioningElementRef, appLayoutMaxWidth }, wrappedChildren), - isPreferencesOpen && import_react407.default.createElement(preferences_modal_default2, { visible: true, preferences: { position }, disabledSidePosition: position === "bottom" && isForcedPosition, isRefresh, i18nStrings: { - header: i18n("i18nStrings.preferencesTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesTitle), - confirm: i18n("i18nStrings.preferencesConfirm", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesConfirm), - cancel: i18n("i18nStrings.preferencesCancel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesCancel), - positionLabel: i18n("i18nStrings.preferencesPositionLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionLabel), - positionDescription: i18n("i18nStrings.preferencesPositionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionDescription), - positionBottom: i18n("i18nStrings.preferencesPositionBottom", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionBottom), - positionSide: i18n("i18nStrings.preferencesPositionSide", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionSide) - }, onConfirm: (preferences) => { - onPreferencesChange(Object.assign({}, preferences)); - setPreferencesOpen(false); - }, onDismiss: () => { - setPreferencesOpen(false); - } }) - )); -}); - -// node_modules/@cloudscape-design/components/split-panel/widget.js -function createWidgetizedSplitPanel(SplitPanelLoader) { - return import_react408.default.forwardRef((props2, ref) => { - const isRefresh = useVisualRefresh(); - if (isRefresh && getGlobalFlag("appLayoutWidget") && SplitPanelLoader) { - return import_react408.default.createElement(SplitPanelLoader, Object.assign({ ref }, props2)); - } - return import_react408.default.createElement(SplitPanelImplementation, Object.assign({ ref }, props2)); - }); -} - -// node_modules/@cloudscape-design/components/split-panel/internal.js -var SplitPanelInternal = createWidgetizedSplitPanel(); - -// node_modules/@cloudscape-design/components/split-panel/index.js -function SplitPanel2(_a2) { - var { hidePreferencesButton = false, closeBehavior = "collapse" } = _a2, restProps = __rest(_a2, ["hidePreferencesButton", "closeBehavior"]); - const { __internalRootRef } = useBaseComponent("SplitPanel", { - props: { closeBehavior, hidePreferencesButton } - }); - return import_react409.default.createElement(SplitPanelInternal, Object.assign({}, restProps, { ref: __internalRootRef, hidePreferencesButton, closeBehavior })); -} -applyDisplayName(SplitPanel2, "SplitPanel"); - -// node_modules/@cloudscape-design/components/status-indicator/index.js -var import_react410 = __toESM(require_react()); -function StatusIndicator2(_a2) { - var { type = "success", wrapText = true } = _a2, props2 = __rest(_a2, ["type", "wrapText"]); - const baseComponentProps = useBaseComponent("StatusIndicator", { - props: { colorOverride: props2.colorOverride, type, wrapText } - }); - return import_react410.default.createElement(StatusIndicator, Object.assign({ type, wrapText }, props2, baseComponentProps)); -} -applyDisplayName(StatusIndicator2, "StatusIndicator"); - -// node_modules/@cloudscape-design/components/table/index.js -var import_react411 = __toESM(require_react()); -var Table = import_react411.default.forwardRef((_a2, ref) => { - var { items = [], selectedItems = [], variant = "container", contentDensity = "comfortable" } = _a2, props2 = __rest(_a2, ["items", "selectedItems", "variant", "contentDensity"]); - const baseComponentProps = useBaseComponent("Table", { - props: { - contentDensity, - resizableColumns: props2.resizableColumns, - selectionType: props2.selectionType, - stickyHeader: props2.stickyHeader, - stripedRows: props2.stripedRows, - variant, - wrapLines: props2.wrapLines, - enableKeyboardNavigation: props2.enableKeyboardNavigation - }, - metadata: { - expandableRows: !!props2.expandableRows - } - }); - const tableProps = Object.assign(Object.assign(Object.assign({ - items, - selectedItems, - variant, - contentDensity - }, props2), baseComponentProps), { ref }); - if (variant === "borderless" || variant === "embedded") { - return import_react411.default.createElement(internal_default19, Object.assign({}, tableProps)); - } - return import_react411.default.createElement( - AnalyticsFunnelSubStep, - null, - import_react411.default.createElement(InternalTableAsSubstep, Object.assign({}, tableProps)) - ); -}); -applyDisplayName(Table, "Table"); -var table_default = Table; - -// node_modules/@cloudscape-design/components/tabs/index.js -var import_react413 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tabs/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tabs/styles.scoped.css"; -var styles_css_default121 = { - "tabs-header": "awsui_tabs-header_14rmt_n8497_198", - "tabs-header-list": "awsui_tabs-header-list_14rmt_n8497_206", - "pagination-button": "awsui_pagination-button_14rmt_n8497_223", - "pagination-button-left": "awsui_pagination-button-left_14rmt_n8497_230", - "pagination-button-left-scrollable": "awsui_pagination-button-left-scrollable_14rmt_n8497_233", - "pagination-button-right": "awsui_pagination-button-right_14rmt_n8497_237", - "pagination-button-right-scrollable": "awsui_pagination-button-right-scrollable_14rmt_n8497_240", - "tabs-tab": "awsui_tabs-tab_14rmt_n8497_245", - "tabs-tab-label": "awsui_tabs-tab-label_14rmt_n8497_257", - "tabs-tab-link": "awsui_tabs-tab-link_14rmt_n8497_273", - "refresh": "awsui_refresh_14rmt_n8497_292", - "tabs-tab-disabled": "awsui_tabs-tab-disabled_14rmt_n8497_343", - "tabs-tab-active": "awsui_tabs-tab-active_14rmt_n8497_378", - "tabs-header-with-divider": "awsui_tabs-header-with-divider_14rmt_n8497_385", - "root": "awsui_root_14rmt_n8497_389", - "tabs": "awsui_tabs_14rmt_n8497_198", - "tabs-content": "awsui_tabs-content_14rmt_n8497_430", - "fit-height": "awsui_fit-height_14rmt_n8497_434", - "tabs-content-active": "awsui_tabs-content-active_14rmt_n8497_440", - "tabs-content-wrapper": "awsui_tabs-content-wrapper_14rmt_n8497_454", - "with-paddings": "awsui_with-paddings_14rmt_n8497_454", - "tabs-container-content-wrapper": "awsui_tabs-container-content-wrapper_14rmt_n8497_465" -}; - -// node_modules/@cloudscape-design/components/tabs/tab-header-bar.js -var import_react412 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tabs/native-smooth-scroll-supported.js -function native_smooth_scroll_supported_default() { - return "scrollBehavior" in document.documentElement.style; -} - -// node_modules/@cloudscape-design/components/tabs/smooth-scroll.js -var getScrollSpeed = (pixels) => 15e-4 * Math.abs(pixels) + 0.558; -var getScrollTime = (pixels) => Math.round(Math.abs(pixels) / getScrollSpeed(pixels)); -var now = () => window.performance ? window.performance.now() : Date.now(); -var ease = (k2) => { - return 0.5 * (1 - Math.cos(Math.PI * k2)); -}; -var step = (context) => { - const time3 = now(); - const elapsed = Math.min((time3 - context.startTime) / context.scrollTime, 1); - const value = ease(elapsed); - const currentX = context.startX + (context.endX - context.startX) * value; - context.scrollable.scrollLeft = currentX; - if (currentX !== context.endX) { - requestAnimationFrame(() => step(context)); - } -}; -var simulateSmoothScroll = (element, endX) => { - const startX = element.scrollLeft; - step({ - scrollable: element, - startX, - endX, - startTime: now(), - scrollTime: getScrollTime(endX - startX) - }); -}; -var smoothScroll = (element, to) => { - if (isMotionDisabled(element)) { - element.scrollLeft = to; - return; - } - if (native_smooth_scroll_supported_default() && element.scrollTo) { - element.scrollTo({ - left: to, - behavior: "smooth" - }); - return; - } - simulateSmoothScroll(element, to); -}; -var smooth_scroll_default = smoothScroll; - -// node_modules/@cloudscape-design/components/tabs/scroll-utils.js -var onPaginationClick = (headerBarRef, direction) => { - if (!(headerBarRef === null || headerBarRef === void 0 ? void 0 : headerBarRef.current)) { - return; - } - const element = headerBarRef.current; - const { scrollLeft, scrollWidth, offsetWidth } = element; - const paginatedSectionSize = Math.ceil(element.clientWidth * 0.75); - const scrollDistance = direction === "forward" ? Math.min(Math.abs(scrollLeft) + paginatedSectionSize, scrollWidth - offsetWidth) : Math.max(Math.abs(scrollLeft) - paginatedSectionSize, 0); - const scrollTo = isRtl(element) ? scrollDistance * -1 : scrollDistance; - smooth_scroll_default(element, scrollTo); -}; -var hasHorizontalOverflow = (headerBar, inlineStartOverflowButton) => { - const { offsetWidth, scrollWidth } = headerBar; - const paginationButtonsWidth = inlineStartOverflowButton.current && 2 * inlineStartOverflowButton.current.offsetWidth; - return paginationButtonsWidth ? scrollWidth > offsetWidth + paginationButtonsWidth : scrollWidth > offsetWidth; -}; -var hasInlineStartOverflow = (headerBar) => { - return getScrollInlineStart(headerBar) > 0; -}; -var hasInlineEndOverflow = (headerBar) => { - return Math.ceil(getScrollInlineStart(headerBar)) < headerBar.scrollWidth - headerBar.offsetWidth; -}; -var scrollIntoView = (tabHeader, headerBar, smooth = true) => { - if (!tabHeader || !headerBar) { - return; - } - const margin = 2; - let updatedLeftScroll = headerBar.scrollLeft; - updatedLeftScroll = Math.min(updatedLeftScroll, tabHeader.offsetLeft - margin); - updatedLeftScroll = Math.max(updatedLeftScroll, tabHeader.offsetLeft + tabHeader.offsetWidth - headerBar.offsetWidth + margin); - if (smooth) { - smooth_scroll_default(headerBar, updatedLeftScroll); - } else { - headerBar.scrollLeft = updatedLeftScroll; - } -}; - -// node_modules/@cloudscape-design/components/tabs/tab-header-bar.js -function TabHeaderBar({ onChange, activeTabId, tabs, variant, idNamespace, ariaLabel, ariaLabelledby, i18nStrings }) { - const headerBarRef = (0, import_react412.useRef)(null); - const activeTabHeaderRef = (0, import_react412.useRef)(null); - const inlineStartOverflowButton = (0, import_react412.useRef)(null); - const i18n = useInternalI18n("tabs"); - const isVisualRefresh = useVisualRefresh(); - const [widthChange, containerRef] = useContainerQuery((rect) => rect.contentBoxWidth); - const tabRefs = (0, import_react412.useRef)(/* @__PURE__ */ new Map()); - const [horizontalOverflow, setHorizontalOverflow] = (0, import_react412.useState)(false); - const [inlineStartOverflow, setInlineStartOverflow] = (0, import_react412.useState)(false); - const [inlineEndOverflow, setInlineEndOverflow] = (0, import_react412.useState)(false); - (0, import_react412.useEffect)(() => { - if (headerBarRef.current) { - setHorizontalOverflow(hasHorizontalOverflow(headerBarRef.current, inlineStartOverflowButton)); - setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current)); - setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current)); - } - }, [widthChange, tabs]); - const scrollIntoViewIfPossible = (smooth) => { - if (!activeTabId) { - return; - } - const activeTabRef = tabRefs.current.get(activeTabId); - if (activeTabRef && headerBarRef.current) { - scrollIntoView(activeTabRef, headerBarRef.current, smooth); - } - }; - (0, import_react412.useEffect)(() => { - requestAnimationFrame(() => { - scrollIntoViewIfPossible(false); - }); - }, [horizontalOverflow, widthChange, tabs.length]); - (0, import_react412.useEffect)(() => { - scrollIntoViewIfPossible(true); - }, [activeTabId]); - (0, import_react412.useEffect)(() => { - var _a2, _b; - if ((_a2 = headerBarRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(document.activeElement)) { - if (document.activeElement !== activeTabHeaderRef.current) { - (_b = activeTabHeaderRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true }); - } - } - }, [activeTabId]); - const onScroll = () => { - if (headerBarRef.current) { - setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current)); - setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current)); - } - }; - const classes = clsx_m_default({ - [styles_css_default121["tabs-header"]]: true, - [styles_css_default121["tabs-header-with-divider"]]: variant === "default" || isVisualRefresh - }); - const leftButtonClasses = clsx_m_default({ - [styles_css_default121["pagination-button"]]: true, - [styles_css_default121["pagination-button-left"]]: true, - [styles_css_default121["pagination-button-left-scrollable"]]: inlineStartOverflow - }); - const rightButtonClasses = clsx_m_default({ - [styles_css_default121["pagination-button"]]: true, - [styles_css_default121["pagination-button-right"]]: true, - [styles_css_default121["pagination-button-right-scrollable"]]: inlineEndOverflow - }); - return ( - //converted span to div as list should not be a child of span for HTML validation - import_react412.default.createElement( - "div", - { className: classes, ref: containerRef }, - horizontalOverflow && import_react412.default.createElement( - "span", - { ref: inlineStartOverflowButton, className: leftButtonClasses }, - import_react412.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "angle-left", disabled: !inlineStartOverflow, __focusable: true, onClick: () => onPaginationClick(headerBarRef, "backward"), ariaLabel: i18n("i18nStrings.scrollLeftAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.scrollLeftAriaLabel) }) - ), - import_react412.default.createElement("ul", { role: "tablist", className: styles_css_default121["tabs-header-list"], "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref: headerBarRef, onScroll }, tabs.map(renderTabHeader)), - horizontalOverflow && import_react412.default.createElement( - "span", - { className: rightButtonClasses }, - import_react412.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "angle-right", disabled: !inlineEndOverflow, __focusable: true, onClick: () => onPaginationClick(headerBarRef, "forward"), ariaLabel: i18n("i18nStrings.scrollRightAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.scrollRightAriaLabel) }) - ) - ) - ); - function renderTabHeader(tab) { - const enabledTabsWithCurrentTab = tabs.filter((tab2) => !tab2.disabled || tab2.id === activeTabId); - const highlightTab = function(enabledTabIndex) { - const tab2 = enabledTabsWithCurrentTab[enabledTabIndex]; - if (tab2.id === activeTabId) { - return; - } - onChange({ activeTabId: tab2.id, activeTabHref: tab2.href }); - }; - const onKeyDown = function(event) { - const { keyCode } = event; - const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown]; - if (hasModifierKeys(event) || specialKeys.indexOf(keyCode) === -1) { - return; - } - event.preventDefault(); - const activeIndex = enabledTabsWithCurrentTab.indexOf(tab); - handleKey(event, { - onEnd: () => highlightTab(enabledTabsWithCurrentTab.length - 1), - onHome: () => highlightTab(0), - onInlineEnd: () => activeIndex + 1 === enabledTabsWithCurrentTab.length ? highlightTab(0) : highlightTab(activeIndex + 1), - onInlineStart: () => activeIndex === 0 ? highlightTab(enabledTabsWithCurrentTab.length - 1) : highlightTab(activeIndex - 1), - onPageDown: () => inlineEndOverflow && onPaginationClick(headerBarRef, "forward"), - onPageUp: () => inlineStartOverflow && onPaginationClick(headerBarRef, "backward") - }); - }; - const clickTab = (event) => { - if (tab.disabled) { - event.preventDefault(); - return; - } - const specialKey = !isPlainLeftClick(event); - if (specialKey && tab.href) { - return; - } - event.preventDefault(); - if (!tab.href) { - const clickedTabRef = tabRefs.current.get(tab.id); - if (clickedTabRef) { - const childElement = clickedTabRef.firstChild; - if (childElement && childElement !== document.activeElement) { - childElement.focus({ preventScroll: true }); - } - } - } - if (tab.id === activeTabId) { - return; - } - onChange({ activeTabId: tab.id, activeTabHref: tab.href }); - }; - const classes2 = clsx_m_default({ - [styles_css_default121["tabs-tab-link"]]: true, - [styles_css_default121.refresh]: isVisualRefresh, - [styles_css_default121["tabs-tab-active"]]: activeTabId === tab.id && !tab.disabled, - [styles_css_default121["tabs-tab-disabled"]]: tab.disabled - }); - const commonProps = { - className: classes2, - role: "tab", - "aria-selected": tab.id === activeTabId, - "aria-controls": `${idNamespace}-${tab.id}-panel`, - "data-testid": tab.id, - id: getTabElementId({ namespace: idNamespace, tabId: tab.id }), - children: import_react412.default.createElement("span", { className: styles_css_default121["tabs-tab-label"] }, tab.label) - }; - if (tab.disabled) { - commonProps["aria-disabled"] = "true"; - } else { - commonProps.onClick = clickTab; - } - if (tab.id === activeTabId) { - commonProps.ref = activeTabHeaderRef; - commonProps.tabIndex = 0; - commonProps.onKeyDown = (event) => onKeyDown(event); - } else { - commonProps.tabIndex = -1; - } - let trigger2 = null; - if (tab.href) { - const anchorProps = commonProps; - anchorProps.href = tab.href; - trigger2 = import_react412.default.createElement("a", Object.assign({}, anchorProps)); - } else { - const buttonProps = commonProps; - buttonProps.type = "button"; - if (tab.disabled) { - buttonProps.disabled = true; - } - trigger2 = import_react412.default.createElement("button", Object.assign({}, buttonProps)); - } - return import_react412.default.createElement("li", { ref: (element) => tabRefs.current.set(tab.id, element), className: styles_css_default121["tabs-tab"], role: "presentation", key: tab.id }, trigger2); - } -} -function getTabElementId({ namespace, tabId }) { - return namespace + "-" + tabId; -} - -// node_modules/@cloudscape-design/components/tabs/index.js -function firstEnabledTab(tabs) { - const enabledTabs = tabs.filter((tab) => !tab.disabled); - if (enabledTabs.length > 0) { - return enabledTabs[0]; - } - return null; -} -function Tabs(_a2) { - var _b, _c; - var { tabs, variant = "default", onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings = false, i18nStrings, fitHeight } = _a2, rest = __rest(_a2, ["tabs", "variant", "onChange", "activeTabId", "ariaLabel", "ariaLabelledby", "disableContentPaddings", "i18nStrings", "fitHeight"]); - for (const tab of tabs) { - checkSafeUrl("Tabs", tab.href); - } - const { __internalRootRef } = useBaseComponent("Tabs", { - props: { disableContentPaddings, variant } - }); - const idNamespace = useUniqueId("awsui-tabs-"); - const [activeTabId, setActiveTabId] = useControllable2(controlledTabId, onChange, (_c = (_b = firstEnabledTab(tabs)) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : "", { - componentName: "Tabs", - controlledProp: "activeTabId", - changeHandler: "onChange" - }); - const baseProps = getBaseProps(rest); - const content = () => { - const selectedTab = tabs.filter((tab) => tab.id === activeTabId)[0]; - const renderContent = (tab) => { - const isTabSelected = tab === selectedTab; - const classes = clsx_m_default({ - [styles_css_default121["tabs-content"]]: true, - [styles_css_default121["tabs-content-active"]]: isTabSelected - }); - const contentAttributes = { - className: classes, - role: "tabpanel", - id: `${idNamespace}-${tab.id}-panel`, - key: `${idNamespace}-${tab.id}-panel`, - tabIndex: 0, - "aria-labelledby": getTabElementId({ namespace: idNamespace, tabId: tab.id }) - }; - const isContentShown = isTabSelected && !selectedTab.disabled; - return import_react413.default.createElement("div", Object.assign({}, contentAttributes), isContentShown && selectedTab.content); - }; - return import_react413.default.createElement("div", { className: clsx_m_default(variant === "container" || variant === "stacked" ? styles_css_default121["tabs-container-content-wrapper"] : styles_css_default121["tabs-content-wrapper"], { - [styles_css_default121["with-paddings"]]: !disableContentPaddings - }) }, tabs.map(renderContent)); - }; - const header = import_react413.default.createElement(TabHeaderBar, { activeTabId, variant, idNamespace, ariaLabel, ariaLabelledby, tabs, onChange: (changeDetail) => { - setActiveTabId(changeDetail.activeTabId); - fireNonCancelableEvent(onChange, changeDetail); - }, i18nStrings }); - if (variant === "container" || variant === "stacked") { - return import_react413.default.createElement(InternalContainer, Object.assign({ header, disableHeaderPaddings: true }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default121.root), __internalRootRef, disableContentPaddings: true, variant: variant === "stacked" ? "stacked" : "default", fitHeight }), content()); - } - return import_react413.default.createElement( - "div", - Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default121.root, styles_css_default121.tabs, { [styles_css_default121["fit-height"]]: fitHeight }), ref: __internalRootRef }), - header, - content() - ); -} -applyDisplayName(Tabs, "Tabs"); - -// node_modules/@cloudscape-design/components/tag-editor/index.js -var import_react416 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tag-editor/internal.js -var import_react414 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tag-editor/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tag-editor/styles.scoped.css"; -var styles_css_default122 = { - "root": "awsui_root_brdst_1yvx7_99", - "loading": "awsui_loading_brdst_1yvx7_103", - "undo-button": "awsui_undo-button_brdst_1yvx7_107" -}; - -// node_modules/@cloudscape-design/components/tag-editor/internal.js -var TagControl = import_react414.default.forwardRef(({ row, value, readOnly, defaultOptions: defaultOptions3, placeholder, errorText, loadingText, suggestionText, tooManySuggestionText, limit, filteringKey, enteredTextLabel, clearAriaLabel, onChange, onBlur, onRequest, initialOptionsRef }, ref) => { - const [options, setOptions] = (0, import_react414.useState)(defaultOptions3); - const [statusType, setStatusType] = (0, import_react414.useState)(); - const requestCancelFnRef = (0, import_react414.useRef)({ - cancel: () => { - }, - isCancelled: () => false - }); - const latestFilteringQuery = (0, import_react414.useRef)({ key: void 0, value: void 0 }); - const isSameQuery = (key2, value2) => latestFilteringQuery.current.key === key2 && latestFilteringQuery.current.value === value2; - const onLoadItems = (filteringText) => { - if (!onRequest || isSameQuery(filteringKey, filteringText) || requestCancelFnRef.current.isCancelled()) { - return; - } - requestCancelFnRef.current.cancel(); - if (latestFilteringQuery.current.key !== filteringKey) { - setOptions([]); - } else if (filteringText === "" && (initialOptionsRef === null || initialOptionsRef === void 0 ? void 0 : initialOptionsRef.current) && initialOptionsRef.current.length > 0) { - setOptions(initialOptionsRef.current); - } - setStatusType("loading"); - latestFilteringQuery.current = { key: filteringKey, value: filteringText }; - const { promise, cancel, isCancelled } = makeCancellable(onRequest(filteringText)); - promise.then((newValues) => { - const newOptions = newValues.map((value2) => ({ value: value2 })); - setStatusType(void 0); - setOptions(newOptions); - if (initialOptionsRef) { - initialOptionsRef.current = newOptions; - } - }).catch((err) => { - if (!(err instanceof PromiseCancelledSignal)) { - setStatusType("error"); - } - }); - requestCancelFnRef.current = { cancel, isCancelled }; - }; - return import_react414.default.createElement(internal_default10, { ref, value, readOnly, statusType, options: options.length < limit ? options : [], empty: options.length < limit ? suggestionText : tooManySuggestionText, placeholder, errorText, loadingText, enteredTextLabel, clearAriaLabel, onChange: ({ detail }) => onChange(detail.value, row), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(row), onFocus: () => { - onLoadItems(""); - }, onLoadItems: ({ detail }) => { - onLoadItems(detail.filteringText); - } }); -}); -var UndoButton = import_react414.default.forwardRef(({ children: children2, onClick }, ref) => { - return import_react414.default.createElement("a", { ref, role: "button", tabIndex: 0, className: styles_css_default122["undo-button"], onClick, onKeyDown: (event) => { - if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) { - event.preventDefault(); - } - if (event.keyCode === KeyCode.enter) { - onClick(); - } - }, onKeyUp: (event) => { - if (event.keyCode === KeyCode.space) { - onClick(); - } - } }, children2); -}); - -// node_modules/@cloudscape-design/components/tag-editor/validation.js -var DEFAULT_CHAR_REGEX = /^([\p{L}\p{Z}\p{N}_.:/=+\\@-]*)$/u; -var SYSTEM_TAG_PREFIX = "aws:"; -var MAX_KEY_LENGTH = 128; -var MAX_VALUE_LENGTH = 256; -function validate2(tags, keyDirtyState, i18n, i18nStrings, charRegex = DEFAULT_CHAR_REGEX) { - const tagKeysCache = {}; - tags.forEach((tag) => { - var _a2; - if (tag.key && !tag.markedForRemoval) { - tagKeysCache[tag.key] = ((_a2 = tagKeysCache[tag.key]) !== null && _a2 !== void 0 ? _a2 : 0) + 1; - } - }); - return tags.map((tag, i) => { - let keyError, valueError; - if (keyDirtyState[i] && emptyKeyCheck(tag.key)) { - keyError = i18n("i18nStrings.emptyKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyKeyError); - } else if (awsPrefixCheck(tag.key)) { - keyError = i18n("i18nStrings.awsPrefixError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.awsPrefixError); - } else if (invalidCharCheck(tag.key, charRegex)) { - keyError = i18n("i18nStrings.invalidKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.invalidKeyError); - } else if (maxKeyLengthCheck(tag.key)) { - keyError = i18n("i18nStrings.maxKeyCharLengthError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.maxKeyCharLengthError); - } else if (duplicateKeyCheck(tag.key, tagKeysCache)) { - keyError = i18n("i18nStrings.duplicateKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.duplicateKeyError); - } - if (!tag.markedForRemoval) { - if (invalidCharCheck(tag.value, charRegex)) { - valueError = i18n("i18nStrings.invalidValueError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.invalidValueError); - } else if (maxValueLengthCheck(tag.value)) { - valueError = i18n("i18nStrings.maxValueCharLengthError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.maxValueCharLengthError); - } - } - if (keyError || valueError) { - return { key: keyError, value: valueError }; - } - }); -} -var awsPrefixCheck = (value) => { - return value.toLowerCase().indexOf(SYSTEM_TAG_PREFIX) === 0; -}; -var emptyKeyCheck = (value) => { - return !value || value.trim().length === 0; -}; -var maxKeyLengthCheck = (value) => { - return value && value.length > MAX_KEY_LENGTH; -}; -var duplicateKeyCheck = (value, keyCache) => { - var _a2; - return ((_a2 = keyCache === null || keyCache === void 0 ? void 0 : keyCache[value]) !== null && _a2 !== void 0 ? _a2 : 0) > 1; -}; -var maxValueLengthCheck = (value) => { - return value && value.length > MAX_VALUE_LENGTH; -}; -var invalidCharCheck = (value, validCharRegex = DEFAULT_CHAR_REGEX) => { - if (!value || !validCharRegex) { - return false; - } - return !validCharRegex.test(value); -}; - -// node_modules/@cloudscape-design/components/tag-editor/utils.js -var import_react415 = __toESM(require_react()); -function findIndex3(array, condition) { - for (let i = 0; i < array.length; i++) { - if (condition(array[i])) { - return i; - } - } - return -1; -} -function makeMemoizedArray(prev, next, isEqual2) { - for (let i = 0; i < Math.max(prev.length, next.length); i++) { - if (i === next.length) { - return prev.slice(0, i); - } - if (i === prev.length) { - return [...prev.slice(0, i), ...next.slice(i)]; - } - if (!isEqual2(prev[i], next[i])) { - return [...prev.slice(0, i), next[i], ...makeMemoizedArray(prev.slice(i + 1), next.slice(i + 1), isEqual2)]; - } - } - return prev; -} -function useMemoizedArray(array, isEqual2) { - const ref = (0, import_react415.useRef)(array); - const updated = makeMemoizedArray(ref.current, array, isEqual2); - (0, import_react415.useEffect)(() => { - ref.current = updated; - }, [updated]); - return updated; -} - -// node_modules/@cloudscape-design/components/tag-editor/index.js -var isItemRemovable = ({ tag }) => !tag.markedForRemoval; -var TagEditor = import_react416.default.forwardRef((_a2, ref) => { - var _b, _c, _d, _e, _f, _g; - var { tags = [], i18nStrings, loading = false, tagLimit = 50, allowedCharacterPattern, keysRequest, valuesRequest, onChange } = _a2, restProps = __rest(_a2, ["tags", "i18nStrings", "loading", "tagLimit", "allowedCharacterPattern", "keysRequest", "valuesRequest", "onChange"]); - const baseComponentProps = useBaseComponent("TagEditor", { - props: { tagLimit, allowedCharacterPattern } - }); - const i18n = useInternalI18n("tag-editor"); - const remainingTags = tagLimit - tags.filter((tag) => !tag.markedForRemoval).length; - const attributeEditorRef = (0, import_react416.useRef)(null); - const keyInputRefs = (0, import_react416.useRef)([]); - const valueInputRefs = (0, import_react416.useRef)([]); - const undoButtonRefs = (0, import_react416.useRef)([]); - const initialKeyOptionsRef = (0, import_react416.useRef)([]); - const keyDirtyStateRef = (0, import_react416.useRef)([]); - const focusEventRef = (0, import_react416.useRef)(); - (0, import_react416.useLayoutEffect)(() => { - var _a3; - (_a3 = focusEventRef.current) === null || _a3 === void 0 ? void 0 : _a3.apply(void 0); - focusEventRef.current = void 0; - }); - const errors = validate2(tags, keyDirtyStateRef.current, i18n, i18nStrings, allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : void 0); - const internalTags = useMemoizedArray(tags.map((tag, i) => ({ tag, error: errors[i] })), (prev, next) => { - var _a3, _b2, _c2, _d2; - return prev.tag === next.tag && ((_a3 = prev.error) === null || _a3 === void 0 ? void 0 : _a3.key) === ((_b2 = next.error) === null || _b2 === void 0 ? void 0 : _b2.key) && ((_c2 = prev.error) === null || _c2 === void 0 ? void 0 : _c2.value) === ((_d2 = next.error) === null || _d2 === void 0 ? void 0 : _d2.value); - }); - (0, import_react416.useImperativeHandle)(ref, () => ({ - focus() { - var _a3, _b2; - const errorIndex = findIndex3(internalTags, ({ error }) => (error === null || error === void 0 ? void 0 : error.key) || (error === null || error === void 0 ? void 0 : error.value)); - if (errorIndex !== -1) { - const refArray = ((_a3 = internalTags[errorIndex].error) === null || _a3 === void 0 ? void 0 : _a3.key) ? keyInputRefs : valueInputRefs; - (_b2 = refArray.current[errorIndex]) === null || _b2 === void 0 ? void 0 : _b2.focus(); - } - } - }), [internalTags]); - const validateAndFire = (0, import_react416.useCallback)((newTags) => { - fireNonCancelableEvent(onChange, { - tags: newTags, - valid: !validate2(newTags, keyDirtyStateRef.current, i18n, i18nStrings, allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : void 0).some((error) => error) - }); - }, [onChange, i18n, i18nStrings, allowedCharacterPattern]); - const onAddButtonClick = () => { - validateAndFire([...tags, { key: "", value: "", existing: false }]); - focusEventRef.current = () => { - var _a3; - (_a3 = keyInputRefs.current[tags.length]) === null || _a3 === void 0 ? void 0 : _a3.focus(); - }; - }; - const onRemoveButtonClick = useStableCallback(({ detail }) => { - var _a3, _b2, _c2, _d2, _e2; - const existing = tags[detail.itemIndex].existing; - validateAndFire([ - ...tags.slice(0, detail.itemIndex), - ...existing ? [Object.assign(Object.assign({}, tags[detail.itemIndex]), { markedForRemoval: true })] : [], - ...tags.slice(detail.itemIndex + 1) - ]); - if (existing) { - focusEventRef.current = () => { - var _a4; - (_a4 = undoButtonRefs.current[detail.itemIndex]) === null || _a4 === void 0 ? void 0 : _a4.focus(); - }; - } else { - keyDirtyStateRef.current.splice(detail.itemIndex, 1); - const nextKey = keyInputRefs.current[detail.itemIndex + 1]; - if (nextKey) { - (_a3 = keyInputRefs.current[detail.itemIndex]) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } else if (detail.itemIndex > 0) { - const previousIsExisting = tags[detail.itemIndex - 1].existing; - if (previousIsExisting) { - if (tags[detail.itemIndex - 1].markedForRemoval) { - (_b2 = undoButtonRefs.current[detail.itemIndex - 1]) === null || _b2 === void 0 ? void 0 : _b2.focus(); - } else { - (_c2 = valueInputRefs.current[detail.itemIndex - 1]) === null || _c2 === void 0 ? void 0 : _c2.focus(); - } - } else { - (_d2 = keyInputRefs.current[detail.itemIndex - 1]) === null || _d2 === void 0 ? void 0 : _d2.focus(); - } - } else { - (_e2 = attributeEditorRef.current) === null || _e2 === void 0 ? void 0 : _e2.focusAddButton(); - } - } - }); - const onKeyChange = useStableCallback((value, row) => { - keyDirtyStateRef.current[row] = true; - validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { key: value }), ...tags.slice(row + 1)]); - }); - const onKeyBlur = useStableCallback((row) => { - keyDirtyStateRef.current[row] = true; - validateAndFire([...tags]); - }); - const onValueChange = useStableCallback((value, row) => { - validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { value }), ...tags.slice(row + 1)]); - }); - const onUndoRemoval = useStableCallback((row) => { - validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { markedForRemoval: false }), ...tags.slice(row + 1)]); - focusEventRef.current = () => { - var _a3; - (_a3 = attributeEditorRef.current) === null || _a3 === void 0 ? void 0 : _a3.focusRemoveButton(row); - }; - }); - const definition = (0, import_react416.useMemo)(() => [ - { - label: i18n("i18nStrings.keyHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keyHeader), - control: ({ tag }, row) => import_react416.default.createElement(TagControl, { row, value: tag.key, readOnly: tag.existing, limit: 200, defaultOptions: [], placeholder: i18n("i18nStrings.keyPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keyPlaceholder), errorText: i18n("i18nStrings.keysSuggestionError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keysSuggestionError), loadingText: i18n("i18nStrings.keysSuggestionLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keysSuggestionLoading), suggestionText: i18n("i18nStrings.keySuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keySuggestion), tooManySuggestionText: i18n("i18nStrings.tooManyKeysSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tooManyKeysSuggestion), enteredTextLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.enteredKeyLabel, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearAriaLabel, onRequest: keysRequest, onChange: onKeyChange, onBlur: onKeyBlur, initialOptionsRef: initialKeyOptionsRef, ref: (ref2) => { - keyInputRefs.current[row] = ref2; - } }), - errorText: ({ error }) => error === null || error === void 0 ? void 0 : error.key - }, - { - label: import_react416.default.createElement( - import_react416.default.Fragment, - null, - i18n("i18nStrings.valueHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valueHeader), - " -", - " ", - import_react416.default.createElement("i", null, i18n("i18nStrings.optional", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.optional)) - ), - control: ({ tag }, row) => { - var _a3; - return tag.markedForRemoval ? import_react416.default.createElement( - "div", - { role: "alert" }, - import_react416.default.createElement( - InternalBox, - { margin: { top: "xxs" } }, - i18n("i18nStrings.undoPrompt", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.undoPrompt), - " ", - import_react416.default.createElement(UndoButton, { onClick: () => onUndoRemoval(row), ref: (elem) => { - undoButtonRefs.current[row] = elem; - } }, i18n("i18nStrings.undoButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.undoButton)) - ) - ) : import_react416.default.createElement(TagControl, { row, value: tag.value, readOnly: false, limit: 200, defaultOptions: (_a3 = tag.valueSuggestionOptions) !== null && _a3 !== void 0 ? _a3 : [], placeholder: i18n("i18nStrings.valuePlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuePlaceholder), errorText: i18n("i18nStrings.valuesSuggestionError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuesSuggestionError), loadingText: i18n("i18nStrings.valuesSuggestionLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuesSuggestionLoading), suggestionText: i18n("i18nStrings.valueSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valueSuggestion), tooManySuggestionText: i18n("i18nStrings.tooManyValuesSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tooManyValuesSuggestion), enteredTextLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.enteredValueLabel, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearAriaLabel, filteringKey: tag.key, onRequest: valuesRequest && ((value) => valuesRequest(tag.key, value)), onChange: onValueChange, ref: (ref2) => { - valueInputRefs.current[row] = ref2; - } }); - }, - errorText: ({ error }) => error === null || error === void 0 ? void 0 : error.value - } - ], [i18n, i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]); - const forwardedI18nStrings = (0, import_react416.useMemo)(() => ({ - errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel, - itemRemovedAriaLive: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive, - removeButtonAriaLabel: i18n("i18nStrings.removeButtonAriaLabel", (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButtonAriaLabel) && (({ tag }) => i18nStrings.removeButtonAriaLabel(tag)), (format3) => ({ tag }) => format3({ tag__key: tag.key })) - }), [i18nStrings, i18n]); - if (loading) { - return import_react416.default.createElement( - "div", - { className: styles_css_default122.root, ref: baseComponentProps.__internalRootRef }, - import_react416.default.createElement( - StatusIndicator, - { className: styles_css_default122.loading, type: "loading" }, - import_react416.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loading)) - ) - ); - } - const baseProps = getBaseProps(restProps); - return import_react416.default.createElement(internal_default9, Object.assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx_m_default(styles_css_default122.root, baseProps.className), items: internalTags, isItemRemovable, onAddButtonClick, onRemoveButtonClick, addButtonText: (_b = i18n("i18nStrings.addButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.addButton)) !== null && _b !== void 0 ? _b : "", removeButtonText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18n("i18nStrings.emptyTags", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyTags), additionalInfo: remainingTags < 0 ? import_react416.default.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, (_d = i18n("i18nStrings.tagLimitExceeded", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitExceeded) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, tagLimit), (format3) => format3({ tagLimit }))) !== null && _d !== void 0 ? _d : "") : remainingTags === 0 ? (_f = i18n("i18nStrings.tagLimitReached", (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitReached) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, tagLimit), (format3) => format3({ tagLimit }))) !== null && _f !== void 0 ? _f : "" : i18n("i18nStrings.tagLimit", (_g = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimit) === null || _g === void 0 ? void 0 : _g.call(i18nStrings, remainingTags, tagLimit), (format3) => format3({ tagLimitAvailable: `${remainingTags === tagLimit}`, availableTags: remainingTags, tagLimit })), definition, i18nStrings: forwardedI18nStrings })); -}); -applyDisplayName(TagEditor, "TagEditor"); -var tag_editor_default = TagEditor; - -// node_modules/@cloudscape-design/components/text-content/index.js -var import_react417 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/text-content/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/text-content/styles.scoped.css"; -var styles_css_default123 = { - "text-content": "awsui_text-content_6absk_1rcdq_100" -}; - -// node_modules/@cloudscape-design/components/text-content/index.js -function TextContent(_a2) { - var { children: children2 } = _a2, props2 = __rest(_a2, ["children"]); - const { __internalRootRef } = useBaseComponent("TextContent"); - const baseProps = getBaseProps(props2); - const className2 = clsx_m_default(baseProps.className, styles_css_default123["text-content"]); - return import_react417.default.createElement("div", Object.assign({}, baseProps, { className: className2, ref: __internalRootRef }), children2); -} -applyDisplayName(TextContent, "TextContent"); - -// node_modules/@cloudscape-design/components/text-filter/index.js -var import_react418 = __toESM(require_react()); -var TextFilter = import_react418.default.forwardRef((props2, ref) => { - const baseComponentProps = useBaseComponent("TextFilter"); - return import_react418.default.createElement(internal_default20, Object.assign({}, props2, baseComponentProps, { ref })); -}); -applyDisplayName(TextFilter, "TextFilter"); -var text_filter_default = TextFilter; - -// node_modules/@cloudscape-design/components/textarea/index.js -var import_react419 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/textarea/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/textarea/styles.scoped.css"; -var styles_css_default124 = { - "root": "awsui_root_qk1j1_w6j53_99", - "textarea": "awsui_textarea_qk1j1_w6j53_103", - "textarea-readonly": "awsui_textarea-readonly_qk1j1_w6j53_156", - "textarea-invalid": "awsui_textarea-invalid_qk1j1_w6j53_198" -}; - -// node_modules/@cloudscape-design/components/textarea/index.js -var Textarea = import_react419.default.forwardRef((_a2, ref) => { - var { value, autoComplete = true, disabled, readOnly, disableBrowserAutocorrect, disableBrowserSpellcheck, spellcheck, onKeyDown, onKeyUp, onChange, onBlur, onFocus, ariaRequired, name, rows, placeholder, autoFocus, ariaLabel } = _a2, rest = __rest(_a2, ["value", "autoComplete", "disabled", "readOnly", "disableBrowserAutocorrect", "disableBrowserSpellcheck", "spellcheck", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "rows", "placeholder", "autoFocus", "ariaLabel"]); - const { __internalRootRef } = useBaseComponent("Textarea", { - props: { autoComplete, autoFocus, disableBrowserAutocorrect, disableBrowserSpellcheck, readOnly, spellcheck } - }); - const { ariaLabelledby, ariaDescribedby, controlId, invalid } = useFormFieldContext(rest); - const baseProps = getBaseProps(rest); - const textareaRef = (0, import_react419.useRef)(null); - useForwardFocus(ref, textareaRef); - const attributes = { - "aria-label": ariaLabel, - "aria-labelledby": ariaLabelledby, - "aria-describedby": ariaDescribedby, - "aria-required": ariaRequired ? "true" : void 0, - "aria-invalid": invalid ? "true" : void 0, - name, - placeholder, - autoFocus, - className: clsx_m_default(styles_css_default124.textarea, { - [styles_css_default124["textarea-readonly"]]: readOnly, - [styles_css_default124["textarea-invalid"]]: invalid - }), - autoComplete: convertAutoComplete(autoComplete), - spellCheck: spellcheck, - disabled, - readOnly: readOnly ? true : void 0, - rows: rows || 3, - onKeyDown: onKeyDown && ((event) => fireKeyboardEvent(onKeyDown, event)), - onKeyUp: onKeyUp && ((event) => fireKeyboardEvent(onKeyUp, event)), - // We set a default value on the component in order to force it into the controlled mode. - value: value || "", - onChange: onChange && ((event) => fireNonCancelableEvent(onChange, { value: event.target.value })), - onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)), - onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)) - }; - if (disableBrowserAutocorrect) { - attributes.autoCorrect = "off"; - attributes.autoCapitalize = "off"; - } - if (disableBrowserSpellcheck) { - attributes.spellCheck = "false"; - } - return import_react419.default.createElement( - "span", - Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default124.root, baseProps.className), ref: __internalRootRef }), - import_react419.default.createElement("textarea", Object.assign({ ref: textareaRef, id: controlId }, attributes)) - ); -}); -applyDisplayName(Textarea, "Textarea"); -var textarea_default = Textarea; - -// node_modules/@cloudscape-design/components/tiles/index.js -var import_react420 = __toESM(require_react()); -var Tiles = import_react420.default.forwardRef((props2, ref) => { - const baseComponentProps = useBaseComponent("Tiles", { - props: { columns: props2.columns } - }); - return import_react420.default.createElement(internal_default21, Object.assign({ ref }, props2, baseComponentProps)); -}); -applyDisplayName(Tiles, "Tiles"); -var tiles_default = Tiles; - -// node_modules/@cloudscape-design/components/time-input/index.js -var import_react421 = __toESM(require_react()); -var TimeInput = import_react421.default.forwardRef((_a2, ref) => { - var { format: format3 = "hh:mm:ss", use24Hour = true, autoComplete = true } = _a2, props2 = __rest(_a2, ["format", "use24Hour", "autoComplete"]); - const baseComponentProps = useBaseComponent("TimeInput", { - props: { - autoFocus: props2.autoFocus, - disableBrowserAutocorrect: props2.disableBrowserAutocorrect, - format: format3, - readOnly: props2.readOnly, - use24Hour - } - }); - return import_react421.default.createElement(internal_default17, Object.assign({ format: format3, use24Hour, autoComplete }, props2, baseComponentProps, { ref })); -}); -applyDisplayName(TimeInput, "TimeInput"); -var time_input_default = TimeInput; - -// node_modules/@cloudscape-design/components/toggle/index.js -var import_react422 = __toESM(require_react()); -var Toggle = import_react422.default.forwardRef((props2, ref) => { - const baseComponentProps = useBaseComponent("Toggle"); - return import_react422.default.createElement(internal_default14, Object.assign({}, props2, baseComponentProps, { ref })); -}); -applyDisplayName(Toggle, "Toggle"); -var toggle_default = Toggle; - -// node_modules/@cloudscape-design/components/token-group/index.js -var import_react423 = __toESM(require_react()); -function TokenGroup(_a2) { - var { items = [], alignment = "horizontal" } = _a2, props2 = __rest(_a2, ["items", "alignment"]); - const baseComponentProps = useBaseComponent("TokenGroup", { - props: { alignment, disableOuterPadding: props2.disableOuterPadding, limit: props2.limit } - }); - return import_react423.default.createElement(InternalTokenGroup, Object.assign({ items, alignment }, props2, baseComponentProps)); -} -applyDisplayName(TokenGroup, "TokenGroup"); - -// node_modules/@cloudscape-design/components/top-navigation/index.js -var import_react434 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/top-navigation/internal.js -var import_react433 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/top-navigation/use-top-navigation.js -var import_react424 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/top-navigation/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/top-navigation/styles.scoped.css"; -var styles_css_default125 = { - "icon": "awsui_icon_k5dlb_d6w6r_99", - "top-navigation": "awsui_top-navigation_k5dlb_d6w6r_117", - "padding-box": "awsui_padding-box_k5dlb_d6w6r_152", - "medium": "awsui_medium_k5dlb_d6w6r_162", - "narrow": "awsui_narrow_k5dlb_d6w6r_162", - "virtual": "awsui_virtual_k5dlb_d6w6r_173", - "hidden": "awsui_hidden_k5dlb_d6w6r_177", - " ": "awsui_ _k5dlb_d6w6r_1", - "identity": "awsui_identity_k5dlb_d6w6r_189", - "identity-link": "awsui_identity-link_k5dlb_d6w6r_192", - "no-logo": "awsui_no-logo_k5dlb_d6w6r_212", - "logo": "awsui_logo_k5dlb_d6w6r_216", - "title": "awsui_title_k5dlb_d6w6r_228", - "inputs": "awsui_inputs_k5dlb_d6w6r_243", - "search": "awsui_search_k5dlb_d6w6r_251", - "search-expanded": "awsui_search-expanded_k5dlb_d6w6r_255", - "utilities": "awsui_utilities_k5dlb_d6w6r_259", - "utility-wrapper": "awsui_utility-wrapper_k5dlb_d6w6r_270", - "utility-type-button-link": "awsui_utility-type-button-link_k5dlb_d6w6r_291", - "utility-type-menu-dropdown": "awsui_utility-type-menu-dropdown_k5dlb_d6w6r_296", - "utility-type-button-primary-button": "awsui_utility-type-button-primary-button_k5dlb_d6w6r_305", - "utility-link-icon": "awsui_utility-link-icon_k5dlb_d6w6r_313", - "utility-button-external-icon": "awsui_utility-button-external-icon_k5dlb_d6w6r_317", - "offset-right-none": "awsui_offset-right-none_k5dlb_d6w6r_321", - "offset-right-l": "awsui_offset-right-l_k5dlb_d6w6r_325", - "offset-right-xxl": "awsui_offset-right-xxl_k5dlb_d6w6r_329", - "overflow-menu-drawer": "awsui_overflow-menu-drawer_k5dlb_d6w6r_334", - "overflow-menu": "awsui_overflow-menu_k5dlb_d6w6r_334", - "overflow-menu-header": "awsui_overflow-menu-header_k5dlb_d6w6r_378", - "overflow-menu-header-text": "awsui_overflow-menu-header-text_k5dlb_d6w6r_386", - "overflow-menu-header-text--secondary": "awsui_overflow-menu-header-text--secondary_k5dlb_d6w6r_398", - "overflow-menu-header-text--title": "awsui_overflow-menu-header-text--title_k5dlb_d6w6r_404", - "overflow-menu-back-button": "awsui_overflow-menu-back-button_k5dlb_d6w6r_408", - "overflow-menu-dismiss-button": "awsui_overflow-menu-dismiss-button_k5dlb_d6w6r_412", - "overflow-menu-control": "awsui_overflow-menu-control_k5dlb_d6w6r_416", - "overflow-menu-list-item-utility": "awsui_overflow-menu-list-item-utility_k5dlb_d6w6r_457", - "overflow-menu-control-link": "awsui_overflow-menu-control-link_k5dlb_d6w6r_465", - "overflow-menu-control-expandable-menu-trigger": "awsui_overflow-menu-control-expandable-menu-trigger_k5dlb_d6w6r_468", - "overflow-menu-list": "awsui_overflow-menu-list_k5dlb_d6w6r_457", - "overflow-menu-list-submenu": "awsui_overflow-menu-list-submenu_k5dlb_d6w6r_504", - "overflow-menu-list-item": "awsui_overflow-menu-list-item_k5dlb_d6w6r_457", - "overflow-menu-list-item-icon": "awsui_overflow-menu-list-item-icon_k5dlb_d6w6r_513", - "overflow-menu-list-item-text": "awsui_overflow-menu-list-item-text_k5dlb_d6w6r_516", - "overflow-menu-list-item-submenu": "awsui_overflow-menu-list-item-submenu_k5dlb_d6w6r_525", - "overflow-menu-list-item-dropdown-menu": "awsui_overflow-menu-list-item-dropdown-menu_k5dlb_d6w6r_531", - "overflow-menu-list-item-expandable": "awsui_overflow-menu-list-item-expandable_k5dlb_d6w6r_535", - "expanded": "awsui_expanded_k5dlb_d6w6r_543" -}; - -// node_modules/@cloudscape-design/components/top-navigation/use-top-navigation.js -var RESPONSIVENESS_BUFFER = 20; -function useTopNavigation({ identity: identity2, search, utilities }) { - const mainRef = (0, import_react424.useRef)(null); - const virtualRef = (0, import_react424.useRef)(null); - const [breakpoint, breakpointRef] = useContainerBreakpoints(["xxs", "s"]); - const hasSearch = !!search; - const hasTitleWithLogo = identity2 && !!identity2.logo && !!identity2.title; - const responsiveStates = (0, import_react424.useMemo)(() => { - return generateResponsiveStateKeys(utilities, hasSearch, hasTitleWithLogo); - }, [utilities, hasSearch, hasTitleWithLogo]); - const [responsiveState, setResponsiveState] = (0, import_react424.useState)(); - const recalculateFit = (0, import_react424.useCallback)(() => { - var _a2, _b, _c, _d; - if (!(mainRef === null || mainRef === void 0 ? void 0 : mainRef.current) || !virtualRef.current) { - setResponsiveState(responsiveStates[0]); - return; - } - const availableWidth = getContentBoxWidth(mainRef.current.querySelector(`.${styles_css_default125["padding-box"]}`)); - if (availableWidth === 0) { - setResponsiveState(responsiveStates[0]); - return; - } - const sizeConfiguration = { - hasSearch, - availableWidth, - // Get widths from the hidden top navigation - fullIdentityWidth: virtualRef.current.querySelector(`.${styles_css_default125.identity}`).getBoundingClientRect().width, - titleWidth: (_b = (_a2 = virtualRef.current.querySelector(`.${styles_css_default125.title}`)) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 0, - searchSlotWidth: (_d = (_c = virtualRef.current.querySelector(`.${styles_css_default125.search}`)) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().width) !== null && _d !== void 0 ? _d : 0, - searchUtilityWidth: virtualRef.current.querySelector('[data-utility-special="search"]').getBoundingClientRect().width, - utilitiesLeftPadding: parseFloat(getComputedStyle(virtualRef.current.querySelector(`.${styles_css_default125.utilities}`)).paddingLeft || "0px"), - utilityWithLabelWidths: Array.prototype.slice.call(virtualRef.current.querySelectorAll(`[data-utility-hide="false"]`)).map((element) => element.getBoundingClientRect().width), - utilityWithoutLabelWidths: Array.prototype.slice.call(virtualRef.current.querySelectorAll(`[data-utility-hide="true"]`)).map((element) => element.getBoundingClientRect().width), - menuTriggerUtilityWidth: virtualRef.current.querySelector('[data-utility-special="menu-trigger"]').getBoundingClientRect().width - }; - setResponsiveState(determineBestResponsiveState(responsiveStates, sizeConfiguration)); - }, [responsiveStates, hasSearch]); - const [, containerQueryRef] = useContainerQuery(() => { - recalculateFit(); - }, [recalculateFit]); - const onVirtualMount = (0, import_react424.useCallback)((element) => { - virtualRef.current = element; - recalculateFit(); - }, [recalculateFit]); - const [isSearchMinimized, setSearchMinimized] = (0, import_react424.useState)(true); - const isSearchExpanded = !isSearchMinimized && hasSearch && (responsiveState === null || responsiveState === void 0 ? void 0 : responsiveState.hideSearch); - (0, import_react424.useEffect)(() => { - if (!(responsiveState === null || responsiveState === void 0 ? void 0 : responsiveState.hideSearch)) { - setSearchMinimized(true); - } - }, [responsiveState]); - (0, import_react424.useEffect)(() => { - var _a2, _b; - if (isSearchExpanded) { - (_b = (_a2 = mainRef === null || mainRef === void 0 ? void 0 : mainRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`.${styles_css_default125.search} input`)) === null || _b === void 0 ? void 0 : _b.focus(); - } - }, [isSearchExpanded, mainRef]); - const mergedMainRef = useMergeRefs(mainRef, containerQueryRef, breakpointRef); - return { - mainRef: mergedMainRef, - virtualRef: onVirtualMount, - responsiveState: responsiveState !== null && responsiveState !== void 0 ? responsiveState : responsiveStates[0], - breakpoint: breakpoint !== null && breakpoint !== void 0 ? breakpoint : "default", - isSearchExpanded: !!isSearchExpanded, - onSearchUtilityClick: () => setSearchMinimized((isSearchMinimized2) => !isSearchMinimized2) - }; -} -function getContentBoxWidth(element) { - const style = getComputedStyle(element); - return parseFloat(style.width || "0px") - parseFloat(style.paddingLeft || "0px") - parseFloat(style.paddingRight || "0px"); -} -function generateResponsiveStateKeys(utilities, canHideSearch, canHideTitle) { - const states = [{}]; - if (utilities.some((utility) => utility.text)) { - states.push({ hideUtilityText: true }); - } - if (canHideSearch) { - states.push({ - hideUtilityText: true, - hideSearch: true - }); - } - const hiddenUtilties = []; - for (let i = 0; i < utilities.length; i++) { - if (!utilities[i].disableUtilityCollapse) { - hiddenUtilties.push(i); - states.push({ - hideUtilityText: true, - hideSearch: canHideSearch || void 0, - hideUtilities: hiddenUtilties.length > 0 ? hiddenUtilties.slice() : void 0 - }); - } - } - if (canHideTitle) { - states.push({ - hideUtilityText: true, - hideSearch: canHideSearch || void 0, - hideUtilities: hiddenUtilties.length > 0 ? hiddenUtilties.slice() : void 0, - hideTitle: true - }); - } - return states; -} -function determineBestResponsiveState(possibleStates, sizes) { - const { hasSearch, availableWidth, utilitiesLeftPadding, fullIdentityWidth, titleWidth, searchSlotWidth, searchUtilityWidth, utilityWithLabelWidths, utilityWithoutLabelWidths, menuTriggerUtilityWidth } = sizes; - for (const state of possibleStates) { - const searchWidth = hasSearch ? state.hideSearch ? searchUtilityWidth : searchSlotWidth : 0; - const utilitiesWidth = (state.hideUtilityText ? utilityWithoutLabelWidths : utilityWithLabelWidths).filter((_width, i) => !state.hideUtilities || state.hideUtilities.indexOf(i) === -1).reduce((sum2, width) => sum2 + width, 0); - const menuTriggerWidth = state.hideUtilities ? menuTriggerUtilityWidth : 0; - const identityWidth = state.hideTitle ? fullIdentityWidth - titleWidth : fullIdentityWidth; - const expectedInnerWidth = identityWidth + searchWidth + utilitiesLeftPadding + utilitiesWidth + menuTriggerWidth; - if (expectedInnerWidth <= availableWidth - RESPONSIVENESS_BUFFER) { - return state; - } - } - return possibleStates[possibleStates.length - 1]; -} - -// node_modules/@cloudscape-design/components/top-navigation/parts/utility.js -var import_react426 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/index.js -var import_react425 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/internal/components/menu-dropdown/styles.scoped.css"; -var styles_css_default126 = { - "button": "awsui_button_m5h9f_1s7lt_99", - "expanded": "awsui_expanded_m5h9f_1s7lt_154", - "offset-right-none": "awsui_offset-right-none_m5h9f_1s7lt_165", - "offset-right-l": "awsui_offset-right-l_m5h9f_1s7lt_168", - "offset-right-xxl": "awsui_offset-right-xxl_m5h9f_1s7lt_171", - "text": "awsui_text_m5h9f_1s7lt_196", - "icon": "awsui_icon_m5h9f_1s7lt_200" -}; - -// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/index.js -var ButtonTrigger2 = import_react425.default.forwardRef(({ testUtilsClass, iconName, iconUrl, iconAlt, iconSvg, badge, ariaLabel, offsetRight, disabled, expanded, children: children2, onClick }, ref) => { - const hasIcon = iconName || iconUrl || iconSvg; - return import_react425.default.createElement( - "button", - { ref, type: "button", className: clsx_m_default(styles_css_default126.button, styles_css_default126[`offset-right-${offsetRight}`], testUtilsClass, { - [styles_css_default126.expanded]: expanded - }), "aria-label": ariaLabel, "aria-expanded": !!expanded, "aria-haspopup": true, disabled, onClick: (event) => { - event.preventDefault(); - onClick && onClick(); - } }, - hasIcon && import_react425.default.createElement(internal_default, { className: styles_css_default126.icon, name: iconName, url: iconUrl, alt: iconAlt, svg: iconSvg, badge }), - children2 && import_react425.default.createElement("span", { className: styles_css_default126.text }, children2), - children2 && import_react425.default.createElement(internal_default, { name: "caret-down-filled", className: expanded ? styles_css_default16["rotate-up"] : styles_css_default16["rotate-down"] }) - ); -}); -var MenuDropdown = (_a2) => { - var { iconName, iconUrl, iconAlt, iconSvg, badge, offsetRight, children: children2 } = _a2, props2 = __rest(_a2, ["iconName", "iconUrl", "iconAlt", "iconSvg", "badge", "offsetRight", "children"]); - const baseProps = getBaseProps(props2); - const dropdownTrigger = ({ triggerRef, ariaLabel, isOpen, testUtilsClass, disabled, onClick }) => { - return import_react425.default.createElement(ButtonTrigger2, { testUtilsClass, ref: triggerRef, disabled, expanded: isOpen, iconName, iconUrl, iconAlt, iconSvg, badge, ariaLabel, offsetRight, onClick }, children2); - }; - return import_react425.default.createElement(internal_default4, Object.assign({}, baseProps, props2, { variant: "navigation", customTriggerBuilder: dropdownTrigger, preferCenter: true })); -}; -applyDisplayName(MenuDropdown, "MenuDropdown"); -var menu_dropdown_default = MenuDropdown; - -// node_modules/@cloudscape-design/components/top-navigation/parts/utility.js -function Utility({ hideText, definition, offsetRight }) { - var _a2; - const hasIcon = !!definition.iconName || !!definition.iconUrl || !!definition.iconAlt || !!definition.iconSvg; - const shouldHideText = hideText && !definition.disableTextCollapse && hasIcon; - let ariaLabel = (_a2 = definition.ariaLabel) !== null && _a2 !== void 0 ? _a2 : definition.text; - if (definition.type === "button") { - ariaLabel = definition.ariaLabel ? definition.ariaLabel : joinStrings(definition.text, definition.externalIconAriaLabel); - checkSafeUrl("TopNavigation", definition.href); - if (definition.variant === "primary-button") { - return import_react426.default.createElement( - "span", - { className: styles_css_default125[`offset-right-${offsetRight}`] }, - import_react426.default.createElement(InternalButton, { variant: "primary", href: definition.href, target: definition.external ? "_blank" : void 0, onClick: definition.onClick, onFollow: definition.onFollow, ariaLabel, iconName: definition.iconName, iconUrl: definition.iconUrl, iconAlt: definition.iconAlt, iconSvg: definition.iconSvg }, shouldHideText ? null : import_react426.default.createElement( - import_react426.default.Fragment, - null, - definition.text, - definition.external && import_react426.default.createElement( - import_react426.default.Fragment, - null, - " ", - import_react426.default.createElement( - "span", - { className: clsx_m_default(styles_css_default125["utility-button-external-icon"], styles_css_default125[`offset-right-${offsetRight}`]), "aria-label": definition.externalIconAriaLabel, role: definition.externalIconAriaLabel ? "img" : void 0 }, - import_react426.default.createElement(internal_default, { name: "external" }) - ) - ) - )) - ); - } else { - return import_react426.default.createElement( - "span", - { className: styles_css_default125[`offset-right-${offsetRight}`] }, - import_react426.default.createElement( - internal_default5, - { variant: "top-navigation", href: definition.href, target: definition.target, rel: definition.rel, external: definition.external, onFollow: (evt) => { - fireCancelableEvent(definition.onFollow, { href: definition.href, target: definition.target, external: definition.external }, evt); - fireCancelableEvent(definition.onClick, { href: definition.href, target: definition.target, external: definition.external }, evt); - }, ariaLabel }, - hasIcon && import_react426.default.createElement(internal_default, { name: definition.iconName, url: definition.iconUrl, alt: definition.iconAlt, svg: definition.iconSvg, badge: definition.badge }), - !shouldHideText && definition.text && import_react426.default.createElement("span", { className: hasIcon ? styles_css_default125["utility-link-icon"] : void 0 }, definition.text) - ) - ); - } - } else if (definition.type === "menu-dropdown") { - const title = definition.title || definition.text; - const shouldShowTitle = shouldHideText || !definition.text; - checkSafeUrlRecursively(definition.items); - return import_react426.default.createElement(menu_dropdown_default, Object.assign({}, definition, { title: shouldShowTitle ? title : "", ariaLabel, offsetRight }), !shouldHideText && definition.text); - } - return null; -} -function checkSafeUrlRecursively(itemOrGroup) { - for (const item of itemOrGroup) { - checkSafeUrl("TopNavigation", item.href); - if ("items" in item) { - checkSafeUrlRecursively(item.items); - } - } -} - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/index.js -var import_react432 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/router.js -var import_react427 = __toESM(require_react()); -var defaultCtx = { state: { view: "utilities", data: null }, setState: () => { -} }; -var ViewContext = (0, import_react427.createContext)(defaultCtx); -var useNavigate = () => { - const { setState } = (0, import_react427.useContext)(ViewContext); - const navigate = (view, data) => { - setState({ view, data }); - }; - return navigate; -}; -var Route = ({ view, element }) => { - const { state } = (0, import_react427.useContext)(ViewContext); - if (view === state.view) { - if (typeof element === "function") { - return element(state.data); - } - return import_react427.default.createElement(import_react427.default.Fragment, null, element); - } - return null; -}; -var Router = ({ children: children2 }) => { - const [state, setState] = (0, import_react427.useState)({ view: "utilities", data: null }); - return import_react427.default.createElement(ViewContext.Provider, { value: { state, setState } }, children2); -}; -var router_default = Router; - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/utilities.js -var import_react430 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/header.js -var import_react428 = __toESM(require_react()); -var Header4 = ({ children: children2, secondaryText, backIconAriaLabel, dismissIconAriaLabel, onBack, onClose }) => { - return import_react428.default.createElement( - "div", - { className: styles_css_default125["overflow-menu-header"] }, - onBack && import_react428.default.createElement( - internal_default2, - { - // Used for test-utils, which require the selectable element to have a classname. - // eslint-disable-next-line react/forbid-component-props - className: styles_css_default125["overflow-menu-back-button"], - ariaLabel: backIconAriaLabel, - iconName: "angle-left", - variant: "icon", - onClick: () => onBack() - } - ), - import_react428.default.createElement( - "h2", - { className: styles_css_default125["overflow-menu-header-text"] }, - import_react428.default.createElement("div", { className: styles_css_default125["overflow-menu-header-text--title"] }, children2), - secondaryText && import_react428.default.createElement("div", { className: styles_css_default125["overflow-menu-header-text--secondary"] }, secondaryText) - ), - import_react428.default.createElement( - internal_default2, - { - // eslint-disable-next-line react/forbid-component-props - className: styles_css_default125["overflow-menu-dismiss-button"], - ariaLabel: dismissIconAriaLabel, - iconName: "close", - variant: "icon", - onClick: () => onClose && onClose() - } - ) - ); -}; -var header_default2 = Header4; - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/menu-item.js -var import_react429 = __toESM(require_react()); -var ListItem = ({ children: children2, startIcon, endIcon }) => { - return import_react429.default.createElement( - import_react429.default.Fragment, - null, - startIcon && import_react429.default.createElement("span", { className: styles_css_default125["overflow-menu-list-item-icon"] }, startIcon), - import_react429.default.createElement("span", { className: styles_css_default125["overflow-menu-list-item-text"] }, children2), - endIcon && endIcon - ); -}; -var LinkItem = (0, import_react429.forwardRef)(({ children: children2, external, href, target, rel, startIcon, endIcon, onClick, context, testId }, ref) => { - const anchorTarget = target !== null && target !== void 0 ? target : external ? "_blank" : void 0; - const anchorRel = rel !== null && rel !== void 0 ? rel : anchorTarget === "_blank" ? "noopener noreferrer" : void 0; - const role = !href ? "button" : void 0; - return import_react429.default.createElement( - "a", - Object.assign({ ref, onClick, className: clsx_m_default(styles_css_default125["overflow-menu-control"], styles_css_default125["overflow-menu-control-link"], context && styles_css_default125[`overflow-menu-control-${context}`]), role, tabIndex: 0, href, target: anchorTarget, rel: anchorRel }, testId ? { "data-testid": testId } : {}), - import_react429.default.createElement(ListItem, { startIcon, endIcon }, children2) - ); -}); -var ButtonItem = (0, import_react429.forwardRef)(({ children: children2, startIcon, endIcon, onClick, testId }, ref) => { - return import_react429.default.createElement( - "button", - Object.assign({ ref, className: styles_css_default125["overflow-menu-control"], onClick }, typeof testId === "string" ? { "data-testid": testId } : {}), - import_react429.default.createElement(ListItem, { startIcon, endIcon }, children2) - ); -}); -var NavigationItem = (0, import_react429.forwardRef)((_a2, ref) => { - var { startIcon, children: children2, index, testId } = _a2, definition = __rest(_a2, ["startIcon", "children", "index", "testId"]); - const navigate = useNavigate(); - return import_react429.default.createElement(ButtonItem, { ref, startIcon, endIcon: import_react429.default.createElement(internal_default, { name: "angle-right" }), testId, onClick: () => navigate("dropdown-menu", { - definition, - headerText: definition.text || definition.title, - headerSecondaryText: definition.description, - utilityIndex: index - }) }, children2); -}); -var ExpandableItem = (_a2) => { - var { children: children2, onItemClick } = _a2, definition = __rest(_a2, ["children", "onItemClick"]); - const [expanded, setExpanded] = (0, import_react429.useState)(false); - const headerId = useUniqueId("overflow-menu-item"); - return import_react429.default.createElement( - import_react429.default.Fragment, - null, - import_react429.default.createElement( - "button", - { className: clsx_m_default(styles_css_default125["overflow-menu-control"], styles_css_default125["overflow-menu-control-expandable-menu-trigger"]), onClick: () => setExpanded((value) => !value), "aria-expanded": expanded }, - import_react429.default.createElement( - ListItem, - { endIcon: import_react429.default.createElement( - "span", - { className: clsx_m_default(styles_css_default125.icon, expanded && styles_css_default125.expanded) }, - import_react429.default.createElement(internal_default, { name: "caret-up-filled" }) - ) }, - import_react429.default.createElement("span", { id: headerId }, children2) - ) - ), - expanded && import_react429.default.createElement("ul", { className: clsx_m_default(styles_css_default125["overflow-menu-list"], styles_css_default125["overflow-menu-list-submenu"]), "aria-labelledby": headerId }, definition.items.map((item, index) => { - const isGroup5 = typeof item.items !== "undefined"; - return import_react429.default.createElement("li", { key: index, className: clsx_m_default(styles_css_default125[`overflow-menu-list-item`], styles_css_default125[`overflow-menu-list-item-dropdown-menu`]) }, dropdownComponentFactory(item, isGroup5, onItemClick)); - })) - ); -}; -function utilityComponentFactory(utility, index, ref) { - const label = utility.text || utility.title; - const hasIcon = !!utility.iconName || !!utility.iconUrl || !!utility.iconAlt || !!utility.iconSvg; - const startIcon = hasIcon && import_react429.default.createElement(internal_default, { name: utility.iconName, url: utility.iconUrl, alt: utility.iconAlt, svg: utility.iconSvg }); - switch (utility.type) { - case "button": { - const handleClick = (event) => { - var _a2; - if (Boolean(utility.href) && isPlainLeftClick(event)) { - fireCancelableEvent(utility.onFollow, { href: utility.href, target: utility.target }, event); - } - fireCancelableEvent(utility.onClick, {}, event); - (_a2 = utility.onClose) === null || _a2 === void 0 ? void 0 : _a2.call(utility); - }; - const content = import_react429.default.createElement( - import_react429.default.Fragment, - null, - label, - utility.external && import_react429.default.createElement( - import_react429.default.Fragment, - null, - " ", - import_react429.default.createElement( - "span", - { "aria-label": utility.externalIconAriaLabel, role: utility.externalIconAriaLabel ? "img" : void 0 }, - import_react429.default.createElement(internal_default, { name: "external", size: "normal" }) - ) - ) - ); - if (!utility.href) { - return import_react429.default.createElement(ButtonItem, { ref, startIcon, onClick: handleClick, testId: `__${index}` }, content); - } - return import_react429.default.createElement(LinkItem, { ref, startIcon, href: utility.href, external: utility.external, target: utility.target, rel: utility.rel, testId: `__${index}`, onClick: handleClick }, content); - } - case "menu-dropdown": { - return import_react429.default.createElement(NavigationItem, Object.assign({ ref, startIcon, index }, utility, { testId: `__${index}` }), label); - } - } -} -function dropdownComponentFactory(item, expandable, onItemClick) { - const label = item.text; - const hasIcon = !!item.iconName || !!item.iconUrl || !!item.iconAlt || !!item.iconSvg; - const startIcon = hasIcon && import_react429.default.createElement(internal_default, { name: item.iconName, url: item.iconUrl, alt: item.iconAlt, svg: item.iconSvg }); - if (expandable) { - return import_react429.default.createElement(ExpandableItem, Object.assign({}, item, { onItemClick }), label); - } - return import_react429.default.createElement( - LinkItem, - { startIcon, href: item.href, external: item.external, context: "dropdown-menu", testId: item.id, onClick: (event) => onItemClick(event, item) }, - label, - item.external && import_react429.default.createElement( - import_react429.default.Fragment, - null, - " ", - import_react429.default.createElement( - "span", - { "aria-label": item.externalIconAriaLabel, role: item.externalIconAriaLabel ? "img" : void 0 }, - import_react429.default.createElement(internal_default, { name: "external", size: "normal" }) - ) - ) - ); -} -var UtilityMenuItem = (0, import_react429.forwardRef)((_a2, ref) => { - var { index } = _a2, props2 = __rest(_a2, ["index"]); - return import_react429.default.createElement("li", { className: clsx_m_default(styles_css_default125[`overflow-menu-list-item`], styles_css_default125[`overflow-menu-list-item-utility`]) }, utilityComponentFactory(props2, index, ref)); -}); -var SubmenuItem = (props2) => { - const expandable = typeof props2.items !== "undefined"; - return import_react429.default.createElement("li", { className: clsx_m_default(styles_css_default125[`overflow-menu-list-item`], styles_css_default125[`overflow-menu-list-item-submenu`], expandable && styles_css_default125[`overflow-menu-list-item-expandable`]) }, dropdownComponentFactory(props2, expandable, props2.onClick)); -}; - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/utilities.js -var UtilitiesView = ({ headerText, dismissIconAriaLabel, onClose, items = [], focusIndex }) => { - const headerId = useUniqueId("overflow-menu-header"); - const ref = (0, import_react430.useRef)(null); - (0, import_react430.useEffect)(() => { - var _a2; - if (typeof focusIndex === "number") { - (_a2 = ref.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); - } - }, [focusIndex]); - return import_react430.default.createElement( - focus_lock_default, - { autoFocus: true }, - import_react430.default.createElement( - header_default2, - { dismissIconAriaLabel, onClose }, - import_react430.default.createElement("span", { id: headerId }, headerText) - ), - import_react430.default.createElement("ul", { className: styles_css_default125["overflow-menu-list"], "aria-labelledby": headerId }, items.map((utility, index) => import_react430.default.createElement(UtilityMenuItem, Object.assign({ key: index, index, ref: index === focusIndex ? ref : void 0, onClose }, utility)))) - ); -}; -var utilities_default = UtilitiesView; - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/submenu.js -var import_react431 = __toESM(require_react()); -var SubmenuView = ({ onClose, utilityIndex, headerText, headerSecondaryText, dismissIconAriaLabel, backIconAriaLabel, definition }) => { - const navigate = useNavigate(); - const headerId = useUniqueId("overflow-menu-header"); - return import_react431.default.createElement( - focus_lock_default, - { autoFocus: true }, - import_react431.default.createElement( - header_default2, - { secondaryText: headerSecondaryText, dismissIconAriaLabel, backIconAriaLabel, onClose, onBack: () => navigate("utilities", { utilityIndex }) }, - import_react431.default.createElement("span", { id: headerId }, headerText) - ), - import_react431.default.createElement("ul", { className: clsx_m_default(styles_css_default125["overflow-menu-list"], styles_css_default125["overflow-menu-list-submenu"]), "aria-labelledby": headerId }, definition.items.map((item, index) => import_react431.default.createElement(SubmenuItem, Object.assign({ key: index }, item, { onClick: (event, item2) => { - if (item2.href && isPlainLeftClick(event)) { - fireCancelableEvent(definition.onItemFollow, { id: item2.id, href: item2.href, external: item2.external }, event); - } - fireCancelableEvent(definition.onItemClick, { id: item2.id, href: item2.href, external: item2.external }, event); - onClose === null || onClose === void 0 ? void 0 : onClose(); - } })))) - ); -}; -var submenu_default = SubmenuView; - -// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/index.js -var OverflowMenu2 = ({ headerText, dismissIconAriaLabel, backIconAriaLabel, items = [], onClose }) => { - const i18n = useInternalI18n("top-navigation"); - const renderedDismissIconAriaLabel = i18n("i18nStrings.overflowMenuDismissIconAriaLabel", dismissIconAriaLabel); - const renderedBackIconAriaLabel = i18n("i18nStrings.overflowMenuBackIconAriaLabel", backIconAriaLabel); - return import_react432.default.createElement( - "div", - { className: styles_css_default125["overflow-menu"], onKeyUp: (event) => { - if (event.key === "Escape") { - onClose === null || onClose === void 0 ? void 0 : onClose(); - } - } }, - import_react432.default.createElement( - router_default, - null, - import_react432.default.createElement(Route, { view: "utilities", element: (data) => import_react432.default.createElement(utilities_default, { headerText: i18n("i18nStrings.overflowMenuTitleText", headerText), items, focusIndex: data === null || data === void 0 ? void 0 : data.utilityIndex, dismissIconAriaLabel: renderedDismissIconAriaLabel, backIconAriaLabel: renderedBackIconAriaLabel, onClose }) }), - import_react432.default.createElement(Route, { view: "dropdown-menu", element: (data) => import_react432.default.createElement(submenu_default, { headerText: data === null || data === void 0 ? void 0 : data.headerText, headerSecondaryText: data === null || data === void 0 ? void 0 : data.headerSecondaryText, dismissIconAriaLabel: renderedDismissIconAriaLabel, backIconAriaLabel: renderedBackIconAriaLabel, definition: data === null || data === void 0 ? void 0 : data.definition, utilityIndex: data === null || data === void 0 ? void 0 : data.utilityIndex, onClose }) }) - ) - ); -}; -var overflow_menu_default = OverflowMenu2; - -// node_modules/@cloudscape-design/components/top-navigation/internal.js -function InternalTopNavigation(_a2) { - var { __internalRootRef, identity: identity2, i18nStrings, utilities, search } = _a2, restProps = __rest(_a2, ["__internalRootRef", "identity", "i18nStrings", "utilities", "search"]); - checkSafeUrl("TopNavigation", identity2.href); - const baseProps = getBaseProps(restProps); - const { mainRef, virtualRef, breakpoint, responsiveState, isSearchExpanded, onSearchUtilityClick } = useTopNavigation({ identity: identity2, search, utilities }); - const [overflowMenuOpen, setOverflowMenuOpen] = (0, import_react433.useState)(false); - const overflowMenuTriggerRef = (0, import_react433.useRef)(null); - const isNarrowViewport = breakpoint === "default"; - const isMediumViewport = breakpoint === "xxs"; - const isLargeViewport = breakpoint === "s"; - const i18n = useInternalI18n("top-navigation"); - const onIdentityClick = (event) => { - if (isPlainLeftClick(event)) { - fireCancelableEvent(identity2.onFollow, {}, event); - } - }; - const toggleOverflowMenu = () => { - setOverflowMenuOpen((overflowMenuOpen2) => !overflowMenuOpen2); - }; - const menuTriggerVisible = !isSearchExpanded && responsiveState.hideUtilities; - (0, import_react433.useEffect)(() => { - setOverflowMenuOpen(false); - }, [menuTriggerVisible]); - useEffectOnUpdate(() => { - var _a3; - if (!overflowMenuOpen) { - (_a3 = overflowMenuTriggerRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }, [overflowMenuOpen]); - const content = (isVirtual) => { - var _a3, _b; - const Wrapper = isVirtual ? "div" : "header"; - const showIdentity = isVirtual || !isSearchExpanded; - const showTitle = isVirtual || !responsiveState.hideTitle; - const showSearchSlot = search && (isVirtual || !responsiveState.hideSearch || isSearchExpanded); - const showSearchUtility = isVirtual || search && responsiveState.hideSearch; - const showUtilities = isVirtual || !isSearchExpanded; - const showMenuTrigger = isVirtual || menuTriggerVisible; - return import_react433.default.createElement( - Wrapper, - { - ref: isVirtual ? virtualRef : mainRef, - "aria-hidden": isVirtual ? true : void 0, - // Wrapper is an alias for "div" or "header". - // eslint-disable-next-line react/forbid-component-props - className: clsx_m_default(styles_css_default125["top-navigation"], { - [styles_css_default125.virtual]: isVirtual, - [styles_css_default125.hidden]: isVirtual, - [styles_css_default125.narrow]: isNarrowViewport, - [styles_css_default125.medium]: isMediumViewport - }) - }, - import_react433.default.createElement( - "div", - { className: styles_css_default125["padding-box"] }, - showIdentity && import_react433.default.createElement( - "div", - { className: clsx_m_default(styles_css_default125.identity, !identity2.logo && styles_css_default125["no-logo"]) }, - import_react433.default.createElement( - "a", - { className: styles_css_default125["identity-link"], href: identity2.href, onClick: onIdentityClick }, - identity2.logo && import_react433.default.createElement("img", { role: "img", src: (_a3 = identity2.logo) === null || _a3 === void 0 ? void 0 : _a3.src, alt: (_b = identity2.logo) === null || _b === void 0 ? void 0 : _b.alt, className: clsx_m_default(styles_css_default125.logo, { - [styles_css_default125.narrow]: isNarrowViewport - }) }), - showTitle && import_react433.default.createElement("span", { className: styles_css_default125.title }, identity2.title) - ) - ), - showSearchSlot && import_react433.default.createElement( - "div", - { className: styles_css_default125.inputs }, - import_react433.default.createElement("div", { className: clsx_m_default(styles_css_default125.search, !isVirtual && isSearchExpanded && styles_css_default125["search-expanded"]) }, search) - ), - import_react433.default.createElement( - "div", - { className: styles_css_default125.utilities }, - showSearchUtility && import_react433.default.createElement( - "div", - { className: clsx_m_default(styles_css_default125["utility-wrapper"], styles_css_default125["utility-type-button"], styles_css_default125["utility-type-button-link"], { - [styles_css_default125.narrow]: isNarrowViewport, - [styles_css_default125.medium]: isMediumViewport - }), "data-utility-special": "search" }, - import_react433.default.createElement(Utility, { hideText: true, definition: { - type: "button", - iconName: isSearchExpanded ? "close" : "search", - ariaLabel: isSearchExpanded ? i18n("i18nStrings.searchDismissIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.searchDismissIconAriaLabel) : i18n("i18nStrings.searchIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.searchIconAriaLabel), - onClick: onSearchUtilityClick - } }) - ), - showUtilities && utilities.filter((_utility, i) => isVirtual || !responsiveState.hideUtilities || responsiveState.hideUtilities.indexOf(i) === -1).map((utility, i) => { - var _a4; - const hideText = !!responsiveState.hideUtilityText; - const isLast = (isVirtual || !showMenuTrigger) && i === utilities.length - 1; - const offsetRight = isLast && isLargeViewport ? "xxl" : isLast ? "l" : void 0; - return import_react433.default.createElement( - "div", - { key: i, className: clsx_m_default(styles_css_default125["utility-wrapper"], styles_css_default125[`utility-type-${utility.type}`], utility.type === "button" && styles_css_default125[`utility-type-button-${(_a4 = utility.variant) !== null && _a4 !== void 0 ? _a4 : "link"}`], { - [styles_css_default125.narrow]: isNarrowViewport, - [styles_css_default125.medium]: isMediumViewport - }), "data-utility-index": i, "data-utility-hide": `${hideText}` }, - import_react433.default.createElement(Utility, { hideText, definition: utility, offsetRight }) - ); - }), - isVirtual && utilities.map((utility, i) => { - var _a4; - const hideText = !responsiveState.hideUtilityText; - const isLast = !showMenuTrigger && i === utilities.length - 1; - const offsetRight = isLast && isLargeViewport ? "xxl" : isLast ? "l" : void 0; - return import_react433.default.createElement( - "div", - { key: i, className: clsx_m_default(styles_css_default125["utility-wrapper"], styles_css_default125[`utility-type-${utility.type}`], utility.type === "button" && styles_css_default125[`utility-type-button-${(_a4 = utility.variant) !== null && _a4 !== void 0 ? _a4 : "link"}`], { - [styles_css_default125.narrow]: isNarrowViewport, - [styles_css_default125.medium]: isMediumViewport - }), "data-utility-index": i, "data-utility-hide": `${hideText}` }, - import_react433.default.createElement(Utility, { hideText, definition: utility, offsetRight }) - ); - }), - showMenuTrigger && import_react433.default.createElement( - "div", - { className: clsx_m_default(styles_css_default125["utility-wrapper"], styles_css_default125["utility-type-menu-dropdown"], { - [styles_css_default125.narrow]: isNarrowViewport, - [styles_css_default125.medium]: isMediumViewport - }), "data-utility-special": "menu-trigger" }, - import_react433.default.createElement(ButtonTrigger2, { expanded: overflowMenuOpen, onClick: toggleOverflowMenu, offsetRight: "l", ref: !isVirtual ? overflowMenuTriggerRef : void 0 }, i18n("i18nStrings.overflowMenuTriggerText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuTriggerText)) - ) - ) - ) - ); - }; - return import_react433.default.createElement( - "div", - Object.assign({}, baseProps, { ref: __internalRootRef }), - import_react433.default.createElement( - VisualContext, - { contextName: "top-navigation" }, - content(false), - import_react433.default.createElement(Portal, null, content(true)), - menuTriggerVisible && overflowMenuOpen && import_react433.default.createElement( - "div", - { className: styles_css_default125["overflow-menu-drawer"] }, - import_react433.default.createElement(overflow_menu_default, { headerText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuTitleText, dismissIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuDismissIconAriaLabel, backIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuBackIconAriaLabel, items: utilities.filter((utility, i) => (!responsiveState.hideUtilities || responsiveState.hideUtilities.indexOf(i) !== -1) && !utility.disableUtilityCollapse), onClose: toggleOverflowMenu }) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/top-navigation/index.js -function TopNavigation(_a2) { - var { utilities = [] } = _a2, restProps = __rest(_a2, ["utilities"]); - const baseComponentProps = useBaseComponent("TopNavigation"); - return import_react434.default.createElement(InternalTopNavigation, Object.assign({}, baseComponentProps, { utilities }, restProps)); -} -applyDisplayName(TopNavigation, "TopNavigation"); - -// node_modules/@cloudscape-design/components/tutorial-panel/index.js -var import_react440 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tutorial-panel/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tutorial-panel/styles.scoped.css"; -var styles_css_default127 = { - "tutorial-panel": "awsui_tutorial-panel_1oin5_a21xr_99" -}; - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/index.js -var import_react435 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.scoped.css"; -var styles_css_default128 = { - "content-enter": "awsui_content-enter_ig8mp_dp1p1_99", - "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_ig8mp_dp1p1_1", - "tutorial-list": "awsui_tutorial-list_ig8mp_dp1p1_125", - "tutorial-box": "awsui_tutorial-box_ig8mp_dp1p1_164", - "tutorial-box-title": "awsui_tutorial-box-title_ig8mp_dp1p1_211", - "tutorial-description-plaintext": "awsui_tutorial-description-plaintext_ig8mp_dp1p1_217", - "tutorial-description": "awsui_tutorial-description_ig8mp_dp1p1_217", - "expandable-section": "awsui_expandable-section_ig8mp_dp1p1_229", - "expanded": "awsui_expanded_ig8mp_dp1p1_233", - "button-wrapper": "awsui_button-wrapper_ig8mp_dp1p1_237", - "start": "awsui_start_ig8mp_dp1p1_242", - "expand-button": "awsui_expand-button_ig8mp_dp1p1_246", - "collapse-button": "awsui_collapse-button_ig8mp_dp1p1_250", - "learn-more-link": "awsui_learn-more-link_ig8mp_dp1p1_254", - "title": "awsui_title_ig8mp_dp1p1_258", - "prerequisites-alert": "awsui_prerequisites-alert_ig8mp_dp1p1_262", - "completed": "awsui_completed_ig8mp_dp1p1_266", - "download-link": "awsui_download-link_ig8mp_dp1p1_270" -}; - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/index.js -function TutorialList({ i18nStrings, tutorials, loading = false, onStartTutorial, downloadUrl }) { - checkSafeUrl("TutorialPanel", downloadUrl); - const isRefresh = useVisualRefresh(); - return import_react435.default.createElement( - import_react435.default.Fragment, - null, - import_react435.default.createElement( - InternalSpaceBetween, - { size: "s" }, - import_react435.default.createElement( - InternalSpaceBetween, - { size: "m" }, - import_react435.default.createElement(InternalBox, { variant: "h2", fontSize: isRefresh ? "heading-m" : "heading-l", padding: { bottom: "n" } }, i18nStrings.tutorialListTitle), - import_react435.default.createElement(InternalBox, { variant: "p", color: "text-body-secondary", padding: "n" }, i18nStrings.tutorialListDescription) - ), - import_react435.default.createElement( - InternalSpaceBetween, - { size: "l" }, - downloadUrl && import_react435.default.createElement( - "a", - { href: downloadUrl, target: "_blank", rel: "noopener noreferrer", className: styles_css_default128["download-link"], "aria-label": i18nStrings.labelTutorialListDownloadLink }, - import_react435.default.createElement(internal_default, { name: "download" }), - import_react435.default.createElement(InternalBox, { padding: { left: "xs" }, color: "inherit", fontWeight: "bold", display: "inline" }, i18nStrings.tutorialListDownloadLinkText) - ), - loading ? import_react435.default.createElement( - StatusIndicator, - { type: "loading" }, - import_react435.default.createElement(live_region_default, { visible: true }, i18nStrings.loadingText) - ) : import_react435.default.createElement("ul", { className: styles_css_default128["tutorial-list"], role: "list" }, tutorials.map((tutorial, index) => import_react435.default.createElement(Tutorial, { tutorial, key: index, onStartTutorial, i18nStrings }))) - ) - ) - ); -} -function Tutorial({ tutorial, onStartTutorial: onStartTutorialEventHandler, i18nStrings }) { - var _a2; - checkSafeUrl("TutorialPanel", tutorial.learnMoreUrl); - const controlId = useUniqueId(); - const triggerControldId = useUniqueId(); - const headerId = useUniqueId(); - const isRefresh = useVisualRefresh(); - const onStartTutorial = (0, import_react435.useCallback)(() => { - fireNonCancelableEvent(onStartTutorialEventHandler, { tutorial }); - }, [onStartTutorialEventHandler, tutorial]); - const [expanded, setExpanded] = (0, import_react435.useState)(!tutorial.prerequisitesNeeded && !tutorial.completed); - const onClick = (0, import_react435.useCallback)(() => { - setExpanded((expanded2) => !expanded2); - }, []); - return import_react435.default.createElement( - "li", - { className: styles_css_default128["tutorial-box"], role: "listitem" }, - import_react435.default.createElement( - InternalSpaceBetween, - { size: "xs" }, - import_react435.default.createElement( - "div", - { className: styles_css_default128["tutorial-box-title"] }, - import_react435.default.createElement(InternalBox, { variant: "h3", fontSize: isRefresh ? "heading-s" : "heading-m", id: headerId, margin: { right: "xs" }, padding: "n", className: styles_css_default128.title }, tutorial.title), - import_react435.default.createElement( - "div", - { className: styles_css_default128["button-wrapper"] }, - import_react435.default.createElement(InternalButton, { id: triggerControldId, variant: "icon", ariaExpanded: expanded, __nativeAttributes: { - "aria-controls": controlId, - "aria-labelledby": headerId - }, formAction: "none", onClick, className: expanded ? styles_css_default128["collapse-button"] : styles_css_default128["expand-button"], iconName: expanded ? "angle-up" : "angle-down" }) - ) - ), - tutorial.completed ? import_react435.default.createElement(StatusIndicator, { __size: "inherit", type: "success", className: styles_css_default128.completed, wrapText: true }, i18nStrings.tutorialCompletedText) : null - ), - import_react435.default.createElement( - "div", - { "aria-live": "polite" }, - import_react435.default.createElement( - CSSTransition_default, - { in: expanded, timeout: 30, classNames: { enter: styles_css_default128["content-enter"] } }, - import_react435.default.createElement( - "div", - { className: clsx_m_default(styles_css_default128["expandable-section"], expanded && styles_css_default128.expanded), id: controlId }, - import_react435.default.createElement( - InternalSpaceBetween, - { size: "l" }, - import_react435.default.createElement( - InternalSpaceBetween, - { size: "m" }, - tutorial.prerequisitesNeeded && tutorial.prerequisitesAlert && import_react435.default.createElement(internal_default3, { type: "info", className: styles_css_default128["prerequisites-alert"] }, tutorial.prerequisitesAlert), - import_react435.default.createElement( - InternalSpaceBetween, - { size: "s" }, - import_react435.default.createElement( - InternalBox, - { color: "text-body-secondary" }, - import_react435.default.createElement("div", { className: clsx_m_default(styles_css_default128["tutorial-description"], typeof tutorial.description === "string" && styles_css_default128["tutorial-description-plaintext"]) }, tutorial.description) - ), - tutorial.learnMoreUrl && import_react435.default.createElement(internal_default5, { href: tutorial.learnMoreUrl, className: styles_css_default128["learn-more-link"], externalIconAriaLabel: i18nStrings.labelLearnMoreExternalIcon, ariaLabel: i18nStrings.labelLearnMoreLink, external: true, variant: "primary" }, i18nStrings.learnMoreLinkText) - ) - ), - import_react435.default.createElement( - InternalBox, - { margin: { bottom: "xxs" } }, - import_react435.default.createElement(InternalButton, { onClick: onStartTutorial, disabled: (_a2 = tutorial.prerequisitesNeeded) !== null && _a2 !== void 0 ? _a2 : false, formAction: "none", className: styles_css_default128.start }, tutorial.completed ? i18nStrings.restartTutorialButtonText : i18nStrings.startTutorialButtonText) - ) - ) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/index.js -var import_react439 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.scoped.css"; -var styles_css_default129 = { - "tutorial-list": "awsui_tutorial-list_1u70p_8w58y_99", - "tutorial-title": "awsui_tutorial-title_1u70p_8w58y_138", - "task": "awsui_task_1u70p_8w58y_145", - "task-title": "awsui_task-title_1u70p_8w58y_153", - "task-title--status": "awsui_task-title--status_1u70p_8w58y_161", - "current-task": "awsui_current-task_1u70p_8w58y_165", - "successful-task": "awsui_successful-task_1u70p_8w58y_169", - "congratulation-message": "awsui_congratulation-message_1u70p_8w58y_173", - "congratulation-message--status": "awsui_congratulation-message--status_1u70p_8w58y_181", - "plaintext-congratulation-description": "awsui_plaintext-congratulation-description_1u70p_8w58y_185", - "divider": "awsui_divider_1u70p_8w58y_189", - "step-list": "awsui_step-list_1u70p_8w58y_193", - "step": "awsui_step_1u70p_8w58y_193", - "expandable-section-wrapper": "awsui_expandable-section-wrapper_1u70p_8w58y_204", - "expandable-section-header": "awsui_expandable-section-header_1u70p_8w58y_208", - "step-title": "awsui_step-title_1u70p_8w58y_213", - "feedback-link": "awsui_feedback-link_1u70p_8w58y_214", - "dismiss-button": "awsui_dismiss-button_1u70p_8w58y_215", - "completion-screen-title": "awsui_completion-screen-title_1u70p_8w58y_216", - "completion-screen-description": "awsui_completion-screen-description_1u70p_8w58y_217" -}; - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js -var import_react436 = __toESM(require_react()); -function CongratulationScreen({ children: children2, onFeedbackClick, i18nStrings }) { - return import_react436.default.createElement( - InternalSpaceBetween, - { size: "xxl" }, - import_react436.default.createElement( - InternalSpaceBetween, - { size: "xl" }, - import_react436.default.createElement( - "div", - { className: styles_css_default129["congratulation-message"] }, - import_react436.default.createElement(StatusIndicator, { __size: "inherit", type: "success", className: styles_css_default129["congratulation-message--status"] }), - import_react436.default.createElement("div", { className: styles_css_default129["completion-screen-title"] }, i18nStrings.completionScreenTitle) - ), - import_react436.default.createElement( - InternalBox, - { color: "text-body-secondary" }, - import_react436.default.createElement("div", { className: clsx_m_default({ - [styles_css_default129["completion-screen-description"]]: true, - [styles_css_default129["plaintext-congratulation-description"]]: typeof children2 === "string" - }) }, children2) - ) - ), - import_react436.default.createElement("div", { className: styles_css_default129.divider }), - onFeedbackClick && import_react436.default.createElement(internal_default5, { onFollow: onFeedbackClick, className: styles_css_default129["feedback-link"], variant: "primary" }, i18nStrings.feedbackLinkText) - ); -} - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task-list.js -var import_react438 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task.js -var import_react437 = __toESM(require_react()); -function getStatusIndicatorType(taskIndex, currentTaskIndex) { - if (taskIndex < currentTaskIndex) { - return "success"; - } - if (taskIndex === currentTaskIndex) { - return "in-progress"; - } - return "pending"; -} -function Task({ task, taskIndex, currentTaskIndex, expanded, onToggleExpand, i18nStrings }) { - const statusIndicatorType = getStatusIndicatorType(taskIndex, currentTaskIndex); - const onExpandChange = (0, import_react437.useCallback)(() => { - onToggleExpand(taskIndex); - }, [onToggleExpand, taskIndex]); - return import_react437.default.createElement( - "li", - { className: styles_css_default129.task }, - import_react437.default.createElement( - InternalSpaceBetween, - { size: "xxs" }, - import_react437.default.createElement( - "div", - { className: styles_css_default129["task-title"] }, - import_react437.default.createElement(StatusIndicator, { __size: "inherit", type: statusIndicatorType, iconAriaLabel: i18nStrings.labelsTaskStatus[statusIndicatorType], className: styles_css_default129["task-title--status"] }), - import_react437.default.createElement(InternalBox, { variant: "h3", padding: { left: "xxxs", vertical: "n" }, fontSize: "heading-s", color: taskIndex < currentTaskIndex ? "text-status-success" : "text-status-inactive" }, i18nStrings.taskTitle(taskIndex, task.title)) - ), - import_react437.default.createElement( - "div", - { className: styles_css_default129["expandable-section-wrapper"] }, - import_react437.default.createElement( - InternalExpandableSection, - { header: import_react437.default.createElement("span", { className: styles_css_default129["expandable-section-header"] }, i18nStrings.labelTotalSteps(task.steps.length)), expanded, onChange: onExpandChange, headerAriaLabel: joinStrings(i18nStrings.taskTitle(taskIndex, task.title), i18nStrings.labelTotalSteps(task.steps.length)) }, - import_react437.default.createElement("ol", { className: styles_css_default129["step-list"] }, task.steps.map((step2, stepIndex) => import_react437.default.createElement( - "li", - { key: stepIndex, className: styles_css_default129.step }, - import_react437.default.createElement(InternalBox, { color: "text-body-secondary", fontSize: "body-m", padding: { left: "l" }, className: styles_css_default129["step-title"] }, i18nStrings.stepTitle(stepIndex, step2.title)) - ))) - ) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task-list.js -function TaskList({ tasks, onExitTutorial, currentGlobalStepIndex, i18nStrings }) { - const currentTaskIndex = getStepInfo(tasks, currentGlobalStepIndex !== null && currentGlobalStepIndex !== void 0 ? currentGlobalStepIndex : 0).taskIndex; - const [expandedTasks, setExpandedTasks] = (0, import_react438.useState)({ [currentTaskIndex]: true }); - const onToggleExpand = (0, import_react438.useCallback)((stepIndex) => { - setExpandedTasks((prevTasks) => Object.assign(Object.assign({}, prevTasks), { [stepIndex]: !prevTasks[stepIndex] })); - }, []); - (0, import_react438.useEffect)(() => { - setExpandedTasks({ [currentTaskIndex]: true }); - }, [currentTaskIndex]); - return import_react438.default.createElement( - InternalSpaceBetween, - { size: "xxl" }, - import_react438.default.createElement("ol", { className: styles_css_default129["tutorial-list"] }, tasks.map((task, index) => { - var _a2; - return import_react438.default.createElement(Task, { task, key: index, taskIndex: index, currentTaskIndex, expanded: (_a2 = expandedTasks[index]) !== null && _a2 !== void 0 ? _a2 : false, onToggleExpand, i18nStrings }); - })), - import_react438.default.createElement( - InternalBox, - { margin: { top: "xxxs" } }, - import_react438.default.createElement(InternalButton, { onClick: onExitTutorial, formAction: "none", className: styles_css_default129["dismiss-button"] }, i18nStrings.dismissTutorialButtonText) - ) - ); -} - -// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/index.js -function TutorialDetailView({ tutorial, onExitTutorial: onExitTutorialHandler, currentStepIndex = 0, onFeedbackClick: onFeedbackClickHandler, i18nStrings }) { - const isRefresh = useVisualRefresh(); - const onExitTutorial = (0, import_react439.useCallback)(() => { - fireNonCancelableEvent(onExitTutorialHandler, { tutorial }); - }, [onExitTutorialHandler, tutorial]); - const onFeedbackClick = (0, import_react439.useMemo)(() => onFeedbackClickHandler && (() => fireNonCancelableEvent(onFeedbackClickHandler, { tutorial })), [onFeedbackClickHandler, tutorial]); - return import_react439.default.createElement( - import_react439.default.Fragment, - null, - import_react439.default.createElement( - InternalSpaceBetween, - { size: "xl" }, - import_react439.default.createElement( - "div", - { className: styles_css_default129["tutorial-title"] }, - import_react439.default.createElement(InternalButton, { variant: "icon", onClick: onExitTutorial, ariaLabel: i18nStrings.labelExitTutorial, formAction: "none", iconName: "arrow-left" }), - import_react439.default.createElement(InternalBox, { variant: "h2", fontSize: isRefresh ? "heading-m" : "heading-l", padding: { top: "xxs" }, margin: { left: "s" } }, tutorial.title) - ), - import_react439.default.createElement( - "div", - null, - import_react439.default.createElement("div", { role: "status" }, tutorial.completed && import_react439.default.createElement(CongratulationScreen, { onFeedbackClick, i18nStrings }, tutorial.completedScreenDescription)), - !tutorial.completed && import_react439.default.createElement(TaskList, { tasks: tutorial.tasks, onExitTutorial, currentGlobalStepIndex: currentStepIndex, i18nStrings }) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/tutorial-panel/index.js -function TutorialPanel(_a2) { - var { i18nStrings, loading, tutorials, onFeedbackClick, downloadUrl } = _a2, restProps = __rest(_a2, ["i18nStrings", "loading", "tutorials", "onFeedbackClick", "downloadUrl"]); - const { __internalRootRef } = useBaseComponent("TutorialPanel"); - const baseProps = getBaseProps(restProps); - const context = (0, import_react440.useContext)(hotspotContext); - return import_react440.default.createElement( - import_react440.default.Fragment, - null, - import_react440.default.createElement("div", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default127["tutorial-panel"]), ref: __internalRootRef }), context.currentTutorial ? import_react440.default.createElement(TutorialDetailView, { i18nStrings, tutorial: context.currentTutorial, onExitTutorial: context.onExitTutorial, currentStepIndex: context.currentStepIndex, onFeedbackClick }) : import_react440.default.createElement(TutorialList, { i18nStrings, tutorials, loading, onStartTutorial: context.onStartTutorial, downloadUrl })) - ); -} -applyDisplayName(TutorialPanel, "TutorialPanel"); - -// node_modules/@cloudscape-design/components/wizard/index.js -var import_react448 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/wizard/internal.js -var import_react447 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/wizard/wizard-form.js -var import_react444 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/wizard/wizard-actions.js -var import_react442 = __toESM(require_react()); - -// node_modules/@cloudscape-design/components/wizard/styles.css.js -import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-on-the-spot/website/node_modules/@cloudscape-design/components/wizard/styles.scoped.css"; -var styles_css_default130 = { - "root": "awsui_root_1xupv_e5t6y_100", - "wizard": "awsui_wizard_1xupv_e5t6y_135", - "refresh": "awsui_refresh_1xupv_e5t6y_135", - "small-container": "awsui_small-container_1xupv_e5t6y_142", - "remove-high-contrast-header": "awsui_remove-high-contrast-header_1xupv_e5t6y_146", - "navigation": "awsui_navigation_1xupv_e5t6y_154", - "number": "awsui_number_1xupv_e5t6y_236", - "circle": "awsui_circle_1xupv_e5t6y_252", - "title": "awsui_title_1xupv_e5t6y_263", - "active": "awsui_active_1xupv_e5t6y_294", - "disabled": "awsui_disabled_1xupv_e5t6y_305", - "enabled": "awsui_enabled_1xupv_e5t6y_315", - "form": "awsui_form_1xupv_e5t6y_357", - "form-header": "awsui_form-header_1xupv_e5t6y_362", - "background": "awsui_background_1xupv_e5t6y_372", - "form-header-content": "awsui_form-header-content_1xupv_e5t6y_384", - "form-component": "awsui_form-component_1xupv_e5t6y_392", - "hidden": "awsui_hidden_1xupv_e5t6y_406", - "collapsed-steps": "awsui_collapsed-steps_1xupv_e5t6y_410", - "collapsed-steps-hidden": "awsui_collapsed-steps-hidden_1xupv_e5t6y_415", - "form-header-component-wrapper": "awsui_form-header-component-wrapper_1xupv_e5t6y_419", - "form-header-component": "awsui_form-header-component_1xupv_e5t6y_419", - "navigation-link": "awsui_navigation-link_1xupv_e5t6y_435", - "navigation-link-item": "awsui_navigation-link-item_1xupv_e5t6y_436", - "navigation-link-label": "awsui_navigation-link-label_1xupv_e5t6y_437", - "navigation-link-active": "awsui_navigation-link-active_1xupv_e5t6y_441", - "navigation-link-disabled": "awsui_navigation-link-disabled_1xupv_e5t6y_446", - "cancel-button": "awsui_cancel-button_1xupv_e5t6y_450", - "previous-button": "awsui_previous-button_1xupv_e5t6y_451", - "primary-button": "awsui_primary-button_1xupv_e5t6y_452", - "skip-to-button": "awsui_skip-to-button_1xupv_e5t6y_453", - "action-buttons": "awsui_action-buttons_1xupv_e5t6y_457" -}; - -// node_modules/@cloudscape-design/components/wizard/unmount.js -var import_react441 = __toESM(require_react()); -var Unmount = class extends import_react441.default.Component { - componentWillUnmount() { - this.props.onUnmount(); - } - render() { - return this.props.children; - } -}; - -// node_modules/@cloudscape-design/components/wizard/wizard-actions.js -function WizardActions({ cancelButtonText, onCancelClick, isPrimaryLoading, primaryButtonText, primaryButtonLoadingText, onPrimaryClick, showPrevious, previousButtonText, onPreviousClick, showSkipTo, skipToButtonText, onSkipToClick }) { - const containerRef = (0, import_react442.useRef)(null); - const primaryButtonRef = (0, import_react442.useRef)(null); - const onPreviousUnmount = () => { - var _a2, _b; - if (((_a2 = containerRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`.${styles_css_default130["previous-button"]}`)) === document.activeElement) { - (_b = primaryButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus(); - } - }; - const onSkipUnmount = () => { - var _a2, _b; - if (((_a2 = containerRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(`.${styles_css_default130["skip-to-button"]}`)) === document.activeElement) { - (_b = primaryButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus(); - } - }; - return import_react442.default.createElement( - "div", - { ref: containerRef }, - import_react442.default.createElement( - InternalSpaceBetween, - { direction: "horizontal", size: "xs", className: styles_css_default130["action-buttons"] }, - import_react442.default.createElement(InternalButton, { className: styles_css_default130["cancel-button"], variant: "link", formAction: "none", onClick: onCancelClick }, cancelButtonText), - showSkipTo && skipToButtonText && import_react442.default.createElement( - Unmount, - { onUnmount: onSkipUnmount }, - import_react442.default.createElement(InternalButton, { className: styles_css_default130["skip-to-button"], onClick: onSkipToClick, formAction: "none", disabled: isPrimaryLoading }, skipToButtonText) - ), - showPrevious && import_react442.default.createElement( - Unmount, - { onUnmount: onPreviousUnmount }, - import_react442.default.createElement(InternalButton, { className: styles_css_default130["previous-button"], onClick: onPreviousClick, formAction: "none", disabled: isPrimaryLoading }, previousButtonText) - ), - import_react442.default.createElement(InternalButton, { ref: primaryButtonRef, className: styles_css_default130["primary-button"], variant: "primary", formAction: "none", onClick: onPrimaryClick, loading: isPrimaryLoading, loadingText: primaryButtonLoadingText }, primaryButtonText) - ) - ); -} - -// node_modules/@cloudscape-design/components/wizard/wizard-form-header.js -var import_react443 = __toESM(require_react()); -function WizardFormHeader({ children: children2, isVisualRefresh }) { - const overlapElement = useDynamicOverlap(); - return import_react443.default.createElement( - "div", - { className: clsx_m_default(styles_css_default130["form-header"], isVisualRefresh && styles_css_default130["form-header-refresh"], isVisualRefresh && getContentHeaderClassName()), ref: overlapElement }, - import_react443.default.createElement("div", { className: clsx_m_default(styles_css_default130["form-header-content"], shouldRemoveHighContrastHeader() && styles_css_default130["remove-high-contrast-header"]) }, children2) - ); -} - -// node_modules/@cloudscape-design/components/wizard/wizard-form.js -var STEP_NAME_SELECTOR = `[${DATA_ATTR_FUNNEL_KEY}=${FUNNEL_KEY_STEP_NAME}]`; -function WizardForm({ steps, activeStepIndex, isVisualRefresh, showCollapsedSteps, i18nStrings, submitButtonText, isPrimaryLoading, allowSkipTo, secondaryActions, onCancelClick, onPreviousClick, onPrimaryClick, onSkipToClick }) { - const _a2 = steps[activeStepIndex] || {}, { title, info, description, content, errorText, isOptional } = _a2, rest = __rest(_a2, ["title", "info", "description", "content", "errorText", "isOptional"]); - const isLastStep = activeStepIndex >= steps.length - 1; - const skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex); - const isMobile = useMobile(); - const stepHeaderRef = (0, import_react444.useRef)(null); - const analyticsMetadata = getAnalyticsMetadataProps(rest); - const elementRef = useComponentMetadata("WizardForm", PACKAGE_VERSION, Object.assign({}, analyticsMetadata)); - useEffectOnUpdate(() => { - var _a3; - if (stepHeaderRef && stepHeaderRef.current) { - (_a3 = stepHeaderRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }, [activeStepIndex]); - const showSkipTo = allowSkipTo && skipToTargetIndex !== -1; - const skipToButtonText = skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel ? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1) : void 0; - return import_react444.default.createElement( - import_react444.default.Fragment, - null, - import_react444.default.createElement(AnalyticsFunnelStep, { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNameSelector: STEP_NAME_SELECTOR, stepNumber: activeStepIndex + 1 }, ({ funnelStepProps }) => { - var _a3; - return import_react444.default.createElement( - import_react444.default.Fragment, - null, - import_react444.default.createElement( - WizardFormHeader, - { isMobile: isMobile || showCollapsedSteps, isVisualRefresh }, - import_react444.default.createElement("div", { className: clsx_m_default(styles_css_default130["collapsed-steps"], !showCollapsedSteps && styles_css_default130["collapsed-steps-hidden"]) }, (_a3 = i18nStrings.collapsedStepsLabel) === null || _a3 === void 0 ? void 0 : _a3.call(i18nStrings, activeStepIndex + 1, steps.length)), - import_react444.default.createElement( - InternalHeader, - { className: styles_css_default130["form-header-component"], variant: "h1", description, info }, - import_react444.default.createElement( - "span", - { className: styles_css_default130["form-header-component-wrapper"], tabIndex: -1, ref: stepHeaderRef }, - import_react444.default.createElement("span", Object.assign({}, { [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_STEP_NAME }), title), - isOptional && import_react444.default.createElement("i", null, ` - ${i18nStrings.optional}`) - ) - ) - ), - import_react444.default.createElement(InternalForm, Object.assign({ __internalRootRef: elementRef, className: clsx_m_default(styles_css_default130["form-component"]), actions: import_react444.default.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? submitButtonText !== null && submitButtonText !== void 0 ? submitButtonText : i18nStrings.submitButton : i18nStrings.nextButton, primaryButtonLoadingText: isLastStep ? i18nStrings.submitButtonLoadingAnnouncement : i18nStrings.nextButtonLoadingAnnouncement, previousButtonText: i18nStrings.previousButton, onCancelClick, onPreviousClick, onPrimaryClick, onSkipToClick: () => onSkipToClick(skipToTargetIndex), showPrevious: activeStepIndex !== 0, isPrimaryLoading, showSkipTo, skipToButtonText }), secondaryActions, errorText, errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, funnelStepProps), content) - ); - }) - ); -} -function findSkipToTargetIndex(steps, activeStepIndex) { - let nextRequiredStepIndex = activeStepIndex; - do { - nextRequiredStepIndex++; - } while (nextRequiredStepIndex < steps.length - 1 && steps[nextRequiredStepIndex].isOptional); - return nextRequiredStepIndex > activeStepIndex + 1 ? nextRequiredStepIndex : -1; -} - -// node_modules/@cloudscape-design/components/wizard/wizard-navigation.js -var import_react445 = __toESM(require_react()); -var Statuses; -(function(Statuses2) { - Statuses2["Active"] = "active"; - Statuses2["Unvisited"] = "unvisited"; - Statuses2["Visited"] = "visited"; - Statuses2["Next"] = "next"; -})(Statuses || (Statuses = {})); -function Navigation2({ activeStepIndex, farthestStepIndex, allowSkipTo, hidden, i18nStrings, isVisualRefresh, isLoadingNextStep, onStepClick, onSkipToClick, steps }) { - return import_react445.default.createElement( - "nav", - { className: clsx_m_default(styles_css_default130.navigation, hidden && styles_css_default130.hidden, isVisualRefresh && styles_css_default130.refresh, shouldRemoveHighContrastHeader() && styles_css_default130["remove-high-contrast-header"]), "aria-label": i18nStrings.navigationAriaLabel }, - import_react445.default.createElement("ul", { className: clsx_m_default(isVisualRefresh && styles_css_default130.refresh, shouldRemoveHighContrastHeader() && styles_css_default130["remove-high-contrast-header"]) }, steps.map((step2, index) => isVisualRefresh ? import_react445.default.createElement(NavigationStepVisualRefresh, { i18nStrings, index, key: index, onStepClick, onSkipToClick, status: getStatus(index), step: step2 }) : import_react445.default.createElement(NavigationStepClassic, { i18nStrings, index, key: index, onStepClick, onSkipToClick, status: getStatus(index), step: step2 }))) - ); - function getStatus(index) { - if (activeStepIndex === index) { - return Statuses.Active; - } - if (isLoadingNextStep) { - return Statuses.Unvisited; - } - if (farthestStepIndex >= index) { - return Statuses.Visited; - } - if (allowSkipTo && canSkip(activeStepIndex + 1, index)) { - return Statuses.Next; - } - return Statuses.Unvisited; - } - function canSkip(fromIndex, toIndex) { - let index = fromIndex; - do { - if (!steps[index].isOptional) { - return false; - } - index++; - } while (index < toIndex); - return true; - } -} -function NavigationStepVisualRefresh({ i18nStrings, index, onStepClick, onSkipToClick, status, step: step2 }) { - function handleStepInteraction() { - if (status === Statuses.Visited) { - onStepClick(index); - } - if (status === Statuses.Next) { - onSkipToClick(index); - } - } - const state = { - active: "active", - unvisited: "disabled", - visited: "enabled", - next: "enabled" - }[status]; - const linkClassName = clsx_m_default(styles_css_default130["navigation-link"], { - [styles_css_default130["navigation-link-active"]]: status === Statuses.Active, - [styles_css_default130["navigation-link-disabled"]]: status === Statuses.Unvisited - }); - return import_react445.default.createElement( - "li", - { className: clsx_m_default(styles_css_default130[`${state}`], styles_css_default130["navigation-link-item"]) }, - import_react445.default.createElement("hr", null), - import_react445.default.createElement( - "span", - { className: clsx_m_default(styles_css_default130.number, styles_css_default130["navigation-link-label"]) }, - i18nStrings.stepNumberLabel && i18nStrings.stepNumberLabel(index + 1), - step2.isOptional && import_react445.default.createElement("i", null, ` - ${i18nStrings.optional}`) - ), - import_react445.default.createElement( - "a", - { className: linkClassName, "aria-current": status === Statuses.Active ? "step" : void 0, "aria-disabled": status === Statuses.Unvisited ? "true" : void 0, onClick: (event) => { - event.preventDefault(); - handleStepInteraction(); - }, onKeyDown: (event) => { - if (event.key === " " || event.key === "Enter") { - event.preventDefault(); - } - if (event.key === "Enter") { - handleStepInteraction(); - } - }, onKeyUp: (event) => { - if (event.key === " ") { - handleStepInteraction(); - } - }, role: "button", tabIndex: status === Statuses.Visited || status === Statuses.Next ? 0 : void 0 }, - import_react445.default.createElement("div", { className: clsx_m_default(styles_css_default130.circle) }), - import_react445.default.createElement("span", { className: clsx_m_default(styles_css_default130.title) }, step2.title) - ) - ); -} -function NavigationStepClassic({ i18nStrings, index, onStepClick, onSkipToClick, status, step: step2 }) { - const spanClassName = clsx_m_default(styles_css_default130["navigation-link"], status === Statuses.Active ? styles_css_default130["navigation-link-active"] : styles_css_default130["navigation-link-disabled"]); - return import_react445.default.createElement( - "li", - { className: styles_css_default130["navigation-link-item"] }, - import_react445.default.createElement( - InternalBox, - { variant: "small", className: styles_css_default130["navigation-link-label"], display: "block", margin: { bottom: "xxs" } }, - i18nStrings.stepNumberLabel && i18nStrings.stepNumberLabel(index + 1), - step2.isOptional && import_react445.default.createElement("i", null, ` - ${i18nStrings.optional}`) - ), - import_react445.default.createElement("div", null, status === Statuses.Visited || status === Statuses.Next ? import_react445.default.createElement(internal_default5, { className: clsx_m_default(styles_css_default130["navigation-link"]), onFollow: (evt) => { - evt.preventDefault(); - status === Statuses.Visited ? onStepClick(index) : onSkipToClick(index); - }, variant: "primary" }, step2.title) : import_react445.default.createElement("span", { className: spanClassName, "aria-current": status === Statuses.Active ? "step" : void 0, "aria-disabled": status === Statuses.Active ? void 0 : "true" }, step2.title)) - ); -} - -// node_modules/@cloudscape-design/components/wizard/analytics.js -var import_react446 = __toESM(require_react()); -function useFunnelChangeEvent(funnelInteractionId, steps) { - const listenForStepChanges = (0, import_react446.useRef)(false); - (0, import_react446.useEffect)(() => { - const handle = setTimeout(() => listenForStepChanges.current = true, 0); - return () => { - clearTimeout(handle); - listenForStepChanges.current = false; - }; - }, [funnelInteractionId]); - const stepTitles = steps.map((step2) => step2.title).join(); - (0, import_react446.useEffect)(() => { - if (!funnelInteractionId || !listenForStepChanges.current) { - return; - } - FunnelMetrics.funnelChange({ - funnelInteractionId, - stepConfiguration: getStepConfiguration(steps) - }); - }, [funnelInteractionId, stepTitles]); -} -function getStepConfiguration(steps) { - return steps.map((step2, index) => { - var _a2; - return { - name: step2.title, - number: index + 1, - isOptional: (_a2 = step2.isOptional) !== null && _a2 !== void 0 ? _a2 : false - }; - }); -} - -// node_modules/@cloudscape-design/components/wizard/internal.js -function InternalWizard(_a2) { - var _b, _c, _d, _e, _f, _g, _h, _j; - var { steps, activeStepIndex: controlledActiveStepIndex, submitButtonText, isLoadingNextStep = false, allowSkipTo = false, secondaryActions, onCancel, onSubmit, onNavigate, __internalRootRef } = _a2, rest = __rest(_a2, ["steps", "activeStepIndex", "submitButtonText", "isLoadingNextStep", "allowSkipTo", "secondaryActions", "onCancel", "onSubmit", "onNavigate", "__internalRootRef"]); - const baseProps = getBaseProps(rest); - const [breakpoint, breakpointsRef] = useContainerBreakpoints(["xs"]); - const ref = useMergeRefs(breakpointsRef, __internalRootRef); - const smallContainer = breakpoint === "default"; - const [activeStepIndex, setActiveStepIndex] = useControllable2(controlledActiveStepIndex, onNavigate, 0, { - componentName: "Wizard", - controlledProp: "activeStepIndex", - changeHandler: "onNavigate" - }); - const { funnelInteractionId, funnelSubmit, funnelCancel, funnelProps, funnelNextOrSubmitAttempt } = useFunnel(); - const actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0; - const farthestStepIndex = (0, import_react447.useRef)(actualActiveStepIndex); - farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex); - const isVisualRefresh = useVisualRefresh(); - const isLastStep = actualActiveStepIndex >= steps.length - 1; - const navigationEvent = (requestedStepIndex, reason) => { - if (funnelInteractionId) { - const stepName = getNameFromSelector(STEP_NAME_SELECTOR); - FunnelMetrics.funnelStepNavigation({ - navigationType: reason, - funnelInteractionId, - stepNumber: actualActiveStepIndex + 1, - stepName, - stepNameSelector: STEP_NAME_SELECTOR, - destinationStepNumber: requestedStepIndex + 1, - subStepAllSelector: getSubStepAllSelector() - }); - } - setActiveStepIndex(requestedStepIndex); - fireNonCancelableEvent(onNavigate, { requestedStepIndex, reason }); - }; - const onStepClick = (stepIndex) => navigationEvent(stepIndex, "step"); - const onSkipToClick = (stepIndex) => navigationEvent(stepIndex, "skip"); - const onCancelClick = () => { - funnelCancel(); - fireNonCancelableEvent(onCancel); - }; - const onPreviousClick = () => navigationEvent(actualActiveStepIndex - 1, "previous"); - const onPrimaryClick = () => { - funnelNextOrSubmitAttempt(); - if (isLastStep) { - funnelSubmit(); - fireNonCancelableEvent(onSubmit); - } else { - navigationEvent(actualActiveStepIndex + 1, "next"); - } - }; - useFunnelChangeEvent(funnelInteractionId, steps); - const i18n = useInternalI18n("wizard"); - const skipToButtonLabel = i18n("i18nStrings.skipToButtonLabel", (_b = rest.i18nStrings) === null || _b === void 0 ? void 0 : _b.skipToButtonLabel, (format3) => (task) => format3({ task__title: task.title })); - const i18nStrings = Object.assign(Object.assign({}, rest.i18nStrings), { skipToButtonLabel, stepNumberLabel: i18n("i18nStrings.stepNumberLabel", (_c = rest.i18nStrings) === null || _c === void 0 ? void 0 : _c.stepNumberLabel, (format3) => (stepNumber) => format3({ stepNumber })), collapsedStepsLabel: i18n("i18nStrings.collapsedStepsLabel", (_d = rest.i18nStrings) === null || _d === void 0 ? void 0 : _d.collapsedStepsLabel, (format3) => (stepNumber, stepsCount) => format3({ stepNumber, stepsCount })), navigationAriaLabel: i18n("i18nStrings.navigationAriaLabel", (_e = rest.i18nStrings) === null || _e === void 0 ? void 0 : _e.navigationAriaLabel), cancelButton: i18n("i18nStrings.cancelButton", (_f = rest.i18nStrings) === null || _f === void 0 ? void 0 : _f.cancelButton), previousButton: i18n("i18nStrings.previousButton", (_g = rest.i18nStrings) === null || _g === void 0 ? void 0 : _g.previousButton), nextButton: i18n("i18nStrings.nextButton", (_h = rest.i18nStrings) === null || _h === void 0 ? void 0 : _h.nextButton), optional: i18n("i18nStrings.optional", (_j = rest.i18nStrings) === null || _j === void 0 ? void 0 : _j.optional) }); - if (activeStepIndex && activeStepIndex >= steps.length) { - warnOnce("Wizard", `You have set \`activeStepIndex\` to ${activeStepIndex} but you have provided only ${steps.length} steps. Its value is ignored and the component uses ${steps.length - 1} instead.`); - } - if (allowSkipTo && !skipToButtonLabel) { - warnOnce("Wizard", `You have set \`allowSkipTo\` but you have not provided \`i18nStrings.skipToButtonLabel\`. The skip-to button will not be rendered.`); - } - return import_react447.default.createElement( - "div", - Object.assign({}, baseProps, funnelProps, { ref, className: clsx_m_default(styles_css_default130.root, baseProps.className) }), - import_react447.default.createElement( - "div", - { className: clsx_m_default(styles_css_default130.wizard, isVisualRefresh && styles_css_default130.refresh, smallContainer && styles_css_default130["small-container"], shouldRemoveHighContrastHeader() && styles_css_default130["remove-high-contrast-header"]) }, - import_react447.default.createElement(Navigation2, { activeStepIndex: actualActiveStepIndex, farthestStepIndex: farthestStepIndex.current, allowSkipTo, hidden: smallContainer, i18nStrings, isVisualRefresh, isLoadingNextStep, onStepClick, onSkipToClick, steps }), - import_react447.default.createElement( - "div", - { className: clsx_m_default(styles_css_default130.form, isVisualRefresh && styles_css_default130.refresh, smallContainer && styles_css_default130["small-container"], shouldRemoveHighContrastHeader() && styles_css_default130["remove-high-contrast-header"]) }, - isVisualRefresh && import_react447.default.createElement("div", { className: clsx_m_default(styles_css_default130.background, getContentHeaderClassName()) }), - import_react447.default.createElement(WizardForm, { steps, isVisualRefresh, showCollapsedSteps: smallContainer, i18nStrings, submitButtonText, activeStepIndex: actualActiveStepIndex, isPrimaryLoading: isLoadingNextStep, allowSkipTo, secondaryActions, onCancelClick, onPreviousClick, onSkipToClick, onPrimaryClick }) - ) - ) - ); -} - -// node_modules/@cloudscape-design/components/wizard/index.js -function Wizard(_a2) { - var { isLoadingNextStep = false, allowSkipTo = false } = _a2, props2 = __rest(_a2, ["isLoadingNextStep", "allowSkipTo"]); - const analyticsMetadata = getAnalyticsMetadataProps(props2); - const baseComponentProps = useBaseComponent("Wizard", { props: { allowSkipTo } }, analyticsMetadata); - const { wizardCount } = useFunnel(); - const externalProps = getExternalProps(props2); - (0, import_react448.useEffect)(() => { - wizardCount.current++; - return () => void wizardCount.current--; - }, [wizardCount]); - return import_react448.default.createElement( - AnalyticsFunnel, - { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, flowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelType: "multi-page", optionalStepNumbers: props2.steps.map((step2, index) => step2.isOptional ? index + 1 : -1).filter((step2) => step2 !== -1), totalFunnelSteps: props2.steps.length, stepConfiguration: getStepConfiguration(props2.steps) }, - import_react448.default.createElement(InternalWizard, Object.assign({ isLoadingNextStep, allowSkipTo }, externalProps, baseComponentProps)) - ); -} -applyDisplayName(Wizard, "Wizard"); -var wizard_default = Wizard; -export { - alert_default as Alert, - AnchorNavigation, - AnnotationContext, - app_layout_default as AppLayout, - area_chart_default as AreaChart, - attribute_editor_default as AttributeEditor, - autosuggest_default as Autosuggest, - Badge, - bar_chart_default as BarChart, - Box, - BreadcrumbGroup, - button_default as Button, - button_dropdown_default as ButtonDropdown, - Calendar2 as Calendar, - cards_default as Cards, - checkbox_default as Checkbox, - code_editor_default as CodeEditor, - CollectionPreferences, - ColumnLayout2 as ColumnLayout, - Container, - ContentLayout, - CopyToClipboard, - date_input_default as DateInput, - date_picker_default as DatePicker, - date_range_picker_default as DateRangePicker, - Drawer2 as Drawer, - ExpandableSection, - file_upload_default as FileUpload, - Flashbar, - Form, - FormField, - Grid3 as Grid, - Header2 as Header, - HelpPanel, - Hotspot, - Icon, - input_default as Input, - line_chart_default as LineChart, - link_default as Link, - mixed_line_bar_chart_default as MixedLineBarChart, - Modal, - multiselect_default as Multiselect, - Pagination, - pie_chart_default2 as PieChart, - Popover, - ProgressBar, - property_filter_default as PropertyFilter, - radio_group_default as RadioGroup, - s3_resource_selector_default as S3ResourceSelector, - SegmentedControl, - select_default as Select, - SideNavigation, - SpaceBetween, - Spinner, - SplitPanel2 as SplitPanel, - StatusIndicator2 as StatusIndicator, - table_default as Table, - Tabs, - tag_editor_default as TagEditor, - TextContent, - text_filter_default as TextFilter, - textarea_default as Textarea, - tiles_default as Tiles, - time_input_default as TimeInput, - toggle_default as Toggle, - TokenGroup, - TopNavigation, - TutorialPanel, - wizard_default as Wizard -}; -/*! Bundled license information: - -react-is/cjs/react-is.development.js: - (** @license React v16.13.1 - * react-is.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - *) - -object-assign/index.js: - (* - object-assign - (c) Sindre Sorhus - @license MIT - *) -*/ -//# sourceMappingURL=@cloudscape-design_components.js.map diff --git a/website/node_modules/.vite/deps/@cloudscape-design_components.js.map b/website/node_modules/.vite/deps/@cloudscape-design_components.js.map deleted file mode 100644 index b981e8814..000000000 --- a/website/node_modules/.vite/deps/@cloudscape-design_components.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../balanced-match/index.js", "../../react-is/cjs/react-is.development.js", "../../react-is/index.js", "../../react-keyed-flatten-children/index.js", "../../object-assign/index.js", "../../prop-types/lib/ReactPropTypesSecret.js", "../../prop-types/lib/has.js", "../../prop-types/checkPropTypes.js", "../../prop-types/factoryWithTypeCheckers.js", "../../prop-types/index.js", "../../tslib/tslib.es6.mjs", "../../src/alert/index.tsx", "../../src/internal/utils/apply-display-name.ts", "../../src/alert/internal.tsx", "../../clsx/dist/clsx.m.js", "../../src/button/internal.tsx", "../../src/internal/events/index.ts", "../../src/internal/hooks/forward-focus/index.ts", "../../@cloudscape-design/components/button/styles.css.js", "../../src/button/icon-helper.tsx", "../../src/icon/internal.tsx", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/component-metadata.js", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/component-metrics.js", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/log-clients.js", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/formatters.js", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/metrics/metrics.js", "../../@cloudscape-design/component-toolkit/lib/internal/base-component/init-awsui-versions.js", "../../@juggle/resize-observer/lib/utils/resizeObservers.js", "../../@juggle/resize-observer/lib/algorithms/hasActiveObservations.js", "../../@juggle/resize-observer/lib/algorithms/hasSkippedObservations.js", "../../@juggle/resize-observer/lib/algorithms/deliverResizeLoopError.js", "../../@juggle/resize-observer/lib/ResizeObserverBoxOptions.js", "../../@juggle/resize-observer/lib/utils/freeze.js", "../../@juggle/resize-observer/lib/ResizeObserverSize.js", "../../@juggle/resize-observer/lib/DOMRectReadOnly.js", "../../@juggle/resize-observer/lib/utils/element.js", "../../@juggle/resize-observer/lib/utils/global.js", "../../@juggle/resize-observer/lib/algorithms/calculateBoxSize.js", "../../@juggle/resize-observer/lib/ResizeObserverEntry.js", "../../@juggle/resize-observer/lib/algorithms/calculateDepthForNode.js", "../../@juggle/resize-observer/lib/algorithms/broadcastActiveObservations.js", "../../@juggle/resize-observer/lib/algorithms/gatherActiveObservationsAtDepth.js", "../../@juggle/resize-observer/lib/utils/process.js", "../../@juggle/resize-observer/lib/utils/queueMicroTask.js", "../../@juggle/resize-observer/lib/utils/queueResizeObserver.js", "../../@juggle/resize-observer/lib/utils/scheduler.js", "../../@juggle/resize-observer/lib/ResizeObservation.js", "../../@juggle/resize-observer/lib/ResizeObserverDetail.js", "../../@juggle/resize-observer/lib/ResizeObserverController.js", "../../@juggle/resize-observer/lib/ResizeObserver.js", "../../@cloudscape-design/component-toolkit/lib/internal/container-queries/use-resize-observer.js", "../../@cloudscape-design/component-toolkit/lib/internal/stable-callback/index.js", "../../@cloudscape-design/component-toolkit/lib/internal/singleton-handler/index.js", "../../@cloudscape-design/component-toolkit/lib/internal/visual-mode/index.js", "../../@cloudscape-design/component-toolkit/lib/dom/find-up-until.js", "../../@cloudscape-design/component-toolkit/lib/dom/node-contains.js", "../../@cloudscape-design/component-toolkit/lib/internal/is-development.js", "../../@cloudscape-design/component-toolkit/lib/internal/logging.js", "../../@cloudscape-design/components/internal/environment.js", "../../@cloudscape-design/components/internal/base-component/styles.css.js", "../../src/internal/base-component/index.ts", "../../@cloudscape-design/components/icon/styles.css.js", "../../@cloudscape-design/components/icon/icons.js", "../../src/internal/hooks/use-merge-refs/index.tsx", "../../src/internal/hooks/use-visual-mode/index.ts", "../../src/spinner/internal.tsx", "../../@cloudscape-design/components/spinner/styles.css.js", "../../src/internal/utils/check-safe-url.ts", "../../src/internal/components/live-region/index.tsx", "../../src/internal/components/screenreader-only/index.tsx", "../../@cloudscape-design/components/internal/components/screenreader-only/styles.css.js", "../../@cloudscape-design/components/internal/components/live-region/styles.css.js", "../../src/internal/context/button-context.ts", "../../src/internal/analytics/hooks/use-funnel.ts", "../../src/internal/analytics/context/analytics-context.ts", "../../src/internal/analytics/selectors.ts", "../../src/internal/analytics/index.ts", "../../src/internal/utils/dom.ts", "../../src/internal/utils/calculate-once.ts", "../../src/internal/utils/node-belongs.ts", "../../src/internal/hooks/use-unique-id/index.ts", "../../src/internal/hooks/use-performance-marks.ts", "../../src/internal/hooks/use-effect-on-update.ts", "../../src/internal/context/single-tab-stop-navigation-context.tsx", "../../src/internal/components/visual-context/index.tsx", "../../@cloudscape-design/components/alert/styles.css.js", "../../src/internal/breakpoints.ts", "../../@cloudscape-design/component-toolkit/lib/container-queries/use-container-query.js", "../../@cloudscape-design/component-toolkit/lib/use-controllable-state/use-controllable-state.js", "../../src/internal/hooks/container-queries/use-container-breakpoints.ts", "../../src/i18n/context.ts", "../../src/internal/context/link-default-variant-context.ts", "../../src/internal/plugins/helpers/runtime-content-wrapper.tsx", "../../src/internal/plugins/helpers/use-discovered-action.tsx", "../../src/internal/debounce.ts", "../../src/internal/plugins/controllers/drawers.ts", "../../src/internal/plugins/helpers/utils.ts", "../../src/internal/plugins/controllers/action-buttons.ts", "../../src/internal/plugins/api.ts", "../../src/alert/actions-wrapper/index.tsx", "../../@cloudscape-design/components/alert/actions-wrapper/styles.css.js", "../../src/internal/hooks/use-telemetry/index.ts", "../../src/internal/hooks/focus-visible/index.ts", "../../src/internal/keycode.ts", "../../src/internal/hooks/use-base-component/index.ts", "../../src/anchor-navigation/index.tsx", "../../src/anchor-navigation/internal.tsx", "../../@cloudscape-design/components/anchor-navigation/styles.css.js", "../../@cloudscape-design/components/anchor-navigation/test-classes/styles.css.js", "../../src/anchor-navigation/use-scroll-spy.tsx", "../../src/annotation-context/index.tsx", "../../src/annotation-context/annotation/open-annotation.tsx", "../../src/annotation-context/annotation/annotation-trigger.tsx", "../../@cloudscape-design/components/annotation-context/annotation/styles.css.js", "../../src/annotation-context/annotation/annotation-icon.tsx", "../../src/annotation-context/annotation/annotation-popover.tsx", "../../src/box/internal.tsx", "../../@cloudscape-design/components/box/styles.css.js", "../../src/space-between/internal.tsx", "../../@cloudscape-design/components/space-between/styles.css.js", "../../src/popover/container.tsx", "../../@cloudscape-design/components/popover/styles.css.js", "../../src/popover/use-popover-position.ts", "../../src/popover/utils/positions.ts", "../../src/internal/utils/scrollable-containers.ts", "../../src/internal/direction.ts", "../../src/popover/body.tsx", "../../src/internal/components/focus-lock/index.tsx", "../../src/internal/components/tab-trap/index.tsx", "../../src/internal/components/focus-lock/utils.ts", "../../src/internal/utils/strings/join-strings.ts", "../../src/annotation-context/annotation/closed-annotation.tsx", "../../src/annotation-context/context.ts", "../../src/annotation-context/utils.ts", "../../src/app-layout/index.tsx", "../../src/app-layout/widget.tsx", "../../src/internal/utils/global-flags.ts", "../../src/app-layout/implementation.tsx", "../../src/app-layout/classic.tsx", "../../src/internal/hooks/use-controllable/index.ts", "../../src/internal/is-development.ts", "../../src/internal/hooks/use-mobile/index.ts", "../../src/app-layout/notifications/index.tsx", "../../@cloudscape-design/components/app-layout/notifications/styles.css.js", "../../src/app-layout/mobile-toolbar/index.tsx", "../../src/app-layout/toggles/index.tsx", "../../@cloudscape-design/components/app-layout/toggles/styles.css.js", "../../src/app-layout/drawer/overflow-menu.tsx", "../../src/button-dropdown/internal.tsx", "../../@cloudscape-design/components/button-dropdown/styles.css.js", "../../@cloudscape-design/components/internal/components/dropdown/styles.css.js", "../../src/internal/components/dropdown/index.tsx", "../../src/internal/components/dropdown/dropdown-fit-handler.ts", "../../src/internal/components/transition/index.tsx", "../../@babel/runtime/helpers/esm/extends.js", "../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../@babel/runtime/helpers/esm/setPrototypeOf.js", "../../@babel/runtime/helpers/esm/inheritsLoose.js", "../../react-transition-group/esm/CSSTransition.js", "../../dom-helpers/esm/hasClass.js", "../../dom-helpers/esm/addClass.js", "../../dom-helpers/esm/removeClass.js", "../../react-transition-group/esm/Transition.js", "../../react-transition-group/esm/config.js", "../../react-transition-group/esm/utils/PropTypes.js", "../../react-transition-group/esm/TransitionGroupContext.js", "../../react-transition-group/esm/utils/reflow.js", "../../react-transition-group/esm/ReplaceTransition.js", "../../@babel/runtime/helpers/esm/assertThisInitialized.js", "../../react-transition-group/esm/TransitionGroup.js", "../../react-transition-group/esm/utils/ChildMapping.js", "../../react-transition-group/esm/SwitchTransition.js", "../../src/internal/hooks/use-portal-mode-classes/index.ts", "../../src/internal/components/dropdown/context.tsx", "../../src/internal/generated/custom-css-properties/index.ts", "../../src/button-dropdown/items-list.tsx", "../../src/button-dropdown/item-element/index.tsx", "../../src/button-dropdown/utils/utils.ts", "../../@cloudscape-design/components/button-dropdown/item-element/styles.css.js", "../../src/button-dropdown/tooltip.tsx", "../../src/popover/arrow.tsx", "../../src/internal/components/portal/index.tsx", "../../src/button-dropdown/utils/use-hidden-description.tsx", "../../src/button-dropdown/utils/menu-item.ts", "../../src/button-dropdown/category-elements/expandable-category-element.tsx", "../../@cloudscape-design/components/button-dropdown/category-elements/styles.css.js", "../../src/button-dropdown/category-elements/category-element.tsx", "../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx", "../../src/button-dropdown/mobile-expandable-group/mobile-expandable-group.tsx", "../../@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.css.js", "../../src/internal/components/options-list/utils/use-open-state.ts", "../../src/button-dropdown/utils/use-highlighted-menu.ts", "../../src/button-dropdown/utils/create-items-tree.ts", "../../src/button-dropdown/utils/move-highlight.ts", "../../src/button-dropdown/utils/use-button-dropdown.ts", "../../src/internal/components/options-list/index.tsx", "../../@cloudscape-design/components/internal/components/options-list/styles.css.js", "../../@cloudscape-design/components/app-layout/test-classes/styles.css.js", "../../@cloudscape-design/components/app-layout/mobile-toolbar/styles.css.js", "../../@cloudscape-design/components/app-layout/styles.css.js", "../../src/app-layout/drawer/drawers-helpers.ts", "../../src/app-layout/utils/use-drawers.ts", "../../src/app-layout/runtime-api.tsx", "../../src/app-layout/utils/use-focus-control.ts", "../../src/internal/context/app-layout-context.ts", "../../src/split-panel/utils/size-utils.ts", "../../src/app-layout/content-wrapper/index.tsx", "../../@cloudscape-design/components/app-layout/content-wrapper/styles.css.js", "../../src/app-layout/drawer/index.tsx", "../../@cloudscape-design/components/app-layout/drawer/styles.css.js", "../../src/app-layout/drawer/resizable-drawer.tsx", "../../src/app-layout/utils/use-pointer-events.ts", "../../src/app-layout/utils/use-keyboard-events.ts", "../../src/split-panel/icons/resize-handler.tsx", "../../@cloudscape-design/components/split-panel/styles.css.js", "../../src/app-layout/split-panel/constants.ts", "../../src/app-layout/split-panel/drawer.tsx", "../../@cloudscape-design/components/app-layout/split-panel/styles.css.js", "../../src/internal/context/split-panel-context.ts", "../../src/app-layout/split-panel/provider.tsx", "../../src/app-layout/utils/use-split-panel-focus-control.ts", "../../src/app-layout/visual-refresh/index.tsx", "../../src/app-layout/visual-refresh/context.tsx", "../../src/internal/context/dynamic-overlap-context.ts", "../../src/app-layout/visual-refresh/split-panel.tsx", "../../@cloudscape-design/components/app-layout/visual-refresh/styles.css.js", "../../src/app-layout/utils/use-resize.tsx", "../../src/app-layout/visual-refresh/use-background-overlap.tsx", "../../src/app-layout/visual-refresh/background.tsx", "../../src/internal/utils/content-header-utils.ts", "../../src/app-layout/visual-refresh/breadcrumbs.tsx", "../../src/app-layout/visual-refresh/drawers.tsx", "../../src/app-layout/visual-refresh/trigger-button.tsx", "../../src/app-layout/visual-refresh/header.tsx", "../../src/app-layout/visual-refresh/layout.tsx", "../../src/app-layout/visual-refresh/main.tsx", "../../src/app-layout/visual-refresh/mobile-toolbar.tsx", "../../src/app-layout/visual-refresh/navigation.tsx", "../../src/app-layout/visual-refresh/notifications.tsx", "../../src/app-layout/visual-refresh/tools.tsx", "../../src/app-layout/internal.tsx", "../../src/app-layout/defaults.ts", "../../src/app-layout/utils/use-app-layout-placement.ts", "../../src/app-layout/utils/use-observed-element.ts", "../../src/area-chart/index.tsx", "../../src/area-chart/internal.tsx", "../../src/internal/components/chart-status-container/index.tsx", "../../src/status-indicator/internal.tsx", "../../@cloudscape-design/components/status-indicator/styles.css.js", "../../src/link/internal.tsx", "../../@cloudscape-design/components/link/styles.css.js", "../../src/internal/context/info-link-label-context.ts", "../../@cloudscape-design/components/internal/components/chart-status-container/styles.css.js", "../../src/area-chart/elements/area-chart-filter.tsx", "../../src/internal/components/chart-filter/index.tsx", "../../src/form-field/internal.tsx", "../../src/internal/context/form-field-context.ts", "../../src/grid/internal.tsx", "../../@cloudscape-design/components/grid/styles.css.js", "../../src/form-field/util.ts", "../../@cloudscape-design/components/form-field/styles.css.js", "../../src/internal/utils/strings/pad-left-zeros.ts", "../../src/multiselect/internal.tsx", "../../src/internal/components/option/utils/filter-options.ts", "../../src/internal/components/dropdown-footer/index.tsx", "../../@cloudscape-design/components/internal/components/dropdown-footer/styles.css.js", "../../src/internal/components/dropdown-status/index.tsx", "../../src/internal/hooks/use-previous/index.ts", "../../@cloudscape-design/components/internal/components/dropdown-status/styles.css.js", "../../src/internal/components/option/utils/flatten-options.ts", "../../src/internal/components/options-list/utils/test-indexes.ts", "../../src/internal/components/option/utils/prepare-options.ts", "../../src/select/utils/use-select.ts", "../../src/internal/components/options-list/utils/use-highlight-option.ts", "../../src/internal/components/options-list/utils/use-keyboard.ts", "../../src/internal/components/options-list/utils/use-ids.ts", "../../src/select/utils/connect-options.ts", "../../src/select/utils/use-native-search.ts", "../../src/internal/hooks/use-debounce-callback/index.ts", "../../src/select/utils/use-load-items.ts", "../../src/select/utils/use-announcement.ts", "../../src/internal/components/option/option-announcer.ts", "../../src/select/parts/plain-list.tsx", "../../src/select/utils/render-options.tsx", "../../src/select/parts/item.tsx", "../../@cloudscape-design/components/select/parts/styles.css.js", "../../src/internal/components/option/index.tsx", "../../@cloudscape-design/components/internal/components/option/styles.css.js", "../../src/internal/components/option/option-parts.tsx", "../../src/internal/components/option/highlight-match.tsx", "../../src/internal/components/selectable-item/index.tsx", "../../@cloudscape-design/components/internal/components/selectable-item/styles.css.js", "../../src/internal/components/checkbox-icon/index.tsx", "../../@cloudscape-design/components/internal/components/checkbox-icon/styles.css.js", "../../src/select/parts/multiselect-item.tsx", "../../src/select/utils/get-item-props.ts", "../../src/select/parts/virtual-list.tsx", "../../src/internal/hooks/use-virtual/index.ts", "../../@cloudscape-design/components/internal/vendor/react-virtual.js", "../../src/select/utils/check-option-value-field.ts", "../../src/select/parts/filter.tsx", "../../src/input/internal.tsx", "../../src/input/utils.ts", "../../@cloudscape-design/components/input/styles.css.js", "../../src/select/parts/trigger.tsx", "../../src/internal/components/button-trigger/index.tsx", "../../@cloudscape-design/components/internal/components/button-trigger/styles.css.js", "../../src/token-group/internal.tsx", "../../src/internal/hooks/check-controlled/index.ts", "../../@cloudscape-design/components/token-group/styles.css.js", "../../src/internal/components/token-list/index.tsx", "../../src/internal/components/token-list/token-limit-toggle.tsx", "../../@cloudscape-design/components/internal/components/token-list/styles.css.js", "../../src/internal/components/token-list/token-focus-controller.tsx", "../../src/token-group/token.tsx", "../../src/token-group/dismiss-button.tsx", "../../@cloudscape-design/components/multiselect/styles.css.js", "../../src/internal/components/chart-series-marker/index.tsx", "../../@cloudscape-design/components/internal/components/chart-series-marker/styles.css.js", "../../@cloudscape-design/components/internal/components/chart-filter/styles.css.js", "../../src/area-chart/elements/area-chart-legend.tsx", "../../src/internal/components/chart-legend/index.tsx", "../../@cloudscape-design/components/internal/components/chart-legend/styles.css.js", "../../src/area-chart/async-store/index.ts", "../../src/area-chart/chart-container.tsx", "../../src/internal/components/chart-plot/index.tsx", "../../@cloudscape-design/components/internal/components/chart-plot/styles.css.js", "../../src/internal/components/chart-plot/application-controller.tsx", "../../src/internal/components/chart-plot/focus-outline.tsx", "../../src/internal/components/cartesian-chart/axis-label.tsx", "../../@cloudscape-design/components/internal/components/cartesian-chart/styles.css.js", "../../src/internal/components/cartesian-chart/labels-measure.tsx", "../../src/internal/components/cartesian-chart/left-labels.tsx", "../../src/internal/components/cartesian-chart/constants.ts", "../../src/internal/components/cartesian-chart/label-utils.ts", "../../src/internal/components/responsive-text/index.tsx", "../../src/internal/components/responsive-text/responsive-text-utils.ts", "../../src/internal/components/cartesian-chart/bottom-labels.tsx", "../../src/internal/components/cartesian-chart/emphasized-baseline.tsx", "../../src/area-chart/elements/data-series.tsx", "../../src/area-chart/elements/area-series.tsx", "../../d3-path/src/path.js", "../../d3-shape/src/constant.js", "../../d3-shape/src/math.js", "../../d3-shape/src/arc.js", "../../d3-shape/src/curve/linear.js", "../../d3-shape/src/point.js", "../../d3-shape/src/line.js", "../../d3-shape/src/area.js", "../../d3-shape/src/descending.js", "../../d3-shape/src/identity.js", "../../d3-shape/src/pie.js", "../../d3-shape/src/curve/radial.js", "../../d3-shape/src/array.js", "../../d3-shape/src/symbol/diamond.js", "../../d3-shape/src/symbol/star.js", "../../d3-shape/src/symbol/triangle.js", "../../d3-shape/src/symbol/wye.js", "../../d3-shape/src/noop.js", "../../d3-shape/src/curve/basis.js", "../../d3-shape/src/curve/basisClosed.js", "../../d3-shape/src/curve/basisOpen.js", "../../d3-shape/src/curve/bundle.js", "../../d3-shape/src/curve/cardinal.js", "../../d3-shape/src/curve/cardinalClosed.js", "../../d3-shape/src/curve/cardinalOpen.js", "../../d3-shape/src/curve/catmullRom.js", "../../d3-shape/src/curve/catmullRomClosed.js", "../../d3-shape/src/curve/catmullRomOpen.js", "../../d3-shape/src/curve/linearClosed.js", "../../d3-shape/src/curve/monotone.js", "../../d3-shape/src/curve/natural.js", "../../d3-shape/src/curve/step.js", "../../src/area-chart/elements/threshold-series.tsx", "../../@cloudscape-design/components/area-chart/styles.css.js", "../../src/area-chart/elements/chart-popover.tsx", "../../src/internal/components/chart-popover/index.tsx", "../../@cloudscape-design/components/internal/components/chart-popover/styles.css.js", "../../src/internal/components/chart-series-details/index.tsx", "../../@cloudscape-design/components/internal/components/chart-series-details/styles.css.js", "../../src/expandable-section/internal.tsx", "../../@cloudscape-design/components/expandable-section/styles.css.js", "../../src/container/internal.tsx", "../../src/container/use-sticky-header.ts", "../../src/internal/hooks/use-dynamic-overlap/index.ts", "../../@cloudscape-design/components/container/styles.css.js", "../../src/internal/context/modal-context.ts", "../../src/expandable-section/expandable-section-container.tsx", "../../src/internal/analytics/components/analytics-funnel.tsx", "../../src/expandable-section/expandable-section-header.tsx", "../../src/header/internal.tsx", "../../@cloudscape-design/components/header/styles.css.js", "../../src/internal/context/collection-label-context.ts", "../../src/expandable-section/utils.ts", "../../src/internal/components/chart-series-details/series-details-text.ts", "../../src/internal/components/chart-popover-footer/index.tsx", "../../@cloudscape-design/components/internal/components/chart-popover-footer/styles.css.js", "../../src/area-chart/elements/highlighted-point.tsx", "../../src/internal/components/cartesian-chart/highlighted-point.tsx", "../../src/area-chart/elements/vertical-marker.tsx", "../../src/internal/components/cartesian-chart/vertical-marker.tsx", "../../src/area-chart/elements/use-highlight-details.ts", "../../src/internal/utils/use-container-width.ts", "../../src/internal/components/cartesian-chart/chart-container.tsx", "../../src/area-chart/model/use-chart-model.ts", "../../src/area-chart/model/utils.ts", "../../@babel/runtime/helpers/esm/typeof.js", "../../date-fns/esm/_lib/toInteger/index.js", "../../date-fns/esm/_lib/requiredArgs/index.js", "../../date-fns/esm/toDate/index.js", "../../date-fns/esm/addDays/index.js", "../../date-fns/esm/addMonths/index.js", "../../date-fns/esm/add/index.js", "../../date-fns/esm/addMilliseconds/index.js", "../../date-fns/esm/_lib/defaultOptions/index.js", "../../date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js", "../../date-fns/esm/startOfDay/index.js", "../../date-fns/esm/differenceInCalendarDays/index.js", "../../date-fns/esm/addMinutes/index.js", "../../date-fns/esm/addWeeks/index.js", "../../date-fns/esm/addYears/index.js", "../../date-fns/esm/max/index.js", "../../date-fns/esm/min/index.js", "../../date-fns/esm/compareAsc/index.js", "../../date-fns/esm/constants/index.js", "../../date-fns/esm/isSameDay/index.js", "../../date-fns/esm/differenceInCalendarYears/index.js", "../../date-fns/esm/differenceInDays/index.js", "../../date-fns/esm/endOfDay/index.js", "../../date-fns/esm/endOfMonth/index.js", "../../date-fns/esm/isLastDayOfMonth/index.js", "../../date-fns/esm/differenceInYears/index.js", "../../date-fns/esm/startOfMonth/index.js", "../../date-fns/esm/startOfYear/index.js", "../../date-fns/esm/_lib/startOfUTCISOWeek/index.js", "../../date-fns/esm/_lib/getUTCISOWeekYear/index.js", "../../date-fns/esm/_lib/startOfUTCISOWeekYear/index.js", "../../date-fns/esm/_lib/getUTCISOWeek/index.js", "../../date-fns/esm/_lib/startOfUTCWeek/index.js", "../../date-fns/esm/_lib/getUTCWeekYear/index.js", "../../date-fns/esm/_lib/startOfUTCWeekYear/index.js", "../../date-fns/esm/_lib/getUTCWeek/index.js", "../../date-fns/esm/locale/_lib/buildFormatLongFn/index.js", "../../date-fns/esm/locale/en-US/_lib/formatLong/index.js", "../../date-fns/esm/locale/_lib/buildLocalizeFn/index.js", "../../date-fns/esm/locale/en-US/_lib/localize/index.js", "../../date-fns/esm/locale/_lib/buildMatchFn/index.js", "../../date-fns/esm/locale/_lib/buildMatchPatternFn/index.js", "../../date-fns/esm/locale/en-US/_lib/match/index.js", "../../date-fns/esm/formatDistanceStrict/index.js", "../../date-fns/esm/getDaysInMonth/index.js", "../../date-fns/esm/getOverlappingDaysInIntervals/index.js", "../../date-fns/esm/isAfter/index.js", "../../date-fns/esm/isBefore/index.js", "../../@babel/runtime/helpers/esm/inherits.js", "../../@babel/runtime/helpers/esm/getPrototypeOf.js", "../../@babel/runtime/helpers/esm/isNativeReflectConstruct.js", "../../@babel/runtime/helpers/esm/possibleConstructorReturn.js", "../../@babel/runtime/helpers/esm/createSuper.js", "../../@babel/runtime/helpers/esm/classCallCheck.js", "../../@babel/runtime/helpers/esm/toPrimitive.js", "../../@babel/runtime/helpers/esm/toPropertyKey.js", "../../@babel/runtime/helpers/esm/createClass.js", "../../@babel/runtime/helpers/esm/defineProperty.js", "../../date-fns/esm/parse/_lib/Setter.js", "../../date-fns/esm/parse/_lib/Parser.js", "../../date-fns/esm/parse/_lib/parsers/EraParser.js", "../../date-fns/esm/parse/_lib/constants.js", "../../date-fns/esm/parse/_lib/utils.js", "../../date-fns/esm/parse/_lib/parsers/YearParser.js", "../../date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js", "../../date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js", "../../date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js", "../../date-fns/esm/parse/_lib/parsers/QuarterParser.js", "../../date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js", "../../date-fns/esm/parse/_lib/parsers/MonthParser.js", "../../date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js", "../../date-fns/esm/_lib/setUTCWeek/index.js", "../../date-fns/esm/parse/_lib/parsers/LocalWeekParser.js", "../../date-fns/esm/_lib/setUTCISOWeek/index.js", "../../date-fns/esm/parse/_lib/parsers/ISOWeekParser.js", "../../date-fns/esm/parse/_lib/parsers/DateParser.js", "../../date-fns/esm/parse/_lib/parsers/DayOfYearParser.js", "../../date-fns/esm/_lib/setUTCDay/index.js", "../../date-fns/esm/parse/_lib/parsers/DayParser.js", "../../date-fns/esm/parse/_lib/parsers/LocalDayParser.js", "../../date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js", "../../date-fns/esm/_lib/setUTCISODay/index.js", "../../date-fns/esm/parse/_lib/parsers/ISODayParser.js", "../../date-fns/esm/parse/_lib/parsers/AMPMParser.js", "../../date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js", "../../date-fns/esm/parse/_lib/parsers/DayPeriodParser.js", "../../date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js", "../../date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js", "../../date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js", "../../date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js", "../../date-fns/esm/parse/_lib/parsers/MinuteParser.js", "../../date-fns/esm/parse/_lib/parsers/SecondParser.js", "../../date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js", "../../date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js", "../../date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js", "../../date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js", "../../date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js", "../../date-fns/esm/parse/_lib/parsers/index.js", "../../date-fns/esm/isSameMonth/index.js", "../../date-fns/esm/isSameYear/index.js", "../../date-fns/esm/isToday/index.js", "../../src/internal/components/cartesian-chart/ticks.ts", "../../@cloudscape-design/components/internal/vendor/d3-scale.js", "../../src/internal/components/cartesian-chart/scales.ts", "../../src/area-chart/model/compute-chart-props.ts", "../../@cloudscape-design/components/internal/generated/styles/tokens.js", "../../src/internal/styles/colors.ts", "../../src/internal/utils/create-category-color-scale.ts", "../../src/area-chart/model/create-series-decorator.ts", "../../src/area-chart/model/interactions-store.ts", "../../src/internal/utils/throttle.ts", "../../src/internal/hooks/container-queries/use-height-measure.ts", "../../src/area-chart/model/use-filter-props.ts", "../../src/area-chart/model/use-highlight-props.ts", "../../src/internal/components/chart-wrapper/index.tsx", "../../@cloudscape-design/components/internal/components/chart-wrapper/styles.css.js", "../../src/attribute-editor/index.tsx", "../../src/attribute-editor/internal.tsx", "../../src/attribute-editor/additional-info.tsx", "../../@cloudscape-design/components/attribute-editor/styles.css.js", "../../src/attribute-editor/row.tsx", "../../src/column-layout/internal.tsx", "../../src/column-layout/flexible-column-layout/index.tsx", "../../@cloudscape-design/components/column-layout/flexible-column-layout/styles.css.js", "../../src/column-layout/grid-column-layout.tsx", "../../src/column-layout/util.tsx", "../../@cloudscape-design/components/column-layout/styles.css.js", "../../src/autosuggest/index.tsx", "../../src/autosuggest/internal.tsx", "../../src/autosuggest/options-controller.ts", "../../src/autosuggest/utils/utils.ts", "../../src/autosuggest/options-list.tsx", "../../src/autosuggest/virtual-list.tsx", "../../src/autosuggest/autosuggest-option.tsx", "../../@cloudscape-design/components/autosuggest/styles.css.js", "../../src/autosuggest/plain-list.tsx", "../../src/autosuggest/load-more-controller.ts", "../../src/internal/components/autosuggest-input/index.tsx", "../../@cloudscape-design/components/internal/components/autosuggest-input/styles.css.js", "../../src/internal/utils/external-props.ts", "../../src/badge/index.tsx", "../../@cloudscape-design/components/badge/styles.css.js", "../../src/bar-chart/index.tsx", "../../@cloudscape-design/components/bar-chart/styles.css.js", "../../src/mixed-line-bar-chart/internal.tsx", "../../src/mixed-line-bar-chart/chart-legend.tsx", "../../src/mixed-line-bar-chart/utils.ts", "../../src/mixed-line-bar-chart/chart-container.tsx", "../../src/internal/components/cartesian-chart/vertical-grid-lines.tsx", "../../src/mixed-line-bar-chart/chart-popover.tsx", "../../@cloudscape-design/components/mixed-line-bar-chart/styles.css.js", "../../src/mixed-line-bar-chart/domain.ts", "../../src/mixed-line-bar-chart/make-scaled-series.ts", "../../src/mixed-line-bar-chart/make-scaled-bar-groups.ts", "../../src/mixed-line-bar-chart/format-highlighted.ts", "../../src/mixed-line-bar-chart/data-series.tsx", "../../src/mixed-line-bar-chart/line-series.tsx", "../../src/mixed-line-bar-chart/bar-series.tsx", "../../src/mixed-line-bar-chart/bar-groups.tsx", "../../src/mixed-line-bar-chart/hooks/use-mouse-hover.ts", "../../src/mixed-line-bar-chart/hooks/use-navigation.ts", "../../src/mixed-line-bar-chart/hooks/use-popover.ts", "../../src/box/index.tsx", "../../src/breadcrumb-group/index.tsx", "../../src/breadcrumb-group/internal.tsx", "../../@cloudscape-design/components/breadcrumb-group/styles.css.js", "../../src/breadcrumb-group/item/item.tsx", "../../@cloudscape-design/components/breadcrumb-group/item/styles.css.js", "../../src/internal/components/tooltip/index.tsx", "../../@cloudscape-design/components/internal/components/tooltip/styles.css.js", "../../src/button/index.tsx", "../../src/button-dropdown/index.tsx", "../../src/calendar/index.tsx", "../../src/calendar/internal.tsx", "../../@cloudscape-design/components/calendar/styles.css.js", "../../src/calendar/header/index.tsx", "../../src/calendar/header/header-button.tsx", "../../src/calendar/grid/index.tsx", "../../src/internal/utils/locale/merge-locales.ts", "../../src/internal/utils/locale/normalize-locale.ts", "../../weekstart/src/api.js", "../../weekstart/src/langRegionMap.js", "../../weekstart/src/regionDayMap.js", "../../weekstart/src/main.js", "../../src/internal/utils/locale/normalize-start-of-week.ts", "../../src/internal/utils/date-time/display-format.ts", "../../src/internal/utils/date-time/is-iso-date-only.ts", "../../src/internal/utils/date-time/format-time-offset.ts", "../../src/internal/utils/date-time/format-date-iso.ts", "../../src/internal/utils/date-time/format-date-localized.ts", "../../src/internal/utils/date-time/format-date-range.ts", "../../src/internal/utils/date-time/format-date.ts", "../../src/internal/utils/date-time/format-time.ts", "../../src/internal/utils/date-time/format-date-time.ts", "../../src/internal/utils/date-time/join-date-time.ts", "../../src/internal/utils/date-time/parse-date.ts", "../../src/internal/utils/date-time/parse-timezone-offset.ts", "../../src/internal/utils/date-time/shift-timezone-offset.ts", "../../src/calendar/utils/navigation.ts", "../../src/internal/hooks/use-date-cache/index.ts", "../../src/calendar/utils/intl.ts", "../../src/calendar/use-calendar-labels.ts", "../../src/calendar/grid/use-calendar-grid-rows.ts", "../../mnth/web/add-days.ts", "../../mnth/web/set-date.ts", "../../mnth/web/index.ts", "../../src/internal/utils/handle-key.ts", "../../src/calendar/grid/use-calendar-grid-keyboard-navigation.ts", "../../src/calendar/grid/calendar-grid-header.tsx", "../../src/cards/index.tsx", "../../@cloudscape-design/components/cards/styles.css.js", "../../src/cards/cards-layout-helper.ts", "../../src/table/tools-header.tsx", "../../@cloudscape-design/components/table/styles.css.js", "../../src/table/utils.ts", "../../src/table/selection/selection-control.tsx", "../../src/checkbox/internal.tsx", "../../src/internal/components/abstract-switch/index.tsx", "../../@cloudscape-design/components/internal/components/abstract-switch/styles.css.js", "../../@cloudscape-design/components/checkbox/styles.css.js", "../../src/radio-group/radio-button.tsx", "../../@cloudscape-design/components/radio-group/styles.css.js", "../../@cloudscape-design/components/table/selection/styles.css.js", "../../src/table/selection/utils.ts", "../../src/table/selection/use-selection-focus-move.ts", "../../src/table/selection/use-selection.ts", "../../src/table/sticky-scrolling.ts", "../../src/internal/hooks/use-mouse-down-target.ts", "../../src/checkbox/index.tsx", "../../src/code-editor/index.tsx", "../../src/code-editor/pane.tsx", "../../src/code-editor/resizable-box/index.tsx", "../../@cloudscape-design/components/code-editor/resizable-box/styles.css.js", "../../@cloudscape-design/components/code-editor/styles.css.js", "../../src/code-editor/ace-modes.ts", "../../src/code-editor/ace-themes.ts", "../../src/code-editor/util.ts", "../../src/code-editor/listeners.ts", "../../src/code-editor/setup-editor.ts", "../../src/code-editor/preferences-modal.tsx", "../../src/modal/internal.tsx", "../../@cloudscape-design/components/modal/styles.css.js", "../../src/internal/utils/browser-scrollbar-size.ts", "../../src/modal/body-scroll.ts", "../../src/internal/hooks/use-intersection-observer/index.ts", "../../src/internal/context/reset-contexts-for-modal.tsx", "../../src/select/internal.tsx", "../../@cloudscape-design/components/select/styles.css.js", "../../src/code-editor/loading-screen.tsx", "../../src/code-editor/error-screen.tsx", "../../src/code-editor/status-bar.tsx", "../../src/code-editor/tab-button.tsx", "../../src/code-editor/use-editor.tsx", "../../src/collection-preferences/index.tsx", "../../src/collection-preferences/utils.tsx", "../../src/radio-group/internal.tsx", "../../src/internal/hooks/forward-focus/radio-group.ts", "../../@cloudscape-design/components/collection-preferences/styles.css.js", "../../src/collection-preferences/visible-content.tsx", "../../src/toggle/internal.tsx", "../../@cloudscape-design/components/toggle/styles.css.js", "../../src/collection-preferences/content-display/index.tsx", "../../src/collection-preferences/content-display/utils.ts", "../../@dnd-kit/utilities/src/hooks/useCombinedRefs.ts", "../../@dnd-kit/utilities/src/execution-context/canUseDOM.ts", "../../@dnd-kit/utilities/src/type-guards/isWindow.ts", "../../@dnd-kit/utilities/src/type-guards/isNode.ts", "../../@dnd-kit/utilities/src/execution-context/getWindow.ts", "../../@dnd-kit/utilities/src/type-guards/isDocument.ts", "../../@dnd-kit/utilities/src/type-guards/isHTMLElement.ts", "../../@dnd-kit/utilities/src/type-guards/isSVGElement.ts", "../../@dnd-kit/utilities/src/execution-context/getOwnerDocument.ts", "../../@dnd-kit/utilities/src/hooks/useIsomorphicLayoutEffect.ts", "../../@dnd-kit/utilities/src/hooks/useEvent.ts", "../../@dnd-kit/utilities/src/hooks/useInterval.ts", "../../@dnd-kit/utilities/src/hooks/useLatestValue.ts", "../../@dnd-kit/utilities/src/hooks/useLazyMemo.ts", "../../@dnd-kit/utilities/src/hooks/useNodeRef.ts", "../../@dnd-kit/utilities/src/hooks/usePrevious.ts", "../../@dnd-kit/utilities/src/hooks/useUniqueId.ts", "../../@dnd-kit/utilities/src/adjustment.ts", "../../@dnd-kit/utilities/src/event/hasViewportRelativeCoordinates.ts", "../../@dnd-kit/utilities/src/event/isKeyboardEvent.ts", "../../@dnd-kit/utilities/src/event/isTouchEvent.ts", "../../@dnd-kit/utilities/src/coordinates/getEventCoordinates.ts", "../../@dnd-kit/utilities/src/css.ts", "../../@dnd-kit/utilities/src/focus/findFirstFocusableNode.ts", "../../@dnd-kit/accessibility/src/components/HiddenText/HiddenText.tsx", "../../@dnd-kit/accessibility/src/components/LiveRegion/LiveRegion.tsx", "../../@dnd-kit/accessibility/src/hooks/useAnnouncement.ts", "../../@dnd-kit/core/src/components/DndMonitor/context.ts", "../../@dnd-kit/core/src/components/DndMonitor/useDndMonitor.ts", "../../@dnd-kit/core/src/components/DndMonitor/useDndMonitorProvider.tsx", "../../@dnd-kit/core/src/components/Accessibility/defaults.ts", "../../@dnd-kit/core/src/components/Accessibility/Accessibility.tsx", "../../@dnd-kit/core/src/store/actions.ts", "../../@dnd-kit/core/src/utilities/other/noop.ts", "../../@dnd-kit/core/src/sensors/useSensor.ts", "../../@dnd-kit/core/src/sensors/useSensors.ts", "../../@dnd-kit/core/src/utilities/coordinates/constants.ts", "../../@dnd-kit/core/src/utilities/coordinates/distanceBetweenPoints.ts", "../../@dnd-kit/core/src/utilities/coordinates/getRelativeTransformOrigin.ts", "../../@dnd-kit/core/src/utilities/algorithms/helpers.ts", "../../@dnd-kit/core/src/utilities/algorithms/closestCenter.ts", "../../@dnd-kit/core/src/utilities/algorithms/closestCorners.ts", "../../@dnd-kit/core/src/utilities/algorithms/rectIntersection.ts", "../../@dnd-kit/core/src/utilities/algorithms/pointerWithin.ts", "../../@dnd-kit/core/src/utilities/rect/adjustScale.ts", "../../@dnd-kit/core/src/utilities/rect/getRectDelta.ts", "../../@dnd-kit/core/src/utilities/rect/rectAdjustment.ts", "../../@dnd-kit/core/src/utilities/transform/parseTransform.ts", "../../@dnd-kit/core/src/utilities/transform/inverseTransform.ts", "../../@dnd-kit/core/src/utilities/rect/getRect.ts", "../../@dnd-kit/core/src/utilities/rect/getWindowClientRect.ts", "../../@dnd-kit/core/src/utilities/scroll/isFixed.ts", "../../@dnd-kit/core/src/utilities/scroll/isScrollable.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollableAncestors.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollableElement.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollCoordinates.ts", "../../@dnd-kit/core/src/types/direction.ts", "../../@dnd-kit/core/src/utilities/scroll/documentScrollingElement.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollPosition.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollDirectionAndSpeed.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollElementRect.ts", "../../@dnd-kit/core/src/utilities/scroll/getScrollOffsets.ts", "../../@dnd-kit/core/src/utilities/scroll/scrollIntoViewIfNeeded.ts", "../../@dnd-kit/core/src/utilities/rect/Rect.ts", "../../@dnd-kit/core/src/sensors/utilities/Listeners.ts", "../../@dnd-kit/core/src/sensors/utilities/getEventListenerTarget.ts", "../../@dnd-kit/core/src/sensors/utilities/hasExceededDistance.ts", "../../@dnd-kit/core/src/sensors/events.ts", "../../@dnd-kit/core/src/sensors/keyboard/types.ts", "../../@dnd-kit/core/src/sensors/keyboard/defaults.ts", "../../@dnd-kit/core/src/sensors/keyboard/KeyboardSensor.ts", "../../@dnd-kit/core/src/sensors/pointer/AbstractPointerSensor.ts", "../../@dnd-kit/core/src/sensors/pointer/PointerSensor.ts", "../../@dnd-kit/core/src/sensors/mouse/MouseSensor.ts", "../../@dnd-kit/core/src/sensors/touch/TouchSensor.ts", "../../@dnd-kit/core/src/hooks/utilities/useAutoScroller.ts", "../../@dnd-kit/core/src/hooks/utilities/useCachedNode.ts", "../../@dnd-kit/core/src/hooks/utilities/useCombineActivators.ts", "../../@dnd-kit/core/src/hooks/utilities/useDroppableMeasuring.ts", "../../@dnd-kit/core/src/hooks/utilities/useInitialValue.ts", "../../@dnd-kit/core/src/hooks/utilities/useInitialRect.ts", "../../@dnd-kit/core/src/hooks/utilities/useMutationObserver.ts", "../../@dnd-kit/core/src/hooks/utilities/useResizeObserver.ts", "../../@dnd-kit/core/src/hooks/utilities/useRect.ts", "../../@dnd-kit/core/src/hooks/utilities/useRectDelta.ts", "../../@dnd-kit/core/src/hooks/utilities/useScrollableAncestors.ts", "../../@dnd-kit/core/src/hooks/utilities/useScrollOffsets.ts", "../../@dnd-kit/core/src/hooks/utilities/useScrollOffsetsDelta.ts", "../../@dnd-kit/core/src/hooks/utilities/useSensorSetup.ts", "../../@dnd-kit/core/src/hooks/utilities/useSyntheticListeners.ts", "../../@dnd-kit/core/src/hooks/utilities/useWindowRect.ts", "../../@dnd-kit/core/src/hooks/utilities/useRects.ts", "../../@dnd-kit/core/src/utilities/nodes/getMeasurableNode.ts", "../../@dnd-kit/core/src/hooks/utilities/useDragOverlayMeasuring.ts", "../../@dnd-kit/core/src/components/DndContext/defaults.ts", "../../@dnd-kit/core/src/store/constructors.ts", "../../@dnd-kit/core/src/store/context.ts", "../../@dnd-kit/core/src/store/reducer.ts", "../../@dnd-kit/core/src/components/Accessibility/components/RestoreFocus.tsx", "../../@dnd-kit/core/src/modifiers/applyModifiers.ts", "../../@dnd-kit/core/src/components/DndContext/hooks/useMeasuringConfiguration.ts", "../../@dnd-kit/core/src/components/DndContext/hooks/useLayoutShiftScrollCompensation.ts", "../../@dnd-kit/core/src/components/DndContext/DndContext.tsx", "../../@dnd-kit/core/src/hooks/useDraggable.ts", "../../@dnd-kit/core/src/hooks/useDndContext.ts", "../../@dnd-kit/core/src/hooks/useDroppable.ts", "../../@dnd-kit/core/src/components/DragOverlay/components/AnimationManager/AnimationManager.tsx", "../../@dnd-kit/core/src/components/DragOverlay/components/NullifiedContextProvider/NullifiedContextProvider.tsx", "../../@dnd-kit/core/src/components/DragOverlay/components/PositionedOverlay/PositionedOverlay.tsx", "../../@dnd-kit/core/src/components/DragOverlay/hooks/useDropAnimation.ts", "../../@dnd-kit/core/src/components/DragOverlay/hooks/useKey.ts", "../../@dnd-kit/core/src/components/DragOverlay/DragOverlay.tsx", "../../@dnd-kit/sortable/src/utilities/arrayMove.ts", "../../@dnd-kit/sortable/src/utilities/arraySwap.ts", "../../@dnd-kit/sortable/src/utilities/getSortedRects.ts", "../../@dnd-kit/sortable/src/utilities/isValidIndex.ts", "../../@dnd-kit/sortable/src/utilities/itemsEqual.ts", "../../@dnd-kit/sortable/src/utilities/normalizeDisabled.ts", "../../@dnd-kit/sortable/src/strategies/horizontalListSorting.ts", "../../@dnd-kit/sortable/src/strategies/rectSorting.ts", "../../@dnd-kit/sortable/src/strategies/rectSwapping.ts", "../../@dnd-kit/sortable/src/strategies/verticalListSorting.ts", "../../@dnd-kit/sortable/src/components/SortableContext.tsx", "../../@dnd-kit/sortable/src/hooks/defaults.ts", "../../@dnd-kit/sortable/src/hooks/utilities/useDerivedTransform.ts", "../../@dnd-kit/sortable/src/hooks/useSortable.ts", "../../@dnd-kit/sortable/src/types/type-guard.ts", "../../@dnd-kit/sortable/src/sensors/keyboard/sortableKeyboardCoordinates.ts", "../../src/collection-preferences/content-display/draggable-option.tsx", "../../src/internal/components/drag-handle/index.tsx", "../../src/internal/components/handle/index.tsx", "../../@cloudscape-design/components/internal/components/handle/styles.css.js", "../../@cloudscape-design/components/internal/components/drag-handle/styles.css.js", "../../src/collection-preferences/content-display/content-display-option.tsx", "../../src/collection-preferences/content-display/use-drag-and-drop-reorder.ts", "../../src/collection-preferences/content-display/keyboard-sensor/utilities/scroll.ts", "../../src/collection-preferences/content-display/keyboard-sensor/utilities/events.ts", "../../src/collection-preferences/content-display/keyboard-sensor/utilities/listeners.ts", "../../src/collection-preferences/content-display/keyboard-sensor/defaults.ts", "../../src/collection-preferences/content-display/keyboard-sensor/index.ts", "../../src/collection-preferences/content-display/use-live-announcements.ts", "../../src/column-layout/index.tsx", "../../src/container/index.tsx", "../../src/content-layout/index.tsx", "../../src/content-layout/internal.tsx", "../../@cloudscape-design/components/content-layout/styles.css.js", "../../src/copy-to-clipboard/index.tsx", "../../src/popover/internal.tsx", "../../@cloudscape-design/components/copy-to-clipboard/styles.css.js", "../../@cloudscape-design/components/copy-to-clipboard/test-classes/styles.css.js", "../../src/date-input/index.tsx", "../../src/date-input/internal.tsx", "../../src/internal/components/masked-input/index.tsx", "../../src/internal/components/masked-input/utils/keys.ts", "../../src/internal/components/masked-input/keyboard-handler.ts", "../../src/internal/components/masked-input/use-mask.ts", "../../src/internal/components/masked-input/utils/strings.ts", "../../src/internal/components/masked-input/utils/mask-format.ts", "../../@cloudscape-design/components/date-input/styles.css.js", "../../src/date-picker/index.tsx", "../../@cloudscape-design/components/date-picker/styles.css.js", "../../src/internal/hooks/use-focus-tracker.ts", "../../src/internal/focus-tracker.ts", "../../src/date-picker/utils.ts", "../../src/date-range-picker/index.tsx", "../../@cloudscape-design/components/date-range-picker/styles.css.js", "../../src/date-range-picker/dropdown.tsx", "../../src/date-range-picker/calendar/index.tsx", "../../src/date-range-picker/calendar/header/index.tsx", "../../src/date-range-picker/calendar/header/header-button.tsx", "../../src/date-range-picker/calendar/grids/index.tsx", "../../src/date-range-picker/calendar/grids/grid.tsx", "../../@cloudscape-design/components/date-range-picker/calendar/grids/styles.css.js", "../../src/internal/utils/has-value.ts", "../../src/date-range-picker/calendar/utils.ts", "../../src/date-range-picker/calendar/range-inputs.tsx", "../../src/time-input/internal.tsx", "../../@cloudscape-design/components/time-input/styles.css.js", "../../src/date-range-picker/relative-range/index.tsx", "../../@cloudscape-design/components/date-range-picker/relative-range/styles.css.js", "../../src/date-range-picker/mode-switcher.tsx", "../../src/segmented-control/internal.tsx", "../../src/segmented-control/internal-segmented-control.tsx", "../../src/segmented-control/segment.tsx", "../../@cloudscape-design/components/segmented-control/styles.css.js", "../../src/date-range-picker/time-offset.ts", "../../src/date-range-picker/utils.tsx", "../../src/drawer/index.tsx", "../../@cloudscape-design/components/drawer/styles.css.js", "../../src/expandable-section/index.tsx", "../../src/file-upload/index.tsx", "../../src/file-upload/internal.tsx", "../../src/file-upload/file-option/index.tsx", "../../@cloudscape-design/components/file-upload/file-option/styles.css.js", "../../src/file-upload/default-formatters.ts", "../../src/file-upload/file-option/thumbnail.tsx", "../../@cloudscape-design/components/file-upload/styles.css.js", "../../src/file-upload/dropzone/index.tsx", "../../@cloudscape-design/components/file-upload/dropzone/styles.css.js", "../../src/file-upload/file-input/index.tsx", "../../@cloudscape-design/components/file-upload/file-input/styles.css.js", "../../src/flashbar/index.tsx", "../../src/flashbar/collapsible-flashbar.tsx", "../../src/flashbar/flash.tsx", "../../@cloudscape-design/components/flashbar/styles.css.js", "../../src/flashbar/utils.ts", "../../src/flashbar/internal/analytics.ts", "../../src/internal/animate.ts", "../../src/flashbar/common.tsx", "../../src/flashbar/non-collapsible-flashbar.tsx", "../../src/flashbar/constant.ts", "../../src/form/index.tsx", "../../src/form/internal.tsx", "../../@cloudscape-design/components/form/styles.css.js", "../../src/form-field/index.tsx", "../../src/grid/index.tsx", "../../src/header/index.tsx", "../../src/help-panel/index.tsx", "../../@cloudscape-design/components/help-panel/styles.css.js", "../../src/hotspot/index.tsx", "../../@cloudscape-design/components/hotspot/styles.css.js", "../../src/icon/index.tsx", "../../src/input/index.tsx", "../../src/line-chart/index.tsx", "../../@cloudscape-design/components/line-chart/styles.css.js", "../../src/link/index.tsx", "../../src/mixed-line-bar-chart/index.tsx", "../../src/modal/index.tsx", "../../src/multiselect/index.tsx", "../../src/pagination/index.tsx", "../../src/pagination/internal.tsx", "../../@cloudscape-design/components/pagination/styles.css.js", "../../src/pagination/utils.ts", "../../src/pie-chart/index.tsx", "../../src/pie-chart/pie-chart.tsx", "../../src/pie-chart/labels.tsx", "../../@cloudscape-design/components/pie-chart/styles.css.js", "../../src/pie-chart/utils.ts", "../../src/pie-chart/responsive-text.tsx", "../../src/pie-chart/segments.tsx", "../../src/popover/index.tsx", "../../src/progress-bar/index.tsx", "../../@cloudscape-design/components/progress-bar/styles.css.js", "../../src/progress-bar/internal.tsx", "../../src/property-filter/index.tsx", "../../src/property-filter/token.tsx", "../../@cloudscape-design/components/property-filter/styles.css.js", "../../src/property-filter/token-editor.tsx", "../../src/property-filter/use-load-items.ts", "../../src/property-filter/utils.ts", "../../src/property-filter/controller.ts", "../../src/internal/components/filtering-token/index.tsx", "../../@cloudscape-design/components/internal/components/filtering-token/styles.css.js", "../../src/property-filter/property-filter-autosuggest.tsx", "../../src/property-filter/filter-options.ts", "../../src/property-filter/property-editor.tsx", "../../src/text-filter/search-results.tsx", "../../@cloudscape-design/components/text-filter/styles.css.js", "../../src/radio-group/index.tsx", "../../src/s3-resource-selector/index.tsx", "../../src/s3-resource-selector/s3-in-context/index.tsx", "../../src/s3-resource-selector/s3-in-context/use-versions-fetch.ts", "../../src/internal/utils/promises.ts", "../../src/s3-resource-selector/s3-in-context/validation.ts", "../../@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.css.js", "../../src/s3-resource-selector/s3-in-context/search-input.tsx", "../../src/s3-resource-selector/s3-modal/index.tsx", "../../src/s3-resource-selector/s3-modal/buckets-table.tsx", "../../src/s3-resource-selector/s3-modal/table-utils.ts", "../../src/s3-resource-selector/s3-modal/column-formats.ts", "../../src/s3-resource-selector/s3-modal/basic-table.tsx", "../../@cloudscape-design/collection-hooks/dist/mjs/use-collection.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/filter.js", "../../@cloudscape-design/collection-hooks/dist/mjs/date-utils/parse-iso-date.js", "../../@cloudscape-design/collection-hooks/dist/mjs/date-utils/compare-dates.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/property-filter.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/sort.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/pagination.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/compose-filters.js", "../../@cloudscape-design/collection-hooks/dist/mjs/operations/index.js", "../../@cloudscape-design/collection-hooks/dist/mjs/utils.js", "../../@cloudscape-design/collection-hooks/dist/mjs/use-collection-state.js", "../../src/table/internal.tsx", "../../src/table/thead.tsx", "../../src/table/header-cell/index.tsx", "../../src/table/header-cell/utils.ts", "../../@cloudscape-design/components/table/header-cell/styles.css.js", "../../src/table/resizer/index.tsx", "../../@cloudscape-design/components/table/resizer/styles.css.js", "../../src/table/use-column-widths.tsx", "../../src/table/column-widths-utils.ts", "../../src/table/resizer/resizer-lookup.ts", "../../src/table/header-cell/th-element.tsx", "../../src/table/sticky-columns/use-sticky-columns.ts", "../../src/table/sticky-columns/utils.ts", "../../src/table/table-role/table-role-helper.ts", "../../src/table/table-role/grid-navigation.tsx", "../../src/table/table-role/utils.ts", "../../@cloudscape-design/components/table/body-cell/styles.css.js", "../../src/table/body-cell/index.tsx", "../../src/table/body-cell/td-element.tsx", "../../src/table/expandable-rows/expand-toggle-button.tsx", "../../@cloudscape-design/components/table/expandable-rows/styles.css.js", "../../src/table/body-cell/inline-editor.tsx", "../../src/table/body-cell/click-away.tsx", "../../src/table/body-cell/disabled-inline-editor.tsx", "../../src/table/use-row-events.ts", "../../src/internal/hooks/use-scroll-sync/index.ts", "../../src/table/sticky-header.tsx", "../../src/table/use-sticky-header.ts", "../../src/table/use-table-focus-navigation.ts", "../../src/table/sticky-scrollbar/sticky-scrollbar.tsx", "../../src/table/sticky-scrollbar/use-sticky-scrollbar.ts", "../../@cloudscape-design/components/table/sticky-scrollbar/styles.css.js", "../../src/table/use-cell-editing.ts", "../../src/table/no-data-cell.tsx", "../../src/table/expandable-rows/expandable-rows-utils.ts", "../../src/text-filter/internal.tsx", "../../src/s3-resource-selector/s3-modal/empty-state.tsx", "../../src/s3-resource-selector/s3-modal/objects-table.tsx", "../../src/s3-resource-selector/utils.ts", "../../src/s3-resource-selector/s3-modal/versions-table.tsx", "../../@cloudscape-design/components/s3-resource-selector/s3-modal/styles.css.js", "../../@cloudscape-design/components/s3-resource-selector/styles.css.js", "../../src/segmented-control/index.tsx", "../../src/select/index.tsx", "../../src/side-navigation/index.tsx", "../../src/side-navigation/internal.tsx", "../../@cloudscape-design/components/side-navigation/styles.css.js", "../../src/side-navigation/util.tsx", "../../src/space-between/index.tsx", "../../src/spinner/index.tsx", "../../src/split-panel/index.tsx", "../../src/split-panel/widget.tsx", "../../src/split-panel/implementation.tsx", "../../src/split-panel/preferences-modal.tsx", "../../src/tiles/internal.tsx", "../../@cloudscape-design/components/tiles/styles.css.js", "../../src/tiles/tile.tsx", "../../src/split-panel/icons/side-position.tsx", "../../src/split-panel/icons/bottom-icon.tsx", "../../src/split-panel/icons/side-position-refresh.tsx", "../../src/split-panel/icons/bottom-icon-refresh.tsx", "../../src/split-panel/side.tsx", "../../src/split-panel/bottom.tsx", "../../src/split-panel/internal.tsx", "../../src/status-indicator/index.tsx", "../../src/table/index.tsx", "../../src/tabs/index.tsx", "../../@cloudscape-design/components/tabs/styles.css.js", "../../src/tabs/tab-header-bar.tsx", "../../src/tabs/native-smooth-scroll-supported.ts", "../../src/tabs/smooth-scroll.ts", "../../src/tabs/scroll-utils.ts", "../../src/tag-editor/index.tsx", "../../src/tag-editor/internal.tsx", "../../@cloudscape-design/components/tag-editor/styles.css.js", "../../src/tag-editor/validation.ts", "../../src/tag-editor/utils.ts", "../../src/text-content/index.tsx", "../../@cloudscape-design/components/text-content/styles.css.js", "../../src/text-filter/index.tsx", "../../src/textarea/index.tsx", "../../@cloudscape-design/components/textarea/styles.css.js", "../../src/tiles/index.tsx", "../../src/time-input/index.tsx", "../../src/toggle/index.tsx", "../../src/token-group/index.tsx", "../../src/top-navigation/index.tsx", "../../src/top-navigation/internal.tsx", "../../src/top-navigation/use-top-navigation.ts", "../../@cloudscape-design/components/top-navigation/styles.css.js", "../../src/top-navigation/parts/utility.tsx", "../../src/internal/components/menu-dropdown/index.tsx", "../../@cloudscape-design/components/internal/components/menu-dropdown/styles.css.js", "../../src/top-navigation/parts/overflow-menu/index.tsx", "../../src/top-navigation/parts/overflow-menu/router.tsx", "../../src/top-navigation/parts/overflow-menu/views/utilities.tsx", "../../src/top-navigation/parts/overflow-menu/header.tsx", "../../src/top-navigation/parts/overflow-menu/menu-item.tsx", "../../src/top-navigation/parts/overflow-menu/views/submenu.tsx", "../../src/tutorial-panel/index.tsx", "../../@cloudscape-design/components/tutorial-panel/styles.css.js", "../../src/tutorial-panel/components/tutorial-list/index.tsx", "../../@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.css.js", "../../src/tutorial-panel/components/tutorial-detail-view/index.tsx", "../../@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.css.js", "../../src/tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx", "../../src/tutorial-panel/components/tutorial-detail-view/task-list.tsx", "../../src/tutorial-panel/components/tutorial-detail-view/task.tsx", "../../src/wizard/index.tsx", "../../src/wizard/internal.tsx", "../../src/wizard/wizard-form.tsx", "../../src/wizard/wizard-actions.tsx", "../../@cloudscape-design/components/wizard/styles.css.js", "../../src/wizard/unmount.ts", "../../src/wizard/wizard-form-header.tsx", "../../src/wizard/wizard-navigation.tsx", "../../src/wizard/analytics.ts"], - "sourcesContent": ["'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n", "/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* Returns React children into an array, flattening fragments. */\nvar react_1 = require(\"react\");\nvar react_is_1 = require(\"react-is\");\nfunction flattenChildren(children, depth, keys) {\n if (depth === void 0) { depth = 0; }\n if (keys === void 0) { keys = []; }\n return react_1.Children.toArray(children).reduce(function (acc, node, nodeIndex) {\n if (react_is_1.isFragment(node)) {\n acc.push.apply(acc, flattenChildren(node.props.children, depth + 1, keys.concat(node.key || nodeIndex)));\n }\n else {\n if (react_1.isValidElement(node)) {\n acc.push(react_1.cloneElement(node, {\n key: keys.concat(String(node.key)).join('.')\n }));\n }\n else if (typeof node === \"string\" || typeof node === \"number\") {\n acc.push(node);\n }\n }\n return acc;\n }, []);\n}\nexports.default = flattenChildren;\n", "/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n", "module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref) => {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Alert',\n {\n props: { type, visible, dismissible: props.dismissible },\n },\n analyticsMetadata\n );\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (baseComponentProps.__internalRootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n instanceIdentifier: analyticsMetadata?.instanceIdentifier,\n errorContext: analyticsMetadata?.errorContext,\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return ;\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function applyDisplayName(component: T, displayName: string): void {\n (component as any).displayName = displayName;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../button/internal';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { AlertProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { createUseDiscoveredAction } from '../internal/plugins/helpers';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { ActionsWrapper } from './actions-wrapper';\n\nconst typeToIcon: Record = {\n error: 'status-negative',\n warning: 'status-warning',\n success: 'status-positive',\n info: 'status-info',\n};\n\ntype InternalAlertProps = SomeRequired & InternalBaseComponentProps;\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n statusIconAriaLabel,\n visible = true,\n dismissible,\n dismissAriaLabel,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n ...rest\n }: InternalAlertProps,\n ref: React.Ref\n ) => {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('alert');\n\n const focusRef = useRef(null);\n useForwardFocus(ref, focusRef);\n\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';\n\n const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type);\n\n const hasAction = Boolean(action || buttonText || discoveredActions.length);\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n return (\n \n \n \n \n
    \n
    \n \n
    \n
    \n {header && (\n
    \n {header}\n
    \n )}\n
    \n {children}\n
    \n
    \n
    \n fireNonCancelableEvent(onButtonClick)}\n />\n {dismissible && (\n
    \n fireNonCancelableEvent(onDismiss)}\n />\n
    \n )}\n
\n \n \n
\n );\n }\n);\n\nexport default InternalAlert;\n", "function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t & {\n variant?: ButtonProps['variant'] | 'flashbar-icon' | 'breadcrumb-group' | 'menu-trigger' | 'modal-dismiss';\n badge?: boolean;\n __nativeAttributes?:\n | (React.HTMLAttributes & React.HTMLAttributes)\n | Record<`data-${string}`, string>;\n __iconClass?: string;\n __focusable?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n wrapText = true,\n href,\n target,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaControls,\n fullWidth,\n badge,\n __nativeAttributes,\n __internalRootRef = null,\n __focusable = false,\n ...props\n }: InternalButtonProps,\n ref: React.Ref\n ) => {\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const isNotInteractive = loading || disabled;\n const hasAriaDisabled = (loading && !disabled) || (disabled && __focusable);\n const shouldHaveContent =\n children && ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss'].indexOf(variant) === -1;\n\n const buttonRef = useRef(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n usePerformanceMarks(\n 'primaryButton',\n variant === 'primary',\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n });\n\n const explicitTabIndex =\n __nativeAttributes && 'tabIndex' in __nativeAttributes ? __nativeAttributes.tabIndex : undefined;\n const { tabIndex } = useSingleTabStopNavigation(buttonRef, {\n tabIndex: isAnchor && isNotInteractive ? -1 : explicitTabIndex,\n });\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n tabIndex,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n // add ariaLabel as `title` as visible hint text\n title: ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n } as const;\n\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n \n {shouldHaveContent && {children}}\n \n \n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n \n {buttonContent}\n \n {loading && loadingText && {loadingText}}\n \n );\n }\n return (\n <>\n \n {buttonContent}\n \n {loading && loadingText && {loadingText}}\n \n );\n }\n);\n\nexport default InternalButton;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\n// This is a part of our public types API. We cannot change this in the current major version\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type NonCancelableEventHandler = (event: NonCancelableCustomEvent) => void;\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type CancelableEventHandler = (event: CustomEvent) => void;\n\nexport type NonCancelableCustomEvent = Omit, 'preventDefault'>;\n\nclass CustomEventStub {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(public cancelable: boolean = false, public detail: T | null = null) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport interface BaseKeyDetail {\n keyCode: number;\n key: string;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport interface BaseNavigationDetail {\n href: string | undefined;\n external?: boolean;\n target?: string;\n}\n\nexport function createCustomEvent({ cancelable, detail }: CustomEventInit): CustomEvent {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireNonCancelableEvent(handler: NonCancelableEventHandler | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n\nexport function fireCancelableEvent(\n handler: CancelableEventHandler | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireKeyboardEvent(handler: CancelableEventHandler, reactEvent: React.KeyboardEvent) {\n return fireCancelableEvent(\n handler,\n {\n keyCode: reactEvent.keyCode,\n key: reactEvent.key,\n ctrlKey: reactEvent.ctrlKey,\n shiftKey: reactEvent.shiftKey,\n altKey: reactEvent.altKey,\n metaKey: reactEvent.metaKey,\n },\n reactEvent\n );\n}\n\nconst isMouseEvent = (e: React.MouseEvent | React.KeyboardEvent): e is React.MouseEvent => {\n return (e as React.MouseEvent).button !== undefined;\n};\n\nexport function hasModifierKeys(event: React.MouseEvent | React.KeyboardEvent) {\n return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;\n}\n\nexport function isPlainLeftClick(event: React.MouseEvent | React.KeyboardEvent) {\n return event && (!isMouseEvent(event) || event.button === 0) && !hasModifierKeys(event);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useImperativeHandle } from 'react';\n\nexport interface ForwardFocusRef {\n focus(): void;\n}\n\nexport default function useForwardFocus(\n mainRef: React.Ref,\n controlRef: React.RefObject<{ focus: HTMLElement['focus'] }>\n) {\n useImperativeHandle(\n mainRef,\n () => ({\n focus(...args: Parameters) {\n controlRef.current?.focus(...args);\n },\n }),\n [controlRef]\n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"content\": \"awsui_content_vjswe_12tek_103\",\n \"button\": \"awsui_button_vjswe_12tek_107\",\n \"variant-normal\": \"awsui_variant-normal_vjswe_12tek_158\",\n \"variant-icon\": \"awsui_variant-icon_vjswe_12tek_201\",\n \"variant-modal-dismiss\": \"awsui_variant-modal-dismiss_vjswe_12tek_201\",\n \"variant-flashbar-icon\": \"awsui_variant-flashbar-icon_vjswe_12tek_201\",\n \"variant-inline-icon\": \"awsui_variant-inline-icon_vjswe_12tek_222\",\n \"disabled\": \"awsui_disabled_vjswe_12tek_243\",\n \"variant-primary\": \"awsui_variant-primary_vjswe_12tek_251\",\n \"variant-link\": \"awsui_variant-link_vjswe_12tek_344\",\n \"variant-inline-link\": \"awsui_variant-inline-link_vjswe_12tek_623\",\n \"variant-breadcrumb-group\": \"awsui_variant-breadcrumb-group_vjswe_12tek_906\",\n \"variant-menu-trigger\": \"awsui_variant-menu-trigger_vjswe_12tek_1004\",\n \"button-no-text\": \"awsui_button-no-text_vjswe_12tek_1097\",\n \"button-no-wrap\": \"awsui_button-no-wrap_vjswe_12tek_1101\",\n \"full-width\": \"awsui_full-width_vjswe_12tek_1104\",\n \"icon-left\": \"awsui_icon-left_vjswe_12tek_1123\",\n \"icon-right\": \"awsui_icon-right_vjswe_12tek_1128\",\n \"icon\": \"awsui_icon_vjswe_12tek_1123\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport * as React from 'react';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport InternalSpinner from '../spinner/internal';\nimport { ButtonProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport interface ButtonIconProps {\n loading?: boolean;\n iconName?: ButtonProps['iconName'];\n iconAlign?: ButtonProps['iconAlign'];\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n iconAlt?: string;\n iconSize?: IconProps.Size;\n variant?: string;\n iconClass?: string;\n badge?: boolean;\n}\n\nfunction getIconAlign(props: ButtonIconProps) {\n const standalone = props.variant === 'icon' || props.variant === 'inline-icon';\n\n return standalone ? 'left' : props.iconAlign;\n}\n\nfunction IconWrapper({ iconName, iconUrl, iconAlt, iconSvg, iconSize, badge, ...props }: ButtonIconProps) {\n if (!iconName && !iconUrl && !iconSvg) {\n return null;\n }\n\n return (\n \n );\n}\n\nexport function LeftIcon(props: ButtonIconProps) {\n if (props.loading) {\n return ;\n } else if (getIconAlign(props) === 'left') {\n return ;\n }\n return null;\n}\n\nexport function RightIcon(props: ButtonIconProps) {\n if (getIconAlign(props) === 'right') {\n return ;\n }\n return null;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport styles from './styles.css.js';\nimport icons from './icons';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { IconProps } from './interfaces';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\ntype InternalIconProps = IconProps &\n InternalBaseComponentProps & {\n badge?: boolean;\n };\n\nfunction iconSizeMap(height: number | null) {\n if (height === null) {\n // This is the best guess for the contextual height while server rendering.\n return 'normal';\n }\n\n if (height >= 50) {\n return 'large';\n } else if (height >= 36) {\n return 'big';\n } else if (height >= 24) {\n return 'medium';\n } else if (height <= 16) {\n return 'small';\n } else {\n return 'normal';\n }\n}\n\nconst InternalIcon = ({\n name,\n size = 'normal',\n variant = 'normal',\n url,\n alt,\n svg,\n badge,\n __internalRootRef = null,\n ...props\n}: InternalIconProps) => {\n const iconRef = useRef(null);\n // To ensure a re-render is triggered on visual mode changes\n useVisualRefresh();\n const [parentHeight, setParentHeight] = useState(null);\n const contextualSize = size === 'inherit';\n const iconSize = contextualSize ? iconSizeMap(parentHeight) : size;\n const inlineStyles = contextualSize && parentHeight !== null ? { height: `${parentHeight}px` } : {};\n const baseProps = getBaseProps(props);\n\n baseProps.className = clsx(\n baseProps.className,\n styles.icon,\n contextualSize && styles['icon-flex-height'],\n badge && styles.badge,\n !contextualSize && styles[`size-${iconSize}-mapped-height`],\n styles[`size-${iconSize}`],\n styles[`variant-${variant}`],\n styles[`name-${name}`]\n );\n\n // Possible infinite loop is not a concern here because line\n // height should not change without an external state update.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (!contextualSize || !iconRef.current) {\n return;\n }\n const { lineHeight } = getComputedStyle(iconRef.current);\n const newParentHeight = parseInt(lineHeight, 10);\n setParentHeight(newParentHeight);\n });\n\n const mergedRef = useMergeRefs(iconRef, __internalRootRef);\n\n if (svg) {\n if (url) {\n warnOnce(\n 'Icon',\n 'You have specified both `url` and `svg`. `svg` will take precedence and `url` will be ignored.'\n );\n }\n return (\n \n {svg}\n \n );\n }\n\n if (url) {\n return (\n \n {alt}\n \n );\n }\n\n const validIcon = name && Object.prototype.hasOwnProperty.call(icons, name);\n\n function iconMap(name: IconProps.Name) {\n const genAiFilledIcon = `\n \n `;\n\n if (name === 'gen-ai' && iconSize === 'small') {\n return genAiFilledIcon;\n } else {\n return icons[name];\n }\n }\n\n return (\n \n );\n};\n\nexport { InternalIconProps };\nexport default InternalIcon;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from 'react';\nexport var COMPONENT_METADATA_KEY = '__awsuiMetadata__';\nexport function useComponentMetadata(componentName, packageVersion) {\n var elementRef = useRef(null);\n useEffect(function () {\n if (elementRef.current) {\n var node = elementRef.current;\n var metadata = { name: componentName, version: packageVersion };\n Object.freeze(metadata);\n Object.defineProperty(node, COMPONENT_METADATA_KEY, { value: metadata, writable: false, configurable: true });\n }\n });\n return elementRef;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect } from 'react';\nimport { Metrics } from './metrics/metrics';\nexport function useComponentMetrics(componentName, _a) {\n var packageSource = _a.packageSource, packageVersion = _a.packageVersion, theme = _a.theme;\n useEffect(function () {\n var metrics = new Metrics(packageSource, packageVersion);\n metrics.initMetrics(theme);\n if (typeof window !== 'undefined') {\n metrics.sendMetricOnce('awsui-viewport-width', window.innerWidth || 0);\n metrics.sendMetricOnce('awsui-viewport-height', window.innerHeight || 0);\n }\n metrics.logComponentLoaded();\n metrics.logComponentUsed(componentName.toLowerCase());\n // Components do not change the name dynamically. Explicit empty array to prevent accidental double metrics\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign } from \"tslib\";\nfunction validateLength(value, maxLength) {\n return !value || value.length <= maxLength;\n}\n/**\n * Console Platform's client logging JS API client.\n */\nvar CLogClient = /** @class */ (function () {\n function CLogClient() {\n }\n /**\n * Sends metric but only if Console Platform client logging JS API is present in the page.\n */\n CLogClient.prototype.sendMetric = function (metricName, value, detail) {\n if (!metricName || !/^[a-zA-Z0-9_-]+$/.test(metricName)) {\n console.error(\"Invalid metric name: \".concat(metricName));\n return;\n }\n if (!validateLength(metricName, 1000)) {\n console.error(\"Metric name \".concat(metricName, \" is too long\"));\n return;\n }\n if (!validateLength(detail, 4000)) {\n console.error(\"Detail for metric \".concat(metricName, \" is too long: \").concat(detail));\n return;\n }\n var AWSC = this.findAWSC(window);\n if (typeof AWSC === 'object' && typeof AWSC.Clog === 'object' && typeof AWSC.Clog.log === 'function') {\n AWSC.Clog.log(metricName, value, detail);\n }\n };\n CLogClient.prototype.findAWSC = function (currentWindow) {\n try {\n if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC) === 'object') {\n return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC;\n }\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n return this.findAWSC(currentWindow.parent);\n }\n catch (ex) {\n // Most likely a cross-origin access error\n return undefined;\n }\n };\n return CLogClient;\n}());\nexport { CLogClient };\n/**\n * Console Platform's client v2 logging JS API client.\n */\nvar PanoramaClient = /** @class */ (function () {\n function PanoramaClient() {\n }\n /**\n * Sends metric but only if Console Platform client v2 logging JS API is present in the page.\n */\n PanoramaClient.prototype.sendMetric = function (metric) {\n if (typeof metric.eventDetail === 'object') {\n metric.eventDetail = JSON.stringify(metric.eventDetail);\n }\n if (typeof metric.eventValue === 'object') {\n metric.eventValue = JSON.stringify(metric.eventValue);\n }\n if (!validateLength(metric.eventDetail, 4000)) {\n console.error(\"Event detail for metric is too long: \".concat(metric.eventDetail));\n return;\n }\n if (!validateLength(metric.eventValue, 4000)) {\n console.error(\"Event value for metric is too long: \".concat(metric.eventValue));\n return;\n }\n if (!validateLength(metric.eventContext, 4000)) {\n console.error(\"Event context for metric is too long: \".concat(metric.eventContext));\n return;\n }\n if (!validateLength(metric.eventType, 50)) {\n console.error(\"Event type for metric is too long: \".concat(metric.eventType));\n return;\n }\n var panorama = this.findPanorama(window);\n if (typeof panorama === 'function') {\n panorama('trackCustomEvent', __assign(__assign({}, metric), { timestamp: Date.now() }));\n }\n };\n PanoramaClient.prototype.findPanorama = function (currentWindow) {\n try {\n if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama) === 'function') {\n return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama;\n }\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n return this.findPanorama(currentWindow.parent);\n }\n catch (ex) {\n // Most likely a cross-origin access error\n return undefined;\n }\n };\n return PanoramaClient;\n}());\nexport { PanoramaClient };\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// React is the only framework we're using.\nvar framework = 'react';\nexport function buildMetricHash(_a) {\n var source = _a.source, action = _a.action;\n return [\"src\".concat(source), \"action\".concat(action)].join('_');\n}\nexport function buildMetricDetail(_a, theme) {\n var source = _a.source, action = _a.action, version = _a.version;\n var metricOrigin = typeof AWSUI_METRIC_ORIGIN !== 'undefined' ? AWSUI_METRIC_ORIGIN : 'main';\n var detailObject = {\n o: metricOrigin,\n s: source,\n t: theme,\n a: action,\n f: framework,\n v: formatMajorVersionForMetricDetail(version)\n };\n return JSON.stringify(detailObject);\n}\nexport function buildMetricName(_a, theme) {\n var source = _a.source, version = _a.version;\n return ['awsui', source, \"\".concat(formatVersionForMetricName(theme, version))].join('_');\n}\nexport function formatMajorVersionForMetricDetail(version) {\n return version.replace(/\\s/g, '');\n}\nexport function formatVersionForMetricName(theme, version) {\n return \"\".concat(theme.charAt(0)).concat(getMajorVersion(version).replace('.', ''));\n}\nfunction getMajorVersion(versionString) {\n var majorVersionMatch = versionString.match(/^(\\d+\\.\\d+)/);\n return majorVersionMatch ? majorVersionMatch[1] : '';\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CLogClient, PanoramaClient } from './log-clients';\nimport { buildMetricDetail, buildMetricHash, buildMetricName } from './formatters';\nvar oneTimeMetrics = new Set();\n// In case we need to override the theme for VR.\nvar theme = '';\nfunction setTheme(newTheme) {\n theme = newTheme;\n}\nvar Metrics = /** @class */ (function () {\n function Metrics(source, packageVersion) {\n this.clog = new CLogClient();\n this.panorama = new PanoramaClient();\n this.source = source;\n this.packageVersion = packageVersion;\n }\n Metrics.prototype.initMetrics = function (theme) {\n setTheme(theme);\n };\n /**\n * Calls Console Platform's client logging JS API with provided metric name, value, and detail.\n * Does nothing if Console Platform client logging JS is not present in page.\n */\n Metrics.prototype.sendMetric = function (metricName, value, detail) {\n if (!theme) {\n // Metrics need to be initialized first (initMetrics)\n console.error('Metrics need to be initialized first.');\n return;\n }\n this.clog.sendMetric(metricName, value, detail);\n };\n /**\n * Calls Console Platform's client v2 logging JS API with provided metric name and detail.\n * Does nothing if Console Platform client logging JS is not present in page.\n */\n Metrics.prototype.sendPanoramaMetric = function (metric) {\n this.panorama.sendMetric(metric);\n };\n Metrics.prototype.sendMetricObject = function (metric, value) {\n this.sendMetric(buildMetricName(metric, theme), value, buildMetricDetail(metric, theme));\n };\n Metrics.prototype.sendMetricObjectOnce = function (metric, value) {\n var metricHash = buildMetricHash(metric);\n if (!oneTimeMetrics.has(metricHash)) {\n this.sendMetricObject(metric, value);\n oneTimeMetrics.add(metricHash);\n }\n };\n /*\n * Calls Console Platform's client logging only the first time the provided metricName is used.\n * Subsequent calls with the same metricName are ignored.\n */\n Metrics.prototype.sendMetricOnce = function (metricName, value, detail) {\n if (!oneTimeMetrics.has(metricName)) {\n this.sendMetric(metricName, value, detail);\n oneTimeMetrics.add(metricName);\n }\n };\n /*\n * Reports a metric value 1 to Console Platform's client logging service to indicate that the\n * component was loaded. The component load event will only be reported as used to client logging\n * service once per page view.\n */\n Metrics.prototype.logComponentLoaded = function () {\n this.sendMetricObjectOnce({ source: this.source, action: 'loaded', version: this.packageVersion }, 1);\n };\n /*\n * Reports a metric value 1 to Console Platform's client logging service to indicate that the\n * component was used in the page. A component will only be reported as used to client logging\n * service once per page view.\n */\n Metrics.prototype.logComponentUsed = function (componentName) {\n this.sendMetricObjectOnce({\n source: componentName,\n action: 'used',\n version: this.packageVersion\n }, 1);\n };\n return Metrics;\n}());\nexport { Metrics };\nvar MetricsTestHelper = /** @class */ (function () {\n function MetricsTestHelper() {\n }\n MetricsTestHelper.prototype.resetOneTimeMetricsCache = function () {\n oneTimeMetrics.clear();\n };\n return MetricsTestHelper;\n}());\nexport { MetricsTestHelper };\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// expose version info, so it can be checked using the browser devtools\nexport function initAwsUiVersions(source, packageVersion) {\n if (typeof window !== 'undefined') {\n if (!window.awsuiVersions) {\n window.awsuiVersions = {};\n }\n if (!window.awsuiVersions[source]) {\n window.awsuiVersions[source] = [];\n }\n window.awsuiVersions[source].push(packageVersion);\n }\n}\n", "var resizeObservers = [];\nexport { resizeObservers };\n", "import { resizeObservers } from '../utils/resizeObservers';\nvar hasActiveObservations = function () {\n return resizeObservers.some(function (ro) { return ro.activeTargets.length > 0; });\n};\nexport { hasActiveObservations };\n", "import { resizeObservers } from '../utils/resizeObservers';\nvar hasSkippedObservations = function () {\n return resizeObservers.some(function (ro) { return ro.skippedTargets.length > 0; });\n};\nexport { hasSkippedObservations };\n", "var msg = 'ResizeObserver loop completed with undelivered notifications.';\nvar deliverResizeLoopError = function () {\n var event;\n if (typeof ErrorEvent === 'function') {\n event = new ErrorEvent('error', {\n message: msg\n });\n }\n else {\n event = document.createEvent('Event');\n event.initEvent('error', false, false);\n event.message = msg;\n }\n window.dispatchEvent(event);\n};\nexport { deliverResizeLoopError };\n", "var ResizeObserverBoxOptions;\n(function (ResizeObserverBoxOptions) {\n ResizeObserverBoxOptions[\"BORDER_BOX\"] = \"border-box\";\n ResizeObserverBoxOptions[\"CONTENT_BOX\"] = \"content-box\";\n ResizeObserverBoxOptions[\"DEVICE_PIXEL_CONTENT_BOX\"] = \"device-pixel-content-box\";\n})(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));\nexport { ResizeObserverBoxOptions };\n", "export var freeze = function (obj) { return Object.freeze(obj); };\n", "import { freeze } from './utils/freeze';\nvar ResizeObserverSize = (function () {\n function ResizeObserverSize(inlineSize, blockSize) {\n this.inlineSize = inlineSize;\n this.blockSize = blockSize;\n freeze(this);\n }\n return ResizeObserverSize;\n}());\nexport { ResizeObserverSize };\n", "import { freeze } from './utils/freeze';\nvar DOMRectReadOnly = (function () {\n function DOMRectReadOnly(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.top = this.y;\n this.left = this.x;\n this.bottom = this.top + this.height;\n this.right = this.left + this.width;\n return freeze(this);\n }\n DOMRectReadOnly.prototype.toJSON = function () {\n var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;\n return { x: x, y: y, top: top, right: right, bottom: bottom, left: left, width: width, height: height };\n };\n DOMRectReadOnly.fromRect = function (rectangle) {\n return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n };\n return DOMRectReadOnly;\n}());\nexport { DOMRectReadOnly };\n", "var isSVG = function (target) { return target instanceof SVGElement && 'getBBox' in target; };\nvar isHidden = function (target) {\n if (isSVG(target)) {\n var _a = target.getBBox(), width = _a.width, height = _a.height;\n return !width && !height;\n }\n var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;\n return !(offsetWidth || offsetHeight || target.getClientRects().length);\n};\nvar isElement = function (obj) {\n var _a;\n if (obj instanceof Element) {\n return true;\n }\n var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;\n return !!(scope && obj instanceof scope.Element);\n};\nvar isReplacedElement = function (target) {\n switch (target.tagName) {\n case 'INPUT':\n if (target.type !== 'image') {\n break;\n }\n case 'VIDEO':\n case 'AUDIO':\n case 'EMBED':\n case 'OBJECT':\n case 'CANVAS':\n case 'IFRAME':\n case 'IMG':\n return true;\n }\n return false;\n};\nexport { isSVG, isHidden, isElement, isReplacedElement };\n", "export var global = typeof window !== 'undefined' ? window : {};\n", "import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions';\nimport { ResizeObserverSize } from '../ResizeObserverSize';\nimport { DOMRectReadOnly } from '../DOMRectReadOnly';\nimport { isSVG, isHidden } from '../utils/element';\nimport { freeze } from '../utils/freeze';\nimport { global } from '../utils/global';\nvar cache = new WeakMap();\nvar scrollRegexp = /auto|scroll/;\nvar verticalRegexp = /^tb|vertical/;\nvar IE = (/msie|trident/i).test(global.navigator && global.navigator.userAgent);\nvar parseDimension = function (pixel) { return parseFloat(pixel || '0'); };\nvar size = function (inlineSize, blockSize, switchSizes) {\n if (inlineSize === void 0) { inlineSize = 0; }\n if (blockSize === void 0) { blockSize = 0; }\n if (switchSizes === void 0) { switchSizes = false; }\n return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);\n};\nvar zeroBoxes = freeze({\n devicePixelContentBoxSize: size(),\n borderBoxSize: size(),\n contentBoxSize: size(),\n contentRect: new DOMRectReadOnly(0, 0, 0, 0)\n});\nvar calculateBoxSizes = function (target, forceRecalculation) {\n if (forceRecalculation === void 0) { forceRecalculation = false; }\n if (cache.has(target) && !forceRecalculation) {\n return cache.get(target);\n }\n if (isHidden(target)) {\n cache.set(target, zeroBoxes);\n return zeroBoxes;\n }\n var cs = getComputedStyle(target);\n var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();\n var removePadding = !IE && cs.boxSizing === 'border-box';\n var switchSizes = verticalRegexp.test(cs.writingMode || '');\n var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || '');\n var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || '');\n var paddingTop = svg ? 0 : parseDimension(cs.paddingTop);\n var paddingRight = svg ? 0 : parseDimension(cs.paddingRight);\n var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom);\n var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft);\n var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth);\n var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth);\n var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth);\n var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth);\n var horizontalPadding = paddingLeft + paddingRight;\n var verticalPadding = paddingTop + paddingBottom;\n var horizontalBorderArea = borderLeft + borderRight;\n var verticalBorderArea = borderTop + borderBottom;\n var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;\n var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;\n var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;\n var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;\n var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;\n var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;\n var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;\n var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;\n var boxes = freeze({\n devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),\n borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes),\n contentBoxSize: size(contentWidth, contentHeight, switchSizes),\n contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)\n });\n cache.set(target, boxes);\n return boxes;\n};\nvar calculateBoxSize = function (target, observedBox, forceRecalculation) {\n var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;\n switch (observedBox) {\n case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:\n return devicePixelContentBoxSize;\n case ResizeObserverBoxOptions.BORDER_BOX:\n return borderBoxSize;\n default:\n return contentBoxSize;\n }\n};\nexport { calculateBoxSize, calculateBoxSizes };\n", "import { calculateBoxSizes } from './algorithms/calculateBoxSize';\nimport { freeze } from './utils/freeze';\nvar ResizeObserverEntry = (function () {\n function ResizeObserverEntry(target) {\n var boxes = calculateBoxSizes(target);\n this.target = target;\n this.contentRect = boxes.contentRect;\n this.borderBoxSize = freeze([boxes.borderBoxSize]);\n this.contentBoxSize = freeze([boxes.contentBoxSize]);\n this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);\n }\n return ResizeObserverEntry;\n}());\nexport { ResizeObserverEntry };\n", "import { isHidden } from '../utils/element';\nvar calculateDepthForNode = function (node) {\n if (isHidden(node)) {\n return Infinity;\n }\n var depth = 0;\n var parent = node.parentNode;\n while (parent) {\n depth += 1;\n parent = parent.parentNode;\n }\n return depth;\n};\nexport { calculateDepthForNode };\n", "import { resizeObservers } from '../utils/resizeObservers';\nimport { ResizeObserverEntry } from '../ResizeObserverEntry';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nimport { calculateBoxSize } from './calculateBoxSize';\nvar broadcastActiveObservations = function () {\n var shallowestDepth = Infinity;\n var callbacks = [];\n resizeObservers.forEach(function processObserver(ro) {\n if (ro.activeTargets.length === 0) {\n return;\n }\n var entries = [];\n ro.activeTargets.forEach(function processTarget(ot) {\n var entry = new ResizeObserverEntry(ot.target);\n var targetDepth = calculateDepthForNode(ot.target);\n entries.push(entry);\n ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);\n if (targetDepth < shallowestDepth) {\n shallowestDepth = targetDepth;\n }\n });\n callbacks.push(function resizeObserverCallback() {\n ro.callback.call(ro.observer, entries, ro.observer);\n });\n ro.activeTargets.splice(0, ro.activeTargets.length);\n });\n for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {\n var callback = callbacks_1[_i];\n callback();\n }\n return shallowestDepth;\n};\nexport { broadcastActiveObservations };\n", "import { resizeObservers } from '../utils/resizeObservers';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nvar gatherActiveObservationsAtDepth = function (depth) {\n resizeObservers.forEach(function processObserver(ro) {\n ro.activeTargets.splice(0, ro.activeTargets.length);\n ro.skippedTargets.splice(0, ro.skippedTargets.length);\n ro.observationTargets.forEach(function processTarget(ot) {\n if (ot.isActive()) {\n if (calculateDepthForNode(ot.target) > depth) {\n ro.activeTargets.push(ot);\n }\n else {\n ro.skippedTargets.push(ot);\n }\n }\n });\n });\n};\nexport { gatherActiveObservationsAtDepth };\n", "import { hasActiveObservations } from '../algorithms/hasActiveObservations';\nimport { hasSkippedObservations } from '../algorithms/hasSkippedObservations';\nimport { deliverResizeLoopError } from '../algorithms/deliverResizeLoopError';\nimport { broadcastActiveObservations } from '../algorithms/broadcastActiveObservations';\nimport { gatherActiveObservationsAtDepth } from '../algorithms/gatherActiveObservationsAtDepth';\nvar process = function () {\n var depth = 0;\n gatherActiveObservationsAtDepth(depth);\n while (hasActiveObservations()) {\n depth = broadcastActiveObservations();\n gatherActiveObservationsAtDepth(depth);\n }\n if (hasSkippedObservations()) {\n deliverResizeLoopError();\n }\n return depth > 0;\n};\nexport { process };\n", "var trigger;\nvar callbacks = [];\nvar notify = function () { return callbacks.splice(0).forEach(function (cb) { return cb(); }); };\nvar queueMicroTask = function (callback) {\n if (!trigger) {\n var toggle_1 = 0;\n var el_1 = document.createTextNode('');\n var config = { characterData: true };\n new MutationObserver(function () { return notify(); }).observe(el_1, config);\n trigger = function () { el_1.textContent = \"\".concat(toggle_1 ? toggle_1-- : toggle_1++); };\n }\n callbacks.push(callback);\n trigger();\n};\nexport { queueMicroTask };\n", "import { queueMicroTask } from './queueMicroTask';\nvar queueResizeObserver = function (cb) {\n queueMicroTask(function ResizeObserver() {\n requestAnimationFrame(cb);\n });\n};\nexport { queueResizeObserver };\n", "import { process } from './process';\nimport { global } from './global';\nimport { queueResizeObserver } from './queueResizeObserver';\nvar watching = 0;\nvar isWatching = function () { return !!watching; };\nvar CATCH_PERIOD = 250;\nvar observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };\nvar events = [\n 'resize',\n 'load',\n 'transitionend',\n 'animationend',\n 'animationstart',\n 'animationiteration',\n 'keyup',\n 'keydown',\n 'mouseup',\n 'mousedown',\n 'mouseover',\n 'mouseout',\n 'blur',\n 'focus'\n];\nvar time = function (timeout) {\n if (timeout === void 0) { timeout = 0; }\n return Date.now() + timeout;\n};\nvar scheduled = false;\nvar Scheduler = (function () {\n function Scheduler() {\n var _this = this;\n this.stopped = true;\n this.listener = function () { return _this.schedule(); };\n }\n Scheduler.prototype.run = function (timeout) {\n var _this = this;\n if (timeout === void 0) { timeout = CATCH_PERIOD; }\n if (scheduled) {\n return;\n }\n scheduled = true;\n var until = time(timeout);\n queueResizeObserver(function () {\n var elementsHaveResized = false;\n try {\n elementsHaveResized = process();\n }\n finally {\n scheduled = false;\n timeout = until - time();\n if (!isWatching()) {\n return;\n }\n if (elementsHaveResized) {\n _this.run(1000);\n }\n else if (timeout > 0) {\n _this.run(timeout);\n }\n else {\n _this.start();\n }\n }\n });\n };\n Scheduler.prototype.schedule = function () {\n this.stop();\n this.run();\n };\n Scheduler.prototype.observe = function () {\n var _this = this;\n var cb = function () { return _this.observer && _this.observer.observe(document.body, observerConfig); };\n document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);\n };\n Scheduler.prototype.start = function () {\n var _this = this;\n if (this.stopped) {\n this.stopped = false;\n this.observer = new MutationObserver(this.listener);\n this.observe();\n events.forEach(function (name) { return global.addEventListener(name, _this.listener, true); });\n }\n };\n Scheduler.prototype.stop = function () {\n var _this = this;\n if (!this.stopped) {\n this.observer && this.observer.disconnect();\n events.forEach(function (name) { return global.removeEventListener(name, _this.listener, true); });\n this.stopped = true;\n }\n };\n return Scheduler;\n}());\nvar scheduler = new Scheduler();\nvar updateCount = function (n) {\n !watching && n > 0 && scheduler.start();\n watching += n;\n !watching && scheduler.stop();\n};\nexport { scheduler, updateCount };\n", "import { ResizeObserverBoxOptions } from './ResizeObserverBoxOptions';\nimport { calculateBoxSize } from './algorithms/calculateBoxSize';\nimport { isSVG, isReplacedElement } from './utils/element';\nvar skipNotifyOnElement = function (target) {\n return !isSVG(target)\n && !isReplacedElement(target)\n && getComputedStyle(target).display === 'inline';\n};\nvar ResizeObservation = (function () {\n function ResizeObservation(target, observedBox) {\n this.target = target;\n this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;\n this.lastReportedSize = {\n inlineSize: 0,\n blockSize: 0\n };\n }\n ResizeObservation.prototype.isActive = function () {\n var size = calculateBoxSize(this.target, this.observedBox, true);\n if (skipNotifyOnElement(this.target)) {\n this.lastReportedSize = size;\n }\n if (this.lastReportedSize.inlineSize !== size.inlineSize\n || this.lastReportedSize.blockSize !== size.blockSize) {\n return true;\n }\n return false;\n };\n return ResizeObservation;\n}());\nexport { ResizeObservation };\n", "var ResizeObserverDetail = (function () {\n function ResizeObserverDetail(resizeObserver, callback) {\n this.activeTargets = [];\n this.skippedTargets = [];\n this.observationTargets = [];\n this.observer = resizeObserver;\n this.callback = callback;\n }\n return ResizeObserverDetail;\n}());\nexport { ResizeObserverDetail };\n", "import { scheduler, updateCount } from './utils/scheduler';\nimport { ResizeObservation } from './ResizeObservation';\nimport { ResizeObserverDetail } from './ResizeObserverDetail';\nimport { resizeObservers } from './utils/resizeObservers';\nvar observerMap = new WeakMap();\nvar getObservationIndex = function (observationTargets, target) {\n for (var i = 0; i < observationTargets.length; i += 1) {\n if (observationTargets[i].target === target) {\n return i;\n }\n }\n return -1;\n};\nvar ResizeObserverController = (function () {\n function ResizeObserverController() {\n }\n ResizeObserverController.connect = function (resizeObserver, callback) {\n var detail = new ResizeObserverDetail(resizeObserver, callback);\n observerMap.set(resizeObserver, detail);\n };\n ResizeObserverController.observe = function (resizeObserver, target, options) {\n var detail = observerMap.get(resizeObserver);\n var firstObservation = detail.observationTargets.length === 0;\n if (getObservationIndex(detail.observationTargets, target) < 0) {\n firstObservation && resizeObservers.push(detail);\n detail.observationTargets.push(new ResizeObservation(target, options && options.box));\n updateCount(1);\n scheduler.schedule();\n }\n };\n ResizeObserverController.unobserve = function (resizeObserver, target) {\n var detail = observerMap.get(resizeObserver);\n var index = getObservationIndex(detail.observationTargets, target);\n var lastObservation = detail.observationTargets.length === 1;\n if (index >= 0) {\n lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);\n detail.observationTargets.splice(index, 1);\n updateCount(-1);\n }\n };\n ResizeObserverController.disconnect = function (resizeObserver) {\n var _this = this;\n var detail = observerMap.get(resizeObserver);\n detail.observationTargets.slice().forEach(function (ot) { return _this.unobserve(resizeObserver, ot.target); });\n detail.activeTargets.splice(0, detail.activeTargets.length);\n };\n return ResizeObserverController;\n}());\nexport { ResizeObserverController };\n", "import { ResizeObserverController } from './ResizeObserverController';\nimport { isElement } from './utils/element';\nvar ResizeObserver = (function () {\n function ResizeObserver(callback) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (typeof callback !== 'function') {\n throw new TypeError(\"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.\");\n }\n ResizeObserverController.connect(this, callback);\n }\n ResizeObserver.prototype.observe = function (target, options) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (!isElement(target)) {\n throw new TypeError(\"Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element\");\n }\n ResizeObserverController.observe(this, target, options);\n };\n ResizeObserver.prototype.unobserve = function (target) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (!isElement(target)) {\n throw new TypeError(\"Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element\");\n }\n ResizeObserverController.unobserve(this, target);\n };\n ResizeObserver.prototype.disconnect = function () {\n ResizeObserverController.disconnect(this);\n };\n ResizeObserver.toString = function () {\n return 'function ResizeObserver () { [polyfill code] }';\n };\n return ResizeObserver;\n}());\nexport { ResizeObserver };\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ResizeObserver, ResizeObserverEntry } from '@juggle/resize-observer';\nimport { useEffect, useLayoutEffect } from 'react';\nimport { useStableCallback } from '../stable-callback';\n/**\n * Attaches resize-observer to the referenced element.\n *\n * @remarks\n *\n * The hook has no control over the referenced element. It is up to the consumer to ensure\n * the element lifecycle and notify the hook by updating the `elementRef`.\n *\n * @example\n * With React reference\n * ```\n * const ref = useRef(null)\n * useResizeObserver(ref, (entry) => setState(getWidth(entry)))\n * ```\n *\n * @example\n * With ID reference\n * ```\n * const getElement = useCallback(() => document.getElementById(id), [id])\n * useResizeObserver(getElement, (entry) => setState(getWidth(entry)))\n * ```\n *\n * @param elementRef React reference or memoized getter for the target element\n * @param onObserve Function to fire when observation occurs\n */\nexport function useResizeObserver(elementRef, onObserve) {\n var stableOnObserve = useStableCallback(onObserve);\n // This effect provides a synchronous update required to prevent flakiness when initial state and first observed state are different.\n // Can potentially conflict with React concurrent mode: https://17.reactjs.org/docs/concurrent-mode-intro.html.\n // TODO: A possible solution would be to make consumers not render any content until the first (asynchronous) observation is available.\n useLayoutEffect(function () {\n var element = typeof elementRef === 'function' ? elementRef() : elementRef === null || elementRef === void 0 ? void 0 : elementRef.current;\n if (element) {\n onObserve(convertResizeObserverEntry(new ResizeObserverEntry(element)));\n }\n }, \n // This effect is only needed for the first render to provide a synchronous update.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n useEffect(function () {\n var element = typeof elementRef === 'function' ? elementRef() : elementRef === null || elementRef === void 0 ? void 0 : elementRef.current;\n if (element) {\n var connected_1 = true;\n var observer_1 = new ResizeObserver(function (entries) {\n // Prevent observe notifications on already unmounted component.\n if (connected_1) {\n stableOnObserve(convertResizeObserverEntry(entries[0]));\n }\n });\n observer_1.observe(element);\n return function () {\n connected_1 = false;\n observer_1.disconnect();\n };\n }\n }, [elementRef, stableOnObserve]);\n}\nfunction convertResizeObserverEntry(entry) {\n return {\n target: entry.target,\n contentBoxWidth: entry.contentBoxSize[0].inlineSize,\n contentBoxHeight: entry.contentBoxSize[0].blockSize,\n borderBoxWidth: entry.borderBoxSize[0].inlineSize,\n borderBoxHeight: entry.borderBoxSize[0].blockSize\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useEffect, useRef } from 'react';\n/**\n * A callback that stays stable between renders even as the dependencies change.\n * Not a recommended React pattern, so it should be used sparingly and only if\n * the callback is used asynchronously (i.e. not used during rendering) and causing\n * clear performance issues.\n *\n * @remarks\n *\n * The implementation ensures the callback cannot be called synchronously. All synchronous calls\n * (during rendering) are ignored.\n *\n * @example\n * Use stable onMouseMove handler\n * ```\n * function Demo({ args }) {\n * const stableOnMouseMove = useStableCallback((event) => makeAction(event, args))\n * return \n * }\n * ```\n *\n * @see https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback\n *\n * @typeParam Callback The callback to be made stable\n * @returns Stable callback\n */\nexport function useStableCallback(fn) {\n var ref = useRef();\n useEffect(function () {\n ref.current = fn;\n });\n return useCallback(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.apply(undefined, args);\n }, []);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\nexport function createSingletonHandler(factory) {\n var listeners = [];\n var callback = function (value) {\n unstable_batchedUpdates(function () {\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener(value);\n }\n });\n };\n var cleanup;\n return function useSingleton(listener) {\n useEffect(function () {\n if (listeners.length === 0) {\n cleanup = factory(callback);\n }\n listeners.push(listener);\n return function () {\n listeners.splice(listeners.indexOf(listener), 1);\n if (listeners.length === 0) {\n cleanup();\n cleanup = undefined;\n }\n };\n // register handlers only on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n };\n}\nexport function createSingletonState(_a) {\n var factory = _a.factory, initialState = _a.initialState;\n var useSingleton = createSingletonHandler(factory);\n var value = initialState;\n return function useSingletonState() {\n var _a = useState(value), state = _a[0], setState = _a[1];\n useSingleton(function (newValue) {\n value = newValue;\n setState(newValue);\n });\n return state;\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useState } from 'react';\nimport { findUpUntil } from '../../dom';\nimport { createSingletonHandler } from '../singleton-handler';\nimport { useStableCallback } from '../stable-callback';\nimport { isDevelopment } from '../is-development';\nimport { warnOnce } from '../logging';\nvar awsuiVisualRefreshFlag = Symbol[\"for\"]('awsui-visual-refresh-flag');\nexport function isMotionDisabled(element) {\n var _a, _b;\n return (!!findUpUntil(element, function (node) { return node.classList.contains('awsui-motion-disabled'); }) ||\n ((_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-reduced-motion: reduce)').matches) !== null && _b !== void 0 ? _b : false));\n}\n// Note that this hook doesn't take into consideration @media print (unlike the dark mode CSS),\n// due to challenges with cross-browser implementations of media/print state change listeners.\n// This means that components using this hook will render in dark mode even when printing.\nexport function useCurrentMode(elementRef) {\n var _a = useState('light'), value = _a[0], setValue = _a[1];\n useMutationObserver(elementRef, function (node) {\n var darkModeParent = findUpUntil(node, function (node) { return node.classList.contains('awsui-polaris-dark-mode') || node.classList.contains('awsui-dark-mode'); });\n setValue(darkModeParent ? 'dark' : 'light');\n });\n return value;\n}\nexport function useDensityMode(elementRef) {\n var _a = useState('comfortable'), value = _a[0], setValue = _a[1];\n useMutationObserver(elementRef, function (node) {\n var compactModeParent = findUpUntil(node, function (node) { return node.classList.contains('awsui-polaris-compact-mode') || node.classList.contains('awsui-compact-mode'); });\n setValue(compactModeParent ? 'compact' : 'comfortable');\n });\n return value;\n}\nexport function useReducedMotion(elementRef) {\n var _a = useState(false), value = _a[0], setValue = _a[1];\n useMutationObserver(elementRef, function (node) {\n setValue(isMotionDisabled(node));\n });\n return value;\n}\nvar useMutationSingleton = createSingletonHandler(function (handler) {\n var observer = new MutationObserver(function () { return handler(); });\n observer.observe(document.body, { attributes: true, subtree: true });\n return function () { return observer.disconnect(); };\n});\nfunction useMutationObserver(elementRef, onChange) {\n var handler = useStableCallback(function () {\n if (elementRef.current) {\n onChange(elementRef.current);\n }\n });\n useMutationSingleton(handler);\n useEffect(function () {\n handler();\n }, [handler]);\n}\n// We expect VR is to be set only once and before the application is rendered.\nvar visualRefreshState = undefined;\n// for testing\nexport function clearVisualRefreshState() {\n visualRefreshState = undefined;\n}\nfunction detectVisualRefresh() {\n return typeof document !== 'undefined' && !!document.querySelector('.awsui-visual-refresh');\n}\nexport function useRuntimeVisualRefresh() {\n var _a;\n if (visualRefreshState === undefined) {\n visualRefreshState = detectVisualRefresh();\n if (!visualRefreshState && typeof window !== 'undefined' && ((_a = window[awsuiVisualRefreshFlag]) === null || _a === void 0 ? void 0 : _a.call(window))) {\n document.body.classList.add('awsui-visual-refresh');\n visualRefreshState = true;\n }\n }\n if (isDevelopment) {\n var newVisualRefreshState = detectVisualRefresh();\n if (newVisualRefreshState !== visualRefreshState) {\n warnOnce('Visual Refresh', 'Dynamic visual refresh change detected. This is not supported. ' +\n 'Make sure `awsui-visual-refresh` is attached to the `` element before initial React render');\n }\n }\n return visualRefreshState;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Checks if the current element or any of its parent is matched with `test` function.\n *\n * @example\n * Check if there is an ancestor with a CSS class matching regex\n * ```\n * const matchContext = (element) => element.className.match(/my-context-([\\w-]+)/)\n * const contextElement = findUpUntil(currentElement, matchContext)\n * ```\n *\n * @param from Element to search from\n * @param test Returns `true` if the given element satisfies the search criteria\n * @returns First matched element or `null`\n */\nexport default function findUpUntil(from, test) {\n var current = from;\n while (current && !test(current)) {\n current = current.parentElement;\n // If a component is used within an svg (i.e. as foreignObject), then it will\n // have some ancestor elements that are SVGElement. We want to skip those,\n // as they have very different properties to HTMLElements.\n while (current && !(current instanceof HTMLElement)) {\n current = current.parentElement;\n }\n }\n return current;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Checks whether the given node is a parent of the other descendant node.\n * @param parent Parent node\n * @param descendant Node that is checked to be a descendant of the parent node\n */\nexport default function nodeContains(parent, descendant) {\n // ('nodeType' in descendant) is a workaround to check if descendant is a node\n // Node interface is tied to the window it's created in, if the descendant was moved to an iframe after it was created,\n // descendant instanceof Node will be false since Node has a different window\n if (!parent || !descendant || !('nodeType' in descendant)) {\n return false;\n }\n return parent.contains(descendant);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Whether the bundle is a development bundle.\n * Only use this in an if condition and on its own! This will help bundlers find\n * and remove the conditional statement for production bundles.\n */\nexport var isDevelopment = process.env.NODE_ENV !== 'production';\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isDevelopment } from './is-development';\nvar messageCache = new Set();\nexport function warnOnce(component, message) {\n if (isDevelopment) {\n var warning = \"[AwsUi] [\".concat(component, \"] \").concat(message);\n if (!messageCache.has(warning)) {\n messageCache.add(warning);\n console.warn(warning);\n }\n }\n}\n", "export var PACKAGE_SOURCE = \"components\";\nexport var PACKAGE_VERSION = \"3.0.0 (171737fc)\";\nexport var THEME = \"open-source-visual-refresh\";\nexport var ALWAYS_VISUAL_REFRESH = true;", "\n import './styles.scoped.css';\n export default {};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initAwsUiVersions } from '@cloudscape-design/component-toolkit/internal';\nimport { PACKAGE_SOURCE, PACKAGE_VERSION } from '../environment';\n\n// these styles needed to be imported for every public component\nimport './styles.css.js';\nimport { AnalyticsMetadata } from '../analytics/interfaces';\n\ninitAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION);\n\nexport interface BaseComponentProps {\n /**\n * Adds the specified classes to the root element of the component.\n * @deprecated Custom CSS is not supported. For other use cases, use [data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes).\n */\n className?: string;\n /**\n * Adds the specified ID to the root element of the component.\n * @deprecated Custom CSS is not supported. For other use cases, use [data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes).\n */\n id?: string;\n // we also support data-* attributes, but they are always implicitly allowed by typescript\n // http://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking\n // \"Note: If an attribute name is not a valid JS identifier (like a data-* attribute), it is not considered to be an error\"\n}\n\nexport function getBaseProps(props: BaseComponentProps) {\n const baseProps: Record = {};\n Object.keys(props).forEach(prop => {\n if (prop === 'id' || prop === 'className' || prop.match(/^data-/)) {\n baseProps[prop] = (props as Record)[prop];\n }\n });\n return baseProps as BaseComponentProps;\n}\n\nexport interface BasePropsWithAnalyticsMetadata {\n __analyticsMetadata?: AnalyticsMetadata;\n}\n\nexport function getAnalyticsMetadataProps(props: BasePropsWithAnalyticsMetadata) {\n return props.__analyticsMetadata;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"icon\": \"awsui_icon_h11ix_1l964_104\",\n \"icon-flex-height\": \"awsui_icon-flex-height_h11ix_1l964_110\",\n \"size-small\": \"awsui_size-small_h11ix_1l964_135\",\n \"size-small-mapped-height\": \"awsui_size-small-mapped-height_h11ix_1l964_139\",\n \"size-normal\": \"awsui_size-normal_h11ix_1l964_154\",\n \"size-normal-mapped-height\": \"awsui_size-normal-mapped-height_h11ix_1l964_158\",\n \"size-medium\": \"awsui_size-medium_h11ix_1l964_173\",\n \"size-medium-mapped-height\": \"awsui_size-medium-mapped-height_h11ix_1l964_177\",\n \"size-big\": \"awsui_size-big_h11ix_1l964_192\",\n \"size-big-mapped-height\": \"awsui_size-big-mapped-height_h11ix_1l964_196\",\n \"size-large\": \"awsui_size-large_h11ix_1l964_211\",\n \"size-large-mapped-height\": \"awsui_size-large-mapped-height_h11ix_1l964_215\",\n \"variant-normal\": \"awsui_variant-normal_h11ix_1l964_230\",\n \"variant-disabled\": \"awsui_variant-disabled_h11ix_1l964_233\",\n \"variant-inverted\": \"awsui_variant-inverted_h11ix_1l964_236\",\n \"variant-subtle\": \"awsui_variant-subtle_h11ix_1l964_239\",\n \"variant-warning\": \"awsui_variant-warning_h11ix_1l964_242\",\n \"variant-error\": \"awsui_variant-error_h11ix_1l964_245\",\n \"variant-success\": \"awsui_variant-success_h11ix_1l964_248\",\n \"variant-link\": \"awsui_variant-link_h11ix_1l964_251\",\n \"name-angle-left-double\": \"awsui_name-angle-left-double_h11ix_1l964_254\",\n \"name-angle-left\": \"awsui_name-angle-left_h11ix_1l964_254\",\n \"name-angle-right-double\": \"awsui_name-angle-right-double_h11ix_1l964_256\",\n \"name-angle-right\": \"awsui_name-angle-right_h11ix_1l964_256\",\n \"name-arrow-left\": \"awsui_name-arrow-left_h11ix_1l964_258\",\n \"name-caret-left-filled\": \"awsui_name-caret-left-filled_h11ix_1l964_259\",\n \"name-caret-right-filled\": \"awsui_name-caret-right-filled_h11ix_1l964_260\",\n \"name-audio-full\": \"awsui_name-audio-full_h11ix_1l964_261\",\n \"name-audio-half\": \"awsui_name-audio-half_h11ix_1l964_262\",\n \"name-audio-off\": \"awsui_name-audio-off_h11ix_1l964_263\",\n \"name-external\": \"awsui_name-external_h11ix_1l964_264\",\n \"name-redo\": \"awsui_name-redo_h11ix_1l964_265\",\n \"name-shrink\": \"awsui_name-shrink_h11ix_1l964_266\",\n \"name-undo\": \"awsui_name-undo_h11ix_1l964_267\",\n \"name-view-vertical\": \"awsui_name-view-vertical_h11ix_1l964_268\",\n \"badge\": \"awsui_badge_h11ix_1l964_272\"\n};\n ", "export default {\n \"add-plus\": \"\",\"anchor-link\": \"\",\"angle-down\": \"\",\"angle-left-double\": \"\",\"angle-left\": \"\",\"angle-right-double\": \"\",\"angle-right\": \"\",\"angle-up\": \"\",\"arrow-left\": \"\",\"audio-full\": \"\",\"audio-half\": \"\",\"audio-off\": \"\",\"bug\": \"\",\"calendar\": \"\",\"call\": \"\",\"caret-down-filled\": \"\",\"caret-down\": \"\",\"caret-left-filled\": \"\",\"caret-right-filled\": \"\",\"caret-up-filled\": \"\",\"caret-up\": \"\",\"check\": \"\",\"close\": \"\",\"contact\": \"\",\"copy\": \"\",\"delete-marker\": \"\",\"download\": \"\",\"drag-indicator\": \"\",\"edit\": \"\",\"ellipsis\": \"\",\"envelope\": \"\",\"expand\": \"\",\"external\": \"\",\"file-open\": \"\",\"file\": \"\",\"filter\": \"\",\"flag\": \"\",\"folder-open\": \"\",\"folder\": \"\",\"gen-ai\": \"\",\"group-active\": \"\",\"group\": \"\",\"heart\": \"\",\"insert-row\": \"\",\"key\": \"\",\"keyboard\": \"\",\"lock-private\": \"\",\"menu\": \"\",\"microphone-off\": \"\",\"microphone\": \"\",\"multiscreen\": \"\",\"notification\": \"\",\"redo\": \"\",\"refresh\": \"\",\"remove\": \"\",\"resize-area\": \"\",\"script\": \"\",\"search\": \"\",\"security\": \"\",\"settings\": \"\",\"share\": \"\",\"shrink\": \"\",\"star-filled\": \"\",\"star-half\": \"\",\"star\": \"\",\"status-in-progress\": \"\",\"status-info\": \"\",\"status-negative\": \"\",\"status-pending\": \"\",\"status-positive\": \"\",\"status-stopped\": \"\",\"status-warning\": \"\",\"suggestions\": \"\",\"thumbs-down-filled\": \"\",\"thumbs-down\": \"\",\"thumbs-up-filled\": \"\",\"thumbs-up\": \"\",\"ticket\": \"\",\"treeview-collapse\": \"\",\"treeview-expand\": \"\",\"undo\": \"\",\"unlocked\": \"\",\"upload-download\": \"\",\"upload\": \"\",\"user-profile-active\": \"\",\"user-profile\": \"\",\"video-off\": \"\",\"video-on\": \"\",\"video-unavailable\": \"\",\"view-full\": \"\",\"view-horizontal\": \"\",\"view-vertical\": \"\",\"zoom-in\": \"\",\"zoom-out\": \"\",\"zoom-to-fit\": \"\"\n }", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\n\n/**\n * useMergeRefs merges multiple refs into single ref callback.\n *\n * For example\n * const mergedRef = useMergeRefs(ref1, ref2, ref3)\n *
...
\n */\nexport function useMergeRefs(\n ...refs: Array | React.MutableRefObject | null | undefined>\n): React.RefCallback | null {\n return useMemo(() => {\n if (refs.every(ref => ref === null || ref === undefined)) {\n return null;\n }\n return (value: T | null) => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== null && ref !== undefined) {\n (ref as React.MutableRefObject).current = value;\n }\n });\n };\n // ESLint expects an array literal which we can not provide here\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ALWAYS_VISUAL_REFRESH } from '../../environment';\nimport { useRuntimeVisualRefresh } from '@cloudscape-design/component-toolkit/internal';\n\nexport const useVisualRefresh = ALWAYS_VISUAL_REFRESH ? () => true : useRuntimeVisualRefresh;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport { SpinnerProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ninterface InternalSpinnerProps extends SpinnerProps, InternalBaseComponentProps {}\n\nexport default function InternalSpinner({\n size = 'normal',\n variant = 'normal',\n __internalRootRef,\n ...props\n}: InternalSpinnerProps) {\n const baseProps = getBaseProps(props);\n\n return (\n \n \n \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1612d_wzftr_133\",\n \"spinner-rotator\": \"awsui_spinner-rotator_1612d_wzftr_1\",\n \"size-normal\": \"awsui_size-normal_1612d_wzftr_147\",\n \"size-big\": \"awsui_size-big_1612d_wzftr_155\",\n \"size-large\": \"awsui_size-large_1612d_wzftr_163\",\n \"variant-normal\": \"awsui_variant-normal_1612d_wzftr_171\",\n \"variant-disabled\": \"awsui_variant-disabled_1612d_wzftr_174\",\n \"variant-inverted\": \"awsui_variant-inverted_1612d_wzftr_177\",\n \"circle\": \"awsui_circle_1612d_wzftr_189\",\n \"circle-left\": \"awsui_circle-left_1612d_wzftr_217\",\n \"spinner-line-left\": \"awsui_spinner-line-left_1612d_wzftr_1\",\n \"circle-right\": \"awsui_circle-right_1612d_wzftr_222\",\n \"spinner-line-right\": \"awsui_spinner-line-right_1612d_wzftr_1\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nconst allowedJavascriptUrls = ['javascript:void(0)', 'javascript:void(0);', 'javascript:;'];\n\nexport function checkSafeUrl(component: string, url: string | undefined | null): void {\n if (!url) {\n return;\n }\n if (allowedJavascriptUrls.indexOf(url.toLowerCase()) !== -1) {\n return;\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (e) {\n // If the URL cannot be parsed by the browser, it likely does not pose a security risk.\n return;\n }\n\n if (parsedUrl.protocol === 'javascript:') {\n warnOnce(component, `A javascript: URL was blocked as a security precaution. The URL was \"${url}\".`);\n // This mirrors the error message that React will use:\n // https://github.com/facebook/react/blob/a724a3b578dce77d427bef313102a4d0e978d9b4/packages/react-dom/src/shared/sanitizeURL.js#L30\n throw new Error(`A javascript: URL was blocked as a security precaution.`);\n }\n\n return;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @cloudscape-design/prefer-live-region */\n\nimport clsx from 'clsx';\nimport React, { memo, useEffect, useRef } from 'react';\nimport ScreenreaderOnly, { ScreenreaderOnlyProps } from '../screenreader-only';\nimport styles from './styles.css.js';\n\nexport interface LiveRegionProps extends ScreenreaderOnlyProps {\n assertive?: boolean;\n delay?: number;\n visible?: boolean;\n tagName?: 'span' | 'div';\n id?: string;\n /**\n * Use a list of strings and/or existing DOM elements for building the\n * announcement text. This avoids rendering separate content just for this\n * LiveRegion.\n *\n * If this property is set, the `children` will be ignored.\n */\n source?: Array | undefined>;\n}\n\n/**\n * The live region is hidden in the layout, but visible for screen readers.\n * It's purpose it to announce changes e.g. when custom navigation logic is used.\n *\n * The way live region works differently in different browsers and screen readers and\n * it is recommended to manually test every new implementation.\n *\n * If you notice there are different words being merged together,\n * check if there are text nodes not being wrapped in elements, like:\n * ```\n * \n * {title}\n *
\n * \n * ```\n *\n * To fix, wrap \"title\" in an element:\n * ```\n * \n * {title}\n *
\n * \n * ```\n *\n * Or create a single text node if possible:\n * ```\n * \n * {`${title} ${details}`}\n * \n * ```\n *\n * The live region is always atomic, because non-atomic regions can be treated by screen readers\n * differently and produce unexpected results. To imitate non-atomic announcements simply use\n * multiple live regions:\n * ```\n * <>\n * {title}\n *
\n * \n * ```\n *\n * If you place interactive content inside the LiveRegion, the content will still be\n * interactive (e.g. as a tab stop). Consider using the `source` property instead.\n */\nexport default memo(LiveRegion);\n\nfunction LiveRegion({\n assertive = false,\n delay = 10,\n visible = false,\n tagName: TagName = 'span',\n children,\n id,\n source,\n ...restProps\n}: LiveRegionProps) {\n const sourceRef = useRef(null);\n const targetRef = useRef(null);\n\n /*\n When React state changes, React often produces too many DOM updates, causing NVDA to\n issue many announcements for the same logical event (See https://github.com/nvaccess/nvda/issues/7996).\n\n The code below imitates a debouncing, scheduling a callback every time new React state\n update is detected. When a callback resolves, it copies content from a muted element\n to the live region, which is recognized by screen readers as an update.\n\n If the use case requires no announcement to be ignored, use delay = 0, but ensure it\n does not impact the performance. If it does, prefer using a string as children prop.\n */\n useEffect(() => {\n function getSourceContent() {\n if (source) {\n return source\n .map(item => {\n if (!item) {\n return undefined;\n }\n if (typeof item === 'string') {\n return item;\n }\n if (item.current) {\n return extractInnerText(item.current);\n }\n })\n .filter(Boolean)\n .join(' ');\n }\n\n if (sourceRef.current) {\n return extractInnerText(sourceRef.current);\n }\n }\n function updateLiveRegion() {\n const sourceContent = getSourceContent();\n\n if (targetRef.current && sourceContent) {\n const targetContent = extractInnerText(targetRef.current);\n if (targetContent !== sourceContent) {\n // The aria-atomic does not work properly in Voice Over, causing\n // certain parts of the content to be ignored. To fix that,\n // we assign the source text content as a single node.\n targetRef.current.innerText = sourceContent;\n }\n }\n }\n\n let timeoutId: null | number;\n if (delay) {\n timeoutId = setTimeout(updateLiveRegion, delay);\n } else {\n updateLiveRegion();\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n });\n\n return (\n <>\n {visible && !source && (\n \n {children}\n \n )}\n\n \n {!visible && !source && (\n \n {children}\n \n )}\n\n \n \n \n );\n}\n\n// This only extracts text content from the node including all its children which is enough for now.\n// To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n// ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\nfunction extractInnerText(node: HTMLElement) {\n return (node.innerText || '').replace(/\\s+/g, ' ').trim();\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\n\nexport interface ScreenreaderOnlyProps {\n id?: string;\n className?: string;\n children?: React.ReactNode;\n}\n\n/**\n * Makes content now shown on a screen but still announced by screen-reader users.\n * The component is suitable when the aria-label cannot be used, e.g. to avoid elemnts being announced as \"blank\".\n *\n * To exclude screenreader-only content use `:not(.${screenreaderOnlyStyles.root})` selector, for example:\n *\n * ```\n * import screenreaderOnlyStyles from '~internal/components/screenreader-only/styles.css.js'\n *\n * let visibleContent = wrapper.find(`${styles.label}`).find(`:not(.${screenreaderOnlyStyles.root})`).getElement().textContent\n *\n * let screenreaderContent = wrapper.find(`${styles.label}`).find(`.${screenreaderOnlyStyles.root}`).getElement().textContent\n * ```\n */\nexport default function ScreenreaderOnly(props: ScreenreaderOnlyProps) {\n return ;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_xttbq_pgwjg_99\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_3bgfn_im8v7_5\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nimport { InternalButtonProps } from '../../button/internal';\n\nexport interface ButtonContextProps {\n onClick: ({ variant }: { variant: InternalButtonProps['variant'] }) => void;\n}\n\nexport const ButtonContext = createContext({\n onClick: () => {},\n});\n\nexport function useButtonContext() {\n return useContext(ButtonContext);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useContext } from 'react';\nimport {\n FunnelContext,\n FunnelNameSelectorContext,\n FunnelStepContext,\n FunnelSubStepContext,\n} from '../context/analytics-context';\nimport {\n DATA_ATTR_FUNNEL_INTERACTION_ID,\n DATA_ATTR_FUNNEL_SUBSTEP,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../selectors';\nimport { FunnelMetrics } from '../';\nimport { nodeBelongs } from '../../utils/node-belongs';\n\n/**\n * Custom React Hook to manage and interact with FunnelSubStep.\n * This hook will provide necessary properties and methods required\n * to track and manage interactions with a FunnelSubStep component.\n *\n * The `onFocus` method is used to track the beginning of interaction with the FunnelSubStep.\n * The `onBlur` method is used to track the completion of interaction with the FunnelSubStep.\n * The subStepId is a unique identifier for the funnel sub-step.\n * The subStepRef is a reference to the DOM element of the funnel sub-step.\n */\nexport const useFunnelSubStep = () => {\n const context = useContext(FunnelSubStepContext);\n const { funnelInteractionId, funnelState, latestFocusCleanupFunction } = useFunnel();\n const { stepNumber, stepNameSelector, subStepConfiguration } = useFunnelStep();\n\n const {\n instanceIdentifier,\n subStepId,\n subStepSelector,\n subStepNameSelector,\n subStepRef,\n isNestedSubStep,\n mousePressed,\n isFocusedSubStep,\n focusCleanupFunction,\n } = context;\n\n if (isNestedSubStep) {\n return context;\n }\n\n const onFocus = async (event: React.FocusEvent) => {\n const element = event.target;\n // Ignore spurious focus events, such as when the browser window is focused again.\n await new Promise(r => setTimeout(r, 1));\n if (document.activeElement !== element) {\n return;\n }\n\n if (isFocusedSubStep.current) {\n return;\n }\n isFocusedSubStep.current = true;\n\n if (funnelInteractionId && subStepId) {\n /*\n If the previously focused substep has provided a cleanup function, we\n call it here on behalf of the previously focused substep.\n */\n latestFocusCleanupFunction.current?.();\n\n const subStepName = getNameFromSelector(subStepNameSelector);\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepNumber = subStepConfiguration.current\n ?.get(stepNumber)\n ?.find(step => step.name === subStepName)?.number;\n FunnelMetrics.funnelSubStepStart({\n instanceIdentifier,\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n\n /*\n This cleanup function will be called when the user leaves this substep.\n The function might be called either:\n\n - by the next focused substep as `latestFocusCleanupFunction`\n (through a separate instance of the function we're currently in), or\n\n - by the same substep as `focusCleanupFunction`\n (through the `onMouseUp` handler or the `onBlur` handler).\n */\n let cleanupFunctionHasBeenRun = false;\n focusCleanupFunction.current = () => {\n if (cleanupFunctionHasBeenRun) {\n return;\n }\n cleanupFunctionHasBeenRun = true;\n\n const subStepNumber = subStepConfiguration.current?.get(stepNumber)?.find(s => s.name === subStepName)?.number;\n\n if (funnelState.current !== 'cancelled') {\n FunnelMetrics.funnelSubStepComplete({\n instanceIdentifier,\n funnelInteractionId,\n subStepSelector,\n subStepNameSelector,\n subStepName,\n subStepNumber,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n latestFocusCleanupFunction.current = focusCleanupFunction.current;\n }\n };\n\n const onBlur = (event: React.FocusEvent) => {\n if (mousePressed.current) {\n /*\n Ignore blur events that are caused by mouse interaction, because these events don't\n always reflect user intention. For example, clicking the label of an interactive form\n element will briefly blur it.\n The mouse-caused events are handled in the global `onMouseUp` handler of the substep\n context instead.\n */\n return;\n }\n\n if (!subStepRef.current || !event.relatedTarget || !nodeBelongs(subStepRef.current, event.relatedTarget)) {\n isFocusedSubStep.current = false;\n\n if (funnelInteractionId && subStepId && funnelState.current !== 'cancelled') {\n /*\n Run this substep's own focus cleanup function if another substep\n hasn't already done it for us.\n */\n focusCleanupFunction.current?.();\n }\n }\n };\n\n const funnelSubStepProps: Record = funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_SUBSTEP]: subStepId,\n onFocus,\n onBlur,\n }\n : {};\n\n return { funnelSubStepProps, ...context };\n};\n\n/**\n * Custom React Hook to manage and interact with FunnelStep.\n * This hook will provide necessary properties required to track\n * and manage interactions with a FunnelStep component.\n *\n * The 'data-analytics-funnel-step' property of funnelStepProps is used to track the index of the current step in the funnel.\n * The context contains additional properties of the FunnelStep.\n */\nexport const useFunnelStep = () => {\n const context = useContext(FunnelStepContext);\n return context;\n};\n\n/**\n * Custom React Hook to manage and interact with Funnel.\n * This hook will provide necessary properties required to track\n * and manage interactions with a Funnel component.\n *\n * The 'data-analytics-funnel-interaction-id' property of funnelProps is used to track the unique identifier of the current interaction with the funnel.\n */\nexport const useFunnel = () => {\n const context = useContext(FunnelContext);\n const funnelProps: Record = context.funnelInteractionId\n ? {\n [DATA_ATTR_FUNNEL_INTERACTION_ID]: context.funnelInteractionId,\n }\n : {};\n\n return { funnelProps, ...context };\n};\n\nexport const useFunnelNameSelector = () => {\n const context = useContext(FunnelNameSelectorContext);\n return context;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { MutableRefObject, RefObject, createContext } from 'react';\nimport { AnalyticsMetadata, FunnelType, SubStepConfiguration } from '../interfaces';\nimport { getFunnelNameSelector } from '../selectors';\n\nexport type FunnelState = 'default' | 'validating' | 'complete' | 'cancelled';\n\nexport interface FunnelContextValue {\n funnelInteractionId: string | undefined;\n funnelType: FunnelType;\n funnelNameSelector: string;\n optionalStepNumbers: number[];\n totalFunnelSteps: number;\n funnelSubmit: () => void;\n funnelCancel: () => void;\n setFunnelInteractionId: (funnelInteractionId: string) => void;\n submissionAttempt: number;\n funnelNextOrSubmitAttempt: () => void;\n funnelState: RefObject;\n errorCount: MutableRefObject;\n loadingButtonCount: MutableRefObject;\n latestFocusCleanupFunction: MutableRefObject void)>;\n isInFunnel: boolean;\n wizardCount: MutableRefObject;\n}\n\nexport interface FunnelStepContextValue {\n instanceIdentifier?: AnalyticsMetadata['instanceIdentifier'];\n stepNameSelector: string;\n stepNumber: number;\n funnelStepProps?: Record;\n subStepCount: MutableRefObject;\n isInStep: boolean;\n funnelInteractionId: string | undefined;\n /** This function is called when the list of substeps in this step changes. */\n onStepChange: () => void;\n subStepConfiguration: MutableRefObject | undefined>;\n}\n\nexport interface FunnelSubStepContextValue {\n instanceIdentifier?: AnalyticsMetadata['instanceIdentifier'];\n subStepId: string;\n subStepSelector: string;\n subStepNameSelector: string;\n subStepRef: MutableRefObject;\n mousePressed: MutableRefObject;\n /**\n * `isFocusedSubStep` is almost the same as checking if document.activeElement\n * is a child of the curren substep. However, `isFocusedSubStep` stays true\n * while the mouse button is pressed down, even though some browsers move the focus\n * to the body element during that time.\n */\n isFocusedSubStep: MutableRefObject;\n\n /**\n * The focus cleanup function should be run when the user leaves the substep.\n */\n focusCleanupFunction: MutableRefObject void)>;\n isNestedSubStep: boolean;\n funnelSubStepProps?: Record;\n}\n\n/* istanbul ignore next */\nexport const FunnelContext = createContext({\n funnelInteractionId: undefined,\n funnelNameSelector: getFunnelNameSelector(),\n setFunnelInteractionId: () => {},\n funnelType: 'single-page',\n optionalStepNumbers: [],\n totalFunnelSteps: 0,\n funnelSubmit: () => {},\n funnelCancel: () => {},\n submissionAttempt: 0,\n funnelNextOrSubmitAttempt: () => {},\n funnelState: { current: 'default' },\n errorCount: { current: 0 },\n loadingButtonCount: { current: 0 },\n latestFocusCleanupFunction: { current: undefined },\n isInFunnel: false,\n wizardCount: { current: 0 },\n});\n\nexport const FunnelStepContext = createContext({\n stepNameSelector: '',\n stepNumber: 0,\n subStepCount: { current: 0 },\n isInStep: false,\n funnelInteractionId: undefined,\n onStepChange: () => {},\n subStepConfiguration: { current: new Map() },\n});\n\nexport const FunnelSubStepContext = createContext({\n subStepId: '',\n subStepSelector: '',\n subStepNameSelector: '',\n subStepRef: { current: null },\n isNestedSubStep: false,\n mousePressed: { current: false },\n isFocusedSubStep: { current: false },\n focusCleanupFunction: { current: undefined },\n});\n\nexport const FunnelNameSelectorContext = createContext(undefined);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const DATA_ATTR_FUNNEL = 'data-analytics-funnel';\nexport const DATA_ATTR_FUNNEL_INTERACTION_ID = `${DATA_ATTR_FUNNEL}-interaction-id`;\nexport const DATA_ATTR_FUNNEL_KEY = `${DATA_ATTR_FUNNEL}-key`;\nexport const DATA_ATTR_FUNNEL_VALUE = `${DATA_ATTR_FUNNEL}-value`;\nexport const DATA_ATTR_FUNNEL_STEP = `${DATA_ATTR_FUNNEL}-step`;\nexport const DATA_ATTR_FUNNEL_SUBSTEP = `${DATA_ATTR_FUNNEL}-substep`;\n\nexport const DATA_ATTR_FIELD_LABEL = 'data-analytics-field-label';\nexport const DATA_ATTR_FIELD_ERROR = 'data-analytics-field-error';\n\nexport const DATA_ATTR_ANALYTICS_ALERT = 'data-analytics-alert';\nexport const DATA_ATTR_ANALYTICS_FLASHBAR = 'data-analytics-flashbar';\n\nexport const FUNNEL_KEY_FUNNEL_NAME = 'funnel-name';\nexport const FUNNEL_KEY_STEP_NAME = 'step-name';\nexport const FUNNEL_KEY_SUBSTEP_NAME = 'substep-name';\n\nexport const getFunnelNameSelector = () => `[${DATA_ATTR_FUNNEL_KEY}=\"${FUNNEL_KEY_FUNNEL_NAME}\"]`;\nexport const getFunnelKeySelector = (key: string) => `[${DATA_ATTR_FUNNEL_KEY}=\"${key}\"]`;\nexport const getFunnelValueSelector = (value: string) => `[${DATA_ATTR_FUNNEL_VALUE}=\"${value}\"]`;\n\nexport const getSubStepAllSelector = () => `[${DATA_ATTR_FUNNEL_SUBSTEP}]`;\nexport const getSubStepSelector = (subStepId: string) => `[${DATA_ATTR_FUNNEL_SUBSTEP}=\"${subStepId}\"]`;\nexport const getSubStepNameSelector = (subStepId?: string) =>\n [subStepId ? getSubStepSelector(subStepId) : '', `[${DATA_ATTR_FUNNEL_KEY}=\"${FUNNEL_KEY_SUBSTEP_NAME}\"]`].join(' ');\n\nexport const getFieldSlotSeletor = (id: string | undefined) => (id ? `[id=\"${id}\"]` : undefined);\n\nexport const getNameFromSelector = (selector: string | undefined): string | undefined =>\n selector ? document.querySelector(selector)?.innerText?.trim() : undefined;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/* istanbul ignore file */\n\nimport { IFunnelMetrics } from './interfaces';\n\nexport function setFunnelMetrics(funnelMetrics: IFunnelMetrics) {\n FunnelMetrics = funnelMetrics;\n}\n\n/**\n * This is a stub implementation of the FunnelMetrics interface and will be replaced during\n * build time with the actual implementation.\n */\nexport let FunnelMetrics: IFunnelMetrics = {\n funnelStart(): string {\n return '';\n },\n\n funnelError(): void {},\n funnelComplete(): void {},\n funnelSuccessful(): void {},\n funnelCancelled(): void {},\n funnelChange(): void {},\n funnelStepStart(): void {},\n funnelStepComplete(): void {},\n funnelStepNavigation(): void {},\n funnelStepError(): void {},\n funnelStepChange(): void {},\n funnelSubStepStart(): void {},\n funnelSubStepComplete(): void {},\n funnelSubStepError(): void {},\n helpPanelInteracted(): void {},\n externalLinkInteracted(): void {},\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport balanced from 'balanced-match';\nimport { calculateOnce } from './calculate-once';\n\nexport function findUpUntil(node: HTMLElement, callback: (element: HTMLElement) => boolean): HTMLElement | null {\n let current: HTMLElement | null = node;\n while (current && !callback(current)) {\n current = current.parentElement;\n // If a component is used within an svg (i.e. as foreignObject), then it will\n // have some ancestor nodes that are SVGElement. We want to skip those,\n // as they have very different properties to HTMLElements.\n while (current && !(current instanceof HTMLElement)) {\n current = (current as Element).parentElement;\n }\n }\n return current;\n}\n\n/**\n * Returns whether the browser supports CSS position sticky.\n * In our list of supported browsers, only returns false for IE11.\n */\nexport function supportsStickyPosition() {\n if (typeof window === 'undefined') {\n // render no-sticky UI on server-side\n return false;\n }\n return window.CSS?.supports?.('position', 'sticky') ?? false;\n}\n\n/**\n * Returns whether `position: fixed` can be relative to transformed parents or\n * whether it's always relative to the viewport. Returns `true` on all browsers\n * except IE.\n */\nconst supportsContainingBlockPositioning = calculateOnce(() => {\n const parent = document.createElement('div');\n parent.style.transform = 'translateY(5px)';\n document.body.appendChild(parent);\n\n const child = document.createElement('div');\n child.style.position = 'fixed';\n child.style.top = '0';\n parent.appendChild(child);\n\n const result = parent.getBoundingClientRect().top === child.getBoundingClientRect().top;\n document.body.removeChild(parent);\n return result;\n});\n\n/**\n * Returns an element that is used to position the given element.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block\n */\nexport function getContainingBlock(startElement: HTMLElement): HTMLElement | null {\n if (!startElement.parentElement) {\n return null;\n }\n\n return supportsContainingBlockPositioning()\n ? (findUpUntil(startElement.parentElement, element => {\n const computedStyle = getComputedStyle(element);\n return (\n (!!computedStyle.transform && computedStyle.transform !== 'none') ||\n (!!computedStyle.perspective && computedStyle.perspective !== 'none')\n );\n }) as HTMLElement)\n : null;\n}\n\nconst cssVariableExpression = /--.+?\\s*,\\s*(.+)/;\n\n/**\n * Parses a CSS color value that might contain CSS Custom Properties\n * and returns a value that will be understood by the browser, no matter of support level.\n * If the browser support CSS Custom Properties, the value will be return as is. Otherwise,\n * the fallback value will be extracted and returned instead.\n */\nexport function parseCssVariable(value: string) {\n if (window.CSS?.supports?.('color', 'var(--dummy, #000)') ?? false) {\n return value;\n }\n\n const varIndex = value.lastIndexOf('var(');\n if (varIndex === -1) {\n return value;\n }\n\n const expr = balanced('(', ')', value.substr(varIndex));\n if (!expr) {\n return value;\n }\n\n const match = expr.body.match(cssVariableExpression);\n return match ? match[1] : value;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function calculateOnce(callback: () => T) {\n let result: T | undefined = undefined;\n return () => {\n if (result === undefined) {\n result = callback();\n }\n return result;\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { findUpUntil } from './dom';\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\n\n/**\n * Checks whether the given node (target) belongs to the container.\n * The function is similar to nodeContains but also accounts for dropdowns with expandToViewport=true.\n *\n * @param container Container node\n * @param target Node that is checked to be a descendant of the container\n */\nexport function nodeBelongs(container: Node | null, target: Node | EventTarget | null): boolean {\n if (!(target instanceof Node)) {\n return false;\n }\n const portal = findUpUntil(\n target as HTMLElement,\n node => node === container || (node instanceof HTMLElement && !!node.dataset.awsuiReferrerId)\n );\n if (portal && portal === container) {\n // We found the container as a direct ancestor without a portal\n return true;\n }\n const referrer = portal instanceof HTMLElement ? document.getElementById(portal.dataset.awsuiReferrerId ?? '') : null;\n return referrer ? nodeContains(container, referrer) : nodeContains(container, target);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nlet counter = 0;\nconst useIdFallback = () => {\n const idRef = useRef(null);\n if (!idRef.current) {\n idRef.current = `${counter++}-${Date.now()}-${Math.round(Math.random() * 10000)}`;\n }\n return idRef.current;\n};\n\nconst useId: typeof useIdFallback = (React as any).useId ?? useIdFallback;\n\nexport function useUniqueId(prefix?: string) {\n return `${prefix ? prefix : ''}` + useId();\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect } from 'react';\nimport { useUniqueId } from './use-unique-id';\nimport { useEffectOnUpdate } from './use-effect-on-update';\n\nexport function usePerformanceMarks(\n name: string,\n enabled: boolean,\n elementRef: React.RefObject,\n getDetails: () => Record,\n dependencies: React.DependencyList\n) {\n const id = useUniqueId();\n\n useEffect(() => {\n if (!enabled || !elementRef.current) {\n return;\n }\n\n const elementVisible =\n elementRef.current.offsetWidth > 0 &&\n elementRef.current.offsetHeight > 0 &&\n getComputedStyle(elementRef.current).visibility !== 'hidden';\n\n if (!elementVisible) {\n return;\n }\n\n const renderedMarkName = `${name}Rendered`;\n\n performance.mark(renderedMarkName, {\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n ...getDetails(),\n },\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectOnUpdate(() => {\n if (!enabled || !elementRef.current) {\n return;\n }\n const elementVisible =\n elementRef.current.offsetWidth > 0 &&\n elementRef.current.offsetHeight > 0 &&\n getComputedStyle(elementRef.current).visibility !== 'hidden';\n\n if (!elementVisible) {\n return;\n }\n\n const updatedMarkName = `${name}Updated`;\n\n performance.mark(updatedMarkName, {\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n ...getDetails(),\n },\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DependencyList, EffectCallback, useEffect, useRef } from 'react';\n\n// useEffect, which skips the initial render\nexport function useEffectOnUpdate(callback: EffectCallback, deps: DependencyList) {\n const isFirstRender = useRef(true);\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n } else {\n return callback();\n }\n // This is a useEffect extension, will be validated at the call site\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nexport type FocusableChangeHandler = (isFocusable: boolean) => void;\n\nexport interface SingleTabStopNavigationOptions {\n tabIndex?: number;\n}\n\nexport const defaultValue: {\n navigationActive: boolean;\n registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;\n} = {\n navigationActive: false,\n registerFocusable: () => () => {},\n};\n\n/**\n * Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.\n * It instructs interactive elements to override tab indices for just a single one to remain user-focusable.\n */\nexport const SingleTabStopNavigationContext = createContext(defaultValue);\n\nexport function useSingleTabStopNavigation(\n focusable: null | React.RefObject,\n options?: { tabIndex?: number }\n) {\n const { navigationActive: contextNavigationActive, registerFocusable } = useContext(SingleTabStopNavigationContext);\n const [focusTargetActive, setFocusTargetActive] = useState(false);\n const navigationDisabled = options?.tabIndex && options?.tabIndex < 0;\n const navigationActive = contextNavigationActive && !navigationDisabled;\n\n useEffect(() => {\n if (navigationActive && focusable && focusable.current) {\n const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));\n return () => unregister();\n }\n });\n\n let tabIndex = options?.tabIndex;\n if (navigationActive) {\n tabIndex = !focusTargetActive ? -1 : options?.tabIndex ?? 0;\n }\n\n return { navigationActive, tabIndex };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useLayoutEffect, useState } from 'react';\nimport { findUpUntil } from '../../utils/dom';\n\ninterface VisualContextProps {\n contextName: string;\n className?: string;\n children: React.ReactNode;\n}\n\nconst contextMatch = /awsui-context-([\\w-]+)/;\n\nexport function useVisualContext(elementRef: React.RefObject) {\n const [value, setValue] = useState('');\n\n useLayoutEffect(() => {\n if (elementRef.current) {\n const contextParent = findUpUntil(elementRef.current, node => !!node.className.match(contextMatch));\n setValue(contextParent?.className.match(contextMatch)![1] ?? '');\n }\n }, [elementRef]);\n\n return value;\n}\n\n/**\n * This function returns only the className string needed to apply a\n * visual context to the DOM. It is used by the default export but\n * can also be imported directly for situations where the insertion\n * of a
node creates style problems.\n */\nexport function getVisualContextClassname(contextName: string) {\n return `awsui-context-${contextName}`;\n}\n\nexport default function VisualContext({ contextName, className, children }: VisualContextProps) {\n return
{children}
;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"alert\": \"awsui_alert_mx3cw_ipfn3_99\",\n \"awsui-motion-fade-in\": \"awsui_awsui-motion-fade-in_mx3cw_ipfn3_1\",\n \"root\": \"awsui_root_mx3cw_ipfn3_125\",\n \"hidden\": \"awsui_hidden_mx3cw_ipfn3_163\",\n \"with-dismiss\": \"awsui_with-dismiss_mx3cw_ipfn3_213\",\n \"with-action\": \"awsui_with-action_mx3cw_ipfn3_213\",\n \"breakpoint-default\": \"awsui_breakpoint-default_mx3cw_ipfn3_219\",\n \"header\": \"awsui_header_mx3cw_ipfn3_226\",\n \"action\": \"awsui_action_mx3cw_ipfn3_230\",\n \"action-slot\": \"awsui_action-slot_mx3cw_ipfn3_235\",\n \"action-button\": \"awsui_action-button_mx3cw_ipfn3_236\",\n \"alert-focus-wrapper\": \"awsui_alert-focus-wrapper_mx3cw_ipfn3_240\",\n \"text\": \"awsui_text_mx3cw_ipfn3_269\",\n \"icon\": \"awsui_icon_mx3cw_ipfn3_276\",\n \"message\": \"awsui_message_mx3cw_ipfn3_279\",\n \"icon-size-medium\": \"awsui_icon-size-medium_mx3cw_ipfn3_287\",\n \"icon-size-big\": \"awsui_icon-size-big_mx3cw_ipfn3_290\",\n \"icon-size-normal\": \"awsui_icon-size-normal_mx3cw_ipfn3_293\",\n \"content\": \"awsui_content_mx3cw_ipfn3_297\",\n \"dismiss\": \"awsui_dismiss_mx3cw_ipfn3_301\",\n \"dismiss-button\": \"awsui_dismiss-button_mx3cw_ipfn3_306\",\n \"type-error\": \"awsui_type-error_mx3cw_ipfn3_310\",\n \"type-warning\": \"awsui_type-warning_mx3cw_ipfn3_318\",\n \"type-success\": \"awsui_type-success_mx3cw_ipfn3_326\",\n \"type-info\": \"awsui_type-info_mx3cw_ipfn3_334\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport type Breakpoint = 'default' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl';\n\nconst BREAKPOINT_MAPPING: [Breakpoint, number][] = [\n ['xl', 1840],\n ['l', 1320],\n ['m', 1120],\n ['s', 912],\n ['xs', 688],\n ['xxs', 465],\n ['default', -1],\n];\n\nexport const mobileBreakpoint = BREAKPOINT_MAPPING.filter(b => b[0] === 'xs')[0][1];\n\nconst BREAKPOINTS_DESCENDING = BREAKPOINT_MAPPING.map(([bp]) => bp);\n\n/**\n * Take a breakpoint mapping and return the breakpoint value that most closely matches the actual breakpoint.\n */\nexport function matchBreakpointMapping(subset: Partial>, actual: Breakpoint): T | null {\n const qualifyingBreakpoints = BREAKPOINT_MAPPING.slice(BREAKPOINTS_DESCENDING.indexOf(actual));\n for (const [breakpoint] of qualifyingBreakpoints) {\n const breakpointValue = subset[breakpoint];\n if (breakpointValue !== undefined) {\n return breakpointValue;\n }\n }\n return null;\n}\n\n/**\n * Get the named breakpoint for a provided width, optionally filtering to a subset of breakpoints.\n */\nexport function getMatchingBreakpoint(\n width: number,\n breakpointFilter?: T\n): T[number] | 'default' {\n for (const [breakpoint, breakpointWidth] of BREAKPOINT_MAPPING) {\n if (width > breakpointWidth && (!breakpointFilter || breakpointFilter.indexOf(breakpoint) !== -1)) {\n return breakpoint;\n }\n }\n return 'default';\n}\n\nexport function getBreakpointValue(breakpoint: Breakpoint): number {\n return BREAKPOINT_MAPPING.find(bp => bp[0] === breakpoint)![1];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef, useState, useCallback } from 'react';\nimport { useResizeObserver } from '../internal/container-queries/use-resize-observer';\n/**\n * Attaches resize-observer to the referenced element and keeps last observation in state.\n * The hook allows to limit the amount of re-renders to only when the observed value changes.\n *\n * @example\n * Switching display mode under a given condition (only re-renders when mode changes):\n * ```\n * const [smallMode, ref] = useContainerQuery(entry => entry.contentBoxHeight <= smallModeHeight, [smallModeHeight])\n * ```\n *\n * @example\n * Obtaining observer entry (re-renders with each observation):\n * ```\n * const [entry, ref] = useContainerQuery(entry => entry)\n * ```\n *\n * @example\n * Using previous state to avoid unnecessary re-renders:\n * ```\n * const [value, ref] = useContainerQuery((entry, prev) => shouldUpdate(entry) ? getValue(entry) : prev)\n * ```\n *\n * @typeParam ObservedState State obtained from the last observation\n * @param mapFn Function to convert ContainerQueryEntry to ObservedState\n * @param deps Dependency list to indicate when the mapFn changes\n * @returns A tuple of the observed state and a reference to be attached to the target element\n */\nexport default function useContainerQuery(mapFn, deps) {\n if (deps === void 0) { deps = []; }\n var elementRef = useRef(null);\n var _a = useState(null), state = _a[0], setState = _a[1];\n // Update getElement when deps change to trigger new observation.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n var getElement = useCallback(function () { return elementRef.current; }, deps);\n useResizeObserver(getElement, function (entry) { return setState(function (prevState) { return mapFn(entry, prevState); }); });\n return [state, elementRef];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState, useEffect, useCallback } from 'react';\nimport { useStableCallback } from '../internal/stable-callback';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '../internal/logging';\n/**\n * This hook allows you to make a component that can be used both in controlled\n * mode and uncontrolled mode. Pass in your component's props, and then implement\n * your component as if it was only controlled.\n *\n * A component determines its mode (either controlled or uncontrolled) on the\n * first render and keeps it for its lifetime. The mode cannot be switched later.\n *\n * @example\n * Using useControllableState in a custom checkbox component\n * ```\n * const [checked, setChecked] = useControllable(\n * props.checked,\n * props.onChange,\n * props.defaultEnabled ?? false,\n * {\n * componentName: 'MyCheckboxComponent',\n * propertyName: 'checked',\n * changeHandler: 'onChange'\n * }\n * );\n *\n * return (\n * setChecked(event.target.checked)}\n * />\n * );\n * ```\n *\n * @param controlledValue The value to use for controlled mode\n * @param changeHandler The update handler for controlled mode\n * @param defaultValue The initial value for uncontrolled mode\n * @param propertyDescriptions Property names used when emitting warnings\n * @param fireEvent Callback executed when controllable value changes\n * @returns A tuple of value and value setter\n */\nexport default function useControllable(controlledValue, changeHandler, defaultValue, propertyDescriptions, fireEvent) {\n if (fireEvent === void 0) { fireEvent = function (value, handler) { return handler(value); }; }\n var componentName = propertyDescriptions.componentName, changeHandlerName = propertyDescriptions.changeHandlerName, propertyName = propertyDescriptions.propertyName;\n // The decision whether a component is controlled or uncontrolled is made on\n // its first render and cannot be changed afterwards.\n var isControlled = useState(controlledValue !== undefined)[0];\n // Most build tools will just strip this block from production builds, so we can\n // skip the conditional hook lint error.\n if (isDevelopment) {\n // Print a warning if a controlled property was passed in without a change handler.\n // This may fire every render if the change handler isn't memoized, but warnOnce\n // will dedupe the error messages.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(function () {\n if (isControlled && changeHandler === undefined) {\n warnOnce(componentName, \"You provided a `\".concat(propertyName, \"` prop without an `\").concat(changeHandlerName, \"` handler. This will render a non-interactive component.\"));\n }\n }, [changeHandler, isControlled, componentName, changeHandlerName, propertyName]);\n // Print a warning if the component switches between controlled and uncontrolled mode.\n var isControlledValueProvided_1 = controlledValue !== undefined;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(function () {\n if (isControlled !== isControlledValueProvided_1) {\n var initialMode = isControlled ? 'controlled' : 'uncontrolled';\n var modeNow = isControlledValueProvided_1 ? 'controlled' : 'uncontrolled';\n warnOnce(componentName, \"A component tried to change \".concat(initialMode, \" '\").concat(propertyName, \"' property to be \").concat(modeNow, \". \") +\n \"This is not supported. Properties should not switch from \".concat(initialMode, \" to \").concat(modeNow, \" (or vice versa). \") +\n \"Decide between using a controlled or uncontrolled mode for the lifetime of the component. \" +\n \"More info: https://fb.me/react-controlled-components\");\n }\n }, [isControlled, isControlledValueProvided_1, propertyName, componentName]);\n }\n // This is the value that is used if the component is uncontrolled.\n var _a = useState(defaultValue), valueState = _a[0], setValue = _a[1];\n var _b = useState(false), isUncontrolledValueSet = _b[0], setIsUncontrolledValueSet = _b[1];\n var stableFireEvent = useStableCallback(function (value, handler) { return fireEvent(value, handler); });\n var setControlledValue = useCallback(function (value) {\n if (changeHandler) {\n stableFireEvent(value, changeHandler);\n }\n }, [changeHandler, stableFireEvent]);\n // We allow changes to the defaultValue prop to be reflected until the component\n // starts controlling it internally.\n var currentUncontrolledValue = isUncontrolledValueSet ? valueState : defaultValue;\n var setUncontrolledValue = useCallback(function (newValue) {\n setValue(newValue);\n setIsUncontrolledValueSet(true);\n }, []);\n return isControlled ? [controlledValue, setControlledValue] : [currentUncontrolledValue, setUncontrolledValue];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { Breakpoint, getMatchingBreakpoint } from '../../breakpoints';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\n/**\n * Re-renders the component when the breakpoint for the component changes. Scopes the re-renders to the specific\n * breakpoints you want to break at. \"default\" is always included as a fallback, so [\"xs\"] would trigger for\n * \"default\" and \"xs\".\n *\n * @param triggers The relevant breakpoints to trigger for.\n */\nexport function useContainerBreakpoints(triggers?: T) {\n // triggers.join() gives us a stable value to use for the dependencies argument\n const triggersDep = triggers?.join();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useContainerQuery(rect => getMatchingBreakpoint(rect.contentBoxWidth, triggers), [triggersDep]) as [\n 'default' | T[number] | null,\n React.Ref\n ];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useContext } from 'react';\nimport { I18nFormatArgTypes } from './messages-types';\n\nexport type CustomHandler = (formatFn: (args: FormatFnArgs) => string) => ReturnValue;\n\nexport interface FormatFunction {\n (namespace: string, component: string, key: string, provided: string): string;\n (namespace: string, component: string, key: string, provided: string | undefined): string | undefined;\n (namespace: string, component: string, key: string, provided: T, handler?: CustomHandler): T;\n}\n\nexport interface InternalI18nContextProps {\n locale: string | null;\n format: FormatFunction;\n}\n\nexport const InternalI18nContext = React.createContext({\n locale: null,\n format: (_namespace: string, _component: string, _key: string, provided: T) => provided,\n});\n\nexport function useLocale(): string | null {\n return useContext(InternalI18nContext).locale;\n}\n\n/**\n * Utility to get \"keyof T\" but exclude number or symbol types.\n * TypeScript allows those types because JS implicitly casts them to string.\n */\ntype StringKeyOf = Extract;\n\nexport interface ComponentFormatFunction> {\n >(\n key: MessageKey,\n provided: string,\n handler?: CustomHandler\n ): string;\n >(\n key: MessageKey,\n provided: string | undefined,\n handler?: CustomHandler\n ): string | undefined;\n , ReturnValue>(\n key: MessageKey,\n provided: ReturnValue,\n handler: I18nFormatArgTypes[ComponentName][MessageKey] extends never\n ? never\n : CustomHandler\n ): ReturnValue;\n}\n\nexport function useInternalI18n>(\n componentName: ComponentName\n): ComponentFormatFunction {\n const { format } = useContext(InternalI18nContext);\n return , ValueType>(\n key: MessageKey,\n provided: ValueType,\n customHandler?: CustomHandler\n ) => {\n return format('@cloudscape-design/components', componentName, key, provided, customHandler);\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createContext } from 'react';\nimport { LinkProps } from '../../link/interfaces';\n\nexport const defaultValue: { defaultVariant: LinkProps.Variant } = {\n defaultVariant: 'secondary',\n};\n\nexport const LinkDefaultVariantContext = createContext(defaultValue);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\n\ninterface RuntimeContentWrapperProps {\n mountContent: (container: HTMLElement) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport function RuntimeContentWrapper({ mountContent, unmountContent }: RuntimeContentWrapperProps) {\n const ref = useRef(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container);\n return () => unmountContent(container);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return
;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\nimport { RuntimeContentWrapper } from './runtime-content-wrapper';\n\nfunction convertRuntimeAction(action: ActionConfig | null, context: ActionContext) {\n if (!action) {\n return null;\n }\n return (\n action.mountContent(container, context)}\n unmountContent={container => action.unmountContent(container)}\n />\n );\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string) {\n const [discoveredActions, setDiscoveredActions] = useState>([]);\n const headerRef = useRef(null);\n const contentRef = useRef(null);\n\n useEffect(() => {\n return onActionRegistered(actions => {\n setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));\n });\n }, [type]);\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// default delay for components defined by UX\nexport const DEBOUNCE_DEFAULT_DELAY = 200;\n\n// instead of using this function directly, consider using useDebounceCallback hook\nexport default function debounce void>(\n func: CallbackType,\n delay: number = DEBOUNCE_DEFAULT_DELAY\n): CallbackType {\n let timeout: ReturnType | null;\n\n return function (...args: any[]) {\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n timeout = null;\n func(...args);\n }, delay);\n } as CallbackType;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { NonCancelableEventHandler } from '../../events';\n\nexport interface DrawerConfig {\n id: string;\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n };\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n orderPriority?: number;\n defaultActive?: boolean;\n trigger: {\n iconSvg: string;\n };\n mountContent: (container: HTMLElement) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport type DrawersRegistrationListener = (drawers: Array) => void;\n\nexport interface DrawersApiPublic {\n registerDrawer(config: DrawerConfig): void;\n}\n\nexport interface DrawersApiInternal {\n clearRegisteredDrawers(): void;\n onDrawersRegistered(listener: DrawersRegistrationListener): () => void;\n}\n\nexport class DrawersController {\n private drawers: Array = [];\n private drawersRegistrationListener: DrawersRegistrationListener | null = null;\n\n scheduleUpdate = debounce(() => {\n this.drawersRegistrationListener?.(this.drawers);\n }, 0);\n\n registerDrawer = (config: DrawerConfig) => {\n this.drawers = this.drawers.concat(config);\n this.scheduleUpdate();\n };\n\n onDrawersRegistered = (listener: DrawersRegistrationListener) => {\n if (this.drawersRegistrationListener !== null) {\n console.warn('[AwsUi] [runtime drawers] multiple app layout instances detected');\n }\n this.drawersRegistrationListener = listener;\n this.scheduleUpdate();\n return () => {\n this.drawersRegistrationListener = null;\n };\n };\n\n clearRegisteredDrawers = () => {\n this.drawers = [];\n };\n\n installPublic(api: Partial = {}): DrawersApiPublic {\n api.registerDrawer ??= this.registerDrawer;\n return api as DrawersApiPublic;\n }\n\n installInternal(internalApi: Partial = {}): DrawersApiInternal {\n internalApi.clearRegisteredDrawers ??= this.clearRegisteredDrawers;\n internalApi.onDrawersRegistered ??= this.onDrawersRegistered;\n return internalApi as DrawersApiInternal;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function sortByPriority(items: Array) {\n return items.slice().sort((a, b) => {\n if (b.orderPriority !== a.orderPriority) {\n return Math.sign((b.orderPriority ?? 0) - (a.orderPriority ?? 0));\n }\n return b.id < a.id ? 1 : -1;\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim;\n contentRef: RefShim;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport type ActionRegistrationListener = (action: Array) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n}\n\nexport interface ActionsApiInternal {\n clearRegisteredActions(): void;\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array = [];\n private actions: Array = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActions = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial = {}): ActionsApiInternal {\n internalApi.clearRegisteredActions ??= this.clearRegisteredActions;\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DrawersApiInternal, DrawersApiPublic, DrawersController } from './controllers/drawers';\nimport { ActionsApiInternal, ActionsApiPublic, ActionButtonsController } from './controllers/action-buttons';\n\nconst storageKey = Symbol.for('awsui-plugin-api');\n\ninterface AwsuiApi {\n awsuiPlugins: {\n appLayout: DrawersApiPublic;\n alert: ActionsApiPublic;\n flashbar: ActionsApiPublic;\n };\n awsuiPluginsInternal: {\n appLayout: DrawersApiInternal;\n alert: ActionsApiInternal;\n flashbar: ActionsApiInternal;\n };\n}\n\ninterface WindowWithApi extends Window {\n [storageKey]: AwsuiApi;\n}\n\nfunction findUpApi(currentWindow: WindowWithApi): AwsuiApi | undefined {\n try {\n if (currentWindow?.[storageKey]) {\n return currentWindow[storageKey];\n }\n\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n\n return findUpApi(currentWindow.parent as WindowWithApi);\n } catch (ex) {\n // Most likely a cross-origin access error\n return undefined;\n }\n}\n\nexport function loadApi() {\n if (typeof window === 'undefined') {\n return installApi({});\n }\n const win = window as unknown as WindowWithApi;\n const existingApi = findUpApi(win);\n win[storageKey] = installApi(existingApi ?? {});\n return win[storageKey];\n}\n\nexport const { awsuiPlugins, awsuiPluginsInternal } = loadApi();\n\ntype DeepPartial = T extends (...args: any) => any ? T : { [P in keyof T]?: DeepPartial };\n\nfunction installApi(api: DeepPartial): AwsuiApi {\n api.awsuiPlugins ??= {};\n api.awsuiPluginsInternal ??= {};\n\n const appLayoutDrawers = new DrawersController();\n api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout);\n api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout);\n\n const alertActions = new ActionButtonsController();\n api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert);\n api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert);\n\n const flashbarActions = new ActionButtonsController();\n api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar);\n api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar);\n\n return api as AwsuiApi;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport InternalButton, { InternalButtonProps } from '../../button/internal';\n\nfunction createActionButton(\n testUtilClasses: ActionsWrapperProps['testUtilClasses'],\n action: React.ReactNode,\n buttonText: React.ReactNode,\n onButtonClick: InternalButtonProps['onClick']\n) {\n if (!action && buttonText) {\n action = (\n \n {buttonText}\n \n );\n }\n return action ?
{action}
: null;\n}\n\ninterface ActionsWrapperProps {\n className: string;\n testUtilClasses: { actionSlot: string; actionButton: string };\n action: React.ReactNode;\n discoveredActions: Array;\n buttonText: React.ReactNode;\n onButtonClick: InternalButtonProps['onClick'];\n}\n\nexport function ActionsWrapper({\n className,\n testUtilClasses,\n action,\n discoveredActions,\n buttonText,\n onButtonClick,\n}: ActionsWrapperProps) {\n const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick);\n if (!actionButton && discoveredActions.length === 0) {\n return null;\n }\n\n return (\n
\n {actionButton}\n {discoveredActions}\n
\n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_37gf8_14wux_9\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ComponentConfiguration, useComponentMetrics } from '@cloudscape-design/component-toolkit/internal';\nimport { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from '../../environment';\nimport { useVisualRefresh } from '../use-visual-mode';\n\nexport function useTelemetry(componentName: string, config?: ComponentConfiguration) {\n const theme = useVisualRefresh() ? 'vr' : THEME;\n useComponentMetrics(componentName, { packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme }, config);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect } from 'react';\nimport { KeyCode } from '../../keycode';\n\nexport function isModifierKey(event: KeyboardEvent) {\n // we do not want to highlight focused element\n // when special keys are pressed\n return [KeyCode.shift, KeyCode.alt, KeyCode.control, KeyCode.meta].indexOf(event.keyCode) > -1;\n}\n\nfunction setIsKeyboard(active: boolean) {\n if (active) {\n document.body.setAttribute('data-awsui-focus-visible', 'true');\n } else {\n document.body.removeAttribute('data-awsui-focus-visible');\n }\n}\n\nfunction handleMousedown() {\n return setIsKeyboard(false);\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (!isModifierKey(event)) {\n setIsKeyboard(true);\n }\n}\n\nlet componentsCount = 0;\n\nfunction addListeners() {\n document.addEventListener('mousedown', handleMousedown);\n document.addEventListener('keydown', handleKeydown);\n}\n\nfunction removeListeners() {\n document.removeEventListener('mousedown', handleMousedown);\n document.removeEventListener('keydown', handleKeydown);\n}\n\nexport default function useFocusVisible() {\n useEffect(() => {\n if (componentsCount === 0) {\n addListeners();\n }\n componentsCount++;\n return () => {\n componentsCount--;\n if (componentsCount === 0) {\n removeListeners();\n }\n };\n }, []);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// When updating the list of key codes, don't forget\n// to modify corresponding list in test-utils\n// to avoid failing unit tests\nexport enum KeyCode {\n pageUp = 33,\n pageDown = 34,\n end = 35,\n home = 36,\n backspace = 8,\n space = 32,\n down = 40,\n left = 37,\n right = 39,\n up = 38,\n escape = 27,\n enter = 13,\n tab = 9,\n shift = 16,\n control = 17,\n alt = 18,\n meta = 91,\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { MutableRefObject } from 'react';\nimport { ComponentConfiguration, useComponentMetadata } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useTelemetry } from '../use-telemetry';\nimport { PACKAGE_VERSION } from '../../environment';\nimport useFocusVisible from '../focus-visible';\nimport { AnalyticsMetadata } from '../../analytics/interfaces';\n\nexport interface InternalBaseComponentProps {\n __internalRootRef?: MutableRefObject | null;\n}\n\n/**\n * This hook is used for components which are exported to customers. The returned __internalRootRef needs to be\n * attached to the (internal) component's root DOM node. The hook takes care of attaching the metadata to this\n * root DOM node and emits the telemetry for this component.\n */\nexport default function useBaseComponent(\n componentName: string,\n config?: ComponentConfiguration,\n analyticsMetadata?: AnalyticsMetadata\n) {\n useTelemetry(componentName, config);\n useFocusVisible();\n const elementRef = useComponentMetadata(componentName, PACKAGE_VERSION, { ...analyticsMetadata });\n return { __internalRootRef: elementRef };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { AnchorNavigationProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalAnchorNavigation from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { AnchorNavigationProps };\n\nexport default function AnchorNavigation({ scrollSpyOffset = 0, ...props }: AnchorNavigationProps) {\n const baseComponentProps = useBaseComponent('AnchorNavigation');\n return ;\n}\napplyDisplayName(AnchorNavigation, 'AnchorNavigation');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport testUtilsStyles from './test-classes/styles.css.js';\nimport { AnchorNavigationProps } from './interfaces';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport useScrollSpy from './use-scroll-spy.js';\nimport { fireCancelableEvent, fireNonCancelableEvent, isPlainLeftClick } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { getBaseProps } from '../internal/base-component/index.js';\n\nexport default function InternalAnchorNavigation({\n anchors,\n ariaLabelledby,\n onFollow,\n onActiveHrefChange,\n activeHref = '',\n __internalRootRef = null,\n scrollSpyOffset = 0,\n ...props\n}: AnchorNavigationProps & InternalBaseComponentProps) {\n const baseProps = getBaseProps(props);\n\n const hrefs = useMemo(() => anchors.map(anchor => anchor.href), [anchors]);\n\n const onFollowHandler = useCallback(\n (anchor: AnchorNavigationProps.Anchor, sourceEvent: React.SyntheticEvent | Event) => {\n fireCancelableEvent(onFollow, anchor, sourceEvent);\n },\n [onFollow]\n );\n\n const currentActiveHref = useScrollSpy({\n hrefs,\n scrollSpyOffset,\n activeHref,\n });\n\n useEffect(() => {\n if (currentActiveHref) {\n const newActiveAnchor = anchors.find(anchor => anchor.href === currentActiveHref);\n fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor);\n }\n }, [onActiveHrefChange, anchors, currentActiveHref]);\n\n return (\n \n
    \n {anchors.map((anchor, index) => {\n return (\n \n );\n })}\n
\n \n );\n}\n\ninterface AnchorProps {\n anchor: AnchorNavigationProps.Anchor;\n onFollow: (anchor: AnchorNavigationProps.Anchor, event: React.SyntheticEvent | Event) => void;\n isActive: boolean;\n index: number;\n}\n\nconst Anchor = ({ anchor, onFollow, isActive, index }: AnchorProps) => {\n checkSafeUrl('AnchorNavigation', anchor.href);\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n onFollow(anchor, event);\n }\n },\n [onFollow, anchor]\n );\n\n const activeItemClasses = clsx(styles['anchor-item--active'], testUtilsStyles['anchor-item--active']);\n\n return (\n
  • \n \n \n {anchor.text}\n \n {anchor.info && (\n {anchor.info}\n )}\n \n
  • \n );\n};\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_swimc_yjm0c_99\",\n \"anchor-list\": \"awsui_anchor-list_swimc_yjm0c_134\",\n \"anchor-item\": \"awsui_anchor-item_swimc_yjm0c_157\",\n \"anchor-item--active\": \"awsui_anchor-item--active_swimc_yjm0c_177\",\n \"anchor-link\": \"awsui_anchor-link_swimc_yjm0c_194\",\n \"anchor-link--active\": \"awsui_anchor-link--active_swimc_yjm0c_236\",\n \"anchor-link-text\": \"awsui_anchor-link-text_swimc_yjm0c_243\",\n \"anchor-link-info\": \"awsui_anchor-link-info_swimc_yjm0c_247\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_17oho_5eh15_5\",\n \"anchor-list\": \"awsui_anchor-list_17oho_5eh15_9\",\n \"anchor-item--active\": \"awsui_anchor-item--active_17oho_5eh15_13\",\n \"anchor-link\": \"awsui_anchor-link_17oho_5eh15_17\",\n \"anchor-link-text\": \"awsui_anchor-link-text_17oho_5eh15_21\",\n \"anchor-link-info\": \"awsui_anchor-link-info_17oho_5eh15_25\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useEffect, useState } from 'react';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * Hook to implement scroll-spy functionality.\n *\n * @param hrefs An array of href strings that correspond to the IDs of the target elements on the page.\n * The hrefs should be sorted in the order they appear on the page for accurate scroll-spy behavior.\n * @param scrollSpyOffset The number of pixels to offset from the top of the document when activating anchors.\n * Useful for accommodating fixed or sticky headers.\n * @param activeHref The currently active href. If provided, the hook will operate in a controlled manner,\n * and the scroll-spy logic will be disabled.\n *\n * @returns {string | undefined} - The href of the currently active element as per scroll position, or undefined if none is active.\n */\nexport default function useScrollSpy({\n hrefs,\n scrollSpyOffset,\n activeHref,\n}: {\n hrefs: string[];\n scrollSpyOffset: number;\n activeHref?: string;\n}): string | undefined {\n const [currentHref, setCurrentHref] = useState(activeHref);\n const [lastAnchorExists, setLastAnchorExists] = useState(false);\n\n useEffect(() => {\n setCurrentHref(activeHref);\n }, [activeHref]);\n\n useEffect(() => {\n setLastAnchorExists(isBrowser && !!document.getElementById(hrefs[hrefs.length - 1]?.slice(1)));\n }, [hrefs]);\n\n // Get the bounding rectangle of an element by href\n const getRectByHref = useCallback((href: string) => {\n return document.getElementById(href.slice(1))?.getBoundingClientRect();\n }, []);\n\n // Check if we're scrolled to the bottom of the page\n const isPageBottom = useCallback(() => {\n return lastAnchorExists && Math.ceil(window.scrollY) >= Math.floor(document.body.scrollHeight - window.innerHeight);\n }, [lastAnchorExists]);\n\n // Find the first href for which the element is within the viewport\n const findHrefInView = useCallback(() => {\n return hrefs.find(href => {\n const rect = getRectByHref(href);\n return rect && rect.bottom <= window.innerHeight && rect.top >= scrollSpyOffset;\n });\n }, [getRectByHref, scrollSpyOffset, hrefs]);\n\n // Find the last href where its element is above or within the viewport\n const findLastHrefInView = useCallback(() => {\n return [...hrefs].reverse().find(href => {\n const rect = getRectByHref(href);\n return rect && rect.bottom <= window.innerHeight;\n });\n }, [getRectByHref, hrefs]);\n\n // Scroll event handler\n const handleScroll = useCallback(() => {\n if (activeHref || !isBrowser) {\n return;\n }\n\n const { scrollY } = window;\n\n if (document.body.scrollHeight > window.innerHeight && isPageBottom()) {\n setCurrentHref(hrefs[hrefs.length - 1]);\n } else {\n setCurrentHref(findHrefInView() || (scrollY > 0 ? findLastHrefInView() : undefined));\n }\n }, [activeHref, isPageBottom, findHrefInView, findLastHrefInView, hrefs]);\n\n useEffect(() => {\n if (isBrowser) {\n handleScroll();\n window.addEventListener('scroll', handleScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', handleScroll);\n };\n }\n }, [handleScroll]);\n\n return currentHref;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { OpenAnnotation } from './annotation/open-annotation';\nimport { ClosedAnnotation } from './annotation/closed-annotation';\nimport { AnnotationContextProps } from './interfaces';\nimport { HotspotContext, hotspotContext } from './context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { HotspotProps } from '../hotspot/interfaces';\nimport { useTelemetry } from '../internal/hooks/use-telemetry';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getStepInfo } from './utils';\n\nexport { AnnotationContextProps };\n\n// constant empty array to keep hook dependency stable\nconst emptyTasks: ReadonlyArray = [];\n\nexport default function AnnotationContext({\n currentTutorial,\n children,\n onStepChange,\n onFinish: onFinishHandler,\n onStartTutorial,\n onExitTutorial,\n i18nStrings,\n}: AnnotationContextProps): JSX.Element {\n useTelemetry('AnnotationContext');\n\n const [open, setOpen] = useState(true);\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n useEffect(() => {\n // When a tutorial is started, we reset the progress to the first step.\n setCurrentStepIndex(0);\n setOpen(true);\n }, [currentTutorial, setOpen]);\n\n const [availableHotspots, setAvailableHotspots] = useState>({});\n // availableHotspots is mirrored in this ref to prevent endless loops\n // in between registerHotspot and unregisterHotspot callbacks.\n const availableHotspotsRef = useRef>(availableHotspots);\n\n const annotations = currentTutorial ? currentTutorial.tasks : emptyTasks;\n const { task, step, localIndex, taskIndex } = getStepInfo(annotations, currentStepIndex);\n const currentId = step?.hotspotId;\n const totalStepCount = annotations.map(a => a.steps.length).reduce((a, b) => a + b, 0);\n\n const id2index = useMemo(() => {\n const mapping: Record = {};\n\n let counter = 0;\n for (const annotation of annotations) {\n for (const step of annotation.steps) {\n if (mapping[step.hotspotId] === undefined) {\n mapping[step.hotspotId] = counter;\n }\n counter++;\n }\n }\n\n return mapping;\n }, [annotations]);\n\n const openNextStep = useCallback(() => {\n const newStepIndex = Math.min(currentStepIndex + 1, totalStepCount);\n setCurrentStepIndex(newStepIndex);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'next' });\n }, [currentStepIndex, onStepChange, totalStepCount]);\n\n const openPreviousStep = useCallback(() => {\n const newStepIndex = Math.max(currentStepIndex - 1, 0);\n setCurrentStepIndex(newStepIndex);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'previous' });\n }, [onStepChange, currentStepIndex]);\n\n const onFinish = useCallback(() => fireNonCancelableEvent(onFinishHandler), [onFinishHandler]);\n\n /**\n * If the currently open hotspot disappears from the page (e.g. because of a react-router navigation),\n * this Effect detects the nearest available hotspot and changes to it. This allows us to e.g. automatically\n * advance to the first step on the new page (or the last step on the previous page, in case the user\n * navigates back).\n */\n const isCurrentHotspotAvailable = currentId ? availableHotspots[currentId] : null;\n useEffect(() => {\n if (!currentId || availableHotspotsRef.current[currentId]) {\n return;\n }\n\n const findNearestHotspot = () => {\n let nearestHotspot: string | undefined = undefined;\n let nearestDistance = Infinity;\n for (const hotspotId of Object.keys(availableHotspotsRef.current)) {\n const distanceFromCurrentHotspot = Math.abs(id2index[hotspotId] - currentStepIndex);\n if (distanceFromCurrentHotspot < nearestDistance) {\n nearestDistance = distanceFromCurrentHotspot;\n nearestHotspot = hotspotId;\n }\n }\n return nearestHotspot;\n };\n\n const nearestHotspot = findNearestHotspot();\n if (nearestHotspot) {\n const newStepIndex = id2index[nearestHotspot];\n setCurrentStepIndex(newStepIndex);\n setOpen(true);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'auto-fallback' });\n }\n }, [annotations, isCurrentHotspotAvailable, currentId, currentStepIndex, id2index, onStepChange]);\n\n const onDismiss = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const onOpen = useCallback(\n (stepIndex: number) => {\n setCurrentStepIndex(stepIndex);\n fireNonCancelableEvent(onStepChange, { step: stepIndex, reason: 'open' });\n setOpen(true);\n },\n [onStepChange, setOpen]\n );\n\n const idOfPreviousHotspot = getStepInfo(annotations, currentStepIndex - 1).step?.hotspotId;\n const idOfNextHotspot = getStepInfo(annotations, currentStepIndex + 1).step?.hotspotId;\n const previousHotspotIsAvailable =\n (idOfPreviousHotspot !== undefined && availableHotspots[idOfPreviousHotspot]) ?? false;\n const nextHotspotIsAvailable = (idOfNextHotspot !== undefined && availableHotspots[idOfNextHotspot]) ?? false;\n\n const getContentForId = useCallback(\n (id: string, direction: HotspotProps['direction']) => {\n if (currentTutorial?.completed) {\n return null;\n }\n\n const globalStepIndex = id2index[id];\n if (globalStepIndex === undefined) {\n // This hotspot is not used in the current tutorial.\n return null;\n }\n\n if (!task || !step || !open || id !== currentId) {\n const { task: currentTask, localIndex: currentStepIndex } = getStepInfo(annotations, globalStepIndex);\n return (\n \n );\n }\n\n return (\n \n );\n },\n [\n id2index,\n currentTutorial,\n task,\n step,\n open,\n currentId,\n currentStepIndex,\n i18nStrings,\n taskIndex,\n localIndex,\n totalStepCount,\n nextHotspotIsAvailable,\n openNextStep,\n onFinish,\n previousHotspotIsAvailable,\n openPreviousStep,\n onDismiss,\n onOpen,\n annotations,\n ]\n );\n\n const registerHotspot = useCallback(\n (id: string) => {\n if (!id2index || id2index[id] === undefined) {\n // This hotspot is not used in the current tutorial.\n return;\n }\n\n /*\n To ensure that all hotspots are immediately known to all triggered useEffects, we\n need to update the availableHotspotsRef BEFORE the setAvailableHotspots calls, since\n they will be batched and delayed until after the useEffects are run.\n */\n availableHotspotsRef.current = { ...availableHotspotsRef.current, [id]: true } as const;\n\n setAvailableHotspots(availableHotspots => {\n if (availableHotspots[id]) {\n return availableHotspots;\n }\n\n return { ...availableHotspots, [id]: true } as const;\n });\n },\n // We need to react on id2index changes for registering new hotspots when the map changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [id2index]\n );\n\n const unregisterHotspot = useCallback((id: string) => {\n if (!availableHotspotsRef.current[id]) {\n // Prevents unnecessary re-renders.\n return;\n }\n\n /*\n To ensure that all hotspots are immediately known to all triggered useEffects, we\n need to update the availableHotspotsRef BEFORE the setAvailableHotspots calls, since\n they will be batched and delayed until after the useEffects are run.\n */\n availableHotspotsRef.current = removeKey(id, availableHotspotsRef.current);\n\n setAvailableHotspots(availableHotspots => {\n if (!availableHotspots[id]) {\n return availableHotspots;\n }\n\n return removeKey(id, availableHotspots);\n });\n }, []);\n\n const context: HotspotContext = {\n getContentForId,\n registerHotspot,\n unregisterHotspot,\n onStartTutorial,\n onExitTutorial,\n currentStepIndex,\n currentTutorial,\n };\n\n return {children};\n}\n\napplyDisplayName(AnnotationContext, 'AnnotationContext');\n\nfunction removeKey>(key: keyof T, object: T) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [key]: _, ...remainingObject } = object;\n return remainingObject;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { AnnotationContextProps } from '../interfaces';\nimport AnnotationTrigger from './annotation-trigger';\nimport { AnnotationPopover } from './annotation-popover';\n\nexport interface AnnotationProps {\n title: string;\n content: React.ReactNode;\n alert?: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n showPreviousButton: boolean;\n showFinishButton: boolean;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n onDismiss: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nexport function OpenAnnotation({\n title,\n content,\n alert,\n\n direction,\n\n showPreviousButton,\n showFinishButton,\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationProps) {\n const trackRef = useRef(null);\n\n return (\n <>\n \n\n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport styles from './styles.css.js';\nimport { AnnotationIcon } from './annotation-icon';\nimport { AnnotationContextProps } from '../interfaces';\n\nexport interface AnnotationTriggerProps {\n open: boolean;\n\n onClick: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n taskLocalStepIndex: number;\n totalLocalSteps: number;\n}\n\nexport default React.forwardRef(function AnnotationTrigger(\n { open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }: AnnotationTriggerProps,\n ref\n) {\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n onClickHandler();\n },\n [onClickHandler]\n );\n\n return (\n \n \n \n );\n});\n", "\n import './styles.scoped.css';\n export default {\n \"arrow\": \"awsui_arrow_1hpp3_10w1c_99\",\n \"arrow-outer\": \"awsui_arrow-outer_1hpp3_10w1c_103\",\n \"arrow-inner\": \"awsui_arrow-inner_1hpp3_10w1c_103\",\n \"arrow-position-right-top\": \"awsui_arrow-position-right-top_1hpp3_10w1c_144\",\n \"arrow-position-right-bottom\": \"awsui_arrow-position-right-bottom_1hpp3_10w1c_144\",\n \"arrow-position-left-top\": \"awsui_arrow-position-left-top_1hpp3_10w1c_147\",\n \"arrow-position-left-bottom\": \"awsui_arrow-position-left-bottom_1hpp3_10w1c_147\",\n \"arrow-position-top-center\": \"awsui_arrow-position-top-center_1hpp3_10w1c_150\",\n \"arrow-position-top-responsive\": \"awsui_arrow-position-top-responsive_1hpp3_10w1c_150\",\n \"arrow-position-bottom-center\": \"awsui_arrow-position-bottom-center_1hpp3_10w1c_153\",\n \"arrow-position-bottom-responsive\": \"awsui_arrow-position-bottom-responsive_1hpp3_10w1c_153\",\n \"annotation\": \"awsui_annotation_1hpp3_10w1c_161\",\n \"next-button\": \"awsui_next-button_1hpp3_10w1c_162\",\n \"previous-button\": \"awsui_previous-button_1hpp3_10w1c_163\",\n \"finish-button\": \"awsui_finish-button_1hpp3_10w1c_164\",\n \"header\": \"awsui_header_1hpp3_10w1c_165\",\n \"step-counter-content\": \"awsui_step-counter-content_1hpp3_10w1c_166\",\n \"content\": \"awsui_content_1hpp3_10w1c_167\",\n \"description\": \"awsui_description_1hpp3_10w1c_171\",\n \"actionBar\": \"awsui_actionBar_1hpp3_10w1c_176\",\n \"stepCounter\": \"awsui_stepCounter_1hpp3_10w1c_183\",\n \"divider\": \"awsui_divider_1hpp3_10w1c_187\",\n \"hotspot\": \"awsui_hotspot_1hpp3_10w1c_191\",\n \"icon\": \"awsui_icon_1hpp3_10w1c_258\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\n\nexport interface AnnotationIconProps {\n open?: boolean;\n}\n\nexport const AnnotationIcon = ({ open }: AnnotationIconProps) => {\n if (open) {\n return (\n \n \n \n \n \n \n );\n } else {\n return (\n \n \n \n \n \n \n \n \n \n );\n }\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { AnnotationContextProps } from '../interfaces';\nimport InternalAlert from '../../alert/internal';\nimport { InternalPosition } from '../../popover/interfaces';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id/index.js';\nimport { joinStrings } from '../../internal/utils/strings/join-strings.js';\n\nexport interface AnnotationPopoverProps {\n title: string;\n content: React.ReactNode;\n alert: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n showPreviousButton: boolean;\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n showFinishButton: boolean;\n\n onDismiss: () => void;\n\n trackRef: React.RefObject;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nconst arrow = (position: InternalPosition | null) => (\n
    \n
    \n
    \n
    \n);\n\nexport function AnnotationPopover({\n title,\n content,\n alert,\n\n direction = 'top',\n\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n showPreviousButton,\n showFinishButton,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n trackRef,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationPopoverProps) {\n useEffect(() => {\n scrollElementIntoView(trackRef.current ?? undefined);\n }, [trackRef]);\n\n const popoverHeaderId = useUniqueId('poppver-header-');\n const stepCounterId = useUniqueId('step-counter-');\n\n return (\n \n \n {title}\n \n }\n onDismiss={onDismiss}\n className={styles.annotation}\n variant=\"annotation\"\n overflowVisible=\"content\"\n // create new dialog to have the native dialog behavior of the screen readers\n key={taskLocalStepIndex}\n ariaLabelledby={joinStrings(popoverHeaderId, stepCounterId)}\n >\n \n
    \n {content}\n
    \n\n {alert && {alert}}\n\n \n
    \n\n
    \n
    \n \n {i18nStrings.stepCounterText(taskLocalStepIndex ?? 0, totalLocalSteps ?? 0)}\n \n
    \n \n {showPreviousButton && (\n \n {i18nStrings.previousButtonText}\n \n )}\n\n {showFinishButton ? (\n \n {i18nStrings.finishButtonText}\n \n ) : (\n \n {i18nStrings.nextButtonText}\n \n )}\n \n
    \n \n \n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { BoxProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalBoxProps = BoxProps & InternalBaseComponentProps;\n\nexport default function InternalBox({\n variant = 'div',\n tagOverride,\n margin = {},\n padding = {},\n display,\n textAlign,\n float,\n fontSize,\n fontWeight,\n color,\n children,\n __internalRootRef = null,\n ...props\n}: InternalBoxProps) {\n const baseProps = getBaseProps(props);\n const marginsClassNamesSuffices = getClassNamesSuffixes(margin);\n const paddingsClassNamesSuffices = getClassNamesSuffixes(padding);\n // This can be any arbitrary string if passed into tagOverride.\n // We appease the compiler with an incorrect type.\n const Tag = getTag(variant, tagOverride) as 'div';\n\n const className = clsx(\n baseProps.className,\n styles.root,\n styles.box,\n styles[`${variant.replace(/^awsui-/, '')}-variant`],\n marginsClassNamesSuffices.map(suffix => styles[`m-${suffix}`]),\n paddingsClassNamesSuffices.map(suffix => styles[`p-${suffix}`]),\n styles[`d-${display}`],\n styles[`f-${float}`],\n styles[`color-${color || 'default'}`],\n styles[`font-size-${fontSize || 'default'}`],\n styles[`font-weight-${fontWeight || 'default'}`],\n styles[`t-${textAlign}`]\n );\n\n return (\n \n {children}\n \n );\n}\n\nconst getClassNamesSuffixes = (value: BoxProps.SpacingSize | BoxProps.Spacing) => {\n if (typeof value === 'string') {\n return [value];\n }\n const sides = ['top', 'right', 'bottom', 'left', 'horizontal', 'vertical'] as const;\n return sides.filter(side => !!value[side]).map(side => `${side}-${value[side]}`);\n};\n\nconst getTag = (variant: BoxProps.Variant, tagOverride: BoxProps['tagOverride']) => {\n if (tagOverride) {\n return tagOverride;\n }\n\n if (variant === 'awsui-value-large') {\n return 'span';\n }\n\n if (variant === 'awsui-key-label' || variant === 'awsui-gen-ai-label') {\n return 'div';\n }\n\n return variant;\n};\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_18wu0_1elzt_99\",\n \"box\": \"awsui_box_18wu0_1elzt_219\",\n \"p-variant\": \"awsui_p-variant_18wu0_1elzt_219\",\n \"color-default\": \"awsui_color-default_18wu0_1elzt_219\",\n \"b-variant\": \"awsui_b-variant_18wu0_1elzt_219\",\n \"strong-variant\": \"awsui_strong-variant_18wu0_1elzt_219\",\n \"code-variant\": \"awsui_code-variant_18wu0_1elzt_219\",\n \"pre-variant\": \"awsui_pre-variant_18wu0_1elzt_219\",\n \"samp-variant\": \"awsui_samp-variant_18wu0_1elzt_219\",\n \"h1-variant\": \"awsui_h1-variant_18wu0_1elzt_223\",\n \"h2-variant\": \"awsui_h2-variant_18wu0_1elzt_223\",\n \"h3-variant\": \"awsui_h3-variant_18wu0_1elzt_223\",\n \"h4-variant\": \"awsui_h4-variant_18wu0_1elzt_223\",\n \"h5-variant\": \"awsui_h5-variant_18wu0_1elzt_223\",\n \"small-variant\": \"awsui_small-variant_18wu0_1elzt_227\",\n \"a-variant\": \"awsui_a-variant_18wu0_1elzt_231\",\n \"font-size-default\": \"awsui_font-size-default_18wu0_1elzt_235\",\n \"font-weight-default\": \"awsui_font-weight-default_18wu0_1elzt_275\",\n \"key-label-variant\": \"awsui_key-label-variant_18wu0_1elzt_317\",\n \"gen-ai-label-variant\": \"awsui_gen-ai-label-variant_18wu0_1elzt_324\",\n \"value-large-variant\": \"awsui_value-large-variant_18wu0_1elzt_331\",\n \"font-weight-heavy\": \"awsui_font-weight-heavy_18wu0_1elzt_338\",\n \"color-inverted\": \"awsui_color-inverted_18wu0_1elzt_343\",\n \"color-text-label\": \"awsui_color-text-label_18wu0_1elzt_346\",\n \"color-text-body-secondary\": \"awsui_color-text-body-secondary_18wu0_1elzt_349\",\n \"color-text-status-error\": \"awsui_color-text-status-error_18wu0_1elzt_352\",\n \"color-text-status-success\": \"awsui_color-text-status-success_18wu0_1elzt_355\",\n \"color-text-status-info\": \"awsui_color-text-status-info_18wu0_1elzt_358\",\n \"color-text-status-inactive\": \"awsui_color-text-status-inactive_18wu0_1elzt_361\",\n \"color-text-status-warning\": \"awsui_color-text-status-warning_18wu0_1elzt_364\",\n \"color-inherit\": \"awsui_color-inherit_18wu0_1elzt_367\",\n \"font-size-body-s\": \"awsui_font-size-body-s_18wu0_1elzt_370\",\n \"font-size-body-m\": \"awsui_font-size-body-m_18wu0_1elzt_375\",\n \"font-size-heading-xs\": \"awsui_font-size-heading-xs_18wu0_1elzt_379\",\n \"font-size-heading-s\": \"awsui_font-size-heading-s_18wu0_1elzt_383\",\n \"font-size-heading-m\": \"awsui_font-size-heading-m_18wu0_1elzt_388\",\n \"font-size-heading-l\": \"awsui_font-size-heading-l_18wu0_1elzt_393\",\n \"font-size-heading-xl\": \"awsui_font-size-heading-xl_18wu0_1elzt_398\",\n \"font-size-display-l\": \"awsui_font-size-display-l_18wu0_1elzt_403\",\n \"font-weight-light\": \"awsui_font-weight-light_18wu0_1elzt_408\",\n \"font-weight-normal\": \"awsui_font-weight-normal_18wu0_1elzt_411\",\n \"font-weight-bold\": \"awsui_font-weight-bold_18wu0_1elzt_414\",\n \"t-left\": \"awsui_t-left_18wu0_1elzt_421\",\n \"t-right\": \"awsui_t-right_18wu0_1elzt_425\",\n \"t-center\": \"awsui_t-center_18wu0_1elzt_429\",\n \"p-n\": \"awsui_p-n_18wu0_1elzt_536\",\n \"p-top-n\": \"awsui_p-top-n_18wu0_1elzt_541\",\n \"p-vertical-n\": \"awsui_p-vertical-n_18wu0_1elzt_542\",\n \"p-right-n\": \"awsui_p-right-n_18wu0_1elzt_546\",\n \"p-horizontal-n\": \"awsui_p-horizontal-n_18wu0_1elzt_547\",\n \"p-bottom-n\": \"awsui_p-bottom-n_18wu0_1elzt_551\",\n \"p-left-n\": \"awsui_p-left-n_18wu0_1elzt_556\",\n \"p-xxxs\": \"awsui_p-xxxs_18wu0_1elzt_561\",\n \"p-top-xxxs\": \"awsui_p-top-xxxs_18wu0_1elzt_566\",\n \"p-vertical-xxxs\": \"awsui_p-vertical-xxxs_18wu0_1elzt_567\",\n \"p-right-xxxs\": \"awsui_p-right-xxxs_18wu0_1elzt_571\",\n \"p-horizontal-xxxs\": \"awsui_p-horizontal-xxxs_18wu0_1elzt_572\",\n \"p-bottom-xxxs\": \"awsui_p-bottom-xxxs_18wu0_1elzt_576\",\n \"p-left-xxxs\": \"awsui_p-left-xxxs_18wu0_1elzt_581\",\n \"p-xxs\": \"awsui_p-xxs_18wu0_1elzt_586\",\n \"p-top-xxs\": \"awsui_p-top-xxs_18wu0_1elzt_591\",\n \"p-vertical-xxs\": \"awsui_p-vertical-xxs_18wu0_1elzt_592\",\n \"p-right-xxs\": \"awsui_p-right-xxs_18wu0_1elzt_596\",\n \"p-horizontal-xxs\": \"awsui_p-horizontal-xxs_18wu0_1elzt_597\",\n \"p-bottom-xxs\": \"awsui_p-bottom-xxs_18wu0_1elzt_601\",\n \"p-left-xxs\": \"awsui_p-left-xxs_18wu0_1elzt_606\",\n \"p-xs\": \"awsui_p-xs_18wu0_1elzt_611\",\n \"p-top-xs\": \"awsui_p-top-xs_18wu0_1elzt_616\",\n \"p-vertical-xs\": \"awsui_p-vertical-xs_18wu0_1elzt_617\",\n \"p-right-xs\": \"awsui_p-right-xs_18wu0_1elzt_621\",\n \"p-horizontal-xs\": \"awsui_p-horizontal-xs_18wu0_1elzt_622\",\n \"p-bottom-xs\": \"awsui_p-bottom-xs_18wu0_1elzt_626\",\n \"p-left-xs\": \"awsui_p-left-xs_18wu0_1elzt_631\",\n \"p-s\": \"awsui_p-s_18wu0_1elzt_636\",\n \"p-top-s\": \"awsui_p-top-s_18wu0_1elzt_641\",\n \"p-vertical-s\": \"awsui_p-vertical-s_18wu0_1elzt_642\",\n \"p-right-s\": \"awsui_p-right-s_18wu0_1elzt_646\",\n \"p-horizontal-s\": \"awsui_p-horizontal-s_18wu0_1elzt_647\",\n \"p-bottom-s\": \"awsui_p-bottom-s_18wu0_1elzt_651\",\n \"p-left-s\": \"awsui_p-left-s_18wu0_1elzt_656\",\n \"p-m\": \"awsui_p-m_18wu0_1elzt_661\",\n \"p-top-m\": \"awsui_p-top-m_18wu0_1elzt_666\",\n \"p-vertical-m\": \"awsui_p-vertical-m_18wu0_1elzt_667\",\n \"p-right-m\": \"awsui_p-right-m_18wu0_1elzt_671\",\n \"p-horizontal-m\": \"awsui_p-horizontal-m_18wu0_1elzt_672\",\n \"p-bottom-m\": \"awsui_p-bottom-m_18wu0_1elzt_676\",\n \"p-left-m\": \"awsui_p-left-m_18wu0_1elzt_681\",\n \"p-l\": \"awsui_p-l_18wu0_1elzt_556\",\n \"p-top-l\": \"awsui_p-top-l_18wu0_1elzt_691\",\n \"p-vertical-l\": \"awsui_p-vertical-l_18wu0_1elzt_692\",\n \"p-right-l\": \"awsui_p-right-l_18wu0_1elzt_696\",\n \"p-horizontal-l\": \"awsui_p-horizontal-l_18wu0_1elzt_697\",\n \"p-bottom-l\": \"awsui_p-bottom-l_18wu0_1elzt_701\",\n \"p-left-l\": \"awsui_p-left-l_18wu0_1elzt_706\",\n \"p-xl\": \"awsui_p-xl_18wu0_1elzt_711\",\n \"p-top-xl\": \"awsui_p-top-xl_18wu0_1elzt_716\",\n \"p-vertical-xl\": \"awsui_p-vertical-xl_18wu0_1elzt_717\",\n \"p-right-xl\": \"awsui_p-right-xl_18wu0_1elzt_721\",\n \"p-horizontal-xl\": \"awsui_p-horizontal-xl_18wu0_1elzt_722\",\n \"p-bottom-xl\": \"awsui_p-bottom-xl_18wu0_1elzt_726\",\n \"p-left-xl\": \"awsui_p-left-xl_18wu0_1elzt_731\",\n \"p-xxl\": \"awsui_p-xxl_18wu0_1elzt_736\",\n \"p-top-xxl\": \"awsui_p-top-xxl_18wu0_1elzt_741\",\n \"p-vertical-xxl\": \"awsui_p-vertical-xxl_18wu0_1elzt_742\",\n \"p-right-xxl\": \"awsui_p-right-xxl_18wu0_1elzt_746\",\n \"p-horizontal-xxl\": \"awsui_p-horizontal-xxl_18wu0_1elzt_747\",\n \"p-bottom-xxl\": \"awsui_p-bottom-xxl_18wu0_1elzt_751\",\n \"p-left-xxl\": \"awsui_p-left-xxl_18wu0_1elzt_756\",\n \"p-xxxl\": \"awsui_p-xxxl_18wu0_1elzt_761\",\n \"p-top-xxxl\": \"awsui_p-top-xxxl_18wu0_1elzt_766\",\n \"p-vertical-xxxl\": \"awsui_p-vertical-xxxl_18wu0_1elzt_767\",\n \"p-right-xxxl\": \"awsui_p-right-xxxl_18wu0_1elzt_771\",\n \"p-horizontal-xxxl\": \"awsui_p-horizontal-xxxl_18wu0_1elzt_772\",\n \"p-bottom-xxxl\": \"awsui_p-bottom-xxxl_18wu0_1elzt_776\",\n \"p-left-xxxl\": \"awsui_p-left-xxxl_18wu0_1elzt_781\",\n \"m-n\": \"awsui_m-n_18wu0_1elzt_786\",\n \"m-top-n\": \"awsui_m-top-n_18wu0_1elzt_791\",\n \"m-vertical-n\": \"awsui_m-vertical-n_18wu0_1elzt_792\",\n \"m-right-n\": \"awsui_m-right-n_18wu0_1elzt_796\",\n \"m-horizontal-n\": \"awsui_m-horizontal-n_18wu0_1elzt_797\",\n \"m-bottom-n\": \"awsui_m-bottom-n_18wu0_1elzt_801\",\n \"m-left-n\": \"awsui_m-left-n_18wu0_1elzt_806\",\n \"m-xxxs\": \"awsui_m-xxxs_18wu0_1elzt_811\",\n \"m-top-xxxs\": \"awsui_m-top-xxxs_18wu0_1elzt_816\",\n \"m-vertical-xxxs\": \"awsui_m-vertical-xxxs_18wu0_1elzt_817\",\n \"m-right-xxxs\": \"awsui_m-right-xxxs_18wu0_1elzt_821\",\n \"m-horizontal-xxxs\": \"awsui_m-horizontal-xxxs_18wu0_1elzt_822\",\n \"m-bottom-xxxs\": \"awsui_m-bottom-xxxs_18wu0_1elzt_826\",\n \"m-left-xxxs\": \"awsui_m-left-xxxs_18wu0_1elzt_831\",\n \"m-xxs\": \"awsui_m-xxs_18wu0_1elzt_836\",\n \"m-top-xxs\": \"awsui_m-top-xxs_18wu0_1elzt_841\",\n \"m-vertical-xxs\": \"awsui_m-vertical-xxs_18wu0_1elzt_842\",\n \"m-right-xxs\": \"awsui_m-right-xxs_18wu0_1elzt_846\",\n \"m-horizontal-xxs\": \"awsui_m-horizontal-xxs_18wu0_1elzt_847\",\n \"m-bottom-xxs\": \"awsui_m-bottom-xxs_18wu0_1elzt_851\",\n \"m-left-xxs\": \"awsui_m-left-xxs_18wu0_1elzt_856\",\n \"m-xs\": \"awsui_m-xs_18wu0_1elzt_861\",\n \"m-top-xs\": \"awsui_m-top-xs_18wu0_1elzt_866\",\n \"m-vertical-xs\": \"awsui_m-vertical-xs_18wu0_1elzt_867\",\n \"m-right-xs\": \"awsui_m-right-xs_18wu0_1elzt_871\",\n \"m-horizontal-xs\": \"awsui_m-horizontal-xs_18wu0_1elzt_872\",\n \"m-bottom-xs\": \"awsui_m-bottom-xs_18wu0_1elzt_876\",\n \"m-left-xs\": \"awsui_m-left-xs_18wu0_1elzt_881\",\n \"m-s\": \"awsui_m-s_18wu0_1elzt_886\",\n \"m-top-s\": \"awsui_m-top-s_18wu0_1elzt_891\",\n \"m-vertical-s\": \"awsui_m-vertical-s_18wu0_1elzt_892\",\n \"m-right-s\": \"awsui_m-right-s_18wu0_1elzt_896\",\n \"m-horizontal-s\": \"awsui_m-horizontal-s_18wu0_1elzt_897\",\n \"m-bottom-s\": \"awsui_m-bottom-s_18wu0_1elzt_901\",\n \"m-left-s\": \"awsui_m-left-s_18wu0_1elzt_906\",\n \"m-m\": \"awsui_m-m_18wu0_1elzt_911\",\n \"m-top-m\": \"awsui_m-top-m_18wu0_1elzt_916\",\n \"m-vertical-m\": \"awsui_m-vertical-m_18wu0_1elzt_917\",\n \"m-right-m\": \"awsui_m-right-m_18wu0_1elzt_921\",\n \"m-horizontal-m\": \"awsui_m-horizontal-m_18wu0_1elzt_922\",\n \"m-bottom-m\": \"awsui_m-bottom-m_18wu0_1elzt_926\",\n \"m-left-m\": \"awsui_m-left-m_18wu0_1elzt_931\",\n \"m-l\": \"awsui_m-l_18wu0_1elzt_806\",\n \"m-top-l\": \"awsui_m-top-l_18wu0_1elzt_941\",\n \"m-vertical-l\": \"awsui_m-vertical-l_18wu0_1elzt_942\",\n \"m-right-l\": \"awsui_m-right-l_18wu0_1elzt_946\",\n \"m-horizontal-l\": \"awsui_m-horizontal-l_18wu0_1elzt_947\",\n \"m-bottom-l\": \"awsui_m-bottom-l_18wu0_1elzt_951\",\n \"m-left-l\": \"awsui_m-left-l_18wu0_1elzt_956\",\n \"m-xl\": \"awsui_m-xl_18wu0_1elzt_961\",\n \"m-top-xl\": \"awsui_m-top-xl_18wu0_1elzt_966\",\n \"m-vertical-xl\": \"awsui_m-vertical-xl_18wu0_1elzt_967\",\n \"m-right-xl\": \"awsui_m-right-xl_18wu0_1elzt_971\",\n \"m-horizontal-xl\": \"awsui_m-horizontal-xl_18wu0_1elzt_972\",\n \"m-bottom-xl\": \"awsui_m-bottom-xl_18wu0_1elzt_976\",\n \"m-left-xl\": \"awsui_m-left-xl_18wu0_1elzt_981\",\n \"m-xxl\": \"awsui_m-xxl_18wu0_1elzt_986\",\n \"m-top-xxl\": \"awsui_m-top-xxl_18wu0_1elzt_991\",\n \"m-vertical-xxl\": \"awsui_m-vertical-xxl_18wu0_1elzt_992\",\n \"m-right-xxl\": \"awsui_m-right-xxl_18wu0_1elzt_996\",\n \"m-horizontal-xxl\": \"awsui_m-horizontal-xxl_18wu0_1elzt_997\",\n \"m-bottom-xxl\": \"awsui_m-bottom-xxl_18wu0_1elzt_1001\",\n \"m-left-xxl\": \"awsui_m-left-xxl_18wu0_1elzt_1006\",\n \"m-xxxl\": \"awsui_m-xxxl_18wu0_1elzt_1011\",\n \"m-top-xxxl\": \"awsui_m-top-xxxl_18wu0_1elzt_1016\",\n \"m-vertical-xxxl\": \"awsui_m-vertical-xxxl_18wu0_1elzt_1017\",\n \"m-right-xxxl\": \"awsui_m-right-xxxl_18wu0_1elzt_1021\",\n \"m-horizontal-xxxl\": \"awsui_m-horizontal-xxxl_18wu0_1elzt_1022\",\n \"m-bottom-xxxl\": \"awsui_m-bottom-xxxl_18wu0_1elzt_1026\",\n \"m-left-xxxl\": \"awsui_m-left-xxxl_18wu0_1elzt_1031\",\n \"d-block\": \"awsui_d-block_18wu0_1elzt_1036\",\n \"d-inline\": \"awsui_d-inline_18wu0_1elzt_1039\",\n \"d-inline-block\": \"awsui_d-inline-block_18wu0_1elzt_1042\",\n \"d-none\": \"awsui_d-none_18wu0_1elzt_1045\",\n \"f-left\": \"awsui_f-left_18wu0_1elzt_1049\",\n \"f-right\": \"awsui_f-right_18wu0_1elzt_1053\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport { SpaceBetweenProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalSpaceBetweenProps = SpaceBetweenProps & InternalBaseComponentProps;\n\nexport default function InternalSpaceBetween({\n direction = 'vertical',\n size,\n children,\n alignItems,\n __internalRootRef,\n ...props\n}: InternalSpaceBetweenProps) {\n const baseProps = getBaseProps(props);\n\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n\n return (\n \n {flattenedChildren.map(child => {\n const key = typeof child === 'object' ? child.key : undefined;\n\n return (\n
    \n {child}\n
    \n );\n })}\n
    \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_18582_z63vw_99\",\n \"child\": \"awsui_child_18582_z63vw_103\",\n \"horizontal\": \"awsui_horizontal_18582_z63vw_114\",\n \"horizontal-xxxs\": \"awsui_horizontal-xxxs_18582_z63vw_118\",\n \"horizontal-xxs\": \"awsui_horizontal-xxs_18582_z63vw_121\",\n \"horizontal-xs\": \"awsui_horizontal-xs_18582_z63vw_124\",\n \"horizontal-s\": \"awsui_horizontal-s_18582_z63vw_127\",\n \"horizontal-m\": \"awsui_horizontal-m_18582_z63vw_130\",\n \"horizontal-l\": \"awsui_horizontal-l_18582_z63vw_133\",\n \"horizontal-xl\": \"awsui_horizontal-xl_18582_z63vw_136\",\n \"horizontal-xxl\": \"awsui_horizontal-xxl_18582_z63vw_139\",\n \"vertical\": \"awsui_vertical_18582_z63vw_146\",\n \"vertical-xxxs\": \"awsui_vertical-xxxs_18582_z63vw_149\",\n \"vertical-xxs\": \"awsui_vertical-xxs_18582_z63vw_152\",\n \"vertical-xs\": \"awsui_vertical-xs_18582_z63vw_155\",\n \"vertical-s\": \"awsui_vertical-s_18582_z63vw_158\",\n \"vertical-m\": \"awsui_vertical-m_18582_z63vw_161\",\n \"vertical-l\": \"awsui_vertical-l_18582_z63vw_164\",\n \"vertical-xl\": \"awsui_vertical-xl_18582_z63vw_167\",\n \"vertical-xxl\": \"awsui_vertical-xxl_18582_z63vw_170\",\n \"align-center\": \"awsui_align-center_18582_z63vw_174\",\n \"align-start\": \"awsui_align-start_18582_z63vw_178\",\n \"align-end\": \"awsui_align-end_18582_z63vw_182\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalPosition, PopoverProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport usePopoverPosition from './use-popover-position.js';\n\nexport interface PopoverContainerProps {\n /** References the element the container is positioned against. */\n trackRef: React.RefObject;\n /**\n Used to update the container position in case track or track position changes:\n \n const trackRef = useRef(null)\n return (<>\n \n \n )\n */\n trackKey?: string | number;\n position: PopoverProps.Position;\n zIndex?: React.CSSProperties['zIndex'];\n arrow: (position: InternalPosition | null) => React.ReactNode;\n children: React.ReactNode;\n renderWithPortal?: boolean;\n size: PopoverProps.Size;\n fixedWidth: boolean;\n variant?: 'annotation';\n // When keepPosition is true, the popover will not recalculate its position when it resizes nor when it receives clicks.\n keepPosition?: boolean;\n // When allowScrollToFit is true, we will scroll to the the popover if it overflows the viewport even when choosing the best possible position for it.\n // Do not use this if the popover is open on hover, in order to avoid unexpected movement.\n allowScrollToFit?: boolean;\n allowVerticalOverflow?: boolean;\n}\n\nexport default function PopoverContainer({\n position,\n trackRef,\n trackKey,\n arrow,\n children,\n zIndex,\n renderWithPortal,\n size,\n fixedWidth,\n variant,\n keepPosition,\n allowScrollToFit,\n allowVerticalOverflow,\n}: PopoverContainerProps) {\n const bodyRef = useRef(null);\n const contentRef = useRef(null);\n const popoverRef = useRef(null);\n const arrowRef = useRef(null);\n\n const isRefresh = useVisualRefresh();\n\n // Updates the position handler.\n const { updatePositionHandler, popoverStyle, internalPosition, positionHandlerRef } = usePopoverPosition({\n popoverRef,\n bodyRef,\n arrowRef,\n trackRef,\n contentRef,\n allowScrollToFit,\n allowVerticalOverflow,\n preferredPosition: position,\n renderWithPortal,\n keepPosition,\n });\n\n // Recalculate position when properties change.\n useLayoutEffect(() => {\n updatePositionHandler();\n }, [updatePositionHandler, trackKey]);\n\n // Recalculate position when content size changes.\n useResizeObserver(contentRef, () => {\n updatePositionHandler(true);\n });\n\n // Recalculate position on DOM events.\n useLayoutEffect(() => {\n /*\n This is a heuristic. Some layout changes are caused by user clicks (e.g. toggling the tools panel, submitting a form),\n and by tracking the click event we can adapt the popover's position to the new layout.\n\n TODO: extend this to Enter and Spacebar?\n */\n\n const onClick = (event: UIEvent | KeyboardEvent) => {\n if (\n // Do not update position if keepPosition is true.\n keepPosition ||\n // If the click was on the trigger, this will make the popover appear or disappear,\n // so no need to update its position either in this case.\n nodeContains(trackRef.current, event.target)\n ) {\n return;\n }\n\n requestAnimationFrame(() => {\n updatePositionHandler();\n });\n };\n\n const updatePositionOnResize = () => requestAnimationFrame(() => updatePositionHandler());\n const refreshPosition = () => requestAnimationFrame(() => positionHandlerRef.current());\n\n window.addEventListener('click', onClick);\n window.addEventListener('resize', updatePositionOnResize);\n window.addEventListener('scroll', refreshPosition, true);\n\n return () => {\n window.removeEventListener('click', onClick);\n window.removeEventListener('resize', updatePositionOnResize);\n window.removeEventListener('scroll', refreshPosition, true);\n };\n }, [keepPosition, positionHandlerRef, trackRef, updatePositionHandler]);\n\n return (\n \n \n {arrow(internalPosition)}\n
    \n\n \n
    {children}
    \n
    \n
    \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"arrow\": \"awsui_arrow_xjuzf_ov8et_197\",\n \"arrow-outer\": \"awsui_arrow-outer_xjuzf_ov8et_201\",\n \"arrow-inner\": \"awsui_arrow-inner_xjuzf_ov8et_201\",\n \"refresh\": \"awsui_refresh_xjuzf_ov8et_235\",\n \"arrow-position-right-top\": \"awsui_arrow-position-right-top_xjuzf_ov8et_245\",\n \"arrow-position-right-bottom\": \"awsui_arrow-position-right-bottom_xjuzf_ov8et_245\",\n \"arrow-position-left-top\": \"awsui_arrow-position-left-top_xjuzf_ov8et_248\",\n \"arrow-position-left-bottom\": \"awsui_arrow-position-left-bottom_xjuzf_ov8et_248\",\n \"arrow-position-top-center\": \"awsui_arrow-position-top-center_xjuzf_ov8et_251\",\n \"arrow-position-top-right\": \"awsui_arrow-position-top-right_xjuzf_ov8et_251\",\n \"arrow-position-top-left\": \"awsui_arrow-position-top-left_xjuzf_ov8et_251\",\n \"arrow-position-top-responsive\": \"awsui_arrow-position-top-responsive_xjuzf_ov8et_251\",\n \"arrow-position-bottom-center\": \"awsui_arrow-position-bottom-center_xjuzf_ov8et_254\",\n \"arrow-position-bottom-right\": \"awsui_arrow-position-bottom-right_xjuzf_ov8et_254\",\n \"arrow-position-bottom-left\": \"awsui_arrow-position-bottom-left_xjuzf_ov8et_254\",\n \"arrow-position-bottom-responsive\": \"awsui_arrow-position-bottom-responsive_xjuzf_ov8et_254\",\n \"body\": \"awsui_body_xjuzf_ov8et_356\",\n \"body-overflow-visible\": \"awsui_body-overflow-visible_xjuzf_ov8et_395\",\n \"has-dismiss\": \"awsui_has-dismiss_xjuzf_ov8et_399\",\n \"dismiss\": \"awsui_dismiss_xjuzf_ov8et_404\",\n \"dismiss-control\": \"awsui_dismiss-control_xjuzf_ov8et_412\",\n \"header-row\": \"awsui_header-row_xjuzf_ov8et_416\",\n \"header\": \"awsui_header_xjuzf_ov8et_416\",\n \"content\": \"awsui_content_xjuzf_ov8et_442\",\n \"content-overflow-visible\": \"awsui_content-overflow-visible_xjuzf_ov8et_450\",\n \"container\": \"awsui_container_xjuzf_ov8et_552\",\n \"container-body\": \"awsui_container-body_xjuzf_ov8et_560\",\n \"container-body-variant-annotation\": \"awsui_container-body-variant-annotation_xjuzf_ov8et_603\",\n \"container-body-size-small\": \"awsui_container-body-size-small_xjuzf_ov8et_608\",\n \"fixed-width\": \"awsui_fixed-width_xjuzf_ov8et_611\",\n \"container-body-size-medium\": \"awsui_container-body-size-medium_xjuzf_ov8et_615\",\n \"container-body-size-large\": \"awsui_container-body-size-large_xjuzf_ov8et_622\",\n \"container-arrow\": \"awsui_container-arrow_xjuzf_ov8et_634\",\n \"container-arrow-position-right-top\": \"awsui_container-arrow-position-right-top_xjuzf_ov8et_638\",\n \"container-arrow-position-right-bottom\": \"awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638\",\n \"container-arrow-position-left-top\": \"awsui_container-arrow-position-left-top_xjuzf_ov8et_654\",\n \"container-arrow-position-left-bottom\": \"awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654\",\n \"container-arrow-position-top-center\": \"awsui_container-arrow-position-top-center_xjuzf_ov8et_670\",\n \"container-arrow-position-top-right\": \"awsui_container-arrow-position-top-right_xjuzf_ov8et_670\",\n \"container-arrow-position-top-left\": \"awsui_container-arrow-position-top-left_xjuzf_ov8et_670\",\n \"container-arrow-position-top-responsive\": \"awsui_container-arrow-position-top-responsive_xjuzf_ov8et_670\",\n \"container-arrow-position-bottom-center\": \"awsui_container-arrow-position-bottom-center_xjuzf_ov8et_686\",\n \"container-arrow-position-bottom-right\": \"awsui_container-arrow-position-bottom-right_xjuzf_ov8et_690\",\n \"container-arrow-position-bottom-left\": \"awsui_container-arrow-position-bottom-left_xjuzf_ov8et_694\",\n \"awsui-motion-fade-in\": \"awsui_awsui-motion-fade-in_xjuzf_ov8et_1\",\n \"root\": \"awsui_root_xjuzf_ov8et_840\",\n \"trigger\": \"awsui_trigger_xjuzf_ov8et_876\",\n \"trigger-type-text\": \"awsui_trigger-type-text_xjuzf_ov8et_883\",\n \"trigger-inner-text\": \"awsui_trigger-inner-text_xjuzf_ov8et_918\",\n \"popover-inline-content\": \"awsui_popover-inline-content_xjuzf_ov8et_922\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useCallback, useRef, useState } from 'react';\nimport { BoundingBox, InternalPosition, Offset, PopoverProps } from './interfaces';\nimport { calculatePosition, getDimensions, getOffsetDimensions } from './utils/positions';\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport {\n calculateScroll,\n getFirstScrollableParent,\n scrollRectangleIntoView,\n} from '../internal/utils/scrollable-containers';\nimport { getContainingBlock } from '../internal/utils/dom';\nimport { getLogicalBoundingClientRect } from '../internal/direction';\n\nexport default function usePopoverPosition({\n popoverRef,\n bodyRef,\n arrowRef,\n trackRef,\n contentRef,\n allowScrollToFit,\n allowVerticalOverflow,\n preferredPosition,\n renderWithPortal,\n keepPosition,\n}: {\n popoverRef: React.RefObject;\n bodyRef: React.RefObject;\n arrowRef: React.RefObject;\n trackRef: React.RefObject;\n contentRef: React.RefObject;\n allowScrollToFit?: boolean;\n allowVerticalOverflow?: boolean;\n preferredPosition: PopoverProps.Position;\n renderWithPortal?: boolean;\n keepPosition?: boolean;\n}) {\n const previousInternalPositionRef = useRef(null);\n const [popoverStyle, setPopoverStyle] = useState>({});\n const [internalPosition, setInternalPosition] = useState(null);\n\n // Store the handler in a ref so that it can still be replaced from outside of the listener closure.\n const positionHandlerRef = useRef<() => void>(() => {});\n\n const updatePositionHandler = useCallback(\n (onContentResize = false) => {\n if (!trackRef.current || !popoverRef.current || !bodyRef.current || !contentRef.current || !arrowRef.current) {\n return;\n }\n\n // Get important elements\n const popover = popoverRef.current;\n const body = bodyRef.current;\n const arrow = arrowRef.current;\n const document = popover.ownerDocument;\n const track = trackRef.current;\n\n // If the popover body isn't being rendered for whatever reason (e.g. \"display: none\" or JSDOM),\n // or track does not belong to the document - bail on calculating dimensions.\n const { offsetWidth, offsetHeight } = getOffsetDimensions(popover);\n if (offsetWidth === 0 || offsetHeight === 0 || !nodeContains(document.body, track)) {\n return;\n }\n\n // Imperatively move body off-screen to give it room to expand.\n // Not doing this in React because this recalculation should happen\n // in the span of a single frame without rerendering anything.\n const prevInsetBlockStart = popover.style.insetBlockStart;\n const prevInsetInlineStart = popover.style.insetInlineStart;\n\n popover.style.insetBlockStart = '0';\n popover.style.insetInlineStart = '0';\n // Imperatively remove body styles that can remain from the previous computation.\n body.style.maxBlockSize = '';\n body.style.overflowX = '';\n body.style.overflowY = '';\n\n // Get rects representing key elements\n // Use getComputedStyle for arrowRect to avoid modifications made by transform\n const viewportRect = getViewportRect(document.defaultView!);\n const trackRect = getLogicalBoundingClientRect(track);\n const arrowRect = getDimensions(arrow);\n const containingBlock = getContainingBlock(popover);\n const containingBlockRect = containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect;\n\n const bodyBorderWidth = getBorderWidth(body);\n const contentRect = getLogicalBoundingClientRect(contentRef.current);\n const contentBoundingBox = {\n inlineSize: contentRect.inlineSize + 2 * bodyBorderWidth,\n blockSize: contentRect.blockSize + 2 * bodyBorderWidth,\n };\n\n // When keepPosition is true and the recalculation was triggered by a resize of the popover content,\n // we maintain the previously defined internal position,\n // but we still call calculatePosition to know if the popover should be scrollable.\n const shouldKeepPosition = keepPosition && onContentResize && !!previousInternalPositionRef.current;\n const fixedInternalPosition = (shouldKeepPosition && previousInternalPositionRef.current) ?? undefined;\n\n // Calculate the arrow direction and viewport-relative position of the popover.\n const {\n scrollable,\n internalPosition: newInternalPosition,\n rect,\n } = calculatePosition({\n preferredPosition,\n fixedInternalPosition,\n trigger: trackRect,\n arrow: arrowRect,\n body: contentBoundingBox,\n container: containingBlock ? containingBlockRect : getDocumentRect(document),\n viewport: viewportRect,\n renderWithPortal,\n allowVerticalOverflow,\n });\n\n // Get the position of the popover relative to the offset parent.\n const popoverOffset = toRelativePosition(rect, containingBlockRect);\n\n // Cache the distance between the trigger and the popover (which stays the same as you scroll),\n // and use that to recalculate the new popover position.\n const trackRelativeOffset = toRelativePosition(popoverOffset, toRelativePosition(trackRect, containingBlockRect));\n\n // Bring back the container to its original position to prevent any flashing.\n popover.style.insetBlockStart = prevInsetBlockStart;\n popover.style.insetInlineStart = prevInsetInlineStart;\n\n // Allow popover body to scroll if can't fit the popover into the container/viewport otherwise.\n if (scrollable) {\n body.style.maxBlockSize = rect.blockSize + 'px';\n body.style.overflowX = 'hidden';\n body.style.overflowY = 'auto';\n }\n\n // Remember the internal position in case we want to keep it later.\n previousInternalPositionRef.current = newInternalPosition;\n setInternalPosition(newInternalPosition);\n\n const shouldScroll = allowScrollToFit && !shouldKeepPosition;\n\n // Position the popover\n const insetBlockStart = shouldScroll\n ? popoverOffset.insetBlockStart + calculateScroll(rect)\n : popoverOffset.insetBlockStart;\n setPopoverStyle({ insetBlockStart, insetInlineStart: popoverOffset.insetInlineStart });\n\n // Scroll if necessary\n if (shouldScroll) {\n const scrollableParent = getFirstScrollableParent(popover);\n scrollRectangleIntoView(rect, scrollableParent);\n }\n\n positionHandlerRef.current = () => {\n const newTrackOffset = toRelativePosition(\n getLogicalBoundingClientRect(track),\n containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect\n );\n setPopoverStyle({\n insetBlockStart: newTrackOffset.insetBlockStart + trackRelativeOffset.insetBlockStart,\n insetInlineStart: newTrackOffset.insetInlineStart + trackRelativeOffset.insetInlineStart,\n });\n };\n },\n [\n trackRef,\n popoverRef,\n bodyRef,\n contentRef,\n arrowRef,\n keepPosition,\n allowScrollToFit,\n preferredPosition,\n renderWithPortal,\n allowVerticalOverflow,\n ]\n );\n return { updatePositionHandler, popoverStyle, internalPosition, positionHandlerRef };\n}\n\nfunction getBorderWidth(element: HTMLElement) {\n return parseInt(getComputedStyle(element).borderWidth) || 0;\n}\n\n/**\n * Convert a viewport-relative offset to an element-relative offset.\n */\nfunction toRelativePosition(element: Offset, parent: Offset): Offset {\n return {\n insetBlockStart: element.insetBlockStart - parent.insetBlockStart,\n insetInlineStart: element.insetInlineStart - parent.insetInlineStart,\n };\n}\n\n/**\n * Get a BoundingBox that represents the visible viewport.\n */\nfunction getViewportRect(window: Window): BoundingBox {\n return {\n insetBlockStart: 0,\n insetInlineStart: 0,\n inlineSize: window.innerWidth,\n blockSize: window.innerHeight,\n };\n}\n\nfunction getDocumentRect(document: Document): BoundingBox {\n const { insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(document.documentElement);\n\n return {\n insetBlockStart,\n insetInlineStart,\n inlineSize: document.documentElement.scrollWidth,\n blockSize: document.documentElement.scrollHeight,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PopoverProps, InternalPosition, BoundingBox, Dimensions } from '../interfaces';\n\n// A structure describing how the popover should be positioned\ninterface CalculatedPosition {\n scrollable?: boolean;\n internalPosition: InternalPosition;\n rect: BoundingBox;\n}\n\ninterface ElementGroup {\n body: Dimensions;\n trigger: BoundingBox;\n arrow: Dimensions;\n}\n\nconst ARROW_OFFSET = 12;\n\nexport const PRIORITY_MAPPING: Record = {\n top: [\n 'top-center',\n 'top-right',\n 'top-left',\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n bottom: [\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'top-center',\n 'top-right',\n 'top-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n left: [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-left',\n 'top-left',\n 'bottom-right',\n 'top-right',\n ],\n right: [\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-right',\n 'top-right',\n 'bottom-left',\n 'top-left',\n ],\n};\n\nconst RECTANGLE_CALCULATIONS: Record BoundingBox> = {\n 'top-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n};\n\nfunction fitIntoContainer(inner: BoundingBox, outer: BoundingBox): BoundingBox {\n let { insetInlineStart, inlineSize, insetBlockStart, blockSize } = inner;\n\n // Adjust left boundary.\n if (insetInlineStart < outer.insetInlineStart) {\n inlineSize = insetInlineStart + inlineSize - outer.insetInlineStart;\n insetInlineStart = outer.insetInlineStart;\n }\n // Adjust right boundary.\n else if (insetInlineStart + inlineSize > outer.insetInlineStart + outer.inlineSize) {\n inlineSize = outer.insetInlineStart + outer.inlineSize - insetInlineStart;\n }\n // Adjust top boundary.\n if (insetBlockStart < outer.insetBlockStart) {\n blockSize = insetBlockStart + blockSize - outer.insetBlockStart;\n insetBlockStart = outer.insetBlockStart;\n }\n // Adjust bottom boundary.\n else if (insetBlockStart + blockSize > outer.insetBlockStart + outer.blockSize) {\n blockSize = outer.insetBlockStart + outer.blockSize - insetBlockStart;\n }\n\n return { insetInlineStart, inlineSize, insetBlockStart, blockSize };\n}\n\nfunction getTallestRect(rect1: BoundingBox, rect2: BoundingBox): BoundingBox {\n return rect1.blockSize >= rect2.blockSize ? rect1 : rect2;\n}\n\nfunction getIntersection(rectangles: BoundingBox[]): BoundingBox | null {\n let boundingBox: BoundingBox | null = null;\n for (const currentRect of rectangles) {\n if (!boundingBox) {\n boundingBox = currentRect;\n continue;\n }\n const insetInlineStart = Math.max(boundingBox.insetInlineStart, currentRect.insetInlineStart);\n const insetBlockStart = Math.max(boundingBox.insetBlockStart, currentRect.insetBlockStart);\n const insetInlineEnd = Math.min(\n boundingBox.insetInlineStart + boundingBox.inlineSize,\n currentRect.insetInlineStart + currentRect.inlineSize\n );\n const insetBlockEnd = Math.min(\n boundingBox.insetBlockStart + boundingBox.blockSize,\n currentRect.insetBlockStart + currentRect.blockSize\n );\n\n if (insetInlineEnd < insetInlineStart || insetBlockEnd < insetBlockStart) {\n return null;\n }\n boundingBox = {\n insetInlineStart,\n insetBlockStart,\n inlineSize: insetInlineEnd - insetInlineStart,\n blockSize: insetBlockEnd - insetBlockStart,\n };\n }\n return boundingBox;\n}\n\n/**\n * Returns the area of the intersection of passed in rectangles or a null, if there is no intersection\n */\nexport function intersectRectangles(rectangles: BoundingBox[]): number | null {\n const boundingBox: BoundingBox | null = getIntersection(rectangles);\n return boundingBox && boundingBox.blockSize * boundingBox.inlineSize;\n}\n\ntype CandidatePosition = CalculatedPosition & { visibleArea: BoundingBox | null };\n\n/**\n * A functions that returns the correct popover position based on screen dimensions.\n */\nexport function calculatePosition({\n preferredPosition,\n fixedInternalPosition,\n trigger,\n arrow,\n body,\n container,\n viewport,\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal,\n allowVerticalOverflow,\n}: {\n preferredPosition: PopoverProps.Position;\n fixedInternalPosition?: InternalPosition;\n trigger: BoundingBox;\n arrow: Dimensions;\n body: Dimensions;\n container: BoundingBox;\n viewport: BoundingBox;\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal?: boolean;\n allowVerticalOverflow?: boolean;\n}): CalculatedPosition {\n let bestOption: CandidatePosition | null = null;\n\n // If a fixed internal position is passed, only consider this one.\n const preferredInternalPositions = fixedInternalPosition\n ? [fixedInternalPosition]\n : PRIORITY_MAPPING[preferredPosition];\n\n // Attempt to position the popover based on the priority list for this position.\n for (const internalPosition of preferredInternalPositions) {\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n const visibleArea = renderWithPortal\n ? getIntersection([rect, viewport])\n : getIntersection([rect, viewport, container]);\n\n const fitsWithoutOverflow =\n visibleArea && visibleArea.inlineSize === body.inlineSize && visibleArea.blockSize === body.blockSize;\n\n if (fitsWithoutOverflow) {\n return { internalPosition, rect };\n }\n\n const newOption = { rect, internalPosition, visibleArea };\n bestOption = getBestOption(newOption, bestOption);\n }\n\n // Use best possible placement.\n const internalPosition = bestOption?.internalPosition || 'right-top';\n // Get default rect for that placement.\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n\n // Get largest possible rect that fits into the viewport or container.\n\n // We allow the popover to overflow the viewport if allowVerticalOverflow is true _and_ the popover will be anchored to the top or the bottom.\n // If it is anchored to the right or left, we consider that it should have enough vertical space so that applying scroll to it is a better option.\n const tallestBoundingContainer = getTallestRect(viewport, container);\n const boundingContainer =\n allowVerticalOverflow && isTopOrBottom(internalPosition)\n ? {\n insetBlockStart: tallestBoundingContainer.insetBlockStart,\n blockSize: tallestBoundingContainer.blockSize,\n insetInlineStart: viewport.insetInlineStart,\n inlineSize: viewport.inlineSize,\n }\n : viewport;\n\n const optimizedRect = fitIntoContainer(rect, boundingContainer);\n\n // If largest possible rect is shorter than original - set body scroll.\n const scrollable = optimizedRect.blockSize < rect.blockSize;\n\n return { internalPosition, rect: optimizedRect, scrollable };\n}\n\nfunction getBestOption(option1: CandidatePosition, option2: CandidatePosition | null) {\n // Within calculatePosition, the only case where option2 will not be defined will be in the first call.\n // The only case where the visibleArea of an option will be null is when the popover is totally outside of the viewport.\n if (!option2?.visibleArea) {\n return option1;\n }\n if (!option1.visibleArea) {\n return option2;\n }\n // Only if none of the two options overflows horizontally, choose the best based on the visible height.\n if (option1.visibleArea.inlineSize === option2.visibleArea.inlineSize) {\n return option1.visibleArea.blockSize > option2.visibleArea.blockSize ? option1 : option2;\n }\n // Otherwise, choose the option that is less cut off horizontally.\n return option1.visibleArea.inlineSize > option2.visibleArea.inlineSize ? option1 : option2;\n}\n\nexport function getOffsetDimensions(element: HTMLElement) {\n return { offsetHeight: element.offsetHeight, offsetWidth: element.offsetWidth };\n}\n\nexport function getDimensions(element: HTMLElement) {\n const computedStyle = getComputedStyle(element);\n return {\n inlineSize: parseFloat(computedStyle.inlineSize),\n blockSize: parseFloat(computedStyle.blockSize),\n };\n}\n\nfunction isTopOrBottom(internalPosition: InternalPosition) {\n return ['top', 'bottom'].includes(internalPosition.split('-')[0]);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { findUpUntil } from './dom';\nexport interface BoundingBox {\n blockSize: number;\n inlineSize: number;\n insetBlockStart: number;\n insetInlineStart: number;\n}\n\nexport const getOverflowParents = (element: HTMLElement): HTMLElement[] => {\n const parents = [];\n let node: HTMLElement | null = element;\n\n while ((node = node.parentElement) && node !== document.body) {\n getComputedStyle(node).overflow !== 'visible' && parents.push(node);\n }\n return parents;\n};\n\nexport const getOverflowParentDimensions = ({\n element,\n excludeClosestParent = false,\n expandToViewport = false,\n canExpandOutsideViewport = false,\n}: {\n element: HTMLElement;\n excludeClosestParent: boolean;\n expandToViewport: boolean;\n canExpandOutsideViewport: boolean;\n}): BoundingBox[] => {\n const parents = expandToViewport\n ? []\n : getOverflowParents(element).map(el => {\n const { height, width, top, left } = el.getBoundingClientRect();\n return {\n // Treat the whole scrollable area as the available height\n // if we're allowed to expand past the viewport.\n blockSize: canExpandOutsideViewport ? el.scrollHeight : height,\n inlineSize: width,\n insetBlockStart: top,\n insetInlineStart: left,\n };\n });\n\n if (canExpandOutsideViewport && !expandToViewport) {\n const documentDimensions = document.documentElement.getBoundingClientRect();\n parents.push({\n inlineSize: Math.max(documentDimensions.width, document.documentElement.clientWidth),\n blockSize: Math.max(documentDimensions.height, document.documentElement.clientHeight),\n insetBlockStart: documentDimensions.top,\n insetInlineStart: documentDimensions.left,\n });\n } else {\n parents.push({\n blockSize: window.innerHeight,\n inlineSize: window.innerWidth,\n insetBlockStart: 0,\n insetInlineStart: 0,\n });\n }\n\n if (excludeClosestParent && !expandToViewport) {\n parents.shift();\n }\n\n return parents;\n};\n\ntype ScrollIntoViewOptions = Parameters[0];\n\n/**\n * Calls `scrollIntoView` on the provided element with sensible defaults. If\n * the element does not exist or does not support the `scrollIntoView`\n * method, it will do nothing. This wrapper is created to support environments\n * where the native function is not available like JSDom (feature request:\n * https://github.com/jsdom/jsdom/issues/1422).\n *\n * @param element to be scrolled into view\n * @param options native options for `scrollIntoView`\n */\nexport function scrollElementIntoView(\n element: HTMLElement | undefined,\n options: ScrollIntoViewOptions = { block: 'nearest', inline: 'nearest' }\n) {\n element?.scrollIntoView?.(options);\n}\n\nexport function calculateScroll({ insetBlockStart, blockSize }: BoundingBox) {\n if (insetBlockStart < 0) {\n return insetBlockStart;\n } else if (insetBlockStart + blockSize > window.innerHeight) {\n if (blockSize > window.innerHeight) {\n return insetBlockStart;\n } else {\n return insetBlockStart + blockSize - window.innerHeight;\n }\n }\n return 0;\n}\n\n/**\n * For elements with fixed position, the browser's native scrollIntoView API doesn't work,\n * so we need to manually scroll to the element's position.\n * Supports only vertical scrolling.\n */\nexport function scrollRectangleIntoView(box: BoundingBox, scrollableParent?: HTMLElement) {\n const scrollAmount = calculateScroll(box);\n if (scrollAmount) {\n (scrollableParent || window).scrollBy(0, scrollAmount);\n }\n}\n\nexport function getFirstScrollableParent(element: HTMLElement): HTMLElement | undefined {\n return (\n findUpUntil(element, el => {\n const overflows = el.scrollHeight > el.clientHeight;\n return overflows && ['scroll', 'auto'].includes(getComputedStyle(el).overflowY);\n }) || undefined\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function isRtl(element: HTMLElement | SVGElement) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\n/**\n * The scrollLeft value will be a negative number if the direction is RTL and\n * needs to be converted to a positive value for direction independent scroll\n * computations. Additionally, the scrollLeft value can be a decimal value on\n * systems using display scaling requiring the floor and ceiling calls.\n */\nexport function getScrollInlineStart(element: HTMLElement) {\n return isRtl(element) ? Math.floor(element.scrollLeft) * -1 : Math.ceil(element.scrollLeft);\n}\n\n/**\n * The getBoundingClientRect() function returns values relative to the top left\n * corner of the document regardless of document direction. The left/right position\n * will be transformed to insetInlineStart based on element direction in order to\n * support direction agnostic position computation.\n */\nexport function getLogicalBoundingClientRect(element: HTMLElement | SVGElement) {\n const boundingClientRect = element.getBoundingClientRect();\n\n const blockSize = boundingClientRect.height;\n const inlineSize = boundingClientRect.width;\n const insetBlockStart = boundingClientRect.top;\n const insetBlockEnd = boundingClientRect.bottom;\n const insetInlineStart = isRtl(element)\n ? document.documentElement.clientWidth - boundingClientRect.right\n : boundingClientRect.left;\n const insetInlineEnd = insetInlineStart + inlineSize;\n\n return {\n blockSize,\n inlineSize,\n insetBlockStart,\n insetBlockEnd,\n insetInlineStart,\n insetInlineEnd,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport FocusLock from '../internal/components/focus-lock';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../i18n/context';\n\nexport interface PopoverBodyProps {\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: (() => void) | undefined;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation';\n overflowVisible?: 'content' | 'both';\n\n className?: string;\n ariaLabelledby?: string;\n}\n\nexport default function PopoverBody({\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n variant,\n overflowVisible,\n className,\n ariaLabelledby,\n}: PopoverBodyProps) {\n const i18n = useInternalI18n('popover');\n const labelledById = useUniqueId('awsui-popover-');\n const dismissButtonFocused = useRef(false);\n const dismissButtonRef = useRef(null);\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n event.stopPropagation();\n onDismiss?.();\n }\n },\n [onDismiss]\n );\n\n // Implement our own auto-focus rather than using FocusLock's,\n // because we also want to focus the dismiss button when it\n // is added dynamically (e.g. in chart popovers)\n useEffect(() => {\n if (showDismissButton && !dismissButtonFocused.current) {\n dismissButtonRef.current?.focus({ preventScroll: true });\n }\n dismissButtonFocused.current = showDismissButton;\n }, [showDismissButton]);\n\n const dismissButton = (showDismissButton ?? null) && (\n
    \n onDismiss?.()}\n ref={dismissButtonRef}\n />\n
    \n );\n\n const isDialog = showDismissButton;\n const shouldTrapFocus = showDismissButton && variant !== 'annotation';\n\n const dialogProps = isDialog\n ? {\n role: 'dialog',\n 'aria-modal': shouldTrapFocus ? true : undefined,\n 'aria-labelledby': ariaLabelledby ?? (header ? labelledById : undefined),\n }\n : {};\n\n return (\n \n \n {header && (\n
    \n {dismissButton}\n
    \n

    {header}

    \n
    \n
    \n )}\n
    \n {!header && dismissButton}\n
    \n {children}\n
    \n
    \n
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\n\nimport TabTrap from '../tab-trap/index';\nimport { getFirstFocusable, getLastFocusable } from './utils';\n\nexport interface FocusLockProps {\n className?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n restoreFocus?: boolean;\n children: React.ReactNode;\n}\n\nexport interface FocusLockRef {\n /**\n * Focuses the first element in the component.\n */\n focusFirst(): void;\n}\n\nfunction FocusLock(\n { className, disabled, autoFocus, restoreFocus, children }: FocusLockProps,\n ref: React.Ref\n) {\n const returnFocusToRef = useRef(null);\n const containerRef = useRef(null);\n\n const focusFirst = () => {\n if (containerRef.current) {\n getFirstFocusable(containerRef.current)?.focus();\n }\n };\n\n const focusLast = () => {\n if (containerRef.current) {\n getLastFocusable(containerRef.current)?.focus();\n }\n };\n\n // Captures focus when `autoFocus` is set, and the component is mounted or\n // `disabled` changes from true to false.\n useEffect(() => {\n if (autoFocus && !disabled) {\n returnFocusToRef.current = document.activeElement as HTMLOrSVGElement | null;\n focusFirst();\n }\n }, [autoFocus, disabled]);\n\n // Restore focus if `restoreFocus` is set, and `disabled` changes from false\n // to true.\n const [previouslyDisabled, setPreviouslyDisabled] = useState(!!disabled);\n useEffect(() => {\n if (previouslyDisabled !== !!disabled) {\n setPreviouslyDisabled(!!disabled);\n if (restoreFocus && disabled) {\n returnFocusToRef.current?.focus();\n returnFocusToRef.current = null;\n }\n }\n }, [previouslyDisabled, disabled, restoreFocus]);\n\n // Restore focus if `restoreFocus` is set and the component is unmounted.\n // Using a callback ref for this is safer than using useEffect cleanups.\n const restoreFocusHandler = useCallback(\n (elem: HTMLDivElement | null) => {\n if (elem === null && restoreFocus) {\n returnFocusToRef.current?.focus();\n returnFocusToRef.current = null;\n }\n },\n [restoreFocus]\n );\n\n useImperativeHandle(ref, () => ({ focusFirst }));\n const mergedRef = useMergeRefs(containerRef, restoreFocusHandler);\n\n return (\n <>\n \n
    \n {children}\n
    \n \n \n );\n}\n\nexport default React.forwardRef(FocusLock);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport interface TabTrapProps {\n focusNextCallback: (event: React.FocusEvent) => void;\n disabled?: boolean;\n}\n\n/**\n * This component handles focus-forwarding when using keyboard tab navigation.\n * When the user focuses this component, the `focusNextCallback` function is called\n * which can forward the focus to another element.\n */\nexport default function TabTrap({ focusNextCallback, disabled = false }: TabTrapProps) {\n return
    ;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// Credits to\n// https://github.com/theKashey/focus-lock/blob/33f8b4bd9675d2605b15e2e4015b77fe35fbd6d0/src/utils/tabbables.ts\nconst tabbables = [\n 'button:enabled',\n 'select:enabled',\n 'textarea:enabled',\n 'input:enabled',\n\n 'a[href]',\n 'area[href]',\n\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n\n 'audio[controls]',\n 'video[controls]',\n\n '[tabindex]',\n '[contenteditable]',\n '[autofocus]',\n].join(',');\n\nexport function getAllFocusables(container: HTMLElement): HTMLElement[] {\n return Array.prototype.slice.call(container.querySelectorAll(tabbables));\n}\n\nexport function getFocusables(container: HTMLElement): HTMLElement[] {\n return getAllFocusables(container).filter((element: HTMLElement) => element.tabIndex !== -1);\n}\n\nexport function getFirstFocusable(container: HTMLElement): null | HTMLElement {\n const focusables = getFocusables(container);\n return focusables[0] ?? null;\n}\n\nexport function getLastFocusable(container: HTMLElement): null | HTMLElement {\n const focusables = getFocusables(container);\n return focusables[focusables.length - 1] ?? null;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Joins strings with a whitespace, discarding empty strings. Useful to combine multiple aria-labels.\n */\nexport function joinStrings(...strings: Array): string | undefined {\n return strings.filter(Boolean).join(' ') || undefined;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { AnnotationContextProps } from '../interfaces';\nimport AnnotationTrigger from './annotation-trigger';\n\nexport interface AnnotationProps {\n globalStepIndex: number;\n\n onOpen: (stepId: number) => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n\n focusOnRender: boolean;\n totalLocalSteps: number;\n taskLocalStepIndex: number;\n}\n\nexport function ClosedAnnotation({\n globalStepIndex,\n onOpen,\n i18nStrings,\n focusOnRender,\n totalLocalSteps,\n taskLocalStepIndex,\n}: AnnotationProps) {\n const [hotspotRef, setHotspotRef] = useState(null);\n const onClick = useCallback(() => {\n onOpen(globalStepIndex);\n }, [globalStepIndex, onOpen]);\n\n useEffect(() => {\n if (focusOnRender && hotspotRef) {\n hotspotRef.focus();\n }\n }, [focusOnRender, hotspotRef]);\n\n return (\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { HotspotProps } from '../hotspot/interfaces';\nimport { AnnotationContextProps } from './interfaces';\n\nexport interface HotspotContext {\n getContentForId(id: string, direction: HotspotProps['direction']): JSX.Element | null;\n registerHotspot(id: string): void;\n unregisterHotspot(id: string): void;\n currentStepIndex: number;\n currentTutorial: AnnotationContextProps.Tutorial | null;\n onStartTutorial: AnnotationContextProps['onStartTutorial'];\n onExitTutorial: AnnotationContextProps['onExitTutorial'];\n}\n\nconst defaultContext: HotspotContext = {\n getContentForId: () => null,\n registerHotspot() {},\n unregisterHotspot() {},\n currentStepIndex: 0,\n currentTutorial: null,\n onStartTutorial() {},\n onExitTutorial() {},\n};\n\nexport const hotspotContext = React.createContext(defaultContext);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AnnotationContextProps } from './interfaces';\n\nexport function getStepInfo(annotations: readonly AnnotationContextProps.Task[], index: number) {\n if (index >= 0) {\n let taskIndex = 0;\n for (const task of annotations) {\n if (task.steps.length <= index) {\n index -= task.steps.length;\n taskIndex++;\n continue;\n }\n return { task, step: task.steps[index], localIndex: index, taskIndex };\n }\n }\n return { task: undefined, step: undefined, localIndex: 0, taskIndex: 0 };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AppLayoutProps } from './interfaces';\nimport { AppLayoutInternal } from './internal';\nimport { applyDefaults } from './defaults';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useAppLayoutPlacement } from './utils/use-app-layout-placement';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n ...rest\n }: AppLayoutProps,\n ref: React.Ref\n ) => {\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent('AppLayout', {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n disableBodyScroll: rest.disableBodyScroll,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n });\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const i18n = useInternalI18n('app-layout');\n const ariaLabels = {\n navigation: i18n('ariaLabels.navigation', rest.ariaLabels?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', rest.ariaLabels?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', rest.ariaLabels?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', rest.ariaLabels?.notifications),\n tools: i18n('ariaLabels.tools', rest.ariaLabels?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', rest.ariaLabels?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', rest.ariaLabels?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', rest.ariaLabels?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', rest.ariaLabels?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', rest.ariaLabels?.drawersOverflowWithBadge),\n };\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n
    \n \n
    \n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getGlobalFlag } from '../internal/utils/global-flags';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { AppLayoutImplementation } from './implementation';\n\ntype AppLayoutType = React.ForwardRefExoticComponent<\n AppLayoutPropsWithDefaults & React.RefAttributes\n>;\n\nexport function createWidgetizedAppLayout(AppLayoutLoader?: AppLayoutType): AppLayoutType {\n return React.forwardRef((props, ref) => {\n const isRefresh = useVisualRefresh();\n if (isRefresh && getGlobalFlag('appLayoutWidget') && AppLayoutLoader) {\n return ;\n }\n\n return ;\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const awsuiGlobalFlagsSymbol = Symbol.for('awsui-global-flags');\n\ninterface GlobalFlags {\n removeHighContrastHeader?: boolean;\n appLayoutWidget?: boolean;\n}\n\nexport interface FlagsHolder {\n [awsuiGlobalFlagsSymbol]?: GlobalFlags;\n}\n\nexport const getTopWindow = () => {\n return window.top;\n};\n\nfunction getGlobal() {\n return typeof window !== 'undefined' ? window : globalThis;\n}\n\nfunction readFlag(window: unknown, flagName: keyof GlobalFlags) {\n const holder = window as FlagsHolder | null;\n return holder?.[awsuiGlobalFlagsSymbol]?.[flagName];\n}\n\nexport const getGlobalFlag = (flagName: keyof GlobalFlags): GlobalFlags[keyof GlobalFlags] | undefined => {\n try {\n const ownFlag = readFlag(getGlobal(), flagName);\n if (ownFlag !== undefined) {\n return ownFlag;\n }\n return readFlag(getTopWindow(), flagName);\n } catch (e) {\n return undefined;\n }\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport ClassicAppLayout from './classic';\nimport RefreshedAppLayout from './visual-refresh';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\n\nexport const AppLayoutImplementation = React.forwardRef(\n (props, ref) => {\n const isRefresh = useVisualRefresh();\n return isRefresh ? : ;\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\nimport { Notifications } from './notifications';\nimport { MobileToolbar } from './mobile-toolbar';\nimport { useFocusControl } from './utils/use-focus-control';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { findUpUntil } from '../internal/utils/dom';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { SplitPanelSideToggleProps } from '../internal/context/split-panel-context';\nimport {\n CONSTRAINED_MAIN_PANEL_MIN_HEIGHT,\n CONSTRAINED_PAGE_HEIGHT,\n getSplitPanelDefaultSize,\n MAIN_PANEL_MIN_HEIGHT,\n} from '../split-panel/utils/size-utils';\nimport ContentWrapper, { ContentWrapperProps } from './content-wrapper';\nimport { Drawer, DrawerTriggersBar } from './drawer';\nimport { ResizableDrawer } from './drawer/resizable-drawer';\nimport {\n SPLIT_PANEL_MIN_WIDTH,\n SideSplitPanelDrawer,\n SplitPanelProvider,\n SplitPanelProviderProps,\n} from './split-panel';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useSplitPanelFocusControl } from './utils/use-split-panel-focus-control';\nimport { TOOLS_DRAWER_ID, useDrawers } from './utils/use-drawers';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { togglesConfig } from './toggles';\n\nconst ClassicAppLayout = React.forwardRef(\n (\n {\n navigation,\n navigationWidth,\n navigationHide,\n navigationOpen,\n tools,\n toolsWidth,\n toolsHide,\n toolsOpen: controlledToolsOpen,\n breadcrumbs,\n notifications,\n stickyNotifications,\n contentHeader,\n disableContentHeaderOverlap,\n content,\n contentType,\n disableContentPaddings,\n disableBodyScroll,\n maxContentWidth,\n minContentWidth,\n placement,\n ariaLabels,\n splitPanel,\n splitPanelSize: controlledSplitPanelSize,\n splitPanelOpen: controlledSplitPanelOpen,\n splitPanelPreferences: controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n onSplitPanelResize,\n onSplitPanelToggle,\n onNavigationChange,\n onToolsChange,\n drawers: controlledDrawers,\n onDrawerChange,\n activeDrawerId: controlledActiveDrawerId,\n ...rest\n }: AppLayoutPropsWithDefaults,\n ref: React.Ref\n ) => {\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((rest as any).__embeddedViewMode);\n\n const rootRef = useRef(null);\n const isMobile = useMobile();\n\n const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n const onToolsToggle = (open: boolean) => {\n setToolsOpen(open);\n focusToolsButtons();\n fireNonCancelableEvent(onToolsChange, { open });\n };\n\n const {\n drawers,\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n activeDrawerId,\n ariaLabelsWithDrawers,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = useDrawers(\n {\n drawers: controlledDrawers,\n onDrawerChange,\n activeDrawerId: controlledActiveDrawerId,\n ...rest,\n },\n ariaLabels,\n {\n ariaLabels,\n tools,\n toolsOpen,\n toolsHide,\n toolsWidth,\n onToolsToggle,\n }\n );\n ariaLabels = ariaLabelsWithDrawers;\n const hasDrawers = !!drawers;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(toolsOpen || activeDrawer !== undefined, true);\n const {\n refs: drawerRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const onNavigationToggle = useStableCallback((open: boolean) => {\n focusNavButtons();\n fireNonCancelableEvent(onNavigationChange, { open });\n });\n\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink) {\n onNavigationToggle(false);\n }\n };\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n onNavigationToggle(false);\n }\n }, [isMobile, onNavigationToggle]);\n\n const navigationVisible = !navigationHide && navigationOpen;\n const toolsVisible = !toolsHide && toolsOpen;\n\n const [headerFooterHeight, setHeaderFooterHeight] = useState(0);\n // Delay applying changes in header/footer height, as applying them immediately can cause\n // ResizeOberver warnings due to the algorithm thinking that the change might have side-effects\n // further up the tree, therefore blocking notifications to prevent loops\n useEffect(() => {\n const id = requestAnimationFrame(() => setHeaderFooterHeight(placement.top + placement.bottom));\n return () => cancelAnimationFrame(id);\n }, [placement.top, placement.bottom]);\n const contentHeightStyle = {\n [disableBodyScroll ? 'height' : 'minHeight']: `calc(100vh - ${headerFooterHeight}px)`,\n };\n\n const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer;\n const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;\n const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null;\n\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(\n controlledSplitPanelOpen,\n onSplitPanelToggle,\n false,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelOpen',\n changeHandler: 'onSplitPanelToggle',\n }\n );\n\n const splitPanelPosition = splitPanelPreferences?.position || 'bottom';\n const [splitPanelReportedToggle, setSplitPanelReportedToggle] = useState({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanel && (splitPanelReportedToggle.displayed || splitPanelOpen));\n\n const closedDrawerWidth = 40;\n const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;\n\n const getEffectiveToolsWidth = () => {\n if (activeDrawer && activeDrawerSize) {\n return activeDrawerSize;\n }\n\n if (toolsHide || drawers) {\n return 0;\n }\n\n if (toolsOpen) {\n return toolsWidth;\n }\n\n return closedDrawerWidth;\n };\n\n const effectiveToolsWidth = getEffectiveToolsWidth();\n\n const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition);\n const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable(\n controlledSplitPanelSize,\n onSplitPanelResize,\n defaultSplitPanelSize,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelSize',\n changeHandler: 'onSplitPanelResize',\n }\n );\n\n const mainContentRef = useRef(null);\n const legacyScrollRootRef = useRef(null);\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n splitPanelOpen,\n ]);\n\n const onSplitPanelPreferencesSet = useCallback(\n (detail: { position: 'side' | 'bottom' }) => {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);\n },\n [setSplitPanelPreferences, onSplitPanelPreferencesChange, setSplitPanelLastInteraction]\n );\n const onSplitPanelSizeSet = useCallback(\n (newSize: number) => {\n setSplitPanelSize(newSize);\n fireNonCancelableEvent(onSplitPanelResize, { size: newSize });\n },\n [setSplitPanelSize, onSplitPanelResize]\n );\n\n const onSplitPanelToggleHandler = useCallback(() => {\n setSplitPanelOpen(!splitPanelOpen);\n setSplitPanelLastInteraction({ type: splitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });\n }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle, setSplitPanelLastInteraction]);\n\n const getSplitPanelMaxHeight = useStableCallback(() => {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n } else if (disableBodyScroll && legacyScrollRootRef.current) {\n const availableHeight = legacyScrollRootRef.current.clientHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n } else {\n const availableHeight = document.documentElement.clientHeight - placement.top - placement.bottom;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT\n ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT\n : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n }\n });\n\n const rightDrawerBarWidth = drawers ? (drawers.length > 1 ? closedDrawerWidth : 0) : 0;\n const contentPadding = 80;\n // all content except split-panel + drawers/tools area\n const resizableSpaceAvailable = Math.max(\n 0,\n placement.width - effectiveNavigationWidth - minContentWidth - contentPadding - rightDrawerBarWidth\n );\n\n // if there is no space to display split panel in the side, force to bottom\n const isSplitPanelForcedPosition =\n isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH;\n const finalSplitPanePosition = isSplitPanelForcedPosition ? 'bottom' : splitPanelPosition;\n\n const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === 'side';\n\n const sideSplitPanelSize = splitPaneAvailableOnTheSide ? (splitPanelOpen ? splitPanelSize : closedDrawerWidth) : 0;\n const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth);\n const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize);\n\n const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;\n\n const contentMaxWidthStyle = !isMobile ? { maxWidth: maxContentWidth } : undefined;\n\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n\n const splitPanelContextProps: SplitPanelProviderProps = {\n topOffset: placement.top + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),\n bottomOffset: placement.bottom,\n leftOffset:\n placement.left + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),\n rightOffset: isMobile ? 0 : placement.right + effectiveToolsWidth + rightDrawerBarWidth,\n position: finalSplitPanePosition,\n size: splitPanelSize,\n maxWidth: splitPanelMaxWidth,\n getMaxHeight: getSplitPanelMaxHeight,\n disableContentPaddings,\n contentWidthStyles: contentMaxWidthStyle,\n isOpen: splitPanelOpen,\n isForcedPosition: isSplitPanelForcedPosition,\n onResize: onSplitPanelSizeSet,\n onToggle: onSplitPanelToggleHandler,\n onPreferencesChange: onSplitPanelPreferencesSet,\n setSplitPanelToggle: setSplitPanelReportedToggle,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n refs: splitPanelRefs,\n };\n const splitPanelWrapped = splitPanel && (\n \n {finalSplitPanePosition === 'side' ? (\n {splitPanel}\n ) : (\n splitPanel\n )}\n \n );\n\n const contentWrapperProps: ContentWrapperProps = {\n contentType,\n navigationPadding: navigationHide || !!navigationOpen,\n contentWidthStyles: !isMobile ? { minWidth: minContentWidth, maxWidth: maxContentWidth } : undefined,\n toolsPadding:\n // tools padding is displayed in one of the three cases\n // 1. Nothing on the that screen edge (no tools panel and no split panel)\n toolsHide ||\n (hasDrawers && !activeDrawer && (!splitPanelDisplayed || finalSplitPanePosition !== 'side')) ||\n // 2. Tools panel is present and open\n toolsVisible ||\n // 3. Split panel is open in side position\n (splitPaneAvailableOnTheSide && splitPanelOpen),\n isMobile,\n };\n\n useImperativeHandle(ref, () => ({\n openTools: () => onToolsToggle(true),\n closeNavigationIfNecessary: () => {\n if (isMobile) {\n onNavigationToggle(false);\n }\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n }));\n\n const splitPanelBottomOffset =\n (!splitPanelDisplayed || finalSplitPanePosition !== 'bottom'\n ? undefined\n : splitPanelOpen\n ? splitPanelReportedSize\n : splitPanelReportedHeaderHeight) ?? undefined;\n\n const [mobileBarHeight, mobileBarRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n return (\n \n {isMobile && !__embeddedViewMode && (!toolsHide || !navigationHide || breadcrumbs) && (\n onNavigationToggle(true)}\n onToolsOpen={() => onToolsToggle(true)}\n unfocusable={anyPanelOpen}\n mobileBarRef={mobileBarRef}\n drawers={drawers}\n activeDrawerId={activeDrawerId}\n onDrawerChange={newDrawerId => {\n onActiveDrawerChange(newDrawerId);\n if (newDrawerId !== activeDrawerId) {\n focusToolsButtons();\n focusDrawersButtons();\n }\n }}\n >\n {breadcrumbs}\n \n )}\n
    \n {!navigationHide && (\n \n {navigation}\n \n )}\n \n \n {notifications && (\n \n {notifications}\n \n )}\n {((!isMobile && breadcrumbs) || contentHeader) && (\n \n {!isMobile && breadcrumbs && (\n
    {breadcrumbs}
    \n )}\n {contentHeader && (\n \n {contentHeader}\n
    \n )}\n \n )}\n \n \n {content}\n \n \n
    \n {finalSplitPanePosition === 'bottom' && splitPanelWrapped}\n \n\n {finalSplitPanePosition === 'side' && splitPanelWrapped}\n\n {hasDrawers ? (\n {\n if (!isOpen) {\n focusToolsButtons();\n focusDrawersButtons();\n onActiveDrawerChange(null);\n }\n }}\n isOpen={true}\n hideOpenButton={true}\n toggleRefs={drawerRefs}\n type=\"tools\"\n onLoseFocus={loseDrawersFocus}\n activeDrawer={activeDrawer}\n onResize={changeDetail => onActiveDrawerResize(changeDetail)}\n refs={drawerRefs}\n toolsContent={drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content}\n >\n {activeDrawer?.content}\n \n ) : (\n !toolsHide && (\n \n {tools}\n \n )\n )}\n {hasDrawers && drawers.length > 0 && (\n {\n if (activeDrawerId !== newDrawerId) {\n focusToolsButtons();\n focusDrawersButtons();\n }\n onActiveDrawerChange(newDrawerId);\n }}\n ariaLabels={ariaLabels}\n />\n )}\n \n \n );\n }\n);\n\nexport default ClassicAppLayout;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport * as React from 'react';\nimport { isDevelopment } from '../../is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\ninterface PropertyDescription {\n componentName: string;\n controlledProp: string;\n changeHandler: string;\n}\n\n/**\n * This hook allows you to make a component that can be used both in controlled mode and uncontrolled mode.\n * Pass in your component's props, and then implement your component as if it was only controlled.\n * When calling onChange callbacks (or the equivalent for your property), you need to call both the callback returned by this function\n * as well as the callback provided in your component's props.\n *\n * A component determines its mode (either controlled or uncontrolled) on the first render and keeps it for its lifetime. The mode cannot\n * be switched later.\n *\n *\n * Example usage:\n * ```jsx\n * const [checked, setChecked] = useControllable(\n * props,\n * props.defaultEnabled ?? false,\n * {\n * componentName: 'MyCheckboxComponent',\n * controlledProp: 'enabled',\n * changeHandler: 'onCheckedStatusChange'\n * }\n * )\n *\n * return\n * {\n * setChecked(event.target.checked);\n * fireNonCancelableEvent(props.onCheckedStatusChange, { checked: event.target.checked })\n * }} />\n * ```\n *\n * @param controlledValue value for the controlled mode\n * @param handler update handler for controlled mode\n * @param defaultValue initial value for uncontrolled mode\n * @param description property metadata\n */\nexport function useControllable(\n controlledValue: ValueType,\n handler: ((...args: any[]) => unknown) | undefined,\n defaultValue: ValueType,\n { componentName, changeHandler, controlledProp }: PropertyDescription\n) {\n // The decision whether a component is controlled or uncontrolled is made on its first render and cannot be changed afterwards.\n const isControlled = React.useState(controlledValue !== undefined)[0];\n\n if (isDevelopment) {\n // Print a warning if the component switches between controlled and uncontrolled mode.\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (isControlled && handler === undefined) {\n warnOnce(\n componentName,\n `You provided a \\`${controlledProp}\\` prop without an \\`${changeHandler}\\` handler. This will render a non-interactive component.`\n );\n }\n }, [handler, isControlled, componentName, changeHandler, controlledProp]);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n const isControlledNow = controlledValue !== undefined;\n if (isControlled !== isControlledNow) {\n const initialMode = isControlled ? 'controlled' : 'uncontrolled';\n const modeNow = isControlledNow ? 'controlled' : 'uncontrolled';\n warnOnce(\n componentName,\n `A component tried to change ${initialMode} '${controlledProp}' property to be ${modeNow}. ` +\n `This is not supported. Properties should not switch from ${initialMode} to ${modeNow} (or vice versa). ` +\n `Decide between using a controlled or uncontrolled mode for the lifetime of the component. ` +\n `More info: https://fb.me/react-controlled-components`\n );\n }\n }, [isControlled, controlledProp, componentName, controlledValue]);\n }\n\n // This is the value that is used if the component is uncontrolled.\n const [valueState, setValue] = React.useState(defaultValue);\n const [valueHasBeenSet, setValueHasBeenSet] = React.useState(false);\n\n // We track changes to the defaultValue\n const currentUncontrolledValue = valueHasBeenSet ? valueState : defaultValue;\n\n const setUncontrolledValue = React.useCallback(\n (newValue: React.SetStateAction) => {\n setValue(newValue);\n setValueHasBeenSet(true);\n },\n [setValue, setValueHasBeenSet]\n );\n\n if (isControlled) {\n return [controlledValue, defaultCallback] as const;\n } else {\n return [currentUncontrolledValue, setUncontrolledValue] as const;\n }\n}\n\nfunction defaultCallback() {\n return void 0;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Allow use of `process.env.NODE_ENV` specifically.\n *\n * Bundlers like Webpack and Parcel find uses of `process.env.NODE_ENV` and\n * statically replace them with the actual value during the build. When creating\n * production bundles, the use is replaced with the string \"production\", and\n * dead code checkers (e.g. terser) will then remove our dev-only code from\n * production bundles, letting us write runtime checks and warnings that don't\n * hurt production bundle size or performance.\n */\ndeclare const process: { env: { NODE_ENV?: string } };\n\n/**\n * Whether the bundle is a development bundle.\n * Only use this in an if condition and on its own! This will help bundlers find\n * and remove the conditional statement for production bundles.\n */\nexport const isDevelopment = process.env.NODE_ENV !== 'production';\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createSingletonState } from '@cloudscape-design/component-toolkit/internal';\nimport { getMatchingBreakpoint, mobileBreakpoint } from '../../breakpoints';\n\nfunction getIsMobile() {\n if (typeof window === 'undefined') {\n // assume desktop in server-rendering\n return false;\n }\n\n if (window.matchMedia) {\n /**\n * Some browsers include the scrollbar width in their media query calculations, but\n * some browsers don't. Thus we can't use `window.innerWidth` or\n * `document.documentElement.clientWidth` to get a very accurate result (since we\n * wouldn't know which one of them to use).\n * Instead, we use the media query here in JS too.\n */\n return window.matchMedia(`(max-width: ${mobileBreakpoint}px)`).matches;\n }\n\n return getMatchingBreakpoint(window.innerWidth, ['xs']) !== 'xs';\n}\n\nexport const useMobile = createSingletonState({\n initialState: () => getIsMobile(),\n factory: handler => {\n const listener = () => handler(getIsMobile());\n window.addEventListener('resize', listener);\n return () => {\n window.removeEventListener('resize', listener);\n };\n },\n});\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\nimport clsx from 'clsx';\n\ninterface NotificationsProps {\n testUtilsClassName: string;\n children?: React.ReactNode;\n labels: AppLayoutProps.Labels | undefined;\n topOffset: number | undefined;\n disableContentPaddings?: boolean;\n}\ninterface NotificationWrapperProps extends NotificationsProps {\n sticky: boolean | undefined;\n}\n\nexport const Notifications = React.forwardRef(\n ({ sticky, disableContentPaddings, ...props }: NotificationWrapperProps, ref: React.Ref) => {\n return sticky ? (\n
    \n \n {props.children}\n
    \n \n ) : (\n \n {props.children}\n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"notifications\": \"awsui_notifications_1hmm4_1xs0q_9\",\n \"notifications-sticky\": \"awsui_notifications-sticky_1hmm4_1xs0q_10\",\n \"no-content-paddings\": \"awsui_no-content-paddings_1hmm4_1xs0q_25\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ToggleButton, togglesConfig } from '../toggles';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n e.target === e.currentTarget && onClick()}\n >\n \n \n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref;\n tools: React.Ref;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels: AppLayoutProps.Labels | undefined;\n mobileBarRef: React.Ref;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers: Array | undefined;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n}\n\nexport function MobileToolbar({\n ariaLabels,\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen,\n unfocusable,\n drawers,\n activeDrawerId,\n children,\n onNavigationOpen,\n onToolsOpen,\n onDrawerChange,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n\n const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n {!navigationHide && (\n \n )}\n
    \n {children &&
    {children}
    }\n
    \n {!toolsHide && !drawers && (\n \n )}\n {drawers && (\n \n )}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { InternalButton } from '../../button/internal';\nimport InternalIcon from '../../icon/internal';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutButtonProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const togglesConfig = {\n navigation: {\n TagName: 'nav',\n iconName: 'menu',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.navigation,\n openLabel: labels.navigationToggle,\n closeLabel: labels.navigationClose,\n }),\n },\n tools: {\n TagName: 'aside',\n iconName: 'status-info',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.tools,\n openLabel: labels.toolsToggle,\n closeLabel: labels.toolsClose,\n }),\n },\n} as const;\n\nexport const ToggleButton = React.forwardRef(\n (\n {\n className,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n iconName,\n iconSvg,\n disabled,\n testId,\n onClick,\n badge,\n }: AppLayoutButtonProps,\n ref: React.Ref<{ focus(): void }>\n ) => {\n return (\n }\n className={clsx(className, styles['toggle-button'])}\n aria-label={ariaLabel}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaExpanded ? undefined : true}\n aria-controls={ariaControls}\n data-testid={testId}\n >\n \n \n );\n }\n);\n\ninterface CloseButtonProps {\n className?: string;\n ariaLabel: string | undefined;\n onClick: () => void;\n}\n\nexport const CloseButton = React.forwardRef(\n ({ className, ariaLabel, onClick }: CloseButtonProps, ref: React.Ref) => {\n return (\n \n \n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"toggle-button\": \"awsui_toggle-button_16w0h_1lkgf_99\",\n \"close-button\": \"awsui_close-button_16w0h_1lkgf_134\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalButtonDropdown from '../../button-dropdown/internal';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from '../../button-dropdown/interfaces';\nimport { CancelableEventHandler } from '../../internal/events';\nimport { AppLayoutProps } from '../interfaces';\nimport testutilStyles from '../test-classes/styles.css.js';\n\ninterface OverflowMenuProps {\n items: Array;\n onItemClick: CancelableEventHandler;\n customTriggerBuilder?: InternalButtonDropdownProps['customTriggerBuilder'];\n ariaLabel?: string;\n}\n\nexport default function OverflowMenu({ items, onItemClick, customTriggerBuilder, ariaLabel }: OverflowMenuProps) {\n return (\n ({\n id: item.id,\n text: item.ariaLabels.drawerName,\n iconName: item.trigger.iconName,\n iconSvg: item.trigger.iconSvg,\n badge: item.badge,\n }))}\n className={testutilStyles['overflow-menu']}\n onItemClick={onItemClick}\n ariaLabel={ariaLabel}\n variant=\"icon\"\n customTriggerBuilder={customTriggerBuilder}\n expandToViewport={true}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton, InternalButtonProps } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n mainAction,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n if (mainAction) {\n checkSafeUrl('ButtonDropdown', mainAction.href);\n }\n\n if (isDevelopment) {\n if (mainAction && variant !== 'primary' && variant !== 'normal') {\n warnOnce('ButtonDropdown', 'Main action is only supported for \"primary\" and \"normal\" component variant.');\n }\n }\n const isMainAction = mainAction && (variant === 'primary' || variant === 'normal');\n const isVisualRefresh = useVisualRefresh();\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n // Scroll is unnecessary when moving focus back to the dropdown trigger.\n onReturnFocus: () => triggerRef.current?.focus({ preventScroll: true }),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const mainActionRef = useRef(null);\n const triggerRef = useRef(null);\n\n useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const baseTriggerProps: InternalButtonProps = {\n className: clsx(styles['trigger-button'], styles['test-utils-button-trigger']),\n ...iconProps,\n variant: triggerVariant,\n loading,\n loadingText,\n disabled,\n onClick: (event: Event) => {\n event.preventDefault();\n clickHandler();\n },\n ariaLabel,\n ariaExpanded: canBeOpened && isOpen,\n formAction: 'none',\n __nativeAttributes: {\n 'aria-haspopup': true,\n },\n };\n\n const triggerId = useUniqueId('awsui-button-dropdown__trigger');\n\n const triggerHasBadge = () => {\n const flatItems = items.flatMap(item => {\n if ('items' in item) {\n return item.items;\n }\n return item;\n });\n\n return (\n variant === 'icon' &&\n !!flatItems?.find(item => {\n if ('badge' in item) {\n return item.badge;\n }\n })\n );\n };\n\n let trigger: React.ReactNode = null;\n if (customTriggerBuilder) {\n trigger = (\n
    \n {customTriggerBuilder({\n testUtilsClass: styles['test-utils-button-trigger'],\n ariaExpanded: canBeOpened && isOpen,\n onClick: clickHandler,\n triggerRef,\n ariaLabel,\n disabled,\n isOpen,\n })}\n
    \n );\n } else if (isMainAction) {\n const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel, ...mainActionProps } =\n mainAction;\n const mainActionIconProps = external\n ? ({ iconName: 'external', iconAlign: 'right' } as const)\n : ({ iconName, iconAlt, iconSvg, iconUrl } as const);\n const mainActionAriaLabel = externalIconAriaLabel\n ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}`\n : undefined;\n\n trigger = (\n
    \n e.stopPropagation()}\n onKeyUp={e => e.stopPropagation()}\n >\n \n {text}\n \n
    \n \n \n \n \n );\n } else {\n trigger = (\n
    \n \n {children}\n \n
    \n );\n }\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\n\n const shouldLabelWithTrigger = !ariaLabel && !mainAction && variant !== 'icon' && variant !== 'inline-icon';\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n return (\n \n toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n
    \n {title && (\n
    \n \n {title}\n \n
    \n )}\n {description && (\n \n {description}\n \n )}\n
    \n )}\n \n \n \n \n \n );\n }\n);\n\nexport default InternalButtonDropdown;\n", "\n import './styles.scoped.css';\n export default {\n \"button-dropdown\": \"awsui_button-dropdown_sne0l_17rq9_99\",\n \"items-list-container\": \"awsui_items-list-container_sne0l_17rq9_103\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_sne0l_17rq9_1\",\n \"rotate-up\": \"awsui_rotate-up_sne0l_17rq9_122\",\n \"rotate-down\": \"awsui_rotate-down_sne0l_17rq9_137\",\n \"header\": \"awsui_header_sne0l_17rq9_152\",\n \"title\": \"awsui_title_sne0l_17rq9_163\",\n \"description\": \"awsui_description_sne0l_17rq9_164\",\n \"split-trigger-wrapper\": \"awsui_split-trigger-wrapper_sne0l_17rq9_168\",\n \"trigger-item\": \"awsui_trigger-item_sne0l_17rq9_171\",\n \"trigger-button\": \"awsui_trigger-button_sne0l_17rq9_174\",\n \"visual-refresh\": \"awsui_visual-refresh_sne0l_17rq9_185\",\n \"split-trigger\": \"awsui_split-trigger_sne0l_17rq9_168\",\n \"dropdown-trigger\": \"awsui_dropdown-trigger_sne0l_17rq9_193\",\n \"test-utils-button-trigger\": \"awsui_test-utils-button-trigger_sne0l_17rq9_197\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"dropdown-content-wrapper\": \"awsui_dropdown-content-wrapper_qwoo0_3gt2b_99\",\n \"awsui-motion-fade-in-dropdown\": \"awsui_awsui-motion-fade-in-dropdown_qwoo0_3gt2b_1\",\n \"refresh\": \"awsui_refresh_qwoo0_3gt2b_120\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_qwoo0_3gt2b_1\",\n \"root\": \"awsui_root_qwoo0_3gt2b_149\",\n \"interior\": \"awsui_interior_qwoo0_3gt2b_185\",\n \"dropdown\": \"awsui_dropdown_qwoo0_3gt2b_99\",\n \"use-portal\": \"awsui_use-portal_qwoo0_3gt2b_196\",\n \"is-empty\": \"awsui_is-empty_qwoo0_3gt2b_248\",\n \"dropdown-drop-up\": \"awsui_dropdown-drop-up_qwoo0_3gt2b_255\",\n \"with-limited-width\": \"awsui_with-limited-width_qwoo0_3gt2b_259\",\n \"dropdown-drop-left\": \"awsui_dropdown-drop-left_qwoo0_3gt2b_262\",\n \"dropdown-drop-right\": \"awsui_dropdown-drop-right_qwoo0_3gt2b_268\",\n \"occupy-entire-width\": \"awsui_occupy-entire-width_qwoo0_3gt2b_274\",\n \"stretch-beyond-trigger-width\": \"awsui_stretch-beyond-trigger-width_qwoo0_3gt2b_277\",\n \"hide-block-border\": \"awsui_hide-block-border_qwoo0_3gt2b_281\",\n \"open\": \"awsui_open_qwoo0_3gt2b_287\",\n \"nowrap\": \"awsui_nowrap_qwoo0_3gt2b_296\",\n \"dropdown-content\": \"awsui_dropdown-content_qwoo0_3gt2b_99\",\n \"stretch-trigger-height\": \"awsui_stretch-trigger-height_qwoo0_3gt2b_307\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '../../direction.js';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n
    \n {children}\n
    ,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children};\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject;\n verticalContainerRef: React.RefObject;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n \n \n
    \n \n {header}\n {children}\n {footer}\n \n
    \n \n \n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef(null);\n const triggerRef = useRef(null);\n const dropdownRef = useRef(null);\n const dropdownContainerRef = useRef(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\n const verticalContainerRef = useRef(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n \n
    \n {trigger}\n
    \n\n dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n \n \n {(state, ref) => (\n
    \n triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n \n {children}\n \n\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n
    \n )}\n
    \n \n \n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getBreakpointValue } from '../../breakpoints';\nimport { getLogicalBoundingClientRect } from '../../direction';\nimport { BoundingBox, getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers';\nimport styles from './styles.css.js';\n\nconst AVAILABLE_SPACE_RESERVE_DEFAULT = 50;\nconst AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31\nconst AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;\n\ninterface AvailableSpace {\n blockStart: number;\n blockEnd: number;\n inlineStart: number;\n inlineEnd: number;\n}\nexport interface DropdownPosition {\n blockSize: string;\n inlineSize: string;\n dropBlockStart: boolean;\n dropInlineStart: boolean;\n insetInlineStart: string;\n}\nexport interface InteriorDropdownPosition extends DropdownPosition {\n insetBlockEnd: string;\n insetBlockStart: string;\n}\n\nconst getClosestParentDimensions = (element: HTMLElement): any => {\n const parents = getOverflowParents(element).map(element => {\n const { blockSize, inlineSize, insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(element);\n return {\n blockSize,\n inlineSize,\n insetBlockStart,\n insetInlineStart,\n };\n });\n\n return parents.shift();\n};\n\n// By default, most dropdowns should expand their content as necessary, but to a maximum of 465px (the XXS breakpoint).\n// This value was determined by UX but may be subject to change in the future, depending on the feedback.\nexport const defaultMaxDropdownWidth = getBreakpointValue('xxs');\n\nexport const getAvailableSpace = ({\n trigger,\n overflowParents,\n stretchWidth = false,\n stretchHeight = false,\n isMobile,\n}: {\n trigger: HTMLElement;\n overflowParents: ReadonlyArray;\n stretchWidth?: boolean;\n stretchHeight?: boolean;\n isMobile?: boolean;\n}): AvailableSpace => {\n const availableSpaceReserveVertical = stretchHeight\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const availableSpaceReserveHorizontal = stretchWidth\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n insetBlockEnd: triggerBlockEnd,\n insetInlineStart: triggerInlineStart,\n insetInlineEnd: triggerInlineEnd,\n } = getLogicalBoundingClientRect(trigger);\n\n return overflowParents.reduce(\n ({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => {\n const offsetTop = triggerBlockEnd - overflowParent.insetBlockStart;\n const currentBlockStart = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;\n const currentBlockEnd = overflowParent.blockSize - offsetTop - availableSpaceReserveVertical;\n const currentInlineStart = triggerInlineEnd - overflowParent.insetInlineStart - availableSpaceReserveHorizontal;\n const currentInlineEnd =\n overflowParent.insetInlineStart +\n overflowParent.inlineSize -\n triggerInlineStart -\n availableSpaceReserveHorizontal;\n\n return {\n blockStart: Math.min(blockStart, currentBlockStart),\n blockEnd: Math.min(blockEnd, currentBlockEnd),\n inlineStart: Math.min(inlineStart, currentInlineStart),\n inlineEnd: Math.min(inlineEnd, currentInlineEnd),\n };\n },\n {\n blockStart: Number.MAX_VALUE,\n blockEnd: Number.MAX_VALUE,\n inlineStart: Number.MAX_VALUE,\n inlineEnd: Number.MAX_VALUE,\n }\n );\n};\n\nexport const getInteriorAvailableSpace = ({\n trigger,\n overflowParents,\n isMobile,\n}: {\n trigger: HTMLElement;\n overflowParents: ReadonlyArray;\n isMobile?: boolean;\n}): AvailableSpace => {\n const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n insetBlockEnd: triggerBlockEnd,\n insetBlockStart: triggerBlockStart,\n insetInlineStart: triggerInlineStart,\n insetInlineEnd: triggerInlineEnd,\n } = getLogicalBoundingClientRect(trigger);\n\n return overflowParents.reduce(\n ({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => {\n const currentBlockStart = triggerBlockEnd - overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentBlockEnd =\n overflowParent.blockSize -\n triggerBlockStart +\n overflowParent.insetBlockStart -\n AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentInlineStart =\n triggerInlineStart - overflowParent.insetInlineStart - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n const currentInlineEnd =\n overflowParent.insetInlineStart +\n overflowParent.inlineSize -\n triggerInlineEnd -\n AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n\n return {\n blockStart: Math.min(blockStart, currentBlockStart),\n blockEnd: Math.min(blockEnd, currentBlockEnd),\n inlineStart: Math.min(inlineStart, currentInlineStart),\n inlineEnd: Math.min(inlineEnd, currentInlineEnd),\n };\n },\n {\n blockStart: Number.MAX_VALUE,\n blockEnd: Number.MAX_VALUE,\n inlineStart: Number.MAX_VALUE,\n inlineEnd: Number.MAX_VALUE,\n }\n );\n};\n\nexport const getWidths = ({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth = false,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n desiredMinWidth?: number;\n stretchBeyondTriggerWidth?: boolean;\n}) => {\n // Determine the width of the trigger\n const { inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(triggerElement);\n // Minimum width is determined by either an explicit number (desiredMinWidth) or the trigger width\n const minWidth = desiredMinWidth ? Math.min(triggerInlineSize, desiredMinWidth) : triggerInlineSize;\n // If stretchBeyondTriggerWidth is true, the maximum width is the XS breakpoint (465px) or the trigger width (if bigger).\n const maxWidth = stretchBeyondTriggerWidth ? Math.max(defaultMaxDropdownWidth, triggerInlineSize) : Number.MAX_VALUE;\n // Determine the actual dropdown width, the size that it \"wants\" to be\n const { inlineSize: requiredWidth } = getLogicalBoundingClientRect(dropdownElement);\n // Try to achieve the required/desired width within the given parameters\n const idealWidth = Math.min(Math.max(requiredWidth, minWidth), maxWidth);\n return { idealWidth, minWidth, triggerInlineSize };\n};\n\nexport const hasEnoughSpaceToStretchBeyondTriggerWidth = ({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n desiredMinWidth?: number;\n expandToViewport: boolean;\n stretchWidth: boolean;\n stretchHeight: boolean;\n isMobile: boolean;\n}) => {\n const overflowParents = getOverflowParentDimensions({\n element: dropdownElement,\n excludeClosestParent: false,\n expandToViewport,\n canExpandOutsideViewport: stretchHeight,\n });\n const { idealWidth } = getWidths({\n triggerElement: triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth: true,\n });\n const availableSpace = getAvailableSpace({\n trigger: triggerElement,\n overflowParents,\n stretchWidth,\n stretchHeight,\n isMobile,\n });\n return idealWidth <= availableSpace.inlineStart || idealWidth <= availableSpace.inlineEnd;\n};\n\nexport const getDropdownPosition = ({\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth: desiredMinWidth,\n preferCenter = false,\n stretchWidth = false,\n stretchHeight = false,\n isMobile = false,\n stretchBeyondTriggerWidth = false,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n overflowParents: ReadonlyArray;\n minWidth?: number;\n preferCenter?: boolean;\n stretchWidth?: boolean;\n stretchHeight?: boolean;\n isMobile?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n}): DropdownPosition => {\n // Determine the space available around the dropdown that it can grow in\n const availableSpace = getAvailableSpace({\n trigger: triggerElement,\n overflowParents,\n stretchWidth,\n stretchHeight,\n isMobile,\n });\n const { idealWidth, minWidth, triggerInlineSize } = getWidths({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth,\n });\n\n let dropInlineStart: boolean;\n let insetInlineStart: number | null = null;\n let inlineSize = idealWidth;\n\n //1. Can it be positioned with ideal width to the right?\n if (idealWidth <= availableSpace.inlineEnd) {\n dropInlineStart = false;\n //2. Can it be positioned with ideal width to the left?\n } else if (idealWidth <= availableSpace.inlineStart) {\n dropInlineStart = true;\n //3. Fit into biggest available space either on left or right\n } else {\n dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd;\n inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd, minWidth);\n }\n\n if (preferCenter) {\n const spillOver = (idealWidth - triggerInlineSize) / 2;\n\n // availableSpace always includes the trigger width, but we want to exclude that\n const availableOutsideLeft = availableSpace.inlineStart - triggerInlineSize;\n const availableOutsideRight = availableSpace.inlineEnd - triggerInlineSize;\n\n const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;\n if (fitsInCenter) {\n insetInlineStart = -spillOver;\n }\n }\n\n const dropBlockStart =\n availableSpace.blockEnd < dropdownElement.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd;\n const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropBlockStart,\n dropInlineStart,\n insetInlineStart: insetInlineStart === null ? 'auto' : `${insetInlineStart}px`,\n blockSize: `${croppedHeight}px`,\n inlineSize: `${inlineSize}px`,\n };\n};\n\nexport const getInteriorDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray,\n isMobile?: boolean\n): InteriorDropdownPosition => {\n const availableSpace = getInteriorAvailableSpace({ trigger, overflowParents, isMobile });\n const {\n insetBlockEnd: triggerBlockEnd,\n insetBlockStart: triggerBlockStart,\n inlineSize: triggerInlineSize,\n } = getLogicalBoundingClientRect(trigger);\n const { insetBlockStart: parentDropdownBlockStart, blockSize: parentDropdownHeight } =\n getClosestParentDimensions(trigger);\n\n let dropInlineStart;\n\n let { inlineSize } = getLogicalBoundingClientRect(dropdown);\n const insetBlockStart = triggerBlockStart - parentDropdownBlockStart;\n if (inlineSize <= availableSpace.inlineEnd) {\n dropInlineStart = false;\n } else if (inlineSize <= availableSpace.inlineStart) {\n dropInlineStart = true;\n } else {\n dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd;\n inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd);\n }\n\n const insetInlineStart = dropInlineStart ? 0 - inlineSize : triggerInlineSize;\n\n const dropBlockStart =\n availableSpace.blockEnd < dropdown.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd;\n const insetBlockEnd = dropBlockStart ? parentDropdownBlockStart + parentDropdownHeight - triggerBlockEnd : 0;\n const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropBlockStart,\n dropInlineStart,\n blockSize: `${croppedHeight}px`,\n inlineSize: `${inlineSize}px`,\n insetBlockStart: `${insetBlockStart}px`,\n insetBlockEnd: `${insetBlockEnd}px`,\n insetInlineStart: `${insetInlineStart}px`,\n };\n};\n\nexport const calculatePosition = (\n dropdownElement: HTMLDivElement,\n triggerElement: HTMLDivElement,\n verticalContainerElement: HTMLDivElement,\n interior: boolean,\n expandToViewport: boolean,\n preferCenter: boolean,\n stretchWidth: boolean,\n stretchHeight: boolean,\n isMobile: boolean,\n minWidth?: number,\n stretchBeyondTriggerWidth?: boolean\n): [DropdownPosition, DOMRect] => {\n // cleaning previously assigned values,\n // so that they are not reused in case of screen resize and similar events\n verticalContainerElement.style.maxBlockSize = '';\n dropdownElement.style.inlineSize = '';\n dropdownElement.style.insetBlockStart = '';\n dropdownElement.style.insetBlockEnd = '';\n dropdownElement.style.insetInlineStart = '';\n\n dropdownElement.classList.remove(styles['dropdown-drop-left']);\n dropdownElement.classList.remove(styles['dropdown-drop-right']);\n dropdownElement.classList.remove(styles['dropdown-drop-up']);\n\n const overflowParents = getOverflowParentDimensions({\n element: dropdownElement,\n excludeClosestParent: interior,\n expandToViewport,\n canExpandOutsideViewport: stretchHeight,\n });\n const position = interior\n ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile)\n : getDropdownPosition({\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n stretchBeyondTriggerWidth,\n });\n const triggerBox = triggerElement.getBoundingClientRect();\n return [position, triggerBox];\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport { MutableRefObject, useCallback, useRef } from 'react';\nimport {\n Transition as ReactTransitionGroupTransition,\n TransitionStatus as ReactTransitionGroupTransitionStatus,\n} from 'react-transition-group';\nimport { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';\n\nexport type TransitionStatus = ReactTransitionGroupTransitionStatus | 'enter' | 'exit';\n\nexport interface TransitionProps {\n in: boolean;\n exit?: boolean;\n\n disabled?: boolean;\n\n children: (state: TransitionStatus, transitioningElementRef: MutableRefObject) => React.ReactNode;\n onStatusChange?: (status: TransitionStatus) => void;\n transitionChangeDelay?: { entering?: number };\n}\n\n/**\n * This component is a wrapper around the CSSTransition component.\n *\n * It provides a second parameter in its rendering function that must be\n * attached to the node that is transitioning.\n */\nexport function Transition({\n in: isIn,\n children,\n exit = true,\n onStatusChange = () => void 0,\n disabled = false,\n transitionChangeDelay,\n ...rest\n}: TransitionProps) {\n const transitionRootElement = useRef(null);\n // the initial state of the transition should be either 'exited' or 'entered' depending\n // on the `in` property, this mimicks how internally the Transition component works here:\n // https://github.com/reactjs/react-transition-group/blob/6cbd6aaedaf8e9472007640b429ddb48c6c24158/src/Transition.js#L121\n const [transitionState, setTransitionState] = useState(isIn ? 'entered' : 'exited');\n const motionDisabled = useReducedMotion(transitionRootElement) || disabled;\n\n const addTransitionEndListener = useCallback((done: () => void) => {\n const node = transitionRootElement.current;\n\n if (node === null) {\n return;\n }\n const listener = (e: TransitionEvent | AnimationEvent) => {\n if (e.target === node) {\n node.removeEventListener('transitionend', listener);\n node.removeEventListener('animationend', listener);\n done();\n }\n };\n node.addEventListener('transitionend', listener);\n node.addEventListener('animationend', listener);\n }, []);\n\n return (\n {\n if (!isAppearing) {\n setTransitionState('enter');\n onStatusChange('enter');\n }\n }}\n onEntering={isAppearing => {\n if (!isAppearing) {\n // This line forces the browser to recalculate the layout because we want the starting state in the 'enter' style\n // to be applied before the animation starts.\n void transitionRootElement.current?.offsetHeight;\n\n if (transitionChangeDelay?.entering) {\n setTimeout(() => {\n setTransitionState('entering');\n onStatusChange('entering');\n }, transitionChangeDelay?.entering);\n } else {\n setTransitionState('entering');\n onStatusChange('entering');\n }\n }\n }}\n onEntered={isAppearing => {\n if (!isAppearing) {\n setTransitionState('entered');\n onStatusChange('entered');\n }\n }}\n onExit={() => {\n setTransitionState('exit');\n onStatusChange('exit');\n }}\n onExiting={() => {\n setTransitionState('exiting');\n onStatusChange('exiting');\n }}\n onExited={() => {\n setTransitionState('exited');\n onStatusChange('exited');\n }}\n {...rest}\n >\n {() => children(transitionState, transitionRootElement)}\n \n );\n}\n", "export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}", "export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}", "export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}", "import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}", "import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\nimport { forceReflow } from './utils/reflow';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
    \n * \n *
    \n * {\"I'll receive my-node-* classes\"}\n *
    \n *
    \n * \n *
    \n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n if (node) forceReflow(node);\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;", "/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}", "import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}", "function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
    \n * I'm a fade Transition!\n *
    \n * )}\n *
    \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
    \n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
    \n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;", "export default {\n disabled: false\n};", "import PropTypes from 'prop-types';\nexport var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n enter: PropTypes.number,\n exit: PropTypes.number,\n appear: PropTypes.number\n}).isRequired]) : null;\nexport var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string,\n active: PropTypes.string\n}), PropTypes.shape({\n enter: PropTypes.string,\n enterDone: PropTypes.string,\n enterActive: PropTypes.string,\n exit: PropTypes.string,\n exitDone: PropTypes.string,\n exitActive: PropTypes.string\n})]) : null;", "import React from 'react';\nexport default React.createContext(null);", "export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport TransitionGroup from './TransitionGroup';\n/**\n * The `` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * \n *
    I appear first
    \n *
    I replace the above
    \n *
    \n * ```\n */\n\nvar ReplaceTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n\n _this.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n var child = React.Children.toArray(children)[idx];\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n\n if (this.props[handler]) {\n var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);\n this.props[handler](maybeNode);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = React.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return /*#__PURE__*/React.createElement(TransitionGroup, props, inProp ? React.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : React.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(React.Component);\n\nReplaceTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n in: PropTypes.bool.isRequired,\n children: function children(props, propName) {\n if (React.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\nexport default ReplaceTransition;", "export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
    ` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
    ` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;", "import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}", "import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\n\nvar _leaveRenders, _enterRenders;\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { ENTERED, ENTERING, EXITING } from './Transition';\nimport TransitionGroupContext from './TransitionGroupContext';\n\nfunction areChildrenDifferent(oldChildren, newChildren) {\n if (oldChildren === newChildren) return false;\n\n if (React.isValidElement(oldChildren) && React.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {\n return false;\n }\n\n return true;\n}\n/**\n * Enum of modes for SwitchTransition component\n * @enum { string }\n */\n\n\nexport var modes = {\n out: 'out-in',\n in: 'in-out'\n};\n\nvar callHook = function callHook(element, name, cb) {\n return function () {\n var _element$props;\n\n element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);\n cb();\n };\n};\n\nvar leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {\n var current = _ref.current,\n changeState = _ref.changeState;\n return React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERING, null);\n })\n });\n}, _leaveRenders[modes.in] = function (_ref2) {\n var current = _ref2.current,\n changeState = _ref2.changeState,\n children = _ref2.children;\n return [current, React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERING);\n })\n })];\n}, _leaveRenders);\nvar enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {\n var children = _ref3.children,\n changeState = _ref3.changeState;\n return React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n });\n}, _enterRenders[modes.in] = function (_ref4) {\n var current = _ref4.current,\n children = _ref4.children,\n changeState = _ref4.changeState;\n return [React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n }), React.cloneElement(children, {\n in: true\n })];\n}, _enterRenders);\n/**\n * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).\n * You can use it when you want to control the render between state transitions.\n * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.\n *\n * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.\n * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.\n *\n * **Note**: If you want the animation to happen simultaneously\n * (that is, to have the old child removed and a new child inserted **at the same time**),\n * you should use\n * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)\n * instead.\n *\n * ```jsx\n * function App() {\n * const [state, setState] = useState(false);\n * return (\n * \n * node.addEventListener(\"transitionend\", done, false)}\n * classNames='fade'\n * >\n * \n * \n * \n * );\n * }\n * ```\n *\n * ```css\n * .fade-enter{\n * opacity: 0;\n * }\n * .fade-exit{\n * opacity: 1;\n * }\n * .fade-enter-active{\n * opacity: 1;\n * }\n * .fade-exit-active{\n * opacity: 0;\n * }\n * .fade-enter-active,\n * .fade-exit-active{\n * transition: opacity 500ms;\n * }\n * ```\n */\n\nvar SwitchTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(SwitchTransition, _React$Component);\n\n function SwitchTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {\n status: ENTERED,\n current: null\n };\n _this.appeared = false;\n\n _this.changeState = function (status, current) {\n if (current === void 0) {\n current = _this.state.current;\n }\n\n _this.setState({\n status: status,\n current: current\n });\n };\n\n return _this;\n }\n\n var _proto = SwitchTransition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n };\n\n SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n if (props.children == null) {\n return {\n current: null\n };\n }\n\n if (state.status === ENTERING && props.mode === modes.in) {\n return {\n status: ENTERING\n };\n }\n\n if (state.current && areChildrenDifferent(state.current, props.children)) {\n return {\n status: EXITING\n };\n }\n\n return {\n current: React.cloneElement(props.children, {\n in: true\n })\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n mode = _this$props.mode,\n _this$state = this.state,\n status = _this$state.status,\n current = _this$state.current;\n var data = {\n children: children,\n current: current,\n changeState: this.changeState,\n status: status\n };\n var component;\n\n switch (status) {\n case ENTERING:\n component = enterRenders[mode](data);\n break;\n\n case EXITING:\n component = leaveRenders[mode](data);\n break;\n\n case ENTERED:\n component = current;\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: {\n isMounting: !this.appeared\n }\n }, component);\n };\n\n return SwitchTransition;\n}(React.Component);\n\nSwitchTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Transition modes.\n * `out-in`: Current element transitions out first, then when complete, the new element transitions in.\n * `in-out`: New element transitions in first, then when complete, the current element transitions out.\n *\n * @type {'out-in'|'in-out'}\n */\n mode: PropTypes.oneOf([modes.in, modes.out]),\n\n /**\n * Any `Transition` or `CSSTransition` component.\n */\n children: PropTypes.oneOfType([PropTypes.element.isRequired])\n} : {};\nSwitchTransition.defaultProps = {\n mode: modes.out\n};\nexport default SwitchTransition;", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { useVisualContext } from '../../components/visual-context';\nimport { useCurrentMode, useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../use-visual-mode';\n\nexport function usePortalModeClasses(ref: React.RefObject) {\n const colorMode = useCurrentMode(ref);\n const densityMode = useDensityMode(ref);\n const context = useVisualContext(ref);\n const visualRefresh = useVisualRefresh();\n return clsx({\n 'awsui-polaris-dark-mode awsui-dark-mode': colorMode === 'dark',\n 'awsui-polaris-compact-mode awsui-compact-mode': densityMode === 'compact',\n 'awsui-visual-refresh': visualRefresh,\n [`awsui-context-${context}`]: context,\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\n\ntype Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\nconst DropdownContext = React.createContext<{ position: Position }>({\n position: 'bottom-right',\n});\n\nexport interface DropdownContextProviderProps {\n position?: Position;\n children?: React.ReactNode;\n}\n\nexport function DropdownContextProvider({ children, position = 'bottom-right' }: DropdownContextProviderProps) {\n return {children};\n}\n\nexport function useDropdownContext() {\n return useContext(DropdownContext);\n}\n", "const customCSSPropertiesMap: Record = {\n breadcrumbsGap: '--awsui-breadcrumbs-gap-lgosor',\n contentGapLeft: '--awsui-content-gap-left-lgosor',\n contentGapRight: '--awsui-content-gap-right-lgosor',\n contentHeight: '--awsui-content-height-lgosor',\n defaultMaxContentWidth: '--awsui-default-max-content-width-lgosor',\n defaultMinContentWidth: '--awsui-default-min-content-width-lgosor',\n drawerSize: '--awsui-drawer-size-lgosor',\n footerHeight: '--awsui-footer-height-lgosor',\n headerGap: '--awsui-header-gap-lgosor',\n headerHeight: '--awsui-header-height-lgosor',\n layoutWidth: '--awsui-layout-width-lgosor',\n mainGap: '--awsui-main-gap-lgosor',\n mainOffsetLeft: '--awsui-main-offset-left-lgosor',\n mainTemplateRows: '--awsui-main-template-rows-lgosor',\n maxContentWidth: '--awsui-max-content-width-lgosor',\n minContentWidth: '--awsui-min-content-width-lgosor',\n mobileBarHeight: '--awsui-mobile-bar-height-lgosor',\n notificationsGap: '--awsui-notifications-gap-lgosor',\n notificationsHeight: '--awsui-notifications-height-lgosor',\n offsetTop: '--awsui-offset-top-lgosor',\n offsetTopWithNotifications: '--awsui-offset-top-with-notifications-lgosor',\n overlapHeight: '--awsui-overlap-height-lgosor',\n navigationWidth: '--awsui-navigation-width-lgosor',\n splitPanelReportedHeaderSize: '--awsui-split-panel-reported-header-size-lgosor',\n splitPanelReportedSize: '--awsui-split-panel-reported-size-lgosor',\n splitPanelHeight: '--awsui-split-panel-height-lgosor',\n splitPanelMinWidth: '--awsui-split-panel-min-width-lgosor',\n splitPanelMaxWidth: '--awsui-split-panel-max-width-lgosor',\n toolsMaxWidth: '--awsui-tools-max-width-lgosor',\n toolsWidth: '--awsui-tools-width-lgosor',\n toolsAnimationStartingOpacity: '--awsui-tools-animation-starting-opacity-lgosor',\n contentScrollMargin: '--awsui-content-scroll-margin-lgosor',\n flashbarStackDepth: '--awsui-flashbar-stack-depth-lgosor',\n flashbarStackIndex: '--awsui-flashbar-stack-index-lgosor',\n flashbarStickyBottomMargin: '--awsui-flashbar-sticky-bottom-margin-lgosor',\n stackedNotificationsBottomMargin: '--awsui-stacked-notifications-bottom-margin-lgosor',\n stackedNotificationsDefaultBottomMargin: '--awsui-stacked-notifications-default-bottom-margin-lgosor',\n dropdownDefaultMaxWidth: '--awsui-dropdown-default-max-width-lgosor',\n spinnerRotatorFrom: '--awsui-spinner-rotator-from-lgosor',\n spinnerRotatorTo: '--awsui-spinner-rotator-to-lgosor',\n spinnerLineLeftFrom: '--awsui-spinner-line-left-from-lgosor',\n spinnerLineLeftTo: '--awsui-spinner-line-left-to-lgosor',\n spinnerLineRightFrom: '--awsui-spinner-line-right-from-lgosor',\n spinnerLineRightTo: '--awsui-spinner-line-right-to-lgosor',\n};\nexport default customCSSPropertiesMap;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ItemListProps } from './interfaces';\nimport ItemElement from './item-element';\nimport ExpandableCategoryElement from './category-elements/expandable-category-element';\nimport CategoryElement from './category-elements/category-element';\nimport { isItemGroup } from './utils/utils';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport MobileExpandableCategoryElement from './category-elements/mobile-expandable-category-element';\n\nexport default function ItemsList({\n items,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n categoryDisabled = false,\n hasExpandableGroups = false,\n hasCategoryHeader = false,\n expandToViewport = false,\n variant = 'normal',\n}: ItemListProps) {\n const isMobile = useMobile();\n\n const elements = items.map((item, index) => {\n if (!isItemGroup(item)) {\n const showDivider = (index === items.length - 1 && !lastInDropdown) || isItemGroup(items[index + 1]);\n\n return (\n \n );\n }\n if (hasExpandableGroups) {\n return item.text ? (\n isMobile ? (\n \n ) : (\n \n )\n ) : null;\n }\n return (\n \n );\n });\n\n return <>{elements};\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ItemProps } from '../interfaces';\nimport { isLinkItem } from '../utils/utils';\nimport styles from './styles.css.js';\nimport Tooltip from '../tooltip';\n\nimport { ButtonDropdownProps } from '../interfaces';\nimport { getItemTarget } from '../utils/utils';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport InternalIcon, { InternalIconProps } from '../../icon/internal';\nimport { useDropdownContext } from '../../internal/components/dropdown/context';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n showDivider,\n hasCategoryHeader,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isLink = isLinkItem(item);\n const onClick = (event: React.MouseEvent) => {\n // Stop propagation to parent node and handle event exclusively in here. This ensures\n // that no group will interfere with the default behavior of links\n event.stopPropagation();\n if (!isLink) {\n event.preventDefault();\n }\n if (!disabled) {\n onItemActivate(item, event);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n return (\n \n \n \n );\n};\n\nexport type InternalItemProps = ButtonDropdownProps.Item & {\n badge?: boolean;\n};\n\ninterface MenuItemProps {\n item: InternalItemProps;\n disabled: boolean;\n highlighted: boolean;\n}\n\nfunction MenuItem({ item, disabled, highlighted }: MenuItemProps) {\n const menuItemRef = useRef<(HTMLSpanElement & HTMLAnchorElement) | null>(null);\n\n useEffect(() => {\n if (highlighted && menuItemRef.current) {\n menuItemRef.current.focus();\n }\n }, [highlighted]);\n\n const isDisabledWithReason = disabled && item.disabledReason;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const menuItemProps: React.HTMLAttributes = {\n className: styles['menu-item'],\n lang: item.lang,\n ref: menuItemRef,\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex: highlighted ? 0 : -1,\n ...getMenuItemProps({ disabled }),\n ...(isDisabledWithReason ? targetProps : {}),\n };\n\n const menuItem = isLinkItem(item) ? (\n \n \n \n ) : (\n \n \n \n );\n\n const { position } = useDropdownContext();\n const tooltipPosition = position === 'bottom-left' || position === 'top-left' ? 'left' : 'right';\n return isDisabledWithReason ? (\n \n {menuItem}\n {descriptionEl}\n \n ) : (\n menuItem\n );\n}\n\nconst MenuItemContent = ({ item, disabled }: { item: InternalItemProps; disabled: boolean }) => {\n const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);\n const hasExternal = isLinkItem(item) && item.external;\n return (\n <>\n {hasIcon && (\n \n )}{' '}\n {item.text} {hasExternal && }\n \n );\n};\n\nconst MenuItemIcon = (props: InternalIconProps) => (\n \n \n \n);\n\nconst ExternalIcon = ({ disabled, ariaLabel }: { disabled: boolean; ariaLabel?: string }) => {\n const icon = ;\n return (\n \n {icon}\n \n );\n};\n\nexport default ItemElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonDropdownProps, LinkItem } from '../interfaces';\n\nexport const isItemGroup = (item: ButtonDropdownProps.ItemOrGroup): item is ButtonDropdownProps.ItemGroup =>\n item && (item as ButtonDropdownProps.ItemGroup).items !== undefined;\n\nexport const isLinkItem = (item: LinkItem | ButtonDropdownProps.ItemOrGroup): item is LinkItem =>\n item && (item as LinkItem).href !== undefined;\n\nexport const getItemTarget = (item: ButtonDropdownProps.Item) => (item.external ? '_blank' : undefined);\n\nexport function indexIncludes(source: number[], target: number[]) {\n for (let index = 0; index < source.length; index++) {\n if (source[index] !== target[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function indexEquals(left: number[], right: number[]) {\n if (left.length !== right.length) {\n return false;\n }\n\n for (let index = 0; index < left.length; index++) {\n if (left[index] !== right[index]) {\n return false;\n }\n }\n\n return true;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"item-element\": \"awsui_item-element_93a1u_goggu_99\",\n \"disabled\": \"awsui_disabled_93a1u_goggu_111\",\n \"show-divider\": \"awsui_show-divider_93a1u_goggu_118\",\n \"highlighted\": \"awsui_highlighted_93a1u_goggu_121\",\n \"is-focused\": \"awsui_is-focused_93a1u_goggu_136\",\n \"menu-item\": \"awsui_menu-item_93a1u_goggu_141\",\n \"has-category-header\": \"awsui_has-category-header_93a1u_goggu_155\",\n \"icon\": \"awsui_icon_93a1u_goggu_159\",\n \"external-icon\": \"awsui_external-icon_93a1u_goggu_164\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEventHandler, useRef, useState } from 'react';\n\nimport Arrow from '../popover/arrow';\nimport PopoverContainer from '../popover/container';\nimport PopoverBody from '../popover/body';\nimport Portal from '../internal/components/portal';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n content?: React.ReactNode;\n position?: 'top' | 'right' | 'bottom' | 'left';\n}\n\nconst DEFAULT_OPEN_TIMEOUT_IN_MS = 120;\n\nexport default function Tooltip({ children, content, position = 'right' }: TooltipProps) {\n const ref = useRef(null);\n const isReducedMotion = useReducedMotion(ref);\n const { open, triggerProps } = useTooltipOpen(isReducedMotion ? 0 : DEFAULT_OPEN_TIMEOUT_IN_MS);\n const portalClasses = usePortalModeClasses(ref);\n\n return (\n \n {children}\n {open && (\n \n \n }\n renderWithPortal={true}\n zIndex={7000}\n >\n {}}\n overflowVisible=\"both\"\n >\n \n {content}\n \n \n \n \n \n )}\n \n );\n}\n\nfunction useTooltipOpen(timeout: number) {\n const handle = useRef();\n const [isOpen, setIsOpen] = useState(false);\n\n const close = () => {\n clearTimeout(handle.current);\n setIsOpen(false);\n };\n const open = () => setIsOpen(true);\n const openDelayed = () => {\n handle.current = setTimeout(open, timeout);\n };\n const onKeyDown: KeyboardEventHandler = e => {\n if (isOpen && isEscape(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n close();\n }\n };\n\n const onFocus = openDelayed;\n const onBlur = close;\n\n return {\n open: isOpen,\n triggerProps: {\n onBlur,\n onFocus,\n onKeyDown,\n },\n };\n}\n\nconst isEscape = (key: string) => key === 'Escape' || key === 'Esc';\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { InternalPosition } from './interfaces';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nexport interface ArrowProps {\n position: InternalPosition | null;\n}\n\nconst Arrow = (props: ArrowProps) => {\n const isVisualRefresh = useVisualRefresh();\n\n return (\n
    \n
    \n
    \n
    \n );\n};\n\nexport default React.memo(Arrow);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useLayoutEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { isDevelopment } from '../../is-development';\n\nexport interface PortalProps {\n container?: null | Element;\n getContainer?: () => Promise;\n removeContainer?: (container: HTMLElement) => void;\n children: React.ReactNode;\n}\n\nfunction manageDefaultContainer(setState: React.Dispatch>) {\n const newContainer = document.createElement('div');\n document.body.appendChild(newContainer);\n setState(newContainer);\n return () => {\n document.body.removeChild(newContainer);\n };\n}\n\nfunction manageAsyncContainer(\n getContainer: () => Promise,\n removeContainer: (container: HTMLElement) => void,\n setState: React.Dispatch>\n) {\n let newContainer: HTMLElement;\n getContainer().then(\n container => {\n newContainer = container;\n setState(container);\n },\n error => {\n console.warn('[AwsUi] [portal]: failed to load portal root', error);\n }\n );\n return () => {\n removeContainer(newContainer);\n };\n}\n\n/**\n * A safe react portal component that renders to a provided node.\n * If a node isn't provided, it creates one under document.body.\n */\nexport default function Portal({ container, getContainer, removeContainer, children }: PortalProps) {\n const [activeContainer, setActiveContainer] = useState(container ?? null);\n\n useLayoutEffect(() => {\n if (container) {\n setActiveContainer(container);\n return;\n }\n if (isDevelopment) {\n if (getContainer && !removeContainer) {\n warnOnce('portal', '`removeContainer` is required when `getContainer` is provided');\n }\n if (!getContainer && removeContainer) {\n warnOnce('portal', '`getContainer` is required when `removeContainer` is provided');\n }\n }\n\n if (getContainer && removeContainer) {\n return manageAsyncContainer(getContainer, removeContainer, setActiveContainer);\n }\n return manageDefaultContainer(setActiveContainer);\n }, [container, getContainer, removeContainer]);\n\n return activeContainer && createPortal(children, activeContainer);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\n\nexport default function useHiddenDescription(description?: string) {\n const id = useUniqueId();\n return {\n targetProps: {\n 'aria-describedby': description ? id : undefined,\n },\n descriptionEl: description ? (\n \n ) : null,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport interface GetMenuItemPropsParams {\n disabled: boolean;\n parent?: boolean;\n expanded?: boolean;\n}\n/**\n * @returns attributes for a menuitem widget given parameters\n */\nexport const getMenuItemProps: (params: GetMenuItemPropsParams) => React.HTMLProps = ({\n disabled,\n parent,\n expanded,\n}: GetMenuItemPropsParams) => ({\n role: 'menuitem',\n 'aria-disabled': disabled ? 'true' : undefined,\n 'aria-haspopup': parent ? 'true' : undefined,\n 'aria-expanded': expanded ? 'true' : parent ? 'false' : undefined,\n});\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport Dropdown from '../../internal/components/dropdown';\nimport { CategoryProps } from '../interfaces';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n expandToViewport,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef(null);\n const ref = useRef(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick: React.MouseEventHandler = event => {\n if (!disabled) {\n event.preventDefault();\n onGroupToggle(item, event);\n triggerRef.current?.focus();\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n \n {item.text}\n \n \n \n \n );\n\n let content: React.ReactNode;\n // If the category element is disabled, we do not render a dropdown.\n // Screenreaders are confused by additional sections\n if (isDisabledWithReason) {\n content = (\n \n {trigger}\n {descriptionEl}\n \n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n \n {item.items && expanded && (\n \n \n \n )}\n \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default ExpandableCategoryElement;\n", "\n import './styles.scoped.css';\n export default {\n \"header\": \"awsui_header_16mm3_w5lmn_99\",\n \"disabled\": \"awsui_disabled_16mm3_w5lmn_116\",\n \"expandable-header\": \"awsui_expandable-header_16mm3_w5lmn_120\",\n \"rolled-down\": \"awsui_rolled-down_16mm3_w5lmn_131\",\n \"highlighted\": \"awsui_highlighted_16mm3_w5lmn_134\",\n \"is-focused\": \"awsui_is-focused_16mm3_w5lmn_152\",\n \"category\": \"awsui_category_16mm3_w5lmn_157\",\n \"expandable\": \"awsui_expandable_16mm3_w5lmn_120\",\n \"variant-navigation\": \"awsui_variant-navigation_16mm3_w5lmn_172\",\n \"expand-icon\": \"awsui_expand-icon_16mm3_w5lmn_179\",\n \"expand-icon-up\": \"awsui_expand-icon-up_16mm3_w5lmn_186\",\n \"expand-icon-right\": \"awsui_expand-icon-right_16mm3_w5lmn_189\",\n \"items-list-container\": \"awsui_items-list-container_16mm3_w5lmn_206\",\n \"in-dropdown\": \"awsui_in-dropdown_16mm3_w5lmn_215\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CategoryProps } from '../interfaces';\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport ItemsList from '../items-list';\n\nconst CategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n // Hide the category title element from screen readers because it will be\n // provided as an ARIA label.\n return (\n \n {item.text && (\n

    \n {item.text}\n

    \n )}\n
      \n {item.items && (\n \n )}\n
    \n \n );\n};\n\nexport default CategoryElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-group';\nimport { CategoryProps } from '../interfaces';\nimport Tooltip from '../tooltip.js';\nimport useHiddenDescription from '../utils/use-hidden-description.js';\nimport { getMenuItemProps } from '../utils/menu-item.js';\n\nconst MobileExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick = (e: React.MouseEvent) => {\n if (!disabled) {\n e.preventDefault();\n onGroupToggle(item, e);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n \n {item.text}\n \n \n \n \n );\n\n let content: React.ReactNode;\n\n if (isDisabledWithReason) {\n content = (\n <>\n {descriptionEl}\n {trigger}\n \n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n \n {item.items && expanded && (\n
      \n \n
    \n )}\n
    \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default MobileExpandableCategoryElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nexport interface MobileExpandableGroupProps {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n /**\n * mobile expandable groups content elements.\n */\n children?: React.ReactNode;\n /**\n * Open state of the mobile expandable groups.\n */\n open?: boolean;\n}\n\nconst MobileExpandableGroup = ({ children, trigger, open }: MobileExpandableGroupProps) => {\n return (\n
    \n
    {trigger}
    \n
    \n {children}\n
    \n
    \n );\n};\n\nexport default MobileExpandableGroup;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_14cnr_1ev1z_99\",\n \"trigger\": \"awsui_trigger_14cnr_1ev1z_136\",\n \"dropdown\": \"awsui_dropdown_14cnr_1ev1z_139\",\n \"nowrap\": \"awsui_nowrap_14cnr_1ev1z_150\",\n \"open\": \"awsui_open_14cnr_1ev1z_153\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState } from 'react';\n\ninterface OpenStateProps {\n onOpen?: () => void;\n onClose?: () => void;\n}\n\nexport const useOpenState = ({ onOpen, onClose }: OpenStateProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [openedWithKeyboard, setOpenedWithKeyboard] = useState(false);\n\n const openDropdown = (isKeyboard: boolean) => {\n if (!isOpen) {\n setIsOpen(true);\n setOpenedWithKeyboard(!!isKeyboard);\n onOpen?.();\n }\n };\n\n const closeDropdown = () => {\n if (isOpen) {\n setIsOpen(false);\n onClose?.();\n }\n };\n\n const toggleDropdown = () => {\n if (isOpen) {\n closeDropdown();\n } else {\n openDropdown(false);\n }\n };\n\n return { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState, useMemo, useCallback } from 'react';\n\nimport { indexIncludes, indexEquals } from './utils';\nimport { ButtonDropdownProps, HighlightProps } from '../interfaces';\nimport createItemsTree, { TreeIndex } from './create-items-tree';\nimport moveHighlightOneStep from './move-highlight';\n\ninterface UseHighlightedMenuOptions {\n items: ButtonDropdownProps.Items;\n hasExpandableGroups: boolean;\n isInRestrictedView?: boolean;\n}\n\ninterface UseHighlightedMenuApi extends HighlightProps {\n moveHighlight: (direction: -1 | 1) => void;\n expandGroup: (group?: ButtonDropdownProps.ItemGroup) => void;\n collapseGroup: () => void;\n reset: () => void;\n setIsUsingMouse: (isUsingMouse: boolean) => void;\n}\n\nexport default function useHighlightedMenu({\n items,\n hasExpandableGroups,\n isInRestrictedView = false,\n}: UseHighlightedMenuOptions): UseHighlightedMenuApi {\n const [targetIndex, setTargetIndex] = useState([]);\n const [expandedIndex, setExpandedIndex] = useState([]);\n const [isUsingMouse, setIsUsingMouse] = useState(true);\n\n const { getItem, getItemIndex, getSequentialIndex, getParentIndex } = useMemo(() => createItemsTree(items), [items]);\n\n const targetItem = useMemo(() => getItem(targetIndex), [targetIndex, getItem]);\n\n const isHighlighted = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n const index = getItemIndex(item);\n return indexIncludes(index, targetIndex);\n },\n [targetIndex, getItemIndex]\n );\n\n // check if keyboard focus is on the element\n const isKeyboardHighlight = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n const index = getItemIndex(item);\n return !isUsingMouse && indexEquals(index, targetIndex);\n },\n [targetIndex, getItemIndex, isUsingMouse]\n );\n\n const isExpanded = useCallback(\n (group: ButtonDropdownProps.ItemGroup) => {\n const index = getItemIndex(group);\n\n return indexIncludes(index, expandedIndex);\n },\n [expandedIndex, getItemIndex]\n );\n\n const moveHighlight = useCallback(\n (direction: -1 | 1) => {\n const getNext = (index: TreeIndex) => {\n const nextIndex = getSequentialIndex(index, direction);\n const item = getItem(nextIndex || [-1]);\n\n if (!nextIndex || !item) {\n return null;\n }\n\n const parentIndex = getParentIndex(item);\n const parentItem = parentIndex && getItem(parentIndex);\n\n return { index: nextIndex, item, parent: parentItem || undefined };\n };\n\n const nextIndex = moveHighlightOneStep({\n startIndex: targetIndex,\n expandedIndex,\n getNext,\n hasExpandableGroups,\n isInRestrictedView,\n });\n\n if (nextIndex) {\n setTargetIndex(nextIndex);\n }\n },\n [targetIndex, expandedIndex, getItem, getSequentialIndex, getParentIndex, hasExpandableGroups, isInRestrictedView]\n );\n\n const highlightItem = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n setTargetIndex(getItemIndex(item));\n },\n [getItemIndex]\n );\n\n const expandGroup = useCallback(\n (group?: ButtonDropdownProps.ItemGroup) => {\n const groupIndex = group ? getItemIndex(group) : targetIndex;\n const firstChildIndex = [...groupIndex, 0];\n\n // move to the first child item unless in restricted mode\n setTargetIndex(isInRestrictedView ? groupIndex : firstChildIndex);\n setExpandedIndex(groupIndex);\n },\n [targetIndex, getItemIndex, isInRestrictedView]\n );\n\n const collapseGroup = useCallback(() => {\n if (expandedIndex.length > 0) {\n setTargetIndex(expandedIndex);\n setExpandedIndex(expandedIndex.slice(0, -1));\n }\n }, [expandedIndex]);\n\n const reset = useCallback(() => {\n setTargetIndex([]);\n setExpandedIndex([]);\n }, []);\n\n return {\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n moveHighlight,\n highlightItem,\n expandGroup,\n collapseGroup,\n reset,\n setIsUsingMouse,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isItemGroup } from './utils';\nimport { ButtonDropdownProps } from '../interfaces';\n\n// The function turns a tree of items into a structure optimized for lookup of\n// items and corresponding indices as well as iteration on indices in the given order.\n\n// As trees are multidimensional, the index is represented as an array\nexport type TreeIndex = number[];\n\ninterface ItemsTreeApi {\n // Returns an item for the given tree index or null if not found\n getItem: (index: TreeIndex) => ButtonDropdownProps.ItemOrGroup | null;\n // Returns the tree index of the given item. The item must be present\n // in the tree (referential comparison), or an error will be thrown\n getItemIndex: (item: ButtonDropdownProps.ItemOrGroup) => TreeIndex;\n // Returns the index of next or previous sequential node or null if out of bounds\n getSequentialIndex: (index: TreeIndex, direction: -1 | 1) => TreeIndex | null;\n // Returns parent tree index of a given item or null if no parent is present\n getParentIndex: (item: ButtonDropdownProps.ItemOrGroup) => TreeIndex | null;\n}\n\nexport default function createItemsTree(items: ButtonDropdownProps.Items): ItemsTreeApi {\n const itemToIndex = new Map();\n const indexToItem = new Map();\n const flatIndices: string[] = [];\n\n traverseItems(items, (item, index) => {\n const indexKey = stringifyIndex(index);\n itemToIndex.set(item, indexKey);\n indexToItem.set(indexKey, item);\n flatIndices.push(indexKey);\n });\n\n return {\n getItem: (index: TreeIndex): ButtonDropdownProps.ItemOrGroup | null => {\n const indexKey = stringifyIndex(index);\n\n return indexToItem.get(indexKey) || null;\n },\n getItemIndex: (item: ButtonDropdownProps.ItemOrGroup): TreeIndex => {\n const indexKey = itemToIndex.get(item);\n\n if (!indexKey) {\n throw new Error('Invariant violation: item is not found.');\n }\n\n return parseIndex(indexKey);\n },\n getSequentialIndex: (index: TreeIndex, direction: -1 | 1): TreeIndex | null => {\n const indexKey = stringifyIndex(index);\n const position = flatIndices.indexOf(indexKey);\n\n const nextIndexKey = flatIndices[position + direction];\n\n if (!nextIndexKey) {\n return null;\n }\n\n return parseIndex(nextIndexKey);\n },\n getParentIndex: (item: ButtonDropdownProps.ItemOrGroup): TreeIndex | null => {\n const indexKey = itemToIndex.get(item);\n\n if (!indexKey) {\n throw new Error('Invariant violation: item is not found.');\n }\n\n const index = parseIndex(indexKey);\n\n // No parent\n if (index.length === 1) {\n return null;\n }\n\n return index.slice(0, index.length - 1);\n },\n };\n}\n\nfunction traverseItems(\n items: ButtonDropdownProps.Items,\n act: (item: ButtonDropdownProps.ItemOrGroup, index: TreeIndex) => void,\n parentIndex: TreeIndex = []\n) {\n items.forEach((item, index) => {\n const itemIndex = [...parentIndex, index];\n act(item, itemIndex);\n\n if (isItemGroup(item)) {\n traverseItems(item.items, act, itemIndex);\n }\n });\n}\n\nfunction stringifyIndex(index: TreeIndex): string {\n return index.join('-');\n}\n\nfunction parseIndex(index: string): TreeIndex {\n return index.split('-').map(it => parseInt(it));\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isItemGroup, indexEquals } from './utils';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { TreeIndex } from './create-items-tree';\n\n// While every menu item except the edge ones have successors and predecessors,\n// there are rules determining what items are eligible for highlighting for the\n// given set of conditions. The function implements all these rules.\n\ninterface MoveHighlightProps {\n startIndex: TreeIndex;\n expandedIndex: TreeIndex;\n getNext: (index: TreeIndex) => {\n index: TreeIndex;\n item: ButtonDropdownProps.ItemOrGroup;\n parent?: ButtonDropdownProps.ItemOrGroup;\n } | null;\n hasExpandableGroups: boolean;\n isInRestrictedView: boolean;\n}\n\nexport default function moveHighlight({\n startIndex,\n expandedIndex,\n getNext,\n hasExpandableGroups,\n isInRestrictedView,\n}: MoveHighlightProps): TreeIndex | null {\n const tryMove = (currentIndex: TreeIndex): TreeIndex | null => {\n const next = getNext(currentIndex);\n\n if (!next) {\n return null;\n }\n\n // Prevents stepping into disabled expandable groups. However,\n // it's possible to navigate nested groups.\n if (next.parent?.disabled && hasExpandableGroups) {\n return tryMove(next.index);\n }\n\n // it is not allowed to highlight groups when non-expandable\n if (isItemGroup(next.item) && !hasExpandableGroups) {\n return tryMove(next.index);\n }\n\n // can only move within same parent unless is in restricted view\n if (hasExpandableGroups && !isInRestrictedView && !isSameParent(startIndex, next.index)) {\n return tryMove(next.index);\n }\n\n // in restricted view can only navigate to children if group is expanded\n if (\n hasExpandableGroups &&\n isInRestrictedView &&\n !isSameLevel(next.index, expandedIndex) &&\n !isIncluded(expandedIndex, next.index)\n ) {\n return tryMove(next.index);\n }\n\n return next.index;\n };\n\n return tryMove(startIndex);\n}\n\nfunction isSameParent(left: TreeIndex, right: TreeIndex) {\n return indexEquals(left.slice(0, -1), right.slice(0, -1));\n}\n\nfunction isSameLevel(left: TreeIndex, right: TreeIndex) {\n return left.length === right.length;\n}\n\nfunction isIncluded(parent: TreeIndex, child: TreeIndex) {\n return indexEquals(parent, child.slice(0, -1));\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { useOpenState } from '../../internal/components/options-list/utils/use-open-state';\nimport { ButtonDropdownProps, ButtonDropdownSettings, GroupToggle, HighlightProps, ItemActivate } from '../interfaces';\nimport { fireCancelableEvent, CancelableEventHandler, isPlainLeftClick } from '../../internal/events';\nimport { KeyCode } from '../../internal/keycode';\nimport { getItemTarget, isItemGroup, isLinkItem } from './utils';\nimport useHighlightedMenu from './use-highlighted-menu';\n\ninterface UseButtonDropdownOptions extends ButtonDropdownSettings {\n items: ButtonDropdownProps.Items;\n onItemClick?: CancelableEventHandler;\n onItemFollow?: CancelableEventHandler;\n onReturnFocus: () => void;\n expandToViewport?: boolean;\n}\n\ninterface UseButtonDropdownApi extends HighlightProps {\n isOpen: boolean;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onKeyUp: (event: React.KeyboardEvent) => void;\n onItemActivate: ItemActivate;\n onGroupToggle: GroupToggle;\n toggleDropdown: (options?: { moveHighlightOnOpen?: boolean }) => void;\n closeDropdown: () => void;\n setIsUsingMouse: (isUsingMouse: boolean) => void;\n}\n\nexport function useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus,\n hasExpandableGroups,\n isInRestrictedView = false,\n expandToViewport = false,\n}: UseButtonDropdownOptions): UseButtonDropdownApi {\n const {\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n moveHighlight,\n expandGroup,\n collapseGroup,\n reset,\n setIsUsingMouse,\n } = useHighlightedMenu({\n items,\n hasExpandableGroups,\n isInRestrictedView,\n });\n\n const { isOpen, closeDropdown, ...openStateProps } = useOpenState({ onClose: reset });\n const toggleDropdown = (options: { moveHighlightOnOpen?: boolean } = {}) => {\n const moveHighlightOnOpen = options.moveHighlightOnOpen ?? true;\n if (!isOpen && moveHighlightOnOpen) {\n moveHighlight(1);\n }\n openStateProps.toggleDropdown();\n };\n\n const onGroupToggle: GroupToggle = item => (!isExpanded(item) ? expandGroup(item) : collapseGroup());\n\n const onItemActivate: ItemActivate = (item, event) => {\n const details = {\n id: item.id || 'undefined',\n href: item.href,\n external: item.external,\n target: getItemTarget(item),\n };\n if (onItemFollow && item.href && isPlainLeftClick(event)) {\n fireCancelableEvent(onItemFollow, details, event);\n }\n if (onItemClick) {\n fireCancelableEvent(onItemClick, details, event);\n }\n onReturnFocus();\n closeDropdown();\n };\n\n const doVerticalNavigation = (direction: -1 | 1) => {\n if (isOpen) {\n moveHighlight(direction);\n }\n };\n\n const openAndSelectFirst = (event: React.KeyboardEvent) => {\n toggleDropdown();\n event.preventDefault();\n };\n\n const actOnParentDropdown = (event: React.KeyboardEvent) => {\n // if there is no highlighted item we act on the trigger by opening or closing dropdown\n if (!targetItem) {\n if (isOpen && !isInRestrictedView) {\n toggleDropdown();\n } else {\n openAndSelectFirst(event);\n }\n } else {\n if (isItemGroup(targetItem)) {\n onGroupToggle(targetItem, event);\n } else {\n onItemActivate(targetItem, event);\n }\n }\n };\n\n const activate = (event: React.KeyboardEvent, isEnter?: boolean) => {\n setIsUsingMouse(false);\n\n // if item is a link we rely on default behavior of an anchor, no need to prevent\n if (targetItem && isLinkItem(targetItem) && isEnter) {\n return;\n }\n\n event.preventDefault();\n actOnParentDropdown(event);\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n setIsUsingMouse(false);\n switch (event.keyCode) {\n case KeyCode.down: {\n doVerticalNavigation(1);\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n doVerticalNavigation(-1);\n event.preventDefault();\n break;\n }\n case KeyCode.space: {\n // Prevent scrolling the list of items and highlighting the trigger\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (!targetItem?.disabled) {\n activate(event, true);\n }\n break;\n }\n case KeyCode.left:\n case KeyCode.right: {\n if (targetItem && !targetItem.disabled && isItemGroup(targetItem) && !isExpanded(targetItem)) {\n expandGroup();\n } else if (hasExpandableGroups) {\n collapseGroup();\n }\n\n event.preventDefault();\n break;\n }\n case KeyCode.escape: {\n onReturnFocus();\n closeDropdown();\n event.preventDefault();\n if (isOpen) {\n event.stopPropagation();\n }\n break;\n }\n case KeyCode.tab: {\n // When expanded to viewport the focus can't move naturally to the next element.\n // Returning the focus to the trigger instead.\n if (expandToViewport) {\n onReturnFocus();\n }\n closeDropdown();\n break;\n }\n }\n };\n const onKeyUp = (event: React.KeyboardEvent) => {\n // We need to handle activating items with Space separately because there is a bug\n // in Firefox where changing the focus during a Space keydown event it will trigger\n // unexpected click events on the new element: https://bugzilla.mozilla.org/show_bug.cgi?id=1220143\n if (event.keyCode === KeyCode.space && !targetItem?.disabled) {\n activate(event);\n }\n };\n\n return {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\nimport { DropdownStatusProps } from '../dropdown-status';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n statusType: DropdownStatusProps.StatusType;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseBlockMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n statusType,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseBlockMargin = false,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef(null);\n\n const handleScroll = useStableCallback(() => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n });\n\n useEffect(() => {\n if (open && statusType === 'pending') {\n handleScroll();\n }\n }, [open, statusType, handleScroll]);\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-block-margin']]: decreaseBlockMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n \n );\n};\n\nexport default React.forwardRef(OptionsList);\n", "\n import './styles.scoped.css';\n export default {\n \"options-list\": \"awsui_options-list_19gcf_halkh_99\",\n \"decrease-block-margin\": \"awsui_decrease-block-margin_19gcf_halkh_149\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1fj9k_3pu9z_5\",\n \"navigation\": \"awsui_navigation_1fj9k_3pu9z_9\",\n \"navigation-toggle\": \"awsui_navigation-toggle_1fj9k_3pu9z_13\",\n \"navigation-close\": \"awsui_navigation-close_1fj9k_3pu9z_17\",\n \"content\": \"awsui_content_1fj9k_3pu9z_21\",\n \"notifications\": \"awsui_notifications_1fj9k_3pu9z_25\",\n \"breadcrumbs\": \"awsui_breadcrumbs_1fj9k_3pu9z_29\",\n \"tools\": \"awsui_tools_1fj9k_3pu9z_33\",\n \"tools-close\": \"awsui_tools-close_1fj9k_3pu9z_37\",\n \"tools-toggle\": \"awsui_tools-toggle_1fj9k_3pu9z_41\",\n \"drawer-closed\": \"awsui_drawer-closed_1fj9k_3pu9z_45\",\n \"mobile-bar\": \"awsui_mobile-bar_1fj9k_3pu9z_49\",\n \"disable-body-scroll-root\": \"awsui_disable-body-scroll-root_1fj9k_3pu9z_53\",\n \"drawers-trigger\": \"awsui_drawers-trigger_1fj9k_3pu9z_57\",\n \"active-drawer\": \"awsui_active-drawer_1fj9k_3pu9z_61\",\n \"active-drawer-close-button\": \"awsui_active-drawer-close-button_1fj9k_3pu9z_65\",\n \"overflow-menu\": \"awsui_overflow-menu_1fj9k_3pu9z_69\",\n \"drawers-slider\": \"awsui_drawers-slider_1fj9k_3pu9z_73\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"block-body-scroll\": \"awsui_block-body-scroll_19d8l_c90gb_103\",\n \"mobile-bar\": \"awsui_mobile-bar_19d8l_c90gb_107\",\n \"mobile-bar-breadcrumbs\": \"awsui_mobile-bar-breadcrumbs_19d8l_c90gb_120\",\n \"mobile-toggle\": \"awsui_mobile-toggle_19d8l_c90gb_127\",\n \"mobile-toggle-type-navigation\": \"awsui_mobile-toggle-type-navigation_19d8l_c90gb_136\",\n \"mobile-toggle-type-tools\": \"awsui_mobile-toggle-type-tools_19d8l_c90gb_139\",\n \"mobile-toggle-type-drawer\": \"awsui_mobile-toggle-type-drawer_19d8l_c90gb_139\",\n \"drawers-container\": \"awsui_drawers-container_19d8l_c90gb_146\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"resize-active\": \"awsui_resize-active_lm6vo_1lt83_104\",\n \"resize-side\": \"awsui_resize-side_lm6vo_1lt83_110\",\n \"resize-bottom\": \"awsui_resize-bottom_lm6vo_1lt83_113\",\n \"with-motion\": \"awsui_with-motion_lm6vo_1lt83_118\",\n \"root\": \"awsui_root_lm6vo_1lt83_133\",\n \"root-no-scroll\": \"awsui_root-no-scroll_lm6vo_1lt83_140\",\n \"layout\": \"awsui_layout_lm6vo_1lt83_145\",\n \"layout-no-scroll\": \"awsui_layout-no-scroll_lm6vo_1lt83_151\",\n \"layout-main\": \"awsui_layout-main_lm6vo_1lt83_155\",\n \"layout-main-scrollable\": \"awsui_layout-main-scrollable_lm6vo_1lt83_161\",\n \"unfocusable\": \"awsui_unfocusable_lm6vo_1lt83_166\",\n \"breadcrumbs-desktop\": \"awsui_breadcrumbs-desktop_lm6vo_1lt83_170\",\n \"content-header-wrapper\": \"awsui_content-header-wrapper_lm6vo_1lt83_175\",\n \"content-wrapper\": \"awsui_content-wrapper_lm6vo_1lt83_179\",\n \"content-overlapped\": \"awsui_content-overlapped_lm6vo_1lt83_183\",\n \"content-extra-top-padding\": \"awsui_content-extra-top-padding_lm6vo_1lt83_187\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function splitItems(\n maybeItems: Array | undefined,\n splitIndex: number,\n activeId: string | null\n) {\n const items = maybeItems ?? [];\n const visibleItems = items.slice(0, splitIndex);\n const overflowItems = items.slice(splitIndex);\n\n if (overflowItems.length === 1) {\n return { visibleItems: items, overflowItems: [] };\n }\n\n if (activeId && overflowItems.length > 0 && visibleItems.length > 0) {\n const activeInOverflow = overflowItems.find(item => item.id === activeId);\n if (activeInOverflow) {\n overflowItems.splice(overflowItems.indexOf(activeInOverflow), 1);\n overflowItems.unshift(visibleItems.pop()!);\n visibleItems.push(activeInOverflow);\n }\n }\n return { visibleItems, overflowItems };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-api';\nimport { AppLayoutProps } from '../interfaces';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState({ before: [], after: [] });\n const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n\n const drawerWasOpenRef = useRef(false);\n drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n setRuntimeDrawers(convertRuntimeDrawers(drawers));\n if (!drawerWasOpenRef.current) {\n const defaultActiveDrawer = sortByPriority(drawers).find(drawer => drawer.defaultActive);\n if (defaultActiveDrawer) {\n onActiveDrawerChangeStable(defaultActiveDrawer.id);\n }\n }\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ before: [], after: [] });\n };\n }, [disableRuntimeDrawers, onActiveDrawerChangeStable]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after];\n if (drawers.length === 0) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\ntype UseDrawersProps = Pick & {\n __disableRuntimeDrawers?: boolean;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [drawerSizes, setDrawerSizes] = useState>({});\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange);\n const combinedDrawers = drawers\n ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved = toolsProps?.toolsOpen && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId;\n const activeDrawer = combinedDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : toolsProps.toolsWidth;\n const minDrawerSize = Math.min(activeDrawer?.defaultSize ?? 290, 290);\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n activeDrawerSize,\n minDrawerSize,\n onActiveDrawerChange,\n onActiveDrawerResize,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/controllers/drawers';\nimport { RuntimeContentWrapper } from '../internal/plugins/helpers';\nimport { sortByPriority } from '../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from './interfaces';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nexport interface DrawersLayout {\n before: Array;\n after: Array;\n}\n\nexport function convertRuntimeDrawers(drawers: Array): DrawersLayout {\n const converted = drawers.map(\n ({\n mountContent,\n unmountContent,\n trigger,\n ...runtimeDrawer\n }): AppLayoutProps.Drawer & { orderPriority?: number } => ({\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: {\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n \n ),\n },\n content: (\n \n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n })\n );\n const sorted = sortByPriority(converted);\n return {\n before: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n after: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useCallback, useEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport interface FocusControlRefs {\n toggle: RefObject;\n close: RefObject;\n slider: RefObject;\n}\n\ninterface FocusControlState {\n refs: FocusControlRefs;\n setFocus: (force?: boolean) => void;\n loseFocus: () => void;\n}\n\nexport function useFocusControl(\n isOpen: boolean,\n restoreFocus = false,\n activeDrawerId?: string | null\n): FocusControlState {\n const refs = {\n toggle: useRef(null),\n close: useRef(null),\n slider: useRef(null),\n };\n const previousFocusedElement = useRef();\n const shouldFocus = useRef(false);\n\n const doFocus = () => {\n if (!shouldFocus.current) {\n return;\n }\n if (isOpen) {\n previousFocusedElement.current =\n document.activeElement !== document.body ? (document.activeElement as HTMLElement) : undefined;\n if (refs.slider.current) {\n refs.slider.current?.focus();\n } else {\n refs.close.current?.focus();\n }\n } else {\n if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {\n previousFocusedElement.current.focus();\n previousFocusedElement.current = undefined;\n } else {\n refs.toggle.current?.focus();\n }\n }\n shouldFocus.current = false;\n };\n\n const setFocus = (force?: boolean) => {\n shouldFocus.current = true;\n if (force && isOpen) {\n doFocus();\n }\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(doFocus, [isOpen, activeDrawerId]);\n\n const loseFocus = useCallback(() => {\n previousFocusedElement.current = undefined;\n }, []);\n\n return {\n refs,\n setFocus,\n loseFocus,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface AppLayoutContextProps {\n stickyOffsetBottom: number;\n stickyOffsetTop: number;\n mobileBarHeight?: number;\n setHasStickyBackground?: (hasBackground: boolean) => void;\n}\n\nexport const defaultValue: AppLayoutContextProps = {\n stickyOffsetTop: 0,\n stickyOffsetBottom: 0,\n mobileBarHeight: 0,\n};\n\nexport const AppLayoutContext = createContext(defaultValue);\n\nexport function useAppLayoutContext() {\n return useContext(AppLayoutContext);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The page height where the page is considered constrained.\n */\nexport const CONSTRAINED_PAGE_HEIGHT = 400;\n\n/**\n * Based on approximate height of breadcrumb, table header, and the first table row\n */\nexport const MAIN_PANEL_MIN_HEIGHT = 250;\n\n/**\n * Based on approximate height of app bar on comfortable mode on mobile.\n */\nexport const CONSTRAINED_MAIN_PANEL_MIN_HEIGHT = 40;\n\n/**\n * Estimate a default split panel size for the first render based on the document size.\n */\nexport function getSplitPanelDefaultSize(position: 'side' | 'bottom') {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n }\n return position === 'side' ? document.documentElement.clientWidth / 3 : document.documentElement.clientHeight / 2;\n}\n\nexport function getLimitedValue(min: number, value: number, max: number) {\n if (min > max) {\n return min;\n }\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\n\nexport interface ContentWrapperProps {\n className?: string;\n contentType: AppLayoutProps.ContentType;\n children?: React.ReactNode;\n isMobile: boolean;\n navigationPadding: boolean;\n toolsPadding: boolean;\n disablePaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n}\n\nconst ContentWrapper = React.forwardRef(\n (\n {\n className,\n contentType,\n children,\n toolsPadding,\n disablePaddings,\n navigationPadding,\n isMobile,\n contentWidthStyles,\n }: ContentWrapperProps,\n ref: React.Ref\n ) => {\n if (disablePaddings) {\n return (\n
    \n {children}\n
    \n );\n }\n return (\n \n
    \n {children}\n
    \n
    \n );\n }\n);\n\nexport default ContentWrapper;\n", "\n import './styles.scoped.css';\n export default {\n \"content-wrapper\": \"awsui_content-wrapper_zycdx_1ocfz_103\",\n \"content-wrapper-mobile\": \"awsui_content-wrapper-mobile_zycdx_1ocfz_107\",\n \"content-type-dashboard\": \"awsui_content-type-dashboard_zycdx_1ocfz_112\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { splitItems } from './drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { AppLayoutProps } from '../interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref\n ) => {\n const openButtonWrapperRef = useRef(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n \n onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n \n );\n\n return (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n \n {!isMobile && !hideOpenButton && regularOpenButton}\n \n {!isMobile && isOpen && resizeHandle}\n {\n onToggle(false);\n }}\n />\n {children}\n \n
    \n
    \n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n
    \n \n
    \n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n \n )}\n
    \n \n );\n};\n", "\n import './styles.scoped.css';\n export default {\n \"toggle\": \"awsui_toggle_1uo6m_1740t_103\",\n \"drawer-triggers\": \"awsui_drawer-triggers_1uo6m_1740t_109\",\n \"drawer\": \"awsui_drawer_1uo6m_1740t_109\",\n \"drawer-mobile\": \"awsui_drawer-mobile_1uo6m_1740t_119\",\n \"drawer-closed\": \"awsui_drawer-closed_1uo6m_1740t_122\",\n \"drawer-content\": \"awsui_drawer-content_1uo6m_1740t_129\",\n \"drawer-content-clickable\": \"awsui_drawer-content-clickable_1uo6m_1740t_141\",\n \"drawer-resize-content\": \"awsui_drawer-resize-content_1uo6m_1740t_151\",\n \"drawer-triggers-wrapper\": \"awsui_drawer-triggers-wrapper_1uo6m_1740t_157\",\n \"drawer-trigger\": \"awsui_drawer-trigger_1uo6m_1740t_109\",\n \"drawer-trigger-active\": \"awsui_drawer-trigger-active_1uo6m_1740t_176\",\n \"hide\": \"awsui_hide_1uo6m_1740t_184\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../utils/use-pointer-events';\nimport { useKeyboardEvents } from '../utils/use-keyboard-events';\nimport { SizeControlProps } from '../utils/interfaces';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport { ResizableDrawerProps } from './interfaces';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\nexport const ResizableDrawer = ({\n onResize,\n maxWidth,\n minWidth,\n refs,\n activeDrawer,\n toolsContent,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, width, isMobile } = props;\n\n const clampedWidth = getLimitedValue(minWidth, width, maxWidth);\n const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;\n\n const setSidePanelWidth = (newWidth: number) => {\n const size = getLimitedValue(minWidth, newWidth, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= minWidth) {\n onResize({ size, id });\n }\n };\n\n const drawerRefObject = useRef(null);\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: refs.slider,\n onResize: setSidePanelWidth,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n \n \n \n );\n\n return (\n {resizeHandle}\n }\n ariaLabels={{\n openLabel: activeDrawer?.ariaLabels?.triggerButton,\n mainLabel: activeDrawer?.ariaLabels?.drawerName,\n closeLabel: activeDrawer?.ariaLabels?.closeButton,\n }}\n >\n {toolsContent &&
    {toolsContent}
    }\n {activeDrawer?.id !== TOOLS_DRAWER_ID ? children : null}\n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\nimport styles from '../styles.css.js';\nimport { SizeControlProps } from './interfaces';\n\nexport const usePointerEvents = ({\n position,\n panelRef,\n handleRef,\n onResize,\n hasTransitions = false,\n}: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n panelRef.current.classList.remove(styles['with-motion']);\n\n if (position === 'side') {\n const mouseClientX = event.clientX || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().width / 2;\n const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset;\n\n onResize(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().height / 2;\n const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset;\n\n onResize(height);\n }\n },\n [position, panelRef, handleRef, onResize]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n if (hasTransitions) {\n panelRef.current.classList.add(styles['with-motion']);\n }\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position, hasTransitions]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { KeyCode } from '../../internal/keycode';\nimport { SizeControlProps } from './interfaces';\n\nconst KEYBOARD_SINGLE_STEP_SIZE = 10;\nconst KEYBOARD_MULTIPLE_STEPS_SIZE = 60;\n\nconst getCurrentSize = (panelRef?: React.RefObject) => {\n if (!panelRef || !panelRef.current) {\n return {\n panelHeight: 0,\n panelWidth: 0,\n };\n }\n\n return {\n panelHeight: panelRef.current.clientHeight,\n panelWidth: panelRef.current.clientWidth,\n };\n};\n\nexport const useKeyboardEvents = ({ position, onResize, panelRef }: SizeControlProps) => {\n return (event: React.KeyboardEvent) => {\n let currentSize;\n let maxSize;\n\n const { panelHeight, panelWidth } = getCurrentSize(panelRef);\n\n if (position === 'side') {\n currentSize = panelWidth;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerWidth;\n } else {\n currentSize = panelHeight;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerHeight;\n }\n\n const primaryGrowKey = position === 'bottom' ? KeyCode.up : KeyCode.left;\n const primaryShrinkKey = position === 'bottom' ? KeyCode.down : KeyCode.right;\n const altGrowKey = position === 'bottom' ? KeyCode.right : KeyCode.down;\n const altShrinkKey = position === 'bottom' ? KeyCode.left : KeyCode.up;\n\n let isEventHandled = true;\n switch (event.keyCode) {\n case primaryGrowKey:\n case altGrowKey:\n onResize(currentSize + KEYBOARD_SINGLE_STEP_SIZE);\n\n break;\n case primaryShrinkKey:\n case altShrinkKey:\n onResize(currentSize - KEYBOARD_SINGLE_STEP_SIZE);\n break;\n case KeyCode.pageUp:\n onResize(currentSize + KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.pageDown:\n onResize(currentSize - KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.home:\n onResize(maxSize);\n break;\n case KeyCode.end:\n onResize(0);\n break;\n default:\n isEventHandled = false;\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nconst ResizeHandler = ({ className }: { className?: string }) => (\n \n \n \n \n);\n\nexport default ResizeHandler;\n", "\n import './styles.scoped.css';\n export default {\n \"drawer\": \"awsui_drawer_1r9lg_5jcsd_201\",\n \"refresh\": \"awsui_refresh_1r9lg_5jcsd_201\",\n \"animating\": \"awsui_animating_1r9lg_5jcsd_215\",\n \"preference-icon--layout-border\": \"awsui_preference-icon--layout-border_1r9lg_5jcsd_238\",\n \"preference-icon--layout-background\": \"awsui_preference-icon--layout-background_1r9lg_5jcsd_242\",\n \"preference-icon--layout-header\": \"awsui_preference-icon--layout-header_1r9lg_5jcsd_245\",\n \"preference-icon--border\": \"awsui_preference-icon--border_1r9lg_5jcsd_248\",\n \"preference-icon--primary-button\": \"awsui_preference-icon--primary-button_1r9lg_5jcsd_252\",\n \"preference-icon--secondary\": \"awsui_preference-icon--secondary_1r9lg_5jcsd_255\",\n \"preference-icon--disabled-element\": \"awsui_preference-icon--disabled-element_1r9lg_5jcsd_258\",\n \"preference-icon--separator\": \"awsui_preference-icon--separator_1r9lg_5jcsd_261\",\n \"preference-icon--focus-text\": \"awsui_preference-icon--focus-text_1r9lg_5jcsd_264\",\n \"preference-icon-refresh--layout-top\": \"awsui_preference-icon-refresh--layout-top_1r9lg_5jcsd_268\",\n \"preference-icon-refresh--layout-main\": \"awsui_preference-icon-refresh--layout-main_1r9lg_5jcsd_271\",\n \"preference-icon-refresh--primary\": \"awsui_preference-icon-refresh--primary_1r9lg_5jcsd_274\",\n \"preference-icon-refresh--disabled\": \"awsui_preference-icon-refresh--disabled_1r9lg_5jcsd_277\",\n \"preference-icon-refresh--column-header\": \"awsui_preference-icon-refresh--column-header_1r9lg_5jcsd_280\",\n \"preference-icon-refresh--window\": \"awsui_preference-icon-refresh--window_1r9lg_5jcsd_283\",\n \"preference-icon-refresh--secondary\": \"awsui_preference-icon-refresh--secondary_1r9lg_5jcsd_287\",\n \"preference-icon-refresh--default\": \"awsui_preference-icon-refresh--default_1r9lg_5jcsd_290\",\n \"preference-icon-refresh--separator\": \"awsui_preference-icon-refresh--separator_1r9lg_5jcsd_293\",\n \"preference-icon-refresh--input-default\": \"awsui_preference-icon-refresh--input-default_1r9lg_5jcsd_296\",\n \"preference-icon-refresh--heading\": \"awsui_preference-icon-refresh--heading_1r9lg_5jcsd_299\",\n \"root\": \"awsui_root_1r9lg_5jcsd_303\",\n \"preferences-button\": \"awsui_preferences-button_1r9lg_5jcsd_338\",\n \"close-button\": \"awsui_close-button_1r9lg_5jcsd_342\",\n \"drawer-closed\": \"awsui_drawer-closed_1r9lg_5jcsd_354\",\n \"drawer-content-side\": \"awsui_drawer-content-side_1r9lg_5jcsd_359\",\n \"drawer-content-bottom\": \"awsui_drawer-content-bottom_1r9lg_5jcsd_375\",\n \"position-bottom\": \"awsui_position-bottom_1r9lg_5jcsd_381\",\n \"position-side\": \"awsui_position-side_1r9lg_5jcsd_408\",\n \"slider\": \"awsui_slider_1r9lg_5jcsd_414\",\n \"slider-side\": \"awsui_slider-side_1r9lg_5jcsd_449\",\n \"slider-wrapper-bottom\": \"awsui_slider-wrapper-bottom_1r9lg_5jcsd_456\",\n \"slider-wrapper-side\": \"awsui_slider-wrapper-side_1r9lg_5jcsd_467\",\n \"open-button\": \"awsui_open-button_1r9lg_5jcsd_478\",\n \"open-button-side\": \"awsui_open-button-side_1r9lg_5jcsd_482\",\n \"slider-icon\": \"awsui_slider-icon_1r9lg_5jcsd_491\",\n \"slider-icon-bottom\": \"awsui_slider-icon-bottom_1r9lg_5jcsd_497\",\n \"slider-icon-side\": \"awsui_slider-icon-side_1r9lg_5jcsd_501\",\n \"pane-header-wrapper-bottom\": \"awsui_pane-header-wrapper-bottom_1r9lg_5jcsd_505\",\n \"drawer-mobile\": \"awsui_drawer-mobile_1r9lg_5jcsd_516\",\n \"drawer-disable-content-paddings\": \"awsui_drawer-disable-content-paddings_1r9lg_5jcsd_520\",\n \"content-bottom\": \"awsui_content-bottom_1r9lg_5jcsd_529\",\n \"pane-bottom-center-align\": \"awsui_pane-bottom-center-align_1r9lg_5jcsd_545\",\n \"pane-bottom-content-nav-padding\": \"awsui_pane-bottom-content-nav-padding_1r9lg_5jcsd_550\",\n \"pane-bottom-content-tools-padding\": \"awsui_pane-bottom-content-tools-padding_1r9lg_5jcsd_554\",\n \"content-bottom-max-width\": \"awsui_content-bottom-max-width_1r9lg_5jcsd_558\",\n \"content-side\": \"awsui_content-side_1r9lg_5jcsd_563\",\n \"pane-header-wrapper-side\": \"awsui_pane-header-wrapper-side_1r9lg_5jcsd_573\",\n \"pane-content-wrapper-side\": \"awsui_pane-content-wrapper-side_1r9lg_5jcsd_579\",\n \"header\": \"awsui_header_1r9lg_5jcsd_586\",\n \"header-text\": \"awsui_header-text_1r9lg_5jcsd_596\",\n \"header-actions\": \"awsui_header-actions_1r9lg_5jcsd_609\",\n \"divider\": \"awsui_divider_1r9lg_5jcsd_617\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const SPLIT_PANEL_MIN_HEIGHT = 160;\nexport const SPLIT_PANEL_MIN_WIDTH = 280;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { useSplitPanelContext } from '../../internal/context/split-panel-context';\n\ninterface SideSplitPanelDrawer {\n displayed: boolean;\n children: React.ReactNode;\n}\n\nexport function SideSplitPanelDrawer({ displayed, children }: SideSplitPanelDrawer) {\n const { isOpen, size, topOffset, bottomOffset } = useSplitPanelContext();\n const width = isOpen && children ? size : undefined;\n return (\n \n
    \n {children}\n
    \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"drawer-displayed\": \"awsui_drawer-displayed_1lh3u_1yevz_103\",\n \"drawer-content\": \"awsui_drawer-content_1lh3u_1yevz_107\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, createContext } from 'react';\nimport { SplitPanelFocusControlRefs } from '../../app-layout/utils/use-split-panel-focus-control';\n\nexport interface SplitPanelSideToggleProps {\n displayed: boolean;\n ariaLabel: string | undefined;\n}\n\nexport interface SplitPanelContextBaseProps {\n topOffset: number;\n bottomOffset: number;\n leftOffset: number;\n rightOffset: number;\n position: 'side' | 'bottom';\n size: number;\n disableContentPaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n contentWrapperPaddings?: {\n closedNav: boolean;\n closedTools: boolean;\n };\n isOpen?: boolean;\n isForcedPosition: boolean;\n onResize: (newSize: number) => void;\n onToggle: () => void;\n onPreferencesChange: (detail: { position: 'side' | 'bottom' }) => void;\n reportSize: (pixels: number) => void;\n reportHeaderHeight: (pixels: number) => void;\n setSplitPanelToggle: (config: SplitPanelSideToggleProps) => void;\n refs: SplitPanelFocusControlRefs;\n}\n\nexport interface SplitPanelContextProps extends SplitPanelContextBaseProps {\n relativeSize: number;\n}\n\nconst SplitPanelContext = createContext(null);\n\nexport const SplitPanelContextProvider = SplitPanelContext.Provider;\n\nexport function useSplitPanelContext() {\n const ctx = useContext(SplitPanelContext);\n if (!ctx) {\n throw new Error('Split panel can only be used inside app layout');\n }\n return ctx;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState } from 'react';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { SplitPanelContextBaseProps, SplitPanelContextProvider } from '../../internal/context/split-panel-context';\nimport { SPLIT_PANEL_MIN_HEIGHT, SPLIT_PANEL_MIN_WIDTH } from './constants';\n\nexport interface SplitPanelProviderProps extends SplitPanelContextBaseProps {\n maxWidth: number;\n getMaxHeight: () => number;\n children?: React.ReactNode;\n}\n\nexport function SplitPanelProvider({\n children,\n size,\n getMaxHeight,\n maxWidth,\n onResize,\n ...rest\n}: SplitPanelProviderProps) {\n const { position, reportSize, isOpen } = rest;\n const [maxHeight, setMaxHeight] = useState(size);\n const minSize = position === 'bottom' ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH;\n const maxSize = position === 'bottom' ? maxHeight : maxWidth;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const relativeSize = ((size - minSize) / (maxSize - minSize)) * 100;\n\n const onResizeWithValidation = (newSize: number) => {\n const maxSize = position === 'side' ? maxWidth : getMaxHeight();\n const isResizeValid = position === 'side' ? maxSize >= SPLIT_PANEL_MIN_WIDTH : maxSize >= SPLIT_PANEL_MIN_HEIGHT;\n if (isOpen && isResizeValid) {\n onResize(getLimitedValue(minSize, newSize, maxSize));\n }\n };\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight()));\n return () => cancelAnimationFrame(handle);\n }, [size, minSize, position, getMaxHeight]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n const handler = () => setMaxHeight(getMaxHeight());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxHeight]);\n\n return (\n \n {children}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DependencyList, RefObject, useEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport type SplitPanelLastInteraction = { type: 'open' } | { type: 'close' } | { type: 'position' };\n\nexport interface SplitPanelFocusControlRefs {\n toggle: RefObject;\n slider: RefObject;\n preferences: RefObject;\n}\ninterface SplitPanelFocusControlState {\n refs: SplitPanelFocusControlRefs;\n setLastInteraction: (interaction: SplitPanelLastInteraction) => void;\n}\n\nexport function useSplitPanelFocusControl(dependencies: DependencyList): SplitPanelFocusControlState {\n const refs = {\n toggle: useRef(null),\n slider: useRef(null),\n preferences: useRef(null),\n };\n const lastInteraction = useRef(null);\n\n useEffect(() => {\n switch (lastInteraction.current?.type) {\n case 'open':\n refs.slider.current?.focus();\n break;\n case 'close':\n refs.toggle.current?.focus();\n break;\n case 'position':\n refs.preferences.current?.focus();\n break;\n }\n lastInteraction.current = null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return {\n refs,\n setLastInteraction: (interaction: SplitPanelLastInteraction) => (lastInteraction.current = interaction),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { AppLayoutInternalsProvider } from './context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport Background from './background';\nimport Breadcrumbs from './breadcrumbs';\nimport Drawers from './drawers';\nimport Header from './header';\nimport Layout from './layout';\nimport Main from './main';\nimport MobileToolbar from './mobile-toolbar';\nimport Navigation from './navigation';\nimport Notifications from './notifications';\nimport SplitPanel from './split-panel';\nimport Tools from './tools';\n\nconst AppLayoutWithRef = React.forwardRef(function AppLayout(\n props: AppLayoutPropsWithDefaults,\n ref: React.Ref\n) {\n return (\n \n \n \n \n\n \n\n \n\n \n\n \n\n
    \n\n
    \n\n \n\n \n \n \n\n \n \n \n \n );\n});\n\nexport default AppLayoutWithRef;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { AppLayoutContext } from '../../internal/context/app-layout-context';\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport useResize from '../utils/use-resize';\nimport styles from './styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport useBackgroundOverlap from './use-background-overlap';\nimport { useDrawers } from '../utils/use-drawers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: number;\n handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n hasStickyBackground: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsElement: React.Ref;\n notificationsHeight: number;\n offsetBottom: number;\n setHasStickyBackground: (value: boolean) => void;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutPropsWithDefaults {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\n\n const [hasStickyBackground, setHasStickyBackground] = useState(false);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean, skipFocusControl?: boolean) {\n setIsToolsOpen(isOpen);\n !skipFocusControl && focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef(null);\n const mainElement = useRef(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n setMainOffsetLeft(mainElement?.current?.offsetLeft ?? 0);\n },\n [placement.width, navigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as MobileToolbar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.contentBoxHeight);\n\n const notificationsHeight = notificationsContainerQuery ?? 0;\n const hasNotificationsContent = notificationsHeight > 0;\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = placement.bottom;\n\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-layout-content-horizontal};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n const contentGapRight = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.width -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth);\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.width,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n \n \n \n {children}\n \n \n \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createContext } from 'react';\n\nexport const DynamicOverlapContext = createContext<(overlapHeight: number) => void>(() => {});\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport { SPLIT_PANEL_MIN_WIDTH, SplitPanelProvider, SplitPanelProviderProps } from '../split-panel';\nimport { AppLayoutProps } from '../interfaces';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * If there is no Split Panel in the AppLayout context then the SplitPanel\n * will pass through the AppLayout children without the context.\n */\nfunction SplitPanel({ children }: React.PropsWithChildren) {\n const {\n footerHeight,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n headerHeight,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n setSplitPanelToggle,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelSize,\n } = useAppLayoutInternals();\n\n const props: SplitPanelProviderProps = {\n bottomOffset: 0,\n getMaxHeight: () => {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n // If the page is likely zoomed in at 200%, allow the split panel to fill the content area.\n return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250;\n },\n maxWidth: typeof document !== 'undefined' ? document.documentElement.clientWidth : Number.POSITIVE_INFINITY,\n isForcedPosition: isSplitPanelForcedPosition,\n isOpen: isSplitPanelOpen,\n leftOffset: 0,\n onPreferencesChange: handleSplitPanelPreferencesChange,\n onResize: handleSplitPanelResize,\n onToggle: handleSplitPanelClick,\n position: splitPanelPosition,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n rightOffset: 0,\n size: splitPanelSize || 0,\n topOffset: 0,\n setSplitPanelToggle,\n refs: splitPanelRefs,\n };\n\n return {children};\n}\n\n/**\n * This is the render function for the SplitPanel when it is in bottom position.\n * The Split Panel container will be another row entry in the grid definition in\n * the Layout component. The start and finish columns will be variable based\n * on the presence and state of the Navigation and Tools components.\n */\nfunction SplitPanelBottom() {\n const {\n disableBodyScroll,\n hasOpenDrawer,\n navigationOpen,\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n \n {(state, transitionEventsRef) => (\n \n \n {splitPanelPosition === 'bottom' && splitPanel}\n \n )}\n \n );\n}\n\n/**\n * This is the render function for the SplitPanel when it is side position.\n * The Split Panel will not be within the grid defined in the Layout component\n * but instead a direct child of the Tools component. The width constraints\n * for this position are computed in the Tools component.\n */\n\n/**\n * This component has no opening animations because it causes lots of rerenders that makes the component lag. *\n */\n\nfunction SplitPanelSide() {\n const {\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelMaxWidth,\n splitPanelControlId,\n isToolsOpen,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n \n {splitPanelPosition === 'side' && splitPanel}\n \n );\n}\n\n/**\n * This logic will determine what the Split Panel position should be. It reconciles the possibility\n * of being in forced position with the current selected position in the settings.\n */\nexport function getSplitPanelPosition(\n isSplitPanelForcedPosition: boolean,\n splitPanelPreferences: AppLayoutProps.SplitPanelPreferences | undefined\n) {\n let splitPanelPosition: AppLayoutProps.SplitPanelPosition = 'bottom';\n\n if (!isSplitPanelForcedPosition && splitPanelPreferences?.position === 'side') {\n splitPanelPosition = 'side';\n }\n\n return splitPanelPosition;\n}\nSplitPanel.Bottom = SplitPanelBottom;\nSplitPanel.Side = SplitPanelSide;\n\nexport default SplitPanel;\n", "\n import './styles.scoped.css';\n export default {\n \"background\": \"awsui_background_hyvsj_1t7qb_99\",\n \"scrolling-background\": \"awsui_scrolling-background_hyvsj_1t7qb_102\",\n \"sticky-background\": \"awsui_sticky-background_hyvsj_1t7qb_108\",\n \"has-sticky-notifications\": \"awsui_has-sticky-notifications_hyvsj_1t7qb_116\",\n \"breadcrumbs\": \"awsui_breadcrumbs_hyvsj_1t7qb_129\",\n \"has-sticky-background\": \"awsui_has-sticky-background_hyvsj_1t7qb_139\",\n \"drawers-container\": \"awsui_drawers-container_hyvsj_1t7qb_151\",\n \"has-open-drawer\": \"awsui_has-open-drawer_hyvsj_1t7qb_162\",\n \"disable-body-scroll\": \"awsui_disable-body-scroll_hyvsj_1t7qb_185\",\n \"drawers-desktop-triggers-container\": \"awsui_drawers-desktop-triggers-container_hyvsj_1t7qb_190\",\n \"has-multiple-triggers\": \"awsui_has-multiple-triggers_hyvsj_1t7qb_231\",\n \"drawers-mobile-triggers-container\": \"awsui_drawers-mobile-triggers-container_hyvsj_1t7qb_241\",\n \"drawers-trigger-content\": \"awsui_drawers-trigger-content_hyvsj_1t7qb_245\",\n \"drawers-trigger-overflow\": \"awsui_drawers-trigger-overflow_hyvsj_1t7qb_259\",\n \"drawers-trigger\": \"awsui_drawers-trigger_hyvsj_1t7qb_245\",\n \"drawer\": \"awsui_drawer_hyvsj_1t7qb_151\",\n \"drawer-content-container\": \"awsui_drawer-content-container_hyvsj_1t7qb_290\",\n \"drawer-close-button\": \"awsui_drawer-close-button_hyvsj_1t7qb_299\",\n \"drawer-content\": \"awsui_drawer-content_hyvsj_1t7qb_290\",\n \"drawer-content-hidden\": \"awsui_drawer-content-hidden_hyvsj_1t7qb_307\",\n \"drawer-slider\": \"awsui_drawer-slider_hyvsj_1t7qb_310\",\n \"is-drawer-open\": \"awsui_is-drawer-open_hyvsj_1t7qb_317\",\n \"content\": \"awsui_content_hyvsj_1t7qb_343\",\n \"layout\": \"awsui_layout_hyvsj_1t7qb_364\",\n \"has-max-content-width\": \"awsui_has-max-content-width_hyvsj_1t7qb_445\",\n \"content-type-dashboard\": \"awsui_content-type-dashboard_hyvsj_1t7qb_460\",\n \"content-type-table\": \"awsui_content-type-table_hyvsj_1t7qb_474\",\n \"content-type-cards\": \"awsui_content-type-cards_hyvsj_1t7qb_474\",\n \"is-overlap-disabled\": \"awsui_is-overlap-disabled_hyvsj_1t7qb_480\",\n \"is-hide-mobile-toolbar\": \"awsui_is-hide-mobile-toolbar_hyvsj_1t7qb_483\",\n \"has-content-gap-left\": \"awsui_has-content-gap-left_hyvsj_1t7qb_515\",\n \"has-content-gap-right\": \"awsui_has-content-gap-right_hyvsj_1t7qb_518\",\n \"content-first-child-notifications\": \"awsui_content-first-child-notifications_hyvsj_1t7qb_528\",\n \"has-breadcrumbs\": \"awsui_has-breadcrumbs_hyvsj_1t7qb_531\",\n \"content-first-child-header\": \"awsui_content-first-child-header_hyvsj_1t7qb_534\",\n \"has-header\": \"awsui_has-header_hyvsj_1t7qb_534\",\n \"content-first-child-main\": \"awsui_content-first-child-main_hyvsj_1t7qb_552\",\n \"disable-content-paddings\": \"awsui_disable-content-paddings_hyvsj_1t7qb_552\",\n \"has-split-panel\": \"awsui_has-split-panel_hyvsj_1t7qb_589\",\n \"split-panel-position-bottom\": \"awsui_split-panel-position-bottom_hyvsj_1t7qb_589\",\n \"block-body-scroll\": \"awsui_block-body-scroll_hyvsj_1t7qb_605\",\n \"unfocusable\": \"awsui_unfocusable_hyvsj_1t7qb_610\",\n \"container\": \"awsui_container_hyvsj_1t7qb_620\",\n \"is-navigation-open\": \"awsui_is-navigation-open_hyvsj_1t7qb_646\",\n \"is-tools-open\": \"awsui_is-tools-open_hyvsj_1t7qb_649\",\n \"is-split-panel-open\": \"awsui_is-split-panel-open_hyvsj_1t7qb_649\",\n \"split-panel-position-side\": \"awsui_split-panel-position-side_hyvsj_1t7qb_649\",\n \"has-active-drawer\": \"awsui_has-active-drawer_hyvsj_1t7qb_649\",\n \"mobile-toolbar\": \"awsui_mobile-toolbar_hyvsj_1t7qb_658\",\n \"remove-high-contrast-header\": \"awsui_remove-high-contrast-header_hyvsj_1t7qb_675\",\n \"mobile-toolbar-nav\": \"awsui_mobile-toolbar-nav_hyvsj_1t7qb_679\",\n \"mobile-toolbar-breadcrumbs\": \"awsui_mobile-toolbar-breadcrumbs_hyvsj_1t7qb_683\",\n \"mobile-toolbar-tools\": \"awsui_mobile-toolbar-tools_hyvsj_1t7qb_687\",\n \"navigation-container\": \"awsui_navigation-container_hyvsj_1t7qb_696\",\n \"show-navigation\": \"awsui_show-navigation_hyvsj_1t7qb_734\",\n \"animating\": \"awsui_animating_hyvsj_1t7qb_757\",\n \"showButtons\": \"awsui_showButtons_hyvsj_1t7qb_1\",\n \"navigation\": \"awsui_navigation_hyvsj_1t7qb_696\",\n \"openNavigation\": \"awsui_openNavigation_hyvsj_1t7qb_1\",\n \"animated-content\": \"awsui_animated-content_hyvsj_1t7qb_819\",\n \"hide-navigation\": \"awsui_hide-navigation_hyvsj_1t7qb_828\",\n \"notifications\": \"awsui_notifications_hyvsj_1t7qb_838\",\n \"sticky-notifications\": \"awsui_sticky-notifications_hyvsj_1t7qb_844\",\n \"split-panel-bottom\": \"awsui_split-panel-bottom_hyvsj_1t7qb_861\",\n \"position-bottom\": \"awsui_position-bottom_hyvsj_1t7qb_908\",\n \"openSplitPanelBottom\": \"awsui_openSplitPanelBottom_hyvsj_1t7qb_1\",\n \"split-panel-side\": \"awsui_split-panel-side_hyvsj_1t7qb_937\",\n \"position-side\": \"awsui_position-side_hyvsj_1t7qb_950\",\n \"tools-container\": \"awsui_tools-container_hyvsj_1t7qb_972\",\n \"tools\": \"awsui_tools_hyvsj_1t7qb_972\",\n \"openTools\": \"awsui_openTools_hyvsj_1t7qb_1\",\n \"has-tools-form-persistence\": \"awsui_has-tools-form-persistence_hyvsj_1t7qb_1063\",\n \"hide-tools\": \"awsui_hide-tools_hyvsj_1t7qb_1073\",\n \"show-tools\": \"awsui_show-tools_hyvsj_1t7qb_1085\",\n \"has-tools-form\": \"awsui_has-tools-form_hyvsj_1t7qb_1063\",\n \"trigger-badge-wrapper\": \"awsui_trigger-badge-wrapper_hyvsj_1t7qb_1168\",\n \"trigger\": \"awsui_trigger_hyvsj_1t7qb_1168\",\n \"selected\": \"awsui_selected_hyvsj_1t7qb_1242\",\n \"badge\": \"awsui_badge_hyvsj_1t7qb_1262\",\n \"trigger-wrapper\": \"awsui_trigger-wrapper_hyvsj_1t7qb_1266\",\n \"dot\": \"awsui_dot_hyvsj_1t7qb_1277\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect } from 'react';\n\nimport clsx from 'clsx';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from './use-pointer-events';\nimport { useKeyboardEvents } from './use-keyboard-events';\nimport { AppLayoutProps } from '../interfaces';\n\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from '../visual-refresh/styles.css.js';\nimport { FocusControlRefs } from './use-focus-control';\nimport { SizeControlProps } from './interfaces';\n\nexport interface DrawerResizeProps {\n activeDrawer: AppLayoutProps.Drawer | undefined;\n activeDrawerSize: number;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n drawersRefs: FocusControlRefs;\n isToolsOpen: boolean;\n drawersMaxWidth: number;\n drawersMinWidth: number;\n}\n\nfunction useResize(\n drawerRefObject: React.RefObject,\n {\n activeDrawer,\n activeDrawerSize,\n onActiveDrawerResize,\n drawersRefs,\n isToolsOpen,\n drawersMinWidth,\n drawersMaxWidth,\n }: DrawerResizeProps\n) {\n const [relativeSize, setRelativeSize] = useState(0);\n\n const drawerSize = !activeDrawer && !isToolsOpen ? 0 : activeDrawerSize;\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = drawersMaxWidth;\n setRelativeSize(((drawerSize - drawersMinWidth) / (maxSize - drawersMinWidth)) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [drawerSize, drawersMaxWidth, drawersMinWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = drawersMaxWidth;\n const size = getLimitedValue(drawersMinWidth, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (id && maxWidth >= drawersMinWidth) {\n onActiveDrawerResize({ size, id });\n }\n };\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: drawersRefs.slider,\n onResize: setSidePanelWidth,\n hasTransitions: true,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n \n \n \n );\n\n return { resizeHandle:
    {resizeHandle}
    , drawerSize };\n}\n\nexport default useResize;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState } from 'react';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The overlap height has a default set in CSS but can also be dynamically overridden\n * for content types (such as Table and Wizard) that have variable size content in the overlap.\n * If a child component utilizes a sticky header the hasStickyBackground property will determine\n * if the background remains in the same vertical position.\n */\nexport default function useBackgroundOverlap({\n contentHeader,\n disableContentHeaderOverlap,\n layoutElement,\n}: {\n contentHeader: React.ReactNode;\n disableContentHeaderOverlap?: boolean;\n layoutElement: React.Ref;\n}) {\n const hasContentHeader = !!contentHeader;\n\n const [hasBackgroundOverlap, setHasBackgroundOverlap] = useState(hasContentHeader);\n\n const updateBackgroundOverlapHeight = useCallback(\n (height: number) => {\n const hasOverlap = hasContentHeader || height > 0;\n setHasBackgroundOverlap(hasOverlap);\n\n /**\n * React 18 will trigger a paint before the state is correctly updated\n * (see https://github.com/facebook/react/issues/24331).\n * To work around this, we bypass React state updates and imperatively update the custom property on the DOM.\n * An alternative would be to use `queueMicrotask` and `flushSync` in the ResizeObserver callback,\n * but that would have some performance impact as it would delay the render.\n */\n // Layout component uses RefObject, we don't expect a RefCallback\n const element = typeof layoutElement !== 'function' && layoutElement?.current;\n if (!element) {\n return;\n }\n if (disableContentHeaderOverlap || !hasOverlap || height <= 0) {\n element.style.removeProperty(customCssProps.overlapHeight);\n } else {\n element.style.setProperty(customCssProps.overlapHeight, `${height}px`);\n }\n },\n [hasContentHeader, layoutElement, disableContentHeaderOverlap]\n );\n\n return {\n hasBackgroundOverlap,\n updateBackgroundOverlapHeight,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const {\n breadcrumbs,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n stickyNotifications,\n } = useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {\n return null;\n }\n\n return (\n
    \n
    \n\n {!isMobile && hasStickyBackground && (\n \n )}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getGlobalFlag } from './global-flags';\n\nexport const shouldRemoveHighContrastHeader = (): boolean => !!getGlobalFlag('removeHighContrastHeader');\nexport const getContentHeaderClassName = (): string =>\n shouldRemoveHighContrastHeader() ? '' : 'awsui-context-content-header';\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Breadcrumbs() {\n const { breadcrumbs, hasStickyBackground, isMobile } = useAppLayoutInternals();\n\n if (isMobile || !breadcrumbs) {\n return null;\n }\n\n return (\n \n {breadcrumbs}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { InternalButton } from '../../button/internal';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\nimport { useAppLayoutInternals } from './context';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n \n \n \n {!isMobile && }\n \n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && resizeHandle}\n
    \n
    \n {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n
    \n {toolsContent && (\n \n {toolsContent}\n
    \n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n
    {activeDrawerId && activeDrawer?.content}
    \n )}\n \n \n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n \n {visibleItems.map(item => {\n return (\n handleDrawersClick(item.id)}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n selected={item.id === activeDrawerId}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n (\n \n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n />\n )}\n \n \n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n
    \n {visibleItems.map(item => (\n handleDrawersClick(item.id)}\n variant=\"icon\"\n __nativeAttributes={{ 'aria-haspopup': true, 'data-testid': `awsui-app-layout-trigger-${item.id}` }}\n />\n ))}\n {overflowItems.length > 0 && (\n handleDrawersClick(detail.id)}\n />\n )}\n
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport Icon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { shouldRemoveHighContrastHeader } from '../../internal/utils/content-header-utils';\n\nexport interface TriggerButtonProps {\n ariaLabel?: string;\n className?: string;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n ariaExpanded: boolean | undefined;\n ariaControls?: string;\n testId?: string;\n onClick: React.MouseEventHandler;\n selected?: boolean;\n badge?: boolean;\n}\n\nfunction TriggerButton(\n {\n ariaLabel,\n className,\n iconName,\n iconSvg,\n ariaExpanded,\n ariaControls,\n onClick,\n testId,\n badge,\n selected = false,\n }: TriggerButtonProps,\n ref: React.Ref\n) {\n return (\n \n }\n type=\"button\"\n data-testid={testId}\n >\n \n \n \n \n {badge &&
    }\n
    \n );\n}\n\nexport default React.forwardRef(TriggerButton);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Header() {\n const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals();\n\n if (!contentHeader) {\n return null;\n }\n\n return (\n \n {contentHeader}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\ninterface LayoutProps {\n children: React.ReactNode;\n}\n\n/**\n * The layoutElement ref will be used by the resize observers to calculate the offset from\n * the top and bottom of the viewport based on the header and footer elements. This is to\n * ensure the Layout component minimum height will fill 100% of the viewport less those\n * cumulative heights.\n */\nexport default function Layout({ children }: LayoutProps) {\n const {\n breadcrumbs,\n contentHeader,\n contentType,\n disableBodyScroll,\n disableContentPaddings,\n drawersTriggerCount,\n footerHeight,\n hasNotificationsContent,\n hasStickyBackground,\n hasOpenDrawer,\n headerHeight,\n isBackgroundOverlapDisabled,\n isMobile,\n navigationOpen,\n layoutElement,\n layoutWidth,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n notificationsHeight,\n __embeddedViewMode,\n splitPanelPosition,\n stickyNotifications,\n splitPanelDisplayed,\n } = useAppLayoutInternals();\n\n // Determine the first content child so the gap will vertically align with the trigger buttons\n const contentFirstChild = getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile);\n\n // Content gaps on the left and right are used with the minmax function in the CSS grid column definition\n const hasContentGapLeft = navigationOpen || navigationHide;\n const hasContentGapRight = drawersTriggerCount === 0 || hasOpenDrawer;\n\n return (\n 0,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['has-sticky-background']]: hasStickyBackground,\n [styles['has-sticky-notifications']]: stickyNotifications && hasNotificationsContent,\n [styles['is-overlap-disabled']]: isBackgroundOverlapDisabled,\n [styles['is-hide-mobile-toolbar']]: __embeddedViewMode,\n },\n testutilStyles.root\n )}\n ref={layoutElement}\n style={{\n [customCssProps.headerHeight]: `${headerHeight}px`,\n [customCssProps.footerHeight]: `${footerHeight}px`,\n [customCssProps.layoutWidth]: `${layoutWidth}px`,\n [customCssProps.mainOffsetLeft]: `${mainOffsetLeft}px`,\n ...(maxContentWidth && { [customCssProps.maxContentWidth]: `${maxContentWidth}px` }),\n ...(minContentWidth && { [customCssProps.minContentWidth]: `${minContentWidth}px` }),\n [customCssProps.notificationsHeight]: `${notificationsHeight}px`,\n }}\n >\n {children}\n \n );\n}\n\n/*\nThe Notifications, Breadcrumbs, Header, and Main are all rendered in the center\ncolumn of the grid layout. Any of these could be the first child to render in the\ncontent area if the previous siblings do not exist. The grid gap before the first\nchild will be different to ensure vertical alignment with the trigger buttons.\n*/\nfunction getContentFirstChild(\n breadcrumbs: React.ReactNode,\n contentHeader: React.ReactNode,\n hasNotificationsContent: boolean,\n isMobile: boolean\n) {\n let contentFirstChild = 'main';\n\n if (hasNotificationsContent) {\n contentFirstChild = 'notifications';\n } else if (breadcrumbs && !isMobile) {\n contentFirstChild = 'breadcrumbs';\n } else if (contentHeader) {\n contentFirstChild = 'header';\n }\n\n return contentFirstChild;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Main() {\n const {\n content,\n disableContentPaddings,\n footerHeight,\n hasDrawerViewportOverlay,\n navigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n mainElement,\n offsetBottom,\n splitPanelDisplayed,\n splitPanelPosition,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n \n {content}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { InternalButton } from '../../button/internal';\nimport { MobileTriggers as DrawersMobileTriggers } from './drawers';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { shouldRemoveHighContrastHeader } from '../../internal/utils/content-header-utils';\n\nexport default function MobileToolbar() {\n const {\n ariaLabels,\n breadcrumbs,\n drawers,\n handleNavigationClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n __embeddedViewMode,\n isToolsOpen,\n navigationHide,\n navigationRefs,\n toolsHide,\n toolsRefs,\n } = useAppLayoutInternals();\n\n if (\n !isMobile ||\n __embeddedViewMode ||\n (navigationHide && !breadcrumbs && toolsHide && (!drawers || drawers.length === 0))\n ) {\n return null;\n }\n\n return (\n \n {!navigationHide && (\n \n handleNavigationClick(true)}\n variant=\"icon\"\n className={testutilStyles['navigation-toggle']}\n ref={navigationRefs.toggle}\n disabled={hasDrawerViewportOverlay}\n __nativeAttributes={{ 'aria-haspopup': navigationOpen ? undefined : true }}\n />\n \n )}\n\n {breadcrumbs && (\n
    {breadcrumbs}
    \n )}\n\n {drawers ? (\n \n ) : (\n !toolsHide && (\n \n handleToolsClick(true)}\n variant=\"icon\"\n ref={toolsRefs.toggle}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n \n )\n )}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport { InternalButton } from '../../button/internal';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport { findUpUntil } from '../../internal/utils/dom';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n disableBodyScroll,\n handleNavigationClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n isToolsOpen,\n navigation,\n navigationHide,\n navigationRefs,\n navigationWidth,\n toolsHide,\n } = useAppLayoutInternals();\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || (isToolsOpen && !toolsHide));\n\n return (\n \n {(state, transitionEventsRef) => (\n \n {!isMobile && (\n \n handleNavigationClick(true)}\n ref={navigationRefs.toggle}\n />\n \n )}\n\n {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n
    \n
    \n handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationRefs.close}\n />\n
    \n {navigation}\n
    \n \n \n )}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Notifications() {\n const { ariaLabels, hasDrawerViewportOverlay, notifications, notificationsElement, stickyNotifications } =\n useAppLayoutInternals();\n\n if (!notifications) {\n return null;\n }\n\n /**\n * The notificationsElement ref is assigned to an inner div to prevent internal bottom margin\n * from affecting the calculated height, which is used for sticky elements below.\n */\n return (\n \n
    {notifications}
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n disableBodyScroll,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsControlId,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = !!splitPanel && splitPanelPosition === 'side';\n const hasToolsForm = getToolsFormStatus(\n hasSplitPanel && splitPanelDisplayed,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n toolsHide\n );\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;\n\n /**\n * If the drawers property is defined the SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n \n {(state, transitionEventsRef) => (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n \n
    \n
    \n handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n
    \n\n {tools}\n
    \n \n )}\n\n {!isMobile && (\n \n {!toolsHide && (\n handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n \n )}\n \n )}\n
    \n );\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createWidgetizedAppLayout } from './widget';\n\nexport const AppLayoutInternal = createWidgetizedAppLayout();\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AppLayoutProps } from './interfaces';\n\nconst defaultContentTypeState: AppLayoutState = {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n};\n\nconst defaults: Record = {\n default: {\n ...defaultContentTypeState,\n },\n dashboard: {\n ...defaultContentTypeState,\n },\n cards: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n form: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 800,\n },\n table: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n wizard: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 1080,\n },\n};\n\nexport interface AppLayoutState {\n navigationOpen?: boolean;\n minContentWidth: number;\n maxContentWidth?: number | undefined;\n}\n\nexport function applyDefaults(\n contentType: AppLayoutProps.ContentType,\n stateFromProps: Pick,\n isRefresh: boolean\n): AppLayoutState {\n const contentTypeDefaults = isRefresh\n ? { ...defaults[contentType], maxContentWidth: undefined }\n : defaults[contentType];\n\n return {\n maxContentWidth: stateFromProps.maxContentWidth ?? contentTypeDefaults.maxContentWidth,\n minContentWidth: stateFromProps.minContentWidth ?? contentTypeDefaults.minContentWidth,\n navigationOpen: stateFromProps.navigationOpen ?? contentTypeDefaults.navigationOpen,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useObservedElement } from './use-observed-element';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nexport function useAppLayoutPlacement(headerSelector: string, footerSelector: string) {\n const mainElementRef = useRef(null);\n const headerHeight = useObservedElement(headerSelector);\n const footerHeight = useObservedElement(footerSelector);\n const [offsets, setOffsets] = useState({ left: 0, right: 0, width: Number.POSITIVE_INFINITY });\n\n const updatePosition = useCallback(() => {\n if (!mainElementRef.current) {\n return;\n }\n const { left, right, width } = mainElementRef.current.getBoundingClientRect();\n\n // skip reading sizes in JSDOM\n if (width === 0) {\n return;\n }\n\n setOffsets({ left, right: width - right, width });\n }, []);\n\n useEffect(() => {\n window.addEventListener('resize', updatePosition);\n return () => window.removeEventListener('resize', updatePosition);\n }, [updatePosition]);\n\n useResizeObserver(mainElementRef, updatePosition);\n\n return [mainElementRef, { ...offsets, top: headerHeight, bottom: footerHeight }] as const;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { useCallback, useState } from 'react';\n\nexport function useObservedElement(selector: string) {\n const getElement = useCallback(() => {\n return document.querySelector(selector);\n }, [selector]);\n\n const [height, setHeight] = useState(0);\n\n useResizeObserver(getElement, entry => setHeight(entry.borderBoxHeight));\n\n return height;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { AreaChartProps } from './interfaces';\nimport InternalAreaChart from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { AreaChartProps };\n\nfunction AreaChart({\n height = 500,\n xScaleType = 'linear',\n yScaleType = 'linear',\n statusType = 'finished',\n detailPopoverSize = 'medium',\n i18nStrings = {},\n ...props\n}: AreaChartProps) {\n const baseComponentProps = useBaseComponent('AreaChart', {\n props: {\n detailPopoverSize,\n hideLegend: props.hideLegend,\n hideFilter: props.hideFilter,\n fitHeight: props.fitHeight,\n xScaleType,\n yScaleType,\n },\n });\n return (\n \n );\n}\n\napplyDisplayName(AreaChart, 'AreaChart');\n\nexport default AreaChart;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { isDevelopment } from '../internal/is-development';\nimport { getBaseProps } from '../internal/base-component';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\n\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport ChartContainer from './chart-container';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { ChartWrapper } from '../internal/components/chart-wrapper';\n\ntype InternalAreaChartProps = SomeRequired<\n AreaChartProps,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart({\n fitHeight,\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n detailPopoverFooter,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef(null);\n const popoverRef = useRef(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const model = useChartModel({\n fitHeight,\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n \n ) : null\n }\n additionalFilters={showFilters ? additionalFilters : null}\n reserveFilterSpace={!!reserveFilterSpace}\n reserveLegendSpace={!!reserveLegendSpace}\n chartStatus={\n \n }\n chart={\n showChart ? (\n \n ) : null\n }\n legend={\n showLegend ? (\n \n ) : null\n }\n onBlur={onBlur}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\n\nimport { BaseComponentProps } from '../../base-component';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalLink from '../../../link/internal';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../../i18n/context';\n\ninterface ChartStatusContainerProps extends BaseComponentProps {\n statusType: 'loading' | 'finished' | 'error';\n\n empty?: React.ReactNode;\n noMatch?: React.ReactNode;\n\n loadingText?: string;\n errorText?: string;\n recoveryText?: string;\n\n onRecoveryClick?: NonCancelableEventHandler;\n\n // From `getChartStatus`\n isEmpty?: boolean;\n isNoMatch?: boolean;\n showChart?: boolean;\n}\n\nexport function getChartStatus({\n externalData,\n visibleData,\n statusType,\n}: {\n externalData: ReadonlyArray;\n visibleData: ReadonlyArray;\n statusType: 'loading' | 'finished' | 'error';\n}) {\n const isEmpty = !visibleData || visibleData.length === 0;\n const isNoMatch = isEmpty && visibleData.length !== externalData.length;\n const showChart = statusType === 'finished' && !isEmpty;\n return { isEmpty, isNoMatch, showChart };\n}\n\nexport default function ChartStatusContainer({\n statusType,\n errorText,\n loadingText,\n recoveryText,\n noMatch,\n empty,\n onRecoveryClick,\n isNoMatch,\n isEmpty,\n showChart,\n}: ChartStatusContainerProps) {\n const i18n = useInternalI18n('[charts]');\n\n const statusContainer = useMemo(() => {\n const handleRecoveryClick = (event: CustomEvent) => {\n event.preventDefault();\n fireNonCancelableEvent(onRecoveryClick);\n };\n if (statusType === 'error') {\n const renderedRecoveryText = i18n('recoveryText', recoveryText);\n return (\n \n {i18n('errorText', errorText)}{' '}\n {!!renderedRecoveryText && !!onRecoveryClick && (\n \n {renderedRecoveryText}\n \n )}\n \n );\n }\n\n if (statusType === 'loading') {\n return {i18n('loadingText', loadingText)};\n }\n\n if (isNoMatch) {\n return
    {noMatch}
    ;\n }\n\n if (isEmpty) {\n return
    {empty}
    ;\n }\n }, [i18n, statusType, onRecoveryClick, isEmpty, isNoMatch, recoveryText, loadingText, errorText, empty, noMatch]);\n\n return (\n
    \n {!showChart && statusContainer}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport InternalIcon from '../icon/internal';\nimport InternalSpinner from '../spinner/internal';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { IconProps } from '../icon/interfaces';\nimport { SomeRequired } from '../internal/types';\n\nconst typeToIcon: (size: IconProps.Size) => Record = size => ({\n error: ,\n warning: ,\n success: ,\n info: ,\n stopped: ,\n pending: ,\n 'in-progress': ,\n loading: ,\n});\n\nexport interface StatusIndicatorProps extends BaseComponentProps {\n /**\n * Specifies the status type.\n */\n type?: StatusIndicatorProps.Type;\n /**\n * A text fragment that communicates the status.\n */\n children?: React.ReactNode;\n /**\n * Specifies an `aria-label` for the icon. If the status text alone does not fully describe the status,\n * use this to communicate additional context.\n */\n iconAriaLabel?: string;\n /**\n * Specifies an override for the status indicator color.\n */\n colorOverride?: StatusIndicatorProps.Color;\n /**\n * Specifies if the text content should wrap. If you set it to false, it prevents the text from wrapping\n * and truncates it with an ellipsis.\n */\n wrapText?: boolean;\n}\n\nexport interface InternalStatusIndicatorProps\n extends SomeRequired,\n InternalBaseComponentProps {\n /**\n * Play an animation on the error icon when first rendered\n */\n __animate?: boolean;\n\n /**\n * Size of icon.\n */\n __size?: IconProps.Size;\n\n /**\n * The CSS behavior of the status indicator container element.\n */\n __display?: 'inline' | 'inline-block';\n}\n\nexport namespace StatusIndicatorProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Type = 'error' | 'warning' | 'success' | 'info' | 'stopped' | 'pending' | 'in-progress' | 'loading';\n export type Color = 'blue' | 'grey' | 'green' | 'red' | 'yellow';\n}\n\nexport default function StatusIndicator({\n type,\n children,\n iconAriaLabel,\n colorOverride,\n wrapText = true,\n __animate = false,\n __internalRootRef,\n __size = 'normal',\n __display = 'inline-block',\n ...rest\n}: InternalStatusIndicatorProps) {\n const baseProps = getBaseProps(rest);\n return (\n \n \n \n {typeToIcon(__size)[type]}\n {__display === 'inline' && <> }\n
    \n {children}\n \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"icon-shake\": \"awsui_icon-shake_1cbgc_azp03_103\",\n \"awsui-motion-shake-horizontally\": \"awsui_awsui-motion-shake-horizontally_1cbgc_azp03_1\",\n \"container-fade-in\": \"awsui_container-fade-in_1cbgc_azp03_131\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_1cbgc_azp03_1\",\n \"root\": \"awsui_root_1cbgc_azp03_153\",\n \"status-error\": \"awsui_status-error_1cbgc_azp03_162\",\n \"status-warning\": \"awsui_status-warning_1cbgc_azp03_165\",\n \"status-success\": \"awsui_status-success_1cbgc_azp03_168\",\n \"status-info\": \"awsui_status-info_1cbgc_azp03_171\",\n \"status-stopped\": \"awsui_status-stopped_1cbgc_azp03_174\",\n \"status-pending\": \"awsui_status-pending_1cbgc_azp03_177\",\n \"status-in-progress\": \"awsui_status-in-progress_1cbgc_azp03_180\",\n \"status-loading\": \"awsui_status-loading_1cbgc_azp03_183\",\n \"color-override-red\": \"awsui_color-override-red_1cbgc_azp03_186\",\n \"color-override-grey\": \"awsui_color-override-grey_1cbgc_azp03_189\",\n \"color-override-blue\": \"awsui_color-override-blue_1cbgc_azp03_192\",\n \"color-override-green\": \"awsui_color-override-green_1cbgc_azp03_195\",\n \"color-override-yellow\": \"awsui_color-override-yellow_1cbgc_azp03_198\",\n \"container\": \"awsui_container_1cbgc_azp03_131\",\n \"display-inline\": \"awsui_display-inline_1cbgc_azp03_202\",\n \"icon\": \"awsui_icon_1cbgc_azp03_103\",\n \"display-inline-block\": \"awsui_display-inline-block_1cbgc_azp03_210\",\n \"overflow-ellipsis\": \"awsui_overflow-ellipsis_1cbgc_azp03_219\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useRef } from 'react';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport { LinkProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\ntype InternalLinkProps = InternalBaseComponentProps &\n Omit & {\n variant?: LinkProps['variant'] | 'top-navigation' | 'link' | 'recovery';\n };\n\nconst InternalLink = React.forwardRef(\n (\n {\n variant: providedVariant,\n fontSize = 'body-m',\n color = 'normal',\n external = false,\n target,\n href,\n rel,\n ariaLabel,\n externalIconAriaLabel,\n onFollow,\n children,\n __internalRootRef = null,\n ...props\n }: InternalLinkProps,\n ref: React.Ref\n ) => {\n checkSafeUrl('Link', href);\n const isButton = !href;\n const { defaultVariant } = useContext(LinkDefaultVariantContext);\n const variant = providedVariant || defaultVariant;\n const specialStyles = ['top-navigation', 'link', 'recovery'];\n const hasSpecialStyle = specialStyles.indexOf(variant) > -1;\n\n const i18n = useInternalI18n('link');\n const baseProps = getBaseProps(props);\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const uniqueId = useUniqueId('link');\n const linkId = useUniqueId('link-self');\n const infoId = useUniqueId('link-info');\n\n const infoLinkLabelFromContext = useContext(InfoLinkLabelContext);\n\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const fireFunnelEvent = (funnelInteractionId: string) => {\n if (variant === 'info') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.helpPanelInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else if (external) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const fireFollowEvent = (event: React.SyntheticEvent) => {\n if (funnelInteractionId) {\n fireFunnelEvent(funnelInteractionId);\n }\n\n fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event);\n };\n\n const handleLinkClick = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollowEvent(event);\n }\n };\n\n const handleButtonClick = (event: React.MouseEvent) => {\n fireFollowEvent(event);\n };\n\n const handleButtonKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) {\n event.preventDefault();\n fireFollowEvent(event);\n }\n };\n\n const linkRef = useRef(null);\n const isVisualRefresh = useVisualRefresh();\n useForwardFocus(ref, linkRef);\n\n // Visual refresh should only add styles to buttons that don't already have unique styles (e.g. primary/secondary variants)\n const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle;\n\n const sharedProps = {\n id: linkId,\n ...baseProps,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(linkRef, __internalRootRef),\n className: clsx(\n styles.link,\n baseProps.className,\n applyButtonStyles ? styles.button : null,\n styles[getVariantStyle(variant)],\n styles[getFontSizeStyle(variant, fontSize)],\n styles[getColorStyle(variant, color)]\n ),\n 'aria-label': ariaLabel,\n 'aria-labelledby': '',\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n };\n\n if (variant === 'info' && infoLinkLabelFromContext && !ariaLabel) {\n sharedProps['aria-labelledby'] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`;\n }\n\n const renderedExternalIconAriaLabel = i18n('externalIconAriaLabel', externalIconAriaLabel);\n const content = (\n <>\n {children}\n {external && (\n \n  \n \n \n \n \n )}\n {variant === 'info' && (\n \n )}\n \n );\n\n const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : undefined });\n\n if (isButton) {\n return (\n \n {content}\n \n );\n }\n\n return (\n // we dynamically set proper rel in the code above\n // eslint-disable-next-line react/jsx-no-target-blank\n \n {content}\n \n );\n }\n);\n\nfunction getVariantStyle(variant: Exclude) {\n return `variant-${variant.replace(/^awsui-/, '')}`;\n}\n\nfunction getFontSizeStyle(variant: InternalLinkProps['variant'], fontSize: InternalLinkProps['fontSize']) {\n switch (variant) {\n case 'info':\n return 'font-size-body-s';\n case 'awsui-value-large':\n return 'font-size-display-l';\n default:\n return `font-size-${fontSize}`;\n }\n}\n\nfunction getColorStyle(variant: InternalLinkProps['variant'], color: InternalLinkProps['color']) {\n return `color-${variant === 'info' ? 'normal' : color}`;\n}\n\nexport default InternalLink;\n", "\n import './styles.scoped.css';\n export default {\n \"link\": \"awsui_link_4c84z_i6aqa_99\",\n \"variant-secondary\": \"awsui_variant-secondary_4c84z_i6aqa_168\",\n \"variant-primary\": \"awsui_variant-primary_4c84z_i6aqa_203\",\n \"variant-info\": \"awsui_variant-info_4c84z_i6aqa_236\",\n \"variant-value-large\": \"awsui_variant-value-large_4c84z_i6aqa_271\",\n \"variant-top-navigation\": \"awsui_variant-top-navigation_4c84z_i6aqa_303\",\n \"variant-recovery\": \"awsui_variant-recovery_4c84z_i6aqa_336\",\n \"button\": \"awsui_button_4c84z_i6aqa_369\",\n \"color-inverted\": \"awsui_color-inverted_4c84z_i6aqa_404\",\n \"font-size-body-s\": \"awsui_font-size-body-s_4c84z_i6aqa_425\",\n \"font-size-body-m\": \"awsui_font-size-body-m_4c84z_i6aqa_432\",\n \"font-size-heading-xs\": \"awsui_font-size-heading-xs_4c84z_i6aqa_438\",\n \"font-size-heading-s\": \"awsui_font-size-heading-s_4c84z_i6aqa_444\",\n \"font-size-heading-m\": \"awsui_font-size-heading-m_4c84z_i6aqa_451\",\n \"font-size-heading-l\": \"awsui_font-size-heading-l_4c84z_i6aqa_458\",\n \"font-size-heading-xl\": \"awsui_font-size-heading-xl_4c84z_i6aqa_465\",\n \"font-size-display-l\": \"awsui_font-size-display-l_4c84z_i6aqa_472\",\n \"font-size-inherit\": \"awsui_font-size-inherit_4c84z_i6aqa_479\",\n \"icon-wrapper\": \"awsui_icon-wrapper_4c84z_i6aqa_491\",\n \"icon\": \"awsui_icon_4c84z_i6aqa_491\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createContext } from 'react';\n\nexport const InfoLinkLabelContext = createContext(undefined);\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_11n0s_6tm6j_9\",\n \"empty\": \"awsui_empty_11n0s_6tm6j_13\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { memo } from 'react';\n\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from '../model';\nimport ChartFilter from '../../internal/components/chart-filter';\n\nexport default memo(AreaChartFilter) as typeof AreaChartFilter;\n\nfunction AreaChartFilter({\n model,\n filterLabel,\n filterPlaceholder,\n filterSelectedAriaLabel,\n}: {\n model: ChartModel;\n filterLabel?: string;\n filterPlaceholder?: string;\n filterSelectedAriaLabel?: string;\n}) {\n const filterItems = model.allSeries.map(s => {\n const { title, color, markerType } = model.getInternalSeries(s);\n return { label: title, color, type: markerType, datum: s };\n });\n\n return (\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, memo } from 'react';\n\nimport { NonCancelableEventHandler } from '../../events';\nimport InternalFormField from '../../../form-field/internal';\nimport InternalMultiselect from '../../../multiselect/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { MultiselectProps } from '../../../multiselect/interfaces';\nimport SeriesMarker, { ChartSeriesMarkerType } from '../chart-series-marker';\nimport { useInternalI18n } from '../../../i18n/context';\n\nimport styles from './styles.css.js';\n\ninterface I18nStrings {\n filterLabel?: string;\n filterPlaceholder?: string;\n filterSelectedAriaLabel?: string;\n}\n\nexport interface ChartFilterItem {\n label: string;\n color: string;\n type: ChartSeriesMarkerType;\n datum: T;\n}\n\nexport interface ChartFilterProps extends BaseComponentProps {\n series: ReadonlyArray>;\n selectedSeries?: ReadonlyArray;\n onChange: (selectedSeries: ReadonlyArray) => void;\n i18nStrings?: I18nStrings;\n}\n\nexport default memo(ChartFilter) as typeof ChartFilter;\n\nfunction ChartFilter({ series, i18nStrings, selectedSeries, onChange, ...restProps }: ChartFilterProps) {\n const baseProps = getBaseProps(restProps);\n const className = clsx(baseProps.className, styles.root);\n const i18n = useInternalI18n('[charts]');\n\n const defaultOptions = series.map((d, i) => ({\n label: d.label,\n value: '' + i,\n datum: d.datum,\n __customIcon: (\n \n \n \n ),\n }));\n\n const selectedOptions = defaultOptions.filter(option => selectedSeries?.indexOf(option.datum) !== -1);\n\n const updateSelection = useCallback>(\n ({ detail: { selectedOptions } }) => {\n const selectedSeries = defaultOptions\n .filter(option => selectedOptions.indexOf(option) !== -1)\n .map(option => option.datum);\n onChange(selectedSeries);\n },\n [onChange, defaultOptions]\n );\n\n return (\n \n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nimport InternalGrid from '../grid/internal';\nimport InternalIcon from '../icon/internal';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport styles from './styles.css.js';\nimport { InternalFormFieldProps } from './interfaces';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FIELD_ERROR,\n DATA_ATTR_FIELD_LABEL,\n getFieldSlotSeletor,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport LiveRegion from '../internal/components/live-region';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef(null);\n\n return (\n <>\n
    \n
    \n \n \n
    \n
    \n \n {children}\n \n \n\n \n \n );\n}\n\nexport function ConstraintText({\n id,\n hasError,\n children,\n}: {\n id?: string;\n hasError: boolean;\n children: React.ReactNode;\n}) {\n return (\n
    \n {children}\n
    \n );\n}\n\nexport default function InternalFormField({\n controlId,\n stretch = false,\n label,\n info,\n i18nStrings,\n children,\n secondaryControl,\n description,\n constraintText,\n errorText,\n __hideLabel,\n __internalRootRef = null,\n __disableGutters = false,\n ...rest\n}: InternalFormFieldProps) {\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n\n const instanceUniqueId = useUniqueId('formField');\n const generatedControlId = controlId || instanceUniqueId;\n const formFieldId = controlId || generatedControlId;\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const slotIds = getSlotIds(formFieldId, label, description, constraintText, errorText);\n\n const ariaDescribedBy = getAriaDescribedBy(slotIds);\n\n const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh);\n\n const {\n ariaLabelledby: parentAriaLabelledby,\n ariaDescribedby: parentAriaDescribedby,\n invalid: parentInvalid,\n } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!parentInvalid,\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : undefined,\n [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,\n };\n\n useEffect(() => {\n if (funnelInteractionId && errorText && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (__internalRootRef?.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles.error__message}`,\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n \n
    \n {label && (\n \n )}\n \n {!__hideLabel && info && {info}}\n \n
    \n\n {description && (\n
    \n {description}\n
    \n )}\n\n
    \n \n \n {children &&
    {children}
    }\n \n\n {secondaryControl && (\n \n
    {secondaryControl}
    \n
    \n )}\n
    \n
    \n\n {(constraintText || errorText) && (\n
    \n {errorText && (\n \n {errorText}\n \n )}\n {constraintText && (\n \n {constraintText}\n \n )}\n
    \n )}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface FormFieldControlProps {\n /**\n * Specifies the ID of the native form element. You can use it to relate\n * a label element's `for` attribute to this control.\n *\n * It defaults to an automatically generated ID that\n * is provided by its parent form field component.\n */\n controlId?: string;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n}\n\nexport interface FormFieldValidationControlProps extends FormFieldControlProps {\n /**\n * Overrides the invalidation state. Usually the invalid state\n * comes from the parent `FormField`component,\n * however sometimes you need to override its\n * state when you have more than one input within a\n * single form field.\n */\n invalid?: boolean;\n}\n\nexport const FormFieldContext = createContext({});\n\nfunction applyDefault(fields: T, defaults: T, keys: (keyof T)[]) {\n const result = {};\n keys.forEach(key => {\n result[key] = fields[key] === undefined ? defaults[key] : fields[key];\n });\n return result;\n}\n\nexport function useFormFieldContext(props: FormFieldValidationControlProps) {\n const context = useContext(FormFieldContext);\n return applyDefault(props, context, ['invalid', 'controlId', 'ariaLabelledby', 'ariaDescribedby']);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx, { ClassValue } from 'clsx';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport { getBaseProps } from '../internal/base-component';\nimport { Breakpoint, matchBreakpointMapping } from '../internal/breakpoints';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport styles from './styles.css.js';\nimport { GridProps } from './interfaces';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nexport interface InternalGridProps extends GridProps, InternalBaseComponentProps {\n __breakpoint?: Breakpoint | null;\n\n /**\n * The handler that fires when the grid breakpoint changes.\n */\n __responsiveClassName?: (breakpoint: Breakpoint | null) => ClassValue;\n}\n\nconst InternalGrid = React.forwardRef(\n (\n {\n __breakpoint,\n gridDefinition = [],\n disableGutters = false,\n children,\n __responsiveClassName,\n __internalRootRef = null,\n ...restProps\n }: InternalGridProps,\n ref: React.Ref\n ) => {\n let [defaultBreakpoint, defaultRef]: [Breakpoint | null, React.Ref] =\n useContainerBreakpoints(undefined);\n if (__breakpoint !== undefined) {\n defaultBreakpoint = __breakpoint;\n defaultRef = ref;\n }\n\n const baseProps = getBaseProps(restProps);\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n\n if (isDevelopment) {\n const columnCount = gridDefinition.length;\n const childCount = flattenedChildren.length;\n if (columnCount !== childCount) {\n warnOnce(\n 'Grid',\n `The number of children (${childCount}) does not match the number of columns defined (${columnCount}).`\n );\n }\n }\n\n const mergedRef = useMergeRefs(defaultRef, __internalRootRef);\n\n return (\n \n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const key = (child as Record<'key', unknown>).key;\n\n return (\n \n
    {child}
    \n \n );\n })}\n \n );\n }\n);\n\nfunction getColumnClassNames(\n prop: string,\n mapping: undefined | number | GridProps.BreakpointMapping,\n breakpoint: Breakpoint | null\n): string | null {\n if (typeof mapping === 'number') {\n return styles[`${prop}-${mapping}`];\n }\n if (breakpoint === null || mapping === undefined) {\n return null;\n }\n return styles[`${prop}-${matchBreakpointMapping(mapping, breakpoint)}`];\n}\n\nexport default InternalGrid;\n", "\n import './styles.scoped.css';\n export default {\n \"grid\": \"awsui_grid_14yj0_1lwse_99\",\n \"no-gutters\": \"awsui_no-gutters_14yj0_1lwse_138\",\n \"grid-column\": \"awsui_grid-column_14yj0_1lwse_143\",\n \"colspan-1\": \"awsui_colspan-1_14yj0_1lwse_154\",\n \"push-1\": \"awsui_push-1_14yj0_1lwse_158\",\n \"pull-1\": \"awsui_pull-1_14yj0_1lwse_161\",\n \"colspan-2\": \"awsui_colspan-2_14yj0_1lwse_164\",\n \"push-2\": \"awsui_push-2_14yj0_1lwse_168\",\n \"pull-2\": \"awsui_pull-2_14yj0_1lwse_171\",\n \"colspan-3\": \"awsui_colspan-3_14yj0_1lwse_174\",\n \"push-3\": \"awsui_push-3_14yj0_1lwse_178\",\n \"pull-3\": \"awsui_pull-3_14yj0_1lwse_181\",\n \"colspan-4\": \"awsui_colspan-4_14yj0_1lwse_184\",\n \"push-4\": \"awsui_push-4_14yj0_1lwse_188\",\n \"pull-4\": \"awsui_pull-4_14yj0_1lwse_191\",\n \"colspan-5\": \"awsui_colspan-5_14yj0_1lwse_194\",\n \"push-5\": \"awsui_push-5_14yj0_1lwse_198\",\n \"pull-5\": \"awsui_pull-5_14yj0_1lwse_201\",\n \"colspan-6\": \"awsui_colspan-6_14yj0_1lwse_204\",\n \"push-6\": \"awsui_push-6_14yj0_1lwse_208\",\n \"pull-6\": \"awsui_pull-6_14yj0_1lwse_211\",\n \"colspan-7\": \"awsui_colspan-7_14yj0_1lwse_214\",\n \"push-7\": \"awsui_push-7_14yj0_1lwse_218\",\n \"pull-7\": \"awsui_pull-7_14yj0_1lwse_221\",\n \"colspan-8\": \"awsui_colspan-8_14yj0_1lwse_224\",\n \"push-8\": \"awsui_push-8_14yj0_1lwse_228\",\n \"pull-8\": \"awsui_pull-8_14yj0_1lwse_231\",\n \"colspan-9\": \"awsui_colspan-9_14yj0_1lwse_234\",\n \"push-9\": \"awsui_push-9_14yj0_1lwse_238\",\n \"pull-9\": \"awsui_pull-9_14yj0_1lwse_241\",\n \"colspan-10\": \"awsui_colspan-10_14yj0_1lwse_244\",\n \"push-10\": \"awsui_push-10_14yj0_1lwse_248\",\n \"pull-10\": \"awsui_pull-10_14yj0_1lwse_251\",\n \"colspan-11\": \"awsui_colspan-11_14yj0_1lwse_254\",\n \"push-11\": \"awsui_push-11_14yj0_1lwse_258\",\n \"pull-11\": \"awsui_pull-11_14yj0_1lwse_261\",\n \"colspan-12\": \"awsui_colspan-12_14yj0_1lwse_264\",\n \"push-12\": \"awsui_push-12_14yj0_1lwse_268\",\n \"pull-12\": \"awsui_pull-12_14yj0_1lwse_271\",\n \"push-0\": \"awsui_push-0_14yj0_1lwse_274\",\n \"pull-0\": \"awsui_pull-0_14yj0_1lwse_277\",\n \"offset-1\": \"awsui_offset-1_14yj0_1lwse_280\",\n \"offset-2\": \"awsui_offset-2_14yj0_1lwse_283\",\n \"offset-3\": \"awsui_offset-3_14yj0_1lwse_286\",\n \"offset-4\": \"awsui_offset-4_14yj0_1lwse_289\",\n \"offset-5\": \"awsui_offset-5_14yj0_1lwse_292\",\n \"offset-6\": \"awsui_offset-6_14yj0_1lwse_295\",\n \"offset-7\": \"awsui_offset-7_14yj0_1lwse_298\",\n \"offset-8\": \"awsui_offset-8_14yj0_1lwse_301\",\n \"offset-9\": \"awsui_offset-9_14yj0_1lwse_304\",\n \"offset-10\": \"awsui_offset-10_14yj0_1lwse_307\",\n \"offset-11\": \"awsui_offset-11_14yj0_1lwse_310\",\n \"restore-pointer-events\": \"awsui_restore-pointer-events_14yj0_1lwse_314\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { GridProps } from '../grid/interfaces';\n\ninterface FormFieldIds {\n label?: string;\n description?: string;\n constraint?: string;\n error?: string;\n}\n\nfunction makeSlotId(prop: React.ReactNode, formFieldId: string, propName: string): string | undefined {\n if (!prop) {\n return undefined;\n }\n\n return `${formFieldId}-${propName}`;\n}\n\nexport function getSlotIds(\n formFieldId: string,\n label?: React.ReactNode,\n description?: React.ReactNode,\n constraintText?: React.ReactNode,\n errorText?: React.ReactNode\n) {\n const ids: FormFieldIds = {\n label: makeSlotId(label, formFieldId, 'label'),\n description: makeSlotId(description, formFieldId, 'description'),\n constraint: makeSlotId(constraintText, formFieldId, 'constraint'),\n error: makeSlotId(errorText, formFieldId, 'error'),\n };\n\n return ids;\n}\n\nexport function getAriaDescribedBy({ error, description, constraint }: FormFieldIds) {\n const describedByAttributes = [error, description, constraint].filter(e => !!e);\n const describedBy = describedByAttributes.length ? describedByAttributes.join(' ') : undefined;\n return describedBy;\n}\n\nexport function getGridDefinition(stretch: boolean, secondaryControlPresent: boolean, isRefresh: boolean) {\n let columns: Array<{ colspan: GridProps.BreakpointMapping | number }>;\n\n if (stretch) {\n columns = [{ colspan: 12 }, { colspan: 12 }];\n } else if (isRefresh) {\n columns = [{ colspan: { default: 12, xs: 8 } }, { colspan: { default: 12, xs: 4 } }];\n } else {\n columns = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\n }\n\n if (!secondaryControlPresent) {\n return [columns[0]];\n }\n\n return columns;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"error-icon-shake-wrapper\": \"awsui_error-icon-shake-wrapper_14mhv_av9zi_103\",\n \"awsui-motion-shake-horizontally\": \"awsui_awsui-motion-shake-horizontally_14mhv_av9zi_1\",\n \"error-icon-scale-wrapper\": \"awsui_error-icon-scale-wrapper_14mhv_av9zi_130\",\n \"awsui-motion-scale-popup\": \"awsui_awsui-motion-scale-popup_14mhv_av9zi_1\",\n \"error\": \"awsui_error_14mhv_av9zi_103\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_14mhv_av9zi_1\",\n \"root\": \"awsui_root_14mhv_av9zi_174\",\n \"label\": \"awsui_label_14mhv_av9zi_210\",\n \"info\": \"awsui_info_14mhv_av9zi_224\",\n \"description\": \"awsui_description_14mhv_av9zi_229\",\n \"constraint\": \"awsui_constraint_14mhv_av9zi_230\",\n \"hints\": \"awsui_hints_14mhv_av9zi_237\",\n \"constraint-has-error\": \"awsui_constraint-has-error_14mhv_av9zi_238\",\n \"secondary-control\": \"awsui_secondary-control_14mhv_av9zi_242\",\n \"controls\": \"awsui_controls_14mhv_av9zi_246\",\n \"label-hidden\": \"awsui_label-hidden_14mhv_av9zi_246\",\n \"control\": \"awsui_control_14mhv_av9zi_246\",\n \"error__message\": \"awsui_error__message_14mhv_av9zi_264\",\n \"visually-hidden\": \"awsui_visually-hidden_14mhv_av9zi_268\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Prefixes given text with zeros until it reaches the target length.\n */\nexport function padLeftZeros(text: string, length: number): string {\n while (text.length < length) {\n text = `0${text}`;\n }\n return text;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\n\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\n\nimport { useSelect, MenuProps } from '../select/utils/use-select';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport PlainList, { SelectListProps } from '../select/parts/plain-list';\nimport VirtualList from '../select/parts/virtual-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport Filter from '../select/parts/filter';\nimport Trigger from '../select/parts/trigger';\n\nimport InternalTokenGroup from '../token-group/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\n\nimport { MultiselectProps } from './interfaces';\nimport styles from './styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\ntype InternalMultiselectProps = MultiselectProps & InternalBaseComponentProps & { inlineTokens?: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n renderHighlightedAriaLive,\n selectedOptions = [],\n deselectAriaLabel,\n keepOpen = true,\n tokenLimit,\n i18nStrings,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n inlineTokens = false,\n hideTokens = false,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef = null,\n autoFocus,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref\n ) => {\n checkOptionValueField('Multiselect', 'options', options);\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const i18nCommon = useInternalI18n('select');\n const recoveryText = i18nCommon('recoveryText', restProps.recoveryText);\n const errorIconAriaLabel = i18nCommon('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18nCommon('selectedAriaLabel', restProps.selectedAriaLabel);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Multiselect', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n const useInteractiveGroups = true;\n const [filteringValue, setFilteringValue] = useState('');\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n const filtered = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filtered);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [onChange, selectedOptions, filteredOptions]\n );\n\n const rootRef = useRef(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const multiSelectAriaLabelId = useUniqueId('multiselect-arialabel-');\n\n const footerId = useUniqueId('footer');\n\n const scrollToIndex = useRef(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n announceSelected,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: filteredOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: filteredOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\n });\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n onRecoveryClick: handleRecoveryClick,\n errorIconAriaLabel: errorIconAriaLabel,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const filter = (\n \n );\n\n const trigger = (\n \n );\n\n const menuProps: MenuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const showTokens = !hideTokens && !inlineTokens && tokens.length > 0;\n const handleTokenDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n \n \n ) : null\n }\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={true}\n >\n \n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={useInteractiveGroups}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n \n {showTokens && (\n \n )}\n {ariaLabel}\n \n );\n }\n);\n\nexport default InternalMultiselect;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../interfaces';\n\ntype SearchableField = 'value' | 'label' | 'description' | 'labelTag';\ntype SearchableTagField = 'tags' | 'filteringTags';\n\nconst searchableFields: SearchableField[] = ['value', 'label', 'description', 'labelTag'];\n\nexport const matchesString = (value: string | undefined, searchText: string, strictMatching: boolean): boolean => {\n if (!value) {\n return false;\n }\n const index = value.toLowerCase().indexOf(searchText);\n return strictMatching ? index === 0 : index > -1;\n};\n\nconst matchesSingleOption = (dropdownOption: DropdownOption, text: string, strictMatching: boolean): boolean => {\n const searchText = text.toLowerCase();\n\n const option: OptionDefinition = dropdownOption.option;\n const searchStrFields = (attr: SearchableField) => matchesString(option[attr], searchText, strictMatching);\n const searchTagsFields = (attr: SearchableTagField) =>\n option[attr]?.some(value => matchesString(value, searchText, strictMatching));\n\n const searchableTagFields: SearchableTagField[] = ['tags'];\n if (!strictMatching) {\n searchableTagFields.push('filteringTags');\n }\n\n return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields);\n};\n\nexport const filterOptions = (\n options: ReadonlyArray,\n searchText: string,\n strictMatching = false\n): ReadonlyArray => {\n if (searchText === '') {\n return options;\n }\n\n let currentGroup: DropdownOption | null = null;\n let parentMatched = false;\n return options.reduce((acc, option) => {\n if (option.type === 'parent') {\n parentMatched = false;\n currentGroup = option;\n if (matchesSingleOption(option, searchText, strictMatching)) {\n parentMatched = true;\n acc.push(currentGroup);\n }\n return acc;\n }\n if (option.type !== 'child') {\n currentGroup = null;\n parentMatched = false;\n }\n if (parentMatched) {\n acc.push(option);\n } else if (matchesSingleOption(option, searchText, strictMatching)) {\n if (currentGroup) {\n acc.push(currentGroup);\n currentGroup = null;\n }\n acc.push(option);\n }\n return acc;\n }, []);\n};\n\nexport const isInteractive = (option?: DropdownOption) => !!option && !option.disabled && option.type !== 'parent';\n\nexport const isGroupInteractive = (option?: DropdownOption) => !!option && !option.disabled;\n\nexport const isGroup = (option?: OptionDefinition | OptionGroup): option is OptionGroup =>\n !!option && 'options' in option;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport DropdownStatus from '../dropdown-status/index.js';\nimport LiveRegion from '../live-region/index.js';\n\ninterface DropdownFooter {\n content?: React.ReactNode | null;\n hasItems?: boolean;\n id?: string;\n}\n\nconst DropdownFooter: React.FC = ({ content, id, hasItems = true }: DropdownFooter) => (\n
    \n \n {content && {content}}\n \n
    \n);\n\nexport default DropdownFooter;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1afi9_5kqbd_99\",\n \"hidden\": \"awsui_hidden_1afi9_5kqbd_133\",\n \"no-items\": \"awsui_no-items_1afi9_5kqbd_136\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalLink from '../../../link/internal';\n\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../../events';\nimport { usePrevious } from '../../hooks/use-previous';\n\nimport { DropdownStatusProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport { DropdownStatusProps };\n\nexport interface DropdownStatusPropsExtended extends DropdownStatusProps {\n isEmpty?: boolean;\n isNoMatch?: boolean;\n isFiltered?: boolean;\n noMatch?: React.ReactNode;\n filteringResultsText?: string;\n /**\n * Called when the user clicks the recovery button placed at the\n * bottom of the dropdown list in the error state. Use this to\n * retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n /**\n * Determines if retry button should be rendered\n * in case recoveryText was automatically provided by i18n.\n */\n hasRecoveryCallback?: boolean;\n}\n\nfunction DropdownStatus({ children }: { children: React.ReactNode }) {\n return
    {children}
    ;\n}\n\ntype UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n hasRecoveryCallback,\n onRecoveryClick,\n}: DropdownStatusPropsExtended) => DropdownStatusResult;\n\ninterface DropdownStatusResult {\n isSticky: boolean;\n content: React.ReactNode | null;\n}\n\nexport const useDropdownStatus: UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n onRecoveryClick,\n hasRecoveryCallback = false,\n errorIconAriaLabel,\n}) => {\n const previousStatusType = usePrevious(statusType);\n const statusResult: DropdownStatusResult = { isSticky: true, content: null };\n\n if (statusType === 'loading') {\n statusResult.content = {loadingText};\n } else if (statusType === 'error') {\n statusResult.content = (\n \n \n {errorText}\n {' '}\n {!!recoveryText && hasRecoveryCallback && (\n fireNonCancelableEvent(onRecoveryClick)}\n variant=\"recovery\"\n className={styles.recovery}\n >\n {recoveryText}\n \n )}\n \n );\n } else if (isEmpty && empty) {\n statusResult.content = empty;\n } else if (isNoMatch && noMatch) {\n statusResult.content = noMatch;\n } else if (isFiltered && filteringResultsText) {\n statusResult.content = filteringResultsText;\n } else if (statusType === 'finished' && finishedText) {\n statusResult.content = finishedText;\n statusResult.isSticky = false;\n }\n\n return statusResult;\n};\n\nexport default DropdownStatus;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef, useEffect } from 'react';\n\n/**\n * This hook gives the value of any variable from the previous render invocation\n */\nexport const usePrevious = (value: T) => {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_vrgzu_ljki3_99\",\n \"recovery\": \"awsui_recovery_vrgzu_ljki3_137\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionGroup, OptionDefinition, DropdownOption } from '../interfaces';\n\nexport const flattenOptions = (options: ReadonlyArray) => {\n const parentMap = new Map();\n\n const flatOptions = options.reduce((acc, option) => {\n if ('options' in option) {\n const { options, ...rest } = option;\n const parentDropdownOption: DropdownOption = { type: 'parent', option };\n const allOptionsDisabled = options.every(option => option.disabled);\n if (option.disabled || allOptionsDisabled) {\n parentDropdownOption.disabled = true;\n }\n acc.push(parentDropdownOption);\n options.forEach(child => {\n const childDropdownOption: DropdownOption = { type: 'child', option: child };\n if (rest.disabled || child.disabled) {\n childDropdownOption.disabled = true;\n }\n acc.push(childDropdownOption);\n parentMap.set(childDropdownOption, parentDropdownOption);\n });\n } else {\n const dropdownOption: DropdownOption = { option };\n if (option.disabled) {\n dropdownOption.disabled = true;\n }\n acc.push(dropdownOption);\n }\n\n return acc;\n }, []);\n\n return {\n flatOptions,\n parentMap,\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\ninterface ListItem {\n type?: string;\n}\ninterface TestIndexes {\n throughIndex?: number;\n groupIndex?: number;\n inGroupIndex?: number;\n}\nconst testIndexMap = new WeakMap();\n//retrieves the test indexes of the option for the findOption and findOptionInGroup test-utils\nexport const getTestOptionIndexes = (item: T) => testIndexMap.get(item);\nexport const generateTestIndexes = (\n filteredItems: ReadonlyArray,\n getParentGroup: (item: T) => Group | undefined\n) => {\n let throughIndex = 1;\n let groupIndex = 0;\n let inGroupIndex = 1;\n let currentGroup: ListItem | null = null;\n filteredItems.forEach(item => {\n const isGroup = item.type === 'parent';\n const group = isGroup ? item : getParentGroup(item);\n if (group && group !== currentGroup) {\n currentGroup = group;\n groupIndex += 1;\n inGroupIndex = 1;\n }\n if (isGroup) {\n testIndexMap.set(item, { groupIndex });\n } else if (group && item.type === 'child') {\n testIndexMap.set(item, {\n throughIndex: throughIndex++,\n groupIndex,\n inGroupIndex: inGroupIndex++,\n });\n } else if (item.type === 'child' || !item.type) {\n testIndexMap.set(item, { throughIndex: throughIndex++ });\n }\n });\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { flattenOptions } from './flatten-options';\nimport { filterOptions } from './filter-options';\nimport { generateTestIndexes } from '../../options-list/utils/test-indexes';\nimport { SelectProps } from '../../../../select/interfaces';\n\nexport function prepareOptions(\n options: SelectProps.Options,\n filteringType: SelectProps.FilteringType,\n filteringText: string\n) {\n const { flatOptions, parentMap } = flattenOptions(options);\n const filteredOptions = filteringType !== 'auto' ? flatOptions : filterOptions(flatOptions, filteringText);\n generateTestIndexes(filteredOptions, parentMap.get.bind(parentMap));\n return {\n filteredOptions,\n parentMap,\n totalCount: flatOptions.length,\n matchesCount: filteredOptions.length,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { RefObject } from 'react';\nimport { DropdownProps } from '../../internal/components/dropdown/interfaces';\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { isInteractive, isGroupInteractive, isGroup } from '../../internal/components/option/utils/filter-options';\nimport { useEffect, useRef } from 'react';\nimport { useHighlightedOption } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { useOpenState } from '../../internal/components/options-list/utils/use-open-state';\nimport { useMenuKeyboard, useTriggerKeyboard } from '../../internal/components/options-list/utils/use-keyboard';\nimport { getOptionId } from '../../internal/components/options-list/utils/use-ids';\nimport { connectOptionsByValue } from './connect-options';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport { OptionsListProps } from '../../internal/components/options-list';\nimport { FilterProps } from '../parts/filter';\nimport { ItemProps } from '../parts/item';\nimport { usePrevious } from '../../internal/hooks/use-previous';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../../internal/events';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status';\nimport { ButtonTriggerProps } from '../../internal/components/button-trigger';\n\nexport type MenuProps = Omit & { ref: React.RefObject };\nexport type GetOptionProps = (option: DropdownOption, index: number) => ItemProps;\n\ninterface UseSelectProps {\n selectedOptions: ReadonlyArray;\n updateSelectedOption: (option: OptionDefinition) => void;\n options: ReadonlyArray;\n filteringType: string;\n keepOpen?: boolean;\n onBlur?: NonCancelableEventHandler;\n onFocus?: NonCancelableEventHandler;\n externalRef: React.Ref;\n fireLoadItems: (filteringText: string) => void;\n setFilteringValue: (filteringText: string) => void;\n useInteractiveGroups?: boolean;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport interface SelectTriggerProps extends ButtonTriggerProps {\n ref: RefObject;\n}\n\nexport function useSelect({\n selectedOptions,\n updateSelectedOption,\n options,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups = false,\n statusType,\n}: UseSelectProps) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n\n const isHighlightable = (option?: DropdownOption) => !!option && (useInteractiveGroups || option.type !== 'parent');\n\n const filterRef = useRef(null);\n const triggerRef = useRef(null);\n const menuRef = useRef(null);\n const hasFilter = filteringType !== 'none';\n const activeRef = hasFilter ? filterRef : menuRef;\n const __selectedOptions = connectOptionsByValue(options, selectedOptions);\n const __selectedValuesSet = selectedOptions.reduce((selectedValuesSet: Set, item: OptionDefinition) => {\n if (item.value) {\n selectedValuesSet.add(item.value);\n }\n return selectedValuesSet;\n }, new Set());\n const [\n { highlightType, highlightedOption, highlightedIndex },\n {\n moveHighlightWithKeyboard,\n resetHighlightWithKeyboard,\n setHighlightedIndexWithMouse,\n highlightOptionWithKeyboard,\n goHomeWithKeyboard,\n goEndWithKeyboard,\n },\n ] = useHighlightedOption({ options, isHighlightable });\n\n const { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard } = useOpenState({\n onOpen: () => fireLoadItems(''),\n onClose: () => {\n resetHighlightWithKeyboard();\n setFilteringValue('');\n },\n });\n\n const handleFocus = () => {\n fireNonCancelableEvent(onFocus, {});\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, {});\n closeDropdown();\n };\n\n const hasSelectedOption = __selectedOptions.length > 0;\n const menuId = useUniqueId('option-list');\n const dialogId = useUniqueId('dialog');\n const highlightedOptionId = getOptionId(menuId, highlightedIndex);\n\n const selectOption = (option?: DropdownOption) => {\n const optionToSelect = option || highlightedOption;\n if (!optionToSelect || !interactivityCheck(optionToSelect)) {\n return;\n }\n updateSelectedOption(optionToSelect.option);\n if (!keepOpen) {\n triggerRef.current?.focus();\n closeDropdown();\n }\n };\n\n const activeKeyDownHandler = useMenuKeyboard({\n moveHighlight: moveHighlightWithKeyboard,\n selectOption,\n goHome: goHomeWithKeyboard,\n goEnd: goEndWithKeyboard,\n closeDropdown: () => {\n triggerRef.current?.focus();\n closeDropdown();\n },\n preventNativeSpace: !hasFilter,\n });\n\n const triggerKeyDownHandler = useTriggerKeyboard({\n openDropdown: () => openDropdown(true),\n goHome: goHomeWithKeyboard,\n });\n\n const getDropdownProps: () => Pick<\n DropdownProps,\n 'onFocus' | 'onBlur' | 'dropdownContentId' | 'dropdownContentRole'\n > = () => ({\n onFocus: handleFocus,\n onBlur: handleBlur,\n dropdownContentId: dialogId,\n dropdownContentRole: hasFilter ? 'dialog' : undefined,\n });\n\n const getTriggerProps = (disabled = false, autoFocus = false) => {\n const triggerProps: SelectTriggerProps = {\n ref: triggerRef,\n onFocus: () => closeDropdown(),\n autoFocus,\n ariaHasPopup: hasFilter ? 'dialog' : 'listbox',\n ariaControls: isOpen ? (hasFilter ? dialogId : menuId) : undefined,\n };\n if (!disabled) {\n triggerProps.onMouseDown = (event: CustomEvent) => {\n event.preventDefault(); // prevent current focus from blurring as it immediately closes the dropdown\n if (isOpen) {\n triggerRef.current?.focus();\n }\n toggleDropdown();\n };\n triggerProps.onKeyDown = triggerKeyDownHandler;\n }\n return triggerProps;\n };\n\n const getFilterProps = (): Partial => {\n if (!hasFilter) {\n return {};\n }\n\n return {\n ref: filterRef,\n onKeyDown: activeKeyDownHandler,\n onChange: event => {\n setFilteringValue(event.detail.value);\n resetHighlightWithKeyboard();\n },\n __onDelayedInput: event => {\n fireLoadItems(event.detail.value);\n },\n __nativeAttributes: {\n 'aria-activedescendant': highlightedOptionId,\n ['aria-owns']: menuId,\n ['aria-controls']: menuId,\n },\n };\n };\n\n const getMenuProps = () => {\n const menuProps: MenuProps = {\n id: menuId,\n ref: menuRef,\n open: isOpen,\n onMouseUp: itemIndex => {\n if (itemIndex > -1) {\n selectOption(options[itemIndex]);\n }\n },\n onMouseMove: itemIndex => {\n if (itemIndex > -1) {\n setHighlightedIndexWithMouse(itemIndex);\n }\n },\n statusType,\n };\n if (!hasFilter) {\n menuProps.onKeyDown = activeKeyDownHandler;\n menuProps.nativeAttributes = {\n 'aria-activedescendant': highlightedOptionId,\n };\n }\n return menuProps;\n };\n const getGroupState = (option: OptionGroup) => {\n const totalSelected = option.options.filter(item => !!item.value && __selectedValuesSet.has(item.value)).length;\n const hasSelected = totalSelected > 0;\n const allSelected = totalSelected === option.options.length;\n return {\n selected: hasSelected && allSelected,\n indeterminate: hasSelected && !allSelected,\n };\n };\n\n const getOptionProps = (option: DropdownOption, index: number) => {\n const highlighted = option === highlightedOption;\n const groupState = isGroup(option.option) ? getGroupState(option.option) : undefined;\n const selected = __selectedOptions.indexOf(option) > -1 || !!groupState?.selected;\n const nextOption = options[index + 1]?.option;\n const isNextSelected =\n !!nextOption && isGroup(nextOption)\n ? getGroupState(nextOption).selected\n : __selectedOptions.indexOf(options[index + 1]) > -1;\n\n const optionProps: any = {\n key: index,\n option,\n highlighted,\n selected,\n isNextSelected,\n indeterminate: !!groupState?.indeterminate,\n ['data-mouse-target']: isHighlightable(option) ? index : -1,\n id: getOptionId(menuId, index),\n };\n\n return optionProps;\n };\n\n const prevOpen = usePrevious(isOpen);\n useEffect(() => {\n // highlight the first selected option, when opening the Select component without filter input\n // keep the focus in the filter input when opening, so that screenreader can recognize the combobox\n if (isOpen && !prevOpen && hasSelectedOption && !hasFilter) {\n if (openedWithKeyboard) {\n highlightOptionWithKeyboard(__selectedOptions[0]);\n } else {\n setHighlightedIndexWithMouse(options.indexOf(__selectedOptions[0]), true);\n }\n }\n }, [\n isOpen,\n __selectedOptions,\n hasSelectedOption,\n setHighlightedIndexWithMouse,\n highlightOptionWithKeyboard,\n openedWithKeyboard,\n options,\n prevOpen,\n hasFilter,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n // dropdown-fit calculations ensure that the dropdown will fit inside the current\n // viewport, so prevent the browser from trying to scroll it into view (e.g. if\n // scroll-padding-top is set on a parent)\n activeRef.current?.focus({ preventScroll: true });\n }\n }, [isOpen, activeRef]);\n\n useForwardFocus(externalRef, triggerRef as React.RefObject);\n const highlightedGroupSelected =\n !!highlightedOption && isGroup(highlightedOption.option) && getGroupState(highlightedOption.option).selected;\n const announceSelected =\n !!highlightedOption && (__selectedOptions.indexOf(highlightedOption) > -1 || highlightedGroupSelected);\n\n return {\n isOpen,\n highlightedOption,\n highlightedIndex,\n highlightType,\n getTriggerProps,\n getDropdownProps,\n getMenuProps,\n getFilterProps,\n getOptionProps,\n highlightOption: highlightOptionWithKeyboard,\n selectOption,\n announceSelected,\n dialogId,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useState } from 'react';\n\nexport class HighlightType {\n constructor(public type: 'keyboard' | 'mouse', public moveFocus: boolean = type === 'keyboard') {}\n}\n\nexport interface HighlightedOptionProps {\n options: readonly OptionType[];\n isHighlightable: (option: OptionType) => boolean;\n}\n\nexport interface HighlightedOptionState {\n highlightType: HighlightType;\n highlightedIndex: number;\n highlightedOption?: OptionType;\n}\n\nexport interface HighlightedOptionHandlers {\n // Mouse handlers\n setHighlightedIndexWithMouse(index: number, moveFocus?: boolean): void;\n // Keyboard handlers\n moveHighlightWithKeyboard(direction: -1 | 1): void;\n highlightOptionWithKeyboard(option: OptionType): void;\n resetHighlightWithKeyboard(): void;\n goHomeWithKeyboard(): void;\n goEndWithKeyboard(): void;\n}\n\nexport function useHighlightedOption({\n options,\n isHighlightable,\n}: HighlightedOptionProps): [HighlightedOptionState, HighlightedOptionHandlers] {\n const [highlightedIndex, setHighlightedIndexState] = useState(-1);\n const [highlightType, setHighlightType] = useState(new HighlightType('keyboard'));\n const setHighlightedIndex = useCallback((index: number, highlightType: HighlightType) => {\n setHighlightedIndexState(index);\n setHighlightType(highlightType);\n }, []);\n\n const highlightedOption =\n options[highlightedIndex] && isHighlightable(options[highlightedIndex]) ? options[highlightedIndex] : undefined;\n\n const moveHighlightFrom = (direction: -1 | 1, startIndex = highlightedIndex, highlightType: HighlightType) => {\n const fromBottomEnd = startIndex === -1 && direction === -1;\n let newIndex = fromBottomEnd ? options.length : startIndex;\n do {\n newIndex += direction;\n } while (options[newIndex] && !isHighlightable(options[newIndex]));\n\n if (options[newIndex]) {\n setHighlightedIndex(newIndex, highlightType);\n }\n };\n\n const moveHighlight = (direction: -1 | 1, highlightType: HighlightType) =>\n moveHighlightFrom(direction, highlightedIndex, highlightType);\n\n const highlightOption = useCallback(\n (option: OptionType, highlightType: HighlightType) => {\n const index = options.indexOf(option);\n setHighlightedIndex(index, highlightType);\n },\n [options, setHighlightedIndex]\n );\n\n return [\n { highlightType, highlightedIndex, highlightedOption },\n {\n setHighlightedIndexWithMouse: (index: number, moveFocus = false) =>\n setHighlightedIndex(index, new HighlightType('mouse', moveFocus)),\n moveHighlightWithKeyboard: (direction: -1 | 1) => moveHighlight(direction, new HighlightType('keyboard')),\n highlightOptionWithKeyboard: (option: OptionType) => highlightOption(option, new HighlightType('keyboard')),\n resetHighlightWithKeyboard: () => setHighlightedIndex(-1, new HighlightType('keyboard')),\n goHomeWithKeyboard: () => moveHighlightFrom(1, -1, new HighlightType('keyboard')),\n goEndWithKeyboard: () => moveHighlightFrom(-1, options.length, new HighlightType('keyboard')),\n },\n ];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\nimport { KeyCode } from '../../../keycode';\nimport { BaseKeyDetail, CancelableEventHandler } from '../../../events';\n\nconst HOME = 36;\nconst END = 35;\n\ninterface UseMenuKeyboard {\n (inputProps: {\n moveHighlight: (direction: -1 | 1, startIndex?: number) => void;\n selectOption: () => void;\n goHome: () => void;\n goEnd: () => void;\n closeDropdown: () => void;\n preventNativeSpace?: boolean;\n }): CancelableEventHandler;\n}\n\nexport const useMenuKeyboard: UseMenuKeyboard = ({\n moveHighlight,\n selectOption,\n goHome,\n goEnd,\n closeDropdown,\n preventNativeSpace = false,\n}) => {\n return useCallback(\n (e: CustomEvent) => {\n switch (e.detail.keyCode) {\n case KeyCode.up:\n e.preventDefault();\n moveHighlight(-1);\n break;\n case KeyCode.down:\n e.preventDefault();\n moveHighlight(1);\n break;\n case HOME:\n goHome();\n break;\n case END:\n goEnd();\n break;\n case KeyCode.escape:\n e.stopPropagation();\n closeDropdown();\n break;\n case KeyCode.enter:\n e.preventDefault();\n selectOption();\n break;\n case KeyCode.space:\n if (preventNativeSpace) {\n e.preventDefault();\n selectOption();\n }\n }\n },\n [moveHighlight, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace]\n );\n};\n\ninterface UseTriggerKeyboard {\n (inputProps: { openDropdown: () => void; goHome: () => void }): CancelableEventHandler;\n}\n\nexport const useTriggerKeyboard: UseTriggerKeyboard = ({ openDropdown, goHome }) => {\n return useCallback(\n (e: CustomEvent) => {\n switch (e.detail.keyCode) {\n case KeyCode.up:\n case KeyCode.down:\n e.preventDefault();\n goHome();\n openDropdown();\n break;\n case KeyCode.space:\n case KeyCode.enter:\n e.preventDefault();\n openDropdown();\n break;\n }\n },\n [openDropdown, goHome]\n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const getOptionId = (menuId: string, index: number) => {\n if (index < 0) {\n return undefined;\n }\n return `${menuId}-option-${index}`;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\n\nexport const connectOptionsByValue = (\n options: ReadonlyArray,\n selectedOptions: ReadonlyArray\n): ReadonlyArray => {\n return (selectedOptions || []).map(selectedOption => {\n for (const dropdownOption of options) {\n if (\n dropdownOption.type !== 'parent' &&\n (dropdownOption.option as OptionDefinition).value === selectedOption.value\n ) {\n return dropdownOption;\n }\n }\n return { option: selectedOption };\n });\n};\n\nexport const findOptionIndex = (options: ReadonlyArray, option: OptionDefinition) => {\n for (let index = 0; index < options.length; index++) {\n const __option = options[index];\n if (__option === option || __option.value === option.value) {\n return index;\n }\n }\n return -1;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport {\n filterOptions,\n isInteractive,\n isGroupInteractive,\n isGroup,\n} from '../../internal/components/option/utils/filter-options';\nimport type { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { useDebounceCallback } from '../../internal/hooks/use-debounce-callback';\n\nexport const isRepeatedChar = (str: string) => str.split('').every(c => c === str[0]);\n\ninterface UseNativeSearchProps {\n isEnabled: boolean;\n options: ReadonlyArray;\n highlightOption: (option: DropdownOption) => void;\n highlightedOption: OptionDefinition | undefined | null;\n useInteractiveGroups?: boolean;\n}\n\nfunction findMatchingOption(\n options: ReadonlyArray,\n searchText: string,\n currentHighlight: OptionDefinition | OptionGroup | undefined | null,\n useInteractiveGroups?: boolean\n) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n const filter = (searchText: string) =>\n filterOptions(options, searchText, true).filter(option => interactivityCheck(option));\n const matchingOptions = filter(searchText);\n\n if (matchingOptions.length === 1) {\n return matchingOptions[0];\n }\n\n // Hit the same char over and over, we assume they want to cycle through\n if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) {\n const matchingOptions = filter(searchText[0]);\n\n if (matchingOptions.length > 0) {\n //handling OptionGroups when useInteractiveGroups is set\n let active: number = isGroup(currentHighlight)\n ? matchingOptions.map(({ option }) => option).indexOf(currentHighlight)\n : matchingOptions\n .map(({ option }) => (option as OptionDefinition).value)\n .indexOf((currentHighlight as OptionDefinition).value);\n\n // Pick the next thing (if something with this prefix wasn't selected\n // we'll end up with the first option)\n active += 1;\n active = active % matchingOptions.length;\n return matchingOptions[active];\n }\n }\n\n // We have multiple things that start with this prefix. Based on the\n // behavior of native select, this is considered after the repeated case\n if (matchingOptions.length > 0) {\n return matchingOptions[0];\n }\n return null;\n}\n\nexport function useNativeSearch({\n isEnabled,\n options,\n highlightOption,\n highlightedOption,\n useInteractiveGroups,\n}: UseNativeSearchProps) {\n const value = useRef('');\n\n const delayedResetValue = useDebounceCallback(() => (value.current = ''), 500);\n\n return (event: React.KeyboardEvent) => {\n if (!isEnabled) {\n return;\n }\n\n const { key } = event;\n\n if (!key || key.length !== 1) {\n return;\n }\n\n delayedResetValue();\n const newValue = value.current + key;\n value.current = newValue;\n\n const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups);\n if (nextHighlight) {\n highlightOption(nextHighlight);\n }\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useRef } from 'react';\nimport debounce from '../../debounce';\n\nexport function useDebounceCallback void>(callback: T, delay?: number): T {\n const callbackRef = useRef();\n callbackRef.current = callback;\n\n // ESLint rule requires an inline function which we cannot provide here\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n debounce(\n ((...args) => {\n if (callbackRef.current) {\n callbackRef.current(...args);\n }\n }) as T,\n delay\n ),\n []\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { SelectProps } from '../interfaces';\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status';\n\ninterface UseLoadItemsProps {\n onLoadItems: SelectProps['onLoadItems'];\n options: ReadonlyArray;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport const useLoadItems = ({ onLoadItems, options, statusType }: UseLoadItemsProps) => {\n const prevFilteringText = useRef(undefined);\n\n const fireLoadItems = (filteringText: string) => {\n if (prevFilteringText.current === filteringText) {\n return;\n }\n prevFilteringText.current = filteringText;\n fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false });\n };\n\n const handleLoadMore = () => {\n const firstPage = options.length === 0;\n statusType === 'pending' &&\n fireNonCancelableEvent(onLoadItems, {\n firstPage,\n samePage: false,\n filteringText: prevFilteringText.current || '',\n });\n };\n\n const handleRecoveryClick = () =>\n fireNonCancelableEvent(onLoadItems, {\n firstPage: false,\n samePage: true,\n filteringText: prevFilteringText.current || '',\n });\n\n return {\n fireLoadItems,\n handleLoadMore,\n handleRecoveryClick,\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { SelectProps } from '../interfaces';\nimport { useEffect, useRef } from 'react';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement