fleet-contractor/Site/js/lib/app.min.js.map
2023-04-28 14:30:46 +08:00

1 line
118 KiB
Plaintext

{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Dropdown, createElement, createCheckbox, createPopup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = createPopup(\r\n c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactPreferencesColon', 'Contact Preferences:')),\r\n preferences.create()\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactEmailColon', 'Email Address:')),\r\n contactEmail\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactMobileColon', 'Mobile:')),\r\n contactMobile\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactOptColon', 'Opt Out:')),\r\n checkOpt\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactNotesColon', 'Notes:')),\r\n contactNotes\r\n )\r\n ),\r\n ...buttons\r\n )\r\n if (c != null) {\r\n contactName.value = c.Name;\r\n preferences.select(String(c.ContactPreference));\r\n contactEmail.value = c.Email;\r\n contactMobile.value = c.MobilePhone;\r\n checkOpt.querySelector('input').checked = c.OptOut;\r\n contactNotes.value = c.Notes;\r\n } else {\r\n preferences.select('0');\r\n }\r\n this.#refs = {\r\n contactName,\r\n preferences,\r\n contactEmail,\r\n contactMobile,\r\n checkOpt,\r\n contactNotes\r\n };\r\n const result = await popup.show(parent);\r\n setTimeout(() => contactName.focus());\r\n return result;\r\n }\r\n\r\n prepare() {\r\n const name = this.#refs.contactName.value;\r\n const pref = this.#refs.preferences.selected.value;\r\n const email = this.#refs.contactEmail.value;\r\n const phone = this.#refs.contactMobile.value;\r\n const opt = this.#refs.checkOpt.querySelector('input').checked;\r\n const notes = this.#refs.contactNotes.value;\r\n const title = this.#option.contact == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact');\r\n if (nullOrEmpty(name)) {\r\n showAlert(title, r('contactNameRequired', 'Contact Name cannot be empty.'), 'warn')\r\n .then(() => this.#refs.contactName.focus());\r\n return null;\r\n }\r\n if (nullOrEmpty(email) && nullOrEmpty(phone)) {\r\n showAlert(title, r('contactEmailPhoneRequired', 'Email and Mobile Phone cannot both be empty.'), 'warn')\r\n .then(() => nullOrEmpty(email) ?\r\n this.#refs.contactEmail.focus() :\r\n this.#refs.contactMobile.focus());\r\n return null;\r\n }\r\n if (!nullOrEmpty(email) && !isEmail(email)) {\r\n showAlert(title, r('contactEmailInvalid', 'The email address is invalid.'), 'warn')\r\n .then(() => this.#refs.contactEmail.focus());\r\n return null;\r\n }\r\n\r\n let contact = this.#option.contact;\r\n if (contact == null) {\r\n contact = {};\r\n } else if (contact.OptOut !== opt) {\r\n if (opt !== false || contact.OptOut_BC === false) {\r\n contact.selected = !opt;\r\n }\r\n }\r\n contact.Name = name;\r\n contact.ContactPreference = pref;\r\n contact.Email = email;\r\n contact.MobilePhone = phone;\r\n contact.OptOut = opt;\r\n contact.Notes = notes;\r\n return contact;\r\n }\r\n}\r\n\r\nexport default Contact;","import { Grid, createElement, createPopup } from \"../../ui\";\r\nimport { nullOrEmpty, r, contains } from \"../../utility\";\r\n\r\nclass Follower {\r\n #option;\r\n #grid;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'follower-grid');\r\n const popup = createPopup(\r\n r('addFollowers', 'Add Followers'),\r\n createElement('div', 'follower-wrapper',\r\n createElement('div', div => div.innerText = r('whoWantReceiveCustomerNotification', 'Who do you want to receive customer notifications?')),\r\n createElement('input', search => {\r\n search.type = 'text';\r\n search.tabIndex = tabIndex + 3;\r\n search.className = 'ui-input follower-search';\r\n search.addEventListener('input', () => {\r\n const key = search.value;\r\n if (nullOrEmpty(key)) {\r\n this.#grid.source = this.#option.followers;\r\n } else {\r\n this.#grid.source = this.#option.followers.filter(f => f.Text || f.Email || contains(f.DisplayName, key, true));\r\n }\r\n });\r\n }),\r\n gridContainer\r\n ),\r\n {\r\n text: r('ok', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this.#option.onOk === 'function') {\r\n return this.#option.onOk.call(this, this.#grid.source.filter(f => f.Email || f.Text));\r\n }\r\n }\r\n },\r\n { text: r('cancel', 'Cancel'), key: 'cancel' }\r\n );\r\n const result = await popup.show(parent);\r\n result.querySelector('.follower-search').focus();\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n { key: 'DisplayName', caption: r('contactName', 'Contact Name'), width: 240 },\r\n { key: 'ContactTypeName', caption: r('contactType', 'Contact Type'), width: 120 },\r\n {\r\n key: 'Text',\r\n caption: r('text', 'Text'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 60,\r\n enabled: item => !nullOrEmpty(item.Mobile)\r\n },\r\n {\r\n key: 'Email',\r\n caption: r('email', 'Email'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 70,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n }\r\n ];\r\n grid.init();\r\n grid.source = this.#option.followers;\r\n this.#grid = grid;\r\n return result;\r\n }\r\n}\r\n\r\nexport default Follower;","import { Grid, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, createPopup, showAlert, showConfirm } from \"../../ui\";\r\nimport { r, nullOrEmpty, formatUrl, isEmail, isPhone } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\nimport Contact from \"./contact\";\r\nimport Follower from \"./follower\";\r\n\r\nclass NoteCol extends Grid.GridColumn {\r\n static create() {\r\n const wrapper = createElement('div', 'contact-wrapper',\r\n createElement('div', 'contact-name'),\r\n createElement('div', 'contact-note')\r\n );\r\n return wrapper;\r\n }\r\n\r\n static setValue(element, _val, item, _col, grid) {\r\n const name = element.querySelector('.contact-name');\r\n name.innerText = item.Name;\r\n if (name.scrollWidth > name.offsetWidth) {\r\n setTooltip(name, item.Name, false, grid.element);\r\n }\r\n element.querySelector('.contact-note').innerText = item.Notes;\r\n }\r\n}\r\n\r\nclass CustomerCommunication {\r\n #container;\r\n #option;\r\n #contacts;\r\n #followers;\r\n #buttonFollower;\r\n #enter;\r\n #message;\r\n #data = {};\r\n #gridContact;\r\n #gridWo;\r\n #gridFollower;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get #autoUpdates() { return this.#container.querySelector('.check-auto-update>input') }\r\n get autoUpdatesEnabled() { return this.#autoUpdates?.disabled !== true }\r\n set autoUpdatesEnabled(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get autoUpdates() { return this.#autoUpdates?.checked }\r\n set autoUpdates(flag) {\r\n const element = this.#autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n get #statusLink() { return this.#container.querySelector('.check-status-link>input') }\r\n get statusLinkEnabled() { return this.#statusLink?.disabled !== true }\r\n set statusLinkEnabled(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get statusLink() { return this.#statusLink?.checked }\r\n set statusLink(flag) {\r\n const element = this.#statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag;\r\n this.#container.querySelector('.customer-name>.ui-input').disabled = flag;\r\n this.#container.querySelector('.button-send-message').disabled = flag;\r\n this.#container.querySelector('.button-edit-contacts').disabled = flag;\r\n this.#container.querySelector('.button-edit-followers').disabled = flag;\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n get customerName() { return this.#container.querySelector('.customer-name>.ui-input')?.value }\r\n set customerName(name) {\r\n const element = this.#container.querySelector('.customer-name>.ui-input');\r\n if (element == null) {\r\n return;\r\n }\r\n element.value = name;\r\n }\r\n\r\n get contacts() {\r\n return [...this.#contacts.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Key': span.dataset.to, 'Value': span.dataset.name };\r\n });\r\n }\r\n set contacts(contacts) {\r\n this.#contacts.replaceChildren();\r\n if (contacts?.length > 0) {\r\n for (let c of contacts) {\r\n if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n continue;\r\n }\r\n const mp = String(c.MobilePhoneDisplayText).trim();\r\n const email = String(c.Email).trim();\r\n const pref = String(c.ContactPreference);\r\n if ((pref !== '1') && !isPhone(mp) ||\r\n pref === '1' && !isEmail(email)) {\r\n continue;\r\n }\r\n const to = pref === '1' ? email : mp;\r\n let icon;\r\n let method;\r\n switch (pref) {\r\n case '0':\r\n icon = 'comment-lines';\r\n method = r('textsToColon', 'Texts to:');\r\n break;\r\n case '2':\r\n icon = 'mobile';\r\n method = r('callsToColon', 'Calls to:');\r\n break;\r\n default:\r\n icon = 'envelope';\r\n method = r('emailsToColon', 'Emails to:');\r\n break;\r\n }\r\n const span = createElement('span', span => {\r\n span.dataset.to = to;\r\n span.dataset.name = c.Name;\r\n span.innerText = c.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this.#contacts.appendChild(item);\r\n let tip = `${method} ${to}`;\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tip = r('nameColon', 'Name:') + ` ${c.Name}\\n${tip}`;\r\n }\r\n setTooltip(span, tip);\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n const link = this.#container.querySelector('.check-status-link');\r\n if (flag === true) {\r\n link.classList.add('disabled');\r\n } else {\r\n link.classList.remove('disabled');\r\n }\r\n link.querySelector('input').disabled = flag;\r\n const display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-contacts').style.display = display;\r\n this.#container.querySelector('.button-edit-followers').style.display = display;\r\n // this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.message-bar').style.display = display;\r\n // this.#container.querySelector('.button-send-message').style.display = display;\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set recordReadonly(flag) {\r\n this.#option.recordReadonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#container.querySelector('.button-edit-contacts').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-edit-followers').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n /**\r\n * @param {String} name\r\n */\r\n set companyName(name) {\r\n this.#option.companyName = name;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(name)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = name;\r\n div.style.display = '';\r\n }\r\n }\r\n /**\r\n * @param {String} code\r\n */\r\n set companyCode(code) {\r\n this.#option.companyCode = code;\r\n const div = this.#container.querySelector('.title-company');\r\n if (nullOrEmpty(this.#option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = this.#option.companyName;\r\n if (!nullOrEmpty(code))\r\n div.innerText = this.#option.companyName + \"/\" + code;\r\n div.style.display = '';\r\n }\r\n }\r\n\r\n get followers() {\r\n return [...this.#followers.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Email': span.dataset.email, 'MobilePhone': span.dataset.mp, 'Value': span.dataset.name };\r\n });\r\n }\r\n set followers(followers) {\r\n this.#data.followers = followers;\r\n this.#followers.replaceChildren();\r\n if (followers?.length > 0) {\r\n this.#container.querySelector('.follower-bar').style.display = '';\r\n this.#container.querySelector('.follower-bar>.bar-list').appendChild(this.#buttonFollower);\r\n for (let f of followers) {\r\n if (f.OptOut) {\r\n continue;\r\n }\r\n const mp = String(f.MobilePhone).trim();\r\n const email = String(f.Email).trim();\r\n const tips = [];\r\n if (f.SendEmail) {\r\n tips.push(r('emailsToColon', 'Emails to:') + ` ${email}`);\r\n }\r\n if (f.SendText) {\r\n tips.push(r('textsToColon', 'Texts to:' + ` ${mp}`));\r\n }\r\n let icon;\r\n if (f.SendText && f.SendEmail) {\r\n icon = 'at';\r\n } else {\r\n icon = f.SendText ? 'comment-lines' : 'envelope';\r\n }\r\n const span = createElement('span', span => {\r\n if (f.SendEmail) {\r\n span.dataset.email = email;\r\n }\r\n if (f.SendText) {\r\n span.dataset.mp = mp;\r\n }\r\n span.dataset.name = f.Name;\r\n span.innerText = f.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this.#followers.appendChild(item);\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tips.splice(0, 0, r('nameColon', 'Name:') + ` ${c.Name}`);\r\n }\r\n setTooltip(span, tips.join('\\n'));\r\n }\r\n } else {\r\n this.#container.querySelector('.follower-bar').style.display = 'none';\r\n this.#container.querySelector('.button-edit-contacts').insertAdjacentElement('beforebegin', this.#buttonFollower)\r\n }\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n }\r\n\r\n setData(key, data) {\r\n this.#data[key] = data;\r\n }\r\n\r\n create() {\r\n const option = this.#option;\r\n const readonly = option.readonly;\r\n // functions\r\n const checkAutoUpdate = createCheckbox({\r\n className: 'check-auto-update',\r\n checked: option.autoUpdates,\r\n checkedNode: createIcon('fa-regular', 'redo-alt'),\r\n uncheckedNode: createIcon('fa-regular', 'ban'),\r\n onchange: function () {\r\n setTooltip(checkAutoUpdate, this.checked ?\r\n r('autoUpdateEnabled', 'Auto Updates Enabled') :\r\n r('autoUpdateDisabled', 'Auto Updates Disabled'));\r\n }\r\n });\r\n if (option.autoUpdatesVisible === false) {\r\n checkAutoUpdate.style.display = 'none';\r\n }\r\n const checkLink = createCheckbox({\r\n className: 'check-status-link',\r\n enabled: !readonly,\r\n checked: option.statusLink,\r\n checkedNode: createIcon('fa-regular', 'link'),\r\n uncheckedNode: createIcon('fa-regular', 'unlink'),\r\n onchange: function () {\r\n setTooltip(checkLink, this.checked ?\r\n r('statusLinkIncluded', 'Status Link Included') :\r\n r('statusLinkExcluded', 'Status Link Excluded'));\r\n }\r\n });\r\n if (option.statusLinkVisible === false) {\r\n checkLink.style.display = 'none';\r\n }\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = option.title ?? r('messages', 'Customer Communication');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n [\r\n setTooltip(checkAutoUpdate, r('autoUpdateEnabled', 'Auto Updates Enabled')),\r\n setTooltip(checkLink, r('statusLinkExcluded', 'Status Link Excluded'))\r\n ]\r\n );\r\n // contacts\r\n this.#contacts = this.#createContacts(container, option);\r\n // followers\r\n this.#followers = this.#createFollowers(container, option);\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeMessage', 'Enter Message Here');\r\n option.maxLength ??= 3000;\r\n enter.maxLength = option.maxLength;\r\n // if (readonly === true) {\r\n // enter.disabled = true;\r\n // }\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', div => {\r\n div.className = 'message-bar';\r\n if (readonly === true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', div => {\r\n div.className = 'customer-name';\r\n if (option.customerNameVisible !== true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n createElement('span', span => span.innerText = r('nameColon', 'Name:')),\r\n createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n })\r\n ),\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n // if (readonly === true) {\r\n // button.style.display = 'none';\r\n // }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n const val = this.#enter.value;\r\n if (nullOrEmpty(val?.trim())) {\r\n showAlert(r('error', 'Error'), r('messageRequired', 'Please input the message.'), 'warn');\r\n return;\r\n }\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n #createContacts(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const contacts = createElement('div');\r\n container.append(\r\n createElement('div', 'contact-bar',\r\n createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-circle', {\r\n 'fill': 'lightgray'\r\n })\r\n ),\r\n createElement('div', 'bar-list',\r\n contacts,\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-edit-contacts';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-edit'));\r\n setTooltip(button, r('editContacts', 'Edit Contacts'));\r\n button.addEventListener('click', () => {\r\n const pop = createPopup(\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n },\r\n createElement('div', div => div.innerText = r('editContacts', 'Edit Contacts')),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-contact';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const add = new Contact({\r\n company: !nullOrEmpty(this.#data.companyCode),\r\n onSave: item => {\r\n const exists = this.#gridContact.source.some(s => s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('addContact', 'Add Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item, true);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n setTooltip(button, r('addContact', 'Add Contact'))\r\n })\r\n )\r\n }),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#data.companyCode)) {\r\n div.style.display = 'none';\r\n }\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromRecord', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n if (nullOrEmpty(this.#data.companyCode)) {\r\n div.style.display = 'none';\r\n }\r\n div.className = 'contacts-record';\r\n div.style.maxHeight = '400px';\r\n div.style.width = '660px';\r\n }),\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromWorkOrder', 'Contacts not on Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'contacts-wo';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '660px';\r\n })\r\n )\r\n );\r\n pop.show(container).then(() => {\r\n const selectedCol = This => {\r\n return {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 50,\r\n enabled: item => !item.OptOut && !item.OptOut_BC,\r\n onchanged: function () {\r\n if (typeof option.onChanged === 'function') {\r\n option.onChanged([...This.#gridContact.source, ...This.#gridWo.source]);\r\n }\r\n }\r\n }\r\n };\r\n const iconCol = {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => {\r\n switch (String(c.ContactPreference)) {\r\n case '0': return 'comment-lines';\r\n case '2': return 'mobile';\r\n default: return 'envelope';\r\n }\r\n },\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n };\r\n const nameCol = { key: 'Name', type: NoteCol, width: 160 };\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n visible: !recordReadonly,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const createEditCol = (This) => {\r\n return {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('edit', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n const edit = new Contact({\r\n contact: this,\r\n company: !nullOrEmpty(This.#data.companyCode),\r\n onSave: (item, _op) => {\r\n const exists =\r\n This.#gridContact.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone) ||\r\n This.#gridWo.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('editContact', 'Edit Contact'), r('contactUniqueRequired', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n This.#gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n This.#gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n edit.show(container);\r\n }\r\n }\r\n }\r\n };\r\n // contacts from customer record\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('remoteContact', 'Remove Contact'),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.paddingLeft = '16px';\r\n div.innerText = r('removeFrom', 'Remove {name} from').replace('{name}', this.Name);\r\n }),\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '10px';\r\n },\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('customerRecord', 'Customer Record'),\r\n checked: true,\r\n className: 'radio-customer-record'\r\n }),\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('workOrder', 'Work Order')\r\n })\r\n )\r\n ),\r\n [\r\n { key: 'ok', text: r('ok', 'OK') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]\r\n ).then(result => {\r\n if (result?.key === 'ok') {\r\n const isRecord = result.popup.container.querySelector('.radio-customer-record>input').checked;\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this, isRecord);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.contacts-record'));\r\n const customerRecords = this.#data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n grid.extraRows = customerRecords.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = customerRecords;\r\n grid.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridWo.selectedIndexes?.length > 0) {\r\n this.#gridWo.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridContact = grid;\r\n\r\n // contacts from work order only\r\n const gridWo = new Grid();\r\n gridWo.height = 0;\r\n gridWo.allowHtml = true;\r\n gridWo.headerVisible = false;\r\n gridWo.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(r('remoteContact', 'Remove Contact'), r('removeFromWorkorder', 'You are removing {name} from work order.\\n\\nDo you want to Continue?').replace('{name}', this.Name), [\r\n { key: 'continue', text: r('continue', 'Continue') },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ]).then(result => {\r\n if (result?.key === 'continue') {\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this);\r\n }\r\n const index = gridWo.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = gridWo.source;\r\n source.splice(index, 1);\r\n gridWo.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n gridWo.init(pop.container.querySelector('.contacts-wo'));\r\n const workOrderOnly = this.#data.contacts.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n gridWo.extraRows = workOrderOnly.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = workOrderOnly;\r\n gridWo.selectedRowChanged = index => {\r\n if (index >= 0 && this.#gridContact.selectedIndexes?.length > 0) {\r\n this.#gridContact.selectedIndexes = [];\r\n }\r\n };\r\n this.#gridWo = gridWo;\r\n });\r\n });\r\n })\r\n )\r\n )\r\n );\r\n return contacts;\r\n }\r\n\r\n #createFollowers(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const followers = createElement('div');\r\n const buttonEditFollower = createElement('button', button => {\r\n button.className = 'roundbtn button-edit-followers';\r\n button.style.backgroundColor = 'rgb(48, 107, 255)';\r\n if (readonly === true || recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'pen'));\r\n setTooltip(button, r('editFollower', 'Edit Followers'));\r\n button.addEventListener('click', () => {\r\n const pop = createPopup(\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n div.innerText = r('editContacts', 'Edit Contacts') + '\\n' + r('followers', 'Followers');\r\n }),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-follower';\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onInitFollower === 'function') {\r\n this.#option.onInitFollower().then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('customerRecord', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const add = new Follower({\r\n followers: data,\r\n onOk: list => {\r\n if (typeof this.#option.onAddFollower === 'function') {\r\n const result = this.#option.onAddFollower(list);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this.#gridFollower.source = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n }\r\n });\r\n setTooltip(button, r('addFollower', 'Add Follower'))\r\n })\r\n )\r\n }),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('contactFromRecord', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'followers-record';\r\n div.style.maxHeight = '400px';\r\n div.style.width = '660px';\r\n })\r\n )\r\n );\r\n pop.show(container).then(() => {\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => c.SendText && c.SendEmail ? 'at' : (c.SendText ? 'comment-lines' : 'envelope'),\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n },\r\n { key: 'Name', width: 160 },\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('edit', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n if (typeof option.onInitFollower === 'function') {\r\n option.onInitFollower().then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('customerRecord', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const contact = data.find(d => d.IID === this.UserIID);\r\n showConfirm(\r\n r('editContactMethod', 'Edit Contact Method'),\r\n createElement('div', 'wrapper-edit-method',\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '20px';\r\n },\r\n createCheckbox({\r\n label: r('text', 'Text'),\r\n checked: this.SendText && !nullOrEmpty(contact?.Mobile),\r\n enabled: !nullOrEmpty(contact?.Mobile),\r\n className: 'check-method-text'\r\n }),\r\n createCheckbox({\r\n label: r('email', 'Email'),\r\n checked: this.SendEmail,\r\n className: 'check-method-email'\r\n })\r\n )\r\n ),\r\n [\r\n {\r\n key: 'ok',\r\n text: r('ok', 'OK'),\r\n trigger: (popup, button) => {\r\n const text = popup.container.querySelector('.check-method-text>input').checked;\r\n const email = popup.container.querySelector('.check-method-email>input').checked;\r\n\r\n if (!text && !email) {\r\n return showConfirm(r('editContactMethod', 'Edit Contact Method'), r('promptRemoveFollower', 'Contact method is required. If you continue, user will be removed as a follower.'), [\r\n { key: 'update', text: r('updateContactMethod', 'Update Contact Method') },\r\n { key: 'remove', text: r('removeFollower', 'Remove Follower') }\r\n ], 'question').then(result => {\r\n if (result?.key === 'remove') {\r\n return {\r\n key: result.key,\r\n popup\r\n };\r\n }\r\n return false;\r\n });\r\n }\r\n return {\r\n key: button.key,\r\n popup\r\n };\r\n }\r\n },\r\n { key: 'cancel', text: r('cancel', 'Cancel') }\r\n ],\r\n null\r\n ).then(result => {\r\n const key = result?.key;\r\n if (key === 'remove') {\r\n if (typeof option.onDeleteFollower === 'function') {\r\n option.onDeleteFollower(result.key, this);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n } else if (key === 'ok') {\r\n const text = result.popup.container.querySelector('.check-method-text>input').checked;\r\n const email = result.popup.container.querySelector('.check-method-email>input').checked;\r\n if (typeof option.onChangeFollower === 'function') {\r\n option.onChangeFollower(result.key, this, text, email);\r\n }\r\n this.SendText = text;\r\n this.SendEmail = email;\r\n grid.refresh();\r\n }\r\n });\r\n });\r\n }\r\n }\r\n }\r\n },\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('delete', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('deleteFollower', 'Delete Follower'),\r\n r('promptDeleteFollower', 'Do you want to delete this follower?')\r\n ).then(result => {\r\n if (result?.key === 'yes') {\r\n if (typeof option.onDeleteFollower === 'function') {\r\n option.onDeleteFollower(result.key, this);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.followers-record'));\r\n grid.source = this.#data.followers;\r\n this.#gridFollower = grid;\r\n });\r\n });\r\n });\r\n this.#buttonFollower = buttonEditFollower;\r\n container.append(\r\n createElement('div', div => {\r\n div.className = 'contact-bar follower-bar';\r\n div.style.display = 'none';\r\n },\r\n setTooltip(createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-tag', {\r\n 'fill': '#fff',\r\n 'background-color': 'lightgray',\r\n 'box-sizing': 'border-box',\r\n 'border-radius': '15px',\r\n 'padding': '4px'\r\n })\r\n ), r('copied', 'Copied')),\r\n createElement('div', 'bar-list',\r\n followers,\r\n buttonEditFollower\r\n )\r\n )\r\n );\r\n return followers;\r\n }\r\n\r\n load(data, contacts, followers) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n contacts ??= this.#data.contacts;\r\n followers ??= this.#data.allfollowers;\r\n for (let comm of data) {\r\n const div = createElement('div', 'item-div');\r\n let name;\r\n if (comm.IsReply && contacts?.length > 0) {\r\n const c = isEmail(comm.Sender) ?\r\n contacts.find(c => c.Email === comm.Sender) :\r\n contacts.find(c => c.MobilePhone === comm.Sender);\r\n name = c?.Name;\r\n }\r\n name ??= comm.IsReply && String(comm.FormatSender) !== '' ? comm.FormatSender : comm.Sender;\r\n let sendto = '';\r\n if (!comm.IsReply && comm.OriPhoneNumbers?.length > 0) {\r\n for (let oriph of comm.OriPhoneNumbers) {\r\n let cname;\r\n const email = isEmail(oriph);\r\n if (contacts?.length > 0) {\r\n let c = email ?\r\n contacts.find(c => c.Email === oriph) :\r\n contacts.find(c => c.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n } else if (followers?.length > 0) {\r\n c = email ?\r\n followers.find(f => f.Email === oriph) :\r\n followers.find(f => f.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n }\r\n }\r\n }\r\n sendto += (cname ?? oriph) + '\\n';\r\n }\r\n }\r\n if (sendto !== '') {\r\n sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = name;\r\n if (!comm.IsReply && sendto?.length > 0) {\r\n setTooltip(div, sendto);\r\n }\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => {\r\n if (/https?:\\/\\//i.test(comm.Message)) {\r\n span.innerHTML = formatUrl(comm.Message);\r\n } else {\r\n span.innerText = comm.Message;\r\n }\r\n }));\r\n if (comm.IsReply) {\r\n div.classList.add('item-other');\r\n } else {\r\n div.classList.add('item-self');\r\n const [status, statusmsg] = this.#getMessageStatus(comm);\r\n if (status !== -100) {\r\n let statustext;\r\n switch (status) {\r\n case 0:\r\n statustext = r('pending', 'Pending');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 1:\r\n statustext = r('sent', 'Sent');\r\n break;\r\n case 9:\r\n statustext = r('failed', 'Failed');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 10:\r\n statustext = r('optOut', 'Opt-Out');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n case 412:\r\n statustext = r('landline', 'Landline');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n default:\r\n statustext = r('undelivered', 'Undelivered');\r\n content.style.backgroundColor = '#ffc107';\r\n break;\r\n }\r\n const divstatus = createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = statustext;\r\n if (status == -10) {\r\n setTooltip(div, statusmsg);\r\n }\r\n });\r\n content.appendChild(divstatus);\r\n }\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comm.TimeStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n\r\n #getMessageStatus(comm) {\r\n let status = -100; // 没有状态,页面上不显示\r\n const ls = [];\r\n let statusmsg = '';\r\n if (!comm.StatusIncorrect && comm.Participator?.length > 0) {\r\n for (let p of comm.Participator) {\r\n if (!isEmail(p.CustomerNumber)) {\r\n if (ls.indexOf(p.Status) < 0) {\r\n ls.push(p.Status);\r\n }\r\n if (statusmsg.length > 0) {\r\n statusmsg += '\\n';\r\n }\r\n statusmsg += `${p.CustomerNumber}: `;\r\n const st = ({\r\n 0: r('undelivered', 'Undelivered'),\r\n 1: r('sent', 'Sent'),\r\n 9: r('failed', 'Failed')\r\n })[p.Status];\r\n if (st != null) {\r\n statusmsg += st;\r\n }\r\n }\r\n }\r\n }\r\n if (ls.length === 1) {\r\n status = ls[0];\r\n } else if (ls.length > 1) {\r\n status = -10; // 多种状态\r\n }\r\n return [status, statusmsg];\r\n }\r\n}\r\n\r\nexport default CustomerCommunication;","import { createElement, setTooltip, createIcon } from \"../../ui\";\r\nimport { r, nullOrEmpty, escapeHtml } from \"../../utility\";\r\nimport { createBox } from \"./lib\";\r\n\r\nclass InternalComment {\r\n #container;\r\n #option;\r\n #enter;\r\n #message;\r\n\r\n constructor(opt) {\r\n this.#option = opt ?? {};\r\n }\r\n\r\n get text() { return this.#enter?.value }\r\n set text(s) {\r\n const element = this.#enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this.#option.readonly = flag;\r\n if (this.#container == null) {\r\n return;\r\n }\r\n this.#enter.disabled = flag === true;\r\n this.#container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';\r\n this.#container.querySelector('.button-post-note').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n create() {\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = r('internalComments', 'Internal Comments');\r\n })\r\n ), []\r\n );\r\n const readonly = this.#option.readonly;\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('typeComment', 'Enter Comment Here');\r\n enter.maxLength = this.#option.maxLength ??= 3000;\r\n enter.addEventListener('input', () => {\r\n const val = this.#enter.value;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(this.#option.maxLength);\r\n this.#container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n if (readonly === true) {\r\n enter.disabled = true;\r\n }\r\n this.#enter = enter;\r\n container.appendChild(\r\n createElement('div', 'message-bar',\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n if (readonly === true || this.#option.noMessage === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('sendMessage', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddMessage === 'function') {\r\n this.#option.onAddMessage(this.#enter.value);\r\n }\r\n })\r\n }),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-post-note';\r\n button.style.border = '1px solid rgb(19, 150, 204)';\r\n button.style.fill = 'rgb(19, 150, 204)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'comment-alt-lines'));\r\n setTooltip(button, r('postNote', 'Post Note'));\r\n button.addEventListener('click', () => {\r\n if (typeof this.#option.onAddComment === 'function') {\r\n this.#option.onAddComment(this.#enter.value);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this.#message = message;\r\n container.appendChild(message);\r\n return this.#container = container;\r\n }\r\n\r\n load(data) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n for (let comment of data) {\r\n const div = createElement('div', 'item-div');\r\n // if (sendto !== '') {\r\n // sendto = r('sendToColon', 'Send To :') + `\\n${sendto}`;\r\n // }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = comment.UserName;\r\n }));\r\n const content = createElement('div', 'item-content');\r\n content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(comment.Comment)));\r\n if (comment.FollowUp?.length > 0) {\r\n div.classList.add('item-sent');\r\n const sendto = r('sendToColon', 'Send To :') + '\\r\\n' + comment.FollowUp.split(';').join('\\r\\n');\r\n content.appendChild(createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = r('sent', 'Sent');\r\n setTooltip(div, sendto);\r\n }));\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comment.SubmitDateStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this.#message.replaceChildren(...children);\r\n this.#message.scrollTop = this.#message.scrollHeight\r\n // setTimeout(() => this.#message.scrollTop = this.#message.scrollHeight, 0);\r\n }\r\n}\r\n\r\nexport default InternalComment;"],"names":["createElement","createBox","title","functions","container","header","Dropdown","isEmail","Contact","option","__privateAdd","_option","_refs","__privateSet","parent","tabIndex","e","c","__privateGet","contactName","input","preferences","r","contactEmail","contactMobile","checkOpt","createCheckbox","contactNotes","txt","buttons","item","popup","createPopup","wrapper","result","name","pref","email","phone","opt","notes","nullOrEmpty","showAlert","contact","Grid","Follower","_grid","gridContainer","div","search","key","f","contains","grid","NoteCol","element","_val","_col","setTooltip","CustomerCommunication","_autoUpdates","_statusLink","_createContacts","_createFollowers","_getMessageStatus","_container","_contacts","_followers","_buttonFollower","_enter","_message","_data","_gridContact","_gridWo","_gridFollower","_a","autoUpdates_get","flag","_b","_d","_c","statusLink_get","s","el","span","contacts","mp","isPhone","to","icon","method","createIcon","tip","link","display","code","followers","tips","data","readonly","checkAutoUpdate","checkLink","__privateMethod","createContacts_fn","createFollowers_fn","enter","val","button","message","children","comm","sendto","oriph","cname","content","formatUrl","status","statusmsg","getMessageStatus_fn","statustext","divstatus","recordReadonly","pop","selectedCol","This","iconCol","nameCol","buttonCol","createEditCol","_op","showConfirm","createRadiobox","isRecord","index","source","customerRecords","gridWo","workOrderOnly","buttonEditFollower","list","d","text","ls","p","st","InternalComment","comment","escapeHtml"],"mappings":"qsBAAAA,EAAA,OAAA,QAAA,EAAA,cA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