@nyaruka/temba-components 0.138.4 → 0.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/locales/es.js +5 -5
  3. package/dist/locales/es.js.map +1 -1
  4. package/dist/locales/fr.js +5 -5
  5. package/dist/locales/fr.js.map +1 -1
  6. package/dist/locales/locale-codes.js +2 -11
  7. package/dist/locales/locale-codes.js.map +1 -1
  8. package/dist/locales/pt.js +5 -5
  9. package/dist/locales/pt.js.map +1 -1
  10. package/dist/temba-components.js +816 -852
  11. package/dist/temba-components.js.map +1 -1
  12. package/out-tsc/src/display/FloatingTab.js +23 -30
  13. package/out-tsc/src/display/FloatingTab.js.map +1 -1
  14. package/out-tsc/src/flow/CanvasMenu.js +5 -3
  15. package/out-tsc/src/flow/CanvasMenu.js.map +1 -1
  16. package/out-tsc/src/flow/CanvasNode.js +6 -7
  17. package/out-tsc/src/flow/CanvasNode.js.map +1 -1
  18. package/out-tsc/src/flow/Editor.js +152 -235
  19. package/out-tsc/src/flow/Editor.js.map +1 -1
  20. package/out-tsc/src/flow/Plumber.js +757 -403
  21. package/out-tsc/src/flow/Plumber.js.map +1 -1
  22. package/out-tsc/src/flow/utils.js +138 -66
  23. package/out-tsc/src/flow/utils.js.map +1 -1
  24. package/out-tsc/src/interfaces.js +1 -0
  25. package/out-tsc/src/interfaces.js.map +1 -1
  26. package/out-tsc/src/list/TicketList.js +4 -1
  27. package/out-tsc/src/list/TicketList.js.map +1 -1
  28. package/out-tsc/src/live/ContactChat.js +18 -1
  29. package/out-tsc/src/live/ContactChat.js.map +1 -1
  30. package/out-tsc/src/locales/es.js +5 -5
  31. package/out-tsc/src/locales/es.js.map +1 -1
  32. package/out-tsc/src/locales/fr.js +5 -5
  33. package/out-tsc/src/locales/fr.js.map +1 -1
  34. package/out-tsc/src/locales/locale-codes.js +2 -11
  35. package/out-tsc/src/locales/locale-codes.js.map +1 -1
  36. package/out-tsc/src/locales/pt.js +5 -5
  37. package/out-tsc/src/locales/pt.js.map +1 -1
  38. package/out-tsc/src/simulator/Simulator.js +1 -0
  39. package/out-tsc/src/simulator/Simulator.js.map +1 -1
  40. package/out-tsc/test/temba-floating-tab.test.js +4 -6
  41. package/out-tsc/test/temba-floating-tab.test.js.map +1 -1
  42. package/out-tsc/test/temba-flow-collision.test.js +221 -223
  43. package/out-tsc/test/temba-flow-collision.test.js.map +1 -1
  44. package/out-tsc/test/temba-flow-editor.test.js +0 -2
  45. package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
  46. package/out-tsc/test/temba-flow-plumber-connections.test.js +83 -84
  47. package/out-tsc/test/temba-flow-plumber-connections.test.js.map +1 -1
  48. package/out-tsc/test/temba-flow-plumber.test.js +102 -93
  49. package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/display/FloatingTab.ts +22 -31
  52. package/src/flow/CanvasMenu.ts +8 -3
  53. package/src/flow/CanvasNode.ts +6 -7
  54. package/src/flow/Editor.ts +184 -279
  55. package/src/flow/Plumber.ts +1011 -457
  56. package/src/flow/utils.ts +162 -84
  57. package/src/interfaces.ts +2 -1
  58. package/src/list/TicketList.ts +4 -1
  59. package/src/live/ContactChat.ts +19 -1
  60. package/src/locales/es.ts +13 -18
  61. package/src/locales/fr.ts +13 -18
  62. package/src/locales/locale-codes.ts +2 -11
  63. package/src/locales/pt.ts +13 -18
  64. package/src/simulator/Simulator.ts +1 -0
  65. package/test/temba-floating-tab.test.ts +4 -6
  66. package/test/temba-flow-collision.test.ts +225 -303
  67. package/test/temba-flow-editor.test.ts +0 -2
  68. package/test/temba-flow-plumber-connections.test.ts +97 -97
  69. package/test/temba-flow-plumber.test.ts +116 -103
@@ -57,5 +57,6 @@ export var CustomEventType;
57
57
  CustomEventType["NodeSaved"] = "temba-node-saved";
58
58
  CustomEventType["NodeEditCancelled"] = "temba-node-edit-cancelled";
59
59
  CustomEventType["FollowSimulation"] = "temba-follow-simulation";
60
+ CustomEventType["ContactClicked"] = "temba-contact-clicked";
60
61
  })(CustomEventType || (CustomEventType = {}));
