ng-implementation/implem/.angular/cache/20.1.4/babel-webpack/a91c4b7030a85cbf6d4c9e5fcbf5ada2.json
2025-08-19 12:05:42 +02:00

1 line
No EOL
52 KiB
JSON

{"ast":null,"code":"/**\n * @license Angular v20.1.4\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { HttpHeaders, HttpParams, HttpRequest, HttpEventType, HttpErrorResponse, HttpClient, HTTP_ROOT_INTERCEPTOR_FNS, HttpResponse } from './module.mjs';\nexport { FetchBackend, HTTP_INTERCEPTORS, HttpBackend, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY } from './module.mjs';\nimport { assertInInjectionContext, inject, Injector, ɵResourceImpl as _ResourceImpl, linkedSignal, computed, signal, ɵencapsulateResourceError as _encapsulateResourceError, ɵRuntimeError as _RuntimeError, InjectionToken, ɵperformanceMarkFeature as _performanceMarkFeature, APP_BOOTSTRAP_LISTENER, ApplicationRef, TransferState, makeStateKey, ɵtruncateMiddle as _truncateMiddle, ɵformatRuntimeError as _formatRuntimeError } from '@angular/core';\nimport { of } from 'rxjs';\nimport { tap } from 'rxjs/operators';\nimport './xhr.mjs';\n\n/**\n * `httpResource` makes a reactive HTTP request and exposes the request status and response value as\n * a `WritableResource`. By default, it assumes that the backend will return JSON data. To make a\n * request that expects a different kind of data, you can use a sub-constructor of `httpResource`,\n * such as `httpResource.text`.\n *\n * @experimental 19.2\n * @initializerApiFunction\n */\nconst httpResource = (() => {\n const jsonFn = makeHttpResourceFn('json');\n jsonFn.arrayBuffer = makeHttpResourceFn('arraybuffer');\n jsonFn.blob = makeHttpResourceFn('blob');\n jsonFn.text = makeHttpResourceFn('text');\n return jsonFn;\n})();\nfunction makeHttpResourceFn(responseType) {\n return function httpResource(request, options) {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(httpResource);\n }\n const injector = options?.injector ?? inject(Injector);\n return new HttpResourceImpl(injector, () => normalizeRequest(request, responseType), options?.defaultValue, options?.parse, options?.equal);\n };\n}\nfunction normalizeRequest(request, responseType) {\n let unwrappedRequest = typeof request === 'function' ? request() : request;\n if (unwrappedRequest === undefined) {\n return undefined;\n } else if (typeof unwrappedRequest === 'string') {\n unwrappedRequest = {\n url: unwrappedRequest\n };\n }\n const headers = unwrappedRequest.headers instanceof HttpHeaders ? unwrappedRequest.headers : new HttpHeaders(unwrappedRequest.headers);\n const params = unwrappedRequest.params instanceof HttpParams ? unwrappedRequest.params : new HttpParams({\n fromObject: unwrappedRequest.params\n });\n return new HttpRequest(unwrappedRequest.method ?? 'GET', unwrappedRequest.url, unwrappedRequest.body ?? null, {\n headers,\n params,\n reportProgress: unwrappedRequest.reportProgress,\n withCredentials: unwrappedRequest.withCredentials,\n keepalive: unwrappedRequest.keepalive,\n cache: unwrappedRequest.cache,\n priority: unwrappedRequest.priority,\n mode: unwrappedRequest.mode,\n redirect: unwrappedRequest.redirect,\n responseType,\n context: unwrappedRequest.context,\n transferCache: unwrappedRequest.transferCache,\n credentials: unwrappedRequest.credentials,\n timeout: unwrappedRequest.timeout\n });\n}\nclass HttpResourceImpl extends _ResourceImpl {\n client;\n _headers = linkedSignal({\n source: this.extRequest,\n computation: () => undefined\n });\n _progress = linkedSignal({\n source: this.extRequest,\n computation: () => undefined\n });\n _statusCode = linkedSignal({\n source: this.extRequest,\n computation: () => undefined\n });\n headers = computed(() => this.status() === 'resolved' || this.status() === 'error' ? this._headers() : undefined, ...(ngDevMode ? [{\n debugName: \"headers\"\n }] : []));\n progress = this._progress.asReadonly();\n statusCode = this._statusCode.asReadonly();\n constructor(injector, request, defaultValue, parse, equal) {\n super(request, ({\n params: request,\n abortSignal\n }) => {\n let sub;\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n abortSignal.addEventListener('abort', onAbort);\n // Start off stream as undefined.\n const stream = signal({\n value: undefined\n }, ...(ngDevMode ? [{\n debugName: \"stream\"\n }] : []));\n let resolve;\n const promise = new Promise(r => resolve = r);\n const send = value => {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n };\n sub = this.client.request(request).subscribe({\n next: event => {\n switch (event.type) {\n case HttpEventType.Response:\n this._headers.set(event.headers);\n this._statusCode.set(event.status);\n try {\n send({\n value: parse ? parse(event.body) : event.body\n });\n } catch (error) {\n send({\n error: _encapsulateResourceError(error)\n });\n }\n break;\n case HttpEventType.DownloadProgress:\n this._progress.set(event);\n break;\n }\n },\n error: error => {\n if (error instanceof HttpErrorResponse) {\n this._headers.set(error.headers);\n this._statusCode.set(error.status);\n }\n send({\n error\n });\n abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new _RuntimeError(991 /* ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE */, ngDevMode && 'Resource completed before producing a value')\n });\n }\n abortSignal.removeEventListener('abort', onAbort);\n }\n });\n return promise;\n }, defaultValue, equal, injector);\n this.client = injector.get(HttpClient);\n }\n}\n\n/**\n * If your application uses different HTTP origins to make API calls (via `HttpClient`) on the server and\n * on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping\n * between those origins, so that `HttpTransferCache` feature can recognize those requests as the same\n * ones and reuse the data cached on the server during hydration on the client.\n *\n * **Important note**: the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in\n * the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an\n * error if it detects that the token is defined while running on the client.\n *\n * @usageNotes\n *\n * When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and\n * via `https://external-domain.com` on the client, you can use the following configuration:\n * ```ts\n * // in app.server.config.ts\n * {\n * provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,\n * useValue: {\n * 'http://internal-domain.com:8080': 'https://external-domain.com'\n * }\n * }\n * ```\n *\n * @publicApi\n */\nconst HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '');\n/**\n * Keys within cached response data structure.\n */\nconst BODY = 'b';\nconst HEADERS = 'h';\nconst STATUS = 's';\nconst STATUS_TEXT = 'st';\nconst REQ_URL = 'u';\nconst RESPONSE_TYPE = 'rt';\nconst CACHE_OPTIONS = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '');\n/**\n * A list of allowed HTTP methods to cache.\n */\nconst ALLOWED_METHODS = ['GET', 'HEAD'];\nfunction transferCacheInterceptorFn(req, next) {\n const {\n isCacheActive,\n ...globalOptions\n } = inject(CACHE_OPTIONS);\n const {\n transferCache: requestOptions,\n method: requestMethod\n } = req;\n // In the following situations we do not want to cache the request\n if (!isCacheActive || requestOptions === false ||\n // POST requests are allowed either globally or at request level\n requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions || requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod) ||\n // Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey\n !globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req) || globalOptions.filter?.(req) === false) {\n return next(req);\n }\n const transferState = inject(TransferState);\n const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {\n optional: true\n });\n if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {\n throw new _RuntimeError(2803 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT */, ngDevMode && 'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' + 'present in the client side code. Please ensure that this token is only provided in the ' + 'server code of the application.');\n }\n const requestUrl = typeof ngServerMode !== 'undefined' && ngServerMode && originMap ? mapRequestOriginUrl(req.url, originMap) : req.url;\n const storeKey = makeCacheKey(req, requestUrl);\n const response = transferState.get(storeKey, null);\n let headersToInclude = globalOptions.includeHeaders;\n if (typeof requestOptions === 'object' && requestOptions.includeHeaders) {\n // Request-specific config takes precedence over the global config.\n headersToInclude = requestOptions.includeHeaders;\n }\n if (response) {\n const {\n [BODY]: undecodedBody,\n [RESPONSE_TYPE]: responseType,\n [HEADERS]: httpHeaders,\n [STATUS]: status,\n [STATUS_TEXT]: statusText,\n [REQ_URL]: url\n } = response;\n // Request found in cache. Respond using it.\n let body = undecodedBody;\n switch (responseType) {\n case 'arraybuffer':\n body = new TextEncoder().encode(undecodedBody).buffer;\n break;\n case 'blob':\n body = new Blob([undecodedBody]);\n break;\n }\n // We want to warn users accessing a header provided from the cache\n // That HttpTransferCache alters the headers\n // The warning will be logged a single time by HttpHeaders instance\n let headers = new HttpHeaders(httpHeaders);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Append extra logic in dev mode to produce a warning when a header\n // that was not transferred to the client is accessed in the code via `get`\n // and `has` calls.\n headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []);\n }\n return of(new HttpResponse({\n body,\n headers,\n status,\n statusText,\n url\n }));\n }\n const event$ = next(req);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Request not found in cache. Make the request and cache it if on the server.\n return event$.pipe(tap(event => {\n // Only cache successful HTTP responses.\n if (event instanceof HttpResponse) {\n transferState.set(storeKey, {\n [BODY]: event.body,\n [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),\n [STATUS]: event.status,\n [STATUS_TEXT]: event.statusText,\n [REQ_URL]: requestUrl,\n [RESPONSE_TYPE]: req.responseType\n });\n }\n }));\n }\n return event$;\n}\n/** @returns true when the requests contains autorization related headers. */\nfunction hasAuthHeaders(req) {\n return req.headers.has('authorization') || req.headers.has('proxy-authorization');\n}\nfunction getFilteredHeaders(headers, includeHeaders) {\n if (!includeHeaders) {\n return {};\n }\n const headersMap = {};\n for (const key of includeHeaders) {\n const values = headers.getAll(key);\n if (values !== null) {\n headersMap[key] = values;\n }\n }\n return headersMap;\n}\nfunction sortAndConcatParams(params) {\n return [...params.keys()].sort().map(k => `${k}=${params.getAll(k)}`).join('&');\n}\nfunction makeCacheKey(request, mappedRequestUrl) {\n // make the params encoded same as a url so it's easy to identify\n const {\n params,\n method,\n responseType\n } = request;\n const encodedParams = sortAndConcatParams(params);\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|');\n const hash = generateHash(key);\n return makeStateKey(hash);\n}\n/**\n * A method that returns a hash representation of a string using a variant of DJB2 hash\n * algorithm.\n *\n * This is the same hashing logic that is used to generate component ids.\n */\nfunction generateHash(value) {\n let hash = 0;\n for (const char of value) {\n hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n return hash.toString();\n}\n/**\n * Returns the DI providers needed to enable HTTP transfer cache.\n *\n * By default, when using server rendering, requests are performed twice: once on the server and\n * other one on the browser.\n *\n * When these providers are added, requests performed on the server are cached and reused during the\n * bootstrapping of the application in the browser thus avoiding duplicate requests and reducing\n * load time.\n *\n */\nfunction withHttpTransferCache(cacheOptions) {\n return [{\n provide: CACHE_OPTIONS,\n useFactory: () => {\n _performanceMarkFeature('NgHttpTransferCache');\n return {\n isCacheActive: true,\n ...cacheOptions\n };\n }\n }, {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n useValue: transferCacheInterceptorFn,\n multi: true\n }, {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: () => {\n const appRef = inject(ApplicationRef);\n const cacheState = inject(CACHE_OPTIONS);\n return () => {\n appRef.whenStable().then(() => {\n cacheState.isCacheActive = false;\n });\n };\n }\n }];\n}\n/**\n * This function will add a proxy to an HttpHeader to intercept calls to get/has\n * and log a warning if the header entry requested has been removed\n */\nfunction appendMissingHeadersDetection(url, headers, headersToInclude) {\n const warningProduced = new Set();\n return new Proxy(headers, {\n get(target, prop) {\n const value = Reflect.get(target, prop);\n const methods = new Set(['get', 'has', 'getAll']);\n if (typeof value !== 'function' || !methods.has(prop)) {\n return value;\n }\n return headerName => {\n // We log when the key has been removed and a warning hasn't been produced for the header\n const key = (prop + ':' + headerName).toLowerCase(); // e.g. `get:cache-control`\n if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) {\n warningProduced.add(key);\n const truncatedUrl = _truncateMiddle(url);\n // TODO: create Error guide for this warning\n console.warn(_formatRuntimeError(2802 /* RuntimeErrorCode.HEADERS_ALTERED_BY_TRANSFER_CACHE */, `Angular detected that the \\`${headerName}\\` header is accessed, but the value of the header ` + `was not transferred from the server to the client by the HttpTransferCache. ` + `To include the value of the \\`${headerName}\\` header for the \\`${truncatedUrl}\\` request, ` + `use the \\`includeHeaders\\` list. The \\`includeHeaders\\` can be defined either ` + `on a request level by adding the \\`transferCache\\` parameter, or on an application ` + `level by adding the \\`httpCacheTransfer.includeHeaders\\` argument to the ` + `\\`provideClientHydration()\\` call. `));\n }\n // invoking the original method\n return value.apply(target, [headerName]);\n };\n }\n });\n}\nfunction mapRequestOriginUrl(url, originMap) {\n const origin = new URL(url, 'resolve://').origin;\n const mappedOrigin = originMap[origin];\n if (!mappedOrigin) {\n return url;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n verifyMappedOrigin(mappedOrigin);\n }\n return url.replace(origin, mappedOrigin);\n}\nfunction verifyMappedOrigin(url) {\n if (new URL(url, 'resolve://').pathname !== '/') {\n throw new _RuntimeError(2804 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_CONTAINS_PATH */, 'Angular detected a URL with a path segment in the value provided for the ' + `\\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\\` token: ${url}. The map should only contain origins ` + 'without any other segments.');\n }\n}\nexport { HTTP_TRANSFER_CACHE_ORIGIN_MAP, HttpClient, HttpErrorResponse, HttpEventType, HttpHeaders, HttpParams, HttpRequest, HttpResponse, httpResource, HTTP_ROOT_INTERCEPTOR_FNS as ɵHTTP_ROOT_INTERCEPTOR_FNS, withHttpTransferCache as ɵwithHttpTransferCache };\n//# sourceMappingURL=http.mjs.map","map":{"version":3,"names":["HttpHeaders","HttpParams","HttpRequest","HttpEventType","HttpErrorResponse","HttpClient","HTTP_ROOT_INTERCEPTOR_FNS","HttpResponse","FetchBackend","HTTP_INTERCEPTORS","HttpBackend","HttpClientJsonpModule","HttpClientModule","HttpClientXsrfModule","HttpContext","HttpContextToken","HttpFeatureKind","HttpHandler","HttpHeaderResponse","HttpResponseBase","HttpStatusCode","HttpUrlEncodingCodec","HttpXhrBackend","HttpXsrfTokenExtractor","JsonpClientBackend","JsonpInterceptor","provideHttpClient","withFetch","withInterceptors","withInterceptorsFromDi","withJsonpSupport","withNoXsrfProtection","withRequestsMadeViaParent","withXsrfConfiguration","HttpInterceptorHandler","ɵHttpInterceptingHandler","ɵHttpInterceptorHandler","REQUESTS_CONTRIBUTE_TO_STABILITY","ɵREQUESTS_CONTRIBUTE_TO_STABILITY","assertInInjectionContext","inject","Injector","ɵResourceImpl","_ResourceImpl","linkedSignal","computed","signal","ɵencapsulateResourceError","_encapsulateResourceError","ɵRuntimeError","_RuntimeError","InjectionToken","ɵperformanceMarkFeature","_performanceMarkFeature","APP_BOOTSTRAP_LISTENER","ApplicationRef","TransferState","makeStateKey","ɵtruncateMiddle","_truncateMiddle","ɵformatRuntimeError","_formatRuntimeError","of","tap","httpResource","jsonFn","makeHttpResourceFn","arrayBuffer","blob","text","responseType","request","options","ngDevMode","injector","HttpResourceImpl","normalizeRequest","defaultValue","parse","equal","unwrappedRequest","undefined","url","headers","params","fromObject","method","body","reportProgress","withCredentials","keepalive","cache","priority","mode","redirect","context","transferCache","credentials","timeout","client","_headers","source","extRequest","computation","_progress","_statusCode","status","debugName","progress","asReadonly","statusCode","constructor","abortSignal","sub","onAbort","unsubscribe","addEventListener","stream","value","resolve","promise","Promise","r","send","set","subscribe","next","event","type","Response","error","DownloadProgress","removeEventListener","complete","get","HTTP_TRANSFER_CACHE_ORIGIN_MAP","BODY","HEADERS","STATUS","STATUS_TEXT","REQ_URL","RESPONSE_TYPE","CACHE_OPTIONS","ALLOWED_METHODS","transferCacheInterceptorFn","req","isCacheActive","globalOptions","requestOptions","requestMethod","includePostRequests","includes","includeRequestsWithAuthHeaders","hasAuthHeaders","filter","transferState","originMap","optional","ngServerMode","requestUrl","mapRequestOriginUrl","storeKey","makeCacheKey","response","headersToInclude","includeHeaders","undecodedBody","httpHeaders","statusText","TextEncoder","encode","buffer","Blob","appendMissingHeadersDetection","event$","pipe","getFilteredHeaders","has","headersMap","key","values","getAll","sortAndConcatParams","keys","sort","map","k","join","mappedRequestUrl","encodedParams","serializedBody","serializeBody","URLSearchParams","hash","generateHash","char","Math","imul","charCodeAt","toString","withHttpTransferCache","cacheOptions","provide","useFactory","useValue","multi","appRef","cacheState","whenStable","then","warningProduced","Set","Proxy","target","prop","Reflect","methods","headerName","toLowerCase","add","truncatedUrl","console","warn","apply","origin","URL","mappedOrigin","verifyMappedOrigin","replace","pathname","ɵHTTP_ROOT_INTERCEPTOR_FNS","ɵwithHttpTransferCache"],"sources":["/home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/implem/node_modules/@angular/common/fesm2022/http.mjs"],"sourcesContent":["/**\n * @license Angular v20.1.4\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { HttpHeaders, HttpParams, HttpRequest, HttpEventType, HttpErrorResponse, HttpClient, HTTP_ROOT_INTERCEPTOR_FNS, HttpResponse } from './module.mjs';\nexport { FetchBackend, HTTP_INTERCEPTORS, HttpBackend, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY } from './module.mjs';\nimport { assertInInjectionContext, inject, Injector, ɵResourceImpl as _ResourceImpl, linkedSignal, computed, signal, ɵencapsulateResourceError as _encapsulateResourceError, ɵRuntimeError as _RuntimeError, InjectionToken, ɵperformanceMarkFeature as _performanceMarkFeature, APP_BOOTSTRAP_LISTENER, ApplicationRef, TransferState, makeStateKey, ɵtruncateMiddle as _truncateMiddle, ɵformatRuntimeError as _formatRuntimeError } from '@angular/core';\nimport { of } from 'rxjs';\nimport { tap } from 'rxjs/operators';\nimport './xhr.mjs';\n\n/**\n * `httpResource` makes a reactive HTTP request and exposes the request status and response value as\n * a `WritableResource`. By default, it assumes that the backend will return JSON data. To make a\n * request that expects a different kind of data, you can use a sub-constructor of `httpResource`,\n * such as `httpResource.text`.\n *\n * @experimental 19.2\n * @initializerApiFunction\n */\nconst httpResource = (() => {\n const jsonFn = makeHttpResourceFn('json');\n jsonFn.arrayBuffer = makeHttpResourceFn('arraybuffer');\n jsonFn.blob = makeHttpResourceFn('blob');\n jsonFn.text = makeHttpResourceFn('text');\n return jsonFn;\n})();\nfunction makeHttpResourceFn(responseType) {\n return function httpResource(request, options) {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(httpResource);\n }\n const injector = options?.injector ?? inject(Injector);\n return new HttpResourceImpl(injector, () => normalizeRequest(request, responseType), options?.defaultValue, options?.parse, options?.equal);\n };\n}\nfunction normalizeRequest(request, responseType) {\n let unwrappedRequest = typeof request === 'function' ? request() : request;\n if (unwrappedRequest === undefined) {\n return undefined;\n }\n else if (typeof unwrappedRequest === 'string') {\n unwrappedRequest = { url: unwrappedRequest };\n }\n const headers = unwrappedRequest.headers instanceof HttpHeaders\n ? unwrappedRequest.headers\n : new HttpHeaders(unwrappedRequest.headers);\n const params = unwrappedRequest.params instanceof HttpParams\n ? unwrappedRequest.params\n : new HttpParams({ fromObject: unwrappedRequest.params });\n return new HttpRequest(unwrappedRequest.method ?? 'GET', unwrappedRequest.url, unwrappedRequest.body ?? null, {\n headers,\n params,\n reportProgress: unwrappedRequest.reportProgress,\n withCredentials: unwrappedRequest.withCredentials,\n keepalive: unwrappedRequest.keepalive,\n cache: unwrappedRequest.cache,\n priority: unwrappedRequest.priority,\n mode: unwrappedRequest.mode,\n redirect: unwrappedRequest.redirect,\n responseType,\n context: unwrappedRequest.context,\n transferCache: unwrappedRequest.transferCache,\n credentials: unwrappedRequest.credentials,\n timeout: unwrappedRequest.timeout,\n });\n}\nclass HttpResourceImpl extends _ResourceImpl {\n client;\n _headers = linkedSignal({\n source: this.extRequest,\n computation: () => undefined,\n });\n _progress = linkedSignal({\n source: this.extRequest,\n computation: () => undefined,\n });\n _statusCode = linkedSignal({\n source: this.extRequest,\n computation: () => undefined,\n });\n headers = computed(() => this.status() === 'resolved' || this.status() === 'error' ? this._headers() : undefined, ...(ngDevMode ? [{ debugName: \"headers\" }] : []));\n progress = this._progress.asReadonly();\n statusCode = this._statusCode.asReadonly();\n constructor(injector, request, defaultValue, parse, equal) {\n super(request, ({ params: request, abortSignal }) => {\n let sub;\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n abortSignal.addEventListener('abort', onAbort);\n // Start off stream as undefined.\n const stream = signal({ value: undefined }, ...(ngDevMode ? [{ debugName: \"stream\" }] : []));\n let resolve;\n const promise = new Promise((r) => (resolve = r));\n const send = (value) => {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n };\n sub = this.client.request(request).subscribe({\n next: (event) => {\n switch (event.type) {\n case HttpEventType.Response:\n this._headers.set(event.headers);\n this._statusCode.set(event.status);\n try {\n send({ value: parse ? parse(event.body) : event.body });\n }\n catch (error) {\n send({ error: _encapsulateResourceError(error) });\n }\n break;\n case HttpEventType.DownloadProgress:\n this._progress.set(event);\n break;\n }\n },\n error: (error) => {\n if (error instanceof HttpErrorResponse) {\n this._headers.set(error.headers);\n this._statusCode.set(error.status);\n }\n send({ error });\n abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new _RuntimeError(991 /* ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE */, ngDevMode && 'Resource completed before producing a value'),\n });\n }\n abortSignal.removeEventListener('abort', onAbort);\n },\n });\n return promise;\n }, defaultValue, equal, injector);\n this.client = injector.get(HttpClient);\n }\n}\n\n/**\n * If your application uses different HTTP origins to make API calls (via `HttpClient`) on the server and\n * on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping\n * between those origins, so that `HttpTransferCache` feature can recognize those requests as the same\n * ones and reuse the data cached on the server during hydration on the client.\n *\n * **Important note**: the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in\n * the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an\n * error if it detects that the token is defined while running on the client.\n *\n * @usageNotes\n *\n * When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and\n * via `https://external-domain.com` on the client, you can use the following configuration:\n * ```ts\n * // in app.server.config.ts\n * {\n * provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,\n * useValue: {\n * 'http://internal-domain.com:8080': 'https://external-domain.com'\n * }\n * }\n * ```\n *\n * @publicApi\n */\nconst HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '');\n/**\n * Keys within cached response data structure.\n */\nconst BODY = 'b';\nconst HEADERS = 'h';\nconst STATUS = 's';\nconst STATUS_TEXT = 'st';\nconst REQ_URL = 'u';\nconst RESPONSE_TYPE = 'rt';\nconst CACHE_OPTIONS = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '');\n/**\n * A list of allowed HTTP methods to cache.\n */\nconst ALLOWED_METHODS = ['GET', 'HEAD'];\nfunction transferCacheInterceptorFn(req, next) {\n const { isCacheActive, ...globalOptions } = inject(CACHE_OPTIONS);\n const { transferCache: requestOptions, method: requestMethod } = req;\n // In the following situations we do not want to cache the request\n if (!isCacheActive ||\n requestOptions === false ||\n // POST requests are allowed either globally or at request level\n (requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions) ||\n (requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod)) ||\n // Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey\n (!globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req)) ||\n globalOptions.filter?.(req) === false) {\n return next(req);\n }\n const transferState = inject(TransferState);\n const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {\n optional: true,\n });\n if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {\n throw new _RuntimeError(2803 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT */, ngDevMode &&\n 'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +\n 'present in the client side code. Please ensure that this token is only provided in the ' +\n 'server code of the application.');\n }\n const requestUrl = typeof ngServerMode !== 'undefined' && ngServerMode && originMap\n ? mapRequestOriginUrl(req.url, originMap)\n : req.url;\n const storeKey = makeCacheKey(req, requestUrl);\n const response = transferState.get(storeKey, null);\n let headersToInclude = globalOptions.includeHeaders;\n if (typeof requestOptions === 'object' && requestOptions.includeHeaders) {\n // Request-specific config takes precedence over the global config.\n headersToInclude = requestOptions.includeHeaders;\n }\n if (response) {\n const { [BODY]: undecodedBody, [RESPONSE_TYPE]: responseType, [HEADERS]: httpHeaders, [STATUS]: status, [STATUS_TEXT]: statusText, [REQ_URL]: url, } = response;\n // Request found in cache. Respond using it.\n let body = undecodedBody;\n switch (responseType) {\n case 'arraybuffer':\n body = new TextEncoder().encode(undecodedBody).buffer;\n break;\n case 'blob':\n body = new Blob([undecodedBody]);\n break;\n }\n // We want to warn users accessing a header provided from the cache\n // That HttpTransferCache alters the headers\n // The warning will be logged a single time by HttpHeaders instance\n let headers = new HttpHeaders(httpHeaders);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Append extra logic in dev mode to produce a warning when a header\n // that was not transferred to the client is accessed in the code via `get`\n // and `has` calls.\n headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []);\n }\n return of(new HttpResponse({\n body,\n headers,\n status,\n statusText,\n url,\n }));\n }\n const event$ = next(req);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Request not found in cache. Make the request and cache it if on the server.\n return event$.pipe(tap((event) => {\n // Only cache successful HTTP responses.\n if (event instanceof HttpResponse) {\n transferState.set(storeKey, {\n [BODY]: event.body,\n [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),\n [STATUS]: event.status,\n [STATUS_TEXT]: event.statusText,\n [REQ_URL]: requestUrl,\n [RESPONSE_TYPE]: req.responseType,\n });\n }\n }));\n }\n return event$;\n}\n/** @returns true when the requests contains autorization related headers. */\nfunction hasAuthHeaders(req) {\n return req.headers.has('authorization') || req.headers.has('proxy-authorization');\n}\nfunction getFilteredHeaders(headers, includeHeaders) {\n if (!includeHeaders) {\n return {};\n }\n const headersMap = {};\n for (const key of includeHeaders) {\n const values = headers.getAll(key);\n if (values !== null) {\n headersMap[key] = values;\n }\n }\n return headersMap;\n}\nfunction sortAndConcatParams(params) {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\nfunction makeCacheKey(request, mappedRequestUrl) {\n // make the params encoded same as a url so it's easy to identify\n const { params, method, responseType } = request;\n const encodedParams = sortAndConcatParams(params);\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n }\n else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|');\n const hash = generateHash(key);\n return makeStateKey(hash);\n}\n/**\n * A method that returns a hash representation of a string using a variant of DJB2 hash\n * algorithm.\n *\n * This is the same hashing logic that is used to generate component ids.\n */\nfunction generateHash(value) {\n let hash = 0;\n for (const char of value) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n return hash.toString();\n}\n/**\n * Returns the DI providers needed to enable HTTP transfer cache.\n *\n * By default, when using server rendering, requests are performed twice: once on the server and\n * other one on the browser.\n *\n * When these providers are added, requests performed on the server are cached and reused during the\n * bootstrapping of the application in the browser thus avoiding duplicate requests and reducing\n * load time.\n *\n */\nfunction withHttpTransferCache(cacheOptions) {\n return [\n {\n provide: CACHE_OPTIONS,\n useFactory: () => {\n _performanceMarkFeature('NgHttpTransferCache');\n return { isCacheActive: true, ...cacheOptions };\n },\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n useValue: transferCacheInterceptorFn,\n multi: true,\n },\n {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: () => {\n const appRef = inject(ApplicationRef);\n const cacheState = inject(CACHE_OPTIONS);\n return () => {\n appRef.whenStable().then(() => {\n cacheState.isCacheActive = false;\n });\n };\n },\n },\n ];\n}\n/**\n * This function will add a proxy to an HttpHeader to intercept calls to get/has\n * and log a warning if the header entry requested has been removed\n */\nfunction appendMissingHeadersDetection(url, headers, headersToInclude) {\n const warningProduced = new Set();\n return new Proxy(headers, {\n get(target, prop) {\n const value = Reflect.get(target, prop);\n const methods = new Set(['get', 'has', 'getAll']);\n if (typeof value !== 'function' || !methods.has(prop)) {\n return value;\n }\n return (headerName) => {\n // We log when the key has been removed and a warning hasn't been produced for the header\n const key = (prop + ':' + headerName).toLowerCase(); // e.g. `get:cache-control`\n if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) {\n warningProduced.add(key);\n const truncatedUrl = _truncateMiddle(url);\n // TODO: create Error guide for this warning\n console.warn(_formatRuntimeError(2802 /* RuntimeErrorCode.HEADERS_ALTERED_BY_TRANSFER_CACHE */, `Angular detected that the \\`${headerName}\\` header is accessed, but the value of the header ` +\n `was not transferred from the server to the client by the HttpTransferCache. ` +\n `To include the value of the \\`${headerName}\\` header for the \\`${truncatedUrl}\\` request, ` +\n `use the \\`includeHeaders\\` list. The \\`includeHeaders\\` can be defined either ` +\n `on a request level by adding the \\`transferCache\\` parameter, or on an application ` +\n `level by adding the \\`httpCacheTransfer.includeHeaders\\` argument to the ` +\n `\\`provideClientHydration()\\` call. `));\n }\n // invoking the original method\n return value.apply(target, [headerName]);\n };\n },\n });\n}\nfunction mapRequestOriginUrl(url, originMap) {\n const origin = new URL(url, 'resolve://').origin;\n const mappedOrigin = originMap[origin];\n if (!mappedOrigin) {\n return url;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n verifyMappedOrigin(mappedOrigin);\n }\n return url.replace(origin, mappedOrigin);\n}\nfunction verifyMappedOrigin(url) {\n if (new URL(url, 'resolve://').pathname !== '/') {\n throw new _RuntimeError(2804 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_CONTAINS_PATH */, 'Angular detected a URL with a path segment in the value provided for the ' +\n `\\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\\` token: ${url}. The map should only contain origins ` +\n 'without any other segments.');\n }\n}\n\nexport { HTTP_TRANSFER_CACHE_ORIGIN_MAP, HttpClient, HttpErrorResponse, Htt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