@forgeroute/ui 0.4.41 → 0.4.42

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.
@@ -3618,6 +3618,9 @@ var SendEmailComponent = class SendEmailComponent {
3618
3618
  }, ...ngDevMode ? [{ debugName: "previewContact" }] : /* istanbul ignore next */ []);
3619
3619
  this.videoDefaults = input(null, ...ngDevMode ? [{ debugName: "videoDefaults" }] : /* istanbul ignore next */ []);
3620
3620
  this.attachmentsAndScheduling = input(true, ...ngDevMode ? [{ debugName: "attachmentsAndScheduling" }] : /* istanbul ignore next */ []);
3621
+ this.showSubject = input(true, ...ngDevMode ? [{ debugName: "showSubject" }] : /* istanbul ignore next */ []);
3622
+ this.showTemplates = input(true, ...ngDevMode ? [{ debugName: "showTemplates" }] : /* istanbul ignore next */ []);
3623
+ this.showVideo = input(true, ...ngDevMode ? [{ debugName: "showVideo" }] : /* istanbul ignore next */ []);
3621
3624
  this.sent = output();
3622
3625
  this.emailAdded = output();
3623
3626
  this.validChange = output();
@@ -3816,7 +3819,7 @@ var SendEmailComponent = class SendEmailComponent {
3816
3819
  if (this.ccError || this.documents() && this.documentsInvalid) return false;
3817
3820
  if (this.signersActive && (this.signersInvalid || !this.signersValue)) return false;
3818
3821
  if (this.viaDocuSign && !this.contactId()) return false;
3819
- const hasContent = (this.viaDocuSign || !!this.subject.trim() && !!this.body.trim()) && this.unresolvedVars.length === 0 && !hasLeftoverTags(this.resolvedSubject) && !hasLeftoverTags(this.resolvedBody);
3822
+ const hasContent = (this.viaDocuSign || (!this.showSubject() || !!this.subject.trim()) && !!this.body.trim()) && this.unresolvedVars.length === 0 && !hasLeftoverTags(this.resolvedSubject) && !hasLeftoverTags(this.resolvedBody);
3820
3823
  if (this.showSchedule) return hasContent && !!this.scheduledAt && new Date(this.scheduledAt).getTime() > Date.now();
3821
3824
  return hasContent;
3822
3825
  }
@@ -4317,6 +4320,27 @@ var SendEmailComponent = class SendEmailComponent {
4317
4320
  isSignal: true,
4318
4321
  isRequired: false,
4319
4322
  transformFunction: null
4323
+ },
4324
+ showSubject: {
4325
+ classPropertyName: "showSubject",
4326
+ publicName: "showSubject",
4327
+ isSignal: true,
4328
+ isRequired: false,
4329
+ transformFunction: null
4330
+ },
4331
+ showTemplates: {
4332
+ classPropertyName: "showTemplates",
4333
+ publicName: "showTemplates",
4334
+ isSignal: true,
4335
+ isRequired: false,
4336
+ transformFunction: null
4337
+ },
4338
+ showVideo: {
4339
+ classPropertyName: "showVideo",
4340
+ publicName: "showVideo",
4341
+ isSignal: true,
4342
+ isRequired: false,
4343
+ transformFunction: null
4320
4344
  }
4321
4345
  },
