@creaditor/newsletter-starterkit 1.0.57 → 1.0.58

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 (37) hide show
  1. package/dist/1142.creaditor.bundle.js +1 -1
  2. package/dist/1142.creaditor.bundle.js.gz +0 -0
  3. package/dist/1260.creaditor.bundle.js +1 -1
  4. package/dist/1260.creaditor.bundle.js.gz +0 -0
  5. package/dist/1271.creaditor.bundle.js +1 -544
  6. package/dist/1271.creaditor.bundle.js.gz +0 -0
  7. package/dist/1529.creaditor.bundle.js +1 -1
  8. package/dist/1529.creaditor.bundle.js.gz +0 -0
  9. package/dist/170.creaditor.bundle.js +1 -1
  10. package/dist/170.creaditor.bundle.js.gz +0 -0
  11. package/dist/3521.creaditor.bundle.js +1 -1
  12. package/dist/3521.creaditor.bundle.js.gz +0 -0
  13. package/dist/3553.creaditor.bundle.js +1 -1
  14. package/dist/3553.creaditor.bundle.js.gz +0 -0
  15. package/dist/3847.creaditor.bundle.js +937 -21
  16. package/dist/3847.creaditor.bundle.js.gz +0 -0
  17. package/dist/5909.creaditor.bundle.js +1 -1
  18. package/dist/5909.creaditor.bundle.js.gz +0 -0
  19. package/dist/5926.creaditor.bundle.js +1 -1
  20. package/dist/5926.creaditor.bundle.js.gz +0 -0
  21. package/dist/7238.creaditor.bundle.js +1 -1
  22. package/dist/7238.creaditor.bundle.js.gz +0 -0
  23. package/dist/7654.creaditor.bundle.js +1 -1
  24. package/dist/7654.creaditor.bundle.js.gz +0 -0
  25. package/dist/8516.creaditor.bundle.js +1 -1
  26. package/dist/8516.creaditor.bundle.js.gz +0 -0
  27. package/dist/8547.creaditor.bundle.js +2 -2
  28. package/dist/8547.creaditor.bundle.js.gz +0 -0
  29. package/dist/9041.creaditor.bundle.js +1 -1
  30. package/dist/9041.creaditor.bundle.js.gz +0 -0
  31. package/dist/9994.creaditor.bundle.js +1 -1
  32. package/dist/9994.creaditor.bundle.js.gz +0 -0
  33. package/dist/creaditor.bundle.js +312 -193
  34. package/dist/creaditor.bundle.js.gz +0 -0
  35. package/dist/service-worker.js +1 -1
  36. package/dist/service-worker.js.gz +0 -0
  37. package/package.json +1 -1
