{"version":3,"file":"ngx-cookie.mjs","sources":["../../../projects/ngx-cookie/src/lib/tokens.ts","../../../projects/ngx-cookie/src/lib/utils.ts","../../../projects/ngx-cookie/src/lib/cookie-options.provider.ts","../../../projects/ngx-cookie/src/lib/cookie.service.ts","../../../projects/ngx-cookie/src/lib/cookie-writer.service.ts","../../../projects/ngx-cookie/src/lib/cookie.factory.ts","../../../projects/ngx-cookie/src/lib/cookie.module.ts","../../../projects/ngx-cookie/src/public-api.ts","../../../projects/ngx-cookie/src/ngx-cookie.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\n\r\nimport { CookieOptions, ICookieWriterService } from './cookie.model';\r\n\r\nexport const COOKIE_OPTIONS = new InjectionToken<CookieOptions>('COOKIE_OPTIONS');\r\nexport const COOKIE_WRITER = new InjectionToken<ICookieWriterService>('COOKIE_WRITER');\r\n","import { CookieDict, CookieOptions } from './cookie.model';\r\n\r\ntype EmptyArray = never[] & { length: 0 };\r\ntype EmptyObject = Record<any, never>;\r\n\r\nexport function isNil(obj: unknown): obj is undefined | null {\r\n  return obj === undefined || obj === null;\r\n}\r\n\r\nexport function isPresent(obj: unknown): obj is Exclude<typeof obj, undefined | null> {\r\n  return !isNil(obj);\r\n}\r\n\r\nexport function isString(obj: unknown): obj is string {\r\n  return typeof obj === 'string';\r\n}\r\n\r\n// noinspection JSUnusedGlobalSymbols\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport function isEmpty(value: unknown): value is undefined | null | '' | EmptyArray | EmptyObject {\r\n  if (isNil(value)) {\r\n    return true;\r\n  }\r\n  // FIXME: This condition will always return 'false' since JavaScript compares objects by reference, not value.ts(2839)\r\n  if (value === {} as unknown) {\r\n    return true;\r\n  }\r\n  if (isString(value) && value.length === 0) {\r\n    return true;\r\n  }\r\n  if (Array.isArray(value) && value.length === 0) {\r\n    return true;\r\n  }\r\n  if (typeof value !== 'boolean' && !value) {\r\n    return true;\r\n  }\r\n  // noinspection RedundantIfStatementJS\r\n  if (typeof value === 'object' && Object.keys(value).length === 0 && value.constructor === Object) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function mergeOptions(oldOptions: CookieOptions, newOptions?: CookieOptions): CookieOptions {\r\n  if (!newOptions) {\r\n    return oldOptions;\r\n  }\r\n  return {\r\n    path: isPresent(newOptions.path) ? newOptions.path : oldOptions.path,\r\n    domain: isPresent(newOptions.domain) ? newOptions.domain : oldOptions.domain,\r\n    expires: isPresent(newOptions.expires) ? newOptions.expires : oldOptions.expires,\r\n    secure: isPresent(newOptions.secure) ? newOptions.secure : oldOptions.secure,\r\n    sameSite: isPresent(newOptions.sameSite) ? newOptions.sameSite : oldOptions.sameSite,\r\n    httpOnly: isPresent(newOptions.httpOnly) ? newOptions.httpOnly : oldOptions.httpOnly,\r\n    storeUnencoded: isPresent(newOptions.storeUnencoded) ? newOptions.storeUnencoded : oldOptions.storeUnencoded\r\n  };\r\n}\r\n\r\nexport function parseCookieString(currentCookieString: string): CookieDict {\r\n  let lastCookies: CookieDict = {};\r\n  let lastCookieString = '';\r\n  let cookieArray: string[];\r\n  let cookie: string;\r\n  let i: number;\r\n  let index: number;\r\n  let name: string;\r\n  if (currentCookieString !== lastCookieString) {\r\n    lastCookieString = currentCookieString;\r\n    cookieArray = lastCookieString.split(';');\r\n    lastCookies = {};\r\n    for (i = 0; i < cookieArray.length; i++) {\r\n      cookie = cookieArray[i];\r\n      index = cookie.indexOf('=');\r\n      if (index > 0) {  // ignore nameless cookies\r\n        name = safeDecodeURIComponent((cookie.substring(0, index)).trim());\r\n        // the first value that is seen for a cookie is the most\r\n        // specific one.  values for the same cookie name that\r\n        // follow are for less specific paths.\r\n        if (isNil((lastCookies)[name])) {\r\n          lastCookies[name] = safeDecodeURIComponent((cookie.substring(index + 1)).trim());\r\n        }\r\n      }\r\n    }\r\n  }\r\n  return lastCookies;\r\n}\r\n\r\nexport function buildCookieString(name: string, value: string | undefined, options?: CookieOptions): string {\r\n  let expires: string | Date | undefined = options?.expires;\r\n  let val: string;\r\n  if (isNil(value)) {\r\n    expires = 'Thu, 01 Jan 1970 00:00:00 GMT';\r\n    val = '';\r\n  } else {\r\n    val = value as string;\r\n  }\r\n  if (isString(expires)) {\r\n    expires = new Date(expires);\r\n  }\r\n  const cookieValue = options?.storeUnencoded ? value : encodeURIComponent(val);\r\n  let str = encodeURIComponent(name) + '=' + cookieValue;\r\n  str += options?.path ? ';path=' + options.path : '';\r\n  str += options?.domain ? ';domain=' + options.domain : '';\r\n  str += expires ? ';expires=' + expires.toUTCString() : '';\r\n  str += options?.sameSite ? '; SameSite=' + options.sameSite : '';\r\n  str += options?.secure ? ';secure' : '';\r\n  str += options?.httpOnly ? '; HttpOnly' : '';\r\n\r\n  // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\r\n  // - 300 cookies\r\n  // - 20 cookies per unique domain\r\n  // - 4096 bytes per cookie\r\n  const cookieLength = str.length + 1;\r\n  if (cookieLength > 4096) {\r\n    console.log('Cookie \\'' + name + '\\' possibly not set or overflowed because it was too large (' + cookieLength + ' > 4096 bytes)!');\r\n  }\r\n  return str;\r\n}\r\n\r\nexport function safeDecodeURIComponent(str: string): string {\r\n  try {\r\n    return decodeURIComponent(str);\r\n  } catch (e) {\r\n    return str;\r\n  }\r\n}\r\n","import { APP_BASE_HREF } from '@angular/common';\r\nimport { Inject, Injectable, Injector } from '@angular/core';\r\n\r\nimport { CookieOptions } from './cookie.model';\r\nimport { COOKIE_OPTIONS } from './tokens';\r\nimport { mergeOptions } from './utils';\r\n\r\n@Injectable()\r\nexport class CookieOptionsProvider {\r\n\r\n  readonly options: CookieOptions;\r\n  private readonly defaultOptions: CookieOptions;\r\n\r\n  constructor(@Inject(COOKIE_OPTIONS) options: CookieOptions = {},\r\n              private injector: Injector) {\r\n    this.defaultOptions = {\r\n      path: this.injector.get(APP_BASE_HREF, '/'),\r\n      domain: undefined,\r\n      expires: undefined,\r\n      secure: false,\r\n      httpOnly: false\r\n    };\r\n    this.options = mergeOptions(this.defaultOptions, options);\r\n  }\r\n\r\n}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable } from '@angular/core';\r\nimport { CookieOptionsProvider } from './cookie-options.provider';\r\n\r\nimport { CookieDict, CookieOptions, ICookieService, ICookieWriterService } from './cookie.model';\r\nimport { COOKIE_WRITER } from './tokens';\r\nimport { isNil, isPresent, mergeOptions, parseCookieString } from './utils';\r\n\r\n@Injectable()\r\nexport class CookieService implements ICookieService {\r\n\r\n  protected options: CookieOptions;\r\n\r\n  constructor(@Inject(DOCUMENT) private document: any,\r\n              private optionsProvider: CookieOptionsProvider,\r\n              @Inject(COOKIE_WRITER) private cookieWriterService: ICookieWriterService) {\r\n    this.options = this.optionsProvider.options;\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Returns if the given cookie key exists or not.\r\n   *\r\n   * @param key Id to use for lookup.\r\n   * @returns true if key exists, otherwise false.\r\n   */\r\n  hasKey(key: string): boolean {\r\n    const value = this.get(key);\r\n    return isPresent(value);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Returns the value of given cookie key.\r\n   *\r\n   * @param key Id to use for lookup.\r\n   * @returns Raw cookie value.\r\n   */\r\n  get(key: string): string | undefined {\r\n    return this.getAll()?.[key];\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Returns the deserialized value of given cookie key.\r\n   *\r\n   * @param key Id to use for lookup.\r\n   * @returns Deserialized cookie value.\r\n   */\r\n  getObject(key: string): object | undefined {\r\n    const value = this.get(key);\r\n    if (isNil(value)) {\r\n      return undefined;\r\n    } else if (value === '') {\r\n      return {};\r\n    }\r\n    return JSON.parse(value);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Returns a key value object with all the cookies.\r\n   *\r\n   * @returns All cookies\r\n   */\r\n  getAll(): CookieDict {\r\n    const cookieString = this.cookieWriterService.readAllAsString();\r\n    return parseCookieString(cookieString);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Sets a value for given cookie key.\r\n   *\r\n   * @param key Id for the `value`.\r\n   * @param value Raw value to be stored.\r\n   * @param options (Optional) Options object.\r\n   */\r\n  put(key: string, value: string | undefined, options?: CookieOptions): void {\r\n    const opts = mergeOptions(this.options, options);\r\n    this.cookieWriterService.write(key, value, opts);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Serializes and sets a value for given cookie key.\r\n   *\r\n   * @param key Id for the `value`.\r\n   * @param value Value to be stored.\r\n   * @param options (Optional) Options object.\r\n   */\r\n  putObject(key: string, value: object, options?: CookieOptions): void {\r\n    this.put(key, JSON.stringify(value), options);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Remove given cookie.\r\n   *\r\n   * @param key Id of the key-value pair to delete.\r\n   * @param options (Optional) Options object.\r\n   */\r\n  remove(key: string, options?: CookieOptions): void {\r\n    this.put(key, undefined, options);\r\n  }\r\n\r\n  /**\r\n   * @description\r\n   * Remove all cookies.\r\n   */\r\n  removeAll(options?: CookieOptions): void {\r\n    const cookies = this.getAll();\r\n    Object.keys(cookies).forEach(key => this.remove(key, options));\r\n  }\r\n\r\n}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { Inject, Injectable } from '@angular/core';\r\n\r\nimport { CookieOptions, ICookieWriterService } from './cookie.model';\r\nimport { buildCookieString } from './utils';\r\n\r\n@Injectable()\r\nexport class CookieWriterService implements ICookieWriterService {\r\n\r\n  constructor(@Inject(DOCUMENT) private document: any) {}\r\n\r\n  readAllAsString(): string {\r\n    return this.document.cookie || '';\r\n  }\r\n\r\n  write(name: string, value: string | undefined, options?: CookieOptions): void {\r\n    this.document.cookie = buildCookieString(name, value, options);\r\n  }\r\n\r\n}\r\n","import { CookieOptionsProvider } from './cookie-options.provider';\r\nimport { ICookieWriterService } from './cookie.model';\r\nimport { CookieService } from './cookie.service';\r\n\r\nexport function cookieServiceFactory(document: Document,\r\n                                     cookieOptionsProvider: CookieOptionsProvider,\r\n                                     cookieWriterService: ICookieWriterService): CookieService {\r\n  return new CookieService(document, cookieOptionsProvider, cookieWriterService);\r\n}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule } from '@angular/core';\r\nimport { CookieWriterService } from './cookie-writer.service';\r\n\r\nimport { CookieOptions } from './cookie.model';\r\nimport { CookieOptionsProvider } from './cookie-options.provider';\r\nimport { cookieServiceFactory } from './cookie.factory';\r\nimport { CookieService } from './cookie.service';\r\nimport { COOKIE_OPTIONS, COOKIE_WRITER } from './tokens';\r\n\r\n\r\n@NgModule({\r\n  providers: [CookieOptionsProvider]\r\n})\r\nexport class CookieModule {\r\n\r\n  /**\r\n   * Use this method in your root module to provide the CookieService\r\n   */\r\n  static withOptions(options: CookieOptions = {}): ModuleWithProviders<CookieModule> {\r\n    return {\r\n      ngModule: CookieModule,\r\n      providers: [\r\n        {provide: COOKIE_OPTIONS, useValue: options},\r\n        {provide: COOKIE_WRITER, useClass: CookieWriterService},\r\n        {provide: CookieService, useFactory: cookieServiceFactory, deps: [DOCUMENT, CookieOptionsProvider, COOKIE_WRITER]}\r\n      ]\r\n    };\r\n  }\r\n\r\n  /**\r\n   * @deprecated use `CookieModule.withOptions()` instead\r\n   * Use this method in your root module to provide the CookieService\r\n   */\r\n  static forRoot(options: CookieOptions = {}): ModuleWithProviders<CookieModule> {\r\n    return this.withOptions(options);\r\n  }\r\n\r\n  /**\r\n   * @deprecated use `CookieModule.withOptions()` instead\r\n   * Use this method in your other (non root) modules to import the directive/pipe\r\n   */\r\n  static forChild(options: CookieOptions = {}): ModuleWithProviders<CookieModule> {\r\n    return this.withOptions(options);\r\n  }\r\n\r\n}\r\n","/*\r\n * Public API Surface of ngx-cookie\r\n */\r\n\r\nexport * from './lib/tokens';\r\nexport * from './lib/cookie.service';\r\nexport * from './lib/cookie.module';\r\nexport * from './lib/cookie.model';\r\nexport * from './lib/cookie-options.provider';\r\nexport * from './lib/cookie-writer.service';\r\nexport * from './lib/cookie.factory';\r\nexport * from './lib/utils';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\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