@nyaruka/temba-components 0.159.1 → 0.159.2

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.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.159.2](https://github.com/nyaruka/temba-components/compare/v0.159.1...v0.159.2)
8
+
9
+ - Rename ContactEvents to ContactTimeline and make campaign pills clickable [`#1022`](https://github.com/nyaruka/temba-components/pull/1022)
10
+
7
11
  #### [v0.159.1](https://github.com/nyaruka/temba-components/compare/v0.159.0...v0.159.1)
8
12
 
13
+ > 28 May 2026
14
+
9
15
  - Handle airtime_created events in contact chat [`#1020`](https://github.com/nyaruka/temba-components/pull/1020)
10
16
  - Stabilize ContentList icon column width across parallel test runs [`#1021`](https://github.com/nyaruka/temba-components/pull/1021)
11
17
 
@@ -6697,16 +6697,49 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
6697
6697
  ></temba-icon>
6698
6698
  </div>
6699
6699
  </div>
6700
- `}return null}}e([gt({type:Boolean})],su.prototype,"hasMore",void 0),e([gt({type:Boolean})],su.prototype,"expanded",void 0);const ru=["#1a86d0","#e8843f","#ec407a","#2bb2a6","#0a5290","#a25320","#a02153","#176a61"];class au extends ih{constructor(){super(...arguments),this.lang_now="Now",this.lang_show_older="Show older events",this.lang_show_more="Show more upcoming events",this.lang_more="Show more",this.lang_campaigns_label="Campaigns",this.lang_empty="No events for this contact yet.",this.lang_projected_info="This is a projected timeline based on current schedules. Past entries may not reflect what actually happened, and upcoming entries are limited to the next year.",this.olderEvents=[],this.newerEvents=[],this.nextBefore=null,this.nextAfter=null,this.loadingMore=!1,this.loadingMoreFuture=!1,this.campaignColors={}}static get styles(){return l`
6700
+ `}return null}}e([gt({type:Boolean})],su.prototype,"hasMore",void 0),e([gt({type:Boolean})],su.prototype,"expanded",void 0);const ru=["#1a86d0","#e8843f","#ec407a","#2bb2a6","#0a5290","#a25320","#a02153","#176a61"];class au extends ih{constructor(){super(...arguments),this.lang_now="Now",this.lang_show_older="Show older events",this.lang_show_more="Show more upcoming events",this.lang_more="Show more",this.lang_campaigns_label="Campaigns",this.lang_empty="No upcoming events",this.lang_empty_help="Events appear here when a contact joins a campaign. Scheduled flows and messages will also show up here.",this.lang_campaigns_link="View campaigns",this.lang_projected_info="This is a projected timeline based on current schedules. Past entries may not reflect what actually happened, and upcoming entries are limited to the next year.",this.olderEvents=[],this.newerEvents=[],this.nextBefore=null,this.nextAfter=null,this.loadingMore=!1,this.loadingMoreFuture=!1,this.campaignColors={}}static get styles(){return l`
6701
6701
  :host {
6702
6702
  display: block;
6703
6703
  }
6704
6704
 
6705
+ /* empty state follows the list design system: centered icon, a short
6706
+ title, muted explanatory copy, and a single call-to-action link */
6705
6707
  .empty {
6706
- padding: 4em 1em;
6708
+ display: flex;
6709
+ flex-direction: column;
6710
+ align-items: center;
6707
6711
  text-align: center;
6712
+ padding: 7em 1em 4em;
6708
6713
  color: var(--text-color);
6709
- opacity: 0.55;
6714
+ }
6715
+
6716
+ .empty temba-icon {
6717
+ margin-bottom: 0.75em;
6718
+ --icon-color: var(--text-3, #7b8593);
6719
+ }
6720
+
6721
+ .empty-title {
6722
+ font-weight: 600;
6723
+ margin-bottom: 0.4em;
6724
+ }
6725
+
6726
+ .empty-help {
6727
+ font-size: 0.875em;
6728
+ line-height: 1.5;
6729
+ max-width: 22em;
6730
+ margin-bottom: 1em;
6731
+ color: var(--text-3, #7b8593);
6732
+ }
6733
+
6734
+ .empty-link {
6735
+ font-size: 0.875em;
6736
+ font-weight: 500;
6737
+ color: var(--color-link-primary);
6738
+ text-decoration: none;
6739
+ }
6740
+
6741
+ .empty-link:hover {
6742
+ text-decoration: underline;
6710
6743
  }
6711
6744
 
6712
6745
  /* row of campaign pills the contact is currently a member of */
@@ -6729,7 +6762,8 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
6729
6762
  }
6730
6763
 
6731
6764
  /* each pill is colored with its campaign's hue - background, border
6732
- and text all derived from --pill-hue. read-only badges, not links */
6765
+ and text all derived from --pill-hue. clickable links to the
6766
+ campaign's read page */
6733
6767
  .campaign-pill {
6734
6768
  display: inline-flex;
6735
6769
  align-items: center;
@@ -6747,6 +6781,21 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
6747
6781
  border: 1px solid
6748
6782
  color-mix(in srgb, var(--pill-hue) 25%, var(--color-widget-bg, #fff));
6749
6783
  color: var(--pill-hue);
6784
+ cursor: pointer;
6785
+ transition: background 100ms ease-in-out;
6786
+ }
6787
+
6788
+ .campaign-pill:hover {
6789
+ background: color-mix(
6790
+ in srgb,
6791
+ var(--pill-hue) 22%,
6792
+ var(--color-widget-bg, #fff)
6793
+ );
6794
+ }
6795
+
6796
+ .campaign-pill:focus-visible {
6797
+ outline: 2px solid var(--pill-hue);
6798
+ outline-offset: 1px;
6750
6799
  }
6751
6800
 
6752
6801
  /* status-badge dot leading each campaign pill, in the same hue */
@@ -7008,7 +7057,7 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
7008
7057
  -webkit-box-orient: vertical;
7009
7058
  overflow: hidden;
7010
7059
  }
7011
- `}async loadEvents(){if(!this.contact)return void(this.data=null);const t=this.contact;try{const e=await this.store.getUrl(`/contact/events/${encodeURIComponent(this.contact)}/`,{force:!0});if(this.contact!==t)return;this.data=e.json}catch(t){}}refresh(){this.loadEvents()}updated(t){var e,i;if(super.updated(t),t.has("contact")&&(this.campaignColors={},this.data=null,this.loadingMore=!1,this.loadingMoreFuture=!1,this.loadEvents()),t.has("data")&&(this.olderEvents=[],this.newerEvents=[],this.nextBefore=this.data&&null!==(e=this.data.next_before)&&void 0!==e?e:null,this.nextAfter=this.data&&null!==(i=this.data.next_after)&&void 0!==i?i:null,this.data&&this.assignCampaignColors([...this.data.past||[],...this.data.future||[]]),null!==this.data&&void 0!==this.data)){const t="number"==typeof this.data.future_count?this.data.future_count:Array.isArray(this.data.future)?this.data.future.length:0;this.fireCustomEvent(Uo.DetailsChanged,{count:t})}}assignCampaignColors(t){for(const e of t){if(e.type!==Fo.CampaignEvent||!e.campaign)continue;const t=e.campaign.uuid;if(!this.campaignColors[t]){const e=Object.keys(this.campaignColors).length;this.campaignColors[t]=ru[e%ru.length]}}}getCampaignColor(t){return this.campaignColors[t]||ru[0]}getColor(t){return t.type===Fo.ScheduledTrigger?"#16a34a":t.type===Fo.CampaignEvent&&t.campaign?this.getCampaignColor(t.campaign.uuid):"#8e5ea7"}getDotIcon(t){return t.type===Fo.ScheduledTrigger?zo.trigger:t.type!==Fo.CampaignEvent?zo.broadcast:null}handleEventClicked(t){this.fireCustomEvent(Uo.Selection,t)}handlePillClicked(t,e){t.stopPropagation(),this.fireCustomEvent(Uo.Selection,e)}handleActivationKey(t,e){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}async handleShowOlder(){var t;if(this.loadingMore||!this.nextBefore)return;this.loadingMore=!0;const e=this.contact,i=`/contact/events/${encodeURIComponent(this.contact)}/?before=${encodeURIComponent(this.nextBefore)}`;try{const o=await this.store.getUrl(i,{force:!0});if(this.contact!==e)return;const n=o.json,s=n.past||[];this.assignCampaignColors(s),this.olderEvents=[...this.olderEvents,...s],this.nextBefore=null!==(t=n.next_before)&&void 0!==t?t:null}catch(t){if(this.contact!==e)return;this.nextBefore=null}finally{this.contact===e&&(this.loadingMore=!1)}}async handleShowMore(){var t;if(this.loadingMoreFuture||!this.nextAfter)return;this.loadingMoreFuture=!0;const e=this.contact,i=`/contact/events/${encodeURIComponent(this.contact)}/?after=${encodeURIComponent(this.nextAfter)}`;try{const o=await this.store.getUrl(i,{force:!0});if(this.contact!==e)return;const n=o.json,s=n.future||[];this.assignCampaignColors(s),this.newerEvents=[...this.newerEvents,...s],this.nextAfter=null!==(t=n.next_after)&&void 0!==t?t:null}catch(t){if(this.contact!==e)return;this.nextAfter=null}finally{this.contact===e&&(this.loadingMoreFuture=!1)}}renderTime(t){var e;return V`
7060
+ `}async loadEvents(){if(!this.contact)return void(this.data=null);const t=this.contact;try{const e=await this.store.getUrl(`/contact/timeline/${encodeURIComponent(this.contact)}/`,{force:!0});if(this.contact!==t)return;this.data=e.json}catch(t){}}refresh(){this.loadEvents()}updated(t){var e,i;if(super.updated(t),t.has("contact")&&(this.campaignColors={},this.data=null,this.loadingMore=!1,this.loadingMoreFuture=!1,this.loadEvents()),t.has("data")&&(this.olderEvents=[],this.newerEvents=[],this.nextBefore=this.data&&null!==(e=this.data.next_before)&&void 0!==e?e:null,this.nextAfter=this.data&&null!==(i=this.data.next_after)&&void 0!==i?i:null,this.data&&this.assignCampaignColors([...this.data.past||[],...this.data.future||[]]),null!==this.data&&void 0!==this.data)){const t="number"==typeof this.data.future_count?this.data.future_count:Array.isArray(this.data.future)?this.data.future.length:0;this.fireCustomEvent(Uo.DetailsChanged,{count:t})}}assignCampaignColors(t){for(const e of t){if(e.type!==Fo.CampaignEvent||!e.campaign)continue;const t=e.campaign.uuid;if(!this.campaignColors[t]){const e=Object.keys(this.campaignColors).length;this.campaignColors[t]=ru[e%ru.length]}}}getCampaignColor(t){return this.campaignColors[t]||ru[0]}getColor(t){return t.type===Fo.ScheduledTrigger?"#16a34a":t.type===Fo.CampaignEvent&&t.campaign?this.getCampaignColor(t.campaign.uuid):"#8e5ea7"}getDotIcon(t){return t.type===Fo.ScheduledTrigger?zo.trigger:t.type!==Fo.CampaignEvent?zo.broadcast:null}handleEventClicked(t){this.fireCustomEvent(Uo.Selection,t)}handlePillClicked(t,e){t.stopPropagation(),this.fireCustomEvent(Uo.Selection,e)}handleActivationKey(t,e){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}async handleShowOlder(){var t;if(this.loadingMore||!this.nextBefore)return;this.loadingMore=!0;const e=this.contact,i=`/contact/timeline/${encodeURIComponent(this.contact)}/?before=${encodeURIComponent(this.nextBefore)}`;try{const o=await this.store.getUrl(i,{force:!0});if(this.contact!==e)return;const n=o.json,s=n.past||[];this.assignCampaignColors(s),this.olderEvents=[...this.olderEvents,...s],this.nextBefore=null!==(t=n.next_before)&&void 0!==t?t:null}catch(t){if(this.contact!==e)return;this.nextBefore=null}finally{this.contact===e&&(this.loadingMore=!1)}}async handleShowMore(){var t;if(this.loadingMoreFuture||!this.nextAfter)return;this.loadingMoreFuture=!0;const e=this.contact,i=`/contact/timeline/${encodeURIComponent(this.contact)}/?after=${encodeURIComponent(this.nextAfter)}`;try{const o=await this.store.getUrl(i,{force:!0});if(this.contact!==e)return;const n=o.json,s=n.future||[];this.assignCampaignColors(s),this.newerEvents=[...this.newerEvents,...s],this.nextAfter=null!==(t=n.next_after)&&void 0!==t?t:null}catch(t){if(this.contact!==e)return;this.nextAfter=null}finally{this.contact===e&&(this.loadingMoreFuture=!1)}}renderTime(t){var e;return V`
7012
7061
  <temba-tip text=${this.store.formatDate(t.scheduled)} position="top">
7013
7062
  ${this.store.getShortDurationFromIso(t.scheduled,null===(e=this.data)||void 0===e?void 0:e.now)}
7014
7063
  </temba-tip>
@@ -7043,12 +7092,23 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
7043
7092
  ${t.map(t=>V`<div
7044
7093
  class="campaign-pill"
7045
7094
  style="--pill-hue:${this.getCampaignColor(t.uuid)}"
7095
+ role="button"
7096
+ tabindex="0"
7097
+ @click=${e=>this.handlePillClicked(e,t)}
7098
+ @keydown=${e=>this.handleActivationKey(e,()=>this.handlePillClicked(e,t))}
7046
7099
  >
7047
7100
  <span class="campaign-dot"></span>${t.name}
7048
7101
  </div>`)}
7049
7102
  </div>
7050
7103
  `}render(){if(!this.data)return V``;const t=Array.isArray(this.data.campaigns)?this.data.campaigns:[],e=[...Array.isArray(this.data.future)?this.data.future:[],...this.newerEvents],i=[...Array.isArray(this.data.past)?this.data.past:[],...this.olderEvents];if(0===t.length&&0===e.length&&0===i.length)return V`<div class="empty">
7051
- <slot name="empty">${this.lang_empty}</slot>
7104
+ <slot name="empty">
7105
+ <temba-icon name=${zo.schedule} size="2"></temba-icon>
7106
+ <div class="empty-title">${this.lang_empty}</div>
7107
+ <div class="empty-help">${this.lang_empty_help}</div>
7108
+ <a class="empty-link" href="/campaign/" onclick="goto(event)"
7109
+ >${this.lang_campaigns_link}</a
7110
+ >
7111
+ </slot>
7052
7112
  </div>`;const o=[];return this.nextBefore&&o.push({kind:"more-past"}),[...i].reverse().forEach(t=>o.push({kind:"event",event:t,past:!0})),o.push({kind:"now"}),e.forEach(t=>o.push({kind:"event",event:t,past:!1})),this.nextAfter&&o.push({kind:"more-future"}),V`
7053
7113
  ${this.renderCampaigns(t)}
7054
7114
  <div class="timeline">
@@ -7126,7 +7186,7 @@ const{I:nh}=at,sh=t=>t,rh=()=>document.createComment(""),ah=(t,e,i)=>{const o=t.
7126
7186
  </div>`,this.renderEvent(t.event),i,n)})}
7127
7187
  </div>
7128
7188
  ${e.length>0?V`<div class="projection-note">${this.lang_projected_info}</div>`:null}
7129
- `}}e([gt({type:String})],au.prototype,"contact",void 0),e([gt({type:Object,attribute:!1})],au.prototype,"data",void 0),e([gt({type:String})],au.prototype,"lang_now",void 0),e([gt({type:String})],au.prototype,"lang_show_older",void 0),e([gt({type:String})],au.prototype,"lang_show_more",void 0),e([gt({type:String})],au.prototype,"lang_more",void 0),e([gt({type:String})],au.prototype,"lang_campaigns_label",void 0),e([gt({type:String})],au.prototype,"lang_empty",void 0),e([gt({type:String})],au.prototype,"lang_projected_info",void 0),e([ft()],au.prototype,"olderEvents",void 0),e([ft()],au.prototype,"newerEvents",void 0),e([ft()],au.prototype,"nextBefore",void 0),e([ft()],au.prototype,"nextAfter",void 0),e([ft()],au.prototype,"loadingMore",void 0),e([ft()],au.prototype,"loadingMoreFuture",void 0);class lu extends Mo{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return l`
7189
+ `}}e([gt({type:String})],au.prototype,"contact",void 0),e([gt({type:Object,attribute:!1})],au.prototype,"data",void 0),e([gt({type:String})],au.prototype,"lang_now",void 0),e([gt({type:String})],au.prototype,"lang_show_older",void 0),e([gt({type:String})],au.prototype,"lang_show_more",void 0),e([gt({type:String})],au.prototype,"lang_more",void 0),e([gt({type:String})],au.prototype,"lang_campaigns_label",void 0),e([gt({type:String})],au.prototype,"lang_empty",void 0),e([gt({type:String})],au.prototype,"lang_empty_help",void 0),e([gt({type:String})],au.prototype,"lang_campaigns_link",void 0),e([gt({type:String})],au.prototype,"lang_projected_info",void 0),e([ft()],au.prototype,"olderEvents",void 0),e([ft()],au.prototype,"newerEvents",void 0),e([ft()],au.prototype,"nextBefore",void 0),e([ft()],au.prototype,"nextAfter",void 0),e([ft()],au.prototype,"loadingMore",void 0),e([ft()],au.prototype,"loadingMoreFuture",void 0);class lu extends Mo{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return l`
7130
7190
  :host {
7131
7191
  display: block;
7132
7192
  }
@@ -10773,7 +10833,7 @@ background: #ccc;
10773
10833
  ${this.renderUploader()}
10774
10834
  </div>
10775
10835
  </div>
10776
- </div>`}}e([gt({type:String,attribute:!1})],Hu.prototype,"endpoint",void 0),e([gt({type:Boolean})],Hu.prototype,"pendingDrop",void 0),e([gt({type:Boolean})],Hu.prototype,"ignoreDrops",void 0),e([gt({type:String})],Hu.prototype,"icon",void 0),e([gt({type:String})],Hu.prototype,"accept",void 0),e([gt({type:Number})],Hu.prototype,"max",void 0),e([gt({type:Array})],Hu.prototype,"attachments",void 0),e([gt({type:Boolean,attribute:!1})],Hu.prototype,"uploading",void 0);let Wu="dev";try{Wu="0.159.1"}catch(t){}const Vu=Wu,Zu=[{type:"has_any_word",name:"has any of the words",operands:1},{type:"has_all_words",name:"has all of the words",operands:1},{type:"has_phrase",name:"has the phrase",operands:1},{type:"has_only_phrase",name:"has only the phrase",operands:1},{type:"has_beginning",name:"starts with",operands:1},{type:"has_text",name:"has some text",operands:0,categoryName:"Has Text"},{type:"has_number",name:"has a number",operands:0,categoryName:"Has Number"},{type:"has_number_between",name:"has a number between",operands:2},{type:"has_number_lt",name:"has a number below",operands:1},{type:"has_number_lte",name:"has a number at or below",operands:1},{type:"has_number_eq",name:"has a number equal to",operands:1},{type:"has_number_gte",name:"has a number at or above",operands:1},{type:"has_number_gt",name:"has a number above",operands:1},{type:"has_date",name:"has a date",operands:0,categoryName:"Has Date"},{type:"has_date_lt",name:"has a date before",operands:1},{type:"has_date_eq",name:"has a date equal to",operands:1},{type:"has_date_gt",name:"has a date after",operands:1},{type:"has_time",name:"has a time",operands:0,categoryName:"Has Time"},{type:"has_phone",name:"has a phone number",operands:0,categoryName:"Has Phone"},{type:"has_email",name:"has an email",operands:0,categoryName:"Has Email"},{type:"has_state",name:"has state",operands:0,categoryName:"Has State",filter:"locations"},{type:"has_district",name:"has district",operands:1,categoryName:"Has District",filter:"locations"},{type:"has_ward",name:"has ward",operands:2,categoryName:"Has Ward",filter:"locations"},{type:"has_group",name:"is in the group",operands:1,visibility:"hidden"},{type:"has_category",name:"has the category",operands:0,visibility:"hidden"},{type:"has_error",name:"has an error",operands:0,categoryName:"Has Error",visibility:"hidden"},{type:"has_value",name:"is not empty",operands:0,categoryName:"Not Empty",visibility:"hidden"},{type:"has_pattern",name:"matches regex",operands:1}],Yu=t=>Zu.filter(e=>"hidden"!==e.visibility&&(!e.filter||!!t&&t.includes(e.filter))),Ku=new Set(["has_beginning","has_number","has_number_between","has_number_lt","has_number_lte","has_number_eq","has_number_gte","has_number_gt","has_pattern"]),Gu=t=>Zu.find(e=>e.type===t),Xu=t=>t.map(t=>({value:t.type,name:t.name})),Qu={type:"text",required:!1,maxLength:64,placeholder:"(optional)",helpText:"The name to use to reference this result in the flow"},Ju={type:"checkbox",label:"Require rules to be localized",helpText:"Each language must specify its own rules for this node"},tp={type:"checkbox",label:"Require categories to be localized",helpText:t=>{var e;const i=null===(e=t.result_name)||void 0===e?void 0:e.trim();if(i){return`Only enable if you plan to use @results.${i.toLowerCase().replace(/\s+/g,"_")}.category_localized`}return"Only enable if you plan to use category_localized in your expressions for this result"},conditions:{visible:t=>!!t.result_name}},ep={label:"Save Result",localizable:!1,items:["result_name"],collapsed:t=>!(t._isNew&&t.result_name),getValueCount:t=>!!t.result_name},ip={type:"accordion",multi:!0,sections:[ep,{label:"Localization",localizable:!1,items:["localizeRules","localizeCategories"],collapsed:!0,getValueCount:t=>!(!t.localizeRules&&!t.localizeCategories)}]},op={type:"accordion",multi:!0,sections:[ep]},np={type:"accordion",multi:!0,sections:[ep,{label:"Localization",localizable:!1,items:["localizeCategories"],collapsed:!0,getValueCount:t=>!!t.localizeCategories}]};function sp(t,e){var i,o;const n=(null===(i=t.router)||void 0===i?void 0:i.categories)||[],s={};n.forEach(t=>{const i=t.uuid,o=e[i];s[i]={originalName:t.name,localizedName:o&&o.name?Array.isArray(o.name)?o.name[0]||"":o.name:""}});const r=(null===(o=t.router)||void 0===o?void 0:o.cases)||[],a={};return r.forEach(t=>{var i,o;if(!(null===(i=t.arguments)||void 0===i?void 0:i.length)||!t.arguments.some(t=>t))return;const n=e[t.uuid],s=(null===(o=Gu(t.type))||void 0===o?void 0:o.name)||t.type;a[t.uuid]={operatorName:s,originalArguments:[...t.arguments],localizedArguments:(null==n?void 0:n.arguments)?[...n.arguments]:t.arguments.map(()=>"")}}),{categories:s,rules:a}}function rp(t,e){const i={};return t.categories&&Object.keys(t.categories).forEach(e=>{var o,n;const s=t.categories[e],r=(null===(o=s.localizedName)||void 0===o?void 0:o.trim())||"",a=(null===(n=s.originalName)||void 0===n?void 0:n.trim())||"";r&&r!==a&&(i[e]={name:[r]})}),t.rules&&Object.keys(t.rules).forEach(e=>{const o=t.rules[e],n=o.localizedArguments||[],s=o.originalArguments||[],r=n.some((t,e)=>(null==t?void 0:t.trim())&&t.trim()!==(s[e]||""));r&&(i[e]={arguments:n.map(t=>(null==t?void 0:t.trim())||"")})}),i}function ap(t,e,i,o=[]){const n=[],s=[],r=[];return t.forEach(t=>{const a=re(e,t.name),l=a?i.find(t=>t.uuid===a.exit_uuid):null,d=(null==l?void 0:l.uuid)||Gt(),c=(null==a?void 0:a.uuid)||Gt();if(n.push({uuid:c,name:t.name,exit_uuid:d}),s.push({uuid:d,destination_uuid:(null==l?void 0:l.destination_uuid)||null}),t.case){const e=t.case.arguments[0],i=o.find(t=>{var i;return(null===(i=t.arguments)||void 0===i?void 0:i[0])===e});r.push({uuid:(null==i?void 0:i.uuid)||Gt(),type:t.case.type,arguments:t.case.arguments,category_uuid:c})}}),{categories:n,exits:s,cases:r}}function lp(t,e,i,o,n){const s=n.some(t=>se(t,"Other"))?null:re(i,"Other"),r=s?o.find(t=>t.uuid===s.exit_uuid):null,a=(null==r?void 0:r.uuid)||Gt(),l=(null==s?void 0:s.uuid)||Gt();return t.push({uuid:l,name:"Other",exit_uuid:a}),e.push({uuid:a,destination_uuid:(null==r?void 0:r.destination_uuid)||null}),l}function dp(t){return e=>{const i={};return t(e,i),{valid:0===Object.keys(i).length,errors:i}}}function cp(t){return t.toLocalizationFormData?t.toLocalizationFormData:"categories"===t.localizable?sp:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={uuid:t.uuid};return e.forEach(t=>{const e=i[t];o[t]=Array.isArray(e)&&e[0]||""}),o}):void 0;var e}function hp(t){return t.fromLocalizationFormData?t.fromLocalizationFormData:"categories"===t.localizable?rp:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={};return e.forEach(e=>{const n=t[e];n&&""!==n.trim()&&n!==i[e]&&(o[e]=[n])}),o}):void 0;var e}const up="undefined"!=typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function pp(t){return 0!==t.button||!(!up||!t.ctrlKey)}function mp(t){if(t.dependency){const e=t.dependency.name||t.dependency.key;return`Cannot find a ${t.dependency.type} for ${e}`}return t.description}function gp(t){const e=20*Math.round(t/20);return Math.max(e,0)}const fp="font-family:SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;font-size:0.95em",vp={[nc.ExpressionPrefix]:`color:${Cc.expression};font-weight:600;${fp}`,[nc.Identifier]:`color:${Cc.expression};${fp}`,[nc.FunctionName]:`color:${Cc.fn};font-weight:900;${fp}`,[nc.StringLiteral]:`color:${Cc.string};${fp}`,[nc.NumberLiteral]:`color:${Cc.number};${fp}`,[nc.Keyword]:`color:${Cc.keyword};${fp}`,[nc.Operator]:`color:${Cc.operator};${fp}`,[nc.ContextRef]:`color:${Cc.expression};${fp}`,[nc.Separator]:`color:${Cc.operator};${fp}`,[nc.Arrow]:`color:${Cc.operator};${fp}`,[nc.Bracket]:`color:${Cc.operator};${fp}`,[nc.Paren]:`color:${Cc.paren};${fp}`,[nc.Whitespace]:fp},bp=[[/claude|anthropic/i,"anthropic"],[/gpt|openai|o1|o3|o4/i,"openai"],[/gemini|google/i,"gemini"],[/azure|microsoft/i,"azure"],[/deepseek/i,"deepseek"]],yp=(t,e=!1)=>{const i=cc(t||"",e?Gd:Kd),o=[];for(const t of i){const e=!!vp[t.type],i=o[o.length-1];i&&i.isExpr===e?i.tokens.push(t):o.push({isExpr:e,tokens:[t]})}const n=t=>{const e=vp[t.type];if(!e){const e=t.text.split("\n");return V`${e.map((t,e)=>V`${e>0?V`<br />`:null}${t}`)}`}const i=t.text.split("\n");return V`${i.map((t,i)=>V`${i>0?V`<br />`:null}${t?V`<span style="${e}">${t}</span>`:null}`)}`};return V`${o.map(t=>{const e=V`${t.tokens.map(n)}`;return t.isExpr?V`<span style="hyphens:none">${e}</span>`:e})}`},xp=(t,e,i=3)=>V`<div
10836
+ </div>`}}e([gt({type:String,attribute:!1})],Hu.prototype,"endpoint",void 0),e([gt({type:Boolean})],Hu.prototype,"pendingDrop",void 0),e([gt({type:Boolean})],Hu.prototype,"ignoreDrops",void 0),e([gt({type:String})],Hu.prototype,"icon",void 0),e([gt({type:String})],Hu.prototype,"accept",void 0),e([gt({type:Number})],Hu.prototype,"max",void 0),e([gt({type:Array})],Hu.prototype,"attachments",void 0),e([gt({type:Boolean,attribute:!1})],Hu.prototype,"uploading",void 0);let Wu="dev";try{Wu="0.159.2"}catch(t){}const Vu=Wu,Zu=[{type:"has_any_word",name:"has any of the words",operands:1},{type:"has_all_words",name:"has all of the words",operands:1},{type:"has_phrase",name:"has the phrase",operands:1},{type:"has_only_phrase",name:"has only the phrase",operands:1},{type:"has_beginning",name:"starts with",operands:1},{type:"has_text",name:"has some text",operands:0,categoryName:"Has Text"},{type:"has_number",name:"has a number",operands:0,categoryName:"Has Number"},{type:"has_number_between",name:"has a number between",operands:2},{type:"has_number_lt",name:"has a number below",operands:1},{type:"has_number_lte",name:"has a number at or below",operands:1},{type:"has_number_eq",name:"has a number equal to",operands:1},{type:"has_number_gte",name:"has a number at or above",operands:1},{type:"has_number_gt",name:"has a number above",operands:1},{type:"has_date",name:"has a date",operands:0,categoryName:"Has Date"},{type:"has_date_lt",name:"has a date before",operands:1},{type:"has_date_eq",name:"has a date equal to",operands:1},{type:"has_date_gt",name:"has a date after",operands:1},{type:"has_time",name:"has a time",operands:0,categoryName:"Has Time"},{type:"has_phone",name:"has a phone number",operands:0,categoryName:"Has Phone"},{type:"has_email",name:"has an email",operands:0,categoryName:"Has Email"},{type:"has_state",name:"has state",operands:0,categoryName:"Has State",filter:"locations"},{type:"has_district",name:"has district",operands:1,categoryName:"Has District",filter:"locations"},{type:"has_ward",name:"has ward",operands:2,categoryName:"Has Ward",filter:"locations"},{type:"has_group",name:"is in the group",operands:1,visibility:"hidden"},{type:"has_category",name:"has the category",operands:0,visibility:"hidden"},{type:"has_error",name:"has an error",operands:0,categoryName:"Has Error",visibility:"hidden"},{type:"has_value",name:"is not empty",operands:0,categoryName:"Not Empty",visibility:"hidden"},{type:"has_pattern",name:"matches regex",operands:1}],Yu=t=>Zu.filter(e=>"hidden"!==e.visibility&&(!e.filter||!!t&&t.includes(e.filter))),Ku=new Set(["has_beginning","has_number","has_number_between","has_number_lt","has_number_lte","has_number_eq","has_number_gte","has_number_gt","has_pattern"]),Gu=t=>Zu.find(e=>e.type===t),Xu=t=>t.map(t=>({value:t.type,name:t.name})),Qu={type:"text",required:!1,maxLength:64,placeholder:"(optional)",helpText:"The name to use to reference this result in the flow"},Ju={type:"checkbox",label:"Require rules to be localized",helpText:"Each language must specify its own rules for this node"},tp={type:"checkbox",label:"Require categories to be localized",helpText:t=>{var e;const i=null===(e=t.result_name)||void 0===e?void 0:e.trim();if(i){return`Only enable if you plan to use @results.${i.toLowerCase().replace(/\s+/g,"_")}.category_localized`}return"Only enable if you plan to use category_localized in your expressions for this result"},conditions:{visible:t=>!!t.result_name}},ep={label:"Save Result",localizable:!1,items:["result_name"],collapsed:t=>!(t._isNew&&t.result_name),getValueCount:t=>!!t.result_name},ip={type:"accordion",multi:!0,sections:[ep,{label:"Localization",localizable:!1,items:["localizeRules","localizeCategories"],collapsed:!0,getValueCount:t=>!(!t.localizeRules&&!t.localizeCategories)}]},op={type:"accordion",multi:!0,sections:[ep]},np={type:"accordion",multi:!0,sections:[ep,{label:"Localization",localizable:!1,items:["localizeCategories"],collapsed:!0,getValueCount:t=>!!t.localizeCategories}]};function sp(t,e){var i,o;const n=(null===(i=t.router)||void 0===i?void 0:i.categories)||[],s={};n.forEach(t=>{const i=t.uuid,o=e[i];s[i]={originalName:t.name,localizedName:o&&o.name?Array.isArray(o.name)?o.name[0]||"":o.name:""}});const r=(null===(o=t.router)||void 0===o?void 0:o.cases)||[],a={};return r.forEach(t=>{var i,o;if(!(null===(i=t.arguments)||void 0===i?void 0:i.length)||!t.arguments.some(t=>t))return;const n=e[t.uuid],s=(null===(o=Gu(t.type))||void 0===o?void 0:o.name)||t.type;a[t.uuid]={operatorName:s,originalArguments:[...t.arguments],localizedArguments:(null==n?void 0:n.arguments)?[...n.arguments]:t.arguments.map(()=>"")}}),{categories:s,rules:a}}function rp(t,e){const i={};return t.categories&&Object.keys(t.categories).forEach(e=>{var o,n;const s=t.categories[e],r=(null===(o=s.localizedName)||void 0===o?void 0:o.trim())||"",a=(null===(n=s.originalName)||void 0===n?void 0:n.trim())||"";r&&r!==a&&(i[e]={name:[r]})}),t.rules&&Object.keys(t.rules).forEach(e=>{const o=t.rules[e],n=o.localizedArguments||[],s=o.originalArguments||[],r=n.some((t,e)=>(null==t?void 0:t.trim())&&t.trim()!==(s[e]||""));r&&(i[e]={arguments:n.map(t=>(null==t?void 0:t.trim())||"")})}),i}function ap(t,e,i,o=[]){const n=[],s=[],r=[];return t.forEach(t=>{const a=re(e,t.name),l=a?i.find(t=>t.uuid===a.exit_uuid):null,d=(null==l?void 0:l.uuid)||Gt(),c=(null==a?void 0:a.uuid)||Gt();if(n.push({uuid:c,name:t.name,exit_uuid:d}),s.push({uuid:d,destination_uuid:(null==l?void 0:l.destination_uuid)||null}),t.case){const e=t.case.arguments[0],i=o.find(t=>{var i;return(null===(i=t.arguments)||void 0===i?void 0:i[0])===e});r.push({uuid:(null==i?void 0:i.uuid)||Gt(),type:t.case.type,arguments:t.case.arguments,category_uuid:c})}}),{categories:n,exits:s,cases:r}}function lp(t,e,i,o,n){const s=n.some(t=>se(t,"Other"))?null:re(i,"Other"),r=s?o.find(t=>t.uuid===s.exit_uuid):null,a=(null==r?void 0:r.uuid)||Gt(),l=(null==s?void 0:s.uuid)||Gt();return t.push({uuid:l,name:"Other",exit_uuid:a}),e.push({uuid:a,destination_uuid:(null==r?void 0:r.destination_uuid)||null}),l}function dp(t){return e=>{const i={};return t(e,i),{valid:0===Object.keys(i).length,errors:i}}}function cp(t){return t.toLocalizationFormData?t.toLocalizationFormData:"categories"===t.localizable?sp:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={uuid:t.uuid};return e.forEach(t=>{const e=i[t];o[t]=Array.isArray(e)&&e[0]||""}),o}):void 0;var e}function hp(t){return t.fromLocalizationFormData?t.fromLocalizationFormData:"categories"===t.localizable?rp:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={};return e.forEach(e=>{const n=t[e];n&&""!==n.trim()&&n!==i[e]&&(o[e]=[n])}),o}):void 0;var e}const up="undefined"!=typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function pp(t){return 0!==t.button||!(!up||!t.ctrlKey)}function mp(t){if(t.dependency){const e=t.dependency.name||t.dependency.key;return`Cannot find a ${t.dependency.type} for ${e}`}return t.description}function gp(t){const e=20*Math.round(t/20);return Math.max(e,0)}const fp="font-family:SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;font-size:0.95em",vp={[nc.ExpressionPrefix]:`color:${Cc.expression};font-weight:600;${fp}`,[nc.Identifier]:`color:${Cc.expression};${fp}`,[nc.FunctionName]:`color:${Cc.fn};font-weight:900;${fp}`,[nc.StringLiteral]:`color:${Cc.string};${fp}`,[nc.NumberLiteral]:`color:${Cc.number};${fp}`,[nc.Keyword]:`color:${Cc.keyword};${fp}`,[nc.Operator]:`color:${Cc.operator};${fp}`,[nc.ContextRef]:`color:${Cc.expression};${fp}`,[nc.Separator]:`color:${Cc.operator};${fp}`,[nc.Arrow]:`color:${Cc.operator};${fp}`,[nc.Bracket]:`color:${Cc.operator};${fp}`,[nc.Paren]:`color:${Cc.paren};${fp}`,[nc.Whitespace]:fp},bp=[[/claude|anthropic/i,"anthropic"],[/gpt|openai|o1|o3|o4/i,"openai"],[/gemini|google/i,"gemini"],[/azure|microsoft/i,"azure"],[/deepseek/i,"deepseek"]],yp=(t,e=!1)=>{const i=cc(t||"",e?Gd:Kd),o=[];for(const t of i){const e=!!vp[t.type],i=o[o.length-1];i&&i.isExpr===e?i.tokens.push(t):o.push({isExpr:e,tokens:[t]})}const n=t=>{const e=vp[t.type];if(!e){const e=t.text.split("\n");return V`${e.map((t,e)=>V`${e>0?V`<br />`:null}${t}`)}`}const i=t.text.split("\n");return V`${i.map((t,i)=>V`${i>0?V`<br />`:null}${t?V`<span style="${e}">${t}</span>`:null}`)}`};return V`${o.map(t=>{const e=V`${t.tokens.map(n)}`;return t.isExpr?V`<span style="hyphens:none">${e}</span>`:e})}`},xp=(t,e,i=3)=>V`<div
10777
10837
  style="display: -webkit-box; -webkit-line-clamp: ${i}; -webkit-box-orient: vertical; overflow: hidden; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;"
10778
10838
  title="${e}"
10779
10839
  >
@@ -18354,7 +18414,7 @@ function(t){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.
18354
18414
  <path class="area" d=${`${r} L90,22 L0,22 Z`}></path>
18355
18415
  <polyline class="line" points=${s}></polyline>
18356
18416
  </svg>
18357
- `}renderFlowStatus(t){const e=(t.status||"active").toString().toLowerCase(),i="archived"===e?"archived":"active",o="archived"===e?"Archived":"Active";return this.renderStatusPill(i,o)}}),HC("temba-list",Oh),HC("temba-sortable-list",jd),HC("temba-run-list",cu),HC("temba-flow-details",hu),HC("temba-label",Qh),HC("temba-menu",Zh),HC("temba-contact-search",Fh),HC("temba-icon",qh),HC("temba-dropdown",Kh),HC("temba-tabs",Gh),HC("temba-tab",Xh),HC("temba-contact-badges",su),HC("temba-contact-events",au),HC("temba-slider",lu),HC("temba-content-menu",yu),HC("temba-compose",_u),HC("temba-color-picker",Cu),HC("temba-resizer",Su),HC("temba-thumbnail",Tu),HC("temba-webchat",Ru),HC("temba-image-picker",Bu),HC("temba-mask",Fu),HC("temba-user",Ll),HC("temba-template-editor",qu),HC("temba-toast",Uu),HC("temba-chat",yh),HC("temba-media-picker",Hu),HC("temba-flow-editor",Eg),HC("temba-editor-toolbar",dg),HC("temba-message-table",jC),HC("temba-node-editor",cC),HC("temba-flow-node",_g),HC("temba-sticky-note",Tg),HC("temba-canvas-menu",Dg),HC("temba-node-type-selector",Mg),HC("temba-contact-notepad",zg),HC("temba-progress",Ig),HC("temba-start-progress",Lg),HC("temba-shortcuts",Og),HC("temba-popup-select",Pg),HC("temba-user-select",Rg),HC("temba-workspace-select",Ng),HC("temba-chart",Xk),HC("temba-key-value-editor",uC),HC("temba-array-editor",pC),HC("temba-message-editor",mC),HC("temba-rich-edit",gC),HC("temba-accordion",bC),HC("temba-accordion-section",yC),HC("temba-expression-highlight",fC),HC("temba-floating-tab",Cg),HC("temba-floating-window",vC),HC("temba-simulator",SC),HC("temba-flow-search",IC),HC("temba-issues-window",LC),HC("temba-revisions-window",FC),HC("temba-auto-translate",UC);class WC extends ct{static get styles(){return l`
18417
+ `}renderFlowStatus(t){const e=(t.status||"active").toString().toLowerCase(),i="archived"===e?"archived":"active",o="archived"===e?"Archived":"Active";return this.renderStatusPill(i,o)}}),HC("temba-list",Oh),HC("temba-sortable-list",jd),HC("temba-run-list",cu),HC("temba-flow-details",hu),HC("temba-label",Qh),HC("temba-menu",Zh),HC("temba-contact-search",Fh),HC("temba-icon",qh),HC("temba-dropdown",Kh),HC("temba-tabs",Gh),HC("temba-tab",Xh),HC("temba-contact-badges",su),HC("temba-contact-timeline",au),HC("temba-slider",lu),HC("temba-content-menu",yu),HC("temba-compose",_u),HC("temba-color-picker",Cu),HC("temba-resizer",Su),HC("temba-thumbnail",Tu),HC("temba-webchat",Ru),HC("temba-image-picker",Bu),HC("temba-mask",Fu),HC("temba-user",Ll),HC("temba-template-editor",qu),HC("temba-toast",Uu),HC("temba-chat",yh),HC("temba-media-picker",Hu),HC("temba-flow-editor",Eg),HC("temba-editor-toolbar",dg),HC("temba-message-table",jC),HC("temba-node-editor",cC),HC("temba-flow-node",_g),HC("temba-sticky-note",Tg),HC("temba-canvas-menu",Dg),HC("temba-node-type-selector",Mg),HC("temba-contact-notepad",zg),HC("temba-progress",Ig),HC("temba-start-progress",Lg),HC("temba-shortcuts",Og),HC("temba-popup-select",Pg),HC("temba-user-select",Rg),HC("temba-workspace-select",Ng),HC("temba-chart",Xk),HC("temba-key-value-editor",uC),HC("temba-array-editor",pC),HC("temba-message-editor",mC),HC("temba-rich-edit",gC),HC("temba-accordion",bC),HC("temba-accordion-section",yC),HC("temba-expression-highlight",fC),HC("temba-floating-tab",Cg),HC("temba-floating-window",vC),HC("temba-simulator",SC),HC("temba-flow-search",IC),HC("temba-issues-window",LC),HC("temba-revisions-window",FC),HC("temba-auto-translate",UC);class WC extends ct{static get styles(){return l`
18358
18418
  :host {
18359
18419
  line-height: normal;
18360
18420
  }