61
62
  //# sourceMappingURL=interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,mCAAsB,CAAA;IACtB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;AAC1B,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,sDAAgC,CAAA;IAChC,gEAA0C,CAAA;IAC1C,4DAAsC,CAAA;AACxC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAkOD,MAAM,CAAN,IAAY,eAyCX;AAzCD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;IAC3B,yDAAsC,CAAA;IACtC,gDAA6B,CAAA;IAC7B,gDAA6B,CAAA;IAC7B,yDAAsC,CAAA;IACtC,uDAAoC,CAAA;IACpC,6DAA0C,CAAA;IAC1C,2DAAwC,CAAA;IACxC,2DAAwC,CAAA;IACxC,yDAAsC,CAAA;IACtC,qDAAkC,CAAA;IAClC,gDAA6B,CAAA;IAC7B,kDAA+B,CAAA;IAC/B,2CAAwB,CAAA;IACxB,uDAAoC,CAAA;IACpC,wCAAqB,CAAA;IACrB,uDAAoC,CAAA;IACpC,iDAA8B,CAAA;IAC9B,+CAA4B,CAAA;IAC5B,uDAAoC,CAAA;IACpC,uDAAoC,CAAA;IACpC,4CAAyB,CAAA;IACzB,2DAAwC,CAAA;IACxC,wCAAqB,CAAA;IACrB,gDAA6B,CAAA;IAC7B,0CAAuB,CAAA;IACvB,yDAAsC,CAAA;IACtC,wCAAqB,CAAA;IACrB,gEAA6C,CAAA;IAC7C,qDAAkC,CAAA;IAClC,sEAAmD,CAAA;IACnD,oEAAiD,CAAA;IACjD,qDAAkC,CAAA;IAClC,oEAAiD,CAAA;IACjD,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,kEAA+C,CAAA;IAC/C,+DAA4C,CAAA;AAC9C,CAAC,EAzCW,eAAe,KAAf,eAAe,QAyC1B","sourcesContent":["export interface Workspace {\n uuid: string;\n name: string;\n country: string;\n languages: string[];\n timezone: string;\n date_style: DateStyle;\n anon: boolean;\n}\n\nexport interface Language {\n iso: string;\n name: string;\n}\n\nexport interface Attachment {\n uuid: string;\n content_type: string;\n url: string;\n filename: string;\n size: number;\n error: string;\n}\n\nexport enum DateStyle {\n DayFirst = 'day_first',\n MonthFirst = 'month_first',\n YearFirst = 'year_first'\n}\n\nexport enum ScheduledEventType {\n CampaignEvent = 'campaign_event',\n ScheduledBroadcast = 'scheduled_broadcast',\n ScheduledTrigger = 'scheduled_trigger'\n}\n\nexport enum TicketStatus {\n Open = 'open',\n Closed = 'closed'\n}\n\nexport interface ScheduledEvent {\n type: ScheduledEventType;\n scheduled: string;\n repeat_period: string;\n campaign?: ObjectReference;\n flow?: ObjectReference;\n message?: string;\n}\n\nexport interface NamedUser extends User {\n name: string;\n}\n\nexport interface User {\n id?: number;\n first_name?: string;\n last_name?: string;\n name?: string;\n email?: string;\n role?: string;\n created_on?: string;\n avatar?: string;\n}\n\nexport interface Ticket {\n uuid: string;\n subject: string;\n body?: string;\n closed_on: string;\n opened_on: string;\n status: string;\n contact: ObjectReference;\n topic: ObjectReference;\n assignee?: { email: string; name: string; avatar?: string };\n}\n\nexport interface FlowResult {\n key: string;\n name: string;\n categories: string[];\n node_uuids: string[];\n}\n\nexport interface FlowDetails {\n name: string;\n results: FlowResult[];\n modified_on: string;\n runs: {\n active: number;\n completed: number;\n expired: number;\n interrupted: number;\n };\n}\n\nexport interface Msg {\n text: string;\n status: string;\n channel: ObjectReference;\n quick_replies: string[];\n urn: string;\n direction: string;\n type: string;\n attachments: string[];\n unsendable_reason?:\n | 'no_route'\n | 'contact_blocked'\n | 'contact_stopped'\n | 'contact_archived'\n | 'org_suspended'\n | 'looping';\n}\n\nexport interface ObjectReference {\n uuid: string;\n name: string;\n}\n\nexport interface Shortcut {\n uuid: string;\n name: string;\n text: string;\n modified_on: string;\n}\n\nexport interface ContactField {\n key: string;\n label: string;\n value_type: string;\n featured: boolean;\n priority: number;\n agent_access: string;\n type: string;\n usages: { campaign_events: number; flows: number; groups: number };\n}\n\nexport interface ContactGroup {\n uuid: string;\n count: number;\n name: string;\n query?: string;\n status: string;\n}\n\nexport interface URN {\n scheme: string;\n path: string;\n}\n\nexport interface Group {\n name: string;\n uuid: string;\n is_dynamic?: boolean;\n}\n\nexport interface ContactNote {\n text: string;\n created_on: string;\n created_by: NamedUser;\n}\n\nexport interface ContactTicket {\n name: string;\n uuid: string;\n status: string;\n\n contact: {\n uuid: string;\n name: string;\n created_on: Date;\n last_seen_on: Date;\n };\n}\n\nexport interface Contact {\n name: string;\n uuid: string;\n stopped: boolean;\n blocked: boolean;\n urns: string[];\n language?: string;\n fields: { [key: string]: string };\n groups: Group[];\n notes: ContactNote[];\n modified_on: string;\n created_on: string;\n last_seen_on: string;\n status: string;\n\n ref?: string; // only returned for anon workspaces\n flow?: ObjectReference;\n last_msg?: Msg;\n direction?: string;\n ticket: {\n uuid: string;\n subject: string;\n closed_on?: string;\n last_activity_on: string;\n assignee?: User;\n topic?: ObjectReference;\n };\n}\n\nexport interface FeatureProperties {\n name: string;\n osm_id: string;\n level: number;\n children?: FeatureProperties[];\n has_children?: boolean;\n aliases?: string;\n parent_osm_id?: string;\n id?: number;\n path?: string;\n}\n\nexport interface Position {\n top: number;\n left: number;\n}\n\nexport interface FunctionExample {\n template: string;\n output: string;\n}\n\nexport interface CompletionOption {\n name?: string;\n summary: string;\n\n // functions\n signature?: string;\n detail?: string;\n examples?: FunctionExample[];\n}\n\nexport interface CompletionResult {\n anchorPosition: Position;\n query: string;\n options: CompletionOption[];\n currentFunction: CompletionOption;\n}\n\nexport interface CompletionProperty {\n key: string;\n help: string;\n type: string;\n}\n\nexport interface CompletionType {\n name: string;\n\n key_source?: string;\n property_template?: CompletionProperty;\n properties?: CompletionProperty[];\n}\n\nexport interface CompletionSchema {\n types: CompletionType[];\n root: CompletionProperty[];\n root_no_session: CompletionProperty[];\n}\n\nexport type KeyedAssets = { [assetType: string]: string[] };\n\nexport enum CustomEventType {\n Loaded = 'temba-loaded',\n Loading = 'temba-loading',\n Canceled = 'temba-canceled',\n CursorChanged = 'temba-cursor-changed',\n Refreshed = 'temba-refreshed',\n Selection = 'temba-selection',\n ButtonClicked = 'temba-button-clicked',\n DialogHidden = 'temba-dialog-hidden',\n ScrollThreshold = 'temba-scroll-threshold',\n ContentChanged = 'temba-content-changed',\n ContextChanged = 'temba-context-changed',\n FetchComplete = 'temba-fetch-complete',\n MessageSent = 'temba-message-sent',\n Submitted = 'temba-submitted',\n Redirected = 'temba-redirected',\n NoPath = 'temba-no-path',\n StoreUpdated = 'temba-store-updated',\n Ready = 'temba-ready',\n OrderChanged = 'temba-order-changed',\n DragStart = 'temba-drag-start',\n DragStop = 'temba-drag-stop',\n DragExternal = 'temba-drag-external',\n DragInternal = 'temba-drag-internal',\n Resized = 'temba-resized',\n DetailsChanged = 'temba-details-changed',\n Error = 'temba-error',\n Interrupt = 'temba-interrupt',\n Opened = 'temba-opened',\n TicketUpdated = 'temba-ticket-updated',\n Moved = 'temba-moved',\n DateRangeChanged = 'temba-date-range-changed',\n NodeDeleted = 'temba-node-deleted',\n ActionEditRequested = 'temba-action-edit-requested',\n AddActionRequested = 'temba-add-action-requested',\n ActionSaved = 'temba-action-saved',\n ActionEditCanceled = 'temba-action-edit-canceled',\n NodeEditRequested = 'temba-node-edit-requested',\n NodeSaved = 'temba-node-saved',\n NodeEditCancelled = 'temba-node-edit-cancelled',\n FollowSimulation = 'temba-follow-simulation'\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,mCAAsB,CAAA;IACtB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;AAC1B,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,sDAAgC,CAAA;IAChC,gEAA0C,CAAA;IAC1C,4DAAsC,CAAA;AACxC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAkOD,MAAM,CAAN,IAAY,eA0CX;AA1CD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;IAC3B,yDAAsC,CAAA;IACtC,gDAA6B,CAAA;IAC7B,gDAA6B,CAAA;IAC7B,yDAAsC,CAAA;IACtC,uDAAoC,CAAA;IACpC,6DAA0C,CAAA;IAC1C,2DAAwC,CAAA;IACxC,2DAAwC,CAAA;IACxC,yDAAsC,CAAA;IACtC,qDAAkC,CAAA;IAClC,gDAA6B,CAAA;IAC7B,kDAA+B,CAAA;IAC/B,2CAAwB,CAAA;IACxB,uDAAoC,CAAA;IACpC,wCAAqB,CAAA;IACrB,uDAAoC,CAAA;IACpC,iDAA8B,CAAA;IAC9B,+CAA4B,CAAA;IAC5B,uDAAoC,CAAA;IACpC,uDAAoC,CAAA;IACpC,4CAAyB,CAAA;IACzB,2DAAwC,CAAA;IACxC,wCAAqB,CAAA;IACrB,gDAA6B,CAAA;IAC7B,0CAAuB,CAAA;IACvB,yDAAsC,CAAA;IACtC,wCAAqB,CAAA;IACrB,gEAA6C,CAAA;IAC7C,qDAAkC,CAAA;IAClC,sEAAmD,CAAA;IACnD,oEAAiD,CAAA;IACjD,qDAAkC,CAAA;IAClC,oEAAiD,CAAA;IACjD,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,kEAA+C,CAAA;IAC/C,+DAA4C,CAAA;IAC5C,2DAAwC,CAAA;AAC1C,CAAC,EA1CW,eAAe,KAAf,eAAe,QA0C1B","sourcesContent":["export interface Workspace {\n uuid: string;\n name: string;\n country: string;\n languages: string[];\n timezone: string;\n date_style: DateStyle;\n anon: boolean;\n}\n\nexport interface Language {\n iso: string;\n name: string;\n}\n\nexport interface Attachment {\n uuid: string;\n content_type: string;\n url: string;\n filename: string;\n size: number;\n error: string;\n}\n\nexport enum DateStyle {\n DayFirst = 'day_first',\n MonthFirst = 'month_first',\n YearFirst = 'year_first'\n}\n\nexport enum ScheduledEventType {\n CampaignEvent = 'campaign_event',\n ScheduledBroadcast = 'scheduled_broadcast',\n ScheduledTrigger = 'scheduled_trigger'\n}\n\nexport enum TicketStatus {\n Open = 'open',\n Closed = 'closed'\n}\n\nexport interface ScheduledEvent {\n type: ScheduledEventType;\n scheduled: string;\n repeat_period: string;\n campaign?: ObjectReference;\n flow?: ObjectReference;\n message?: string;\n}\n\nexport interface NamedUser extends User {\n name: string;\n}\n\nexport interface User {\n id?: number;\n first_name?: string;\n last_name?: string;\n name?: string;\n email?: string;\n role?: string;\n created_on?: string;\n avatar?: string;\n}\n\nexport interface Ticket {\n uuid: string;\n subject: string;\n body?: string;\n closed_on: string;\n opened_on: string;\n status: string;\n contact: ObjectReference;\n topic: ObjectReference;\n assignee?: { email: string; name: string; avatar?: string };\n}\n\nexport interface FlowResult {\n key: string;\n name: string;\n categories: string[];\n node_uuids: string[];\n}\n\nexport interface FlowDetails {\n name: string;\n results: FlowResult[];\n modified_on: string;\n runs: {\n active: number;\n completed: number;\n expired: number;\n interrupted: number;\n };\n}\n\nexport interface Msg {\n text: string;\n status: string;\n channel: ObjectReference;\n quick_replies: string[];\n urn: string;\n direction: string;\n type: string;\n attachments: string[];\n unsendable_reason?:\n | 'no_route'\n | 'contact_blocked'\n | 'contact_stopped'\n | 'contact_archived'\n | 'org_suspended'\n | 'looping';\n}\n\nexport interface ObjectReference {\n uuid: string;\n name: string;\n}\n\nexport interface Shortcut {\n uuid: string;\n name: string;\n text: string;\n modified_on: string;\n}\n\nexport interface ContactField {\n key: string;\n label: string;\n value_type: string;\n featured: boolean;\n priority: number;\n agent_access: string;\n type: string;\n usages: { campaign_events: number; flows: number; groups: number };\n}\n\nexport interface ContactGroup {\n uuid: string;\n count: number;\n name: string;\n query?: string;\n status: string;\n}\n\nexport interface URN {\n scheme: string;\n path: string;\n}\n\nexport interface Group {\n name: string;\n uuid: string;\n is_dynamic?: boolean;\n}\n\nexport interface ContactNote {\n text: string;\n created_on: string;\n created_by: NamedUser;\n}\n\nexport interface ContactTicket {\n name: string;\n uuid: string;\n status: string;\n\n contact: {\n uuid: string;\n name: string;\n created_on: Date;\n last_seen_on: Date;\n };\n}\n\nexport interface Contact {\n name: string;\n uuid: string;\n stopped: boolean;\n blocked: boolean;\n urns: string[];\n language?: string;\n fields: { [key: string]: string };\n groups: Group[];\n notes: ContactNote[];\n modified_on: string;\n created_on: string;\n last_seen_on: string;\n status: string;\n\n ref?: string; // only returned for anon workspaces\n flow?: ObjectReference;\n last_msg?: Msg;\n direction?: string;\n ticket: {\n uuid: string;\n subject: string;\n closed_on?: string;\n last_activity_on: string;\n assignee?: User;\n topic?: ObjectReference;\n };\n}\n\nexport interface FeatureProperties {\n name: string;\n osm_id: string;\n level: number;\n children?: FeatureProperties[];\n has_children?: boolean;\n aliases?: string;\n parent_osm_id?: string;\n id?: number;\n path?: string;\n}\n\nexport interface Position {\n top: number;\n left: number;\n}\n\nexport interface FunctionExample {\n template: string;\n output: string;\n}\n\nexport interface CompletionOption {\n name?: string;\n summary: string;\n\n // functions\n signature?: string;\n detail?: string;\n examples?: FunctionExample[];\n}\n\nexport interface CompletionResult {\n anchorPosition: Position;\n query: string;\n options: CompletionOption[];\n currentFunction: CompletionOption;\n}\n\nexport interface CompletionProperty {\n key: string;\n help: string;\n type: string;\n}\n\nexport interface CompletionType {\n name: string;\n\n key_source?: string;\n property_template?: CompletionProperty;\n properties?: CompletionProperty[];\n}\n\nexport interface CompletionSchema {\n types: CompletionType[];\n root: CompletionProperty[];\n root_no_session: CompletionProperty[];\n}\n\nexport type KeyedAssets = { [assetType: string]: string[] };\n\nexport enum CustomEventType {\n Loaded = 'temba-loaded',\n Loading = 'temba-loading',\n Canceled = 'temba-canceled',\n CursorChanged = 'temba-cursor-changed',\n Refreshed = 'temba-refreshed',\n Selection = 'temba-selection',\n ButtonClicked = 'temba-button-clicked',\n DialogHidden = 'temba-dialog-hidden',\n ScrollThreshold = 'temba-scroll-threshold',\n ContentChanged = 'temba-content-changed',\n ContextChanged = 'temba-context-changed',\n FetchComplete = 'temba-fetch-complete',\n MessageSent = 'temba-message-sent',\n Submitted = 'temba-submitted',\n Redirected = 'temba-redirected',\n NoPath = 'temba-no-path',\n StoreUpdated = 'temba-store-updated',\n Ready = 'temba-ready',\n OrderChanged = 'temba-order-changed',\n DragStart = 'temba-drag-start',\n DragStop = 'temba-drag-stop',\n DragExternal = 'temba-drag-external',\n DragInternal = 'temba-drag-internal',\n Resized = 'temba-resized',\n DetailsChanged = 'temba-details-changed',\n Error = 'temba-error',\n Interrupt = 'temba-interrupt',\n Opened = 'temba-opened',\n TicketUpdated = 'temba-ticket-updated',\n Moved = 'temba-moved',\n DateRangeChanged = 'temba-date-range-changed',\n NodeDeleted = 'temba-node-deleted',\n ActionEditRequested = 'temba-action-edit-requested',\n AddActionRequested = 'temba-add-action-requested',\n ActionSaved = 'temba-action-saved',\n ActionEditCanceled = 'temba-action-edit-canceled',\n NodeEditRequested = 'temba-node-edit-requested',\n NodeSaved = 'temba-node-saved',\n NodeEditCancelled = 'temba-node-edit-cancelled',\n FollowSimulation = 'temba-follow-simulation',\n ContactClicked = 'temba-contact-clicked'\n}\n"]}
