@adlfe/campaign-management-library 2.13.1 → 2.14.1

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 (20) hide show
  1. package/bundles/adlfe-campaign-management-library.umd.js +69 -65
  2. package/bundles/adlfe-campaign-management-library.umd.js.map +1 -1
  3. package/bundles/adlfe-campaign-management-library.umd.min.js +1 -1
  4. package/bundles/adlfe-campaign-management-library.umd.min.js.map +1 -1
  5. package/esm2015/environments/environment.js +3 -3
  6. package/esm2015/lib/campaign-management/models/general-information-wa-req.model.js +15 -27
  7. package/esm2015/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +41 -32
  8. package/esm2015/lib/campaign-management/modules/new-campaign/general-information/general-information.component.js +1 -2
  9. package/esm2015/lib/campaign-management/modules/new-campaign/new-number-bases/new-number-bases.component.js +14 -6
  10. package/esm5/environments/environment.js +3 -3
  11. package/esm5/lib/campaign-management/models/general-information-wa-req.model.js +15 -27
  12. package/esm5/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +41 -32
  13. package/esm5/lib/campaign-management/modules/new-campaign/general-information/general-information.component.js +1 -2
  14. package/esm5/lib/campaign-management/modules/new-campaign/new-number-bases/new-number-bases.component.js +14 -6
  15. package/fesm2015/adlfe-campaign-management-library.js +69 -65
  16. package/fesm2015/adlfe-campaign-management-library.js.map +1 -1
  17. package/fesm5/adlfe-campaign-management-library.js +69 -65
  18. package/fesm5/adlfe-campaign-management-library.js.map +1 -1
  19. package/lib/campaign-management/models/general-information-wa-req.model.d.ts +0 -5
  20. package/package.json +1 -1
@@ -992,11 +992,11 @@
992
992
  }
993
993
  // 4. Cek Demo Dev secara spesifik
994
994
  else if (origin.includes('demo-dev')) {
995
- API_CONST = 'https://api-staging.neuapix.com';
995
+ API_CONST = 'https://apibsp-dev.adlsandbox.net';
996
996
  }
997
997
  // 5. Default (Localhost atau lainnya)
998
998
  else {
999
- API_CONST = 'https://api-staging.neuapix.com';
999
+ API_CONST = 'https://apibsp-dev.adlsandbox.net';
1000
1000
  }
