{"version":3,"sources":["src/app/shared/configs/api-configuration.ts","src/app/shared/configs/base-api-client.ts","src/app/shared/helpers/request-builder.ts","src/app/shared/services/user-and-authentication-api-client.service.ts","src/app/shared/auth-helpers/auth.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { environment } from '../../../environments/environment';\n\n/**\n * Global configuration\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ApiConfiguration {\n rootUrl: string = environment.urls.api;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ApiConfiguration } from './api-configuration';\n\n/**\n * Base class for services\n */\n@Injectable()\nexport class BaseApiClient {\n protected config = inject(ApiConfiguration);\n protected http = inject(HttpClient);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n private _rootUrl: string = '';\n\n /**\n * Returns the root url for all operations in this service. If not set directly in this\n * service, will fallback to `ApiConfiguration.rootUrl`.\n */\n get rootUrl(): string {\n return this._rootUrl || this.config.rootUrl;\n }\n\n /**\n * Sets the root URL for API operations in this service.\n */\n set rootUrl(rootUrl: string) {\n this._rootUrl = rootUrl;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n HttpRequest,\n HttpParameterCodec,\n HttpParams,\n HttpHeaders,\n HttpContext,\n} from '@angular/common/http';\n\n/**\n * Custom parameter codec to correctly handle the plus sign in parameter\n * values. See https://github.com/angular/angular/issues/18261\n */\nclass ParameterCodec implements HttpParameterCodec {\n encodeKey(key: string): string {\n return encodeURIComponent(key);\n }\n\n encodeValue(value: string): string {\n return encodeURIComponent(value);\n }\n\n decodeKey(key: string): string {\n return decodeURIComponent(key);\n }\n\n decodeValue(value: string): string {\n return decodeURIComponent(value);\n }\n}\nconst ParameterCodecInstance = new ParameterCodec();\n\n/**\n * Defines the options for appending a parameter\n */\ninterface ParameterOptions {\n style?: string;\n explode?: boolean;\n}\n\n/**\n * Base class for a parameter\n */\nabstract class Parameter {\n constructor(\n public name: string,\n public value: any,\n public options: ParameterOptions,\n defaultStyle: string,\n defaultExplode: boolean,\n ) {\n this.options = options || {};\n if (this.options.style === null || this.options.style === undefined) {\n this.options.style = defaultStyle;\n }\n if (\n this.options.explode === null ||\n this.options.explode === undefined\n ) {\n this.options.explode = defaultExplode;\n }\n }\n\n serializeValue(value: any, separator = ','): string {\n if (value === null || value === undefined) {\n return '';\n } else if (value instanceof Array) {\n return value\n .map((v) =>\n this.serializeValue(v)\n .split(separator)\n .join(encodeURIComponent(separator)),\n )\n .join(separator);\n } else if (typeof value === 'object') {\n const array: string[] = [];\n for (const key of Object.keys(value)) {\n let propVal = value[key];\n if (propVal !== null && propVal !== undefined) {\n propVal = this.serializeValue(propVal)\n .split(separator)\n .join(encodeURIComponent(separator));\n if (this.options.explode) {\n array.push(`${key}=${propVal}`);\n } else {\n array.push(key);\n array.push(propVal);\n }\n }\n }\n return array.join(separator);\n } else {\n return String(value);\n }\n }\n}\n\n/**\n * A parameter in the operation path\n */\nclass PathParameter extends Parameter {\n constructor(name: string, value: any, options: ParameterOptions) {\n super(name, value, options, 'simple', false);\n }\n\n append(path: string): string {\n let value = this.value;\n if (value === null || value === undefined) {\n value = '';\n }\n let prefix = this.options.style === 'label' ? '.' : '';\n const separator = this.options.explode\n ? prefix === ''\n ? ','\n : prefix\n : ',';\n let alreadySerialized = false;\n if (this.options.style === 'matrix') {\n // The parameter name is just used as prefix, except in some cases...\n prefix = `;${this.name}=`;\n if (this.options.explode && typeof value === 'object') {\n prefix = ';';\n if (value instanceof Array) {\n // For arrays we have to repeat the name for each element\n value = value.map(\n (v) => `${this.name}=${this.serializeValue(v, ';')}`,\n );\n value = value.join(';');\n alreadySerialized = true;\n } else {\n // For objects we have to put each the key / value pairs\n value = this.serializeValue(value, ';');\n alreadySerialized = true;\n }\n }\n }\n value =\n prefix +\n (alreadySerialized ? value : this.serializeValue(value, separator));\n // Replace both the plain variable and the corresponding variant taking in the prefix and explode into account\n path = path.replace(`{${this.name}}`, value);\n path = path.replace(\n `{${prefix}${this.name}${this.options.explode ? '*' : ''}}`,\n value,\n );\n return path;\n }\n\n serializeValue(value: any, separator = ','): string {\n let result =\n typeof value === 'string'\n ? encodeURIComponent(value)\n : super.serializeValue(value, separator);\n result = result.replace(/%3D/g, '=');\n result = result.replace(/%3B/g, ';');\n result = result.replace(/%2C/g, ',');\n return result;\n }\n}\n\n/**\n * A parameter in the query\n */\nclass QueryParameter extends Parameter {\n constructor(name: string, value: any, options: ParameterOptions) {\n super(name, value, options, 'form', true);\n }\n\n append(params: HttpParams): HttpParams {\n if (this.value instanceof Array) {\n // Array serialization\n if (this.options.explode) {\n for (const v of this.value) {\n params = params.append(this.name, this.serializeValue(v));\n }\n } else {\n const separator =\n this.options.style === 'spaceDelimited'\n ? ' '\n : this.options.style === 'pipeDelimited'\n ? '|'\n : ',';\n return params.append(\n this.name,\n this.serializeValue(this.value, separator),\n );\n }\n } else if (this.value !== null && typeof this.value === 'object') {\n // Object serialization\n if (this.options.style === 'deepObject') {\n // Append a parameter for each key, in the form `name[key]`\n for (const key of Object.keys(this.value)) {\n const propVal = this.value[key];\n if (propVal !== null && propVal !== undefined) {\n params = params.append(\n `${this.name}[${key}]`,\n this.serializeValue(propVal),\n );\n }\n }\n } else if (this.options.explode) {\n // Append a parameter for each key without using the parameter name\n for (const key of Object.keys(this.value)) {\n const propVal = this.value[key];\n if (propVal !== null && propVal !== undefined) {\n params = params.append(\n key,\n this.serializeValue(propVal),\n );\n }\n }\n } else {\n // Append a single parameter whose values are a comma-separated list of key,value,key,value...\n const array: any[] = [];\n for (const key of Object.keys(this.value)) {\n const propVal = this.value[key];\n if (propVal !== null && propVal !== undefined) {\n array.push(key);\n array.push(propVal);\n }\n }\n params = params.append(this.name, this.serializeValue(array));\n }\n } else if (this.value !== null && this.value !== undefined) {\n // Plain value\n params = params.append(this.name, this.serializeValue(this.value));\n }\n return params;\n }\n}\n\n/**\n * A parameter in the HTTP request header\n */\nclass HeaderParameter extends Parameter {\n constructor(name: string, value: any, options: ParameterOptions) {\n super(name, value, options, 'simple', false);\n }\n\n append(headers: HttpHeaders): HttpHeaders {\n if (this.value !== null && this.value !== undefined) {\n if (this.value instanceof Array) {\n for (const v of this.value) {\n headers = headers.append(this.name, this.serializeValue(v));\n }\n } else {\n headers = headers.append(\n this.name,\n this.serializeValue(this.value),\n );\n }\n }\n return headers;\n }\n}\n\n/**\n * Helper to build http requests from parameters\n */\nexport class RequestBuilder {\n private _path = new Map();\n private _query = new Map();\n private _header = new Map();\n _bodyContent: any | null;\n _bodyContentType?: string;\n\n constructor(\n public rootUrl: string,\n public operationPath: string,\n public method: string,\n ) {}\n\n /**\n * Sets a path parameter\n */\n path(name: string, value: any, options?: ParameterOptions): void {\n this._path.set(name, new PathParameter(name, value, options || {}));\n }\n\n /**\n * Sets a query parameter\n */\n query(name: string, value: any, options?: ParameterOptions): void {\n this._query.set(name, new QueryParameter(name, value, options || {}));\n }\n\n /**\n * Sets a header parameter\n */\n header(name: string, value: any, options?: ParameterOptions): void {\n this._header.set(name, new HeaderParameter(name, value, options || {}));\n }\n\n /**\n * Sets the body content, along with the content type\n */\n body(value: any, contentType = 'application/json'): void {\n if (value instanceof Blob) {\n this._bodyContentType = value.type;\n } else {\n this._bodyContentType = contentType;\n }\n if (\n this._bodyContentType === 'application/x-www-form-urlencoded' &&\n value !== null &&\n typeof value === 'object'\n ) {\n // Handle URL-encoded data\n const pairs: Array<[string, string]> = [];\n for (const key of Object.keys(value)) {\n let val = value[key];\n if (!(val instanceof Array)) {\n val = [val];\n }\n for (const v of val) {\n const formValue = this.formDataValue(v);\n if (formValue !== null) {\n pairs.push([key, formValue]);\n }\n }\n }\n this._bodyContent = pairs\n .map(\n (p) =>\n `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`,\n )\n .join('&');\n } else if (this._bodyContentType === 'multipart/form-data') {\n // Handle multipart form data\n const formData = new FormData();\n if (value !== null && value !== undefined) {\n for (const key of Object.keys(value)) {\n const val = value[key];\n if (val instanceof Array) {\n for (const v of val) {\n const toAppend = this.formDataValue(v);\n if (toAppend !== null) {\n formData.append(key, toAppend);\n }\n }\n } else {\n const toAppend = this.formDataValue(val);\n if (toAppend !== null) {\n formData.set(key, toAppend);\n }\n }\n }\n }\n this._bodyContent = formData;\n } else {\n // The body is the plain content\n this._bodyContent = value;\n }\n }\n\n private formDataValue(value: any): any {\n if (value === null || value === undefined) {\n return null;\n }\n if (value instanceof Blob) {\n return value;\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n }\n\n /**\n * Builds the request with the current set parameters\n */\n build(options?: {\n /** Which content types to accept */\n accept?: string;\n\n /** The expected response type */\n responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';\n\n /** Whether to report progress on uploads / downloads */\n reportProgress?: boolean;\n\n /** Allow passing HttpContext for HttpClient */\n context?: HttpContext;\n }): HttpRequest {\n options = options || {};\n\n // Path parameters\n let path = this.operationPath;\n for (const pathParam of this._path.values()) {\n path = pathParam.append(path);\n }\n const url = this.rootUrl + path;\n\n // Query parameters\n let httpParams = new HttpParams({\n encoder: ParameterCodecInstance,\n });\n for (const queryParam of this._query.values()) {\n httpParams = queryParam.append(httpParams);\n }\n\n // Header parameters\n let httpHeaders = new HttpHeaders();\n if (options.accept) {\n httpHeaders = httpHeaders.append('Accept', options.accept);\n }\n for (const headerParam of this._header.values()) {\n httpHeaders = headerParam.append(httpHeaders);\n }\n\n // Request content headers\n if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {\n httpHeaders = httpHeaders.set(\n 'Content-Type',\n this._bodyContentType,\n );\n }\n\n // Perform the request\n return new HttpRequest(\n this.method.toUpperCase(),\n url,\n this._bodyContent,\n {\n params: httpParams,\n headers: httpHeaders,\n responseType: options.responseType,\n reportProgress: options.reportProgress,\n context: options.context,\n },\n );\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpClient, HttpResponse, HttpContext } from '@angular/common/http';\nimport { Observable, lastValueFrom, map, filter } from 'rxjs';\n\nimport { LoginUAEPassUser, LoginUser } from '../models/login-user';\nimport { LoggedInUser, User } from '../models/user';\n\nimport { ApiConfiguration } from '../configs/api-configuration';\nimport { BaseApiClient } from '../configs/base-api-client';\nimport { RequestBuilder } from '../helpers/request-builder';\nimport { StrictHttpResponse } from '../helpers/strict-http-response';\nimport { NewUser } from '../models/new-user';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserAndAuthenticationApiClientService extends BaseApiClient {\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n const config = inject(ApiConfiguration);\n const http = inject(HttpClient);\n\n super(config, http);\n }\n\n /**\n * Path part for operation login\n */\n static readonly LoginPath = '/login/';\n static readonly UAEPassLoginPath = 'uae-pass/login/';\n\n static readonly loginPaths = {\n login: '/login/',\n UAEPass: '/uae-pass/login/',\n };\n\n /**\n * Existing user login.\n *\n * Login for existing user\n *\n * This method provides access to the full `HttpResponse`, allowing access to response headers.\n * To access only the response body, use `login()` instead.\n *\n * This method sends `application/json` and handles request body of type `application/json`.\n */\n login$Response(\n params: {\n body;\n },\n key: string,\n context?: HttpContext,\n ): Observable> {\n const rb = new RequestBuilder(\n this.rootUrl,\n UserAndAuthenticationApiClientService.loginPaths[key],\n 'post',\n );\n if (params) {\n rb.body(params.body, 'application/json');\n }\n\n return this.http\n .request(\n rb.build({\n responseType: 'json',\n accept: 'application/json',\n context: context,\n }),\n )\n .pipe(\n filter((r) => r instanceof HttpResponse),\n map((r) => {\n return r as StrictHttpResponse<{\n session_key: string;\n }>;\n }),\n );\n }\n\n /**\n * Existing user login.\n *\n * Login for existing user\n *\n * This method provides access only to the response body.\n * To access the full response (for headers, for example), `login$Response()` instead.\n *\n * This method sends `application/json` and handles request body of type `application/json`.\n */\n login(\n params: {\n body: LoginUser;\n },\n key: string,\n context?: HttpContext,\n ): Promise<{ session_key: string }> {\n return lastValueFrom(\n this.login$Response(params, key, context).pipe(\n map(\n (\n r: StrictHttpResponse<{\n session_key: string;\n }>,\n ) =>\n r.body as {\n session_key: string;\n },\n ),\n ),\n );\n }\n\n uaePassLogin(\n params: {\n body: LoginUAEPassUser;\n },\n key: string,\n context?: HttpContext,\n ): Promise<{\n session_key?: string;\n logout_redirect?: string;\n registration_id?: string;\n }> {\n return lastValueFrom(\n this.login$Response(params, key, context).pipe(\n map(\n (r) =>\n r.body as {\n session_key?: string;\n logout_redirect?: string;\n registration_id?: string;\n },\n ),\n ),\n );\n }\n\n /**\n * Path part for operation createUser\n */\n static readonly CreateUserPath = '/register/';\n\n /**\n * Register a new user\n *\n * This method provides access to the full `HttpResponse`, allowing access to response headers.\n * To access only the response body, use `createUser()` instead.\n *\n * This method sends `application/json` and handles request body of type `application/json`.\n */\n createUser$Response(\n params: {\n /**\n * Details of the new user to register\n */\n body: NewUser;\n },\n context?: HttpContext,\n ): Observable<\n StrictHttpResponse<{\n user: User;\n }>\n > {\n const rb = new RequestBuilder(\n this.rootUrl,\n UserAndAuthenticationApiClientService.CreateUserPath,\n 'post',\n );\n if (params) {\n rb.body(params.body, 'application/json');\n }\n\n return this.http\n .request(\n rb.build({\n responseType: 'json',\n accept: 'application/json',\n context: context,\n }),\n )\n .pipe(\n filter((r) => r instanceof HttpResponse),\n map((r) => {\n return r as StrictHttpResponse<{\n user: User;\n }>;\n }),\n );\n }\n\n /**\n * Register a new user\n *\n * This method provides access only to the response body.\n * To access the full response (for headers, for example), `createUser$Response()` instead.\n *\n * This method sends `application/json` and handles request body of type `application/json`.\n */\n createUser(\n params: {\n /**\n * Details of the new user to register\n */\n body: NewUser;\n },\n context?: HttpContext,\n ): Promise<{\n user: User;\n }> {\n return lastValueFrom(\n this.createUser$Response(params, context).pipe(\n map(\n (\n r: StrictHttpResponse<{\n user: User;\n }>,\n ) =>\n r.body as {\n user: User;\n },\n ),\n ),\n );\n }\n\n /**\n * Path part for operation getCurrentUser\n */\n static readonly GetCurrentUserPath = '/profile/';\n\n /**\n * Get current user.\n *\n * Gets the currently logged-in user\n *\n * This method provides access to the full `HttpResponse`, allowing access to response headers.\n * To access only the response body, use `getCurrentUser()` instead.\n *\n * This method doesn't expect any request body.\n */\n getCurrentUser$Response(\n params?: object,\n context?: HttpContext,\n ): Observable<\n StrictHttpResponse<{\n user: LoggedInUser;\n }>\n > {\n const rb = new RequestBuilder(\n this.rootUrl,\n UserAndAuthenticationApiClientService.GetCurrentUserPath,\n 'get',\n );\n\n return this.http\n .request(\n rb.build({\n responseType: 'json',\n accept: 'application/json',\n context: context,\n }),\n )\n .pipe(\n filter((r) => r instanceof HttpResponse),\n map((r) => {\n return r as StrictHttpResponse<{\n user: LoggedInUser;\n }>;\n }),\n );\n }\n\n /**\n * Get current user.\n *\n * Gets the currently logged-in user\n *\n * This method provides access only to the response body.\n * To access the full response (for headers, for example), `getCurrentUser$Response()` instead.\n *\n * This method doesn't expect any request body.\n */\n getCurrentUser(\n params?: object,\n context?: HttpContext,\n ): Promise<{\n user: LoggedInUser;\n }> {\n return lastValueFrom(\n this.getCurrentUser$Response(params, context).pipe(\n map(\n (\n r: StrictHttpResponse<{\n user: LoggedInUser;\n }>,\n ) =>\n r.body as {\n user: LoggedInUser;\n },\n ),\n ),\n );\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject } from 'rxjs';\nimport { environment } from '../../../environments/environment';\nimport { User } from '../models/user';\nimport { UserAndAuthenticationApiClientService } from '../services/user-and-authentication-api-client.service';\n\nexport type AuthStatus = 'idle' | 'authenticated' | 'unauthenticated';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthService {\n private httpClient = inject(HttpClient);\n private document = inject(DOCUMENT);\n\n readonly #userAndAuthenticationApiClient = inject(\n UserAndAuthenticationApiClientService,\n );\n readonly #router = inject(Router);\n\n public user$: BehaviorSubject<\n | {\n user: User;\n is_uaepass_session?: boolean;\n }\n | { user: null; is_uaepass_session?: boolean }\n > = new BehaviorSubject(JSON.parse(localStorage.getItem('gsr-user')!));\n public status$: BehaviorSubject = new BehaviorSubject('idle');\n private baseUrl: string;\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n this.baseUrl = environment.urls.api;\n }\n\n public get userValue() {\n return this.user$.value;\n }\n\n async refresh(navigateAfterRefresh = false) {\n const token = localStorage.getItem('gsr-user-token');\n if (!token) {\n this.user$.next({ user: null });\n this.status$.next('unauthenticated');\n return;\n }\n\n // TODO: better handling\n const currentUserResponse = await this.#userAndAuthenticationApiClient\n .getCurrentUser()\n .catch(({ error }: HttpErrorResponse) => {\n console.error(`error refreshing user -->`, error);\n localStorage.removeItem('gsr-user');\n localStorage.removeItem('gsr-user-token');\n this.user$.next({ user: null });\n this.#router.navigate(['/login']);\n return { user: null };\n });\n\n this.user$.next(currentUserResponse);\n\n if (navigateAfterRefresh) {\n this.#router.navigate(['/home/dashboard']);\n }\n\n localStorage.setItem('gsr-user', JSON.stringify(currentUserResponse));\n }\n\n public authenticate() {\n this.refresh(true).then(() => {\n this.status$.next(\n this.user$.value ? 'authenticated' : 'unauthenticated',\n );\n });\n }\n\n public logout() {\n this.httpClient\n .post<{ logout_redirect: string }>(`${this.baseUrl}/logout/`, null)\n .subscribe((data) => {\n // remove user from local storage to log user out\n localStorage.removeItem('gsr-user');\n localStorage.removeItem('gsr-user-token');\n this.user$.next({ user: null });\n this.document.location.href = data.logout_redirect;\n });\n\n // this.document.location.href = \"/\";\n }\n}\n"],"names":["ApiConfiguration","rootUrl","environment","urls","api","factory","ɵfac","providedIn","BaseApiClient","config","inject","ApiConfiguration","http","HttpClient","constructor","_rootUrl","rootUrl","factory","ɵfac","ParameterCodec","encodeKey","key","encodeURIComponent","encodeValue","value","decodeKey","decodeURIComponent","decodeValue","ParameterCodecInstance","Parameter","name","options","constructor","defaultStyle","defaultExplode","style","undefined","explode","serializeValue","separator","Array","map","v","split","join","array","Object","keys","propVal","push","String","PathParameter","append","path","prefix","alreadySerialized","replace","result","QueryParameter","params","HeaderParameter","headers","RequestBuilder","rootUrl","operationPath","method","_path","Map","_query","_header","_bodyContent","_bodyContentType","set","query","header","body","contentType","Blob","type","pairs","val","formValue","formDataValue","p","formData","FormData","toAppend","JSON","stringify","build","pathParam","values","url","httpParams","HttpParams","encoder","queryParam","httpHeaders","HttpHeaders","accept","headerParam","HttpRequest","toUpperCase","responseType","reportProgress","context","UserAndAuthenticationApiClientService","BaseApiClient","constructor","config","inject","ApiConfiguration","http","HttpClient","LoginPath","UAEPassLoginPath","loginPaths","login","UAEPass","login$Response","params","key","context","rb","RequestBuilder","rootUrl","body","request","build","responseType","accept","pipe","filter","r","HttpResponse","map","lastValueFrom","uaePassLogin","CreateUserPath","createUser$Response","createUser","GetCurrentUserPath","getCurrentUser$Response","getCurrentUser","factory","ɵfac","providedIn","AuthService","httpClient","inject","HttpClient","document","DOCUMENT","#userAndAuthenticationApiClient","UserAndAuthenticationApiClientService","#router","Router","user$","BehaviorSubject","JSON","parse","localStorage","getItem","status$","baseUrl","constructor","environment","urls","api","userValue","value","refresh","navigateAfterRefresh","__async","next","user","currentUserResponse","getCurrentUser","catch","error","console","removeItem","navigate","setItem","stringify","authenticate","then","logout","post","subscribe","data","location","href","logout_redirect","factory","ɵfac","providedIn"],"mappings":";;kJASA,IAAaA,GAAgB,IAAA,CAAvB,MAAOA,CAAgB,CACzBC,QAAkBC,EAAYC,KAAKC,+CAD1BJ,EAAgB,6BAAhBA,EAAgBK,QAAhBL,EAAgBM,UAAAC,WAFb,MAAM,CAAA,SAETP,CAAgB,GAAA,ECD7B,IAAaQ,GAAa,IAAA,CAApB,MAAOA,CAAa,CACZC,OAASC,EAAOC,CAAgB,EAChCC,KAAOF,EAAOG,CAAU,EAKlCC,aAAA,CAAe,CAEPC,SAAmB,GAM3B,IAAIC,SAAO,CACP,OAAO,KAAKD,UAAY,KAAKN,OAAOO,OACxC,CAKA,IAAIA,QAAQA,EAAe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