@@ -8,7 +8,10 @@ export class TicketList extends TembaList {
8
8
  if (this.items.length > 0) {
9
9
  const lastActivity = this.items[0].ticket.last_activity_on;
10
10
  const separator = this.endpoint.includes('?') ? '&' : '?';
11
- return (this.endpoint + separator + 'after=' + new Date(lastActivity).getTime() * 1000);
11
+ return (this.endpoint +
12
+ separator +
13
+ 'after=' +
14
+ new Date(lastActivity).getTime() * 1000);
12
15
  }
13
16
  return this.endpoint;
14
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TicketList.js","sourceRoot":"","sources":["../../../src/list/TicketList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,SAAS;IAIhC,kBAAkB;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC;YAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAC1D,OAAO,CACL,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAC/E,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAES,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8BAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;+BAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM;;mCAE1B;gBACjB,CAAC,CAAC,IAAI;;;;;;;sBAOF,OAAO,CAAC,MAAM,CAAC,SAAS;gBAChC,OAAO,CAAC,MAAM,CAAC,gBAAgB;;;;;OAKtC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF;AArGC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAChB","sourcesContent":["import { html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { TembaList } from './TembaList';\nimport { Contact } from '../interfaces';\nimport { Icon } from '../Icons';\n\nexport class TicketList extends TembaList {\n @property({ type: String })\n agent = '';\n\n public getRefreshEndpoint() {\n if (this.items.length > 0) {\n const lastActivity = this.items[0].ticket.last_activity_on;\n const separator = this.endpoint.includes('?') ? '&' : '?';\n return (\n this.endpoint + separator + 'after=' + new Date(lastActivity).getTime() * 1000\n );\n }\n return this.endpoint;\n }\n\n protected sanitizeResults(results: any[]): Promise<any[]> {\n return new Promise<any[]>((resolve) => {\n const contacts: Contact[] = results as Contact[];\n this.store.resolveUsers(contacts, ['ticket.assignee']).then(() => {\n resolve(contacts);\n });\n });\n }\n\n constructor() {\n super();\n\n this.valueKey = 'ticket.uuid';\n this.renderOption = (contact: Contact): TemplateResult => {\n return html`\n <div\n style=\"align-items:center; margin-top: 0.1em; margin-bottom: 0.1em\"\n >\n <div\n style=\"display:flex; align-items: flex-start;border:0px solid red;\"\n >\n <div style=\"flex: 1; color:#333;\">\n <div\n style=\"font-weight:400;line-height:1.6;padding-right:0.5em;display:-webkit-box;-webkit-box-orient: vertical; -webkit-line-clamp: 1;overflow: hidden;\"\n >\n ${contact.name}\n </div>\n ${contact.ticket.closed_on\n ? null\n : contact.last_msg\n ? html`\n <div\n style=\"font-size: 0.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;\"\n >\n ${\n contact.last_msg.direction === 'I'\n ? html`<div\n style=\"border-radius:9999px; background:var(--color-primary-dark);width:6px;height:6px;display:inline-block;margin:0px 2px;margin-bottom:1px;\"\n ></div>`\n : null\n }\n ${\n contact.last_msg.text\n ? contact.last_msg.text\n : contact.last_msg.attachments\n ? html`<div style=\"display:inline-block\">\n <div style=\"display:flex; margin-left:0.2em\">\n <temba-icon\n name=\"${Icon.attachment}\"\n ></temba-icon>\n <div style=\"flex-grow:1;margin-left:0.2em\">\n Attachment\n </div>\n </div>\n </div>`\n : 'Unsupported Message'\n }\n </div></div>\n `\n : null}\n </div>\n <div\n style=\"margin-right: -5px; margin-top: 0px;display:flex;flex-direction:column;align-items:flex-end;max-width:60px;min-width:30px;border:0px solid green;text-align:right\"\n >\n <div>\n ${!contact.ticket.closed_on && contact.ticket.assignee\n ? html`<temba-user\n name=${contact.ticket.assignee.name}\n email=${contact.ticket.assignee.email}\n avatar=${contact.ticket.assignee.avatar}\n scale=\"0.8\"\n ></temba-user>`\n : null}\n </div>\n </div>\n </div>\n\n <div style=\"font-size:0.8em;text-align:right;border:0px solid red;\">\n <temba-date\n value=${contact.ticket.closed_on ||\n contact.ticket.last_activity_on}\n display=\"duration\"\n ></temba-date>\n </div>\n </div>\n `;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"TicketList.js","sourceRoot":"","sources":["../../../src/list/TicketList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,SAAS;IAIhC,kBAAkB;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAA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AAQ,CAAC,IAAI;wBACnB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI;wBACvB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW;4BAC9B,CAAC,CAAC,IAAI,CAAA;;;0CAGU,IAAI,CAAC,UAAU;;;;;;mCAMtB;4BACT,CAAC,CAAC,qBACN;;mBAEH;oBACH,CAAC,CAAC,IAAI;;;;;;kBAMJ,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ;gBACpD,CAAC,CAAC,IAAI,CAAA;6BACK,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI;8BAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;+BAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM;;mCAE1B;gBACjB,CAAC,CAAC,IAAI;;;;;;;sBAOF,OAAO,CAAC,MAAM,CAAC,SAAS;gBAChC,OAAO,CAAC,MAAM,CAAC,gBAAgB;;;;;OAKtC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF;AAxGC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAChB","sourcesContent":["import { html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { TembaList } from './TembaList';\nimport { Contact } from '../interfaces';\nimport { Icon } from '../Icons';\n\nexport class TicketList extends TembaList {\n @property({ type: String })\n agent = '';\n\n public getRefreshEndpoint() {\n if (this.items.length > 0) {\n const lastActivity = this.items[0].ticket.last_activity_on;\n const separator = this.endpoint.includes('?') ? '&' : '?';\n return (\n this.endpoint +\n separator +\n 'after=' +\n new Date(lastActivity).getTime() * 1000\n );\n }\n return this.endpoint;\n }\n\n protected sanitizeResults(results: any[]): Promise<any[]> {\n return new Promise<any[]>((resolve) => {\n const contacts: Contact[] = results as Contact[];\n this.store.resolveUsers(contacts, ['ticket.assignee']).then(() => {\n resolve(contacts);\n });\n });\n }\n\n constructor() {\n super();\n\n this.valueKey = 'ticket.uuid';\n this.renderOption = (contact: Contact): TemplateResult => {\n return html`\n <div\n style=\"align-items:center; margin-top: 0.1em; margin-bottom: 0.1em\"\n >\n <div\n style=\"display:flex; align-items: flex-start;border:0px solid red;\"\n >\n <div style=\"flex: 1; color:#333;\">\n <div\n style=\"font-weight:400;line-height:1.6;padding-right:0.5em;display:-webkit-box;-webkit-box-orient: vertical; -webkit-line-clamp: 1;overflow: hidden;\"\n >\n ${contact.name}\n </div>\n ${contact.ticket.closed_on\n ? null\n : contact.last_msg\n ? html`\n <div\n style=\"font-size: 0.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;\"\n >\n ${\n contact.last_msg.direction === 'I'\n ? html`<div\n style=\"border-radius:9999px; background:var(--color-primary-dark);width:6px;height:6px;display:inline-block;margin:0px 2px;margin-bottom:1px;\"\n ></div>`\n : null\n }\n ${\n contact.last_msg.text\n ? contact.last_msg.text\n : contact.last_msg.attachments\n ? html`<div style=\"display:inline-block\">\n <div style=\"display:flex; margin-left:0.2em\">\n <temba-icon\n name=\"${Icon.attachment}\"\n ></temba-icon>\n <div style=\"flex-grow:1;margin-left:0.2em\">\n Attachment\n </div>\n </div>\n </div>`\n : 'Unsupported Message'\n }\n </div></div>\n `\n : null}\n </div>\n <div\n style=\"margin-right: -5px; margin-top: 0px;display:flex;flex-direction:column;align-items:flex-end;max-width:60px;min-width:30px;border:0px solid green;text-align:right\"\n >\n <div>\n ${!contact.ticket.closed_on && contact.ticket.assignee\n ? html`<temba-user\n name=${contact.ticket.assignee.name}\n email=${contact.ticket.assignee.email}\n avatar=${contact.ticket.assignee.avatar}\n scale=\"0.8\"\n ></temba-user>`\n : null}\n </div>\n </div>\n </div>\n\n <div style=\"font-size:0.8em;text-align:right;border:0px solid red;\">\n <temba-date\n value=${contact.ticket.closed_on ||\n contact.ticket.last_activity_on}\n display=\"duration\"\n ></temba-date>\n </div>\n </div>\n `;\n };\n }\n}\n"]}
@@ -238,6 +238,8 @@ export class ContactChat extends ContactStoreElement {
238
238
  this.agent = '';
239
239
  this.blockFetching = false;
240
240
  this.showInterrupt = false;
241
+ this.disableAssign = false;
242
+ this.disableReply = false;
241
243
  this.avatar = DEFAULT_AVATAR;
242
244
  this._showMessageLogsAfter = null;
243
245
  this.ticket = null;
@@ -503,6 +505,12 @@ export class ContactChat extends ContactStoreElement {
503
505
  }
504
506
  else {
505
507
  if (!this.currentTicket.closed_on) {
508
+ // hide compose if agent can't reply to unassigned tickets
509
+ if (this.disableReply &&
510
+ (!this.currentTicket.assignee ||
511
+ this.currentTicket.assignee.email !== this.agent)) {
512
+ return null;
513
+ }
506
514
  //chatbox for active contacts with an open ticket
507
515
  return this.getCompose();
508
516
  }
@@ -567,6 +575,9 @@ export class ContactChat extends ContactStoreElement {
567
575
  }
568
576
  }
569
577
  assignTicket(email) {
578
+ if (this.disableAssign) {
579
+ return;
580
+ }
570
581
  // if its already assigned to use, it's a noop
571
582
  if ((this.currentTicket.assignee &&
572
583
  this.currentTicket.assignee.email === email) ||
@@ -683,7 +694,7 @@ export class ContactChat extends ContactStoreElement {
683
694
  ? [this.currentTicket.assignee]
684
695
  : []}
685
696
  @change=${this.handleAssignmentChanged}
686
- ?disabled=${ticketClosed}
697
+ ?disabled=${ticketClosed || this.disableAssign}
687
698
  ></temba-user-select>
688
699
 
689
700
  <temba-select
@@ -745,6 +756,12 @@ __decorate([
745
756
  __decorate([
746
757
  property({ type: Boolean })
747
758
  ], ContactChat.prototype, "showInterrupt", void 0);
759
+ __decorate([
760
+ property({ type: Boolean })
761
+ ], ContactChat.prototype, "disableAssign", void 0);
762
+ __decorate([
763
+ property({ type: Boolean })
764
+ ], ContactChat.prototype, "disableReply", void 0);
748
765
  __decorate([
749
766
  property({ type: String })
750
767
  ], ContactChat.prototype, "avatar", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ContactChat.js","sourceRoot":"","sources":["../../../src/live/ContactChat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ValueMap, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport {\n Contact,\n CustomEventType,\n NamedUser,\n Ticket,\n User\n} from '../interfaces';\nimport {\n fetchResults,\n generateUUIDv7,\n getUrl,\n postJSON,\n postUrl,\n WebResponse\n} from '../utils';\nimport { ContactStoreElement } from './ContactStoreElement';\nimport { Compose, ComposeValue } from '../form/Compose';\nimport { ContactHistoryPage } from '../events';\nimport { Chat, MessageType, ContactEvent } from '../display/Chat';\nimport { DEFAULT_AVATAR } from '../webchat/assets';\nimport { UserSelect } from '../form/select/UserSelect';\nimport { Select } from '../form/select/Select';\nimport {\n renderEvent,\n renderTicketAction,\n renderTicketAssigneeChanged\n} from '../events/eventRenderers';\n\n/*\nexport const SCROLL_THRESHOLD = 100;\nexport const SIMULATED_WEB_SLOWNESS = 0;\nexport const MAX_CHAT_REFRESH = 10000;\nexport const MIN_CHAT_REFRESH = 500;\nexport const BODY_SNIPPET_LENGTH = 250;\n*/\n\n// re-export for backwards compatibility\nexport { renderTicketAction, renderTicketAssigneeChanged };\n\nexport class ContactChat extends ContactStoreElement {\n public static get styles() {\n return css`\n :host {\n flex-grow: 1;\n display: flex;\n flex-direction: row;\n min-height: 0;\n --compose-shadow: none;\n --compose-border: none;\n --compose-padding: 3px;\n --compose-curvature: none;\n border-top: 1px inset rgba(0, 0, 0, 0.05);\n\n\n }\n\n .chat-wrapper {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n min-height: 0;\n background: #f9f9f9;\n }\n\n temba-contact-history {\n border-bottom: 1px solid #f6f6f6;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n }\n\n .compose {\n background: #fff;\n display: flex;\n flex-direction: column;\n --textarea-min-height: 8em;\n --textarea-height: 0.5em;\n --widget-box-shadow-focused: none;\n --compose-curvature: 0px;\n overflow: hidden;\n }\n\n .closed-footer {\n padding: 1em;\n background: #f2f2f2;\n border-top: 3px solid #e1e1e1;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n a {\n color: var(--color-link-primary);\n }\n\n a:hover {\n text-decoration: underline;\n color: var(--color-link-primary-hover);\n }\n\n temba-button {\n margin: 0.1em 0.25em;\n }\n\n temba-completion {\n --widget-box-shadow: none;\n --color-widget-border: transparent;\n --widget-box-shadow-focused: none;\n --color-focus: transparent;\n --color-widget-bg-focused: transparent;\n }\n\n .border {\n }\n\n temba-compose {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n --temba-tabs-options-padding: 0.5em 0.5em 0 0.5em;\n --temba-tabs-border-left: none;\n --temba-tabs-border-right: none;\n --temba-tabs-border-bottom: none;\n }\n\n .error-gutter {\n display: flex;\n padding: 0.5em 1em;\n background: #f9f9f9;\n item-align: center;\n }\n\n .error-message {\n color: var(--color-error);\n padding-right: 1em;\n flex-grow: 1;\n align-self: center;\n }\n\n temba-chat {\n border-bottom: 1px solid #ddd;\n background: linear-gradient(0deg, #fff, #fff);\n --chat-border-in: 1px solid #eee;\n --color-chat-out: var(--color-message)\n );\n }\n\n .action-bar {\n }\n\n .in-flow {\n border-radius: 0.8em;\n align-items: center;\n background: #666;\n padding: 0.5em 1em;\n margin: 1em;\n margin-right: 2em;\n display: inline-flex;\n opacity: 0.9;\n }\n\n .in-flow:hover {\n opacity: 1;\n }\n\n .in-flow .flow-name {\n display: flex;\n color: #fff;\n }\n\n .in-flow a {\n font-weight: bold;\n color: #fff;\n }\n\n .in-flow .interrupt-button {\n margin-left: 1em;\n }\n\n .in-flow .interrupt {\n text-align: center;\n align-self: stretch;\n display: flex;\n align-items: center;\n cursor: pointer;\n justify-content: center;\n padding: 0.5em 1em;\n font-weight: bold;\n }\n\n .in-flow .interrupt:hover {\n background: rgba(var(--error-rgb), 0.92);\n }\n\n .in-flow temba-icon,\n .in-ticket temba-icon {\n margin-right: 0.5em;\n }\n\n .in-ticket-wrapper {\n }\n\n .in-ticket {\n box-shadow: none;\n padding: 0.5em 0.5em;\n text-align: center;\n align-items: center;\n border-bottom: 1px solid #ddd;\n display: flex;\n box-shadow: none;\n margin: 0em;\n background: rgba(0, 0, 0, 0.03);\n }\n\n temba-user {\n border: 1px solid #ddd;\n padding: 0.2em 0.5em;\n border-radius: var(--curvature);\n min-width: 10em;\n background: #fff;\n }\n\n temba-user:hover {\n border: 1px solid #ddd;\n background: #f9f9f9;\n }\n\n .assign-button {\n --button-mask: #ebebeb;\n color: #333;\n margin: 0.25em;\n }\n\n temba-user-select {\n width: 250px;\n }\n\n temba-button {\n --button-border: 1px solid #ddd;\n }\n `;\n }\n\n @property({ type: String, attribute: 'ticket' })\n ticketUUID: string;\n\n @property({ type: String })\n contactsEndpoint = '/api/v2/contacts.json';\n\n @property({ type: String })\n currentNote = '';\n\n @property({ type: Boolean })\n showDetails = true;\n\n @property({ type: Object })\n currentTicket: Ticket = null;\n\n @property({ type: Object })\n currentContact: Contact = null;\n\n @property({ type: String })\n agent = '';\n\n @property({ type: Boolean })\n blockFetching = false;\n\n @property({ type: Boolean })\n showInterrupt = false;\n\n @property({ type: String })\n avatar = DEFAULT_AVATAR;\n\n @property({ type: String })\n set showMessageLogsAfter(value: string) {\n const oldValue = this._showMessageLogsAfter;\n this._showMessageLogsAfter = value ? new Date(value) : null;\n this.requestUpdate('showMessageLogsAfter', oldValue);\n }\n\n get showMessageLogsAfter(): Date {\n return this._showMessageLogsAfter;\n }\n\n private _showMessageLogsAfter: Date = null;\n\n @property({ type: String })\n errorMessage: string;\n\n // http promise to monitor for completeness\n public httpComplete: Promise<void>;\n private chat: Chat;\n\n ticket = null;\n beforeUUID: string = null; // for scrolling back through history\n afterUUID: string = null; // for polling new messages\n refreshId = null;\n polling = false;\n pollingInterval = 2000; // start at 2 seconds\n lastFetchTime: number = null;\n\n constructor() {\n super();\n }\n\n public firstUpdated(\n changed: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.firstUpdated(changed);\n }\n\n public connectedCallback() {\n super.connectedCallback();\n this.chat = this.shadowRoot.querySelector('temba-chat');\n }\n\n public disconnectedCallback() {\n super.disconnectedCallback();\n if (this.refreshId) {\n clearInterval(this.refreshId);\n }\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n\n // if we don't have an endpoint infer one\n if (\n changedProperties.has('data') ||\n changedProperties.has('currentContact')\n ) {\n // unschedule any previous refreshes\n if (this.refreshId) {\n clearTimeout(this.refreshId);\n this.refreshId = null;\n }\n\n this.currentContact = this.data;\n }\n\n if (changedProperties.has('currentContact') && this.currentContact) {\n this.chat = this.shadowRoot.querySelector('temba-chat');\n if (\n this.currentContact.uuid !==\n changedProperties.get('currentContact')?.uuid\n ) {\n this.reset();\n } else {\n setTimeout(() => this.checkForNewMessages(), 500);\n }\n this.fetchPreviousMessages();\n }\n }\n\n private reset() {\n if (this.chat) {\n this.chat.reset();\n }\n this.blockFetching = false;\n this.ticket = null;\n this.beforeUUID = null;\n this.afterUUID = null;\n this.refreshId = null;\n this.polling = false;\n this.pollingInterval = 2000;\n this.lastFetchTime = null;\n this.errorMessage = null;\n\n const compose = this.shadowRoot.querySelector('temba-compose') as Compose;\n if (compose) {\n compose.reset();\n }\n }\n\n private handleInterrupt() {\n this.fireCustomEvent(CustomEventType.Interrupt, {\n contact: this.currentContact\n });\n }\n\n private handleRetry() {\n const compose = this.shadowRoot.querySelector('temba-compose') as Compose;\n compose.triggerSend();\n }\n\n private handleSend(evt: CustomEvent) {\n this.errorMessage = null;\n const composeEle = evt.currentTarget as Compose;\n const compose = evt.detail.langValues['und'] as ComposeValue;\n\n const payload = {\n contact: this.currentContact.uuid\n };\n\n const text = compose.text;\n if (text && text.length > 0) {\n payload['text'] = text;\n }\n const attachments = compose.attachments;\n if (attachments && attachments.length > 0) {\n const attachment_uuids = attachments.map((attachment) => attachment.uuid);\n payload['attachments'] = attachment_uuids;\n }\n\n if (this.currentTicket) {\n payload['ticket'] = this.currentTicket.uuid;\n }\n\n const genericError = 'Send failed, please try again.';\n postJSON(`/contact/chat/${this.currentContact.uuid}/`, payload)\n .then((response) => {\n if (response.status < 400) {\n const event = response.json.event;\n event.created_on = new Date(event.created_on);\n this.chat.addMessages([event], null, true);\n // reset polling interval to 2 seconds after sending a message\n this.pollingInterval = 2000;\n this.checkForNewMessages();\n composeEle.reset();\n this.fireCustomEvent(CustomEventType.MessageSent, {\n msg: payload,\n response\n });\n } else {\n this.errorMessage = genericError;\n }\n })\n .catch(() => {\n this.errorMessage = genericError;\n });\n }\n\n private getEndpoint() {\n if (this.contact) {\n return `/contact/chat/${this.contact}/`;\n }\n return null;\n }\n\n private scheduleRefresh(hasNewEvents = false) {\n if (this.refreshId) {\n clearTimeout(this.refreshId);\n this.refreshId = null;\n }\n\n // reset to 2 seconds if we received new events\n if (hasNewEvents) {\n this.pollingInterval = 2000;\n } else {\n // increase interval by 1 second up to max of 15 seconds\n this.pollingInterval = Math.min(this.pollingInterval + 1000, 15000);\n }\n\n this.refreshId = setTimeout(() => {\n this.checkForNewMessages();\n }, this.pollingInterval);\n }\n\n public prerender(event: ContactEvent) {\n // use the unified renderEvent function with isSimulation = false\n const rendered = renderEvent(event, false);\n\n if (rendered) {\n event._rendered = {\n html: rendered,\n type: MessageType.Inline\n };\n }\n }\n\n private createMessages(page: ContactHistoryPage): ContactEvent[] {\n if (page.events) {\n const messages: ContactEvent[] = [];\n page.events.forEach((event) => {\n // track the UUID of the newest event for polling\n if (\n !this.afterUUID ||\n event.uuid.toLowerCase() > this.afterUUID.toLowerCase()\n ) {\n this.afterUUID = event.uuid;\n }\n\n // convert to dates\n event.created_on = new Date(event.created_on);\n\n if (\n event.type === 'msg_created' ||\n event.type === 'msg_received' ||\n event.type === 'ivr_created'\n ) {\n messages.push(event);\n } else {\n this.prerender(event);\n if (event._rendered) {\n messages.push(event);\n }\n }\n });\n\n // remove any messages we don't recognize\n return messages.filter((msg) => !!msg);\n }\n return [];\n }\n\n private checkForNewMessages() {\n // we are already working on it\n if (this.polling) {\n return;\n }\n\n const chat = this.chat;\n if (this.currentContact && this.afterUUID) {\n this.polling = true;\n this.lastFetchTime = Date.now();\n const endpoint = this.getEndpoint();\n if (!endpoint) {\n return;\n }\n\n const fetchContact = this.currentContact.uuid;\n\n fetchContactHistory(\n endpoint,\n this.currentTicket?.uuid,\n null,\n this.afterUUID\n ).then((page: ContactHistoryPage) => {\n const messages = this.createMessages(page);\n messages.reverse();\n if (fetchContact === this.currentContact.uuid) {\n const hasNewEvents = messages.length > 0;\n chat.addMessages(messages, null, true);\n this.polling = false;\n this.scheduleRefresh(hasNewEvents);\n } else {\n this.polling = false;\n }\n });\n }\n }\n\n private fetchPreviousMessages() {\n const chat = this.chat;\n const contactChat = this;\n if (!chat || chat.fetching || contactChat.blockFetching) {\n return;\n }\n\n chat.fetching = true;\n if (this.currentContact) {\n const endpoint = this.getEndpoint();\n if (!endpoint) {\n return;\n }\n\n // initialize anchor UUID if not set (first fetch)\n if (!this.beforeUUID && !this.afterUUID) {\n // generate a UUID v7 for current time as the anchor\n const anchorUUID = generateUUIDv7();\n this.beforeUUID = anchorUUID;\n this.afterUUID = anchorUUID;\n }\n\n fetchContactHistory(\n endpoint,\n this.currentTicket?.uuid,\n this.beforeUUID,\n null\n ).then((page: ContactHistoryPage) => {\n const messages = this.createMessages(page);\n messages.reverse();\n\n if (messages.length === 0) {\n contactChat.blockFetching = true;\n } else if (page.next) {\n // update beforeUUID for next fetch of older messages\n this.beforeUUID = page.next;\n } else {\n // no more history, mark end and show oldest event date\n contactChat.blockFetching = true;\n if (page.events && page.events.length > 0) {\n const oldestEvent = page.events[page.events.length - 1];\n chat.setEndOfHistory(new Date(oldestEvent.created_on));\n }\n }\n\n chat.addMessages(messages);\n this.scheduleRefresh();\n });\n }\n }\n\n private fetchComplete() {\n if (this.chat) {\n this.chat.fetching = false;\n }\n }\n\n private getTembaCompose(): TemplateResult {\n if (this.currentTicket) {\n if (this.currentContact && this.currentContact.status !== 'active') {\n //no chatbox for archived, blocked, or stopped contacts\n return null;\n } else {\n if (!this.currentTicket.closed_on) {\n //chatbox for active contacts with an open ticket\n return this.getCompose();\n } else {\n return null;\n }\n }\n }\n\n if (this.currentContact && this.currentContact.status !== 'active') {\n //no chatbox for archived, blocked, or stopped contacts\n return null;\n } else {\n //chatbox for active contacts\n return this.getCompose();\n }\n }\n\n private getCompose(): TemplateResult {\n return html`<div class=\"border\"></div>\n <div class=\"compose\">\n <temba-compose\n attachments\n counter\n autogrow\n shortcuts\n ?embeddedTabs=${!this.currentTicket}\n @temba-submitted=${this.handleSend.bind(this)}\n >\n </temba-compose>\n ${this.errorMessage\n ? html` <div class=\"error-gutter\">\n <div class=\"error-message\">${this.errorMessage}</div>\n <temba-button\n name=\"Retry\"\n @click=${this.handleRetry}\n ></temba-button>\n </div>`\n : null}\n </div>`;\n }\n\n private handleAssignmentChanged(evt: CustomEvent) {\n const users = evt.currentTarget as UserSelect;\n const assignee = users.values[0];\n\n this.assignTicket(assignee ? assignee.email : null);\n users.blur();\n }\n\n private handleTopicChanged(evt: CustomEvent) {\n const select = evt.target as Select<any>;\n const topic = select.values[0];\n\n if (this.currentTicket.topic.uuid !== topic.uuid) {\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [this.currentTicket.uuid],\n action: 'change_topic',\n topic: topic.uuid\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n }\n\n public assignTicket(email: string) {\n // if its already assigned to use, it's a noop\n if (\n (this.currentTicket.assignee &&\n this.currentTicket.assignee.email === email) ||\n (this.currentTicket.assignee === null && email === null)\n ) {\n return;\n }\n\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [this.currentTicket.uuid],\n action: 'assign',\n assignee: email\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n return true;\n }\n\n public refreshTicket() {\n if (this.currentTicket) {\n fetchResults(`/api/v2/tickets.json?uuid=${this.currentTicket.uuid}`).then(\n (values) => {\n if (values.length > 0) {\n this.fireCustomEvent(CustomEventType.TicketUpdated, {\n ticket: values[0],\n previous: this.currentTicket\n });\n this.currentTicket = values[0];\n }\n }\n );\n }\n }\n\n private handleReopen() {\n const uuid = this.currentTicket.uuid;\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [uuid],\n action: 'reopen'\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n\n private handleClose() {\n const uuid = this.currentTicket.uuid;\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [uuid],\n action: 'close'\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n\n public render(): TemplateResult {\n const inFlow = this.currentContact && this.currentContact.flow;\n\n const inTicket = this.currentTicket;\n const ticketClosed = this.currentTicket && this.currentTicket.closed_on;\n\n return html`<div class=\"chat-wrapper\">\n ${this.currentContact\n ? html`<temba-chat\n @temba-scroll-threshold=${this.fetchPreviousMessages}\n @temba-fetch-complete=${this.fetchComplete}\n avatar=${this.avatar}\n agent\n avatars\n ?hasFooter=${inFlow}\n .showMessageLogsAfter=${this.showMessageLogsAfter}\n >\n ${inFlow\n ? html`\n <div slot=\"footer\" style=\"text-align:center;\">\n <div class=\"in-flow\">\n <div class=\"flow-name\">\n <temba-icon name=\"flow\" size=\"1.2\"></temba-icon>\n <div>\n Currently in\n <a\n href=\"/flow/editor/${this.currentContact.flow\n .uuid}/\"\n >${this.currentContact.flow.name}</a\n >\n </div>\n </div>\n ${this.showInterrupt\n ? html`<temba-button\n class=\"interrupt-button\"\n destructive\n small\n @click=${this.handleInterrupt}\n name=\"Interrupt\"\n >\n </temba-button>`\n : null}\n </div>\n </div>\n `\n : null}\n <div slot=\"footer\"></div>\n </temba-chat>\n ${inTicket\n ? html`<div class=\"in-ticket-wrapper\">\n <div class=\"in-ticket\">\n <temba-user-select\n placeholder=\"Assign to..\"\n searchable\n searchOnFocus\n clearable\n .values=${this.currentTicket.assignee\n ? [this.currentTicket.assignee]\n : []}\n @change=${this.handleAssignmentChanged}\n ?disabled=${ticketClosed}\n ></temba-user-select>\n\n <temba-select\n style=\"margin:0 0.5em; flex-grow:1\"\n endpoint=\"/api/v2/topics.json\"\n searchable\n valuekey=\"uuid\"\n .values=${[this.currentTicket.topic]}\n @change=${this.handleTopicChanged}\n ?disabled=${ticketClosed}\n ></temba-select>\n\n ${this.currentTicket.closed_on\n ? html`\n <temba-button\n name=\"Reopen\"\n @click=${this.handleReopen}\n ></temba-button>\n `\n : html`\n <temba-button\n name=\"Close\"\n destructive\n @click=${this.handleClose}\n ></temba-button>\n `}\n </div>\n </div> `\n : null}\n ${this.getTembaCompose()}`\n : null}\n </div>`;\n }\n}\nexport const closeTicket = (uuid: string): Promise<WebResponse> => {\n const formData = new FormData();\n formData.append('status', 'C');\n return postUrl(`/ticket/update/${uuid}/?_format=json`, formData);\n};\nexport const fetchContact = (endpoint: string): Promise<Contact> => {\n return new Promise<Contact>((resolve, reject) => {\n fetchResults(endpoint).then((contacts: Contact[]) => {\n if (contacts && contacts.length === 1) {\n resolve(contacts[0]);\n } else {\n reject('No contact found');\n }\n });\n });\n};\nexport const fetchContactHistory = (\n endpoint: string,\n ticket: string = undefined,\n before: string = undefined,\n after: string = undefined\n): Promise<ContactHistoryPage> => {\n return new Promise<ContactHistoryPage>((resolve) => {\n const controller = new AbortController();\n pendingRequests.push(controller);\n\n let url = endpoint;\n const params = [];\n\n if (before) {\n params.push(`before=${before}`);\n }\n\n if (after) {\n params.push(`after=${after}`);\n }\n\n if (ticket) {\n params.push(`ticket=${ticket}`);\n }\n\n if (params.length > 0) {\n url += (url.includes('?') ? '&' : '?') + params.join('&');\n }\n\n getUrl(url, controller)\n .then((response: WebResponse) => {\n // on success, remove our abort controller\n pendingRequests = pendingRequests.filter(\n (controller: AbortController) => {\n return response.controller === controller;\n }\n );\n\n resolve(response.json as ContactHistoryPage);\n })\n .catch(() => {\n // canceled\n });\n });\n};\nexport const getDisplayName = (user: User) => {\n if (!user) {\n return 'Somebody';\n }\n\n if ((user as NamedUser).name) {\n return (user as NamedUser).name;\n }\n\n if (user.first_name && user.last_name) {\n return `${user.first_name} ${user.last_name}`;\n }\n\n if (user.first_name) {\n return user.first_name;\n }\n\n return user.email;\n};\nexport let pendingRequests: AbortController[] = [];\n"]}
1
+ {"version":3,"file":"ContactChat.js","sourceRoot":"","sources":["../../../src/live/ContactChat.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAoC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAEL,eAAe,EAIhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,MAAM,EACN,QAAQ,EACR,OAAO,EAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAQ,WAAW,EAAgB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC;;;;;;EAME;AAEF,wCAAwC;AACxC,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,CAAC;AAE3D,MAAM,OAAO,WAAY,SAAQ,mBAAmB;IAC3C,MAAM,KAAK,MAAM;QACtB,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuMT,CAAC;IACJ,CAAC;IAuCD,IAAI,oBAAoB,CAAC,KAAa;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC;QA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AE;YACV,WAAW;QACb,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,EAAE;IAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAK,IAAkB,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAQ,IAAkB,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACtC,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IAChD,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,IAAI,eAAe,GAAsB,EAAE,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-this-alias */\nimport { css, html, PropertyValueMap, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport {\n Contact,\n CustomEventType,\n NamedUser,\n Ticket,\n User\n} from '../interfaces';\nimport {\n fetchResults,\n generateUUIDv7,\n getUrl,\n postJSON,\n postUrl,\n WebResponse\n} from '../utils';\nimport { ContactStoreElement } from './ContactStoreElement';\nimport { Compose, ComposeValue } from '../form/Compose';\nimport { ContactHistoryPage } from '../events';\nimport { Chat, MessageType, ContactEvent } from '../display/Chat';\nimport { DEFAULT_AVATAR } from '../webchat/assets';\nimport { UserSelect } from '../form/select/UserSelect';\nimport { Select } from '../form/select/Select';\nimport {\n renderEvent,\n renderTicketAction,\n renderTicketAssigneeChanged\n} from '../events/eventRenderers';\n\n/*\nexport const SCROLL_THRESHOLD = 100;\nexport const SIMULATED_WEB_SLOWNESS = 0;\nexport const MAX_CHAT_REFRESH = 10000;\nexport const MIN_CHAT_REFRESH = 500;\nexport const BODY_SNIPPET_LENGTH = 250;\n*/\n\n// re-export for backwards compatibility\nexport { renderTicketAction, renderTicketAssigneeChanged };\n\nexport class ContactChat extends ContactStoreElement {\n public static get styles() {\n return css`\n :host {\n flex-grow: 1;\n display: flex;\n flex-direction: row;\n min-height: 0;\n --compose-shadow: none;\n --compose-border: none;\n --compose-padding: 3px;\n --compose-curvature: none;\n border-top: 1px inset rgba(0, 0, 0, 0.05);\n\n\n }\n\n .chat-wrapper {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n min-height: 0;\n background: #f9f9f9;\n }\n\n temba-contact-history {\n border-bottom: 1px solid #f6f6f6;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n min-height: 0;\n }\n\n .compose {\n background: #fff;\n display: flex;\n flex-direction: column;\n --textarea-min-height: 8em;\n --textarea-height: 0.5em;\n --widget-box-shadow-focused: none;\n --compose-curvature: 0px;\n overflow: hidden;\n }\n\n .closed-footer {\n padding: 1em;\n background: #f2f2f2;\n border-top: 3px solid #e1e1e1;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n a {\n color: var(--color-link-primary);\n }\n\n a:hover {\n text-decoration: underline;\n color: var(--color-link-primary-hover);\n }\n\n temba-button {\n margin: 0.1em 0.25em;\n }\n\n temba-completion {\n --widget-box-shadow: none;\n --color-widget-border: transparent;\n --widget-box-shadow-focused: none;\n --color-focus: transparent;\n --color-widget-bg-focused: transparent;\n }\n\n .border {\n }\n\n temba-compose {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n --temba-tabs-options-padding: 0.5em 0.5em 0 0.5em;\n --temba-tabs-border-left: none;\n --temba-tabs-border-right: none;\n --temba-tabs-border-bottom: none;\n }\n\n .error-gutter {\n display: flex;\n padding: 0.5em 1em;\n background: #f9f9f9;\n item-align: center;\n }\n\n .error-message {\n color: var(--color-error);\n padding-right: 1em;\n flex-grow: 1;\n align-self: center;\n }\n\n temba-chat {\n border-bottom: 1px solid #ddd;\n background: linear-gradient(0deg, #fff, #fff);\n --chat-border-in: 1px solid #eee;\n --color-chat-out: var(--color-message)\n );\n }\n\n .action-bar {\n }\n\n .in-flow {\n border-radius: 0.8em;\n align-items: center;\n background: #666;\n padding: 0.5em 1em;\n margin: 1em;\n margin-right: 2em;\n display: inline-flex;\n opacity: 0.9;\n }\n\n .in-flow:hover {\n opacity: 1;\n }\n\n .in-flow .flow-name {\n display: flex;\n color: #fff;\n }\n\n .in-flow a {\n font-weight: bold;\n color: #fff;\n }\n\n .in-flow .interrupt-button {\n margin-left: 1em;\n }\n\n .in-flow .interrupt {\n text-align: center;\n align-self: stretch;\n display: flex;\n align-items: center;\n cursor: pointer;\n justify-content: center;\n padding: 0.5em 1em;\n font-weight: bold;\n }\n\n .in-flow .interrupt:hover {\n background: rgba(var(--error-rgb), 0.92);\n }\n\n .in-flow temba-icon,\n .in-ticket temba-icon {\n margin-right: 0.5em;\n }\n\n .in-ticket-wrapper {\n }\n\n .in-ticket {\n box-shadow: none;\n padding: 0.5em 0.5em;\n text-align: center;\n align-items: center;\n border-bottom: 1px solid #ddd;\n display: flex;\n box-shadow: none;\n margin: 0em;\n background: rgba(0, 0, 0, 0.03);\n }\n\n temba-user {\n border: 1px solid #ddd;\n padding: 0.2em 0.5em;\n border-radius: var(--curvature);\n min-width: 10em;\n background: #fff;\n }\n\n temba-user:hover {\n border: 1px solid #ddd;\n background: #f9f9f9;\n }\n\n .assign-button {\n --button-mask: #ebebeb;\n color: #333;\n margin: 0.25em;\n }\n\n temba-user-select {\n width: 250px;\n }\n\n temba-button {\n --button-border: 1px solid #ddd;\n }\n `;\n }\n\n @property({ type: String, attribute: 'ticket' })\n ticketUUID: string;\n\n @property({ type: String })\n contactsEndpoint = '/api/v2/contacts.json';\n\n @property({ type: String })\n currentNote = '';\n\n @property({ type: Boolean })\n showDetails = true;\n\n @property({ type: Object })\n currentTicket: Ticket = null;\n\n @property({ type: Object })\n currentContact: Contact = null;\n\n @property({ type: String })\n agent = '';\n\n @property({ type: Boolean })\n blockFetching = false;\n\n @property({ type: Boolean })\n showInterrupt = false;\n\n @property({ type: Boolean })\n disableAssign = false;\n\n @property({ type: Boolean })\n disableReply = false;\n\n @property({ type: String })\n avatar = DEFAULT_AVATAR;\n\n @property({ type: String })\n set showMessageLogsAfter(value: string) {\n const oldValue = this._showMessageLogsAfter;\n this._showMessageLogsAfter = value ? new Date(value) : null;\n this.requestUpdate('showMessageLogsAfter', oldValue);\n }\n\n get showMessageLogsAfter(): Date {\n return this._showMessageLogsAfter;\n }\n\n private _showMessageLogsAfter: Date = null;\n\n @property({ type: String })\n errorMessage: string;\n\n // http promise to monitor for completeness\n public httpComplete: Promise<void>;\n private chat: Chat;\n\n ticket = null;\n beforeUUID: string = null; // for scrolling back through history\n afterUUID: string = null; // for polling new messages\n refreshId = null;\n polling = false;\n pollingInterval = 2000; // start at 2 seconds\n lastFetchTime: number = null;\n\n constructor() {\n super();\n }\n\n public firstUpdated(\n changed: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.firstUpdated(changed);\n }\n\n public connectedCallback() {\n super.connectedCallback();\n this.chat = this.shadowRoot.querySelector('temba-chat');\n }\n\n public disconnectedCallback() {\n super.disconnectedCallback();\n if (this.refreshId) {\n clearInterval(this.refreshId);\n }\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n\n // if we don't have an endpoint infer one\n if (\n changedProperties.has('data') ||\n changedProperties.has('currentContact')\n ) {\n // unschedule any previous refreshes\n if (this.refreshId) {\n clearTimeout(this.refreshId);\n this.refreshId = null;\n }\n\n this.currentContact = this.data;\n }\n\n if (changedProperties.has('currentContact') && this.currentContact) {\n this.chat = this.shadowRoot.querySelector('temba-chat');\n if (\n this.currentContact.uuid !==\n changedProperties.get('currentContact')?.uuid\n ) {\n this.reset();\n } else {\n setTimeout(() => this.checkForNewMessages(), 500);\n }\n this.fetchPreviousMessages();\n }\n }\n\n private reset() {\n if (this.chat) {\n this.chat.reset();\n }\n this.blockFetching = false;\n this.ticket = null;\n this.beforeUUID = null;\n this.afterUUID = null;\n this.refreshId = null;\n this.polling = false;\n this.pollingInterval = 2000;\n this.lastFetchTime = null;\n this.errorMessage = null;\n\n const compose = this.shadowRoot.querySelector('temba-compose') as Compose;\n if (compose) {\n compose.reset();\n }\n }\n\n private handleInterrupt() {\n this.fireCustomEvent(CustomEventType.Interrupt, {\n contact: this.currentContact\n });\n }\n\n private handleRetry() {\n const compose = this.shadowRoot.querySelector('temba-compose') as Compose;\n compose.triggerSend();\n }\n\n private handleSend(evt: CustomEvent) {\n this.errorMessage = null;\n const composeEle = evt.currentTarget as Compose;\n const compose = evt.detail.langValues['und'] as ComposeValue;\n\n const payload = {\n contact: this.currentContact.uuid\n };\n\n const text = compose.text;\n if (text && text.length > 0) {\n payload['text'] = text;\n }\n const attachments = compose.attachments;\n if (attachments && attachments.length > 0) {\n const attachment_uuids = attachments.map((attachment) => attachment.uuid);\n payload['attachments'] = attachment_uuids;\n }\n\n if (this.currentTicket) {\n payload['ticket'] = this.currentTicket.uuid;\n }\n\n const genericError = 'Send failed, please try again.';\n postJSON(`/contact/chat/${this.currentContact.uuid}/`, payload)\n .then((response) => {\n if (response.status < 400) {\n const event = response.json.event;\n event.created_on = new Date(event.created_on);\n this.chat.addMessages([event], null, true);\n // reset polling interval to 2 seconds after sending a message\n this.pollingInterval = 2000;\n this.checkForNewMessages();\n composeEle.reset();\n this.fireCustomEvent(CustomEventType.MessageSent, {\n msg: payload,\n response\n });\n } else {\n this.errorMessage = genericError;\n }\n })\n .catch(() => {\n this.errorMessage = genericError;\n });\n }\n\n private getEndpoint() {\n if (this.contact) {\n return `/contact/chat/${this.contact}/`;\n }\n return null;\n }\n\n private scheduleRefresh(hasNewEvents = false) {\n if (this.refreshId) {\n clearTimeout(this.refreshId);\n this.refreshId = null;\n }\n\n // reset to 2 seconds if we received new events\n if (hasNewEvents) {\n this.pollingInterval = 2000;\n } else {\n // increase interval by 1 second up to max of 15 seconds\n this.pollingInterval = Math.min(this.pollingInterval + 1000, 15000);\n }\n\n this.refreshId = setTimeout(() => {\n this.checkForNewMessages();\n }, this.pollingInterval);\n }\n\n public prerender(event: ContactEvent) {\n // use the unified renderEvent function with isSimulation = false\n const rendered = renderEvent(event, false);\n\n if (rendered) {\n event._rendered = {\n html: rendered,\n type: MessageType.Inline\n };\n }\n }\n\n private createMessages(page: ContactHistoryPage): ContactEvent[] {\n if (page.events) {\n const messages: ContactEvent[] = [];\n page.events.forEach((event) => {\n // track the UUID of the newest event for polling\n if (\n !this.afterUUID ||\n event.uuid.toLowerCase() > this.afterUUID.toLowerCase()\n ) {\n this.afterUUID = event.uuid;\n }\n\n // convert to dates\n event.created_on = new Date(event.created_on);\n\n if (\n event.type === 'msg_created' ||\n event.type === 'msg_received' ||\n event.type === 'ivr_created'\n ) {\n messages.push(event);\n } else {\n this.prerender(event);\n if (event._rendered) {\n messages.push(event);\n }\n }\n });\n\n // remove any messages we don't recognize\n return messages.filter((msg) => !!msg);\n }\n return [];\n }\n\n private checkForNewMessages() {\n // we are already working on it\n if (this.polling) {\n return;\n }\n\n const chat = this.chat;\n if (this.currentContact && this.afterUUID) {\n this.polling = true;\n this.lastFetchTime = Date.now();\n const endpoint = this.getEndpoint();\n if (!endpoint) {\n return;\n }\n\n const fetchContact = this.currentContact.uuid;\n\n fetchContactHistory(\n endpoint,\n this.currentTicket?.uuid,\n null,\n this.afterUUID\n ).then((page: ContactHistoryPage) => {\n const messages = this.createMessages(page);\n messages.reverse();\n if (fetchContact === this.currentContact.uuid) {\n const hasNewEvents = messages.length > 0;\n chat.addMessages(messages, null, true);\n this.polling = false;\n this.scheduleRefresh(hasNewEvents);\n } else {\n this.polling = false;\n }\n });\n }\n }\n\n private fetchPreviousMessages() {\n const chat = this.chat;\n const contactChat = this;\n if (!chat || chat.fetching || contactChat.blockFetching) {\n return;\n }\n\n chat.fetching = true;\n if (this.currentContact) {\n const endpoint = this.getEndpoint();\n if (!endpoint) {\n return;\n }\n\n // initialize anchor UUID if not set (first fetch)\n if (!this.beforeUUID && !this.afterUUID) {\n // generate a UUID v7 for current time as the anchor\n const anchorUUID = generateUUIDv7();\n this.beforeUUID = anchorUUID;\n this.afterUUID = anchorUUID;\n }\n\n fetchContactHistory(\n endpoint,\n this.currentTicket?.uuid,\n this.beforeUUID,\n null\n ).then((page: ContactHistoryPage) => {\n const messages = this.createMessages(page);\n messages.reverse();\n\n if (messages.length === 0) {\n contactChat.blockFetching = true;\n } else if (page.next) {\n // update beforeUUID for next fetch of older messages\n this.beforeUUID = page.next;\n } else {\n // no more history, mark end and show oldest event date\n contactChat.blockFetching = true;\n if (page.events && page.events.length > 0) {\n const oldestEvent = page.events[page.events.length - 1];\n chat.setEndOfHistory(new Date(oldestEvent.created_on));\n }\n }\n\n chat.addMessages(messages);\n this.scheduleRefresh();\n });\n }\n }\n\n private fetchComplete() {\n if (this.chat) {\n this.chat.fetching = false;\n }\n }\n\n private getTembaCompose(): TemplateResult {\n if (this.currentTicket) {\n if (this.currentContact && this.currentContact.status !== 'active') {\n //no chatbox for archived, blocked, or stopped contacts\n return null;\n } else {\n if (!this.currentTicket.closed_on) {\n // hide compose if agent can't reply to unassigned tickets\n if (\n this.disableReply &&\n (!this.currentTicket.assignee ||\n this.currentTicket.assignee.email !== this.agent)\n ) {\n return null;\n }\n //chatbox for active contacts with an open ticket\n return this.getCompose();\n } else {\n return null;\n }\n }\n }\n\n if (this.currentContact && this.currentContact.status !== 'active') {\n //no chatbox for archived, blocked, or stopped contacts\n return null;\n } else {\n //chatbox for active contacts\n return this.getCompose();\n }\n }\n\n private getCompose(): TemplateResult {\n return html`<div class=\"border\"></div>\n <div class=\"compose\">\n <temba-compose\n attachments\n counter\n autogrow\n shortcuts\n ?embeddedTabs=${!this.currentTicket}\n @temba-submitted=${this.handleSend.bind(this)}\n >\n </temba-compose>\n ${this.errorMessage\n ? html` <div class=\"error-gutter\">\n <div class=\"error-message\">${this.errorMessage}</div>\n <temba-button\n name=\"Retry\"\n @click=${this.handleRetry}\n ></temba-button>\n </div>`\n : null}\n </div>`;\n }\n\n private handleAssignmentChanged(evt: CustomEvent) {\n const users = evt.currentTarget as UserSelect;\n const assignee = users.values[0];\n\n this.assignTicket(assignee ? assignee.email : null);\n users.blur();\n }\n\n private handleTopicChanged(evt: CustomEvent) {\n const select = evt.target as Select<any>;\n const topic = select.values[0];\n\n if (this.currentTicket.topic.uuid !== topic.uuid) {\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [this.currentTicket.uuid],\n action: 'change_topic',\n topic: topic.uuid\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n }\n\n public assignTicket(email: string) {\n if (this.disableAssign) {\n return;\n }\n\n // if its already assigned to use, it's a noop\n if (\n (this.currentTicket.assignee &&\n this.currentTicket.assignee.email === email) ||\n (this.currentTicket.assignee === null && email === null)\n ) {\n return;\n }\n\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [this.currentTicket.uuid],\n action: 'assign',\n assignee: email\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n return true;\n }\n\n public refreshTicket() {\n if (this.currentTicket) {\n fetchResults(`/api/v2/tickets.json?uuid=${this.currentTicket.uuid}`).then(\n (values) => {\n if (values.length > 0) {\n this.fireCustomEvent(CustomEventType.TicketUpdated, {\n ticket: values[0],\n previous: this.currentTicket\n });\n this.currentTicket = values[0];\n }\n }\n );\n }\n }\n\n private handleReopen() {\n const uuid = this.currentTicket.uuid;\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [uuid],\n action: 'reopen'\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n\n private handleClose() {\n const uuid = this.currentTicket.uuid;\n postJSON(`/api/v2/ticket_actions.json`, {\n tickets: [uuid],\n action: 'close'\n })\n .then(() => {\n this.refreshTicket();\n })\n .catch((response: any) => {\n console.error(response);\n });\n }\n\n public render(): TemplateResult {\n const inFlow = this.currentContact && this.currentContact.flow;\n\n const inTicket = this.currentTicket;\n const ticketClosed = this.currentTicket && this.currentTicket.closed_on;\n\n return html`<div class=\"chat-wrapper\">\n ${this.currentContact\n ? html`<temba-chat\n @temba-scroll-threshold=${this.fetchPreviousMessages}\n @temba-fetch-complete=${this.fetchComplete}\n avatar=${this.avatar}\n agent\n avatars\n ?hasFooter=${inFlow}\n .showMessageLogsAfter=${this.showMessageLogsAfter}\n >\n ${inFlow\n ? html`\n <div slot=\"footer\" style=\"text-align:center;\">\n <div class=\"in-flow\">\n <div class=\"flow-name\">\n <temba-icon name=\"flow\" size=\"1.2\"></temba-icon>\n <div>\n Currently in\n <a\n href=\"/flow/editor/${this.currentContact.flow\n .uuid}/\"\n >${this.currentContact.flow.name}</a\n >\n </div>\n </div>\n ${this.showInterrupt\n ? html`<temba-button\n class=\"interrupt-button\"\n destructive\n small\n @click=${this.handleInterrupt}\n name=\"Interrupt\"\n >\n </temba-button>`\n : null}\n </div>\n </div>\n `\n : null}\n <div slot=\"footer\"></div>\n </temba-chat>\n ${inTicket\n ? html`<div class=\"in-ticket-wrapper\">\n <div class=\"in-ticket\">\n <temba-user-select\n placeholder=\"Assign to..\"\n searchable\n searchOnFocus\n clearable\n .values=${this.currentTicket.assignee\n ? [this.currentTicket.assignee]\n : []}\n @change=${this.handleAssignmentChanged}\n ?disabled=${ticketClosed || this.disableAssign}\n ></temba-user-select>\n\n <temba-select\n style=\"margin:0 0.5em; flex-grow:1\"\n endpoint=\"/api/v2/topics.json\"\n searchable\n valuekey=\"uuid\"\n .values=${[this.currentTicket.topic]}\n @change=${this.handleTopicChanged}\n ?disabled=${ticketClosed}\n ></temba-select>\n\n ${this.currentTicket.closed_on\n ? html`\n <temba-button\n name=\"Reopen\"\n @click=${this.handleReopen}\n ></temba-button>\n `\n : html`\n <temba-button\n name=\"Close\"\n destructive\n @click=${this.handleClose}\n ></temba-button>\n `}\n </div>\n </div> `\n : null}\n ${this.getTembaCompose()}`\n : null}\n </div>`;\n }\n}\nexport const closeTicket = (uuid: string): Promise<WebResponse> => {\n const formData = new FormData();\n formData.append('status', 'C');\n return postUrl(`/ticket/update/${uuid}/?_format=json`, formData);\n};\nexport const fetchContact = (endpoint: string): Promise<Contact> => {\n return new Promise<Contact>((resolve, reject) => {\n fetchResults(endpoint).then((contacts: Contact[]) => {\n if (contacts && contacts.length === 1) {\n resolve(contacts[0]);\n } else {\n reject('No contact found');\n }\n });\n });\n};\nexport const fetchContactHistory = (\n endpoint: string,\n ticket: string = undefined,\n before: string = undefined,\n after: string = undefined\n): Promise<ContactHistoryPage> => {\n return new Promise<ContactHistoryPage>((resolve) => {\n const controller = new AbortController();\n pendingRequests.push(controller);\n\n let url = endpoint;\n const params = [];\n\n if (before) {\n params.push(`before=${before}`);\n }\n\n if (after) {\n params.push(`after=${after}`);\n }\n\n if (ticket) {\n params.push(`ticket=${ticket}`);\n }\n\n if (params.length > 0) {\n url += (url.includes('?') ? '&' : '?') + params.join('&');\n }\n\n getUrl(url, controller)\n .then((response: WebResponse) => {\n // on success, remove our abort controller\n pendingRequests = pendingRequests.filter(\n (controller: AbortController) => {\n return response.controller === controller;\n }\n );\n\n resolve(response.json as ContactHistoryPage);\n })\n .catch(() => {\n // canceled\n });\n });\n};\nexport const getDisplayName = (user: User) => {\n if (!user) {\n return 'Somebody';\n }\n\n if ((user as NamedUser).name) {\n return (user as NamedUser).name;\n }\n\n if (user.first_name && user.last_name) {\n return `${user.first_name} ${user.last_name}`;\n }\n\n if (user.first_name) {\n return user.first_name;\n }\n\n return user.email;\n};\nexport let pendingRequests: AbortController[] = [];\n"]}
@@ -3,10 +3,10 @@
3
3
  /* eslint-disable no-irregular-whitespace */
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
- 'scf1453991c986b25': `Tab para completar, enter para seleccionar`,
7
- 's73b4d70c02f4b4e0': `No options`,
8
- 's8f02e3a18ffc083a': `Are not currently in a flow`,
9
- 's638236250662c6b3': `Have sent a message in the last`,
10
- 's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
6
+ scf1453991c986b25: `Tab para completar, enter para seleccionar`,
7
+ s73b4d70c02f4b4e0: `No options`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s638236250662c6b3: `Have sent a message in the last`,
10
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
11
11
  };
12
12
  //# sourceMappingURL=es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,4CAA4C;IACvE,mBAAmB,EAAE,YAAY;IACjC,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'scf1453991c986b25': `Tab para completar, enter para seleccionar`,\n's73b4d70c02f4b4e0': `No options`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
1
+ {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,YAAY;IAC/B,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n s73b4d70c02f4b4e0: `No options`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -3,10 +3,10 @@
3
3
  /* eslint-disable no-irregular-whitespace */
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
- 's73b4d70c02f4b4e0': `No options`,
7
- 'scf1453991c986b25': `Tab to complete, enter to select`,
8
- 's8f02e3a18ffc083a': `Are not currently in a flow`,
9
- 's638236250662c6b3': `Have sent a message in the last`,
10
- 's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
6
+ s73b4d70c02f4b4e0: `No options`,
7
+ scf1453991c986b25: `Tab to complete, enter to select`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s638236250662c6b3: `Have sent a message in the last`,
10
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
11
11
  };
12
12
  //# sourceMappingURL=fr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,YAAY;IACvC,mBAAmB,EAAE,kCAAkC;IACvD,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's73b4d70c02f4b4e0': `No options`,\n'scf1453991c986b25': `Tab to complete, enter to select`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
1
+ {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,YAAY;IAC/B,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n s73b4d70c02f4b4e0: `No options`,\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -8,18 +8,9 @@ export const sourceLocale = `en`;
8
8
  * The other locale codes that this application is localized into. Sorted
9
9
  * lexicographically.
10
10
  */
11
- export const targetLocales = [
12
- `es`,
13
- `fr`,
14
- `pt`,
15
- ];
11
+ export const targetLocales = [`es`, `fr`, `pt`];
16
12
  /**
17
13
  * All valid project locale codes. Sorted lexicographically.
18
14
  */
19
- export const allLocales = [
20
- `en`,
21
- `es`,
22
- `fr`,
23
- `pt`,
24
- ];
15
+ export const allLocales = [`en`, `es`, `fr`, `pt`];
25
16
  //# sourceMappingURL=locale-codes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale-codes.js","sourceRoot":"","sources":["../../../src/locales/locale-codes.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize.\n\n/**\n * The locale code that templates in this source code are written in.\n */\nexport const sourceLocale = `en`;\n\n/**\n * The other locale codes that this application is localized into. Sorted\n * lexicographically.\n */\nexport const targetLocales = [\n `es`,\n `fr`,\n `pt`,\n] as const;\n\n/**\n * All valid project locale codes. Sorted lexicographically.\n */\nexport const allLocales = [\n `en`,\n `es`,\n `fr`,\n `pt`,\n] as const;\n"]}
1
+ {"version":3,"file":"locale-codes.js","sourceRoot":"","sources":["../../../src/locales/locale-codes.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize.\n\n/**\n * The locale code that templates in this source code are written in.\n */\nexport const sourceLocale = `en`;\n\n/**\n * The other locale codes that this application is localized into. Sorted\n * lexicographically.\n */\nexport const targetLocales = [`es`, `fr`, `pt`] as const;\n\n/**\n * All valid project locale codes. Sorted lexicographically.\n */\nexport const allLocales = [`en`, `es`, `fr`, `pt`] as const;\n"]}
@@ -3,10 +3,10 @@
3
3
  /* eslint-disable no-irregular-whitespace */
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
- 's73b4d70c02f4b4e0': `No options`,
7
- 'scf1453991c986b25': `Tab to complete, enter to select`,
8
- 's8f02e3a18ffc083a': `Are not currently in a flow`,
9
- 's638236250662c6b3': `Have sent a message in the last`,
10
- 's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
6
+ s73b4d70c02f4b4e0: `No options`,
7
+ scf1453991c986b25: `Tab to complete, enter to select`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s638236250662c6b3: `Have sent a message in the last`,
10
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
11
11
  };
12
12
  //# sourceMappingURL=pt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,YAAY;IACvC,mBAAmB,EAAE,kCAAkC;IACvD,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's73b4d70c02f4b4e0': `No options`,\n'scf1453991c986b25': `Tab to complete, enter to select`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
1
+ {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,YAAY;IAC/B,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n s73b4d70c02f4b4e0: `No options`,\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -1659,6 +1659,7 @@ export class Simulator extends RapidElement {
1659
1659
  icon="simulator"
1660
1660
  label="Phone Simulator"
1661
1661
  color="#10b981"
1662
+ order="3"
1662
1663
  .hidden=${this.isVisible}
1663
1664
  @temba-button-clicked=${this.handleShow}
1664
1665
  ></temba-floating-tab>