{"version":3,"file":"static/chunks/3270-ac9513ea690942d2.js","mappings":"mHAEA,yBACA,YACA,gCACA,8BACA,gBACA,4BACA,sCACA,8BACA,wCACA,sBACA,sBACA,8CACA,wEACA,0EACA,8DACA,4CACA,oDACA,4CACA,sCACA,4DACA,4EACA,wEACA,8BACA,gDACA,0EACA,uDACA,CAAC,UAAgE,EACjE,OACA,mBACA,0CACA,CAAK,CACL,kBACA,0FACA,CAAK,CACL,WACA,kCACA,CAAK,CACL,iBACA,8CACA,CAAK,CACL,sBACA,mDACA,CAAK,CACL,kBACA,+CACA,CAAK,CACL,uBACA,oDACA,CAAK,CACL,cACA,qDACA,CAAK,CACL,cACA,gDACA,CAAK,CACL,iCACA,wDACA,CAAK,CACL,sBACA,qDACA,CAAK,CACL,yBACA,sFACA,CAAK,CACL,kCACA,2GACA,CAAK,CACL,yBACA,8CACA,CAAK,CACL,wCACA,qEACA,CAAK,CACL,6BACA,0DACA,CAAK,CACL,yCACA,kEACA,CAAK,CACL,uCACA,iEACA,CAAK,CACL,kBACA,yBACA,CAAK,CACL,0BACA,8EACA,CAAK,CACL,uCACA,gEACA,CAAK,CACL,2BACA,qCACA,CAAK,CACL,wCACA,0EACA,CAAK,CACL,+BACA,+CACA,CAAK,6DCvFL,aAAsB,uBAA2B,EAAI,kBAAwB,IAC7E,MAA0B,OAAgB,IAC1C,aAAY,+CAAuD,EAEnE,MAA6B,GAAU,IACvC,gBACA,CAAS,IAAqB,EAAG,IAA2B,CAC5D,CAAS,IAAsB,KAAM,EAAY,GAAG,EAAgB,EACpE,CAAS,IAAoB,IAC7B,CAAS,IAA0B,EAAG,IAAW,CACjD,OAA4B,CAAC,IAAmB,eAA0B,CAC1E,OAA8B,CAAC,IAAiB,IAAiB,CAC5D,oBACL,0BACA,CAAK,EACL,OACA,OACA,SAAmB,CAAC,IAAW,SAAa,CAC5C,SACA,KACA,EAEA,EAAsB,OAAY,MAElC,OADA,sBAAqC,IAAqB,IAC1D,CACA,gBCnCA,sBAEA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,EAAS,GACjE,YAA2B,GAAU,CACrC,KACA,CAFqC,aAErC,EDjCA,ECiCgD,GAAW,IAAa,eDhC7D,QAAmB,EAC9B,SAAkB,IAAQ,SAC1B,QACA,CAAK,EC8BL,CAAK,EACL,SACA,MACA,kDACA,CAAK,EACL,GACA,0BACA,qBACA,YACA,4BACA,oBACA,uBAEA,gBACA,CAAY,WADa,CAEzB,CAAY,YACZ,ECvBA,CDoB0C,ECpB1C,aACA,IAAY,WAAyB,EACrC,UAAY,qCAA0C,MAAQ,GAAuB,KACrF,WAAY,IADyE,QACzE,GAAuB,GAA+B,KAC9D,GAAqB,kBADyC,MAGlE,4BACA,MAAc,GAAa,IAAiB,IAAa,EAA9B,KAA8B,EAEzD,oBhBpCA,EgBoCyD,EACzD,wBADmF,UACnF,CACA,sBACA,cACA,sBACA,GAEA,YADA,yCACA,IAGI,GAAqB,GADS,OACqC,EAA0B,MAAxE,GAD2B,eAC6C,KAEjG,CACA,UAAmB,GAAwB,CAC3C,KACA,cACA,CAH2C,UAG3C,CACA,CAAS,EACT,SACA,IhBzCA,QgBkBA,EAAoD,MAwBpD,MAxBmC,iBAAiB,GAwBpD,CACA,2BAA4C,GAA2B,qBACvE,CAAa,CACb,CAFuE,EAEvE,iBACA,kCACa,CACb,0CACA,CAAS,EACT,oCACA,CACA,ECjEA,SAAS,GAAM,GACf,OADe,GACK,GAAD,CAAQ,EAC3B","sources":["webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/types/validation.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/constants.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/StorageError.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/CanceledError.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs","webpack://_N_E/./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/utils/extendedEncodeURIComponent.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/serializeHelpers.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/IntegrityError.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateObjectUrl.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/createRetryDecider.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/constants.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/utils/assertValidationError.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/base.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/getObject.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/utils/resolvePrefix.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/errors/constants.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateBucketOwnerID.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/isInputWithPath.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/resolveIdentityId.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateStorageOperationInput.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/constructContentDisposition.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/utils/logger.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/headObject.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/userAgent.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/getProperties.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/getUrl.mjs","webpack://_N_E/./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/getUrl.mjs"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoSourcePath\"] = \"NoSourcePath\";\n StorageValidationErrorCode[\"NoDestinationPath\"] = \"NoDestinationPath\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"InvalidStorageBucket\"] = \"InvalidStorageBucket\";\n StorageValidationErrorCode[\"InvalidCopyOperationStorageBucket\"] = \"InvalidCopyOperationStorageBucket\";\n StorageValidationErrorCode[\"InvalidStorageOperationPrefixInput\"] = \"InvalidStorageOperationPrefixInput\";\n StorageValidationErrorCode[\"InvalidStorageOperationInput\"] = \"InvalidStorageOperationInput\";\n StorageValidationErrorCode[\"InvalidAWSAccountID\"] = \"InvalidAWSAccountID\";\n StorageValidationErrorCode[\"InvalidStoragePathInput\"] = \"InvalidStoragePathInput\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n StorageValidationErrorCode[\"InvalidLocationCredentialsCacheSize\"] = \"InvalidLocationCredentialsCacheSize\";\n StorageValidationErrorCode[\"LocationCredentialsStoreDestroyed\"] = \"LocationCredentialsStoreDestroyed\";\n StorageValidationErrorCode[\"InvalidS3Uri\"] = \"InvalidS3Uri\";\n StorageValidationErrorCode[\"InvalidCustomEndpoint\"] = \"InvalidCustomEndpoint\";\n StorageValidationErrorCode[\"ForcePathStyleEndpointNotSupported\"] = \"ForcePathStyleEndpointNotSupported\";\n StorageValidationErrorCode[\"DnsIncompatibleBucketName\"] = \"DnsIncompatibleBucketName\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nconst validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoSourcePath]: {\n message: 'Missing source path in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationPath]: {\n message: 'Missing destination path in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationInput]: {\n message: 'Path or key parameter must be specified in the input. Both can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidAWSAccountID]: {\n message: 'Invalid AWS account ID was provided.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationPrefixInput]: {\n message: 'Both path and prefix can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStoragePathInput]: {\n message: 'Input `path` does not allow a leading slash (/).',\n },\n [StorageValidationErrorCode.InvalidLocationCredentialsCacheSize]: {\n message: 'locationCredentialsCacheSize must be a positive integer.',\n },\n [StorageValidationErrorCode.LocationCredentialsStoreDestroyed]: {\n message: `Location-specific credentials store has been destroyed.`,\n },\n [StorageValidationErrorCode.InvalidS3Uri]: {\n message: 'Invalid S3 URI.',\n },\n [StorageValidationErrorCode.InvalidStorageBucket]: {\n message: 'Unable to lookup bucket from provided name in Amplify configuration.',\n },\n [StorageValidationErrorCode.InvalidCopyOperationStorageBucket]: {\n message: 'Missing bucket option in either source or destination.',\n },\n [StorageValidationErrorCode.InvalidCustomEndpoint]: {\n message: 'Invalid S3 custom endpoint.',\n },\n [StorageValidationErrorCode.ForcePathStyleEndpointNotSupported]: {\n message: 'Path style URLs are not supported with S3 Transfer Acceleration.',\n },\n [StorageValidationErrorCode.DnsIncompatibleBucketName]: {\n message: `The bucket name isn't DNS compatible.`,\n },\n};\n\nexport { StorageValidationErrorCode, validationErrorMap };\n//# sourceMappingURL=validation.mjs.map\n","import { AmplifyUrl } from '../../../../../utils/amplifyUrl/index.mjs';\nimport { ALGORITHM_QUERY_PARAM, SHA256_ALGORITHM_IDENTIFIER, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, HOST_HEADER, EXPIRES_QUERY_PARAM, TOKEN_QUERY_PARAM, SIGNATURE_QUERY_PARAM } from './constants.mjs';\nimport { getSigningValues } from './utils/getSigningValues.mjs';\nimport { getSignature } from './utils/getSignature.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.\n *\n * @param presignable `Presignable` object containing at least a url to be presigned with authentication query params.\n * @param presignUrlOptions `PresignUrlOptions` object containing values used to construct the signature.\n * @returns A `URL` with authentication query params which can grant temporary access to AWS resources.\n */\nconst presignUrl = ({ body, method = 'GET', url }, { expiration, ...options }) => {\n const signingValues = getSigningValues(options);\n const { accessKeyId, credentialScope, longDate, sessionToken } = signingValues;\n // create the request to sign\n const presignedUrl = new AmplifyUrl(url);\n Object.entries({\n [ALGORITHM_QUERY_PARAM]: SHA256_ALGORITHM_IDENTIFIER,\n [CREDENTIAL_QUERY_PARAM]: `${accessKeyId}/${credentialScope}`,\n [AMZ_DATE_QUERY_PARAM]: longDate,\n [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n ...(expiration && { [EXPIRES_QUERY_PARAM]: expiration.toString() }),\n ...(sessionToken && { [TOKEN_QUERY_PARAM]: sessionToken }),\n }).forEach(([key, value]) => {\n presignedUrl.searchParams.append(key, value);\n });\n const requestToSign = {\n body,\n headers: { [HOST_HEADER]: url.host },\n method,\n url: presignedUrl,\n };\n // calculate and add the signature to the url\n const signature = getSignature(requestToSign, signingValues);\n presignedUrl.searchParams.append(SIGNATURE_QUERY_PARAM, signature);\n return presignedUrl;\n};\n\nexport { presignUrl };\n//# sourceMappingURL=presignUrl.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst SEND_UPLOAD_PROGRESS_EVENT = 'sendUploadProgress';\nconst SEND_DOWNLOAD_PROGRESS_EVENT = 'sendDownloadProgress';\nconst NETWORK_ERROR_MESSAGE = 'Network Error';\nconst NETWORK_ERROR_CODE = 'ERR_NETWORK';\nconst ABORT_ERROR_MESSAGE = 'Request aborted';\nconst ABORT_ERROR_CODE = 'ERR_ABORTED';\nconst CANCELED_ERROR_MESSAGE = 'canceled';\nconst CANCELED_ERROR_CODE = 'ERR_CANCELED';\nconst CONTENT_SHA256_HEADER = 'x-amz-content-sha256';\n\nexport { ABORT_ERROR_CODE, ABORT_ERROR_MESSAGE, CANCELED_ERROR_CODE, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, NETWORK_ERROR_CODE, NETWORK_ERROR_MESSAGE, SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT };\n//# sourceMappingURL=constants.mjs.map\n","import { getHashedPayload } from '@aws-amplify/core/internals/aws-client-utils';\nimport { CONTENT_SHA256_HEADER } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A middleware that adds the x-amz-content-sha256 header to the request if it is not already present.\n * It's required for S3 requests in browsers where the request body is sent in 1 chunk.\n * @see https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html\n *\n * @internal\n */\nconst contentSha256MiddlewareFactory = () => (next) => async function contentSha256Middleware(request) {\n if (request.headers[CONTENT_SHA256_HEADER]) {\n return next(request);\n }\n else {\n const hash = await getHashedPayload(request.body);\n request.headers[CONTENT_SHA256_HEADER] = hash;\n return next(request);\n }\n};\n\nexport { contentSha256MiddlewareFactory };\n//# sourceMappingURL=contentSha256middleware.mjs.map\n","import { AmplifyError } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass StorageError extends AmplifyError {\n constructor(params) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = StorageError;\n Object.setPrototypeOf(this, StorageError.prototype);\n }\n}\n\nexport { StorageError };\n//# sourceMappingURL=StorageError.mjs.map\n","import { StorageError } from './StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Internal-only class for CanceledError thrown by XHR handler or multipart upload when cancellation is invoked\n * without overwriting behavior.\n *\n * @internal\n */\nclass CanceledError extends StorageError {\n constructor(params = {}) {\n super({\n name: 'CanceledError',\n message: 'Upload is canceled by user',\n ...params,\n });\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = CanceledError;\n Object.setPrototypeOf(this, CanceledError.prototype);\n }\n}\n/**\n * Check if an error is caused by user calling `cancel()` on a upload/download task. If an overwriting error is\n * supplied to `task.cancel(errorOverwrite)`, this function will return `false`.\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nconst isCancelError = (error) => !!error && error instanceof CanceledError;\n\nexport { CanceledError, isCancelError };\n//# sourceMappingURL=CanceledError.mjs.map\n","import { withMemoization } from '@aws-amplify/core/internals/aws-client-utils';\nimport { ConsoleLogger } from '@aws-amplify/core';\nimport { CanceledError } from '../../../../../errors/CanceledError.mjs';\nimport { StorageError } from '../../../../../errors/StorageError.mjs';\nimport { NETWORK_ERROR_MESSAGE, NETWORK_ERROR_CODE, ABORT_ERROR_MESSAGE, ABORT_ERROR_CODE, CANCELED_ERROR_CODE, CANCELED_ERROR_MESSAGE } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('xhr-http-handler');\n/**\n * Base transfer handler implementation using XMLHttpRequest to support upload and download progress events.\n *\n * @param request - The request object.\n * @param options - The request options.\n * @returns A promise that will be resolved with the response object.\n *\n * @internal\n */\nconst xhrTransferHandler = (request, options) => {\n const { url, method, headers, body } = request;\n const { onDownloadProgress, onUploadProgress, responseType, abortSignal } = options;\n return new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n xhr.open(method.toUpperCase(), url.toString());\n Object.entries(headers)\n .filter(([header]) => !FORBIDDEN_HEADERS.includes(header))\n .forEach(([header, value]) => {\n xhr.setRequestHeader(header, value);\n });\n xhr.responseType = responseType;\n if (onDownloadProgress) {\n xhr.addEventListener('progress', event => {\n onDownloadProgress(convertToTransferProgressEvent(event));\n logger.debug(event);\n });\n }\n if (onUploadProgress) {\n xhr.upload.addEventListener('progress', event => {\n onUploadProgress(convertToTransferProgressEvent(event));\n logger.debug(event);\n });\n }\n xhr.addEventListener('error', () => {\n const networkError = new StorageError({\n message: NETWORK_ERROR_MESSAGE,\n name: NETWORK_ERROR_CODE,\n });\n logger.error(NETWORK_ERROR_MESSAGE);\n reject(networkError);\n xhr = null; // clean up request\n });\n // Handle browser request cancellation (as opposed to a manual cancellation)\n xhr.addEventListener('abort', () => {\n // The abort event can be triggered after the error or load event. So we need to check if the xhr is null.\n // When request is aborted by AbortSignal, the promise is rejected in the abortSignal's 'abort' event listener.\n if (!xhr || abortSignal?.aborted)\n return;\n // Handle abort request caused by browser instead of AbortController\n // see: https://github.com/axios/axios/issues/537\n const error = buildHandlerError(ABORT_ERROR_MESSAGE, ABORT_ERROR_CODE);\n logger.error(ABORT_ERROR_MESSAGE);\n reject(error);\n xhr = null; // clean up request\n });\n // Skip handling timeout error since we don't have a timeout\n xhr.addEventListener('readystatechange', () => {\n if (!xhr || xhr.readyState !== xhr.DONE) {\n return;\n }\n const onloadend = () => {\n // The load event is triggered after the error/abort/load event. So we need to check if the xhr is null.\n if (!xhr)\n return;\n const responseHeaders = convertResponseHeaders(xhr.getAllResponseHeaders());\n const { responseType: loadEndResponseType } = xhr;\n const responseBlob = xhr.response;\n const responseText = loadEndResponseType === 'text' ? xhr.responseText : '';\n const bodyMixIn = {\n blob: () => Promise.resolve(responseBlob),\n text: withMemoization(() => loadEndResponseType === 'blob'\n ? readBlobAsText(responseBlob)\n : Promise.resolve(responseText)),\n json: () => Promise.reject(\n // S3 does not support JSON response. So fail-fast here with nicer error message.\n new Error('Parsing response to JSON is not implemented. Please use response.text() instead.')),\n };\n const response = {\n statusCode: xhr.status,\n headers: responseHeaders,\n // The xhr.responseType is only set to 'blob' for streaming binary S3 object data. The streaming data is\n // exposed via public interface of Storage.get(). So we need to return the response as a Blob object for\n // backward compatibility. In other cases, the response payload is only used internally, we return it is\n // {@link ResponseBodyMixin}\n body: (xhr.responseType === 'blob'\n ? Object.assign(responseBlob, bodyMixIn)\n : bodyMixIn),\n };\n resolve(response);\n xhr = null; // clean up request\n };\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n // @see https://github.com/axios/axios/blob/9588fcdec8aca45c3ba2f7968988a5d03f23168c/lib/adapters/xhr.js#L98-L99\n setTimeout(onloadend);\n });\n if (abortSignal) {\n const onCanceled = () => {\n // The abort event is triggered after the error or load event. So we need to check if the xhr is null.\n if (!xhr) {\n return;\n }\n const canceledError = new CanceledError({\n name: CANCELED_ERROR_CODE,\n message: CANCELED_ERROR_MESSAGE,\n });\n reject(canceledError);\n xhr.abort();\n xhr = null;\n };\n abortSignal.aborted\n ? onCanceled()\n : abortSignal.addEventListener('abort', onCanceled);\n }\n if (typeof ReadableStream === 'function' &&\n body instanceof ReadableStream) {\n // This does not matter as previous implementation uses Axios which does not support ReadableStream anyway.\n throw new Error('ReadableStream request payload is not supported.');\n }\n xhr.send(body ?? null);\n });\n};\nconst convertToTransferProgressEvent = (event) => ({\n transferredBytes: event.loaded,\n totalBytes: event.lengthComputable ? event.total : undefined,\n});\nconst buildHandlerError = (message, name) => {\n const error = new Error(message);\n error.name = name;\n return error;\n};\n/**\n * Convert xhr.getAllResponseHeaders() string to a Record. Note that modern browser already returns\n * header names in lowercase.\n * @param xhrHeaders - string of headers returned from xhr.getAllResponseHeaders()\n */\nconst convertResponseHeaders = (xhrHeaders) => {\n if (!xhrHeaders) {\n return {};\n }\n return xhrHeaders\n .split('\\r\\n')\n .reduce((headerMap, line) => {\n const parts = line.split(': ');\n const header = parts.shift();\n const value = parts.join(': ');\n headerMap[header.toLowerCase()] = value;\n return headerMap;\n }, {});\n};\nconst readBlobAsText = (blob) => {\n const reader = new FileReader();\n return new Promise((resolve, reject) => {\n reader.onloadend = () => {\n if (reader.readyState !== FileReader.DONE) {\n return;\n }\n resolve(reader.result);\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsText(blob);\n });\n};\n// To add more forbidden headers as found set by S3. Intentionally NOT list all of them here to save bundle size.\n// https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name\nconst FORBIDDEN_HEADERS = ['host'];\n\nexport { xhrTransferHandler };\n//# sourceMappingURL=xhrTransferHandler.mjs.map\n","import { userAgentMiddlewareFactory, retryMiddlewareFactory, signingMiddlewareFactory } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeTransferHandler } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { contentSha256MiddlewareFactory } from '../contentSha256middleware.mjs';\nimport { xhrTransferHandler } from '../xhrTransferHandler.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * S3 transfer handler for browser and React Native based on XHR. On top of basic transfer handler, it also supports\n * x-amz-content-sha256 header, and request&response process tracking.\n *\n * @internal\n */\nconst s3TransferHandler = composeTransferHandler(xhrTransferHandler, [\n contentSha256MiddlewareFactory,\n userAgentMiddlewareFactory,\n retryMiddlewareFactory,\n signingMiddlewareFactory,\n]);\n\nexport { s3TransferHandler };\n//# sourceMappingURL=xhr.mjs.map\n","import { StorageError } from '../../../../../errors/StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Maps an object to a new object using the provided instructions.\n * The instructions are a map of the returning mapped object's property names to a single instruction of how to map the\n * value from the original object to the new object. There are two types of instructions:\n *\n * 1. A string representing the property name of the original object to map to the new object. The value mapped from\n * the original object will be the same as the value in the new object, and it can ONLY be string.\n *\n * 2. An array of two elements. The first element is the property name of the original object to map to the new object.\n * The second element is a function that takes the value from the original object and returns the value to be mapped to\n * the new object. The function can return any type.\n *\n * Example:\n * ```typescript\n * const input = {\n * Foo: 'foo',\n * BarList: [{value: 'bar1'}, {value: 'bar2'}]\n * }\n * const output = map(input, {\n * someFoo: 'Foo',\n * bar: ['BarList', (barList) => barList.map(bar => bar.value)]\n * baz: 'Baz' // Baz does not exist in input, so it will not be in the output.\n * });\n * // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }\n * ```\n *\n * @param obj The object containing the data to compose mapped object.\n * @param instructions The instructions mapping the object values to the new object.\n * @returns A new object with the mapped values.\n *\n * @internal\n */\nconst map = (obj, instructions) => {\n const result = {};\n for (const [key, instruction] of Object.entries(instructions)) {\n const [accessor, deserializer] = Array.isArray(instruction)\n ? instruction\n : [instruction];\n if (Object.prototype.hasOwnProperty.call(obj, accessor)) {\n result[key] = deserializer\n ? deserializer(obj[accessor])\n : String(obj[accessor]);\n }\n }\n return result;\n};\n/**\n * Deserializes a string to a number. Returns undefined if input is undefined.\n *\n * @internal\n */\nconst deserializeNumber = (value) => value ? Number(value) : undefined;\n/**\n * Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',\n * otherwise false.\n *\n * @internal\n */\nconst deserializeBoolean = (value) => {\n return value ? value === 'true' : undefined;\n};\n/**\n * Deserializes a string to a Date. Returns undefined if input is undefined.\n * It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)\n *\n * @see https://www.epoch101.com/\n * @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6\n * @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1\n *\n * @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight\n * difference among browsers.\n *\n * @internal\n */\nconst deserializeTimestamp = (value) => {\n return value ? new Date(value) : undefined;\n};\n/**\n * Create a function deserializing a string to an enum value. If the string is not a valid enum value, it throws a\n * StorageError.\n *\n * @example\n * ```typescript\n * const deserializeStringEnum = createStringEnumDeserializer(['a', 'b', 'c'] as const, 'FieldName');\n * const deserializedArray = ['a', 'b', 'c'].map(deserializeStringEnum);\n * // deserializedArray = ['a', 'b', 'c']\n *\n * const invalidValue = deserializeStringEnum('d');\n * // Throws InvalidFieldName: Invalid FieldName: d\n * ```\n *\n * @internal\n */\nconst createStringEnumDeserializer = (enumValues, fieldName) => {\n const deserializeStringEnum = (value) => {\n const parsedEnumValue = value\n ? enumValues.find(enumValue => enumValue === value)\n : undefined;\n if (!parsedEnumValue) {\n throw new StorageError({\n name: `Invalid${fieldName}`,\n message: `Invalid ${fieldName}: ${value}`,\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n return parsedEnumValue;\n };\n return deserializeStringEnum;\n};\n/**\n * Function that makes sure the deserializer receives non-empty array.\n *\n * @internal\n */\nconst emptyArrayGuard = (value, deserializer) => {\n if (value === '') {\n return [];\n }\n const valueArray = (Array.isArray(value) ? value : [value]).filter(e => e != null);\n return deserializer(valueArray);\n};\n/**\n * @internal\n */\nconst deserializeMetadata = (headers) => {\n const objectMetadataHeaderPrefix = 'x-amz-meta-';\n const deserialized = Object.keys(headers)\n .filter(header => header.startsWith(objectMetadataHeaderPrefix))\n .reduce((acc, header) => {\n acc[header.replace(objectMetadataHeaderPrefix, '')] = headers[header];\n return acc;\n }, {});\n return Object.keys(deserialized).length > 0 ? deserialized : undefined;\n};\n/**\n * Internal-only method to create a new StorageError from a service error.\n *\n * @internal\n */\nconst buildStorageServiceError = (error, statusCode) => {\n const storageError = new StorageError({\n name: error.name,\n message: error.message,\n });\n if (statusCode === 404) {\n storageError.recoverySuggestion =\n 'Please add the object with this key to the bucket as the key is not found.';\n }\n return storageError;\n};\n/**\n * Internal-only method used for deserializing the parts of a multipart upload.\n *\n * @internal\n */\nconst deserializeCompletedPartList = (input) => input.map(item => map(item, {\n PartNumber: ['PartNumber', deserializeNumber],\n ETag: 'ETag',\n ChecksumCRC32: 'ChecksumCRC32',\n}));\n\nexport { buildStorageServiceError, createStringEnumDeserializer, deserializeBoolean, deserializeCompletedPartList, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map };\n//# sourceMappingURL=deserializeHelpers.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Wraps encodeURIComponent to encode additional characters to fully adhere to RFC 3986.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/86b432c464150069678b25ff88d57c2ca26e75a2/packages/smithy-client/src/extended-encode-uri-component.ts#L7\n *\n * @param uri URI string to encode\n * @returns RFC 3986 encoded string\n *\n * @internal\n */\nconst extendedEncodeURIComponent = (uri) => {\n // Match characters normally not encoded by `encodeURIComponent`\n const extendedCharacters = /[!'()*]/g;\n return encodeURIComponent(uri).replace(extendedCharacters, hexEncode);\n};\nconst hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n\nexport { extendedEncodeURIComponent };\n//# sourceMappingURL=extendedEncodeURIComponent.mjs.map\n","import { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from '../../../../../errors/StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nconst serializeObjectConfigsToHeaders = async (input) => ({\n ...assignStringVariables({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nconst serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(extendedEncodeURIComponent).join('/')}`);\n};\nfunction validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n}\n\nexport { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, validateS3RequiredParameter };\n//# sourceMappingURL=serializeHelpers.mjs.map\n","import { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from './StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass IntegrityError extends StorageError {\n constructor(params = {\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n }) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = IntegrityError;\n Object.setPrototypeOf(this, IntegrityError.prototype);\n }\n}\n\nexport { IntegrityError };\n//# sourceMappingURL=IntegrityError.mjs.map\n","import { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { IntegrityError } from '../../../errors/IntegrityError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction validateObjectUrl({ bucketName, key, objectURL, }) {\n if (!bucketName || !key || !objectURL) {\n throw new IntegrityError();\n }\n const bucketWithDots = bucketName.includes('.');\n const encodedBucketName = extendedEncodeURIComponent(bucketName);\n const encodedKey = key.split('/').map(extendedEncodeURIComponent).join('/');\n const isPathStyleUrl = objectURL.pathname === `/${encodedBucketName}/${encodedKey}`;\n const isSubdomainUrl = objectURL.hostname.startsWith(`${encodedBucketName}.`) &&\n objectURL.pathname === `/${encodedKey}`;\n if (!(isPathStyleUrl || (!bucketWithDots && isSubdomainUrl))) {\n throw new IntegrityError();\n }\n}\n\nexport { validateObjectUrl };\n//# sourceMappingURL=validateObjectUrl.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Drop-in replacement for fast-xml-parser's XmlParser class used in the AWS SDK S3 client XML deserializer. This\n * implementation is not tested against the full xml conformance test suite. It is only tested against the XML responses\n * from S3. This implementation requires the `DOMParser` class in the runtime.\n */\nconst parser = {\n parse: (xmlStr) => {\n const domParser = new DOMParser();\n const xml = domParser.parseFromString(xmlStr, 'text/xml');\n const parsedObj = parseXmlNode(xml);\n const rootKey = Object.keys(parsedObj)[0];\n return parsedObj[rootKey];\n },\n};\nconst parseXmlNode = (node) => {\n if (isDocumentNode(node)) {\n return {\n [node.documentElement.nodeName]: parseXmlNode(node.documentElement),\n };\n }\n if (node.nodeType === Node.TEXT_NODE) {\n return node.nodeValue?.trim();\n }\n if (isElementNode(node)) {\n // Node like foo will be converted to { Location: 'foo' }\n // instead of { Location: { '#text': 'foo' } }.\n if (isTextOnlyElementNode(node)) {\n return node.childNodes[0].nodeValue;\n }\n const nodeValue = {};\n // convert attributes\n for (const attr of node.attributes) {\n if (!isNamespaceAttributeName(attr.nodeName)) {\n nodeValue[attr.nodeName] = attr.nodeValue;\n }\n }\n // convert child nodes\n if (node.children.length > 0) {\n for (const child of node.children) {\n const childValue = parseXmlNode(child);\n if (childValue === undefined) {\n continue;\n }\n const childName = child.nodeName;\n if (nodeValue[childName] === undefined) {\n nodeValue[childName] = childValue;\n }\n else if (Array.isArray(nodeValue[childName])) {\n nodeValue[childName].push(childValue);\n }\n else {\n nodeValue[childName] = [nodeValue[childName], childValue];\n }\n }\n }\n // Return empty element node as empty string instead of `{}`, which is the default behavior of fast-xml-parser.\n return Object.keys(nodeValue).length === 0 ? '' : nodeValue;\n }\n};\nconst isElementNode = (node) => node.nodeType === Node.ELEMENT_NODE;\nconst isDocumentNode = (node) => node.nodeType === Node.DOCUMENT_NODE;\nconst isTextOnlyElementNode = (node) => hasOnlyNamespaceAttributes(node) &&\n node.children.length === 0 &&\n node.firstChild?.nodeType === Node.TEXT_NODE;\nconst hasOnlyNamespaceAttributes = (node) => {\n for (const attr of node.attributes) {\n if (!isNamespaceAttributeName(attr.nodeName)) {\n return false;\n }\n }\n return true;\n};\nconst isNamespaceAttributeName = (name) => name === 'xmlns' || name.startsWith('xmlns:');\n\nexport { parser };\n//# sourceMappingURL=dom.mjs.map\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport '../runtime/s3TransferHandler/fetch.mjs';\nimport { parser } from '../runtime/xmlParser/pureJs.mjs';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Factory creating a parser that parses the JS Error object from the XML\n * response payload.\n *\n * @param input Input object\n * @param input.noErrorWrapping Whether the error code and message are located\n * directly in the root XML element, or in a nested `` element.\n * See: https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#restxml-errors\n *\n * Default to false.\n *\n * @internal\n */\nconst createXmlErrorParser = ({ noErrorWrapping = false, } = {}) => async (response) => {\n if (!response || response.statusCode < 300) {\n return;\n }\n const { statusCode } = response;\n const body = await parseXmlBody(response);\n const errorLocation = noErrorWrapping ? body : body.Error;\n const code = errorLocation?.Code\n ? errorLocation.Code\n : statusCode === 404\n ? 'NotFound'\n : statusCode.toString();\n const message = errorLocation?.message ?? errorLocation?.Message ?? code;\n const error = new Error(message);\n return Object.assign(error, {\n name: code,\n $metadata: parseMetadata(response),\n });\n};\nconst parseXmlBody = async (response) => {\n if (!response.body) {\n // S3 can return 200 without a body indicating failure.\n throw new Error('S3 aborted request.');\n }\n const data = await response.body.text();\n if (data?.length > 0) {\n try {\n return parser.parse(data);\n }\n catch (error) {\n throw new Error(`Failed to parse XML response: ${error}`);\n }\n }\n return {};\n};\n\nexport { createXmlErrorParser, parseXmlBody };\n//# sourceMappingURL=parsePayload.mjs.map\n","import { getRetryDecider } from '@aws-amplify/core/internals/aws-client-utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Factory of a {@link RetryDecider} function.\n *\n * @param errorParser function to parse HTTP response wth XML payload to JS\n * \tError instance.\n * @returns A structure indicating if the response is retryable; And if it is a\n * \tCredentialsExpiredError\n */\nconst createRetryDecider = (errorParser) => async (response, error, middlewareContext) => {\n const defaultRetryDecider = getRetryDecider(errorParser);\n const defaultRetryDecision = await defaultRetryDecider(response, error);\n if (!response) {\n return { retryable: defaultRetryDecision.retryable };\n }\n const parsedError = await errorParser(response);\n const errorCode = parsedError?.name;\n const errorMessage = parsedError?.message;\n const isCredentialsExpired = isCredentialsExpiredError(errorCode, errorMessage);\n return {\n retryable: defaultRetryDecision.retryable ||\n // If we know the previous retry attempt sets isCredentialsExpired in the\n // middleware context, we don't want to retry anymore.\n !!(isCredentialsExpired && !middlewareContext?.isCredentialsExpired),\n isCredentialsExpiredError: isCredentialsExpired,\n };\n};\n// Ref: https://github.com/aws/aws-sdk-js/blob/54829e341181b41573c419bd870dd0e0f8f10632/lib/event_listeners.js#L522-L541\nconst INVALID_TOKEN_ERROR_CODES = [\n 'RequestExpired',\n 'ExpiredTokenException',\n 'ExpiredToken',\n];\n/**\n * Given an error code, returns true if it is related to invalid credentials.\n *\n * @param errorCode String representation of some error.\n * @returns True if given error indicates the credentials used to authorize request\n * are invalid.\n */\nconst isCredentialsExpiredError = (errorCode, errorMessage) => {\n const isExpiredTokenError = !!errorCode && INVALID_TOKEN_ERROR_CODES.includes(errorCode);\n // Ref: https://github.com/aws/aws-sdk-js/blob/54829e341181b41573c419bd870dd0e0f8f10632/lib/event_listeners.js#L536-L539\n const isExpiredSignatureError = !!errorCode &&\n !!errorMessage &&\n errorCode.includes('Signature') &&\n errorMessage.includes('expired');\n return isExpiredTokenError || isExpiredSignatureError;\n};\n\nexport { createRetryDecider };\n//# sourceMappingURL=createRetryDecider.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst LOCAL_TESTING_S3_ENDPOINT = 'http://localhost:20005';\nconst DEFAULT_ACCESS_LEVEL = 'guest';\nconst DEFAULT_PRESIGN_EXPIRATION = 900;\nconst MAX_URL_EXPIRATION = 7 * 24 * 60 * 60 * 1000;\nconst MiB = 1024 * 1024;\nconst GiB = 1024 * MiB;\nconst TiB = 1024 * GiB;\n/**\n * Default part size in MB that is used to determine if an upload task is single part or multi part.\n */\nconst DEFAULT_PART_SIZE = 5 * MiB;\nconst MAX_OBJECT_SIZE = 5 * TiB;\nconst MAX_PARTS_COUNT = 10000;\nconst DEFAULT_QUEUE_SIZE = 4;\nconst UPLOADS_STORAGE_KEY = '__uploadInProgress';\nconst STORAGE_INPUT_PREFIX = 'prefix';\nconst STORAGE_INPUT_KEY = 'key';\nconst STORAGE_INPUT_PATH = 'path';\nconst DEFAULT_DELIMITER = '/';\nconst CHECKSUM_ALGORITHM_CRC32 = 'crc-32';\n\nexport { CHECKSUM_ALGORITHM_CRC32, DEFAULT_ACCESS_LEVEL, DEFAULT_DELIMITER, DEFAULT_PART_SIZE, DEFAULT_PRESIGN_EXPIRATION, DEFAULT_QUEUE_SIZE, LOCAL_TESTING_S3_ENDPOINT, MAX_OBJECT_SIZE, MAX_PARTS_COUNT, MAX_URL_EXPIRATION, STORAGE_INPUT_KEY, STORAGE_INPUT_PATH, STORAGE_INPUT_PREFIX, UPLOADS_STORAGE_KEY };\n//# sourceMappingURL=constants.mjs.map\n","import { validationErrorMap } from '../types/validation.mjs';\nimport { StorageError } from '../StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new StorageError({ name, message, recoverySuggestion });\n }\n}\n\nexport { assertValidationError };\n//# sourceMappingURL=assertValidationError.mjs.map\n","import { getAmplifyUserAgent, AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { jitteredBackoff, getDnsSuffix } from '@aws-amplify/core/internals/aws-client-utils';\nimport { createXmlErrorParser } from '../utils/parsePayload.mjs';\nimport '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { createRetryDecider } from '../utils/createRetryDecider.mjs';\nimport { LOCAL_TESTING_S3_ENDPOINT } from '../../constants.mjs';\nimport { assertValidationError } from '../../../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../../../errors/types/validation.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst DOMAIN_PATTERN = /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;\nconst IP_ADDRESS_PATTERN = /(\\d+\\.){3}\\d+/;\nconst DOTS_PATTERN = /\\.\\./;\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 's3';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region, and input parameters.\n */\nconst endpointResolver = (options, apiInput) => {\n const { region, useAccelerateEndpoint, customEndpoint, forcePathStyle } = options;\n let endpoint;\n // 1. get base endpoint\n if (customEndpoint) {\n if (customEndpoint === LOCAL_TESTING_S3_ENDPOINT) {\n endpoint = new AmplifyUrl(customEndpoint);\n }\n assertValidationError(!customEndpoint.includes('://'), StorageValidationErrorCode.InvalidCustomEndpoint);\n endpoint = new AmplifyUrl(`https://${customEndpoint}`);\n }\n else if (useAccelerateEndpoint) {\n // this ErrorCode isn't expose yet since forcePathStyle param isn't publicly exposed\n assertValidationError(!forcePathStyle, StorageValidationErrorCode.ForcePathStyleEndpointNotSupported);\n endpoint = new AmplifyUrl(`https://s3-accelerate.${getDnsSuffix(region)}`);\n }\n else {\n endpoint = new AmplifyUrl(`https://s3.${region}.${getDnsSuffix(region)}`);\n }\n // 2. inject bucket name\n if (apiInput?.Bucket) {\n assertValidationError(isDnsCompatibleBucketName(apiInput.Bucket), StorageValidationErrorCode.DnsIncompatibleBucketName);\n if (forcePathStyle || apiInput.Bucket.includes('.')) {\n endpoint.pathname = `/${apiInput.Bucket}`;\n }\n else {\n endpoint.host = `${apiInput.Bucket}.${endpoint.host}`;\n }\n }\n return { url: endpoint };\n};\n/**\n * Determines whether a given string is DNS compliant per the rules outlined by\n * S3. Length, capitaization, and leading dot restrictions are enforced by the\n * DOMAIN_PATTERN regular expression.\n * @internal\n *\n * @see https://github.com/aws/aws-sdk-js-v3/blob/f2da6182298d4d6b02e84fb723492c07c27469a8/packages/middleware-bucket-endpoint/src/bucketHostnameUtils.ts#L39-L48\n * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html\n */\nconst isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) &&\n !IP_ADDRESS_PATTERN.test(bucketName) &&\n !DOTS_PATTERN.test(bucketName);\n/**\n * Error parser for the XML payload of S3 data plane error response. The error's\n * `Code` and `Message` locates directly at the XML root element.\n *\n * @example\n * ```\n * \n * \t\n * \t\tNoSuchKey\n * \t\tThe resource you requested does not exist\n * \t\t/mybucket/myfoto.jpg\n * \t\t4442587FB7D0A2F9\n * \t\n * \t```\n *\n * @internal\n */\nconst parseXmlError = createXmlErrorParser({ noErrorWrapping: true });\n/**\n * @internal\n */\nconst retryDecider = createRetryDecider(parseXmlError);\n/**\n * @internal\n */\nconst defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider,\n computeDelay: jitteredBackoff,\n userAgentValue: getAmplifyUserAgent(),\n useAccelerateEndpoint: false,\n uriEscapePath: false, // Required by S3. See https://github.com/aws/aws-sdk-js-v3/blob/9ba012dfa3a3429aa2db0f90b3b0b3a7a31f9bc3/packages/signature-v4/src/SignatureV4.ts#L76-L83\n};\n\nexport { SERVICE_NAME, defaultConfig, isDnsCompatibleBucketName, parseXmlError, retryDecider };\n//# sourceMappingURL=base.mjs.map\n","import { parseMetadata, EMPTY_SHA256_HASH, presignUrl } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { CONTENT_SHA256_HEADER } from '../runtime/constants.mjs';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, deserializeBoolean, deserializeTimestamp, deserializeNumber, deserializeMetadata } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n return {\n ...map(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', deserializeTimestamp],\n ContentLength: ['content-length', deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n MissingMeta: ['x-amz-missing-meta', deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', deserializeNumber],\n TagCount: ['x-amz-tagging-count', deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: deserializeMetadata(response.headers),\n $metadata: parseMetadata(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nconst getObject = composeServiceApi(s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nconst getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.\n // It requires changes in presignUrl. Without this change, the generated url still works,\n // but not the same as other tools like AWS SDK and CLI.\n url.searchParams.append(CONTENT_SHA256_HEADER, EMPTY_SHA256_HASH);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return presignUrl({ method, url, body: undefined }, {\n signingService: defaultConfig.service,\n signingRegion: config.region,\n ...defaultConfig,\n ...config,\n });\n};\n\nexport { getObject, getPresignedGetObjectUrl };\n//# sourceMappingURL=getObject.mjs.map\n","import { assertValidationError } from '../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../errors/types/validation.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst resolvePrefix = ({ accessLevel, targetIdentityId, }) => {\n if (accessLevel === 'private') {\n assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);\n return `private/${targetIdentityId}/`;\n }\n else if (accessLevel === 'protected') {\n assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);\n return `protected/${targetIdentityId}/`;\n }\n else {\n return 'public/';\n }\n};\n\nexport { resolvePrefix };\n//# sourceMappingURL=resolvePrefix.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst INVALID_STORAGE_INPUT = 'InvalidStorageInput';\n\nexport { INVALID_STORAGE_INPUT };\n//# sourceMappingURL=constants.mjs.map\n","import { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { resolvePrefix } from '../../../utils/resolvePrefix.mjs';\nimport { StorageError } from '../../../errors/StorageError.mjs';\nimport { INVALID_STORAGE_INPUT } from '../../../errors/constants.mjs';\nimport { DEFAULT_ACCESS_LEVEL, LOCAL_TESTING_S3_ENDPOINT } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * resolve the common input options for S3 API handlers from Amplify configuration and library options.\n *\n * @param {AmplifyClassV6} amplify The Amplify instance.\n * @param {S3ApiOptions} apiOptions The input options for S3 provider.\n * @returns {Promise} The resolved common input options for S3 API handlers.\n * @throws A `StorageError` with `error.name` from `StorageValidationErrorCode` indicating invalid\n * configurations or Amplify library options.\n *\n * @internal\n */\nconst resolveS3ConfigAndInput = async (amplify, apiInput) => {\n const { options: apiOptions } = apiInput ?? {};\n /**\n * IdentityId is always cached in memory so we can safely make calls here. It\n * should be stable even for unauthenticated users, regardless of credentials.\n */\n const { identityId } = await amplify.Auth.fetchAuthSession();\n /**\n * A credentials provider function instead of a static credentials object is\n * used because the long-running tasks like multipart upload may span over the\n * credentials expiry. Auth.fetchAuthSession() automatically refreshes the\n * credentials if they are expired.\n *\n * The optional forceRefresh option is set when the S3 service returns expired\n * tokens error in the previous API call attempt.\n */\n const credentialsProvider = async (options) => {\n if (isLocationCredentialsProvider(apiOptions)) {\n assertStorageInput(apiInput);\n }\n // TODO: forceRefresh option of fetchAuthSession would refresh both tokens and\n // AWS credentials. So we do not support forceRefreshing from the Auth until\n // we support refreshing only the credentials.\n const { credentials } = isLocationCredentialsProvider(apiOptions)\n ? await apiOptions.locationCredentialsProvider(options)\n : await amplify.Auth.fetchAuthSession();\n assertValidationError(!!credentials, StorageValidationErrorCode.NoCredentials);\n return credentials;\n };\n const { bucket: defaultBucket, region: defaultRegion, dangerouslyConnectToHttpEndpointForTesting, buckets, } = amplify.getConfig()?.Storage?.S3 ?? {};\n const { bucket = defaultBucket, region = defaultRegion } = (apiOptions?.bucket && resolveBucketConfig(apiOptions, buckets)) || {};\n assertValidationError(!!bucket, StorageValidationErrorCode.NoBucket);\n assertValidationError(!!region, StorageValidationErrorCode.NoRegion);\n const { defaultAccessLevel, prefixResolver = resolvePrefix, isObjectLockEnabled, } = amplify.libraryOptions?.Storage?.S3 ?? {};\n const accessLevel = apiOptions?.accessLevel ?? defaultAccessLevel ?? DEFAULT_ACCESS_LEVEL;\n const targetIdentityId = accessLevel === 'protected'\n ? (apiOptions?.targetIdentityId ?? identityId)\n : identityId;\n const keyPrefix = await prefixResolver({ accessLevel, targetIdentityId });\n return {\n s3Config: {\n credentials: credentialsProvider,\n region,\n useAccelerateEndpoint: apiOptions?.useAccelerateEndpoint,\n ...(apiOptions?.customEndpoint\n ? { customEndpoint: apiOptions.customEndpoint }\n : {}),\n ...(dangerouslyConnectToHttpEndpointForTesting\n ? {\n customEndpoint: LOCAL_TESTING_S3_ENDPOINT,\n forcePathStyle: true,\n }\n : {}),\n },\n bucket,\n keyPrefix,\n identityId,\n isObjectLockEnabled,\n };\n};\nconst isLocationCredentialsProvider = (options) => {\n return !!options?.locationCredentialsProvider;\n};\nconst isInputWithCallbackPath = (input) => {\n return ((input?.path &&\n typeof input.path === 'function') ||\n (input?.destination?.path &&\n typeof input.destination?.path === 'function') ||\n (input?.source?.path &&\n typeof input.source?.path === 'function'));\n};\nconst isDeprecatedInput = (input) => {\n return (isInputWithKey(input) ||\n isInputWithPrefix(input) ||\n isInputWithCopySourceOrDestination(input));\n};\nconst assertStorageInput = (input) => {\n if (isDeprecatedInput(input) || isInputWithCallbackPath(input)) {\n throw new StorageError({\n name: INVALID_STORAGE_INPUT,\n message: 'The input needs to have a path as a string value.',\n recoverySuggestion: 'Please provide a valid path as a string value for the input.',\n });\n }\n};\nconst isInputWithKey = (input) => {\n return !!(typeof input.key === 'string');\n};\nconst isInputWithPrefix = (input) => {\n return !!(typeof input.prefix === 'string');\n};\nconst isInputWithCopySourceOrDestination = (input) => {\n return !!(typeof input.source?.key === 'string' ||\n typeof input.destination?.key === 'string');\n};\nconst resolveBucketConfig = (apiOptions, buckets) => {\n if (typeof apiOptions.bucket === 'string') {\n const bucketConfig = buckets?.[apiOptions.bucket];\n assertValidationError(!!bucketConfig, StorageValidationErrorCode.InvalidStorageBucket);\n return { bucket: bucketConfig.bucketName, region: bucketConfig.region };\n }\n if (typeof apiOptions.bucket === 'object') {\n return {\n bucket: apiOptions.bucket.bucketName,\n region: apiOptions.bucket.region,\n };\n }\n};\n\nexport { resolveS3ConfigAndInput };\n//# sourceMappingURL=resolveS3ConfigAndInput.mjs.map\n","import { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst VALID_AWS_ACCOUNT_ID_PATTERN = /^\\d{12}/;\nconst validateBucketOwnerID = (accountID) => {\n if (accountID === undefined) {\n return;\n }\n assertValidationError(VALID_AWS_ACCOUNT_ID_PATTERN.test(accountID), StorageValidationErrorCode.InvalidAWSAccountID);\n};\n\nexport { validateBucketOwnerID };\n//# sourceMappingURL=validateBucketOwnerID.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst isInputWithPath = (input) => {\n return input.path !== undefined;\n};\n\nexport { isInputWithPath };\n//# sourceMappingURL=isInputWithPath.mjs.map\n","import { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst resolveIdentityId = (identityId) => {\n assertValidationError(!!identityId, StorageValidationErrorCode.NoIdentityId);\n return identityId;\n};\n\nexport { resolveIdentityId };\n//# sourceMappingURL=resolveIdentityId.mjs.map\n","import { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { isInputWithPath } from './isInputWithPath.mjs';\nimport { STORAGE_INPUT_PATH, STORAGE_INPUT_KEY } from './constants.mjs';\nimport { resolveIdentityId } from './resolveIdentityId.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst validateStorageOperationInput = (input, identityId) => {\n assertValidationError(\n // Key present without a path\n (!!input.key && !input.path) ||\n // Path present without a key\n (!input.key && !!input.path), StorageValidationErrorCode.InvalidStorageOperationInput);\n if (isInputWithPath(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: resolveIdentityId(identityId) });\n assertValidationError(!objectKey.startsWith('/'), StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: STORAGE_INPUT_KEY, objectKey: input.key };\n }\n};\n\nexport { validateStorageOperationInput };\n//# sourceMappingURL=validateStorageOperationInput.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constructContentDisposition = (contentDisposition) => {\n if (!contentDisposition)\n return undefined;\n if (typeof contentDisposition === 'string')\n return contentDisposition;\n const { type, filename } = contentDisposition;\n return filename !== undefined ? `${type}; filename=\"${filename}\"` : type;\n};\n\nexport { constructContentDisposition };\n//# sourceMappingURL=constructContentDisposition.mjs.map\n","import { ConsoleLogger } from '@aws-amplify/core';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('Storage');\n\nexport { logger };\n//# sourceMappingURL=logger.mjs.map\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, deserializeNumber, deserializeTimestamp, deserializeMetadata } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst headObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n return {\n method: 'HEAD',\n headers,\n url,\n };\n};\nconst headObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const contents = {\n ...map(response.headers, {\n ContentLength: ['content-length', deserializeNumber],\n ContentType: 'content-type',\n ETag: 'etag',\n LastModified: ['last-modified', deserializeTimestamp],\n VersionId: 'x-amz-version-id',\n }),\n Metadata: deserializeMetadata(response.headers),\n };\n return {\n $metadata: parseMetadata(response),\n ...contents,\n };\n }\n};\nconst headObject = composeServiceApi(s3TransferHandler, headObjectSerializer, headObjectDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { headObject };\n//# sourceMappingURL=headObject.mjs.map\n","import { getAmplifyUserAgent, Category } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getStorageUserAgentValue(action) {\n return getAmplifyUserAgent({\n category: Category.Storage,\n action,\n });\n}\n\nexport { getStorageUserAgentValue };\n//# sourceMappingURL=userAgent.mjs.map\n","import { StorageAction } from '@aws-amplify/core/internals/utils';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';\nimport '../../../../errors/types/validation.mjs';\nimport { logger } from '../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';\nimport { STORAGE_INPUT_KEY } from '../../utils/constants.mjs';\nimport '../../utils/client/s3data/base.mjs';\nimport '../../utils/client/s3data/getObject.mjs';\nimport '../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../utils/client/s3data/putObject.mjs';\nimport '../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../utils/client/s3data/uploadPart.mjs';\nimport '../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../utils/client/s3data/listParts.mjs';\nimport '../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../utils/client/s3data/copyObject.mjs';\nimport { headObject } from '../../utils/client/s3data/headObject.mjs';\nimport '../../utils/client/s3data/deleteObject.mjs';\nimport { getStorageUserAgentValue } from '../../utils/userAgent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getProperties = async (amplify, input, action) => {\n const { s3Config, bucket, keyPrefix, identityId } = await resolveS3ConfigAndInput(amplify, input);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n validateBucketOwnerID(input.options?.expectedBucketOwner);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n logger.debug(`get properties of ${objectKey} from ${finalKey}`);\n const response = await headObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(action ?? StorageAction.GetProperties),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ExpectedBucketOwner: input.options?.expectedBucketOwner,\n });\n const result = {\n contentType: response.ContentType,\n size: response.ContentLength,\n eTag: response.ETag,\n lastModified: response.LastModified,\n metadata: response.Metadata,\n versionId: response.VersionId,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n\nexport { getProperties };\n//# sourceMappingURL=getProperties.mjs.map\n","import { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation.mjs';\nimport '../../utils/client/s3data/base.mjs';\nimport { getPresignedGetObjectUrl } from '../../utils/client/s3data/getObject.mjs';\nimport '../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../utils/client/s3data/putObject.mjs';\nimport '../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../utils/client/s3data/uploadPart.mjs';\nimport '../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../utils/client/s3data/listParts.mjs';\nimport '../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../utils/client/s3data/copyObject.mjs';\nimport '../../utils/client/s3data/headObject.mjs';\nimport '../../utils/client/s3data/deleteObject.mjs';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError.mjs';\nimport '../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';\nimport { DEFAULT_PRESIGN_EXPIRATION, STORAGE_INPUT_KEY, MAX_URL_EXPIRATION } from '../../utils/constants.mjs';\nimport { constructContentDisposition } from '../../utils/constructContentDisposition.mjs';\nimport { getProperties } from './getProperties.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getUrl = async (amplify, input) => {\n const { options: getUrlOptions } = input;\n const { s3Config, keyPrefix, bucket, identityId } = await resolveS3ConfigAndInput(amplify, input);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n validateBucketOwnerID(getUrlOptions?.expectedBucketOwner);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n if (getUrlOptions?.validateObjectExistence) {\n await getProperties(amplify, input, StorageAction.GetUrl);\n }\n let urlExpirationInSec = getUrlOptions?.expiresIn ?? DEFAULT_PRESIGN_EXPIRATION;\n const resolvedCredential = typeof s3Config.credentials === 'function'\n ? await s3Config.credentials()\n : s3Config.credentials;\n const awsCredExpiration = resolvedCredential.expiration;\n if (awsCredExpiration) {\n const awsCredExpirationInSec = Math.floor((awsCredExpiration.getTime() - Date.now()) / 1000);\n urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);\n }\n const maxUrlExpirationInSec = MAX_URL_EXPIRATION / 1000;\n assertValidationError(urlExpirationInSec <= maxUrlExpirationInSec, StorageValidationErrorCode.UrlExpirationMaxLimitExceed);\n // expiresAt is the minimum of credential expiration and url expiration\n return {\n url: await getPresignedGetObjectUrl({\n ...s3Config,\n credentials: resolvedCredential,\n expiration: urlExpirationInSec,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(getUrlOptions?.contentDisposition && {\n ResponseContentDisposition: constructContentDisposition(getUrlOptions.contentDisposition),\n }),\n ...(getUrlOptions?.contentType && {\n ResponseContentType: getUrlOptions.contentType,\n }),\n ExpectedBucketOwner: getUrlOptions?.expectedBucketOwner,\n }),\n expiresAt: new Date(Date.now() + urlExpirationInSec * 1000),\n };\n};\n\nexport { getUrl };\n//# sourceMappingURL=getUrl.mjs.map\n","import { Amplify } from '@aws-amplify/core';\nimport { getUrl as getUrl$1 } from './internal/getUrl.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getUrl(input) {\n return getUrl$1(Amplify, input);\n}\n\nexport { getUrl };\n//# sourceMappingURL=getUrl.mjs.map\n"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]}