{"version":3,"file":"toolbox-utilities.mjs","sources":["../../../projects/toolbox/utilities/arrays.ts","../../../projects/toolbox/utilities/dates.ts","../../../projects/toolbox/utilities/numbers.ts","../../../projects/toolbox/utilities/objects.ts","../../../projects/toolbox/utilities/random.ts","../../../projects/toolbox/utilities/strings.ts","../../../projects/toolbox/utilities/subsink.ts","../../../projects/toolbox/utilities/clock.service.ts","../../../projects/toolbox/utilities/toolbox-utilities.ts"],"sourcesContent":["/**\r\n * Indicates whether the specified value is array.\r\n * @param value The value to test.\r\n * @returns true if the value is an array, false otherwise.\r\n */\r\nexport const isArray = ( value: any ): boolean =>\r\n  Array.isArray( value ) || ( Boolean( value ) ) && typeof value.length === \"number\";\r\n\r\n/**\r\n * Indicates whether the specified value is not an array.\r\n * @param value The value to test.\r\n * @returns true if the value is not an array, false otherwise.\r\n */\r\nexport const isNotArray = ( value: any ): boolean => !isArray( value );\r\n\r\n/**\r\n * Indicates whether the specified value is an empty array.\r\n * @param value The value to test.\r\n * @returns true if the value is an empty array, false otherwise.\r\n */\r\nexport const isEmpty = ( value: any ): value is [any] =>\r\n  !isArray( value ) ? true : value.length === 0;\r\n\r\n/**\r\n * Indicates whether the specified value is an array and not empty.\r\n * @param value The value to test.\r\n * @returns true if the value is an array and not empty.\r\n */\r\nexport const isNotEmpty = ( value: any ): boolean => !isEmpty( value );\r\n","/**\r\n * Indicates whether the specified value is a date. This function does not handle\r\n * the numeric representation of a date (it is considered invalid).\r\n * @param value The date to test.\r\n * @returns true if the value is a date, false otherwise.\r\n */\r\nexport const isDate = ( value: unknown ): value is Date =>\r\n  toDate( value ) !== null ||\r\n  toIsoDate( value ) !== null;\r\n\r\n/**\r\n * Indicates whether the specified value is not a date.\r\n * @param value The value to test.\r\n * @returns true if the value is not a date, false otherwise.\r\n */\r\nexport const isNotDate = ( value: unknown ): value is Date => !isDate( value );\r\n\r\n/**\r\n * Indicates whether the specified value is a date by LACERA standards where\r\n * 1/1/1900 is considered the default value and not a valid date.\r\n * @param date The date to test.\r\n * @returns true if the value is a LACERA date, false otherwise.\r\n */\r\nexport const isDateValid = ( date: unknown ): date is Date =>\r\n{\r\n  if( isDateObject( date ) )\r\n  {\r\n    return ( date as Date ).getFullYear() > 1900;\r\n  }\r\n\r\n  const convertedDate = toDate( date );\r\n\r\n  return convertedDate !== null && convertedDate.getFullYear() > 1900;\r\n};\r\n\r\n/**\r\n * Indicates whether the specified value is not a date by LACERA standards where\r\n * 1/1/1900 is considered the default value and not a valid date.\r\n * @param date The date to test.\r\n * @returns true if the value is a LACERA date, false otherwise.\r\n */\r\nexport const isDateNotValid = ( date: unknown ): date is Date => !isDateValid( date );\r\n\r\n/**\r\n * Indicates whether the specified value is an ISO 8601 date.\r\n * @param value The value to test.\r\n * @returns true if the value is a valid ISO 8601 date, false otherwise.\r\n */\r\nexport const isDateIso = ( value: unknown ): boolean =>\r\n{\r\n  // 2081-06-26T07:00:00.000Z\r\n  const regex = /^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(\\.\\d+)?(([+-]\\d\\d:\\d\\d)|Z)?$/i;\r\n\r\n  return regex.test( value as string );\r\n};\r\n\r\n/**\r\n * Indicates whether the specified value is a date and later than 1/1/1900.\r\n * @param date The value to test.\r\n * @returns true if the value is LACERA valid, false otherwise.\r\n */\r\nexport const isDateLaceraValid = ( date?: unknown ): boolean =>\r\n{\r\n  if( date == null )\r\n  {\r\n    return false;\r\n  }\r\n\r\n  let year = 0;\r\n\r\n  if( date instanceof Date && !isNaN( date.valueOf() ) )\r\n  {\r\n    year = date.getFullYear();\r\n  }\r\n  else if( typeof date === \"string\" )\r\n  {\r\n    const parts = date.split( /[.,/ -]/ );\r\n\r\n    if( parts.length >= 2 )\r\n    {\r\n      year = parts[0].length === 4 ? +parts[0] : +parts[2];\r\n    }\r\n  }\r\n\r\n  return year > 1900;\r\n};\r\n\r\n/**\r\n * Indicates whether the specified value is of type {@link Date}.\r\n * @param date The value to test.\r\n * @returns true if the value is a Date, false otherwise.\r\n */\r\nexport const isDateObject = ( date?: unknown ): boolean =>\r\n  date instanceof Date && !isNaN( date.valueOf() );\r\n\r\n/**\r\n * Converts a value to a {@link Date} object if value is a valid ISO 8601 date.\r\n * @param value The value to convert to a date.\r\n * @returns The value as a {@link Date} or null if not valid.\r\n */\r\nexport const toIsoDate = ( value: unknown ): Date | null =>\r\n  isDateIso( value ) ? new Date( value as string ) : null;\r\n\r\n/**\r\n * Converts a value to a {@link Date} object if possible.\r\n * @param value The value to convert to a date.\r\n * @returns The value as a {@link Date} or null if not valid.\r\n */\r\n// eslint-disable-next-line complexity\r\nexport const toDate = ( value: unknown ): Date | null =>\r\n{\r\n  if( isDateObject( value ) )\r\n  {\r\n    return value as Date;\r\n  }\r\n\r\n  if( typeof value === \"number\" && !isNaN( value ) )\r\n  {\r\n    return new Date( value );\r\n  }\r\n\r\n  if( typeof value !== \"string\" )\r\n  {\r\n    return null;\r\n  }\r\n\r\n  let month = 0;\r\n  let day = 0;\r\n  let year = 0;\r\n\r\n  // mm/dd/yyyy or mm-dd-yyyy\r\n  const localRegEx = /^(\\d{1,2})[-/](\\d{1,2})[-/](\\d{4})$/g;\r\n  let parts = localRegEx.exec( value );\r\n\r\n  if( parts !== null )\r\n  {\r\n    month = +parts[1];\r\n    day = +parts[2];\r\n    year = +parts[3];\r\n  }\r\n  else\r\n  {\r\n    // yyyy-mm-dd (ISO)\r\n    const isoRegEx = /^(\\d{4})-(\\d{1,2})-(\\d{1,2})/g;\r\n    parts = isoRegEx.exec( value );\r\n\r\n    if( parts == null )\r\n    {\r\n      return null;\r\n    }\r\n\r\n    year = +parts[1];\r\n    month = +parts[2];\r\n    day = +parts[3];\r\n  }\r\n\r\n  if( ( month < 1 || month > 12 ) || ( day < 1 || day > 31 ) )\r\n  {\r\n    return null;\r\n  }\r\n\r\n  // Apr, Jun, Sept, and Nov don't have 31 days\r\n  if( ( month === 4 || month === 6 || month === 9 || month === 11 ) && day === 31 )\r\n  {\r\n    return null;\r\n  }\r\n\r\n  if( month === 2 )\r\n  {\r\n    const isLeap = ( year % 4 === 0 && year % 100 !== 0 ) || year % 400 === 0;\r\n    if( day > 29 || ( day === 29 && !isLeap ) )\r\n    {\r\n      return null;\r\n    }\r\n  }\r\n\r\n  const date = new Date( value );\r\n  date.setFullYear( year, month - 1, day );\r\n\r\n  // Make sure the new date matches the original\r\n  return date.getMonth() === month - 1 &&\r\n  date.getDate() === day &&\r\n  date.getFullYear() === year ? date : null;\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/**\r\n * Indicates whether the specified value is a number.\r\n * @param value The value to test.\r\n * @returns true if the value is a number, false otherwise.\r\n */\r\nexport const isNumber = ( value: any ): value is number =>\r\n!isNaN( parseFloat( value ) ) && ( value - parseFloat( value ) + 1 ) >= 0;\r\n\r\n/**\r\n * Indicates whether the specified value is not a number.\r\n * @param value The value to test.\r\n * @returns true if the value is not a number, false otherwise.\r\n */\r\nexport const isNotNumber = ( value: any ): value is number =>!isNumber( value );\r\n\r\n/**\r\n * Indicates whether the specified value is currency (including $ symbol).\r\n * @param value The value to test.\r\n * @returns true if the value is currency, false otherwise.\r\n */\r\nexport const isCurrency = ( value: any ): boolean =>\r\n{\r\n  if( typeof ( value ) === \"string\" )\r\n  {\r\n    return isNumber( value.replace( /[^\\d-]/g, \"\" ) );\r\n  }\r\n\r\n  return isNumber( value );\r\n};\r\n\r\n/**\r\n * Converts the given value to an integer number.\r\n * @param value The value to convert.\r\n * @returns The value represented as a number or NaN.\r\n */\r\nexport const toNumber = ( value: any ): number =>\r\n{\r\n  if( typeof ( value ) === \"string\" )\r\n  {\r\n    return parseInt( value.replace( /[^\\d-]/g, \"\" ), 10 );\r\n  }\r\n\r\n  return value;\r\n};\r\n\r\n/**\r\n * Converts the given value to a floating number.\r\n * @param value The value to convert.\r\n * @returns The value represented as a number or NaN.\r\n */\r\nexport const toFloat = ( value: any ): number =>\r\n{\r\n  if( typeof ( value ) === \"string\" )\r\n  {\r\n    return parseFloat( value.replace( /[^\\d.-]/g, \"\" ) );\r\n  }\r\n\r\n  return value;\r\n};\r\n\r\n/**\r\n * Removes all characters that are not digits from a string.\r\n * @param value The value to strip.\r\n * @param keepCurrency Indicates to keep currency symbols (dash, dot).\r\n * @returns A new string without non-digit characters.\r\n */\r\nexport const stripNonNumbers = ( value: any, keepCurrency = false ): string =>\r\n{\r\n  if( typeof ( value ) === \"string\" )\r\n  {\r\n    return keepCurrency\r\n      ? value.replace( /[^\\d.-]/g, \"\" )\r\n      : value.replace( /\\D/g, \"\" );\r\n  }\r\n\r\n  return value;\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/**\r\n * Indicates whether the specified value is an object.\r\n * @param value The value to test.\r\n * @returns true if the value is an object, false otherwise.\r\n */\r\nexport const isObject = ( value: any ): value is object =>\r\n  value != null && typeof value === \"object\";\r\n\r\n/**\r\n * Indicates whether the specified value is not an object.\r\n * @param value The value to test.\r\n * @returns true if the value is not an object, false otherwise.\r\n */\r\nexport const isNotObject = ( value: any ): value is number => !isObject( value );\r\n\r\n/**\r\n * Indicates whether the specified value is a function.\r\n * @param value The value to test.\r\n * @returns true if the value is a function, false otherwise.\r\n */\r\nexport const isFunction = ( value: any ): value is Function =>\r\n  typeof value === \"function\";\r\n\r\n/**\r\n * Indicates whether the specified value is not a function.\r\n * @param value The value to test.\r\n * @returns true if the value is not a function, false otherwise.\r\n */\r\nexport const isNotFunction = ( value: any ): value is number =>\r\n  !isFunction( value );\r\n\r\n/**\r\n * Indicates whether the specified value is valid/present.\r\n * @param obj The object to test.\r\n * @returns true if the value is present, false otherwise.\r\n */\r\nexport const isPresent = ( obj: any ): boolean => obj != null;\r\n\r\n/**\r\n * Indicates whether the specified value is valid/present.\r\n * @param value The value to test.\r\n * @returns true if the value is present, false otherwise.\r\n */\r\nexport const isInputValueEmpty = ( value: any ): boolean =>\r\n  // We don't check for string here, so it also works with arrays\r\n  value == null || value.length === 0;\r\n","/* eslint-disable prefer-template */\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\nexport declare type TbxRandomStringType =\r\n/** Generate a random string with only numbers. */\r\n  \"Number\" |\r\n\r\n  /** Generate a random string with only letters. */\r\n  \"Letters\" |\r\n\r\n  /** Generate a random string with both letters and number. */\r\n  \"Alpha\" |\r\n\r\n  /** Generate a random string with valid password characters (e.g., #$@) */\r\n  \"Password\";\r\n\r\n/** Numbers used to generate passwords. */\r\nconst NUMBERS = \"0123456789\";\r\n\r\n/** Letters used to generate random strings. */\r\nconst LETTERS = \"ABCDEFGHIJKLMNOPQRSTUVWYZabcdefghijklmnopqrstuvwyz\";\r\n\r\n/** Letters and numbers used to generate random strings. */\r\nconst ALPHA = \"ABCDEFGHIJKLMNOPQRSTUVWYZabcdefghijklmnopqrstuvwyz0123456789\";\r\n\r\n/** Letters and numbers used to generate passwords. */\r\nconst PASSWORD = \"ABCDEFGHIJKLMNOPQRSTUVWYZ0123456789&$+%@#*\";\r\n\r\n/**\r\n * Generate a Globally Unique ID (GUID).\r\n * @param useRandom4 Indicates to use a random string of 4 characters instead of\r\n * the window.crypto API.\r\n * @returns A Globally Unique ID.\r\n */\r\nexport const newGuid = ( useRandom4?: boolean ): string =>\r\n{\r\n  if( useRandom4 !== undefined &&\r\n    useRandom4 &&\r\n    typeof ( window as any ) !== \"undefined\" &&\r\n    typeof ( window.crypto as any ) !== \"undefined\" &&\r\n    typeof ( window.crypto.getRandomValues as any ) !== \"undefined\" )\r\n  {\r\n    // If we have a cryptographically secure PRNG, use that\r\n    // eslint-disable-next-line max-len\r\n    // http://stackoverflow.com/questions/6906916/collisions-when-generating-uuids-in-javascript\r\n    const buf: Uint16Array = new Uint16Array( 8 );\r\n    window.crypto.getRandomValues( buf );\r\n\r\n    // tslint:disable-next-line:prefer-template\r\n    return (\r\n      pad4( buf[0] ) + pad4( buf[1] ) + \"-\" +\r\n      pad4( buf[2] ) + \"-\" + pad4( buf[3] ) + \"-\" +\r\n      pad4( buf[4] ) + \"-\" + pad4( buf[5] ) +\r\n      pad4( buf[6] ) + pad4( buf[7] )\r\n    );\r\n  }\r\n  else\r\n  {\r\n    return `${random4()}${random4()}-` +\r\n      `${random4()}-${random4()}-` +\r\n      `${random4()}-${random4()}` +\r\n      `${random4()}${random4()}`;\r\n  }\r\n};\r\n\r\n/**\r\n * Generates a random string.\r\n * @param length The length of the string to generate. Minimum is 1 character.\r\n * @param type The type of string to generate.\r\n * @param makeUpper Indicates to return the string in uppercase.\r\n * @returns The random string.\r\n */\r\nexport const getString = (\r\n  length: number,\r\n  type: TbxRandomStringType = \"Alpha\",\r\n  makeUpper = false\r\n): string =>\r\n{\r\n  if( length <= 0 )\r\n  {\r\n    throw new Error( `Length request must be at least 1 ({length})` );\r\n  }\r\n\r\n  let text = \"\";\r\n\r\n  for( let i = 0; i < length; i++ )\r\n  {\r\n    switch( type )\r\n    {\r\n      case \"Number\":\r\n        text += NUMBERS.charAt(\r\n          Math.floor( Math.random() * NUMBERS.length ) );\r\n        break;\r\n      case \"Letters\":\r\n        text += LETTERS.charAt(\r\n          Math.floor( Math.random() * LETTERS.length ) );\r\n        break;\r\n      case \"Password\":\r\n        text += PASSWORD.charAt(\r\n          Math.floor( Math.random() * PASSWORD.length ) );\r\n        break;\r\n      case \"Alpha\":\r\n        text += ALPHA.charAt(\r\n          Math.floor( Math.random() * ALPHA.length ) );\r\n    }\r\n  }\r\n\r\n  return makeUpper ? text.toUpperCase() : text;\r\n};\r\n\r\n/**\r\n * Generates a random password.\r\n * @param length The length of the string to generate. Minimum is 1 character.\r\n * @returns The random password.\r\n */\r\nexport const generatePassword = ( length: number ): string =>\r\n  getString( length, \"Password\" );\r\n\r\n/**\r\n * Returns a random value from the specified array of values.\r\n * @param values The array of values.\r\n * @returns One of the specified values.\r\n */\r\nexport const getOneOf = <T>( values: T[] ): T =>\r\n  values[Math.floor( Math.random() * values.length )];\r\n\r\n/**\r\n * Simulates a coin toss.\r\n * @returns True 50% of the time, false the other.\r\n */\r\nexport const coinToss = (): boolean => Math.floor( Math.random() * 2 ) === 0;\r\n\r\n/**\r\n * Generates a random number.\r\n * @param maxValue The exclusive upper bound of the number to be generated. It\r\n * defaults to 10.\r\n * @param minValue The exclusive lower bound of the number to be generated. It\r\n * defaults to 1.\r\n * @returns The random number.\r\n */\r\nexport const getNumber = ( maxValue = 10, minValue: number = 1 ): number =>\r\n{\r\n  if( maxValue <= 0 )\r\n  {\r\n    throw new Error( \"The max value must be greater than zero.\" );\r\n  }\r\n\r\n  return Math.floor( Math.random() * ( maxValue - minValue ) ) + minValue;\r\n};\r\n\r\n/**\r\n * Pads the specified number with zeros to the left.\r\n * @param num The number to pad.\r\n * @returns The padded number up to 4 digits.\r\n */\r\nconst pad4 = ( num: number ): string =>\r\n{\r\n  let ret = num.toString( 16 );\r\n  while( ret.length < 4 )\r\n  {\r\n    ret = \"0\" + ret;\r\n  }\r\n\r\n  return ret;\r\n};\r\n\r\n/**\r\n * Generate a random string of 4 characters.\r\n * @returns A string of 4 characters in length.\r\n */\r\nconst random4 = (): string =>\r\n  Math.floor( ( Math.random() + 1 ) * 0x10000 ).toString( 16 ).substring( 1 );\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { stripNonNumbers } from \"./numbers\";\r\n\r\n/**\r\n * Indicates whether the specified value is null or an empty string.\r\n * @param value The value to test.\r\n * @returns true if the value is null or an empty string.\r\n */\r\nexport const isNullOrEmpty = ( value: any ): boolean =>\r\n  typeof value !== \"string\" || value === \"\";\r\n\r\n/**\r\n * Indicates whether the specified value is not null or not an empty string.\r\n * @param value The value to test.\r\n * @returns true if the value is not null nor an empty string.\r\n */\r\nexport const isNotNullOrEmpty = ( value: any ): value is string =>\r\n  !isNullOrEmpty( value );\r\n\r\n/**\r\n * Indicates whether a specified string is null, empty, or consists only of\r\n * white-space characters.\r\n * @param value The value test.\r\n * @returns true if the string is null, empty, or consists only of\r\n * white-space characters\r\n */\r\nexport const isNullOrWhiteSpace = ( value: any ): value is string =>\r\n  typeof value !== \"string\" || value.trim() === \"\";\r\n\r\n/**\r\n * Indicates whether a specified string is null, empty, or consists only of\r\n * white-space characters.\r\n * @param value The value test.\r\n * @returns true if the string is not null, not empty, nor consists only of\r\n * white-space characters\r\n */\r\nexport const isNotNullOrWhiteSpace = ( value: any ): value is string =>\r\n  !isNullOrWhiteSpace( value );\r\n\r\n/**\r\n * Compares two strings to determine whether they contain the same case-sensitive value.\r\n * @param value1 The first value to test.\r\n * @param value2 The second value to test.\r\n * @returns true if the strings contain the same case-sensitive value, false otherwise.\r\n */\r\nexport const equals = ( value1: any, value2: any ): value1 is string =>\r\n  typeof value1 === \"string\" && typeof value2 === \"string\" && value1 === value2;\r\n\r\n/**\r\n * Determines whether two strings do not contain the same case-sensitive value.\r\n * @param value1 The first value to test.\r\n * @param value2 The second value to test.\r\n * @returns true if the strings do not contain the same case-sensitive value,\r\n * false otherwise.\r\n */\r\nexport const notEquals = ( value1: any, value2: any ): value1 is string =>\r\n  !equals( value1, value2 );\r\n\r\n/**\r\n * Determines whether two strings contain the same case-insensitive value.\r\n * @param value1 The first value to test.\r\n * @param value2 The second value to test.\r\n * @returns true if the strings contain the same case-insensitive value,\r\n * false otherwise.\r\n */\r\nexport const equalsIgnoreCase = ( value1: any, value2: any ): value1 is string =>\r\n  typeof value1 === \"string\" &&\r\n  typeof value2 === \"string\" &&\r\n  value1.toUpperCase() === value2.toUpperCase();\r\n\r\n/**\r\n * Determines whether two strings do not contain the same case-insensitive value.\r\n * @param value1 The first value to test.\r\n * @param value2 The second value to test.\r\n * @returns true if the strings do not contain the same case-insensitive value,\r\n * false otherwise.\r\n */\r\nexport const notEqualsIgnoreCase = ( value1: any, value2: any ): boolean =>\r\n  !equalsIgnoreCase( value1, value2 );\r\n\r\n/**\r\n * Removes all characters that are not digits from a string.\r\n * @param value The value to strip.\r\n * @param keepCurrency Indicates to keep currency symbols (dash, dot).\r\n * @returns A new string without non-digit characters.\r\n */\r\nexport const stripNonDigits = ( value: any, keepCurrency = false ): string =>\r\n  stripNonNumbers( value, keepCurrency );\r\n\r\n/**\r\n * Determines if the given value is a boolean by comparing it to typical true\r\n * values such as 'true', 1, '1', 'on', or 'yes' ignoring case.\r\n * @param value The value to check.\r\n * @returns true if the value is a truthy boolean, false otherwise.\r\n */\r\nexport const isTrue = ( value: any ): boolean =>\r\n{\r\n  let temp = value;\r\n  if( typeof ( value ) === \"string\" )\r\n  {\r\n    temp = value.trim().toLowerCase();\r\n  }\r\n\r\n  switch( temp )\r\n  {\r\n    case true:\r\n    case \"true\":\r\n    case 1:\r\n    case \"1\":\r\n    case \"on\":\r\n    case \"yes\":\r\n      return true;\r\n    default:\r\n      return false;\r\n  }\r\n};\r\n\r\n/**\r\n * Determines if the given value is a valid credit card number.\r\n * @param value The value to check.\r\n * @returns isTrue if the value is a credit card number, false otherwise.\r\n */\r\nexport const isCreditCard = ( value: any ): boolean =>\r\n  typeof value === \"string\" &&\r\n  Boolean( value.match(\r\n    // eslint-disable-next-line max-len\r\n    /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/ ) );\r\n\r\n/**\r\n * Determines if the given value is a valid email address.\r\n * @param value The value to check.\r\n * @returns isTrue if the value is a valid email address, false otherwise.\r\n */\r\nexport const isEmail = ( value: any ): boolean =>\r\n  typeof value === \"string\" &&\r\n  Boolean( value.match(\r\n    // eslint-disable-next-line max-len\r\n    /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/ ) );\r\n\r\n//=====================================================================================\r\n// Social Security Numbers\r\n//=====================================================================================\r\n\r\n/**\r\n * Determines whether the specified value is a valid SSN with or without dashes.\r\n * @param value The SSN to test.\r\n * @returns true if it's a valid SSN, false otherwise.\r\n */\r\nexport const isSsn = ( value: any ): value is string =>\r\n  typeof value === \"string\" && value.replace( /[^0-9]/g, \"\" ).length === 9;\r\n\r\n/**\r\n * Determines whether the specified value is not a valid SSN.\r\n * @param value The SSN to test.\r\n * @returns false if it's not a valid SSN, false otherwise.\r\n */\r\nexport const isNotSsn = ( value: any ): value is string => !isSsn( value );\r\n\r\n/**\r\n * Formats the specified SSN with or without dashes (defaults to add dashes).\r\n * @param value The SSN to format.\r\n * @param addDashes Indicates whether to format with dashes (defaults to true).\r\n * @returns The formatted SSN if valid, otherwise the same value is returned.\r\n */\r\nexport const formatSsn = ( value: any, addDashes = true ): string =>\r\n{\r\n  if( isNotSsn( value ) )\r\n  {\r\n    return value;\r\n  }\r\n\r\n  const ssn = value.replace( /[^0-9]/g, \"\" ) as string;\r\n\r\n  return addDashes\r\n    ? `${ ssn.substring( 0, 3 ) }-${ ssn.substring( 3, 5 ) }-${ ssn.substring( 5 ) }`\r\n    : ssn;\r\n};\r\n\r\n/**\r\n * Masks the SSN by showing only the last 4 digits and x for the rest. It the\r\n * specified SSN is invalid, it simply returns it without throwing an exception.\r\n * @param ssn The SSN to mask.\r\n * @returns The masked SSN.\r\n */\r\nexport const maskSsn = ( ssn: any ): string =>\r\n  isSsn( ssn ) ? `xxx-xx-${ ssn.replace( /[^0-9]/g, \"\" ).substring( 5 ) }` : ssn;\r\n\r\n//=====================================================================================\r\n// Trimming\r\n//=====================================================================================\r\n\r\n/**\r\n * Removes the specified text from the beginning of the string.\r\n * @param text The text to trim.\r\n * @param what The text to remove from the string. Defaults to an empty space.\r\n * @returns The text without the specified text from the start of the string.\r\n */\r\nexport const trimLeft = ( text: string, what = \"\" ): string =>\r\n{\r\n  const pattern = `^[\" + ${ what } + \"]+`;\r\n\r\n  return text.replace( new RegExp( pattern ), \"\" );\r\n};\r\n\r\n/**\r\n * Removes the specified text from the end of the string.\r\n * @param text The text to trim.\r\n * @param what The text to remove from the string. Defaults to an empty space.\r\n * @returns The text without the specified text from the end of the string.\r\n */\r\nexport const trimRight = ( text: string, what = \"\" ): string =>\r\n{\r\n  const pattern = `[\" + ${ what } + \"]+$`;\r\n\r\n  return text.replace( new RegExp( pattern ), \"\" );\r\n};\r\n\r\n//=====================================================================================\r\n// Remove/Add slashes\r\n//=====================================================================================\r\n\r\n/**\r\n * Remove the trailing slash from the specified string, if any.\r\n * @param text The text to remove the trailing slash.\r\n * @returns The string without the trailing slash.\r\n */\r\nexport const removeTrailingSlash = ( text: string ): string =>\r\n{\r\n  let temp = text;\r\n  while( temp.endsWith( \"/\" ) )\r\n  {\r\n    temp = temp.slice( 0, -1 );\r\n  }\r\n\r\n  return temp;\r\n};\r\n\r\n/**\r\n * Remove the leading slash from the specified string, if any.\r\n * @param text The text to remove the leading slash.\r\n * @returns The string without the leading slash.\r\n */\r\nexport const removeLeadingSlash = ( text: string ): string =>\r\n{\r\n  let temp = text;\r\n  while( temp.startsWith( \"/\" ) )\r\n  {\r\n    temp = temp.substring( 1 );\r\n  }\r\n\r\n  return temp;\r\n};\r\n\r\n/**\r\n * Adds a trailing slash to the specified text if it doesn't end with one, but\r\n * it does not add it if the text is null.\r\n * @param text The text to add the trailing slash to.\r\n * @returns The text with a trailing slash.\r\n */\r\nexport const addTrailingSlash = ( text: string ): string =>\r\n  text.endsWith( \"/\" ) ? text : `${ text }/`;\r\n\r\n//=====================================================================================\r\n// Ensure\r\n//=====================================================================================\r\n\r\n/**\r\n * Ensures the text ends with the specified text.\r\n * @param text The text to ensure ends with the specified text.\r\n * @param what The text to end with.\r\n * @returns The text ending with specified text.\r\n */\r\nexport const ensureEndsWith = ( text: string, what: string ): string =>\r\n  text.endsWith( what ) ? text : `${ text }${ what }`;\r\n\r\n/**\r\n * Ensures the text starts with the specified text.\r\n * @param text The text to ensure starts with the specified text.\r\n * @param what The text to start with.\r\n * @returns The text starting with specified text.\r\n */\r\nexport const ensureStartsWith = ( text: string, what: string ): string =>\r\n  text.startsWith( what ) ? text : `${ what }${ text }`;\r\n\r\n/**\r\n * Ensures the given value is not null or undefined by returning\r\n * an empty string if so.\r\n * @param value The value to check.\r\n * @param defaultValue The value to return if null/undefined (default to \"\").\r\n * @returns The value if it's a string, or an empty string if null or undefined.\r\n */\r\nexport const ensureNotNull =\r\n  ( value: string | null | undefined, defaultValue = \"\" ): string =>\r\n  value == null ? defaultValue : value;\r\n","export interface TbxSubscriptionLike\r\n{\r\n  unsubscribe(): void;\r\n}\r\n\r\n/**\r\n * Subscription sink that holds Observable subscriptions until unsubscribe\r\n * is called to release all subscriptions (usually on ngOnDestroy).\r\n */\r\nexport class TbxSubSink\r\n{\r\n  /** The list of subscriptions to maintain. */\r\n  protected subs: TbxSubscriptionLike[] = [];\r\n\r\n  /**\r\n   * Assign subscription to this sink to add it to the tracked subscriptions\r\n   * @example\r\n   *  this.subs.sink = observable$.subscribe(...);\r\n   */\r\n  public set sink( subscription: TbxSubscriptionLike )\r\n  {\r\n    this.subs.push( subscription );\r\n  }\r\n\r\n  /**\r\n   * Add subscriptions to the tracked subscriptions\r\n   * @example\r\n   *  this.subs.add(observable$.subscribe(...));\r\n   */\r\n  public add( ...subscriptions: TbxSubscriptionLike[] ): void\r\n  {\r\n    this.subs = this.subs.concat( subscriptions );\r\n  }\r\n\r\n  /**\r\n   * Unsubscribe to all subscriptions in ngOnDestroy()\r\n   * @example\r\n   *   ngOnDestroy() {\r\n   *     this.subs.unsubscribe();\r\n   *   }\r\n   */\r\n  public unsubscribe(): void\r\n  {\r\n    this.subs.forEach( sub =>\r\n    {\r\n      // tslint:disable-next-line: strict-type-predicates\r\n      if( ( typeof sub.unsubscribe === \"function\" ) )\r\n      {\r\n        sub.unsubscribe();\r\n      }\r\n    } );\r\n\r\n    this.subs = [];\r\n  }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { Observable, timer } from \"rxjs\";\r\nimport { map, share  } from \"rxjs/operators\";\r\n\r\n/** Provides basic clock functions. */\r\n@Injectable( { providedIn: \"root\" } )\r\nexport class TbxClockService\r\n{\r\n  /** The clock Observable. */\r\n  private readonly clockObservable: Observable<Date>;\r\n\r\n  /** Initializes a new instance of the {@link TbxClockService} class. */\r\n  public constructor()\r\n  {\r\n    this.clockObservable = timer( 0, 1000 ).pipe( map( () => new Date() ), share() );\r\n  }\r\n\r\n  /** Gets the current date and time as an {@link Observable}. */\r\n  public get now(): Observable<Date>\r\n  {\r\n    return this.clockObservable;\r\n  }\r\n\r\n  /** Gets the current date and time. */\r\n  // eslint-disable-next-line class-methods-use-this\r\n  public get currentTime(): Date\r\n  {\r\n    return new Date();\r\n  }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;AAIG;AACI,MAAM,OAAO,GAAG,CAAE,KAAU,KACjC,KAAK,CAAC,OAAO,CAAE,KAAK,CAAE,IAAI,CAAE,OAAO,CAAE,KAAK,CAAE,KAAM,OAAO,KAAK,CAAC,MAAM,KAAK;AAE5E;;;;AAIG;AACI,MAAM,UAAU,GAAG,CAAE,KAAU,KAAe,CAAC,OAAO,CAAE,KAAK;AAEpE;;;;AAIG;AACI,MAAM,OAAO,GAAG,CAAE,KAAU,KACjC,CAAC,OAAO,CAAE,KAAK,CAAE,GAAG,IAAI,GAAG,KAAK,CAAC,MAAM,KAAK;AAE9C;;;;AAIG;AACI,MAAM,UAAU,GAAG,CAAE,KAAU,KAAe,CAAC,OAAO,CAAE,KAAK;;AC5BpE;;;;;AAKG;AACI,MAAM,MAAM,GAAG,CAAE,KAAc,KACpC,MAAM,CAAE,KAAK,CAAE,KAAK,IAAI;AACxB,IAAA,SAAS,CAAE,KAAK,CAAE,KAAK;AAEzB;;;;AAIG;AACI,MAAM,SAAS,GAAG,CAAE,KAAc,KAAqB,CAAC,MAAM,CAAE,KAAK;AAE5E;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAE,IAAa,KAAmB;AAE3D,IAAA,IAAI,YAAY,CAAE,IAAI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