@@ -1,34 +1,950 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3847],{13847:(e,t,s)=>{s.r(t),s.d(t,{ImageSkeleton:()=>r});var i=s(56666),n=s(21293);class r extends n.oi{constructor(){super()}render(){return n.dy` <div class="skeleton-item skeleton-image"></div>`}}(0,i.Z)(r,"styles",n.iv`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380,3847],{70380(t,e,i){i.r(e),i.d(e,{default:()=>p});var s=i(59929),o=i(21421),r=i(91597);const n="֑-߿יִ-﷽ﹰ-ﻼ",a="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",l=new RegExp("^[^"+a+"]*["+n+"]"),c=new RegExp("^[^"+n+"]*["+a+"]");var h=i(86319);const d=(0,r.S)();class p extends s.WF{constructor(){super(),this.inputRef=(0,o._)(),this.min=0,this.max=100,this.step=1,this.autofocus=!1,this.type="text",this.value="number"===this.type?"0":"",this.placeholder="",this.oldValue=this.value,this.successActive=!1,this._successTimeout=null}onSubmit(t){t.preventDefault();const e=new UIEvent("submit",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),this.oldValue=this.value}focus(){const t=this.inputRef.value;t.focus(),t.setSelectionRange(t.value.length,t.value.length)}onFocus(){const t=new UIEvent("focus",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}onBlur(){const t=new UIEvent("blur",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t),this.oldValue=this.value}render(){this.fullWidth&&(this.style.width="100%"),this.value||"text"!==this.type||(this.value=""),this.icon&&"string"!=typeof this.inputStyle&&(this.inputStyle="");const t=h.M.get("lang",this.placeholder)||this.placeholder||"";t&&("string"!=typeof this.inputStyle&&(this.inputStyle=""),-1===this.inputStyle.indexOf("text-align")&&(this.inputStyle+=";text-align:"+("rtl"===function(t){const e=String(t||"");return l.test(e)?"rtl":c.test(e)?"ltr":"neutral"}(t)?"right":"")));const e=this.multiline?s.qy` <textarea
2
+ row=${this.row||4}
3
+ .disabled=${this.disabled}
4
+ dir="auto"
5
+ ${(0,o.K)(this.inputRef)}
6
+ style="${this.inputStyle}"
7
+ .autofocus="${this.autofocus}"
8
+ .placeholder="${t}"
9
+ @input="${this.setValue}"
10
+ @change="${this.setValue}"
11
+ .min="${String(this.min)}"
12
+ .max="${String(this.max)}"
13
+ .step="${String(this.step)}"
14
+ .value="${String(this.value)}"
15
+ />`:s.qy` <input
16
+ .disabled=${this.disabled}
17
+ dir="auto"
18
+ ${(0,o.K)(this.inputRef)}
19
+ style="${this.inputStyle}"
20
+ .autofocus="${this.autofocus}"
21
+ .placeholder="${t}"
22
+ @input="${this.setValue}"
23
+ @change="${this.setValue}"
24
+ .min="${String(this.min)}"
25
+ .type="${this.type}"
26
+ .max="${String(this.max)}"
27
+ .step="${String(this.step)}"
28
+ .value="${String(this.value)}"
29
+ />`;return s.qy`<form @submit=${this.onSubmit}>
30
+ ${e}
31
+ ${!this.icon||this.couchOnEmpty||this.successActive?null:s.qy`<cdtr-icon
32
+ color="#d9d9d9"
33
+ width=${20}
34
+ height=${20}
35
+ style="position: absolute;
36
+ transform: translateY(-50%);top:50%;z-index:1;
37
+ left: 10px;"
38
+ icon="${this.icon}"
39
+ ></cdtr-icon>`}
40
+ ${this.successActive?s.qy`<div class="success-overlay" aria-live="polite">
41
+ <cdtr-couch-mark></cdtr-couch-mark>
42
+ <span class="success-icon">✓</span>
43
+ </div>`:null}
44
+ ${!this.couchOnEmpty||this.value||this.successActive?null:s.qy`<cdtr-couch-mark
45
+ style="position: absolute;
46
+ transform: translateY(-50%);
47
+ left: 0;"
48
+ ></cdtr-couch-mark>`}
49
+ ${"text"===this.type&&this.maxLength?s.qy`<span class="counter"
50
+ >${this.value.length}/${this.maxLength}</span
51
+ > `:null}
52
+ </form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const i=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(i),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};d.run(t,500)}}success(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null),this.successActive=!0;const e=Number(t);!Number.isFinite(e)||e<=0||(this._successTimeout=setTimeout(()=>{this.successActive=!1,this._successTimeout=null},e))}patch(t){this.value=t}}p.styles=s.AH`
2
53
  :host {
3
- display: block;
4
- width: 100%;
5
- height: 100%;
54
+ display: inline-block;
55
+ --cdtr-input-height: 30px;
56
+ --cdtr-input-padding: 0.105rem 0.45rem;
6
57
  }
7
- .skeleton-item {
8
- background: #e8e4f0;
9
- border-radius: 4px;
58
+
59
+ form {
10
60
  position: relative;
11
- overflow: hidden;
61
+ }
62
+ .counter {
63
+ font-size: 10px;
64
+ }
65
+ input,
66
+ textarea {
67
+ height: var(--cdtr-input-height);
68
+ display: inline-block;
12
69
  width: 100%;
13
- height: 100%;
70
+ padding: var(--cdtr-input-padding);
71
+ font-size: 14px;
72
+ font-weight: 400;
73
+ line-height: 1.5;
74
+ color: #212529;
75
+ background: #fff;
76
+ background-clip: padding-box;
77
+ border: 1px solid #ced4da;
78
+ -webkit-appearance: none;
79
+ -moz-appearance: none;
80
+ appearance: none;
81
+ border-radius: 0.25rem;
82
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
83
+ margin: 0;
84
+ font-family: var(--font-family);
85
+ border-color: var(--input-border-color);
86
+ outline: var(--input-border-color);
87
+ box-sizing: border-box;
88
+ }
89
+ textarea {
90
+ height: auto;
91
+ resize: none;
92
+ }
93
+ input:disabled,
94
+ textrea:disabled,
95
+ textareap[readonly],
96
+ input[readonly] {
97
+ background-color: #e9ecef;
98
+ opacity: 0.5;
99
+ }
100
+ input:hover,
101
+ textarea:hover {
102
+ border-color: black;
103
+ }
104
+ input::placeholder,
105
+ textarea::placeholder {
106
+ font-family: var(--font-family);
107
+ }
108
+ input:focus,
109
+ textarea:focus {
110
+ border-color: var(--primary);
111
+ }
112
+ input[type="number"] {
113
+ padding-right: 0px;
114
+ padding-left: 4px;
115
+ }
116
+
117
+ input[type="number"] {
118
+ -moz-appearance: textfield;
14
119
  }
15
- .skeleton-item::after {
16
- content: "";
120
+
121
+ .success-overlay {
17
122
  position: absolute;
18
- top: 0;
19
- left: 0;
20
- width: 100%;
21
- height: 100%;
22
- background: linear-gradient(90deg, #e8e4f0, #f0ecf8, #e8e4f0);
23
- animation: skeleton-shimmer 1.6s ease-in-out infinite;
123
+ top: 50%;
124
+ left: 4px;
125
+ transform: translateY(-50%);
126
+ width: 28px;
127
+ height: 28px;
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: center;
131
+ pointer-events: none;
132
+ z-index: 2;
24
133
  }
25
134
 
26
- @keyframes skeleton-shimmer {
135
+ .success-overlay cdtr-couch-mark {
136
+ position: absolute;
137
+ top: 50%;
138
+ left: 50%;
139
+ transform: translate(-50%, -50%) scale(0.75);
140
+ opacity: 0.85;
141
+ }
142
+
143
+ .success-overlay .success-icon {
144
+ position: absolute;
145
+ top: 50%;
146
+ left: 50%;
147
+ width: 20px;
148
+ height: 20px;
149
+ border-radius: 999px;
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ background: var(--primary);
154
+ color: #f6fff9;
155
+ font-size: 14px;
156
+ font-weight: 600;
157
+ transform: translate(-50%, -50%) scale(0.85);
158
+ opacity: 0;
159
+ animation: successPop 0.32s ease-out forwards;
160
+ box-shadow: 0 0 6px rgba(79, 192, 111, 0.25);
161
+ }
162
+
163
+ @keyframes successPop {
27
164
  0% {
28
- transform: translate3d(-100%, 0, 0);
165
+ transform: translate(-50%, -50%) scale(0.85);
166
+ opacity: 0;
167
+ }
168
+ 50% {
169
+ transform: translate(-50%, -50%) scale(1.05);
170
+ opacity: 1;
29
171
  }
30
172
  100% {
31
- transform: translate3d(100%, 0, 0);
173
+ transform: translate(-50%, -50%) scale(1);
174
+ opacity: 1;
175
+ }
176
+ }
177
+
178
+ @keyframes successGlow {
179
+ 0% {
180
+ box-shadow: 0 0 6px rgba(79, 192, 111, 0.25);
32
181
  }
182
+ 100% {
183
+ box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
184
+ }
185
+ }
186
+ `,p.properties={value:{type:String,reflect:!0},step:{type:Number,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},type:{type:String,reflect:!0},inputDir:{type:String},icon:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autofocus:{type:Boolean,reflect:!0},fullWidth:{type:Boolean,reflect:!0},selectionStart:{type:Number},inputStyle:{type:String,reflect:!0},maxLength:{type:Number},couchOnEmpty:{type:Boolean},disabled:{type:Boolean},multiline:{type:Boolean},row:{type:Number},successActive:{type:Boolean}},customElements.get("cdtr-input")||customElements.define("cdtr-input",p)},73847(t,e,i){i.r(e),i.d(e,{LinkElement:()=>C});var s=i(59929),o=i(86319),r=i(88385);const n=s.AH`
187
+ :host {
188
+ --paper-radio-button-checked-color: var(--primary);
189
+ box-sizing: border-box;
190
+ }
191
+ .anchor-dd {
192
+ width: 100%;
193
+ }
194
+ .anchor-create {
195
+ width: 100%;
196
+ margin-top: 10px;
197
+ text-align: var(--text-align-locale);
198
+ direction: var(--direction-locale);
199
+ }
200
+ /* Drag source for the anchor element — grabbed by the editor DnD engine. */
201
+ .anchor-drag {
202
+ display: flex;
203
+ align-items: center;
204
+ gap: 8px;
205
+ padding: 10px;
206
+ border: 1px dashed var(--primary, #484553);
207
+ border-radius: 6px;
208
+ background: rgba(0, 0, 0, 0.02);
209
+ color: var(--primary, #484553);
210
+ cursor: grab;
211
+ user-select: none;
212
+ transition: background 0.2s, box-shadow 0.2s;
213
+ }
214
+ .anchor-drag:hover {
215
+ background: rgba(0, 0, 0, 0.05);
216
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
217
+ }
218
+ .anchor-drag:active {
219
+ cursor: grabbing;
220
+ }
221
+ .anchor-drag svg {
222
+ width: 20px;
223
+ height: 20px;
224
+ flex: 0 0 auto;
225
+ pointer-events: none;
226
+ }
227
+ .anchor-drag-label {
228
+ font-size: 13px;
229
+ line-height: 1.3;
230
+ pointer-events: none;
231
+ }
232
+ .anchor-drag-hint {
233
+ display: block;
234
+ margin-top: 6px;
235
+ font-size: 11px;
236
+ line-height: 1.4;
237
+ color: var(--micro-info-color, #00000080);
238
+ }
239
+ cdtr-add-icon {
240
+ --cdtr-icon-width: 16px;
241
+ --cdtr-icon-height: 16px;
242
+ --cdtr-icon-color: var(--dark);
243
+ }
244
+ cdtr-row {
245
+ direction: var(--direction-locale);
246
+ }
247
+ paper-radio-button {
248
+ padding: 0;
249
+ display: flex;
250
+ gap: 5px;
251
+ margin-top: 8px;
252
+ }
253
+ .add-button {
254
+ background: var(--primary);
255
+ color: #fff;
256
+ min-width:0;
257
+ padding:6px;
258
+ width:100%;
259
+ }
260
+ paper-item {
261
+ width: 130px;
262
+ cursor: pointer;
263
+ }
264
+ paper-item:hover {
265
+ color: var(--primary);
266
+ }
267
+ .input-wrapper {
268
+ width: 100%;
269
+ position: relative;
270
+ }
271
+
272
+ paper-button {
273
+ padding: 0.4em;
274
+ color: var(--primary);
33
275
  }
34
- `),(0,i.Z)(r,"properties",{}),customElements.define("cdtr-image-skeleton",r)}}]);
276
+ paper-button.indigo {
277
+ background: var(--primary);
278
+ color: white;
279
+ }
280
+
281
+ .input-wrapper cdtr-input {
282
+ display: block;
283
+ }
284
+ .explain-title {
285
+ margin: 20px 0 6px;
286
+ }
287
+ paper-item {
288
+ text-align: var(--text-align-locale);
289
+ direction: var(--direction-locale);
290
+ }
291
+ .link-type-dropdown {
292
+ text-align: var(--text-align-locale);
293
+ direction: var(--direction-locale);
294
+ width: 50%;
295
+ }
296
+ .trigger-wrapper svg {
297
+ width: 20px;
298
+ cursor: pointer;
299
+ fill: var(--dark);
300
+ }
301
+ .trigger-wrapper svg:hover {
302
+ fill: var(--primary);
303
+ }
304
+ .demo-icon {
305
+ position: absolute;
306
+ left: 100%;
307
+ transform: translate(-100%, -50%);
308
+ top: 55%;
309
+ }
310
+ .automations-view {
311
+ width: 100%;
312
+ }
313
+ .automation-card {
314
+ padding: 1rem;
315
+ border: 1px solid #e0e0e0;
316
+ border-radius: 4px;
317
+ margin-bottom: 0.5rem;
318
+ cursor: pointer;
319
+ transition: all 0.2s;
320
+ }
321
+ .automation-card:hover {
322
+ border-color: var(--primary);
323
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
324
+ }
325
+ .automation-card.active {
326
+ border-color: var(--primary);
327
+ background: #e3f2fd;
328
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
329
+ }
330
+ .automation-card.active:hover {
331
+ border-color: var(--primary);
332
+ box-shadow: 0 2px 6px rgba(0,0,0,0.15);
333
+ }
334
+ .automation-details-view {
335
+ width: 100%;
336
+ min-height: 400px;
337
+ display: flex;
338
+ flex-direction: column;
339
+ }
340
+ .automation-content {
341
+ overflow-y: auto;
342
+ flex: 1 1 auto;
343
+ min-height: 0;
344
+ }
345
+ .automation-footer {
346
+ flex: 0 0 auto;
347
+ position: sticky;
348
+ bottom: 0;
349
+ z-index: 10;
350
+ background: #fff;
351
+ }
352
+ .mailing-lists-container {
353
+ max-height: 300px;
354
+ overflow-y: auto;
355
+ }
356
+ .mailing-list-item {
357
+ padding: 0.5rem 0.75rem;
358
+ border-radius: 4px;
359
+ margin-bottom: 0.5rem;
360
+ cursor: pointer;
361
+ transition: all 0.2s;
362
+ }
363
+ .mailing-list-item:hover {
364
+ background: rgba(0, 0, 0, 0.03);
365
+ }
366
+ .action-section {
367
+ margin-bottom: 1.5rem;
368
+ }
369
+ .action-question {
370
+ padding: 0.75rem 0;
371
+ cursor: pointer;
372
+ border-bottom: 1px solid #e0e0e0;
373
+ transition: all 0.2s;
374
+ }
375
+ .action-question:hover {
376
+ border-bottom-color: var(--primary);
377
+ }
378
+ .mailing-lists-list {
379
+ margin-top: 0.75rem;
380
+ padding-left: 1rem;
381
+ }
382
+ `;var a=i(21421);i(73095),i(70380);const l="260px",c=[{type:"https:",text:"link"},{type:"http:",text:"link"},{type:"mailto:",text:"sendEmail"},{type:"tel:",text:"tel"},{type:"sms:",text:"sendSms"},{type:"whatsapp:",text:"sendWhatsapp"},{type:"anchor:",text:"anchor"}],h="cdtrAdd",d="cdtrRemove",p="cdtrAutomation",u=[h,d,p];function m(t,e){t=t.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}const g="anchor",f="linkpicker:anchor";function b(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}let y=null,v=null;const x=[0,60,150,400,800];function w(t,e){let i=null;const s=()=>{document.removeEventListener("mouseup",s,!0);let o=0;const r=()=>{if(function(t){return b().find(e=>e.type===g&&e.props&&e.props.name===t)||null}(t))return v=null,void e(t);o++,o<x.length?i=setTimeout(r,x[o]):v=null};i=setTimeout(r,x[0])};return document.addEventListener("mouseup",s,!0),()=>{document.removeEventListener("mouseup",s,!0),i&&clearTimeout(i)}}function $(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};A();const e=function(){const t=new Set(b().filter(t=>t.type===g&&t.props&&t.props.name).map(t=>String(t.props.name)));let e=1;for(;t.has(`${g}-${e}`);)e++;return`${g}-${e}`}(),i={id:f,name:g,group:"elements",body:{type:g,props:{mode:"inline",name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",f),s.setAttribute("data-group","elements"),s.setAttribute("data-placement",""),s.setAttribute("draggable-element","create:element"),s.setAttribute("draggable-direction","top,bottom,left,right"),s.classList.add("draggable-element-handle"),s.__template=i,window.__dragoned_selected_element=s,y=s,"function"==typeof t&&(v=w(e,t)),s}function A(){y&&window.__dragoned_selected_element===y&&delete window.__dragoned_selected_element,y=null,v&&(v(),v=null)}function k(t){let{onRequest:e,onChangeLink:i,onBlur:r}=t;return function(){const t=o.M.get("config","editor","configure","plugins");return!!Array.isArray(t)&&t.some(t=>t&&t.name===g)}()?s.qy`
383
+ <div class="anchor-create">
384
+ <div
385
+ class="anchor-drag draggable-element-handle"
386
+ role="button"
387
+ @mousedown=${()=>$({onCreated:t=>{i({target:{value:`#${t}`},anchor:!0}),r()}})}
388
+ @mouseup=${()=>{A(),"function"==typeof e&&e("anchor")}}
389
+ >
390
+ <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
391
+ <path d="${"M2.05 11H7v2H4.062A8.004 8.004 0 0 0 11 19.938V9.874A4.002 4.002 0 0 1 12 2a4 4 0 0 1 1 7.874v10.064A8.004 8.004 0 0 0 19.938 13H17v-2h4.95c.033.329.05.663.05 1 0 5.523-4.477 10-10 10S2 17.523 2 12c0-.337.017-.671.05-1zM12 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}"></path>
392
+ </svg>
393
+ <span class="anchor-drag-label">
394
+ <lang-text text="drag_anchor_to_canvas"></lang-text>
395
+ </span>
396
+ </div>
397
+ <span class="anchor-drag-hint">
398
+ <lang-text
399
+ whiteSpace="break-spaces"
400
+ text="drag_anchor_hint"
401
+ ></lang-text>
402
+ </span>
403
+ </div>
404
+ `:null}function _(t,e){switch(t){case"anchor:":return function(t){const{url:e,anchors:i,href:o,protocol:r,onChangeLink:n,onBlur:a,onRequest:l}=t;return s.qy`
405
+ <cdtr-row alignItems="center" spacing="5">
406
+ <cdtr-dropdown
407
+ @change=${t=>{n({target:{value:"#"+t.target.value},anchor:!0}),a()}}
408
+ .opened=${i.length>0&&"anchor:"===r&&!o}
409
+ class="anchor-dd"
410
+ >
411
+ <cdtr-dropdown-button
412
+ minWidth=${100}
413
+ class=" dropdown-button"
414
+ slot="trigger"
415
+ ><lang-text .text=${e.isAnchor?o:""}></lang-text>
416
+ </cdtr-dropdown-button>
417
+ <div style="min-width:150px" slot="content">
418
+ ${i.map(t=>s.qy`<cdtr-dropdown-item
419
+ value="${t.props.name||t.props.element_ID}"
420
+ >${t.props.name||t.props.element_ID}
421
+ </cdtr-dropdown-item>`)}
422
+ </div>
423
+ </cdtr-dropdown>
424
+ ${k({onRequest:l,onChangeLink:n,onBlur:a})}
425
+ </cdtr-row>
426
+ `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?m("body",e):i||e.params.body,h="string"==typeof e?m("subject",e):o||e.params.subject;return s.qy`
427
+ <cdtr-row spacing="5">
428
+ <cdtr-title class="explain-title"
429
+ ><lang-text text="add_catchy_subject"></lang-text
430
+ ></cdtr-title>
431
+ <cdtr-input
432
+ inputStyle="height:${"40px"};"
433
+ style="width:${l};"
434
+ @change=${t=>{let{target:e}=t;a(e.value),r()}}
435
+ value=${h||o||""}
436
+ ></cdtr-input>
437
+ <cdtr-title class="explain-title"
438
+ ><lang-text text="email_body_if_needed"></lang-text
439
+ ></cdtr-title>
440
+ <cdtr-input
441
+ .multiline=${!0}
442
+ value="${c||i||""}"
443
+ style="width:${l};"
444
+ @change=${t=>{let{target:e}=t;n(e.value),r()}}
445
+ ></cdtr-input>
446
+ </cdtr-row>
447
+ `}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?m("body",e):e.params.body;return s.qy`
448
+ <cdtr-row spacing="5">
449
+ <cdtr-title class="explain-title"
450
+ ><lang-text text="sms_body_if_needed"></lang-text
451
+ ></cdtr-title>
452
+ <cdtr-input
453
+ .multiline=${!0}
454
+ value="${n||i||""}"
455
+ style="width:${l};"
456
+ @change=${t=>{let{target:e}=t;r(e.value),o()}}
457
+ ></cdtr-input>
458
+ </cdtr-row>
459
+ `}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?m("text",e)||m("body",e):e.params&&(e.params.text||e.params.body)||"";return s.qy`
460
+ <cdtr-row spacing="5">
461
+ <cdtr-title class="explain-title"
462
+ ><lang-text text="whatsapp_body_if_needed"></lang-text
463
+ ></cdtr-title>
464
+ <cdtr-input
465
+ .multiline=${!0}
466
+ value="${n||i||""}"
467
+ style="width:${l};"
468
+ @change=${t=>{let{target:e}=t;r(e.value),o()}}
469
+ ></cdtr-input>
470
+ </cdtr-row>
471
+ `}(e);default:return""}}function S(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t),a=(n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||m("phone",n.href||"")||n.url||"").replace(/\D+/g,"");if(!a)return null;const l=s||n.params&&(n.params.text||n.params.body)||"",c=l?encodeURIComponent(l):"";let h=`https://wa.me/${a}`;c&&(h+=`?text=${c}`);const d=new r.A(h);return d.target=o||d.target||"_blank",{url:d,params:d.params,protocol:"whatsapp:"}}(t,e,i,s,n):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function R(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function L(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:h,placeholder:d="",inputStyle:p="",style:u="width:260px;",width:m=l}=t,g=t=>{r&&r(t),n&&n()},f=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
472
+ <cdtr-row style="position:relative;" spacing="5">
473
+ <span style="display:none;" aria-hidden="true">${e}</span>
474
+ <cdtr-input
475
+ .couchOnEmpty=${!0}
476
+ ${i?(0,a.K)(i):""}
477
+ style="${u}"
478
+ inputStyle="${p}"
479
+ .autofocus=${o}
480
+ type="search"
481
+ width="${m}"
482
+ placeholder="${d}"
483
+ @input=${t=>{if(t.target.selectionStart!==t.target.value.length)return;const e=t.target.value.trim();/^[^a-zA-Z0-9]+$/.test(e)||r&&r(t)}}
484
+ @change=${g}
485
+ @focus=${c}
486
+ @submit=${h||g}
487
+ .value="${f}"
488
+ ></cdtr-input>
489
+ </cdtr-row>
490
+ `}function U(t){return class extends t{initAutomations(){this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.activeTab="add",this.baseUrl="",this.showSaveSuccess=!1;const t=o.M.get("config","editor","configure","editorProps","mailingLists","items");this.mailingLists=t||[];const e=o.M.get("config","editor","configure","editorProps","automations")||{};this.automations=[],e.addAndRemoveFromMailingList&&this.automations.push({id:"addAndRemoveFromMailingList",name:"moving_from_mailing_list"})}onAutomationsClick(){if(this.showAutomations=!0,this.protocol="automation:",this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.href&&this.href.href){const t=this.href.href;if("string"==typeof t&&t.match(/^\[\[([^\]]+)\]\]\?/))this.parseAutomationLink(this.href);else{const t=new r.A(this.href);t.params&&t.params[p]?(this.baseUrl=this.extractBaseUrl(t),this.parseAutomationLink(t)):this.baseUrl=t.href||""}}else this.baseUrl="";this.requestUpdate()}extractBaseUrl(t){const e=[];t.protocol&&e.push(t.protocol),t.host&&(e.push("//"),e.push(t.host)),t.pathname&&e.push(t.pathname);const i=u,s=[];t.params&&Object.keys(t.params).forEach(e=>{if(!i.includes(e)){const i=t.params[e];s.push(`${e}=${encodeURIComponent(i)}`)}});let o=e.join("");return s.length>0&&(o+=`?${s.join("&")}`),t.href}onBackClick(){if(this.selectedAutomation)this.selectedAutomation=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null;else if(this.showAutomations=!1,this.activeAutomationId=null,"automation:"===this.protocol)if(this.baseUrl){const t=new r.A(this.baseUrl);this.href=t,this.protocol=t.protocol}else this.protocol=null,this.href={};this.requestUpdate()}onAutomationClick(t){this.selectedAutomation=t,this.activeAutomationId=t.id,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.requestUpdate()}onActionSelect(t){this.automationAction===t?this.automationAction=null:this.automationAction=t,this.requestUpdate()}onTabChange(t){this.activeTab=t,this.requestUpdate()}onMailingListToggle(t,e){("add"===e?this.selectedMailingListsForAdd:this.selectedMailingListsForRemove).indexOf(t)>-1?"add"===e?this.selectedMailingListsForAdd=this.selectedMailingListsForAdd.filter(e=>e!==t):this.selectedMailingListsForRemove=this.selectedMailingListsForRemove.filter(e=>e!==t):"add"===e?this.selectedMailingListsForAdd=[...this.selectedMailingListsForAdd,t]:this.selectedMailingListsForRemove=[...this.selectedMailingListsForRemove,t],this.requestUpdate()}createAutomationLink(){if(!this.selectedAutomation)return null;const t=[];if(this.selectedMailingListsForAdd.length>0&&t.push(`${h}=${this.selectedMailingListsForAdd.join(",")}`),this.selectedMailingListsForRemove.length>0&&t.push(`${d}=${this.selectedMailingListsForRemove.join(",")}`),0===t.length)return null;const e=this.selectedAutomation.name||this.selectedAutomation.id;if(this.baseUrl&&this.baseUrl.trim()){let e=this.baseUrl.trim();e.match(/^https?:\/\//i)||e.includes("://")||!e.includes(".")&&e.match(/^[a-zA-Z]+:/)||(e=`https://${e}`),t.push(`url=${encodeURIComponent(e)}`)}return`[[${e}]]?${t.join("&")}`}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=t.match(/^\[\[([^\]]+)\]\]\?(.+)$/);if(!e)return void console.error("Invalid automation link format:",t);const i=e[1],s=e[2],o={};s.split("&").forEach(t=>{const[e,i]=t.split("=");e&&i&&(o[decodeURIComponent(e)]=decodeURIComponent(i))});const n=o.url;let a;if(delete o.url,a=n?new r.A(n):new r.A("https://example.com"),a.params||(a.params={}),o[h]&&(a.params[h]=o[h]),o[d]&&(a.params[d]=o[d]),a.params[p]=i,a.href=t,a.url=n||"",this.href=a,this.protocol=null,this.value=a,this.link=a,this.lastUrl=a,console.log("Set href to:",this.href),console.log("Set href.href to:",this.href?.href),this.onDispatch(),console.log("After dispatch, href:",this.href),console.log("After dispatch, href.href:",this.href?.href),console.log("After dispatch, href.params:",this.href?.params),this.href&&(!this.href.params||!this.href.params[p])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=String(t).match(/^\[\[([^\]]+)\]\]\?(.+)$/);if(e){const i=e[2],s={};i.split("&").forEach(t=>{const[e,i]=t.split("=");e&&i&&(s[decodeURIComponent(e)]=decodeURIComponent(i))});const o=s.url,n=o?new r.A(o):new r.A("https://example.com");n.params||(n.params={}),s[h]&&(n.params[h]=s[h]),s[d]&&(n.params[d]=s[d]),n.params[p]=e[1],n.href=t,n.url=o||"",this.href=n,this.value=n,this.link=n,this.lastUrl=n,console.log("Restored href:",this.href?.href),console.log("Restored params:",this.href?.params)}}this.showSaveSuccess=!0,this.requestUpdate(),setTimeout(()=>{this.showSaveSuccess=!1,this.requestUpdate()},2e3)}parseAutomationLink(t){if(!t)return;let e=null,i=!1,s=t.href||t;if("string"==typeof s&&s.match(/^\[\[([^\]]+)\]\]\?/)){i=!0;e=s.match(/^\[\[([^\]]+)\]\]\?/)[1]}else t.params&&(e=t.params[p],i=e&&""!==e&&"string"==typeof e&&""!==e.trim());if(i){if("string"==typeof s&&s.match(/^\[\[([^\]]+)\]\]\?(.+)$/)){const t=s.match(/^\[\[([^\]]+)\]\]\?(.+)$/)[2],e={};if(t.split("&").forEach(t=>{const[i,s]=t.split("=");i&&s&&(e[decodeURIComponent(i)]=decodeURIComponent(s))}),e.url?this.baseUrl=e.url:this.baseUrl="",e[h]){const t="string"==typeof e[h]?e[h].split(",").filter(t=>t.trim()):Array.isArray(e[h])?e[h]:[];this.selectedMailingListsForAdd=t}if(e[d]){const t="string"==typeof e[d]?e[d].split(",").filter(t=>t.trim()):Array.isArray(e[d])?e[d]:[];this.selectedMailingListsForRemove=t}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,t.params[h]){const e="string"==typeof t.params[h]?t.params[h].split(",").filter(t=>t.trim()):Array.isArray(t.params[h])?t.params[h]:[];this.selectedMailingListsForAdd=e}if(t.params[d]){const e="string"==typeof t.params[d]?t.params[d].split(",").filter(t=>t.trim()):Array.isArray(t.params[d])?t.params[d]:[];this.selectedMailingListsForRemove=e}}if((this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0)&&(this.showAutomations=!0,this.automations&&this.automations.length>0)){const t=String(e).trim(),i=this.automations.find(e=>e.name&&String(e.name).trim()===t||e.id&&String(e.id).trim()===t)||this.automations[0];this.selectedAutomation=i,this.activeAutomationId=i.id}}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
491
+ <div class="automations-view">
492
+ <cdtr-row justify="space-between" alignItems="center" mb="1">
493
+ <cdtr-title
494
+ style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
495
+ >
496
+ <lang-text text="automations"></lang-text>
497
+ </cdtr-title>
498
+ <paper-button
499
+ @click=${this.onBackClick}
500
+ style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
501
+ >
502
+ <lang-text text="back"></lang-text>
503
+ </paper-button>
504
+ </cdtr-row>
505
+ <cdtr-divider></cdtr-divider>
506
+ <div class="automations-list" style="margin-top: 1rem;">
507
+ ${this.automations.map(t=>{const e=this.activeAutomationId===t.id;return s.qy`
508
+ <div
509
+ class="automation-card ${e?"active":""}"
510
+ @click=${()=>this.onAutomationClick(t)}
511
+ style="
512
+ padding: 1rem;
513
+ border: 2px solid ${e?"var(--primary)":"#e0e0e0"};
514
+ border-radius: 4px;
515
+ margin-bottom: 0.5rem;
516
+ cursor: pointer;
517
+ transition: all 0.2s;
518
+ background: ${e?"#e3f2fd":"#fff"};
519
+ "
520
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="var(--primary)",t.currentTarget.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)")}}
521
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.boxShadow="none")}}
522
+ >
523
+ <cdtr-row justify="space-between" alignItems="center">
524
+ <cdtr-title
525
+ style="font-size: 14px; color: ${e?"var(--primary)":"#000"}; font-weight: ${e?"600":"400"};"
526
+ >
527
+ <lang-text text="${t.name}"></lang-text>
528
+ </cdtr-title>
529
+ ${e?s.qy`
530
+ <span
531
+ style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
532
+ >✓</span
533
+ >
534
+ `:null}
535
+ </cdtr-row>
536
+ </div>
537
+ `})}
538
+ <!-- coming soon -->
539
+ <h6 align="center">
540
+ <lang-text whiteSpace="break-spaces" text="coming_soon_automations"></lang-text>
541
+ </h6>
542
+ </div>
543
+ </div>
544
+ `}renderAutomationDetails(){const t=this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0;return s.qy`
545
+ <div
546
+ class="automation-details-view"
547
+ style="display: flex; flex-direction: column; height: 100%;"
548
+ >
549
+ <div style="flex: 0 0 auto;">
550
+ <cdtr-row justify="space-between" alignItems="center" mb="1">
551
+ <cdtr-title
552
+ style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
553
+ >
554
+ <lang-text text="automation_settings"></lang-text>
555
+ </cdtr-title>
556
+ <paper-button
557
+ @click=${this.onBackClick}
558
+ style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
559
+ >
560
+ <lang-text text="back"></lang-text>
561
+ </paper-button>
562
+ </cdtr-row>
563
+ <cdtr-divider></cdtr-divider>
564
+ </div>
565
+
566
+ <div class="automation-content">
567
+ <!-- Success Message -->
568
+ ${this.showSaveSuccess?s.qy`
569
+ <style>
570
+ .save-success-container {
571
+ margin-bottom: 1rem;
572
+ animation: slideDown 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
573
+ }
574
+
575
+ .save-success-content {
576
+ display: flex;
577
+ align-items: center;
578
+ gap: 12px;
579
+ background: #e8f5e9;
580
+ border: 1px solid #4caf50;
581
+ color: #2e7d32;
582
+ padding: 12px 16px;
583
+ border-radius: 6px;
584
+ animation: scaleIn 0.3s ease-out;
585
+ }
586
+
587
+ .success-icon {
588
+ display: flex;
589
+ align-items: center;
590
+ justify-content: center;
591
+ width: 20px;
592
+ height: 20px;
593
+ background: #4caf50;
594
+ border-radius: 50%;
595
+ flex-shrink: 0;
596
+ animation: iconBounce 0.5s ease-out 0.2s both;
597
+ }
598
+
599
+ .success-icon svg {
600
+ width: 14px;
601
+ height: 14px;
602
+ color: white;
603
+ }
604
+
605
+ .success-text {
606
+ font-size: 13px;
607
+ font-weight: 500;
608
+ flex: 1;
609
+ }
610
+
611
+ @keyframes slideDown {
612
+ from {
613
+ transform: translateY(-10px);
614
+ opacity: 0;
615
+ }
616
+ to {
617
+ transform: translateY(0);
618
+ opacity: 1;
619
+ }
620
+ }
621
+
622
+ @keyframes fadeOut {
623
+ from {
624
+ opacity: 1;
625
+ transform: translateY(0);
626
+ }
627
+ to {
628
+ opacity: 0;
629
+ transform: translateY(-10px);
630
+ }
631
+ }
632
+
633
+ @keyframes scaleIn {
634
+ from {
635
+ transform: scale(0.95);
636
+ opacity: 0;
637
+ }
638
+ to {
639
+ transform: scale(1);
640
+ opacity: 1;
641
+ }
642
+ }
643
+
644
+ @keyframes iconBounce {
645
+ 0% {
646
+ transform: scale(0);
647
+ opacity: 0;
648
+ }
649
+ 50% {
650
+ transform: scale(1.2);
651
+ }
652
+ 100% {
653
+ transform: scale(1);
654
+ opacity: 1;
655
+ }
656
+ }
657
+ </style>
658
+ <div class="save-success-container">
659
+ <div class="save-success-content">
660
+ <div class="success-icon">
661
+ <svg
662
+ width="24"
663
+ height="24"
664
+ viewBox="0 0 24 24"
665
+ fill="none"
666
+ xmlns="http://www.w3.org/2000/svg"
667
+ >
668
+ <path
669
+ d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
670
+ fill="currentColor"
671
+ />
672
+ </svg>
673
+ </div>
674
+ <span class="success-text">
675
+ <lang-text text="saved_successfully"></lang-text>
676
+ </span>
677
+ </div>
678
+ </div>
679
+ `:null}
680
+
681
+ <!-- URL Input (Optional) -->
682
+ <div style="margin-bottom: 1.5rem;">
683
+ <cdtr-title
684
+ style="font-size: 13px; color: #666; margin-bottom: 0.5rem; font-weight: 500;"
685
+ >
686
+ <lang-text text="url"></lang-text> (Optional)
687
+ </cdtr-title>
688
+ ${L({value:this.baseUrl||"",onChange:t=>{const e=t.target.value||"",i=R(e,null,this.baseUrl?new r.A(this.baseUrl):{});null===i?this.baseUrl=e:i.href?i.href instanceof r.A?this.baseUrl=i.href.href||e:"string"==typeof i.href?this.baseUrl=i.href:this.baseUrl=e:this.baseUrl=e,this.requestUpdate()},placeholder:"https://example.com",inputStyle:"height: 40px; padding: 0.5rem; border: 1px solid #e0e0e0; border-radius: 4px; width: 100%;",style:"width: 100%;"})}
689
+ </div>
690
+
691
+ <h6
692
+ class="explain-title"
693
+ style="margin-bottom: 1rem; font-size: 14px; color: #666;"
694
+ >
695
+ <lang-text whiteSpace="break-spaces" text="what_should_happen"></lang-text>
696
+ </h6>
697
+
698
+ <!-- Tabs -->
699
+ <div
700
+ style="margin-bottom: 1.5rem; border-bottom: 1px solid #e0e0e0;"
701
+ >
702
+ <cdtr-row spacing="0">
703
+ <paper-button
704
+ @click=${()=>this.onTabChange("add")}
705
+ style="
706
+ background: ${"add"===this.activeTab?"var(--primary)":"transparent"};
707
+ color: ${"add"===this.activeTab?"#fff":"var(--primary)"};
708
+ padding: 0.6em 1.5em;
709
+ font-size: 14px;
710
+ text-transform: none;
711
+ border-radius: 4px 4px 0 0;
712
+ margin-right: 0.5rem;
713
+ box-shadow: none;
714
+ "
715
+ >
716
+ <lang-text text="add_to_mailing_list_question"></lang-text>
717
+ </paper-button>
718
+ <paper-button
719
+ @click=${()=>this.onTabChange("remove")}
720
+ style="
721
+ background: ${"remove"===this.activeTab?"#f44336":"transparent"};
722
+ color: ${"remove"===this.activeTab?"#fff":"#f44336"};
723
+ padding: 0.6em 1.5em;
724
+ font-size: 14px;
725
+ text-transform: none;
726
+ border-radius: 4px 4px 0 0;
727
+ box-shadow: none;
728
+ "
729
+ >
730
+ <lang-text
731
+ text="remove_from_mailing_list_question"
732
+ ></lang-text>
733
+ </paper-button>
734
+ </cdtr-row>
735
+ </div>
736
+
737
+ <!-- Add to mailing list section -->
738
+ ${"add"===this.activeTab?s.qy`
739
+ <div class="action-section">
740
+ <div class="mailing-lists-list" style="padding-left: 1rem;">
741
+ ${this.mailingLists.map(t=>{const e=this.selectedMailingListsForAdd.includes(t.id);return s.qy`
742
+ <div
743
+ class="mailing-list-item ${e?"selected":""}"
744
+ @click=${()=>this.onMailingListToggle(t.id,"add")}
745
+ style="
746
+ padding: 0.75rem;
747
+ margin-bottom: 0.5rem;
748
+ cursor: pointer;
749
+ border-radius: 4px;
750
+ transition: all 0.2s;
751
+ border: 2px solid ${e?"var(--primary)":"#e0e0e0"};
752
+ background: ${e?"#e3f2fd":"#fff"};
753
+ "
754
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="var(--primary)",t.currentTarget.style.background="#f5f5f5")}}
755
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.background="#fff")}}
756
+ >
757
+ <cdtr-row
758
+ justify="space-between"
759
+ alignItems="center"
760
+ >
761
+ <cdtr-title
762
+ style="font-size: 13px; color: ${e?"var(--primary)":"#333"}; font-weight: ${e?"600":"400"};"
763
+ >
764
+ ${t.name}
765
+ </cdtr-title>
766
+ ${e?s.qy`
767
+ <span
768
+ style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
769
+ >✓</span
770
+ >
771
+ `:s.qy`
772
+ <span
773
+ style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
774
+ >○</span
775
+ >
776
+ `}
777
+ </cdtr-row>
778
+ </div>
779
+ `})}
780
+ </div>
781
+ </div>
782
+ `:null}
783
+
784
+ <!-- Remove from mailing list section -->
785
+ ${"remove"===this.activeTab?s.qy`
786
+ <div class="action-section">
787
+ <div class="mailing-lists-list" style="padding-left: 1rem;">
788
+ ${this.mailingLists.map(t=>{const e=this.selectedMailingListsForRemove.includes(t.id);return s.qy`
789
+ <div
790
+ class="mailing-list-item ${e?"selected":""}"
791
+ @click=${()=>this.onMailingListToggle(t.id,"remove")}
792
+ style="
793
+ padding: 0.75rem;
794
+ margin-bottom: 0.5rem;
795
+ cursor: pointer;
796
+ border-radius: 4px;
797
+ transition: all 0.2s;
798
+ border: 2px solid ${e?"#f44336":"#e0e0e0"};
799
+ background: ${e?"#ffebee":"#fff"};
800
+ "
801
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="#f44336",t.currentTarget.style.background="#f5f5f5")}}
802
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.background="#fff")}}
803
+ >
804
+ <cdtr-row
805
+ justify="space-between"
806
+ alignItems="center"
807
+ >
808
+ <cdtr-title
809
+ style="font-size: 13px; color: ${e?"#f44336":"#333"}; font-weight: ${e?"600":"400"};"
810
+ >
811
+ ${t.name}
812
+ </cdtr-title>
813
+ ${e?s.qy`
814
+ <span
815
+ style="color: #f44336; font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
816
+ >✓</span
817
+ >
818
+ `:s.qy`
819
+ <span
820
+ style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
821
+ >○</span
822
+ >
823
+ `}
824
+ </cdtr-row>
825
+ </div>
826
+ `})}
827
+ </div>
828
+ </div>
829
+ `:null}
830
+ </div>
831
+
832
+ <div
833
+ class="automation-footer"
834
+ style="flex: 0 0 auto; padding: 10px; border-top: 1px solid #e0e0e0; background: #fff;"
835
+ >
836
+ <cdtr-row justify="flex-end">
837
+ <paper-button
838
+ @click=${this.onSaveAutomation}
839
+ ?disabled=${!t}
840
+ style="
841
+ background: ${t?"var(--primary)":"#ccc"};
842
+ color: #fff;
843
+ padding: 0.6em 1.5em;
844
+ font-size: 14px;
845
+ text-transform: none;
846
+ cursor: ${t?"pointer":"not-allowed"};
847
+ "
848
+ >
849
+ <lang-text text="save"></lang-text>
850
+ </paper-button>
851
+ </cdtr-row>
852
+ </div>
853
+ </div>
854
+ `}}}customElements.get("paper-button")||Promise.resolve().then(i.bind(i,39239)),customElements.get("cdtr-emoji-picker")||i.e(3105).then(i.t.bind(i,63105,23));class C extends(U(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=S(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=R(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=function(){const t=o.M.get("components");return t?.filter(t=>"anchor"===t.type&&t.props.name||t.props.element_ID)||[]}()}onChangeType(t){const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),e.forceProtocolChange){const t=new r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.A(this.href);const t=String(this.href?.href||"").match(/^\[\[([^\]]+)\]\]\?/),e=this.href&&this.href.params&&this.href.params[p];(t||e)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");n.match(/^\[\[([^\]]+)\]\]\?/)||i.params&&i.params[p]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null)}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const h=String(i.href||""),d=h.match(/^\[\[([^\]]+)\]\]\?/),m=i.params&&i.params[p];if(d)c=h;else if(m){const t=u,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const g=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),f=[...this.options],b=f.findIndex(t=>"http:"===t.type);b>-1&&f.splice(b,1);const y=o.M.get("config","editor","configure","editorProps","automations"),v={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},x=null!=c&&""!==c?String(c):"",w=this._urlInputRawValue!==x,$=void 0!==this._lastSyncedMyHref&&x!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&x&&!$;w&&!A?(this._urlInputRawValue=x,this._lastSyncedMyHref=x):w||(this._lastSyncedMyHref=x);const k=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,S={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:k};return this.showAutomations?s.qy` <div class="root">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
855
+ ${j=this.label,j?s.qy`<cdtr-title
856
+ style="font-weight: 700;
857
+ font-size: 14.4px;
858
+ margin-bottom: 0.6rem;
859
+ color: #000000b0;"
860
+ ><lang-text text=${j}></lang-text
861
+ ><cdtr-divider></cdtr-divider
862
+ ></cdtr-title>`:null}
863
+ <cdtr-row alignItems="center" justify="space-between" spacing="10">
864
+ ${I=this.options,q=this.protocol,F=this.onChangeType.bind(this),s.qy`
865
+ <cdtr-dropdown @change=${t=>F(t.target.value)}>
866
+ <cdtr-dropdown-button
867
+ minWidth=${100}
868
+ class=" dropdown-button"
869
+ slot="trigger"
870
+ ><lang-text
871
+ .text="${I.find(t=>t.type===q)?.text||"link"}"
872
+ ></lang-text>
873
+ </cdtr-dropdown-button>
874
+ <div slot="content">
875
+ ${I.map(t=>s.qy`<cdtr-dropdown-item
876
+ .focused=${t.type===q}
877
+ .selected=${t.type===q}
878
+ value="${t.type}"
879
+ ><lang-text text="${t.text}"></lang-text>
880
+ </cdtr-dropdown-item>`)}
881
+ </div>
882
+ </cdtr-dropdown>
883
+ `}
884
+ ${C=this.target,M=this.onChangeTarget.bind(this),s.qy`
885
+ <cdtr-dropdown @change=${t=>M(t)} style="min-width: 120px;">
886
+ <cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
887
+ <lang-text .text=${C}></lang-text>
888
+ </cdtr-dropdown-button>
889
+ <div slot="content">
890
+ <cdtr-dropdown-item value="_blank" .selected=${"_blank"===C}>
891
+ <lang-text text="open_in_new_tab"></lang-text>
892
+ </cdtr-dropdown-item>
893
+ <cdtr-dropdown-item value="_self" .selected=${"_self"===C}>
894
+ <lang-text text="open_in_same_tab"></lang-text>
895
+ </cdtr-dropdown-item>
896
+ <cdtr-dropdown-item value="_parent" .selected=${"_parent"===C}>
897
+ <lang-text text="open_in_parent_frame"></lang-text>
898
+ </cdtr-dropdown-item>
899
+ <cdtr-dropdown-item value="_top" .selected=${"_top"===C}>
900
+ <lang-text text="open_in_top_frame"></lang-text>
901
+ </cdtr-dropdown-item>
902
+ </div>
903
+ </cdtr-dropdown>
904
+ `}
905
+ </cdtr-row>
906
+ <cdtr-row mt="1">
907
+ ${function(t,e){return 0===t.length?null:s.qy`${t.map(t=>s.qy`<paper-button
908
+ @click=${()=>e(t.type)}
909
+ style="background:rgb(233, 237, 243);color:#000;font-size:13px;margin:0;margin-right:5px;"
910
+ ><lang-text text="${t.text}"></lang-text
911
+ ></paper-button>`)}`}(l,this.onChangeType.bind(this))}
912
+ </cdtr-row>
913
+
914
+ <div class="input-wrapper">
915
+ <cdtr-title class="explain-title"
916
+ ><lang-text .text="${g}"></lang-text
917
+ ></cdtr-title>
918
+ ${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:r,onBlur:n,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:L({value:c,inputRef:o,autofocus:s,onChange:r,onBlur:n,onFocus:a,onKeyDown:l})}(S)}
919
+ ${_(this.protocol,v)}
920
+ ${y?s.qy` <cdtr-divider></cdtr-divider>
921
+ <cdtr-row justify="flex-start" mt="1">
922
+ <cdtr-title class="explain-title"
923
+ ><lang-text
924
+ whiteSpace="break-spaces"
925
+ text="need_automations"
926
+ ></lang-text>
927
+ </cdtr-title>
928
+ <paper-button
929
+ @click=${this.onAutomationsClick.bind(this)}
930
+ style="background:#000;color:#fff;font-size:13px;margin:0;width:100%;"
931
+ >
932
+ <lang-text text="menu_automations"></lang-text>
933
+ </paper-button>
934
+ <cdtr-divider></cdtr-divider
935
+ ></cdtr-row>`:null}
936
+ ${function(t,e,i,o){return t&&Array.isArray(t)&&0!==t.length?s.qy`<cdtr-list-picker
937
+ .selected=${e}
938
+ @change=${t=>{i({target:{value:t.target.value}}),o()}}
939
+ heading="saved_links"
940
+ .list=${t}
941
+ ></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
942
+ </div>
943
+
944
+ ${R=this.hasButton,U=this.onClickOk.bind(this),R?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
945
+ <cdtr-row justify="flex-end" mt="1">
946
+ <paper-button fullWidth @click=${U} raised class="add-button">
947
+ <lang-text text="add_now"></lang-text>
948
+ </paper-button>
949
+ </cdtr-row>`:null}
950
+ </div>`;var R,U,C,M,I,q,F,j}}C.styles=n,C.properties={href:{type:String,reflect:!0},value:{type:Object},protocol:{type:String},name:{type:String},label:{type:String},target:{type:String},hasButton:{type:Boolean},params:{type:Object},explain:{type:String},anchors:{type:Array},link:{},body:{type:String},subject:{type:String},autofocus:{type:Boolean},onRequest:{type:Function}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",C)},88385(t,e,i){i.d(e,{A:()=>a});const s=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function r(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let r,n=-1!==o?t.substring(o+1):"";for(;null!==(r=i.exec(n));){const t=s(r[1]),i=s(r[2]);t&&(e[t]=i)}return e}function n(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class a{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\]\?/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...r(t)};const i=t.indexOf("?");return this.url=i>-1?t.slice(0,i):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol??a.getProtocol(this.href);const i=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=s(i),this.isPhone=o(i),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...r(this.href)},this.url=n(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams()}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const i in this.params){const s=this.params[i],o=encodeURIComponent(i).replace(/%24/g,"$");if(s){const i=encodeURIComponent(s).replace(/%24/g,"$");t+=`${o}=${i}&`,e+=`${o}=${i}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const i=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return i(this.protocol+"//"+t);if("whatsapp:"===this.protocol){const s=this.extractPhoneFromTextUsingRegex(t);return s.length>0?i("https://wa.me/"+s[0]+e):i("https://wa.me/"+e)}return i(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}a.resetURL=n}}]);