{"version":3,"file":"app-8a937c8c.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;AAAA;AAEA;AAgDA;;;;;;;;;;;;;;;AClDA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;ACFA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC3BA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA;;;;;;;;;;;;;;;ACFA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACTA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AAVA;;;;;;;;;;;;;;;;ACFA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtBA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAhBA;;;;;;;;;;;;;;ACFA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACLA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AClBA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACZA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACfA;AAEA;AAGA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA;;;;;;;;;;;;;;;ACFA;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACpBA;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtBA;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACNA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAlBA;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACXA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApBA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;ACFA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACVA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA;;;;;;;;;;;;;;;ACFA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA;;;;;;;;;;;;;;;ACJA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;ACFA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACbA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;ACFA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACZA;AAEA;AAGA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;;;;;;;;ACPA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACRA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AClBA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAZA","sources":["webpack://www.zeusteam.com/./src/resources/value-converters/_index.js","webpack://www.zeusteam.com/./src/resources/value-converters/agent-number-status.js","webpack://www.zeusteam.com/./src/resources/value-converters/bool-to-yesno.js","webpack://www.zeusteam.com/./src/resources/value-converters/code-to-description.js","webpack://www.zeusteam.com/./src/resources/value-converters/contest-name.js","webpack://www.zeusteam.com/./src/resources/value-converters/coverage-type.js","webpack://www.zeusteam.com/./src/resources/value-converters/decode-js-property.js","webpack://www.zeusteam.com/./src/resources/value-converters/display-language.js","webpack://www.zeusteam.com/./src/resources/value-converters/dob-to-age.js","webpack://www.zeusteam.com/./src/resources/value-converters/email-parameter.js","webpack://www.zeusteam.com/./src/resources/value-converters/first-letter.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-bytes.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-date.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-money.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-number.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-number2.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-percent.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-phone.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-seconds.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-time-period.js","webpack://www.zeusteam.com/./src/resources/value-converters/format-url.js","webpack://www.zeusteam.com/./src/resources/value-converters/gender.js","webpack://www.zeusteam.com/./src/resources/value-converters/lead-disposition.js","webpack://www.zeusteam.com/./src/resources/value-converters/lead-status.js","webpack://www.zeusteam.com/./src/resources/value-converters/lead-type.js","webpack://www.zeusteam.com/./src/resources/value-converters/level-name.js","webpack://www.zeusteam.com/./src/resources/value-converters/level-type.js","webpack://www.zeusteam.com/./src/resources/value-converters/line-of-business.js","webpack://www.zeusteam.com/./src/resources/value-converters/mass-communication-status.js","webpack://www.zeusteam.com/./src/resources/value-converters/max-length.js","webpack://www.zeusteam.com/./src/resources/value-converters/member-inactive-reason.js","webpack://www.zeusteam.com/./src/resources/value-converters/note-record-type.js","webpack://www.zeusteam.com/./src/resources/value-converters/payment-method.js","webpack://www.zeusteam.com/./src/resources/value-converters/policy-rider-code.js","webpack://www.zeusteam.com/./src/resources/value-converters/policy-status.js","webpack://www.zeusteam.com/./src/resources/value-converters/replace-variables.js","webpack://www.zeusteam.com/./src/resources/value-converters/role-name.js","webpack://www.zeusteam.com/./src/resources/value-converters/shorten.js","webpack://www.zeusteam.com/./src/resources/value-converters/smoking-rating.js","webpack://www.zeusteam.com/./src/resources/value-converters/social-media-link.js","webpack://www.zeusteam.com/./src/resources/value-converters/task-type.js","webpack://www.zeusteam.com/./src/resources/value-converters/textarea-to-html.js","webpack://www.zeusteam.com/./src/resources/value-converters/time-between.js","webpack://www.zeusteam.com/./src/resources/value-converters/time-from-now.js","webpack://www.zeusteam.com/./src/resources/value-converters/title-case.js","webpack://www.zeusteam.com/./src/resources/value-converters/to-do-type.js"],"sourcesContent":["import { PLATFORM } from 'aurelia-pal';\r\n\r\nconst valueConverterGlobalResources = [\r\n PLATFORM.moduleName('resources/value-converters/level-name'),\r\n PLATFORM.moduleName('resources/value-converters/agent-number-status'),\r\n PLATFORM.moduleName('resources/value-converters/bool-to-yesno'),\r\n PLATFORM.moduleName('resources/value-converters/code-to-description'),\r\n PLATFORM.moduleName('resources/value-converters/contest-name'),\r\n PLATFORM.moduleName('resources/value-converters/coverage-type'),\r\n PLATFORM.moduleName('resources/value-converters/decode-js-property'),\r\n PLATFORM.moduleName('resources/value-converters/dob-to-age'),\r\n PLATFORM.moduleName('resources/value-converters/display-language'),\r\n PLATFORM.moduleName('resources/value-converters/email-parameter'),\r\n PLATFORM.moduleName('resources/value-converters/first-letter'),\r\n PLATFORM.moduleName('resources/value-converters/format-bytes'),\r\n PLATFORM.moduleName('resources/value-converters/format-date'),\r\n PLATFORM.moduleName('resources/value-converters/format-money'),\r\n PLATFORM.moduleName('resources/value-converters/format-number'),\r\n PLATFORM.moduleName('resources/value-converters/format-number2'),\r\n PLATFORM.moduleName('resources/value-converters/format-percent'),\r\n PLATFORM.moduleName('resources/value-converters/format-phone'),\r\n PLATFORM.moduleName('resources/value-converters/format-seconds'),\r\n PLATFORM.moduleName('resources/value-converters/format-time-period'),\r\n PLATFORM.moduleName('resources/value-converters/format-url'),\r\n PLATFORM.moduleName('resources/value-converters/gender'),\r\n PLATFORM.moduleName('resources/value-converters/line-of-business'),\r\n PLATFORM.moduleName('resources/value-converters/lead-disposition'),\r\n PLATFORM.moduleName('resources/value-converters/lead-status'),\r\n PLATFORM.moduleName('resources/value-converters/lead-type'),\r\n PLATFORM.moduleName('resources/value-converters/level-type'),\r\n PLATFORM.moduleName('resources/value-converters/mass-communication-status'),\r\n PLATFORM.moduleName('resources/value-converters/max-length'),\r\n PLATFORM.moduleName('resources/value-converters/member-inactive-reason'),\r\n PLATFORM.moduleName('resources/value-converters/note-record-type'),\r\n PLATFORM.moduleName('resources/value-converters/payment-method'),\r\n PLATFORM.moduleName('resources/value-converters/policy-rider-code'),\r\n PLATFORM.moduleName('resources/value-converters/policy-status'),\r\n PLATFORM.moduleName('resources/value-converters/replace-variables'),\r\n PLATFORM.moduleName('resources/value-converters/role-name'),\r\n PLATFORM.moduleName('resources/value-converters/shorten'),\r\n PLATFORM.moduleName('resources/value-converters/smoking-rating'),\r\n PLATFORM.moduleName('resources/value-converters/social-media-link'),\r\n PLATFORM.moduleName('resources/value-converters/task-type'),\r\n PLATFORM.moduleName('resources/value-converters/textarea-to-html'),\r\n PLATFORM.moduleName('resources/value-converters/time-between'),\r\n PLATFORM.moduleName('resources/value-converters/time-from-now'),\r\n PLATFORM.moduleName('resources/value-converters/title-case'),\r\n PLATFORM.moduleName('resources/value-converters/to-do-type'),\r\n];\r\n\r\nexport default valueConverterGlobalResources;","import { I18n } from 'common/i18n';\r\n\r\nexport class AgentNumberStatusValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`agent-number-status-${value}`);\r\n }\r\n}\r\n","import {I18n} from 'common/i18n';\r\n\r\nexport class BoolToYesNoValueConverter {\r\n static inject = [I18n];\r\n\r\n constructor(i18n) {\r\n this.i18n = i18n;\r\n }\r\n\r\n\ttoView(value, yesKey = 'yes', noKey = 'no', nullKey = 'no') {\r\n if (value === null) return this.i18n.tr(nullKey);\r\n\t return value ? this.i18n.tr(yesKey) : this.i18n.tr(noKey); \r\n\t} \r\n}\r\n","export class CodeToDescriptionValueConverter {\r\n toView(value, separateTo = false) {\r\n try {\r\n if (!value) return '';\r\n let desc = value.replace(/-/g, ' ');\r\n let words = desc.split(' ');\r\n let upperCasedDesc = '';\r\n words.forEach(w => {\r\n let doNotUpperCase = false;\r\n if (upperCasedDesc !== '') {\r\n if (separateTo && w === 'to') {\r\n doNotUpperCase = true;\r\n upperCasedDesc += ':';\r\n }\r\n upperCasedDesc += ' ';\r\n }\r\n if (doNotUpperCase) {\r\n upperCasedDesc += w;\r\n } else {\r\n upperCasedDesc += `${w.charAt(0).toUpperCase()}${w.slice(1)}`;\r\n }\r\n });\r\n return upperCasedDesc;\r\n } catch (err) {\r\n return value;\r\n }\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class ContestNameValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`contest-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class CoverageTypeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n let ct = this._i18n.tr(`coverage-type-${value}`);\r\n if (ct && ct != `coverage-type-${value}`) return ct;\r\n return value;\r\n }\r\n}\r\n","import { c } from 'common/common';\r\n\r\nexport class DecodeJsPropertyValueConverter {\r\n constructor() {}\r\n\r\n\ttoView(value) {\r\n if (!value) return '';\r\n\t return c.Helpers.decodeJsProperty(value);\r\n\t} \r\n}\r\n","import {I18n} from 'common/i18n';\r\n\r\nexport class DisplayLanguageValueConverter {\r\n static inject = [I18n];\r\n\r\n constructor(i18n) {\r\n this.i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n return this.i18n.languageName(value);\r\n } \r\n}\r\n","import moment from 'moment';\r\n\r\nexport class DobToAgeValueConverter { \r\n toView(value, nearest = false) {\r\n if (!value) return '';\r\n try {\r\n const format = value.length === 10 ? 'MM/DD/YYYY' : undefined;\r\n const dob = moment(value, format);\r\n if (!dob.isValid()) return '';\r\n const years = moment().diff(dob, 'years', true);\r\n if (!nearest) {\r\n return Math.floor(years);\r\n }\r\n const floor = Math.floor(years);\r\n const decimal = years - floor;\r\n if (decimal >= 0.5) return floor + 1;\r\n return floor;\r\n } catch (err) {\r\n console.log(err);\r\n return value;\r\n }\r\n } \r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class EmailParameterValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return '';\r\n if (value.type === 'Email') return value.email;\r\n if (value.type === 'Agency' || value.type === 'Agent' || value.type === 'DirectUpline' || value.type === 'Mentor' || value.type === 'EntireUpline'\r\n || value.type === 'TaskAssignee' || value.type === 'UplineToAgency'\r\n || value.type === 'BookingGuest') return this._i18n.tr(`admin:email-type-${value.type.toLowerCase()}`);\r\n if (value.type === 'Role') return this._i18n.tr(`roles-name-${value.email}`);\r\n return value.email ?? value.type;\r\n }\r\n}\r\n","export class FirstLetterValueConverter {\r\n toView(value, letters = 1) {\r\n if (!value) return '';\r\n return value.substring(0, letters);\r\n }\r\n}\r\n","import { c } from 'common/common';\r\n\r\nexport class FormatBytesValueConverter {\r\n toView(value) {\r\n try {\r\n if (!value) return '0 MB';\r\n let bytes = Number(value);\r\n if (isNaN(bytes)) return '-';\r\n if (bytes < 1000000) {\r\n let kb = c.Helpers.round(bytes / 1000, 2);\r\n return `${kb} KB`;\r\n }\r\n let mb = c.Helpers.round(bytes / 1000000, 2);\r\n return `${mb} MB`;\r\n } catch (err) {\r\n return value;\r\n }\r\n }\r\n}\r\n","import moment from 'moment';\r\n\r\nexport class FormatDateValueConverter { \r\n toView(value, format, ignoreTz = false) {\r\n if (!value) return '';\r\n const parseExact = value.length === 10 ? 'MM/DD/YYYY' : undefined;\r\n const m = ignoreTz\r\n ? moment.utc(value)\r\n : moment(value, parseExact);\r\n if (!m.isValid()) return '';\r\n return m.format(format);\r\n } \r\n}\r\n","import { c } from 'common/common';\r\n\r\nexport class FormatMoneyValueConverter { \r\n toView(value, decimals = 2) {\r\n try {\r\n if (value === null || value === undefined) return '';\r\n if (!value) return '$0';\r\n\r\n if (value < 0) return `($${c.Helpers.formatNumber(value * -1, decimals)})`;\r\n return `$${c.Helpers.formatNumber(value, decimals)}`;\r\n } catch (err) {\r\n console.log(err);\r\n return `$${value}`;\r\n }\r\n } \r\n}\r\n","import {I18n} from 'common/i18n';\r\n\r\nexport class FormatNumberValueConverter {\r\n static inject = [I18n];\r\n\r\n constructor(i18n) {\r\n this.i18n = i18n;\r\n }\r\n\r\n toView(value, decimals = 2, isMoney = false, addPlusIfPositive = false) {\r\n const prefix = isMoney ? '$' : '';\r\n if (value === undefined || value === null) return prefix;\r\n if (!value) return `${prefix}${value}`;\r\n return this.i18n.formatNumber(value, decimals, prefix, addPlusIfPositive);\r\n } \r\n}\r\n","import { c } from 'common/common';\r\n\r\nexport class FormatNumber2ValueConverter {\r\n constructor() {}\r\n\r\n toView(value, decimals = 2, isMoney = false, isPercent = false, removeInsignificantDigits = false, displayPlusMinus = false, plusMinusZeroValue = '', isPercentDecimal = true) {\r\n const prefix = isMoney ? '$' : '';\r\n const suffix = isPercent ? '%' : '';\r\n if (value === undefined || value === null) return prefix;\r\n if (isMoney) removeInsignificantDigits = false;\r\n if (isPercent && isPercentDecimal) value = value * 100;\r\n let formattedValue = c.Helpers.formatNumber(value, decimals, removeInsignificantDigits);\r\n let plusMinus = '';\r\n if (displayPlusMinus) {\r\n if (value < 0) plusMinus = formattedValue.indexOf('-') !== 0 ? '-' : '';\r\n else if (value > 0) plusMinus = '+';\r\n else plusMinus = plusMinusZeroValue;\r\n }\r\n return `${plusMinus}${prefix}${formattedValue}${suffix}`;\r\n } \r\n}\r\n","import { c } from 'common/common';\r\n\r\nexport class FormatPercentValueConverter {\r\n constructor() {}\r\n\r\n toView(value, isDecimal = true, decimals = 0, displayPlusMinus = false, plusMinusZeroValue = '') {\r\n try {\r\n if (value === undefined || value === null) return '';\r\n if (isDecimal) value = value * 100;\r\n let formattedValue = c.Helpers.formatNumber(value, decimals, true);\r\n let plusMinus = '';\r\n if (displayPlusMinus) {\r\n if (value < 0) plusMinus = formattedValue.indexOf('-') !== 0 ? '-' : '';\r\n else if (value > 0) plusMinus = '+';\r\n else plusMinus = plusMinusZeroValue;\r\n }\r\n return `${plusMinus}${formattedValue}%`;\r\n } catch (err) {\r\n console.log(err);\r\n return value;\r\n }\r\n } \r\n}\r\n","import { formatPhone } from 'services/functions';\r\n\r\nexport class FormatPhoneValueConverter {\r\n toView(value) {\r\n return formatPhone(value);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class FormatSecondsValueConverter {\r\n static inject = [I18n];\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n try {\r\n if (value < 60) return this._i18n.tr('seconds-count', { count: value });\r\n const minutes = Math.floor(value / 60);\r\n const seconds = value - minutes * 60;\r\n return `${this._i18n.tr('minutes-count', { count: minutes })} ${this._i18n.tr('seconds-count', { count: seconds })}`;\r\n } catch (err) {\r\n console.log(err);\r\n return `${value} seconds`;\r\n }\r\n }\r\n}\r\n","import moment from 'moment';\r\nimport { CACHE_PERIOD } from 'services/production-service';\r\nimport { TIME_PERIOD } from 'common/constants';\r\n\r\nexport class FormatTimePeriodValueConverter {\r\n constructor() {}\r\n\r\n\ttoView(value, period) {\r\n if (!value) return '';\r\n try {\r\n if (!value || !value.start || !value.end) return '';\r\n const start = moment(value.start);\r\n const end = moment(value.end);\r\n if (!start.isValid() || !end.isValid()) return '';\r\n switch (period) {\r\n case CACHE_PERIOD.Yesterday:\r\n case CACHE_PERIOD.LastYesterday:\r\n case TIME_PERIOD.Today:\r\n return start.format('l');\r\n case CACHE_PERIOD.CurrentWeek:\r\n case CACHE_PERIOD.LastWeek:\r\n case CACHE_PERIOD.LastLastWeek:\r\n case TIME_PERIOD.ThisWeek:\r\n case TIME_PERIOD.WTD:\r\n return `${start.format('l')} - ${end.format('l')}`;\r\n case CACHE_PERIOD.CurrentMonth:\r\n case CACHE_PERIOD.LastMonth:\r\n //case TIME_PERIOD.LastMonth:\r\n case TIME_PERIOD.ThisMonth:\r\n case TIME_PERIOD.MTD:\r\n case TIME_PERIOD.PriorMonth:\r\n return end.format('MMM YYYY');\r\n case CACHE_PERIOD.CurrentYear:\r\n case CACHE_PERIOD.LastYear:\r\n case TIME_PERIOD.YTD:\r\n case TIME_PERIOD.PriorYear:\r\n return end.format('YYYY');\r\n }\r\n return value;\r\n } catch (err) {\r\n console.log(err);\r\n return value;\r\n }\r\n\t} \r\n}\r\n","export class FormatUrlValueConverter {\r\n toView(value) {\r\n try {\r\n if (!value) return '';\r\n if (value.indexOf('http') === 0) return value;\r\n return `https://${value}`;\r\n } catch (err) {\r\n console.log(err);\r\n return value;\r\n }\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class GenderValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n let gender = this._i18n.tr(`gender-${value}`);\r\n if (gender === `gender-${value}`) gender = value;\r\n return gender;\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LeadDispositionValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`lead:disposition-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LeadStatusValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value,) {\r\n if (!value) return value;\r\n return this._i18n.tr(`lead-status-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LeadTypeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value,) {\r\n if (!value) return value;\r\n return this._i18n.tr(`lead:type-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LevelNameValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value, dropLevelNumber = false) {\r\n if (!value) return value;\r\n let ln = this._i18n.tr(`level-${value}`);\r\n try {\r\n if (!dropLevelNumber) return ln;\r\n const parenIndex = ln.indexOf('(');\r\n if (parenIndex < 0) return ln;\r\n return ln.substr(0, parenIndex);\r\n } catch (err) {\r\n console.log(err);\r\n return ln;\r\n }\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LevelTypeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`level-type-${value.toLowerCase()}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class LineOfBusinessValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`lob-${value.toLowerCase()}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class MassCommunicationStatusValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value, type = 'mailchimp') {\r\n if (!value || !type) return value;\r\n return this._i18n.tr(`${type}-status-${value}`);\r\n }\r\n}\r\n","export class MaxLengthValueConverter {\r\n constructor() {}\r\n\r\n toView(value, length = 25) {\r\n if (!value) return value;\r\n if (isNaN(length)) return value;\r\n if (typeof value !== 'string') return value;\r\n if (value.length <= length) return value;\r\n return `${value.substring(0, length)}...`;\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class MemberInactiveReasonValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`inactive-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class NoteRecordTypeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value, metadata) {\r\n if (!value) return value;\r\n return this._i18n.tr(`note:note-record-type-${value}`, metadata);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class PaymentMethodValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`payment-method-${value}`);\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class PolicyRiderCodeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value, description, alternateDescription) {\r\n let alternateName = description || alternateDescription;\r\n if (!value) return alternateName;\r\n let riderCodeTr = this._i18n.tr(`policy:rider-code-${value}`);\r\n if (riderCodeTr.indexOf('rider-code-') === 0) return alternateName ?? value;\r\n return riderCodeTr;\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class PolicyStatusValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value, sub = false) {\r\n if (!value) return value;\r\n if (sub) return this._i18n.tr(`policy-substatus-${value}`);\r\n return this._i18n.tr(`policy-status-${value}`);\r\n }\r\n}\r\n","import { Security } from 'common/security';\r\nimport moment from 'moment';\r\nimport { c } from 'common/common';\r\n\r\nexport class ReplaceVariablesValueConverter {\r\n static inject = [Security];\r\n _security;\r\n\r\n constructor(security) {\r\n this._security = security;\r\n }\r\n\r\n toView(value, skip = false, urlEncode = false) {\r\n if (skip) return value;\r\n if (!this._security.isAuthenticated || !(typeof value === 'string' || value instanceof String)) return value;\r\n const newValue = c.Helpers.replaceVariables(this._security, value, urlEncode);\r\n return newValue;\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class RoleNameValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`roles-name-${value}`);\r\n }\r\n}\r\n","export class ShortenValueConverter {\r\n constructor() {}\r\n\r\n toView(value, shortenTo) {\r\n try {\r\n if (!value || !shortenTo) return value;\r\n if (value.length <= shortenTo) return value;\r\n return `${value.substr(0, shortenTo)}...`;\r\n } catch (err) {\r\n console.log(err);\r\n return value;\r\n }\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class SmokingRatingValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`smoking-rating-${value}`);\r\n }\r\n}\r\n","import { socialMedia } from 'common/common';\r\n\r\nexport class SocialMediaLinkValueConverter {\r\n constructor() {}\r\n\r\n\ttoView(value, socialMediaKey) {\r\n if (!value || !socialMediaKey) return '';\r\n if (value.indexOf('http') === 0) return value;\r\n var linkStart = socialMedia.link(socialMediaKey);\r\n if (!linkStart) return value;\r\n return `${linkStart}${encodeURIComponent(value)}`;\r\n\t} \r\n}\r\n","import { I18n } from 'common/i18n';\r\n\r\nexport class TaskTypeValueConverter {\r\n static inject = [I18n];\r\n _i18n;\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n }\r\n\r\n toView(value) {\r\n if (!value) return value;\r\n return this._i18n.tr(`task-type-${value}`);\r\n }\r\n}\r\n","export class TextareaToHtmlValueConverter {\r\n toView(value) {\r\n if (!value) return value;\r\n // if (value.indexOf('
') >= 0 || value.indexOf('