4322
4346
  outputs: {
@@ -4381,12 +4405,15 @@ var SendEmailComponent = class SendEmailComponent {
4381
4405
  (ngModelChange)="notifyValid()" />
4382
4406
  }
4383
4407
 
4384
- <!-- Mode -->
4408
+ <!-- Mode (hidden with [showTemplates]="false": the form is Create Message only) -->
4409
+ @if (showTemplates()) {
4385
4410
  <div class="sm-mode-row">
4386
4411
  <ui-pill-tabs [tabs]="modeTabs" [activeKey]="mode" (tabChange)="setMode($event)" />
4387
4412
  </div>
4413
+ }
4388
4414
 
4389
4415
  @if (mode === 'compose') {
4416
+ @if (showSubject()) {
4390
4417
  <ui-text-input
4391
4418
  label="Subject"
4392
4419
  [required]="!viaDocuSign"
@@ -4394,6 +4421,7 @@ var SendEmailComponent = class SendEmailComponent {
4394
4421
  [maxlength]="MAX_SUBJECT"
4395
4422
  [(ngModel)]="subject"
4396
4423
  (ngModelChange)="notifyValid()" />
4424
+ }
4397
4425
  <ui-textarea-input
4398
4426
  label="Message"
4399
4427
  [required]="!viaDocuSign"
@@ -4543,7 +4571,7 @@ var SendEmailComponent = class SendEmailComponent {
4543
4571
  }
4544
4572
 
4545
4573
  <!-- Video: the LAST section. The picker, and once a video is attached its settings, Watch Preview and Remove Video. -->
4546
- @if (mode === 'compose') {
4574
+ @if (mode === 'compose' && showVideo()) {
4547
4575
  <ui-form-section label="Video" [divider]="true">
4548
4576
  @for (k of [videoPickerKey]; track k) {
4549
4577
  <ui-video-picker (videoSelected)="onVideoSelected($event)" />
@@ -4980,12 +5008,15 @@ i0.ɵɵngDeclareClassMetadata({
4980
5008
  (ngModelChange)="notifyValid()" />
4981
5009
  }
4982
5010
 
4983
- <!-- Mode -->
5011
+ <!-- Mode (hidden with [showTemplates]="false": the form is Create Message only) -->
5012
+ @if (showTemplates()) {
4984
5013
  <div class="sm-mode-row">
4985
5014
  <ui-pill-tabs [tabs]="modeTabs" [activeKey]="mode" (tabChange)="setMode($event)" />
4986
5015
  </div>
5016
+ }
4987
5017
 
4988
5018
  @if (mode === 'compose') {
5019
+ @if (showSubject()) {
4989
5020
  <ui-text-input
4990
5021
  label="Subject"
4991
5022
  [required]="!viaDocuSign"
@@ -4993,6 +5024,7 @@ i0.ɵɵngDeclareClassMetadata({
4993
5024
  [maxlength]="MAX_SUBJECT"
4994
5025
  [(ngModel)]="subject"
4995
5026
  (ngModelChange)="notifyValid()" />
5027
+ }
4996
5028
  <ui-textarea-input
4997
5029
  label="Message"
4998
5030
  [required]="!viaDocuSign"
@@ -5142,7 +5174,7 @@ i0.ɵɵngDeclareClassMetadata({
5142
5174
  }
5143
5175
 
5144
5176
  <!-- Video: the LAST section. The picker, and once a video is attached its settings, Watch Preview and Remove Video. -->
5145
- @if (mode === 'compose') {
5177
+ @if (mode === 'compose' && showVideo()) {
5146
5178
  <ui-form-section label="Video" [divider]="true">
5147
5179
  @for (k of [videoPickerKey]; track k) {
5148
5180
  <ui-video-picker (videoSelected)="onVideoSelected($event)" />
@@ -5408,6 +5440,30 @@ i0.ɵɵngDeclareClassMetadata({
5408
5440
  required: false
5409
5441
  }]
5410
5442
  }],
5443
+ showSubject: [{
5444
+ type: i0.Input,
5445
+ args: [{
5446
+ isSignal: true,
5447
+ alias: "showSubject",
5448
+ required: false
5449
+ }]
5450
+ }],
5451
+ showTemplates: [{
5452
+ type: i0.Input,
5453
+ args: [{
5454
+ isSignal: true,
5455
+ alias: "showTemplates",
5456
+ required: false
5457
+ }]
5458
+ }],
5459
+ showVideo: [{
5460
+ type: i0.Input,
5461
+ args: [{
5462
+ isSignal: true,
5463
+ alias: "showVideo",
5464
+ required: false
5465
+ }]
5466
+ }],
5411
5467
  sent: [{
5412
5468
  type: i0.Output,
5413
5469
  args: ["sent"]
@@ -5430,6 +5486,395 @@ i0.ɵɵngDeclareClassMetadata({
5430
5486
  }]
5431
5487
  }
5432
5488
  });
5489
+ const MAX_SUBJECT = 255;
5490
+ var SendInAppComponent = class SendInAppComponent {
5491
+ constructor() {
5492
+ this.destroyRef = inject(DestroyRef);
5493
+ this.toast = inject(ToastService);
5494
+ this.contactName = input("", ...ngDevMode ? [{ debugName: "contactName" }] : /* istanbul ignore next */ []);
5495
+ this.contactId = input("", ...ngDevMode ? [{ debugName: "contactId" }] : /* istanbul ignore next */ []);
5496
+ this.defaultSubject = input("", ...ngDevMode ? [{ debugName: "defaultSubject" }] : /* istanbul ignore next */ []);
5497
+ this.defaultBody = input("", ...ngDevMode ? [{ debugName: "defaultBody" }] : /* istanbul ignore next */ []);
5498
+ this.showSubject = input(true, ...ngDevMode ? [{ debugName: "showSubject" }] : /* istanbul ignore next */ []);
5499
+ this.maxLength = input(null, ...ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []);
5500
+ this.limit = computed(() => this.maxLength() ?? 0, ...ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []);
5501
+ this.sendFn = input(null, ...ngDevMode ? [{ debugName: "sendFn" }] : /* istanbul ignore next */ []);
5502
+ this.sent = output();
5503
+ this.validChange = output();
5504
+ this.MAX_SUBJECT = MAX_SUBJECT;
5505
+ this.sending = signal(false, ...ngDevMode ? [{ debugName: "sending" }] : /* istanbul ignore next */ []);
5506
+ this.subject = "";
5507
+ this.body = "";
5508
+ }
5509
+ ngOnInit() {
5510
+ this.subject = this.defaultSubject();
5511
+ this.body = this.defaultBody();
5512
+ this.notifyValid();
5513
+ }
5514
+ get canSend() {
5515
+ if (!this.body.trim() || this.showSubject() && !this.subject.trim()) return false;
5516
+ if (this.showSubject() && this.subject.length > MAX_SUBJECT) return false;
5517
+ const max = this.maxLength();
5518
+ return max == null || this.body.length <= max;
5519
+ }
5520
+ notifyValid() {
5521
+ this.validChange.emit(!this.sending() && !!this.sendFn() && this.canSend);
5522
+ }
5523
+ submit() {
5524
+ const send = this.sendFn();
5525
+ if (!send || this.sending() || !this.canSend) return;
5526
+ this.sending.set(true);
5527
+ this.notifyValid();
5528
+ const payload = {
5529
+ contactName: this.contactName(),
5530
+ contactId: this.contactId() || void 0,
5531
+ body: this.body.trim()
5532
+ };
5533
+ if (this.showSubject()) payload.subject = this.subject.trim();
5534
+ send(payload).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
5535
+ next: () => {
5536
+ this.toast.show("Message sent");
5537
+ this.sending.set(false);
5538
+ this.sent.emit();
5539
+ },
5540
+ error: (err) => {
5541
+ this.toast.error(serverMessage(err) || "Failed to send message");
5542
+ this.sending.set(false);
5543
+ this.notifyValid();
5544
+ }
5545
+ });
5546
+ }
5547
+ static {
5548
+ this.ɵfac = i0.ɵɵngDeclareFactory({
5549
+ minVersion: "12.0.0",
5550
+ version: "22.2.2",
5551
+ ngImport: i0,
5552
+ type: SendInAppComponent,
5553
+ deps: [],
5554
+ target: i0.ɵɵFactoryTarget.Component
5555
+ });
5556
+ }
5557
+ static {
5558
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
5559
+ minVersion: "17.0.0",
5560
+ version: "22.2.2",
5561
+ type: SendInAppComponent,
5562
+ isStandalone: true,
5563
+ selector: "ui-send-in-app",
5564
+ inputs: {
5565
+ contactName: {
5566
+ classPropertyName: "contactName",
5567
+ publicName: "contactName",
5568
+ isSignal: true,
5569
+ isRequired: false,
5570
+ transformFunction: null
5571
+ },
5572
+ contactId: {
5573
+ classPropertyName: "contactId",
5574
+ publicName: "contactId",
5575
+ isSignal: true,
5576
+ isRequired: false,
5577
+ transformFunction: null
5578
+ },
5579
+ defaultSubject: {
5580
+ classPropertyName: "defaultSubject",
5581
+ publicName: "defaultSubject",
5582
+ isSignal: true,
5583
+ isRequired: false,
5584
+ transformFunction: null
5585
+ },
5586
+ defaultBody: {
5587
+ classPropertyName: "defaultBody",
5588
+ publicName: "defaultBody",
5589
+ isSignal: true,
5590
+ isRequired: false,
5591
+ transformFunction: null
5592
+ },
5593
+ showSubject: {
5594
+ classPropertyName: "showSubject",
5595
+ publicName: "showSubject",
5596
+ isSignal: true,
5597
+ isRequired: false,
5598
+ transformFunction: null
5599
+ },
5600
+ maxLength: {
5601
+ classPropertyName: "maxLength",
5602
+ publicName: "maxLength",
5603
+ isSignal: true,
5604
+ isRequired: false,
5605
+ transformFunction: null
5606
+ },
5607
+ sendFn: {
5608
+ classPropertyName: "sendFn",
5609
+ publicName: "sendFn",
5610
+ isSignal: true,
5611
+ isRequired: false,
5612
+ transformFunction: null
5613
+ }
5614
+ },
5615
+ outputs: {
5616
+ sent: "sent",
5617
+ validChange: "validChange"
5618
+ },
5619
+ ngImport: i0,
5620
+ template: `
5621
+ <div class="sm-group">
5622
+ <span class="sm-group-label">To</span>
5623
+ <div class="sm-to-card">
5624
+ <span class="sm-to-name">{{ contactName() }}</span>
5625
+ </div>
5626
+ </div>
5627
+ @if (showSubject()) {
5628
+ <ui-text-input
5629
+ label="Subject"
5630
+ [required]="true"
5631
+ placeholder="Subject..."
5632
+ [maxlength]="MAX_SUBJECT"
5633
+ [(ngModel)]="subject"
5634
+ (ngModelChange)="notifyValid()" />
5635
+ }
5636
+ @if (limit(); as max) {
5637
+ <ui-textarea-input
5638
+ label="Message"
5639
+ [required]="true"
5640
+ placeholder="Write your message..."
5641
+ [rows]="8"
5642
+ [maxlength]="max"
5643
+ [(ngModel)]="body"
5644
+ (ngModelChange)="notifyValid()" />
5645
+ } @else {
5646
+ <ui-textarea-input
5647
+ label="Message"
5648
+ [required]="true"
5649
+ placeholder="Write your message..."
5650
+ [rows]="8"
5651
+ [(ngModel)]="body"
5652
+ (ngModelChange)="notifyValid()" />
5653
+ }
5654
+ `,
5655
+ isInline: true,
5656
+ styles: [":host{display:flex;flex-direction:column;gap:14px}.sm-group-label{display:block;font-size:.8125rem;font-weight:600;color:#334155;margin-bottom:6px}.sm-to-card{border:1px solid #e2e8f0;border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:3px}.sm-to-name{font-size:.9375rem;font-weight:600;color:#1e293b;min-width:0;overflow-wrap:anywhere}\n"],
5657
+ dependencies: [
5658
+ {
5659
+ kind: "ngmodule",
5660
+ type: FormsModule
5661
+ },
5662
+ {
5663
+ kind: "directive",
5664
+ type: i1.NgControlStatus,
5665
+ selector: "[formControlName],[ngModel],[formControl]"
5666
+ },
5667
+ {
5668
+ kind: "directive",
5669
+ type: i1.RequiredValidator,
5670
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
5671
+ inputs: ["required"]
5672
+ },
5673
+ {
5674
+ kind: "directive",
5675
+ type: i1.MaxLengthValidator,
5676
+ selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
5677
+ inputs: ["maxlength"]
5678
+ },
5679
+ {
5680
+ kind: "directive",
5681
+ type: i1.NgModel,
5682
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
5683
+ inputs: [
5684
+ "name",
5685
+ "disabled",
5686
+ "ngModel",
5687
+ "ngModelOptions"
5688
+ ],
5689
+ outputs: ["ngModelChange"],
5690
+ exportAs: ["ngModel"]
5691
+ },
5692
+ {
5693
+ kind: "component",
5694
+ type: TextInputComponent,
5695
+ selector: "ui-text-input",
5696
+ inputs: [
5697
+ "label",
5698
+ "ariaLabel",
5699
+ "inputTestId",
5700
+ "placeholder",
5701
+ "prefix",
5702
+ "revealable",
5703
+ "passwordRequirements",
5704
+ "passwordRules",
5705
+ "type",
5706
+ "maxlength",
5707
+ "required",
5708
+ "autocomplete",
5709
+ "inputmode",
5710
+ "readonly",
5711
+ "hint",
5712
+ "error",
5713
+ "phoneFormat",
5714
+ "min",
5715
+ "max",
5716
+ "maxDecimals",
5717
+ "step",
5718
+ "valueType",
5719
+ "formatter",
5720
+ "integer",
5721
+ "showErrors",
5722
+ "disabled"
5723
+ ],
5724
+ outputs: [
5725
+ "valueChange",
5726
+ "focused",
5727
+ "blurred",
5728
+ "invalidChange"
5729
+ ]
5730
+ },
5731
+ {
5732
+ kind: "component",
5733
+ type: TextareaInputComponent,
5734
+ selector: "ui-textarea-input",
5735
+ inputs: [
5736
+ "label",
5737
+ "ariaLabel",
5738
+ "placeholder",
5739
+ "rows",
5740
+ "maxlength",
5741
+ "required",
5742
+ "readonly",
5743
+ "hint",
5744
+ "hintAsDescription",
5745
+ "error",
5746
+ "monospace",
5747
+ "showErrors",
5748
+ "disabled"
5749
+ ],
5750
+ outputs: ["invalidChange"]
5751
+ }
5752
+ ],
5753
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
5754
+ });
5755
+ }
5756
+ };
5757
+ i0.ɵɵngDeclareClassMetadata({
5758
+ minVersion: "12.0.0",
5759
+ version: "22.2.2",
5760
+ ngImport: i0,
5761
+ type: SendInAppComponent,
5762
+ decorators: [{
5763
+ type: Component,
5764
+ args: [{
5765
+ selector: "ui-send-in-app",
5766
+ standalone: true,
5767
+ changeDetection: ChangeDetectionStrategy.OnPush,
5768
+ imports: [
5769
+ FormsModule,
5770
+ TextInputComponent,
5771
+ TextareaInputComponent
5772
+ ],
5773
+ template: `
5774
+ <div class="sm-group">
5775
+ <span class="sm-group-label">To</span>
5776
+ <div class="sm-to-card">
5777
+ <span class="sm-to-name">{{ contactName() }}</span>
5778
+ </div>
5779
+ </div>
5780
+ @if (showSubject()) {
5781
+ <ui-text-input
5782
+ label="Subject"
5783
+ [required]="true"
5784
+ placeholder="Subject..."
5785
+ [maxlength]="MAX_SUBJECT"
5786
+ [(ngModel)]="subject"
5787
+ (ngModelChange)="notifyValid()" />
5788
+ }
5789
+ @if (limit(); as max) {
5790
+ <ui-textarea-input
5791
+ label="Message"
5792
+ [required]="true"
5793
+ placeholder="Write your message..."
5794
+ [rows]="8"
5795
+ [maxlength]="max"
5796
+ [(ngModel)]="body"
5797
+ (ngModelChange)="notifyValid()" />
5798
+ } @else {
5799
+ <ui-textarea-input
5800
+ label="Message"
5801
+ [required]="true"
5802
+ placeholder="Write your message..."
5803
+ [rows]="8"
5804
+ [(ngModel)]="body"
5805
+ (ngModelChange)="notifyValid()" />
5806
+ }
5807
+ `,
5808
+ styles: [":host{display:flex;flex-direction:column;gap:14px}.sm-group-label{display:block;font-size:.8125rem;font-weight:600;color:#334155;margin-bottom:6px}.sm-to-card{border:1px solid #e2e8f0;border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:3px}.sm-to-name{font-size:.9375rem;font-weight:600;color:#1e293b;min-width:0;overflow-wrap:anywhere}\n"]
5809
+ }]
5810
+ }],
5811
+ propDecorators: {
5812
+ contactName: [{
5813
+ type: i0.Input,
5814
+ args: [{
5815
+ isSignal: true,
5816
+ alias: "contactName",
5817
+ required: false
5818
+ }]
5819
+ }],
5820
+ contactId: [{
5821
+ type: i0.Input,
5822
+ args: [{
5823
+ isSignal: true,
5824
+ alias: "contactId",
5825
+ required: false
5826
+ }]
5827
+ }],
5828
+ defaultSubject: [{
5829
+ type: i0.Input,
5830
+ args: [{
5831
+ isSignal: true,
5832
+ alias: "defaultSubject",
5833
+ required: false
5834
+ }]
5835
+ }],
5836
+ defaultBody: [{
5837
+ type: i0.Input,
5838
+ args: [{
5839
+ isSignal: true,
5840
+ alias: "defaultBody",
5841
+ required: false
5842
+ }]
5843
+ }],
5844
+ showSubject: [{
5845
+ type: i0.Input,
5846
+ args: [{
5847
+ isSignal: true,
5848
+ alias: "showSubject",
5849
+ required: false
5850
+ }]
5851
+ }],
5852
+ maxLength: [{
5853
+ type: i0.Input,
5854
+ args: [{
5855
+ isSignal: true,
5856
+ alias: "maxLength",
5857
+ required: false
5858
+ }]
5859
+ }],
5860
+ sendFn: [{
5861
+ type: i0.Input,
5862
+ args: [{
5863
+ isSignal: true,
5864
+ alias: "sendFn",
5865
+ required: false
5866
+ }]
5867
+ }],
5868
+ sent: [{
5869
+ type: i0.Output,
5870
+ args: ["sent"]
5871
+ }],
5872
+ validChange: [{
5873
+ type: i0.Output,
5874
+ args: ["validChange"]
5875
+ }]
5876
+ }
5877
+ });
5433
5878
  const MAX_SMS_LENGTH = 320;
5434
5879
  const PHONE_RE = /^\+?[\d\s\-().]{7,}$/;
5435
5880
  function formatPhone(raw) {
@@ -5467,6 +5912,8 @@ var SendTextComponent = class SendTextComponent {
5467
5912
  this.documentSentMessage = input(null, ...ngDevMode ? [{ debugName: "documentSentMessage" }] : /* istanbul ignore next */ []);
5468
5913
  this.documents = input(false, ...ngDevMode ? [{ debugName: "documents" }] : /* istanbul ignore next */ []);
5469
5914
  this.attachmentsAndScheduling = input(true, ...ngDevMode ? [{ debugName: "attachmentsAndScheduling" }] : /* istanbul ignore next */ []);
5915
+ this.showTemplates = input(true, ...ngDevMode ? [{ debugName: "showTemplates" }] : /* istanbul ignore next */ []);
5916
+ this.showVideo = input(true, ...ngDevMode ? [{ debugName: "showVideo" }] : /* istanbul ignore next */ []);
5470
5917
  this.documentPurposes = input([
5471
5918
  "ESIGN",
5472
5919
  "ATTACH",
@@ -5946,6 +6393,20 @@ var SendTextComponent = class SendTextComponent {
5946
6393
  isRequired: false,
5947
6394
  transformFunction: null
5948
6395
  },
6396
+ showTemplates: {
6397
+ classPropertyName: "showTemplates",
6398
+ publicName: "showTemplates",
6399
+ isSignal: true,
6400
+ isRequired: false,
6401
+ transformFunction: null
6402
+ },
6403
+ showVideo: {
6404
+ classPropertyName: "showVideo",
6405
+ publicName: "showVideo",
6406
+ isSignal: true,
6407
+ isRequired: false,
6408
+ transformFunction: null
6409
+ },
5949
6410
  documentPurposes: {
5950
6411
  classPropertyName: "documentPurposes",
5951
6412
  publicName: "documentPurposes",
@@ -6052,10 +6513,12 @@ var SendTextComponent = class SendTextComponent {
6052
6513
  </div>
6053
6514
  </div>
6054
6515
 
6055
- <!-- Mode -->
6516
+ <!-- Mode (hidden with [showTemplates]="false": the form is Create Message only) -->
6517
+ @if (showTemplates()) {
6056
6518
  <div class="sm-mode-row">
6057
6519
  <ui-pill-tabs [tabs]="modeTabs" [activeKey]="mode" (tabChange)="setMode($event)" />
6058
6520
  </div>
6521
+ }
6059
6522
 
6060
6523
  @if (mode === 'compose') {
6061
6524
  <div class="sm-field">
@@ -6199,7 +6662,7 @@ var SendTextComponent = class SendTextComponent {
6199
6662
  }
6200
6663
 
6201
6664
  <!-- Video: the LAST section. The picker, and once a video is attached its settings, Watch Preview and Remove Video. -->
6202
- @if (mode === 'compose') {
6665
+ @if (mode === 'compose' && showVideo()) {
6203
6666
  <ui-form-section label="Video" [divider]="true">
6204
6667
  @for (k of [videoPickerKey]; track k) {
6205
6668
  <ui-video-picker (videoSelected)="onVideoSelected($event)" />
@@ -6599,10 +7062,12 @@ i0.ɵɵngDeclareClassMetadata({
6599
7062
  </div>
6600
7063
  </div>
6601
7064
 
6602
- <!-- Mode -->
7065
+ <!-- Mode (hidden with [showTemplates]="false": the form is Create Message only) -->
7066
+ @if (showTemplates()) {
6603
7067
  <div class="sm-mode-row">
6604
7068
  <ui-pill-tabs [tabs]="modeTabs" [activeKey]="mode" (tabChange)="setMode($event)" />
6605
7069
  </div>
7070
+ }
6606
7071
 
6607
7072
  @if (mode === 'compose') {
6608
7073
  <div class="sm-field">
@@ -6746,7 +7211,7 @@ i0.ɵɵngDeclareClassMetadata({
6746
7211
  }
6747
7212
 
6748
7213
  <!-- Video: the LAST section. The picker, and once a video is attached its settings, Watch Preview and Remove Video. -->
6749
- @if (mode === 'compose') {
7214
+ @if (mode === 'compose' && showVideo()) {
6750
7215
  <ui-form-section label="Video" [divider]="true">
6751
7216
  @for (k of [videoPickerKey]; track k) {
6752
7217
  <ui-video-picker (videoSelected)="onVideoSelected($event)" />
@@ -6890,6 +7355,22 @@ i0.ɵɵngDeclareClassMetadata({
6890
7355
  required: false
6891
7356
  }]
6892
7357
  }],
7358
+ showTemplates: [{
7359
+ type: i0.Input,
7360
+ args: [{
7361
+ isSignal: true,
7362
+ alias: "showTemplates",
7363
+ required: false
7364
+ }]
7365
+ }],
7366
+ showVideo: [{
7367
+ type: i0.Input,
7368
+ args: [{
7369
+ isSignal: true,
7370
+ alias: "showVideo",
7371
+ required: false
7372
+ }]
7373
+ }],
6893
7374
  documentPurposes: [{
6894
7375
  type: i0.Input,
6895
7376
  args: [{
@@ -7023,6 +7504,13 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7023
7504
  this.documents = input(false, ...ngDevMode ? [{ debugName: "documents" }] : /* istanbul ignore next */ []);
7024
7505
  this.documentsEnabled = input(true, ...ngDevMode ? [{ debugName: "documentsEnabled" }] : /* istanbul ignore next */ []);
7025
7506
  this.showCc = input(false, ...ngDevMode ? [{ debugName: "showCc" }] : /* istanbul ignore next */ []);
7507
+ this.recipientMode = input("contact", ...ngDevMode ? [{ debugName: "recipientMode" }] : /* istanbul ignore next */ []);
7508
+ this.sendMessage = input(null, ...ngDevMode ? [{ debugName: "sendMessage" }] : /* istanbul ignore next */ []);
7509
+ this.maxBodyLength = input(null, ...ngDevMode ? [{ debugName: "maxBodyLength" }] : /* istanbul ignore next */ []);
7510
+ this.showSubject = input(true, ...ngDevMode ? [{ debugName: "showSubject" }] : /* istanbul ignore next */ []);
7511
+ this.showTemplates = input(true, ...ngDevMode ? [{ debugName: "showTemplates" }] : /* istanbul ignore next */ []);
7512
+ this.showVideo = input(true, ...ngDevMode ? [{ debugName: "showVideo" }] : /* istanbul ignore next */ []);
7513
+ this.inApp = computed(() => this.recipientMode() === "in-app", ...ngDevMode ? [{ debugName: "inApp" }] : /* istanbul ignore next */ []);
7026
7514
  this.attachmentsAndScheduling = input(true, ...ngDevMode ? [{ debugName: "attachmentsAndScheduling" }] : /* istanbul ignore next */ []);
7027
7515
  this.documentPurposes = input([
7028
7516
  "ESIGN",
@@ -7057,6 +7545,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7057
7545
  this.phoneAdded = output();
7058
7546
  this.sendEmailRef = viewChild("sendEmailRef", ...ngDevMode ? [{ debugName: "sendEmailRef" }] : /* istanbul ignore next */ []);
7059
7547
  this.sendTextRef = viewChild("sendTextRef", ...ngDevMode ? [{ debugName: "sendTextRef" }] : /* istanbul ignore next */ []);
7548
+ this.sendInAppRef = viewChild("sendInAppRef", ...ngDevMode ? [{ debugName: "sendInAppRef" }] : /* istanbul ignore next */ []);
7060
7549
  this.destroyRef = inject(DestroyRef);
7061
7550
  this.jobSearch$ = new Subject();
7062
7551
  this.jobOptions = signal([], ...ngDevMode ? [{ debugName: "jobOptions" }] : /* istanbul ignore next */ []);
@@ -7072,7 +7561,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7072
7561
  this.activeContact = signal(null, ...ngDevMode ? [{ debugName: "activeContact" }] : /* istanbul ignore next */ []);
7073
7562
  this.contactNotices = computed(() => {
7074
7563
  const c = this.activeContact();
7075
- if (!c) return [];
7564
+ if (!c || this.inApp()) return [];
7076
7565
  const notices = [];
7077
7566
  const hasEmail = !!c.email, hasPhone = !!c.phone;
7078
7567
  if (!this.textEnabled()) notices.push("Text messaging is not enabled. Connect Twilio in Comm Settings to send texts.");
@@ -7150,7 +7639,8 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7150
7639
  this.phoneAdded.emit(phone);
7151
7640
  }
7152
7641
  submit() {
7153
- if (this.channel() === "email") this.sendEmailRef()?.submit();
7642
+ if (this.inApp()) this.sendInAppRef()?.submit();
7643
+ else if (this.channel() === "email") this.sendEmailRef()?.submit();
7154
7644
  else this.sendTextRef()?.submit();
7155
7645
  }
7156
7646
  onSent() {
@@ -7297,6 +7787,48 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7297
7787
  isRequired: false,
7298
7788
  transformFunction: null
7299
7789
  },
7790
+ recipientMode: {
7791
+ classPropertyName: "recipientMode",
7792
+ publicName: "recipientMode",
7793
+ isSignal: true,
7794
+ isRequired: false,
7795
+ transformFunction: null
7796
+ },
7797
+ sendMessage: {
7798
+ classPropertyName: "sendMessage",
7799
+ publicName: "sendMessage",
7800
+ isSignal: true,
7801
+ isRequired: false,
7802
+ transformFunction: null
7803
+ },
7804
+ maxBodyLength: {
7805
+ classPropertyName: "maxBodyLength",
7806
+ publicName: "maxBodyLength",
7807
+ isSignal: true,
7808
+ isRequired: false,
7809
+ transformFunction: null
7810
+ },
7811
+ showSubject: {
7812
+ classPropertyName: "showSubject",
7813
+ publicName: "showSubject",
7814
+ isSignal: true,
7815
+ isRequired: false,
7816
+ transformFunction: null
7817
+ },
7818
+ showTemplates: {
7819
+ classPropertyName: "showTemplates",
7820
+ publicName: "showTemplates",
7821
+ isSignal: true,
7822
+ isRequired: false,
7823
+ transformFunction: null
7824
+ },
7825
+ showVideo: {
7826
+ classPropertyName: "showVideo",
7827
+ publicName: "showVideo",
7828
+ isSignal: true,
7829
+ isRequired: false,
7830
+ transformFunction: null
7831
+ },
7300
7832
  attachmentsAndScheduling: {
7301
7833
  classPropertyName: "attachmentsAndScheduling",
7302
7834
  publicName: "attachmentsAndScheduling",
@@ -7447,19 +7979,29 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7447
7979
  mapFieldsClick: "mapFieldsClick",
7448
7980
  phoneAdded: "phoneAdded"
7449
7981
  },
7450
- viewQueries: [{
7451
- propertyName: "sendEmailRef",
7452
- first: true,
7453
- predicate: ["sendEmailRef"],
7454
- descendants: true,
7455
- isSignal: true
7456
- }, {
7457
- propertyName: "sendTextRef",
7458
- first: true,
7459
- predicate: ["sendTextRef"],
7460
- descendants: true,
7461
- isSignal: true
7462
- }],
7982
+ viewQueries: [
7983
+ {
7984
+ propertyName: "sendEmailRef",
7985
+ first: true,
7986
+ predicate: ["sendEmailRef"],
7987
+ descendants: true,
7988
+ isSignal: true
7989
+ },
7990
+ {
7991
+ propertyName: "sendTextRef",
7992
+ first: true,
7993
+ predicate: ["sendTextRef"],
7994
+ descendants: true,
7995
+ isSignal: true
7996
+ },
7997
+ {
7998
+ propertyName: "sendInAppRef",
7999
+ first: true,
8000
+ predicate: ["sendInAppRef"],
8001
+ descendants: true,
8002
+ isSignal: true
8003
+ }
8004
+ ],
7463
8005
  ngImport: i0,
7464
8006
  template: `
7465
8007
  <ui-side-panel
@@ -7467,7 +8009,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7467
8009
  [title]="title()"
7468
8010
  [wide]="wide()"
7469
8011
  cancelLabel="Cancel"
7470
- [primaryLabel]="!loading() && activeContact() ? (sendLabel() || (channel() === 'email' ? 'Send Email' : 'Send Text')) : ''"
8012
+ [primaryLabel]="!loading() && activeContact() ? (sendLabel() || (inApp() ? 'Send Message' : channel() === 'email' ? 'Send Email' : 'Send Text')) : ''"
7471
8013
  primaryVariant="warning"
7472
8014
  [primaryDisabled]="!valid()"
7473
8015
  (closed)="onClose()"
@@ -7481,7 +8023,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7481
8023
  </div>
7482
8024
  }
7483
8025
 
7484
- @if (!loading() && !activeContact()) {
8026
+ @if (!loading() && !activeContact() && !inApp()) {
7485
8027
  <div class="msg-step">
7486
8028
  <span class="msg-step-badge">1</span>
7487
8029
  <span class="msg-step-text">Who would you like to message?</span>
@@ -7492,7 +8034,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7492
8034
  }
7493
8035
 
7494
8036
  @if (!loading() && activeContact()) {
7495
- @if (textEnabled() && activeContact()?.smsOptedIn) {
8037
+ @if (!inApp() && textEnabled() && activeContact()?.smsOptedIn) {
7496
8038
  <div class="msg-channel-row">
7497
8039
  <label class="form-label msg-via-label">Send via</label>
7498
8040
  <div class="msg-via-tabs">
@@ -7530,7 +8072,19 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7530
8072
 
7531
8073
  <!-- Keyed on formEpoch: a fresh open or another contact gets brand-new forms (no stale draft / template). -->
7532
8074
  @for (epoch of [formEpoch()]; track epoch) {
7533
- @if (channel() === 'email') {
8075
+ @if (inApp()) {
8076
+ <ui-send-in-app
8077
+ #sendInAppRef
8078
+ [contactName]="activeContact()!.name"
8079
+ [contactId]="activeContact()!.id"
8080
+ [defaultSubject]="defaultSubject()"
8081
+ [defaultBody]="defaultBody()"
8082
+ [showSubject]="showSubject()"
8083
+ [maxLength]="maxBodyLength()"
8084
+ [sendFn]="sendMessage()"
8085
+ (sent)="onSent()"
8086
+ (validChange)="valid.set($event)" />
8087
+ } @else if (channel() === 'email') {
7534
8088
  <ui-send-email
7535
8089
  #sendEmailRef
7536
8090
  [contactName]="activeContact()!.name"
@@ -7562,6 +8116,9 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7562
8116
  [videoDefaults]="videoDefaults()"
7563
8117
  [showCc]="showCc()"
7564
8118
  [attachmentsAndScheduling]="attachmentsAndScheduling()"
8119
+ [showSubject]="showSubject()"
8120
+ [showTemplates]="showTemplates()"
8121
+ [showVideo]="showVideo()"
7565
8122
  (sent)="onSent()"
7566
8123
  (emailAdded)="onEmailAdded($event)"
7567
8124
  (validChange)="valid.set($event)" />
@@ -7589,6 +8146,8 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7589
8146
  (rejected)="rejected.emit()"
7590
8147
  [documentPreview]="documentPreview()"
7591
8148
  [videoDefaults]="videoDefaults()"
8149
+ [showTemplates]="showTemplates()"
8150
+ [showVideo]="showVideo()"
7592
8151
  (sent)="onSent()"
7593
8152
  (phoneAdded)="onPhoneAdded($event)"
7594
8153
  (validChange)="valid.set($event)" />
@@ -7665,7 +8224,10 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7665
8224
  "docuSignConnected",
7666
8225
  "documentPreview",
7667
8226
  "videoDefaults",
7668
- "attachmentsAndScheduling"
8227
+ "attachmentsAndScheduling",
8228
+ "showSubject",
8229
+ "showTemplates",
8230
+ "showVideo"
7669
8231
  ],
7670
8232
  outputs: [
7671
8233
  "sent",
@@ -7675,6 +8237,21 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7675
8237
  "mapFieldsClick"
7676
8238
  ]
7677
8239
  },
8240
+ {
8241
+ kind: "component",
8242
+ type: SendInAppComponent,
8243
+ selector: "ui-send-in-app",
8244
+ inputs: [
8245
+ "contactName",
8246
+ "contactId",
8247
+ "defaultSubject",
8248
+ "defaultBody",
8249
+ "showSubject",
8250
+ "maxLength",
8251
+ "sendFn"
8252
+ ],
8253
+ outputs: ["sent", "validChange"]
8254
+ },
7678
8255
  {
7679
8256
  kind: "component",
7680
8257
  type: SendTextComponent,
@@ -7690,6 +8267,8 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
7690
8267
  "documentSentMessage",
7691
8268
  "documents",
7692
8269
  "attachmentsAndScheduling",
8270
+ "showTemplates",
8271
+ "showVideo",
7693
8272
  "documentPurposes",
7694
8273
  "initialDocuments",
7695
8274
  "documentSigners",
@@ -7781,6 +8360,7 @@ i0.ɵɵngDeclareClassMetadata({
7781
8360
  SidePanelComponent,
7782
8361
  ToggleBadgeComponent,
7783
8362
  SendEmailComponent,
8363
+ SendInAppComponent,
7784
8364
  SendTextComponent,
7785
8365
  ContactPickerComponent,
7786
8366
  ComboboxComponent
@@ -7791,7 +8371,7 @@ i0.ɵɵngDeclareClassMetadata({
7791
8371
  [title]="title()"
7792
8372
  [wide]="wide()"
7793
8373
  cancelLabel="Cancel"
7794
- [primaryLabel]="!loading() && activeContact() ? (sendLabel() || (channel() === 'email' ? 'Send Email' : 'Send Text')) : ''"
8374
+ [primaryLabel]="!loading() && activeContact() ? (sendLabel() || (inApp() ? 'Send Message' : channel() === 'email' ? 'Send Email' : 'Send Text')) : ''"
7795
8375
  primaryVariant="warning"
7796
8376
  [primaryDisabled]="!valid()"
7797
8377
  (closed)="onClose()"
@@ -7805,7 +8385,7 @@ i0.ɵɵngDeclareClassMetadata({
7805
8385
  </div>
7806
8386
  }
7807
8387
 
7808
- @if (!loading() && !activeContact()) {
8388
+ @if (!loading() && !activeContact() && !inApp()) {
7809
8389
  <div class="msg-step">
7810
8390
  <span class="msg-step-badge">1</span>
7811
8391
  <span class="msg-step-text">Who would you like to message?</span>
@@ -7816,7 +8396,7 @@ i0.ɵɵngDeclareClassMetadata({
7816
8396
  }
7817
8397
 
7818
8398
  @if (!loading() && activeContact()) {
7819
- @if (textEnabled() && activeContact()?.smsOptedIn) {
8399
+ @if (!inApp() && textEnabled() && activeContact()?.smsOptedIn) {
7820
8400
  <div class="msg-channel-row">
7821
8401
  <label class="form-label msg-via-label">Send via</label>
7822
8402
  <div class="msg-via-tabs">
@@ -7854,7 +8434,19 @@ i0.ɵɵngDeclareClassMetadata({
7854
8434
 
7855
8435
  <!-- Keyed on formEpoch: a fresh open or another contact gets brand-new forms (no stale draft / template). -->
7856
8436
  @for (epoch of [formEpoch()]; track epoch) {
7857
- @if (channel() === 'email') {
8437
+ @if (inApp()) {
8438
+ <ui-send-in-app
8439
+ #sendInAppRef
8440
+ [contactName]="activeContact()!.name"
8441
+ [contactId]="activeContact()!.id"
8442
+ [defaultSubject]="defaultSubject()"
8443
+ [defaultBody]="defaultBody()"
8444
+ [showSubject]="showSubject()"
8445
+ [maxLength]="maxBodyLength()"
8446
+ [sendFn]="sendMessage()"
8447
+ (sent)="onSent()"
8448
+ (validChange)="valid.set($event)" />
8449
+ } @else if (channel() === 'email') {
7858
8450
  <ui-send-email
7859
8451
  #sendEmailRef
7860
8452
  [contactName]="activeContact()!.name"
@@ -7886,6 +8478,9 @@ i0.ɵɵngDeclareClassMetadata({
7886
8478
  [videoDefaults]="videoDefaults()"
7887
8479
  [showCc]="showCc()"
7888
8480
  [attachmentsAndScheduling]="attachmentsAndScheduling()"
8481
+ [showSubject]="showSubject()"
8482
+ [showTemplates]="showTemplates()"
8483
+ [showVideo]="showVideo()"
7889
8484
  (sent)="onSent()"
7890
8485
  (emailAdded)="onEmailAdded($event)"
7891
8486
  (validChange)="valid.set($event)" />
@@ -7913,6 +8508,8 @@ i0.ɵɵngDeclareClassMetadata({
7913
8508
  (rejected)="rejected.emit()"
7914
8509
  [documentPreview]="documentPreview()"
7915
8510
  [videoDefaults]="videoDefaults()"
8511
+ [showTemplates]="showTemplates()"
8512
+ [showVideo]="showVideo()"
7916
8513
  (sent)="onSent()"
7917
8514
  (phoneAdded)="onPhoneAdded($event)"
7918
8515
  (validChange)="valid.set($event)" />
@@ -8063,6 +8660,54 @@ i0.ɵɵngDeclareClassMetadata({
8063
8660
  required: false
8064
8661
  }]
8065
8662
  }],
8663
+ recipientMode: [{
8664
+ type: i0.Input,
8665
+ args: [{
8666
+ isSignal: true,
8667
+ alias: "recipientMode",
8668
+ required: false
8669
+ }]
8670
+ }],
8671
+ sendMessage: [{
8672
+ type: i0.Input,
8673
+ args: [{
8674
+ isSignal: true,
8675
+ alias: "sendMessage",
8676
+ required: false
8677
+ }]
8678
+ }],
8679
+ maxBodyLength: [{
8680
+ type: i0.Input,
8681
+ args: [{
8682
+ isSignal: true,
8683
+ alias: "maxBodyLength",
8684
+ required: false
8685
+ }]
8686
+ }],
8687
+ showSubject: [{
8688
+ type: i0.Input,
8689
+ args: [{
8690
+ isSignal: true,
8691
+ alias: "showSubject",
8692
+ required: false
8693
+ }]
8694
+ }],
8695
+ showTemplates: [{
8696
+ type: i0.Input,
8697
+ args: [{
8698
+ isSignal: true,
8699
+ alias: "showTemplates",
8700
+ required: false
8701
+ }]
8702
+ }],
8703
+ showVideo: [{
8704
+ type: i0.Input,
8705
+ args: [{
8706
+ isSignal: true,
8707
+ alias: "showVideo",
8708
+ required: false
8709
+ }]
8710
+ }],
8066
8711
  attachmentsAndScheduling: [{
8067
8712
  type: i0.Input,
8068
8713
  args: [{
@@ -8258,6 +8903,10 @@ i0.ɵɵngDeclareClassMetadata({
8258
8903
  sendTextRef: [{
8259
8904
  type: i0.ViewChild,
8260
8905
  args: ["sendTextRef", { isSignal: true }]
8906
+ }],
8907
+ sendInAppRef: [{
8908
+ type: i0.ViewChild,
8909
+ args: ["sendInAppRef", { isSignal: true }]
8261
8910
  }]
8262
8911
  }
8263
8912
  });