@creaditor/web-starterkit 1.0.42 → 1.0.44

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 (199) hide show
  1. package/dist/112.creaditor.bundle.js.gz +0 -0
  2. package/dist/1142.creaditor.bundle.js.gz +0 -0
  3. package/dist/1204.creaditor.bundle.js.gz +0 -0
  4. package/dist/1271.creaditor.bundle.js +1 -1
  5. package/dist/1271.creaditor.bundle.js.gz +0 -0
  6. package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  7. package/dist/1317.creaditor.bundle.js.gz +0 -0
  8. package/dist/1334.creaditor.bundle.js.gz +0 -0
  9. package/dist/1396.creaditor.bundle.js.gz +0 -0
  10. package/dist/1403.creaditor.bundle.js.gz +0 -0
  11. package/dist/1456.creaditor.bundle.js.gz +0 -0
  12. package/dist/1529.creaditor.bundle.js.gz +0 -0
  13. package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  14. package/dist/168.creaditor.bundle.js.gz +0 -0
  15. package/dist/170.creaditor.bundle.js.gz +0 -0
  16. package/dist/175.creaditor.bundle.js.gz +0 -0
  17. package/dist/1972.creaditor.bundle.js.gz +0 -0
  18. package/dist/2001.creaditor.bundle.js +16 -16
  19. package/dist/2001.creaditor.bundle.js.gz +0 -0
  20. package/dist/211.creaditor.bundle.js.gz +0 -0
  21. package/dist/2112.creaditor.bundle.js.gz +0 -0
  22. package/dist/2154.creaditor.bundle.js.gz +0 -0
  23. package/dist/2234.creaditor.bundle.js.gz +0 -0
  24. package/dist/2298.creaditor.bundle.js.gz +0 -0
  25. package/dist/235.creaditor.bundle.js.gz +0 -0
  26. package/dist/2350.creaditor.bundle.js.gz +0 -0
  27. package/dist/2377.creaditor.bundle.js.gz +0 -0
  28. package/dist/2384.creaditor.bundle.js.gz +0 -0
  29. package/dist/2397.creaditor.bundle.js.gz +0 -0
  30. package/dist/2409.creaditor.bundle.js.gz +0 -0
  31. package/dist/2547.creaditor.bundle.js.gz +0 -0
  32. package/dist/2550.creaditor.bundle.js.gz +0 -0
  33. package/dist/2590.creaditor.bundle.js.gz +0 -0
  34. package/dist/2655.creaditor.bundle.js +823 -0
  35. package/dist/2655.creaditor.bundle.js.gz +0 -0
  36. package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  37. package/dist/2706.creaditor.bundle.js.gz +0 -0
  38. package/dist/271.creaditor.bundle.js.gz +0 -0
  39. package/dist/2717.creaditor.bundle.js.gz +0 -0
  40. package/dist/2765.creaditor.bundle.js.gz +0 -0
  41. package/dist/2773.creaditor.bundle.js.gz +0 -0
  42. package/dist/2833.creaditor.bundle.js.gz +0 -0
  43. package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  44. package/dist/2837.creaditor.bundle.js.gz +0 -0
  45. package/dist/2956.creaditor.bundle.js.gz +0 -0
  46. package/dist/2963.creaditor.bundle.js.gz +0 -0
  47. package/dist/3105.creaditor.bundle.js.gz +0 -0
  48. package/dist/3233.creaditor.bundle.js.gz +0 -0
  49. package/dist/3418.creaditor.bundle.js.gz +0 -0
  50. package/dist/3521.creaditor.bundle.js +2 -2
  51. package/dist/3521.creaditor.bundle.js.gz +0 -0
  52. package/dist/353.creaditor.bundle.js.gz +0 -0
  53. package/dist/3545.creaditor.bundle.js.gz +0 -0
  54. package/dist/3553.creaditor.bundle.js.gz +0 -0
  55. package/dist/3606.creaditor.bundle.js.gz +0 -0
  56. package/dist/3792.creaditor.bundle.js.gz +0 -0
  57. package/dist/380.creaditor.bundle.js.gz +0 -0
  58. package/dist/3827.creaditor.bundle.js.gz +0 -0
  59. package/dist/3847.creaditor.bundle.js +228 -139
  60. package/dist/3847.creaditor.bundle.js.gz +0 -0
  61. package/dist/3875.creaditor.bundle.js.gz +0 -0
  62. package/dist/3971.creaditor.bundle.js.gz +0 -0
  63. package/dist/4061.creaditor.bundle.js.gz +0 -0
  64. package/dist/407.creaditor.bundle.js.gz +0 -0
  65. package/dist/4074.creaditor.bundle.js.gz +0 -0
  66. package/dist/4100.creaditor.bundle.js.gz +0 -0
  67. package/dist/4109.creaditor.bundle.js.gz +0 -0
  68. package/dist/4114.creaditor.bundle.js.gz +0 -0
  69. package/dist/4161.creaditor.bundle.js.gz +0 -0
  70. package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  71. package/dist/4186.creaditor.bundle.js.gz +0 -0
  72. package/dist/4288.creaditor.bundle.js.gz +0 -0
  73. package/dist/4413.creaditor.bundle.js.gz +0 -0
  74. package/dist/4475.creaditor.bundle.js.gz +0 -0
  75. package/dist/453.creaditor.bundle.js.gz +0 -0
  76. package/dist/4615.creaditor.bundle.js.gz +0 -0
  77. package/dist/4639.creaditor.bundle.js.gz +0 -0
  78. package/dist/467.creaditor.bundle.js.gz +0 -0
  79. package/dist/4762.creaditor.bundle.js.gz +0 -0
  80. package/dist/4770.creaditor.bundle.js.gz +0 -0
  81. package/dist/4819.creaditor.bundle.js +198 -235
  82. package/dist/4819.creaditor.bundle.js.gz +0 -0
  83. package/dist/4947.creaditor.bundle.js.gz +0 -0
  84. package/dist/4987.creaditor.bundle.js.gz +0 -0
  85. package/dist/4988.creaditor.bundle.js.gz +0 -0
  86. package/dist/5119.creaditor.bundle.js.gz +0 -0
  87. package/dist/5133.creaditor.bundle.js.gz +0 -0
  88. package/dist/5156.creaditor.bundle.js.gz +0 -0
  89. package/dist/5284.creaditor.bundle.js.gz +0 -0
  90. package/dist/5379.creaditor.bundle.js.gz +0 -0
  91. package/dist/5391.creaditor.bundle.js.gz +0 -0
  92. package/dist/5411.creaditor.bundle.js.gz +0 -0
  93. package/dist/5501.creaditor.bundle.js.gz +0 -0
  94. package/dist/5530.creaditor.bundle.js.gz +0 -0
  95. package/dist/5666.creaditor.bundle.js.gz +0 -0
  96. package/dist/567.creaditor.bundle.js.gz +0 -0
  97. package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  98. package/dist/5713.creaditor.bundle.js.gz +0 -0
  99. package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  100. package/dist/574.creaditor.bundle.js.gz +0 -0
  101. package/dist/578.creaditor.bundle.js.gz +0 -0
  102. package/dist/5791.creaditor.bundle.js.gz +0 -0
  103. package/dist/5839.creaditor.bundle.js.gz +0 -0
  104. package/dist/5849.creaditor.bundle.js.gz +0 -0
  105. package/dist/5850.creaditor.bundle.js.gz +0 -0
  106. package/dist/5884.creaditor.bundle.js.gz +0 -0
  107. package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  108. package/dist/59.creaditor.bundle.js.gz +0 -0
  109. package/dist/5926.creaditor.bundle.js.gz +0 -0
  110. package/dist/6036.creaditor.bundle.js.gz +0 -0
  111. package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  112. package/dist/6216.creaditor.bundle.js.gz +0 -0
  113. package/dist/638.creaditor.bundle.js.gz +0 -0
  114. package/dist/6442.creaditor.bundle.js.gz +0 -0
  115. package/dist/6496.creaditor.bundle.js.gz +0 -0
  116. package/dist/653.creaditor.bundle.js.gz +0 -0
  117. package/dist/6751.creaditor.bundle.js.gz +0 -0
  118. package/dist/6814.creaditor.bundle.js.gz +0 -0
  119. package/dist/6937.creaditor.bundle.js.gz +0 -0
  120. package/dist/7051.creaditor.bundle.js +162 -0
  121. package/dist/{2682.creaditor.bundle.js.LICENSE.txt → 7051.creaditor.bundle.js.LICENSE.txt} +6 -0
  122. package/dist/{2682.creaditor.bundle.js.LICENSE.txt.gz → 7051.creaditor.bundle.js.LICENSE.txt.gz} +0 -0
  123. package/dist/7051.creaditor.bundle.js.gz +0 -0
  124. package/dist/7055.creaditor.bundle.js.gz +0 -0
  125. package/dist/715.creaditor.bundle.js +4 -4
  126. package/dist/715.creaditor.bundle.js.gz +0 -0
  127. package/dist/7155.creaditor.bundle.js.gz +0 -0
  128. package/dist/7209.creaditor.bundle.js.gz +0 -0
  129. package/dist/7238.creaditor.bundle.js.gz +0 -0
  130. package/dist/7255.creaditor.bundle.js.gz +0 -0
  131. package/dist/738.creaditor.bundle.js.gz +0 -0
  132. package/dist/7380.creaditor.bundle.js.gz +0 -0
  133. package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  134. package/dist/7463.creaditor.bundle.js.gz +0 -0
  135. package/dist/7466.creaditor.bundle.js.gz +0 -0
  136. package/dist/752.creaditor.bundle.js.gz +0 -0
  137. package/dist/7523.creaditor.bundle.js.gz +0 -0
  138. package/dist/7564.creaditor.bundle.js.gz +0 -0
  139. package/dist/7654.creaditor.bundle.js.gz +0 -0
  140. package/dist/767.creaditor.bundle.js.gz +0 -0
  141. package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  142. package/dist/7789.creaditor.bundle.js.gz +0 -0
  143. package/dist/7838.creaditor.bundle.js.gz +0 -0
  144. package/dist/7918.creaditor.bundle.js.gz +0 -0
  145. package/dist/7937.creaditor.bundle.js.gz +0 -0
  146. package/dist/7997.creaditor.bundle.js.gz +0 -0
  147. package/dist/8042.creaditor.bundle.js.gz +0 -0
  148. package/dist/8064.creaditor.bundle.js.gz +0 -0
  149. package/dist/8141.creaditor.bundle.js.gz +0 -0
  150. package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  151. package/dist/8173.creaditor.bundle.js.gz +0 -0
  152. package/dist/8196.creaditor.bundle.js.gz +0 -0
  153. package/dist/823.creaditor.bundle.js.gz +0 -0
  154. package/dist/8250.creaditor.bundle.js.gz +0 -0
  155. package/dist/8251.creaditor.bundle.js.gz +0 -0
  156. package/dist/8299.creaditor.bundle.js.gz +0 -0
  157. package/dist/8315.creaditor.bundle.js.gz +0 -0
  158. package/dist/8443.creaditor.bundle.js.gz +0 -0
  159. package/dist/8516.creaditor.bundle.js.gz +0 -0
  160. package/dist/8533.creaditor.bundle.js.gz +0 -0
  161. package/dist/8547.creaditor.bundle.js +197 -149
  162. package/dist/8547.creaditor.bundle.js.gz +0 -0
  163. package/dist/8570.creaditor.bundle.js.gz +0 -0
  164. package/dist/8646.creaditor.bundle.js.gz +0 -0
  165. package/dist/8654.creaditor.bundle.js.gz +0 -0
  166. package/dist/8854.creaditor.bundle.js.gz +0 -0
  167. package/dist/8878.creaditor.bundle.js +1 -1
  168. package/dist/8878.creaditor.bundle.js.gz +0 -0
  169. package/dist/8916.creaditor.bundle.js.gz +0 -0
  170. package/dist/8921.creaditor.bundle.js.gz +0 -0
  171. package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  172. package/dist/898.creaditor.bundle.js.gz +0 -0
  173. package/dist/8983.creaditor.bundle.js.gz +0 -0
  174. package/dist/9041.creaditor.bundle.js.gz +0 -0
  175. package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  176. package/dist/9158.creaditor.bundle.js.gz +0 -0
  177. package/dist/9250.creaditor.bundle.js.gz +0 -0
  178. package/dist/9386.creaditor.bundle.js.gz +0 -0
  179. package/dist/9431.creaditor.bundle.js.gz +0 -0
  180. package/dist/9453.creaditor.bundle.js.gz +0 -0
  181. package/dist/9570.creaditor.bundle.js.gz +0 -0
  182. package/dist/9694.creaditor.bundle.js.gz +0 -0
  183. package/dist/975.creaditor.bundle.js.gz +0 -0
  184. package/dist/976.creaditor.bundle.js.gz +0 -0
  185. package/dist/9986.creaditor.bundle.js.gz +0 -0
  186. package/dist/9990.creaditor.bundle.js.gz +0 -0
  187. package/dist/9994.creaditor.bundle.js.gz +0 -0
  188. package/dist/creaditor.bundle.js +263 -256
  189. package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
  190. package/dist/creaditor.bundle.js.gz +0 -0
  191. package/dist/index.html.gz +0 -0
  192. package/dist/service-worker.js +1 -1
  193. package/dist/service-worker.js.gz +0 -0
  194. package/dist/workbox-f3063069.js.gz +0 -0
  195. package/package.json +1 -1
  196. package/dist/2682.creaditor.bundle.js +0 -195
  197. package/dist/2682.creaditor.bundle.js.gz +0 -0
  198. package/dist/5909.creaditor.bundle.js +0 -693
  199. package/dist/5909.creaditor.bundle.js.gz +0 -0