1001
1001
  var environment = {
1002
1002
  production: false,
@@ -2686,7 +2686,7 @@
2686
2686
  function GeneralInformationWAReqModel() {
2687
2687
  }
2688
2688
  GeneralInformationWAReqModel.prototype.clone = function (source) {
2689
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2689
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2690
2690
  if (((_a = source) === null || _a === void 0 ? void 0 : _a.media) === 'IMAGE' ||
2691
2691
  ((_b = source) === null || _b === void 0 ? void 0 : _b.media) === 'VIDEO' ||
2692
2692
  ((_c = source) === null || _c === void 0 ? void 0 : _c.media) === 'DOCUMENT') {
@@ -2723,12 +2723,6 @@
2723
2723
  fileName: source.fileName,
2724
2724
  };
2725
2725
  }
2726
- if (source.buttonParams && Array.isArray(source.buttonParams)) {
2727
- this.buttonParams = source.buttonParams.map(function (btn) { return ({
2728
- label: btn.label,
2729
- payload: btn.payload ? btn.payload : btn.label,
2730
- }); });
2731
- }
2732
2726
  if (source.template) {
2733
2727
  this.template = {
2734
2728
  id: source.template.ID,
@@ -2738,19 +2732,15 @@
2738
2732
  header: (_g = (_f = source.paramHeader) === null || _f === void 0 ? void 0 : _f.map(function (t) { return t.name; }), (_g !== null && _g !== void 0 ? _g : [])),
2739
2733
  data: ((_h = source.variables) === null || _h === void 0 ? void 0 : _h.length) ? source.variables.map(function (v) { return v.paramName; })
2740
2734
  : (_k = (_j = source.paramBody) === null || _j === void 0 ? void 0 : _j.map(function (t) { return t.name; }), (_k !== null && _k !== void 0 ? _k : [])),
2741
- button: (_l = source.paramButton) === null || _l === void 0 ? void 0 : _l.reduce(function (result, each) {
2742
- var _a;
2743
- result.push((_a = each.name.map(function (t) { return t.name; }), (_a !== null && _a !== void 0 ? _a : [])));
2744
- return result;
2745
- }, []),
2746
- buttonParams: source.buttonParams
2747
- ? source.buttonParams.map(function (btn) {
2748
- return {
2749
- label: btn.label,
2750
- payload: btn.payload ? btn.payload : btn.label,
2751
- };
2752
- })
2753
- : [],
2735
+ button: source.buttonParams && source.buttonParams.length > 0
2736
+ ? source.buttonParams.map(function (btn) { return [
2737
+ btn.payload ? btn.payload : btn.label,
2738
+ ]; })
2739
+ : (_m = (_l = source.paramButton) === null || _l === void 0 ? void 0 : _l.reduce(function (result, each) {
2740
+ var _a;
2741
+ result.push((_a = each.name.map(function (t) { return t.name; }), (_a !== null && _a !== void 0 ? _a : [])));
2742
+ return result;
2743
+ }, []), (_m !== null && _m !== void 0 ? _m : [])),
2754
2744
  };
2755
2745
  if (source.template.category === 'AUTHENTICATION')
2756
2746
  this.template = {
@@ -2759,7 +2749,6 @@
2759
2749
  header: null,
2760
2750
  data: [source.otpValue],
2761
2751
  button: [[source.otpValue]],
2762
- buttonParams: [],
2763
2752
  };
2764
2753
  if (source.template.ID)
2765
2754
  this.template.id = source.template.ID;
@@ -2767,9 +2756,9 @@
2767
2756
  if (this.type === 'utility') {
2768
2757
  this.type = 'template';
2769
2758
  this.category = 'utility';
2770
- var mappedVariables = ((_o = (_m = source) === null || _m === void 0 ? void 0 : _m.variables) === null || _o === void 0 ? void 0 : _o.length) ? source.variables.map(function (v) { return v.paramName; })
2759
+ var mappedVariables = ((_p = (_o = source) === null || _o === void 0 ? void 0 : _o.variables) === null || _p === void 0 ? void 0 : _p.length) ? source.variables.map(function (v) { return v.paramName; })
2771
2760
  : [];
2772
- if ((_p = source) === null || _p === void 0 ? void 0 : _p.isUseExistingTemplate) {
2761
+ if ((_q = source) === null || _q === void 0 ? void 0 : _q.isUseExistingTemplate) {
2773
2762
  this.template = __assign(__assign({}, source.template), { data: mappedVariables.length > 0 ? mappedVariables : source.template.data || [] });
2774
2763
  }
2775
2764
  else {
@@ -2779,13 +2768,12 @@
2779
2768
  header: null,
2780
2769
  button: null,
2781
2770
  data: mappedVariables,
2782
- buttonParams: [],
2783
2771
  };
2784
2772
  }
2785
2773
  this.isNeedSave = source.isNeedSave;
2786
2774
  this.ttlSeconds = source.ttl;
2787
- if ((_q = source) === null || _q === void 0 ? void 0 : _q.isUseExistingTemplate) {
2788
- this.text = ((_r = source) === null || _r === void 0 ? void 0 : _r.text) || ((_u = (_t = (_s = source) === null || _s === void 0 ? void 0 : _s.template) === null || _t === void 0 ? void 0 : _t.body) === null || _u === void 0 ? void 0 : _u.text);
2775
+ if ((_r = source) === null || _r === void 0 ? void 0 : _r.isUseExistingTemplate) {
2776
+ this.text = ((_s = source) === null || _s === void 0 ? void 0 : _s.text) || ((_v = (_u = (_t = source) === null || _t === void 0 ? void 0 : _t.template) === null || _u === void 0 ? void 0 : _u.body) === null || _v === void 0 ? void 0 : _v.text);
2789
2777
  }
2790
2778
  }
2791
2779
  return this;
@@ -4396,6 +4384,7 @@
4396
4384
  ((_c = formValues) === null || _c === void 0 ? void 0 : _c.medium) !== 'WA') {
4397
4385
  return;
4398
4386
  }
4387
+ console.log(formValues, 'formValues');
4399
4388
  (_d = this.getControl('channel')) === null || _d === void 0 ? void 0 : _d.setValue((_e = formValues) === null || _e === void 0 ? void 0 : _e.channel);
4400
4389
  (_f = this.getControl('media')) === null || _f === void 0 ? void 0 : _f.setValue((_g = formValues) === null || _g === void 0 ? void 0 : _g.media);
4401
4390
  (_h = this.getControl('from')) === null || _h === void 0 ? void 0 : _h.setValue((_j = formValues) === null || _j === void 0 ? void 0 : _j.from);
@@ -4576,6 +4565,7 @@
4576
4565
  this.initParam('pageNo', this.pageNoTemplateOption, 'number'),
4577
4566
  this.initParam('rowPerPage', 20, 'number'),
4578
4567
  this.initParam('platform', 'WA', 'string'),
4568
+ this.initParam('templateType', 'all', 'string'),
4579
4569
  this.initParam('filter', filter, 'string'),
4580
4570
  this.initParam('status', 'APPROVED', 'string'),
4581
4571
  this.initParam('clientId', (_c = (_b = (_a = this.getControl('from')) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.clientId, (_c !== null && _c !== void 0 ? _c : '')), 'string'),
@@ -4778,7 +4768,8 @@
4778
4768
  };
4779
4769
  Object.defineProperty(GeneralInformationWAComponent.prototype, "buttonParamsControls", {
4780
4770
  get: function () {
4781
- return this.form.get('buttonParams').controls;
4771
+ var control = this.form.get('buttonParams');
4772
+ return control ? control.controls : [];
4782
4773
  },
4783
4774
  enumerable: true,
4784
4775
  configurable: true
@@ -4793,66 +4784,72 @@
4793
4784
  });
4794
4785
  GeneralInformationWAComponent.prototype.updateTemplate = function (template) {
4795
4786
  var _this = this;
4796
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34;
4787
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35;
4797
4788
  this.isShowParameter = false;
4798
4789
  if (!template)
4799
4790
  return;
4791
+ var formStorage = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.generalInformation) === null || _b === void 0 ? void 0 : _b.form;
4792
+ var savedButtonParams = ((_c = formStorage) === null || _c === void 0 ? void 0 : _c.buttonParams) || [];
4800
4793
  var buttonParamsArray = this.form.get('buttonParams');
4801
4794
  buttonParamsArray.clear();
4802
4795
  if (template && template.buttons && template.buttons.length > 0) {
4803
4796
  var quickReplyButtons = template.buttons.filter(function (btn) { return btn.type === 'QUICK_REPLY'; });
4804
- quickReplyButtons.forEach(function (btn) {
4797
+ quickReplyButtons.forEach(function (btn, index) {
4798
+ var _a;
4799
+ var existingPayload = ((_a = savedButtonParams[index]) === null || _a === void 0 ? void 0 : _a.payload) || '';
4805
4800
  buttonParamsArray.push(new forms.FormGroup({
4806
4801
  label: new forms.FormControl(btn.text),
4807
- payload: new forms.FormControl('', [forms.Validators.maxLength(256)]),
4802
+ payload: new forms.FormControl({
4803
+ value: existingPayload,
4804
+ disabled: _this.isReadOnlyMode,
4805
+ }, [forms.Validators.maxLength(256)]),
4808
4806
  }));
4809
4807
  });
4810
4808
  }
4811
4809
  this.isHaveTemplateParam =
4812
- (_c = (_b = (_a = template.header) === null || _a === void 0 ? void 0 : _a.examples) === null || _b === void 0 ? void 0 : _b.length, (_c !== null && _c !== void 0 ? _c : 0)) > 0 ||
4813
- (_f = (_e = (_d = template.body) === null || _d === void 0 ? void 0 : _d.examples) === null || _e === void 0 ? void 0 : _e.length, (_f !== null && _f !== void 0 ? _f : 0)) > 0 ||
4814
- (_h = (_g = template.buttons) === null || _g === void 0 ? void 0 : _g.length, (_h !== null && _h !== void 0 ? _h : 0)) > 0;
4815
- if (['image', 'video', 'document'].includes((_l = (_k = (_j = template) === null || _j === void 0 ? void 0 : _j.header) === null || _k === void 0 ? void 0 : _k.type) === null || _l === void 0 ? void 0 : _l.toLowerCase())) {
4816
- (_m = this.getControl('fileName')) === null || _m === void 0 ? void 0 : _m.setValue((_t = (_q = (_p = (_o = this.getCampaignStorage) === null || _o === void 0 ? void 0 : _o.generalInformation) === null || _p === void 0 ? void 0 : _p.form.fileName, (_q !== null && _q !== void 0 ? _q : (_s = (_r = this.getCampaignStorage) === null || _r === void 0 ? void 0 : _r.generalInformation) === null || _s === void 0 ? void 0 : _s.form.targetURL)), (_t !== null && _t !== void 0 ? _t : template.header.url)));
4817
- (_u = this.getControl('targetURL')) === null || _u === void 0 ? void 0 : _u.setValue((_x = (_w = (_v = this.getCampaignStorage) === null || _v === void 0 ? void 0 : _v.generalInformation) === null || _w === void 0 ? void 0 : _w.form.targetURL, (_x !== null && _x !== void 0 ? _x : template.header.url)));
4818
- this.fileTypeChange((_0 = (_z = (_y = template) === null || _y === void 0 ? void 0 : _y.header) === null || _z === void 0 ? void 0 : _z.type) === null || _0 === void 0 ? void 0 : _0.toLowerCase());
4819
- }
4820
- (_2 = (_1 = template.header.examples) === null || _1 === void 0 ? void 0 : _1.length, (_2 !== null && _2 !== void 0 ? _2 : 0)) > 0
4821
- ? (_3 = this.getControl('paramHeader')) === null || _3 === void 0 ? void 0 : _3.setValidators(forms.Validators.required) : (_4 = this.getControl('paramHeader')) === null || _4 === void 0 ? void 0 : _4.clearValidators();
4822
- (_6 = (_5 = template.body.examples) === null || _5 === void 0 ? void 0 : _5.length, (_6 !== null && _6 !== void 0 ? _6 : 0)) > 0
4823
- ? (_7 = this.getControl('paramBody')) === null || _7 === void 0 ? void 0 : _7.setValidators(forms.Validators.required) : (_8 = this.getControl('paramBody')) === null || _8 === void 0 ? void 0 : _8.clearValidators();
4824
- (_10 = (_9 = template.buttons) === null || _9 === void 0 ? void 0 : _9.length, (_10 !== null && _10 !== void 0 ? _10 : 0)) > 0
4825
- ? (_11 = this.getControl('paramButton')) === null || _11 === void 0 ? void 0 : _11.setValidators(forms.Validators.required) : (_12 = this.getControl('paramButton')) === null || _12 === void 0 ? void 0 : _12.clearValidators();
4810
+ (_f = (_e = (_d = template.header) === null || _d === void 0 ? void 0 : _d.examples) === null || _e === void 0 ? void 0 : _e.length, (_f !== null && _f !== void 0 ? _f : 0)) > 0 ||
4811
+ (_j = (_h = (_g = template.body) === null || _g === void 0 ? void 0 : _g.examples) === null || _h === void 0 ? void 0 : _h.length, (_j !== null && _j !== void 0 ? _j : 0)) > 0 ||
4812
+ (_l = (_k = template.buttons) === null || _k === void 0 ? void 0 : _k.length, (_l !== null && _l !== void 0 ? _l : 0)) > 0;
4813
+ if (['image', 'video', 'document'].includes((_p = (_o = (_m = template) === null || _m === void 0 ? void 0 : _m.header) === null || _o === void 0 ? void 0 : _o.type) === null || _p === void 0 ? void 0 : _p.toLowerCase())) {
4814
+ (_q = this.getControl('fileName')) === null || _q === void 0 ? void 0 : _q.setValue((_w = (_t = (_s = (_r = this.getCampaignStorage) === null || _r === void 0 ? void 0 : _r.generalInformation) === null || _s === void 0 ? void 0 : _s.form.fileName, (_t !== null && _t !== void 0 ? _t : (_v = (_u = this.getCampaignStorage) === null || _u === void 0 ? void 0 : _u.generalInformation) === null || _v === void 0 ? void 0 : _v.form.targetURL)), (_w !== null && _w !== void 0 ? _w : template.header.url)));
4815
+ (_x = this.getControl('targetURL')) === null || _x === void 0 ? void 0 : _x.setValue((_0 = (_z = (_y = this.getCampaignStorage) === null || _y === void 0 ? void 0 : _y.generalInformation) === null || _z === void 0 ? void 0 : _z.form.targetURL, (_0 !== null && _0 !== void 0 ? _0 : template.header.url)));
4816
+ this.fileTypeChange((_3 = (_2 = (_1 = template) === null || _1 === void 0 ? void 0 : _1.header) === null || _2 === void 0 ? void 0 : _2.type) === null || _3 === void 0 ? void 0 : _3.toLowerCase());
4817
+ }
4818
+ (_5 = (_4 = template.header.examples) === null || _4 === void 0 ? void 0 : _4.length, (_5 !== null && _5 !== void 0 ? _5 : 0)) > 0
4819
+ ? (_6 = this.getControl('paramHeader')) === null || _6 === void 0 ? void 0 : _6.setValidators(forms.Validators.required) : (_7 = this.getControl('paramHeader')) === null || _7 === void 0 ? void 0 : _7.clearValidators();
4820
+ (_9 = (_8 = template.body.examples) === null || _8 === void 0 ? void 0 : _8.length, (_9 !== null && _9 !== void 0 ? _9 : 0)) > 0
4821
+ ? (_10 = this.getControl('paramBody')) === null || _10 === void 0 ? void 0 : _10.setValidators(forms.Validators.required) : (_11 = this.getControl('paramBody')) === null || _11 === void 0 ? void 0 : _11.clearValidators();
4822
+ (_13 = (_12 = template.buttons) === null || _12 === void 0 ? void 0 : _12.length, (_13 !== null && _13 !== void 0 ? _13 : 0)) > 0
4823
+ ? (_14 = this.getControl('paramButton')) === null || _14 === void 0 ? void 0 : _14.setValidators(forms.Validators.required) : (_15 = this.getControl('paramButton')) === null || _15 === void 0 ? void 0 : _15.clearValidators();
4826
4824
  this.form.get('paramHeader').controls = [];
4827
4825
  this.form.get('paramHeader').reset();
4828
- (_13 = this.getControl('paramHeader')) === null || _13 === void 0 ? void 0 : _13.updateValueAndValidity();
4826
+ (_16 = this.getControl('paramHeader')) === null || _16 === void 0 ? void 0 : _16.updateValueAndValidity();
4829
4827
  this.form.get('paramBody').controls = [];
4830
4828
  this.form.get('paramBody').reset();
4831
- (_14 = this.getControl('paramBody')) === null || _14 === void 0 ? void 0 : _14.updateValueAndValidity();
4829
+ (_17 = this.getControl('paramBody')) === null || _17 === void 0 ? void 0 : _17.updateValueAndValidity();
4832
4830
  this.form.get('paramButton').controls = [];
4833
4831
  this.form.get('paramButton').reset();
4834
- (_15 = this.getControl('paramButton')) === null || _15 === void 0 ? void 0 : _15.updateValueAndValidity();
4835
- (_16 = this.getControl('otpValue')) === null || _16 === void 0 ? void 0 : _16.setValue('');
4836
- (_17 = this.getControl('otpValue')) === null || _17 === void 0 ? void 0 : _17.clearValidators();
4837
- (_18 = this.getControl('otpValue')) === null || _18 === void 0 ? void 0 : _18.updateValueAndValidity();
4838
- var formStorage = (_20 = (_19 = this.getCampaignStorage) === null || _19 === void 0 ? void 0 : _19.generalInformation) === null || _20 === void 0 ? void 0 : _20.form;
4832
+ (_18 = this.getControl('paramButton')) === null || _18 === void 0 ? void 0 : _18.updateValueAndValidity();
4833
+ (_19 = this.getControl('otpValue')) === null || _19 === void 0 ? void 0 : _19.setValue('');
4834
+ (_20 = this.getControl('otpValue')) === null || _20 === void 0 ? void 0 : _20.clearValidators();
4835
+ (_21 = this.getControl('otpValue')) === null || _21 === void 0 ? void 0 : _21.updateValueAndValidity();
4839
4836
  if (template.category === 'AUTHENTICATION') {
4840
- (_21 = this.getControl('otpValue')) === null || _21 === void 0 ? void 0 : _21.setValue((_29 = (_23 = (_22 = formStorage) === null || _22 === void 0 ? void 0 : _22.otpValue, (_23 !== null && _23 !== void 0 ? _23 : (_28 = __spread((_27 = (_26 = (_25 = (_24 = formStorage) === null || _24 === void 0 ? void 0 : _24.template) === null || _25 === void 0 ? void 0 : _25.body) === null || _26 === void 0 ? void 0 : _26.examples, (_27 !== null && _27 !== void 0 ? _27 : [])))) === null || _28 === void 0 ? void 0 : _28.pop())), (_29 !== null && _29 !== void 0 ? _29 : '')));
4841
- (_30 = this.getControl('otpValue')) === null || _30 === void 0 ? void 0 : _30.setValidators(forms.Validators.required);
4842
- (_31 = this.getControl('otpValue')) === null || _31 === void 0 ? void 0 : _31.updateValueAndValidity();
4837
+ (_22 = this.getControl('otpValue')) === null || _22 === void 0 ? void 0 : _22.setValue((_30 = (_24 = (_23 = formStorage) === null || _23 === void 0 ? void 0 : _23.otpValue, (_24 !== null && _24 !== void 0 ? _24 : (_29 = __spread((_28 = (_27 = (_26 = (_25 = formStorage) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.body) === null || _27 === void 0 ? void 0 : _27.examples, (_28 !== null && _28 !== void 0 ? _28 : [])))) === null || _29 === void 0 ? void 0 : _29.pop())), (_30 !== null && _30 !== void 0 ? _30 : '')));
4838
+ (_31 = this.getControl('otpValue')) === null || _31 === void 0 ? void 0 : _31.setValidators(forms.Validators.required);
4839
+ (_32 = this.getControl('otpValue')) === null || _32 === void 0 ? void 0 : _32.updateValueAndValidity();
4843
4840
  }
4844
- (_32 = template.header.examples) === null || _32 === void 0 ? void 0 : _32.forEach(function (each, index) {
4841
+ (_33 = template.header.examples) === null || _33 === void 0 ? void 0 : _33.forEach(function (each, index) {
4845
4842
  var _a, _b, _c, _d, _e, _f, _g;
4846
4843
  _this.addParamHeader((_g = (_d = (_c = (_b = (_a = formStorage) === null || _a === void 0 ? void 0 : _a.paramHeader) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.name, (_d !== null && _d !== void 0 ? _d : (_f = (_e = formStorage) === null || _e === void 0 ? void 0 : _e.paramHeader) === null || _f === void 0 ? void 0 : _f[index])), (_g !== null && _g !== void 0 ? _g : '')));
4847
4844
  });
4848
- (_33 = template.body.examples) === null || _33 === void 0 ? void 0 : _33.forEach(function (each, index) {
4845
+ (_34 = template.body.examples) === null || _34 === void 0 ? void 0 : _34.forEach(function (each, index) {
4849
4846
  var _a, _b, _c, _d, _e, _f, _g;
4850
4847
  var paramValue = (_g = (_d = (_c = (_b = (_a = formStorage) === null || _a === void 0 ? void 0 : _a.paramBody) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.name, (_d !== null && _d !== void 0 ? _d : (_f = (_e = formStorage) === null || _e === void 0 ? void 0 : _e.paramBody) === null || _f === void 0 ? void 0 : _f[index])), (_g !== null && _g !== void 0 ? _g : ''));
4851
4848
  if (['$UnsubscribeAccount'].includes(each))
4852
4849
  paramValue = each;
4853
4850
  _this.addParamBody(paramValue);
4854
4851
  });
4855
- (_34 = template.buttons) === null || _34 === void 0 ? void 0 : _34.forEach(function (each, index) {
4852
+ (_35 = template.buttons) === null || _35 === void 0 ? void 0 : _35.forEach(function (each, index) {
4856
4853
  var _a, _b, _c, _d;
4857
4854
  _this.addParamButton();
4858
4855
  var button = _this.getButton;
@@ -5548,7 +5545,6 @@
5548
5545
  this.form.disable();
5549
5546
  };
5550
5547
  GeneralInformationComponent.prototype.updateGeneralInformationForm = function (form) {
5551
- console.log(form, 'form');
5552
5548
  this.generalInformationForm = form;
5553
5549
  this.isShowMore = false;
5554
5550
  this.generalInformation.emit({
@@ -5910,23 +5906,31 @@
5910
5906
  return found ? true : false;
5911
5907
  };
5912
5908
  NewNumberBasesComponent.prototype.onDownloadSampleService = function () {
5913
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
5909
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
5914
5910
  var genInfoForm = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.generalInformation) === null || _b === void 0 ? void 0 : _b.form;
5915
5911
  var isNeedSave = (_c = genInfoForm) === null || _c === void 0 ? void 0 : _c.isNeedSave;
5916
5912
  var parameterList = [
5917
5913
  this.initParam('platform', ((_e = (_d = genInfoForm) === null || _d === void 0 ? void 0 : _d.template) === null || _e === void 0 ? void 0 : _e.platform) || 'WA', 'string'),
5914
+ this.initParam('templateName', (_g = (_f = genInfoForm) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.name, 'string'),
5915
+ this.initParam('templateLang', (_j = (_h = genInfoForm) === null || _h === void 0 ? void 0 : _h.template) === null || _j === void 0 ? void 0 : _j.lang, 'string'),
5918
5916
  ];
5919
5917
  if (isNeedSave) {
5920
5918
  // SKENARIO 1: USE EXISTING / TEMPLATE SUDAH DISAVE
5921
- parameterList.push(this.initParam('templateName', (_g = (_f = genInfoForm) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.name, 'string'), this.initParam('templateLang', (_j = (_h = genInfoForm) === null || _h === void 0 ? void 0 : _h.template) === null || _j === void 0 ? void 0 : _j.lang, 'string'), this.initParam('category', (_l = (_k = this.categorySelected) === null || _k === void 0 ? void 0 : _k.map(function (t) { return t.id; }).join(), (_l !== null && _l !== void 0 ? _l : '')), 'string'));
5919
+ parameterList.push(this.initParam('category', (_l = (_k = this.categorySelected) === null || _k === void 0 ? void 0 : _k.map(function (t) { return t.id; }).join(), (_l !== null && _l !== void 0 ? _l : '')), 'string'));
5922
5920
  }
5923
5921
  else {
5924
- // SKENARIO 2: CREATE NEW (Belum disave, butuh text & examples)
5925
- parameterList.push(this.initParam('bodyText', (_m = genInfoForm) === null || _m === void 0 ? void 0 : _m.text, 'string'));
5922
+ // SKENARIO 2: CREATE NEW (Auto-generated dll)
5923
+ var safeBodyText = encodeURIComponent(((_m = genInfoForm) === null || _m === void 0 ? void 0 : _m.text) || '');
5924
+ parameterList.push(this.initParam('bodyText', safeBodyText, 'string'));
5926
5925
  var variables = (_o = genInfoForm) === null || _o === void 0 ? void 0 : _o.variables;
5927
5926
  if (variables && Array.isArray(variables) && variables.length > 0) {
5928
5927
  var bodyExamplesString = variables.map(function (v) { return v.paramName; }).join(',');
5929
- parameterList.push(this.initParam('bodyExamples', bodyExamplesString, 'string'));
5928
+ var safeBodyExamples = encodeURIComponent(bodyExamplesString);
5929
+ parameterList.push(this.initParam('bodyExamples', safeBodyExamples, 'string'));
5930
+ }
5931
+ if ((_r = (_q = (_p = genInfoForm) === null || _p === void 0 ? void 0 : _p.template) === null || _q === void 0 ? void 0 : _q.header) === null || _r === void 0 ? void 0 : _r.text) {
5932
+ var safeHeaderText = encodeURIComponent(genInfoForm.template.header.text);
5933
+ parameterList.push(this.initParam('headerText', safeHeaderText, 'string'));
5930
5934
  }
5931
5935
  }
5932
5936
  var subs = this.apiAdapterService