@@ -1,4 +1,4 @@
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:()=>u});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 d=i(86319);const h=(0,r.S)();class u 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=d.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
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:()=>u});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 u 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
2
  rows=${this.row||4}
3
3
  .disabled=${this.disabled}
4
4
  dir="auto"
@@ -49,7 +49,7 @@
49
49
  ${"text"===this.type&&this.maxLength?s.qy`<span class="counter"
50
50
  >${this.value.length}/${this.maxLength}</span
51
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)};h.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}}u.styles=s.AH`
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}}u.styles=s.AH`
53
53
  :host {
54
54
  display: inline-block;
55
55
  --cdtr-input-height: 30px;
@@ -185,7 +185,7 @@
185
185
  box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
186
186
  }
187
187
  }
188
- `,u.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",u)},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`
188
+ `,u.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",u)},73847(t,e,i){i.r(e),i.d(e,{LinkElement:()=>j});var s=i(59929),o=i(86319),r=i(88385);const n=s.AH`
189
189
  :host {
190
190
  --paper-radio-button-checked-color: var(--primary);
191
191
  box-sizing: border-box;
@@ -316,29 +316,161 @@
316
316
  transform: translate(-100%, -50%);
317
317
  top: 55%;
318
318
  }
319
+ /* "Special links" item at the bottom of the link-type dropdown. */
320
+ .special-links-item {
321
+ margin-top: 4px;
322
+ border-top: 1px solid rgba(0, 0, 0, 0.08);
323
+ }
324
+ /* Reads like the other link types; the purple bolt (the toolbar AI
325
+ icon's purple) marks it, and a quiet second line names what is inside. */
326
+ .special-links-label {
327
+ display: flex;
328
+ flex-direction: column;
329
+ gap: 2px;
330
+ min-width: 210px;
331
+ direction: var(--direction-locale);
332
+ text-align: var(--text-align-locale);
333
+ }
334
+ .special-links-title {
335
+ display: inline-flex;
336
+ align-items: center;
337
+ gap: 3px;
338
+ }
339
+ .special-links-title svg {
340
+ width: 14px;
341
+ height: 14px;
342
+ fill: #9747ff;
343
+ }
344
+ .special-links-desc {
345
+ font-size: 11.5px;
346
+ line-height: 1.4;
347
+ color: #00000080;
348
+ white-space: normal;
349
+ }
319
350
  .automations-view {
320
351
  width: 100%;
321
352
  }
322
- .automation-card {
323
- padding: 1rem;
324
- border: 1px solid #e0e0e0;
353
+ .automation-crumbs {
354
+ display: flex;
355
+ align-items: center;
356
+ flex-wrap: wrap;
357
+ gap: 2px;
358
+ margin-bottom: 14px;
359
+ font-size: 13px;
360
+ direction: var(--direction-locale);
361
+ }
362
+ .automation-crumbs .crumb {
363
+ all: unset;
364
+ padding: 2px 4px;
325
365
  border-radius: 4px;
326
- margin-bottom: 0.5rem;
366
+ color: #00000080;
327
367
  cursor: pointer;
328
- transition: all 0.2s;
368
+ }
369
+ .automation-crumbs button.crumb:hover {
370
+ color: var(--primary);
371
+ background: rgba(0, 0, 0, 0.04);
372
+ }
373
+ .automation-crumbs button.crumb:focus-visible {
374
+ outline: 2px solid var(--primary);
375
+ }
376
+ .automation-crumbs .crumb.current {
377
+ color: var(--dark, #000);
378
+ font-weight: 600;
379
+ cursor: default;
380
+ }
381
+ .crumb-sep {
382
+ width: 14px;
383
+ height: 14px;
384
+ flex: 0 0 auto;
385
+ fill: none;
386
+ stroke: #00000050;
387
+ stroke-width: 2;
388
+ stroke-linecap: round;
389
+ stroke-linejoin: round;
390
+ }
391
+ /* Separators and card arrows point "forward" in reading order. */
392
+ .rtl .crumb-sep {
393
+ transform: scaleX(-1);
394
+ }
395
+ .automations-list {
396
+ display: flex;
397
+ flex-direction: column;
398
+ gap: 8px;
399
+ }
400
+ .automation-card {
401
+ all: unset;
402
+ box-sizing: border-box;
403
+ display: flex;
404
+ align-items: center;
405
+ gap: 12px;
406
+ width: 100%;
407
+ padding: 12px;
408
+ border: 1px solid rgba(0, 0, 0, 0.12);
409
+ border-radius: 8px;
410
+ background: #fff;
411
+ cursor: pointer;
412
+ direction: var(--direction-locale);
413
+ text-align: var(--text-align-locale);
414
+ transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
329
415
  }
330
416
  .automation-card:hover {
331
417
  border-color: var(--primary);
332
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
418
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
419
+ }
420
+ .automation-card:focus-visible {
421
+ outline: 2px solid var(--primary);
422
+ outline-offset: 2px;
333
423
  }
334
424
  .automation-card.active {
335
425
  border-color: var(--primary);
336
- background: #e3f2fd;
337
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
426
+ background: rgba(0, 0, 0, 0.02);
338
427
  }
339
- .automation-card.active:hover {
340
- border-color: var(--primary);
341
- box-shadow: 0 2px 6px rgba(0,0,0,0.15);
428
+ .automation-card-icon {
429
+ flex: 0 0 auto;
430
+ display: grid;
431
+ place-items: center;
432
+ width: 36px;
433
+ height: 36px;
434
+ border-radius: 8px;
435
+ background: rgb(233, 237, 243);
436
+ color: var(--dark, #000);
437
+ }
438
+ .automation-card-icon svg {
439
+ width: 18px;
440
+ height: 18px;
441
+ fill: none;
442
+ stroke: currentColor;
443
+ stroke-width: 1.8;
444
+ stroke-linecap: round;
445
+ stroke-linejoin: round;
446
+ }
447
+ .automation-card.active .automation-card-icon {
448
+ background: var(--primary);
449
+ color: #fff;
450
+ }
451
+ .automation-card-text {
452
+ flex: 1 1 auto;
453
+ min-width: 0;
454
+ display: flex;
455
+ flex-direction: column;
456
+ gap: 2px;
457
+ }
458
+ .automation-card-title {
459
+ font-size: 14px;
460
+ font-weight: 600;
461
+ color: var(--dark, #000);
462
+ }
463
+ .automation-card-desc {
464
+ font-size: 12px;
465
+ line-height: 1.4;
466
+ color: #00000080;
467
+ }
468
+ .automation-card .crumb-sep {
469
+ width: 18px;
470
+ height: 18px;
471
+ }
472
+ .automation-card:hover .crumb-sep {
473
+ stroke: var(--primary);
342
474
  }
343
475
  .automation-details-view {
344
476
  width: 100%;
@@ -388,13 +520,13 @@
388
520
  margin-top: 0.75rem;
389
521
  padding-left: 1rem;
390
522
  }
391
- `;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"}],d="cdtrAdd",h="cdtrRemove",u="cdtrAutomation",p=[d,h,u];var m=i(73813);function f(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",b="linkpicker:anchor";function y(){const t=new Set;return function(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}().forEach(e=>{const i=e&&e.props;i&&(i.anchor&&i.anchor.name&&t.add(String(i.anchor.name)),e.type===g&&i.name&&t.add(String(i.name)))}),t}let v=null,x=null;const w="cdtr:anchor-attached";function $(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};A();const e=function(){const t=y();let e=1;for(;t.has(`${g}-${e}`);)e++;return`${g}-${e}`}(),i={id:b,name:g,group:"elements",body:{type:g,props:{name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",b),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,v=s,"function"==typeof t&&(x=function(t){let e=!1;const i=i=>{const s=i&&i.detail&&i.detail.name;!e&&s&&(e=!0,o(),x=null,t(s))},s=()=>{setTimeout(()=>{e||(o(),x=null)},0)};function o(){window.removeEventListener(w,i),document.removeEventListener("mouseup",s,!0)}return window.addEventListener(w,i),document.addEventListener("mouseup",s,!0),o}(t)),s}function A(){v&&window.__dragoned_selected_element===v&&delete window.__dragoned_selected_element,v=null,x&&(x(),x=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`
523
+ `;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",u="cdtrAutomation",p=[h,d,u];var m=i(73813);function f(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",b="linkpicker:anchor";function y(){const t=new Set;return function(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}().forEach(e=>{const i=e&&e.props;i&&(i.anchor&&i.anchor.name&&t.add(String(i.anchor.name)),e.type===g&&i.name&&t.add(String(i.name)))}),t}let x=null,v=null;const w="cdtr:anchor-attached";function $(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k();const e=function(){const t=y();let e=1;for(;t.has(`${g}-${e}`);)e++;return`${g}-${e}`}(),i={id:b,name:g,group:"elements",body:{type:g,props:{name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",b),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,x=s,"function"==typeof t&&(v=function(t){let e=!1;const i=i=>{const s=i&&i.detail&&i.detail.name;!e&&s&&(e=!0,o(),v=null,t(s))},s=()=>{setTimeout(()=>{e||(o(),v=null)},0)};function o(){window.removeEventListener(w,i),document.removeEventListener("mouseup",s,!0)}return window.addEventListener(w,i),document.addEventListener("mouseup",s,!0),o}(t)),s}function k(){x&&window.__dragoned_selected_element===x&&delete window.__dragoned_selected_element,x=null,v&&(v(),v=null)}function A(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`
392
524
  <div class="anchor-create">
393
525
  <div
394
526
  class="anchor-drag draggable-element-handle"
395
527
  role="button"
396
528
  @mousedown=${()=>$({onCreated:t=>{i({target:{value:`#${t}`},anchor:!0}),r()}})}
397
- @mouseup=${()=>{A(),"function"==typeof e&&e("anchor")}}
529
+ @mouseup=${()=>{k(),"function"==typeof e&&e("anchor")}}
398
530
  >
399
531
  <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
400
532
  <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>
@@ -437,9 +569,9 @@
437
569
  </cdtr-dropdown-item>`)}
438
570
  </div>
439
571
  </cdtr-dropdown>
440
- ${k({onRequest:a,onChangeLink:r,onBlur:n})}
572
+ ${A({onRequest:a,onChangeLink:r,onBlur:n})}
441
573
  </cdtr-row>
442
- `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?f("body",e):i||e.params.body,d="string"==typeof e?f("subject",e):o||e.params.subject;return s.qy`
574
+ `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?f("body",e):i||e.params.body,h="string"==typeof e?f("subject",e):o||e.params.subject;return s.qy`
443
575
  <cdtr-row spacing="5">
444
576
  <cdtr-title class="explain-title"
445
577
  ><lang-text text="add_catchy_subject"></lang-text
@@ -448,7 +580,7 @@
448
580
  inputStyle="height:${"40px"};"
449
581
  style="width:${l};"
450
582
  @change=${t=>{let{target:e}=t;a(e.value),r()}}
451
- value=${d||o||""}
583
+ value=${h||o||""}
452
584
  ></cdtr-input>
453
585
  <cdtr-title class="explain-title"
454
586
  ><lang-text text="email_body_if_needed"></lang-text
@@ -484,7 +616,7 @@
484
616
  @change=${t=>{let{target:e}=t;r(e.value),o()}}
485
617
  ></cdtr-input>
486
618
  </cdtr-row>
487
- `}(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))||f("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 d=`https://wa.me/${a}`;c&&(d+=`?text=${c}`);const h=new r.A(d);return h.target=o||h.target||"_blank",{url:h,params:h.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 L(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 R(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e,i)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e,label:i||e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name,e.anchor.label):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}function U(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:d,placeholder:h="",inputStyle:u="",style:p="width:260px;",width:m=l}=t,f=t=>{r&&r(t),n&&n()},g=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
619
+ `}(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))||f("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 L(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 R(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e,i)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e,label:i||e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name,e.anchor.label):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}function U(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:h,placeholder:d="",inputStyle:u="",style:p="width:260px;",width:m=l}=t,f=t=>{r&&r(t),n&&n()},g=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
488
620
  <cdtr-row style="position:relative;" spacing="5">
489
621
  <span style="display:none;" aria-hidden="true">${e}</span>
490
622
  <cdtr-input
@@ -495,15 +627,15 @@
495
627
  .autofocus=${o}
496
628
  type="search"
497
629
  width="${m}"
498
- placeholder="${h}"
630
+ placeholder="${d}"
499
631
  @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)}}
500
632
  @change=${f}
501
633
  @focus=${c}
502
- @submit=${d||f}
634
+ @submit=${h||f}
503
635
  .value="${g}"
504
636
  ></cdtr-input>
505
637
  </cdtr-row>
506
- `}function M(){return s.qy`
638
+ `}const M="automation:";function C(){return s.qy`
507
639
  <style>
508
640
  .save-success-container {
509
641
  margin-bottom: 1rem;
@@ -614,58 +746,42 @@
614
746
  </span>
615
747
  </div>
616
748
  </div>
617
- `}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(function(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"}),e.unsubscribe&&this.automations.push({id:"unsubscribe",name:"unsubscribe"})}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((0,m.r_)(t))this.parseAutomationLink(this.href);else{const t=new r.A(this.href);t.params&&t.params[u]?(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=p,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=this.selectedAutomation.name||this.selectedAutomation.id;if("unsubscribe"===this.selectedAutomation.id)return(0,m.LX)(t);const e={};if(this.selectedMailingListsForAdd.length>0&&(e[d]=this.selectedMailingListsForAdd.join(",")),this.selectedMailingListsForRemove.length>0&&(e[h]=this.selectedMailingListsForRemove.join(",")),0===Object.keys(e).length)return null;if(this.baseUrl&&this.baseUrl.trim()){let t=this.baseUrl.trim();t.match(/^https?:\/\//i)||t.includes("://")||!t.includes(".")&&t.match(/^[a-zA-Z]+:/)||(t=`https://${t}`),e.url=t}return(0,m.LX)(t,e)}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=(0,m.IW)(t);if(!e)return void console.error("Invalid automation link format:",t);const i=e.name,s=e.params,o=s.url;let n;if(delete s.url,n=o?new r.A(o):new r.A("https://example.com"),n.params||(n.params={}),s[d]&&(n.params[d]=s[d]),s[h]&&(n.params[h]=s[h]),n.params[u]=i,n.href=t,n.url=o||"",this.href=n,this.protocol=null,this.value=n,this.link=n,this.lastUrl=n,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[u])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=(0,m.IW)(String(t));if(e){const i=e.params,s=i.url,o=s?new r.A(s):new r.A("https://example.com");o.params||(o.params={}),i[d]&&(o.params[d]=i[d]),i[h]&&(o.params[h]=i[h]),o.params[u]=e.name,o.href=t,o.url=s||"",this.href=o,this.value=o,this.link=o,this.lastUrl=o,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;const o="string"==typeof s?(0,m.IW)(s):null;if(o?(i=!0,e=o.name):t.params&&(e=t.params[u],i=e&&""!==e&&"string"==typeof e&&""!==e.trim()),!i)return;if(o){const t=o.params;if(t.url?this.baseUrl=t.url:this.baseUrl="",t[d]){const e="string"==typeof t[d]?t[d].split(",").filter(t=>t.trim()):Array.isArray(t[d])?t[d]:[];this.selectedMailingListsForAdd=e}if(t[h]){const e="string"==typeof t[h]?t[h].split(",").filter(t=>t.trim()):Array.isArray(t[h])?t[h]:[];this.selectedMailingListsForRemove=e}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,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.selectedMailingListsForAdd=e}if(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.selectedMailingListsForRemove=e}}const r=String(e).trim(),n=(this.automations||[]).find(t=>t.name&&String(t.name).trim()===r||t.id&&String(t.id).trim()===r);if(this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0||"unsubscribe"===n?.id){this.showAutomations=!0;const t=n||this.automations?.[0];t&&(this.selectedAutomation=t,this.activeAutomationId=t.id)}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
749
+ `}function q(){const t=o.M.get("config","editor","configure","editorProps","automations")||{},e=[];return t.addAndRemoveFromMailingList&&e.push({id:"addAndRemoveFromMailingList",name:"moving_from_mailing_list",description:"automation_desc_mailing_list",icon:"lists"}),t.unsubscribe&&e.push({id:"unsubscribe",name:"unsubscribe",description:"automation_desc_unsubscribe",icon:"unsubscribe"}),e}const B={lists:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true">
750
+ <path d="M4 6h11M4 12h11M4 18h7M18 15v6M15 18h6" />
751
+ </svg>`,unsubscribe:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true">
752
+ <rect x="3" y="5" width="18" height="14" rx="2" />
753
+ <path d="m3 7 9 6 9-6M15 16l4-4M19 16l-4-4" />
754
+ </svg>`},I=s.qy`<svg class="crumb-sep" viewBox="0 0 24 24" aria-hidden="true">
755
+ <path d="m9 6 6 6-6 6" />
756
+ </svg>`;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 j extends(function(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||[],this.automations=q()}onAutomationsClick(){if(this.automations=q(),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((0,m.r_)(t))this.parseAutomationLink(this.href);else{const t=new r.A(this.href);t.params&&t.params[u]?(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=p,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()}exitAutomations(){this.selectedAutomation&&this.onBackClick(),this.onBackClick()}renderAutomationsBreadcrumb(){const t=[{text:"link",onClick:()=>this.exitAutomations()}];return this.selectedAutomation?(t.push({text:"link_automations_title",onClick:()=>this.onBackClick()}),t.push({text:this.selectedAutomation.name})):t.push({text:"link_automations_title"}),s.qy`<nav class="automation-crumbs" aria-label="breadcrumb">
757
+ ${t.map((t,e)=>s.qy`
758
+ ${e>0?I:null}
759
+ ${t.onClick?s.qy`<button type="button" class="crumb" @click=${t.onClick}>
760
+ <lang-text text="${t.text}"></lang-text>
761
+ </button>`:s.qy`<span class="crumb current" aria-current="page">
762
+ <lang-text text="${t.text}"></lang-text>
763
+ </span>`}
764
+ `)}
765
+ </nav>`}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=this.selectedAutomation.name||this.selectedAutomation.id;if("unsubscribe"===this.selectedAutomation.id)return(0,m.LX)(t);const e={};if(this.selectedMailingListsForAdd.length>0&&(e[h]=this.selectedMailingListsForAdd.join(",")),this.selectedMailingListsForRemove.length>0&&(e[d]=this.selectedMailingListsForRemove.join(",")),0===Object.keys(e).length)return null;if(this.baseUrl&&this.baseUrl.trim()){let t=this.baseUrl.trim();t.match(/^https?:\/\//i)||t.includes("://")||!t.includes(".")&&t.match(/^[a-zA-Z]+:/)||(t=`https://${t}`),e.url=t}return(0,m.LX)(t,e)}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=(0,m.IW)(t);if(!e)return void console.error("Invalid automation link format:",t);const i=e.name,s=e.params,o=s.url;let n;if(delete 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[u]=i,n.href=t,n.url=o||"",this.href=n,this.protocol=null,this.value=n,this.link=n,this.lastUrl=n,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[u])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=(0,m.IW)(String(t));if(e){const i=e.params,s=i.url,o=s?new r.A(s):new r.A("https://example.com");o.params||(o.params={}),i[h]&&(o.params[h]=i[h]),i[d]&&(o.params[d]=i[d]),o.params[u]=e.name,o.href=t,o.url=s||"",this.href=o,this.value=o,this.link=o,this.lastUrl=o,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;const o="string"==typeof s?(0,m.IW)(s):null;if(o?(i=!0,e=o.name):t.params&&(e=t.params[u],i=e&&""!==e&&"string"==typeof e&&""!==e.trim()),!i)return;if(o){const t=o.params;if(t.url?this.baseUrl=t.url:this.baseUrl="",t[h]){const e="string"==typeof t[h]?t[h].split(",").filter(t=>t.trim()):Array.isArray(t[h])?t[h]:[];this.selectedMailingListsForAdd=e}if(t[d]){const e="string"==typeof t[d]?t[d].split(",").filter(t=>t.trim()):Array.isArray(t[d])?t[d]:[];this.selectedMailingListsForRemove=e}}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}}const r=String(e).trim(),n=(this.automations||[]).find(t=>t.name&&String(t.name).trim()===r||t.id&&String(t.id).trim()===r);if(this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0||"unsubscribe"===n?.id){this.showAutomations=!0;const t=n||this.automations?.[0];t&&(this.selectedAutomation=t,this.activeAutomationId=t.id)}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
618
766
  <div class="automations-view">
619
- <cdtr-row justify="space-between" alignItems="center" mb="1">
620
- <cdtr-title
621
- style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
622
- >
623
- <lang-text text="automations"></lang-text>
624
- </cdtr-title>
625
- <paper-button
626
- @click=${this.onBackClick}
627
- style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
628
- >
629
- <lang-text text="back"></lang-text>
630
- </paper-button>
631
- </cdtr-row>
632
- <cdtr-divider></cdtr-divider>
633
- <div class="automations-list" style="margin-top: 1rem;">
767
+ ${this.renderAutomationsBreadcrumb()}
768
+ <div class="automations-list">
634
769
  ${this.automations.map(t=>{const e=this.activeAutomationId===t.id;return s.qy`
635
- <div
770
+ <button
771
+ type="button"
636
772
  class="automation-card ${e?"active":""}"
637
773
  @click=${()=>this.onAutomationClick(t)}
638
- style="
639
- padding: 1rem;
640
- border: 2px solid ${e?"var(--primary)":"#e0e0e0"};
641
- border-radius: 4px;
642
- margin-bottom: 0.5rem;
643
- cursor: pointer;
644
- transition: all 0.2s;
645
- background: ${e?"#e3f2fd":"#fff"};
646
- "
647
- @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="var(--primary)",t.currentTarget.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)")}}
648
- @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.boxShadow="none")}}
649
774
  >
650
- <cdtr-row justify="space-between" alignItems="center">
651
- <cdtr-title
652
- style="font-size: 14px; color: ${e?"var(--primary)":"#000"}; font-weight: ${e?"600":"400"};"
653
- >
654
- <lang-text text="${t.name}"></lang-text>
655
- </cdtr-title>
656
- ${e?s.qy`
657
- <span
658
- style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
659
- >✓</span
660
- >
661
- `:null}
662
- </cdtr-row>
663
- </div>
775
+ <span class="automation-card-icon">${B[t.icon]}</span>
776
+ <span class="automation-card-text">
777
+ <span class="automation-card-title"><lang-text text="${t.name}"></lang-text></span>
778
+ ${t.description?s.qy`<span class="automation-card-desc"
779
+ ><lang-text whiteSpace="break-spaces" text="${t.description}"></lang-text
780
+ ></span>`:null}
781
+ </span>
782
+ ${I}
783
+ </button>
664
784
  `})}
665
- <!-- coming soon -->
666
- <h6 align="center">
667
- <lang-text whiteSpace="break-spaces" text="coming_soon_automations"></lang-text>
668
- </h6>
669
785
  </div>
670
786
  </div>
671
787
  `}renderUnsubscribeDetails(){return s.qy`
@@ -674,25 +790,12 @@
674
790
  style="display: flex; flex-direction: column; height: 100%;"
675
791
  >
676
792
  <div style="flex: 0 0 auto;">
677
- <cdtr-row justify="space-between" alignItems="center" mb="1">
678
- <cdtr-title
679
- style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
680
- >
681
- <lang-text text="automation_settings"></lang-text>
682
- </cdtr-title>
683
- <paper-button
684
- @click=${this.onBackClick}
685
- style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
686
- >
687
- <lang-text text="back"></lang-text>
688
- </paper-button>
689
- </cdtr-row>
690
- <cdtr-divider></cdtr-divider>
793
+ ${this.renderAutomationsBreadcrumb()}
691
794
  </div>
692
795
 
693
796
  <div class="automation-content">
694
797
  <!-- Success Message -->
695
- ${this.showSaveSuccess?M():null}
798
+ ${this.showSaveSuccess?C():null}
696
799
 
697
800
  <h6
698
801
  class="explain-title"
@@ -731,25 +834,12 @@
731
834
  style="display: flex; flex-direction: column; height: 100%;"
732
835
  >
733
836
  <div style="flex: 0 0 auto;">
734
- <cdtr-row justify="space-between" alignItems="center" mb="1">
735
- <cdtr-title
736
- style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
737
- >
738
- <lang-text text="automation_settings"></lang-text>
739
- </cdtr-title>
740
- <paper-button
741
- @click=${this.onBackClick}
742
- style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
743
- >
744
- <lang-text text="back"></lang-text>
745
- </paper-button>
746
- </cdtr-row>
747
- <cdtr-divider></cdtr-divider>
837
+ ${this.renderAutomationsBreadcrumb()}
748
838
  </div>
749
839
 
750
840
  <div class="automation-content">
751
841
  <!-- Success Message -->
752
- ${this.showSaveSuccess?M():null}
842
+ ${this.showSaveSuccess?C():null}
753
843
 
754
844
  <!-- URL Input (Optional) -->
755
845
  <div style="margin-bottom: 1.5rem;">
@@ -924,52 +1014,67 @@
924
1014
  </cdtr-row>
925
1015
  </div>
926
1016
  </div>
927
- `}}}(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=L(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=R()}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||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[u];(e||i)&&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="");(0,m.r_)(n)||i.params&&i.params[u]?(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 d=String(i.href||""),h=(0,m.r_)(d),f=i.params&&i.params[u];if(h)c=d;else if(f){const t=p,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),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const v=o.M.get("config","editor","configure","editorProps","automations"),x={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}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,A=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,k=this.urlInputFocused&&this._urlInputRawValue&&w&&!A;$&&!k?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const S=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,L={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:S};return this.showAutomations?s.qy` <div class="root">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
928
- ${B=this.label,B?s.qy`<cdtr-title
1017
+ `}}}(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=L(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=R()}onChangeType(t){if(t===M)return void this.onAutomationsClick();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||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[u];(e||i)&&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){const t=void 0===this._lastBodySyncHref;this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");(0,m.r_)(n)||i.params&&i.params[u]?(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,t&&this.openAutomations&&q().length&&this.onAutomationsClick())}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=(0,m.r_)(h),f=i.params&&i.params[u];if(d)c=h;else if(f){const t=p,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),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const x=q(),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}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,k=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&w&&!k;$&&!A?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const S=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,L={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:S},R="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();return this.showAutomations?s.qy` <div class="root ${R?"rtl":""}">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
1018
+ ${z=this.label,z?s.qy`<cdtr-title
929
1019
  style="font-weight: 700;
930
1020
  font-size: 14.4px;
931
1021
  margin-bottom: 0.6rem;
932
1022
  color: #000000b0;"
933
- ><lang-text text=${B}></lang-text
1023
+ ><lang-text text=${z}></lang-text
934
1024
  ><cdtr-divider></cdtr-divider
935
1025
  ></cdtr-title>`:null}
936
1026
  <cdtr-row alignItems="center" justify="space-between" spacing="10">
937
- ${q=this.options,j=this.protocol,F=this.onChangeType.bind(this),s.qy`
938
- <cdtr-dropdown @change=${t=>F(t.target.value)}>
1027
+ ${function(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return s.qy`
1028
+ <cdtr-dropdown @change=${t=>i(t.target.value)}>
939
1029
  <cdtr-dropdown-button
940
1030
  minWidth=${100}
941
1031
  class=" dropdown-button"
942
1032
  slot="trigger"
943
1033
  ><lang-text
944
- .text="${q.find(t=>t.type===j)?.text||"link"}"
1034
+ .text="${t.find(t=>t.type===e)?.text||"link"}"
945
1035
  ></lang-text>
946
1036
  </cdtr-dropdown-button>
947
1037
  <div slot="content">
948
- ${q.map(t=>s.qy`<cdtr-dropdown-item
949
- .focused=${t.type===j}
950
- .selected=${t.type===j}
1038
+ ${t.map(t=>s.qy`<cdtr-dropdown-item
1039
+ .focused=${t.type===e}
1040
+ .selected=${t.type===e}
951
1041
  value="${t.type}"
952
1042
  ><lang-text text="${t.text}"></lang-text>
953
1043
  </cdtr-dropdown-item>`)}
1044
+ ${o.length?s.qy`<cdtr-dropdown-item value="${M}" class="special-links-item">
1045
+ <span class="special-links-label">
1046
+ <span class="special-links-title">
1047
+ <svg viewBox="0 0 24 24" aria-hidden="true">
1048
+ <path d="M13 2 4.5 13.5H11L10 22l8.5-11.5H12L13 2Z" />
1049
+ </svg>
1050
+ <lang-text text="link_automations_title"></lang-text>
1051
+ </span>
1052
+ <span class="special-links-desc">
1053
+ ${o.map((t,e)=>s.qy`${e>0?" · ":""}<lang-text
1054
+ text="${t.name}"
1055
+ ></lang-text>`)}
1056
+ </span>
1057
+ </span>
1058
+ </cdtr-dropdown-item>`:null}
954
1059
  </div>
955
1060
  </cdtr-dropdown>
956
- `}
957
- ${C=this.target,I=this.onChangeTarget.bind(this),s.qy`
958
- <cdtr-dropdown @change=${t=>I(t)} style="min-width: 120px;">
1061
+ `}(this.options,this.protocol,this.onChangeType.bind(this),x)}
1062
+ ${F=this.target,E=this.onChangeTarget.bind(this),s.qy`
1063
+ <cdtr-dropdown @change=${t=>E(t)} style="min-width: 120px;">
959
1064
  <cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
960
- <lang-text .text=${C}></lang-text>
1065
+ <lang-text .text=${F}></lang-text>
961
1066
  </cdtr-dropdown-button>
962
1067
  <div slot="content">
963
- <cdtr-dropdown-item value="_blank" .selected=${"_blank"===C}>
1068
+ <cdtr-dropdown-item value="_blank" .selected=${"_blank"===F}>
964
1069
  <lang-text text="open_in_new_tab"></lang-text>
965
1070
  </cdtr-dropdown-item>
966
- <cdtr-dropdown-item value="_self" .selected=${"_self"===C}>
1071
+ <cdtr-dropdown-item value="_self" .selected=${"_self"===F}>
967
1072
  <lang-text text="open_in_same_tab"></lang-text>
968
1073
  </cdtr-dropdown-item>
969
- <cdtr-dropdown-item value="_parent" .selected=${"_parent"===C}>
1074
+ <cdtr-dropdown-item value="_parent" .selected=${"_parent"===F}>
970
1075
  <lang-text text="open_in_parent_frame"></lang-text>
971
1076
  </cdtr-dropdown-item>
972
- <cdtr-dropdown-item value="_top" .selected=${"_top"===C}>
1077
+ <cdtr-dropdown-item value="_top" .selected=${"_top"===F}>
973
1078
  <lang-text text="open_in_top_frame"></lang-text>
974
1079
  </cdtr-dropdown-item>
975
1080
  </div>
@@ -977,11 +1082,11 @@
977
1082
  `}
978
1083
  </cdtr-row>
979
1084
  <cdtr-row mt="1">
980
- ${function(t,e){return 0===t.length?null:s.qy`${t.map(t=>s.qy`<paper-button
981
- @click=${()=>e(t.type)}
1085
+ ${I=l,j=this.onChangeType.bind(this),0===I.length?null:s.qy`${I.map(t=>s.qy`<paper-button
1086
+ @click=${()=>j(t.type)}
982
1087
  style="background:rgb(233, 237, 243);color:#000;font-size:13px;margin:0;margin-right:5px;"
983
1088
  ><lang-text text="${t.text}"></lang-text
984
- ></paper-button>`)}`}(l,this.onChangeType.bind(this))}
1089
+ ></paper-button>`)}`}
985
1090
  </cdtr-row>
986
1091
 
987
1092
  <div class="input-wrapper">
@@ -989,23 +1094,7 @@
989
1094
  ><lang-text .text="${g}"></lang-text
990
1095
  ></cdtr-title>
991
1096
  ${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:U({value:c,inputRef:o,autofocus:s,onChange:r,onBlur:n,onFocus:a,onKeyDown:l})}(L)}
992
- ${_(this.protocol,x)}
993
- ${v?s.qy` <cdtr-divider></cdtr-divider>
994
- <cdtr-row justify="flex-start" mt="1">
995
- <cdtr-title class="explain-title"
996
- ><lang-text
997
- whiteSpace="break-spaces"
998
- text="need_automations"
999
- ></lang-text>
1000
- </cdtr-title>
1001
- <paper-button
1002
- @click=${this.onAutomationsClick.bind(this)}
1003
- style="background:#000;color:#fff;font-size:13px;margin:0;width:100%;"
1004
- >
1005
- <lang-text text="menu_automations"></lang-text>
1006
- </paper-button>
1007
- <cdtr-divider></cdtr-divider
1008
- ></cdtr-row>`:null}
1097
+ ${_(this.protocol,v)}
1009
1098
  ${function(t,e,i,o){return t&&Array.isArray(t)&&0!==t.length?s.qy`<cdtr-list-picker
1010
1099
  .selected=${e}
1011
1100
  @change=${t=>{i({target:{value:t.target.value}}),o()}}
@@ -1014,10 +1103,10 @@
1014
1103
  ></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
1015
1104
  </div>
1016
1105
 
1017
- ${R=this.hasButton,M=this.onClickOk.bind(this),R?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
1106
+ ${C=this.hasButton,B=this.onClickOk.bind(this),C?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
1018
1107
  <cdtr-row justify="flex-end" mt="1">
1019
- <paper-button fullWidth @click=${M} raised class="add-button">
1108
+ <paper-button fullWidth @click=${B} raised class="add-button">
1020
1109
  <lang-text text="add_now"></lang-text>
1021
1110
  </paper-button>
1022
1111
  </cdtr-row>`:null}
1023
- </div>`;var R,M,C,I,q,j,F,B}}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||this.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(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}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(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${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}}]);
1112
+ </div>`;var C,B,I,j,F,E,z}}j.styles=n,j.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},openAutomations:{type:Boolean}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",j)},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||this.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(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}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(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${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}}]);