PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0
Elementor Website Builder – more than just a page builder v3.32.0
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / floating-buttons / base / widget-contact-button-base.php

widget-contact-button-base.php in Elementor Website Builder – more than just a page builder 3.32.0, at modules/floating-buttons/base/widget-contact-button-base.php

3,133 lines 83.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\FloatingButtons\Base;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Core\Base\Providers\Social_Network_Provider;
7 use Elementor\Core\Base\Traits\Shared_Widget_Controls_Trait;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Modules\FloatingButtons\Classes\Render\Contact_Buttons_Core_Render;
11 use Elementor\Modules\FloatingButtons\Documents\Floating_Buttons;
12 use Elementor\Plugin;
13 use Elementor\Repeater;
14 use Elementor\Utils;
15 use Elementor\Widget_Base;
16
17 abstract class Widget_Contact_Button_Base extends Widget_Base {
18
19 use Shared_Widget_Controls_Trait;
20
21 const TAB_ADVANCED = 'advanced-tab-floating-buttons';
22
23 public function show_in_panel(): bool {
24 return false;
25 }
26
27 public function get_group_name(): string {
28 return 'floating-buttons';
29 }
30
31 public function get_style_depends(): array {
32 $widget_name = $this->get_name();
33
34 $style_depends = Plugin::$instance->experiments->is_feature_active( 'e_font_icon_svg' )
35 ? parent::get_style_depends()
36 : [ 'elementor-icons-fa-solid', 'elementor-icons-fa-brands', 'elementor-icons-fa-regular' ];
37
38 $style_depends[] = 'widget-contact-buttons-base';
39
40 if ( 'contact-buttons' !== $widget_name ) {
41 $style_depends[] = "widget-{$widget_name}";
42 }
43
44 return $style_depends;
45 }
46
47 public function has_widget_inner_wrapper(): bool {
48 return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
49 }
50
51 public function hide_on_search(): bool {
52 return true;
53 }
54
55 protected function get_initial_config(): array {
56 return array_merge( parent::get_initial_config(), [
57 'commonMerged' => true,
58 ] );
59 }
60
61 public static function get_configuration() {
62 return [
63 'content' => [
64 'chat_button_section' => [
65 'section_name' => esc_html__( 'Chat Button', 'elementor' ),
66 'has_platform' => true,
67 'has_icon' => false,
68 'icon_default' => [
69 'value' => 'far fa-comment-dots',
70 'library' => 'fa-regular',
71 ],
72 'icons_recommended' => [
73 'fa-regular' => [
74 'comment',
75 'comment-dots',
76 'comment-alt',
77 ],
78 'fa-solid' => [
79 'ellipsis-v',
80 ],
81 ],
82 'has_notification_dot' => true,
83 'has_notification_dot_default_enabled' => true,
84 'has_active_tab' => false,
85 'has_display_text' => false,
86 'display_text_label' => esc_html__( 'Call now', 'elementor' ),
87 'has_display_text_select' => true,
88 'platform' => [
89 'group' => [
90 Social_Network_Provider::EMAIL,
91 Social_Network_Provider::SMS,
92 Social_Network_Provider::WHATSAPP,
93 Social_Network_Provider::SKYPE,
94 Social_Network_Provider::MESSENGER,
95 Social_Network_Provider::VIBER,
96 ],
97 'default' => Social_Network_Provider::WHATSAPP,
98 ],
99 'chat_aria_label' => Floating_Buttons::get_title(),
100 'defaults' => [
101 'mail' => null,
102 'mail_subject' => null,
103 'mail_body' => null,
104 'number' => null,
105 'username' => null,
106 'location' => [
107 'is_external' => true,
108 ],
109 'url' => [
110 'is_external' => true,
111 ],
112 ],
113 'has_accessible_name' => true,
114 ],
115 'top_bar_section' => [
116 'section_name' => esc_html__( 'Top Bar', 'elementor' ),
117 'has_image' => true,
118 'has_active_dot' => true,
119 'has_subtitle' => true,
120 'title' => [
121 'label' => esc_html__( 'Name', 'elementor' ),
122 'default' => esc_html__( 'Rob Jones', 'elementor' ),
123 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
124 'dynamic' => false,
125 'ai' => false,
126 'label_block' => false,
127 ],
128 'subtitle' => [
129 'label' => esc_html__( 'Title', 'elementor' ),
130 'default' => esc_html__( 'Store Manager', 'elementor' ),
131 'placeholder' => esc_html__( 'Type your title here', 'elementor' ),
132 'dynamic' => false,
133 'ai' => false,
134 'label_block' => false,
135 ],
136 ],
137 'message_bubble_section' => [
138 'has_typing_animation' => true,
139 ],
140 'contact_section' => [
141 'section_name' => esc_html__( 'Contact Buttons', 'elementor' ),
142 'has_cta_text' => true,
143 'repeater' => [
144 'has_tooltip' => false,
145 'tooltip_label' => esc_html__( 'Text', 'elementor' ),
146 'tooltip_default' => esc_html__( 'Tooltip', 'elementor' ),
147 'tooltip_placeholder' => esc_html__( 'Enter icon text', 'elementor' ),
148 'has_title' => false,
149 'has_description' => false,
150 ],
151 'platform' => [
152 'group-1' => [
153 Social_Network_Provider::EMAIL,
154 Social_Network_Provider::SMS,
155 Social_Network_Provider::WHATSAPP,
156 Social_Network_Provider::SKYPE,
157 Social_Network_Provider::MESSENGER,
158 Social_Network_Provider::VIBER,
159 ],
160 'limit' => 5,
161 'min_items' => 0,
162 ],
163 'default' => [
164 [
165 'contact_icon_platform' => Social_Network_Provider::WHATSAPP,
166 ],
167 [
168 'contact_icon_platform' => Social_Network_Provider::EMAIL,
169 ],
170 [
171 'contact_icon_platform' => Social_Network_Provider::SMS,
172 ],
173 [
174 'contact_icon_platform' => Social_Network_Provider::VIBER,
175 ],
176 [
177 'contact_icon_platform' => Social_Network_Provider::MESSENGER,
178 ],
179 ],
180 'has_accessible_name' => true,
181 ],
182 'send_button_section' => [
183 'section_name' => esc_html__( 'Send Button', 'elementor' ),
184 'has_link' => false,
185 'text' => [
186 'default' => esc_html__( 'Click to start chat', 'elementor' ),
187 ],
188 ],
189 ],
190 'style' => [
191 'has_platform_colors' => true,
192 'chat_button_section' => [
193 'has_entrance_animation' => true,
194 'has_box_shadow' => true,
195 'has_drop_shadow' => false,
196 'has_padding' => false,
197 'has_button_size' => true,
198 'button_size_default' => 'small',
199 'has_typography' => false,
200 'has_icon_position' => false,
201 'has_icon_spacing' => false,
202 'has_tabs' => true,
203 'has_platform_color_controls' => false,
204 'hover_animation_type' => 'default',
205 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
206 ],
207 'top_bar_section' => [
208 'has_title_heading' => true,
209 'title_heading_label' => esc_html__( 'Name', 'elementor' ),
210 'subtitle_heading_label' => esc_html__( 'Title', 'elementor' ),
211 'has_style_close_button' => true,
212 'has_close_button_heading' => false,
213 'has_background' => true,
214 'has_background_heading' => false,
215 ],
216 'message_bubble_section' => [
217 'has_chat_background' => true,
218 ],
219 'contact_section' => [
220 'has_buttons_heading' => true,
221 'buttons_heading_label' => esc_html__( 'Buttons', 'elementor' ),
222 'has_buttons_size' => true,
223 'has_box_shadow' => false,
224 'has_buttons_spacing' => false,
225 'has_hover_animation' => true,
226 'has_chat_box_animation' => false,
227 'has_icon_bg_color' => true,
228 'has_button_bar' => false,
229 'has_tabs' => true,
230 'has_text_color' => false,
231 'has_bg_color' => false,
232 'has_padding' => false,
233 'has_button_corners' => false,
234 'has_typography' => false,
235 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
236 'has_hover_transition_duration' => false,
237 ],
238 'send_button_section' => [
239 'has_platform_colors' => true,
240 'has_icon_color' => true,
241 'has_background_color' => true,
242 'has_text_color' => false,
243 'has_typography' => true,
244 'typography_selector' => '{{WRAPPER}} .e-contact-buttons__send-cta',
245 ],
246 'chat_box_section' => [
247 'section_name' => esc_html__( 'Chat Box', 'elementor' ),
248 'has_width' => true,
249 'has_padding' => false,
250 ],
251 ],
252 'advanced' => [
253 'has_layout_position' => true,
254 'horizontal_position_default' => 'end',
255 'has_mobile_full_width' => false,
256 'has_vertical_offset' => true,
257 'has_horizontal_offset' => true,
258 ],
259 ];
260 }
261
262 public function get_icon(): string {
263 return 'eicon-commenting-o';
264 }
265
266 public function get_categories(): array {
267 return [ 'general' ];
268 }
269
270 protected function register_controls(): void {
271
272 $this->add_content_tab();
273
274 $this->add_style_tab();
275
276 $this->add_advanced_tab();
277 }
278
279 private function social_media_controls(): void {
280 $config = static::get_configuration();
281
282 $this->add_control(
283 'chat_button_mail',
284 [
285 'label' => esc_html__( 'Email', 'elementor' ),
286 'type' => Controls_Manager::TEXT,
287 'dynamic' => [
288 'active' => true,
289 ],
290 'ai' => [
291 'active' => false,
292 ],
293 'label_block' => true,
294 'placeholder' => esc_html__( '@', 'elementor' ),
295 'default' => $config['content']['chat_button_section']['defaults']['mail'],
296 'condition' => [
297 'chat_button_platform' => Social_Network_Provider::EMAIL,
298 ],
299 ],
300 );
301
302 $this->add_control(
303 'chat_button_mail_subject',
304 [
305 'label' => esc_html__( 'Subject', 'elementor' ),
306 'type' => Controls_Manager::TEXT,
307 'dynamic' => [
308 'active' => true,
309 ],
310 'label_block' => true,
311 'default' => $config['content']['chat_button_section']['defaults']['mail_subject'],
312 'condition' => [
313 'chat_button_platform' => Social_Network_Provider::EMAIL,
314 ],
315 ],
316 );
317
318 $this->add_control(
319 'chat_button_mail_body',
320 [
321 'label' => esc_html__( 'Message', 'elementor' ),
322 'type' => Controls_Manager::TEXTAREA,
323 'default' => $config['content']['chat_button_section']['defaults']['mail_body'],
324 'condition' => [
325 'chat_button_platform' => Social_Network_Provider::EMAIL,
326 ],
327 ]
328 );
329
330 $this->add_control(
331 'chat_button_number',
332 [
333 'label' => esc_html__( 'Number', 'elementor' ),
334 'type' => Controls_Manager::TEXT,
335 'dynamic' => [
336 'active' => true,
337 ],
338 'ai' => [
339 'active' => false,
340 ],
341 'label_block' => true,
342 'placeholder' => esc_html__( '+', 'elementor' ),
343 'default' => $config['content']['chat_button_section']['defaults']['number'],
344 'condition' => [
345 'chat_button_platform' => [
346 Social_Network_Provider::SMS,
347 Social_Network_Provider::WHATSAPP,
348 Social_Network_Provider::VIBER,
349 Social_Network_Provider::TELEPHONE,
350 ],
351 ],
352 ],
353 );
354
355 $this->add_control(
356 'chat_button_username',
357 [
358 'label' => esc_html__( 'Username', 'elementor' ),
359 'type' => Controls_Manager::TEXT,
360 'dynamic' => [
361 'active' => true,
362 ],
363 'ai' => [
364 'active' => false,
365 ],
366 'label_block' => true,
367 'default' => $config['content']['chat_button_section']['defaults']['username'],
368 'condition' => [
369 'chat_button_platform' => [
370 Social_Network_Provider::SKYPE,
371 Social_Network_Provider::MESSENGER,
372 ],
373 ],
374 ],
375 );
376
377 $this->add_control(
378 'chat_button_viber_action',
379 [
380 'label' => esc_html__( 'Action', 'elementor' ),
381 'type' => Controls_Manager::SELECT,
382 'default' => 'chat',
383 'options' => [
384 'chat' => 'Chat',
385 'contact' => 'Contact',
386 ],
387 'condition' => [
388 'chat_button_platform' => Social_Network_Provider::VIBER,
389 ],
390 ]
391 );
392
393 $this->add_control(
394 'chat_button_waze',
395 [
396 'label' => esc_html__( 'Location', 'elementor' ),
397 'type' => Controls_Manager::URL,
398 'dynamic' => [
399 'active' => true,
400 ],
401 'ai' => [
402 'active' => false,
403 ],
404 'label_block' => true,
405 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
406 'default' => $config['content']['chat_button_section']['defaults']['location'],
407 'condition' => [
408 'chat_button_platform' => [
409 Social_Network_Provider::WAZE,
410 ],
411 ],
412 ],
413 );
414
415 $this->add_control(
416 'chat_button_url',
417 [
418 'label' => esc_html__( 'Link', 'elementor' ),
419 'type' => Controls_Manager::URL,
420 'dynamic' => [
421 'active' => true,
422 ],
423 'ai' => [
424 'active' => false,
425 ],
426 'autocomplete' => true,
427 'label_block' => true,
428 'default' => $config['content']['chat_button_section']['defaults']['url'],
429 'condition' => [
430 'chat_button_platform' => [
431 Social_Network_Provider::URL,
432 ],
433 ],
434 ],
435 );
436 }
437
438 private function get_display_text_condition( $condition ) {
439 $config = static::get_configuration();
440
441 if ( true == $config['content']['chat_button_section']['has_display_text_select'] ) {
442 return $condition;
443 }
444
445 return null;
446 }
447
448 protected function add_chat_button_section(): void {
449 $config = static::get_configuration();
450
451 $this->start_controls_section(
452 'chat_button_section',
453 [
454 'label' => $config['content']['chat_button_section']['section_name'],
455 'tab' => Controls_Manager::TAB_CONTENT,
456 ]
457 );
458
459 if ( $config['content']['chat_button_section']['has_accessible_name'] ) {
460 $this->add_control(
461 'chat_aria_label',
462 [
463 'label' => esc_html__( 'Accessible name', 'elementor' ),
464 'type' => Controls_Manager::TEXT,
465 'default' => $config['content']['chat_button_section']['chat_aria_label'],
466 'placeholder' => esc_html__( 'Add accessible name', 'elementor' ),
467 'dynamic' => [
468 'active' => true,
469 ],
470 ],
471 );
472 }
473
474 if ( $config['content']['chat_button_section']['has_platform'] ) {
475
476 $this->add_control(
477 'chat_button_platform',
478 [
479 'label' => esc_html__( 'Platform', 'elementor' ),
480 'type' => Controls_Manager::SELECT,
481 'default' => $config['content']['chat_button_section']['platform']['default'],
482 'options' => Social_Network_Provider::get_social_networks_text(
483 $config['content']['chat_button_section']['platform']['group']
484 ),
485 ]
486 );
487
488 $this->social_media_controls();
489 }
490
491 if ( $config['content']['chat_button_section']['has_icon'] ) {
492 $this->add_control(
493 'chat_button_icon',
494 [
495 'label' => esc_html__( 'Icon', 'elementor' ),
496 'type' => Controls_Manager::ICONS,
497 'default' => $config['content']['chat_button_section']['icon_default'],
498 'recommended' => $config['content']['chat_button_section']['icons_recommended'],
499 ]
500 );
501 }
502
503 if ( $config['content']['chat_button_section']['has_notification_dot'] ) {
504
505 $notification_dot_return_value = 'yes';
506 $notification_dot_default = $notification_dot_return_value;
507
508 // Only clear if explicitly passed
509 if ( false === $config['content']['chat_button_section']['has_notification_dot_default_enabled'] ) {
510 $notification_dot_default = '';
511 }
512
513 $this->add_control(
514 'chat_button_show_dot',
515 [
516 'label' => esc_html__( 'Notification Dot', 'elementor' ),
517 'type' => Controls_Manager::SWITCHER,
518 'label_on' => esc_html__( 'Show', 'elementor' ),
519 'label_off' => esc_html__( 'Hide', 'elementor' ),
520 'return_value' => $notification_dot_return_value,
521 'default' => $notification_dot_default,
522 ]
523 );
524 }
525
526 if ( $config['content']['chat_button_section']['has_display_text'] ) {
527
528 if ( $config['content']['chat_button_section']['has_display_text_select'] ) {
529 $this->add_control(
530 'chat_button_display_text_select',
531 [
532 'label' => esc_html__( 'Display Text', 'elementor' ),
533 'type' => Controls_Manager::SELECT,
534 'default' => 'details',
535 'options' => [
536 'details' => esc_html__( 'Contact Details', 'elementor' ),
537 'cta' => esc_html__( 'Call to Action', 'elementor' ),
538 ],
539 ]
540 );
541 }
542
543 $this->add_control(
544 'chat_button_display_text',
545 [
546 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
547 'type' => Controls_Manager::TEXT,
548 'dynamic' => [
549 'active' => true,
550 ],
551 'label_block' => true,
552 'placeholder' => esc_html__( 'Enter the text', 'elementor' ),
553 'default' => $config['content']['chat_button_section']['display_text_label'],
554 'condition' => $this->get_display_text_condition([
555 'chat_button_display_text_select' => 'cta',
556 ] ),
557 ],
558 );
559 }
560
561 $this->end_controls_section();
562 }
563
564 protected function add_top_bar_section(): void {
565 $config = static::get_configuration();
566
567 $this->start_controls_section(
568 'top_bar_section',
569 [
570 'label' => $config['content']['top_bar_section']['section_name'],
571 'tab' => Controls_Manager::TAB_CONTENT,
572 ]
573 );
574
575 $this->add_control(
576 'top_bar_title',
577 [
578 'label' => $config['content']['top_bar_section']['title']['label'],
579 'type' => Controls_Manager::TEXT,
580 'default' => $config['content']['top_bar_section']['title']['default'],
581 'placeholder' => $config['content']['top_bar_section']['title']['placeholder'],
582 'dynamic' => [
583 'active' => $config['content']['top_bar_section']['title']['dynamic'],
584 ],
585 'ai' => [
586 'active' => $config['content']['top_bar_section']['title']['ai'],
587 ],
588 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
589 ]
590 );
591
592 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
593 $this->add_control(
594 'top_bar_subtitle',
595 [
596 'label' => $config['content']['top_bar_section']['subtitle']['label'],
597 'type' => Controls_Manager::TEXT,
598 'default' => $config['content']['top_bar_section']['subtitle']['default'],
599 'placeholder' => $config['content']['top_bar_section']['subtitle']['placeholder'],
600 $config['content']['top_bar_section']['subtitle']['dynamic'],
601 'ai' => [
602 'active' => $config['content']['top_bar_section']['subtitle']['ai'],
603 ],
604 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
605 ]
606 );
607 }
608
609 if ( $config['content']['top_bar_section']['has_image'] ) {
610 $this->add_control(
611 'top_bar_image',
612 [
613 'label' => esc_html__( 'Profile Image', 'elementor' ),
614 'type' => Controls_Manager::MEDIA,
615 'default' => [
616 'url' => Utils::get_placeholder_image_src(),
617 ],
618 ]
619 );
620 }
621
622 if ( $config['content']['top_bar_section']['has_active_dot'] ) {
623 $this->add_control(
624 'top_bar_show_dot',
625 [
626 'label' => esc_html__( 'Active Dot', 'elementor' ),
627 'type' => Controls_Manager::SWITCHER,
628 'label_on' => esc_html__( 'Show', 'elementor' ),
629 'label_off' => esc_html__( 'Hide', 'elementor' ),
630 'return_value' => 'yes',
631 'default' => 'yes',
632 ]
633 );
634 }
635
636 $this->end_controls_section();
637 }
638
639 protected function add_message_bubble_section(): void {
640 $config = static::get_configuration();
641
642 $this->start_controls_section(
643 'message_bubble_section',
644 [
645 'label' => esc_html__( 'Message Bubble', 'elementor' ),
646 'tab' => Controls_Manager::TAB_CONTENT,
647 ]
648 );
649
650 $this->add_control(
651 'message_bubble_name',
652 [
653 'label' => esc_html__( 'Name', 'elementor' ),
654 'type' => Controls_Manager::TEXT,
655 'default' => esc_html__( 'Rob', 'elementor' ),
656 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
657 ]
658 );
659
660 $this->add_control(
661 'message_bubble_body',
662 [
663 'label' => esc_html__( 'Message', 'elementor' ),
664 'type' => Controls_Manager::TEXTAREA,
665 'dynamic' => [
666 'active' => true,
667 ],
668 'label_block' => true,
669 'default' => esc_html__( 'Hey, how can I help you today?', 'elementor' ),
670 'placeholder' => esc_html__( 'Message', 'elementor' ),
671 ],
672 );
673
674 $this->add_control(
675 'chat_button_time_format',
676 [
677 'label' => esc_html__( 'Time format', 'elementor' ),
678 'type' => Controls_Manager::SELECT,
679 'default' => '12h',
680 'options' => [
681 '12h' => esc_html__( '2:20 PM', 'elementor' ),
682 '24h' => esc_html__( '14:20', 'elementor' ),
683 ],
684 ]
685 );
686
687 if ( $config['content']['message_bubble_section']['has_typing_animation'] ) {
688 $this->add_control(
689 'chat_button_show_animation',
690 [
691 'label' => esc_html__( 'Typing Animation', 'elementor' ),
692 'type' => Controls_Manager::SWITCHER,
693 'label_on' => esc_html__( 'Show', 'elementor' ),
694 'label_off' => esc_html__( 'Hide', 'elementor' ),
695 'return_value' => 'yes',
696 'default' => 'yes',
697 ]
698 );
699 }
700
701 $this->end_controls_section();
702 }
703
704 protected function add_contact_section(): void {
705 $config = static::get_configuration();
706
707 $this->start_controls_section(
708 'contact_section',
709 [
710 'label' => $config['content']['contact_section']['section_name'],
711 'tab' => Controls_Manager::TAB_CONTENT,
712 ]
713 );
714
715 if ( $config['content']['contact_section']['has_accessible_name'] ) {
716 $this->add_control(
717 'contact_aria_label',
718 [
719 'label' => esc_html__( 'Accessible name', 'elementor' ),
720 'type' => Controls_Manager::TEXT,
721 'default' => $config['content']['chat_button_section']['chat_aria_label'],
722 'placeholder' => esc_html__( 'Add accessible name', 'elementor' ),
723 'dynamic' => [
724 'active' => true,
725 ],
726 ],
727 );
728 }
729
730 if ( $config['content']['contact_section']['has_cta_text'] ) {
731 $this->add_control(
732 'contact_cta_text',
733 [
734 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
735 'type' => Controls_Manager::TEXT,
736 'default' => esc_html__( 'Start conversation:', 'elementor' ),
737 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
738 'label_block' => true,
739 ]
740 );
741 }
742
743 if ( $config['content']['contact_section']['platform']['limit'] ) {
744 if ( $config['content']['contact_section']['platform']['min_items'] ) {
745 $this->add_control(
746 'contact_custom_panel_alert',
747 [
748 'type' => Controls_Manager::ALERT,
749 'alert_type' => 'info',
750 'content' => sprintf(
751 /* translators: 1: Minimum items, 2: Items limit. */
752 esc_html__( 'Add between %1$s to %2$s contact buttons', 'elementor' ),
753 '<b>' . $config['content']['contact_section']['platform']['min_items'] . '</b>',
754 '<b>' . $config['content']['contact_section']['platform']['limit'] . '</b>'
755 ),
756 ]
757 );
758 } else {
759 $this->add_control(
760 'contact_custom_panel_alert',
761 [
762 'type' => Controls_Manager::ALERT,
763 'alert_type' => 'info',
764 'content' => sprintf(
765 /* translators: %s: Items limit. */
766 esc_html__( 'Add up to %s contact buttons', 'elementor' ),
767 '<b>' . $config['content']['contact_section']['platform']['limit'] . '</b>'
768 ),
769 ]
770 );
771 }
772 }
773
774 $repeater = new Repeater();
775
776 $repeater->add_control(
777 'contact_icon_platform',
778 [
779 'label' => esc_html__( 'Platform', 'elementor' ),
780 'type' => Controls_Manager::SELECT,
781 'options' => Social_Network_Provider::get_social_networks_text(
782 $config['content']['contact_section']['platform']['group-1']
783 ),
784 'default' => Social_Network_Provider::WHATSAPP,
785 ],
786 );
787
788 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
789 $repeater->add_control(
790 'contact_tooltip',
791 [
792 'label' => $config['content']['contact_section']['repeater']['tooltip_label'],
793 'type' => Controls_Manager::TEXT,
794 'dynamic' => [
795 'active' => true,
796 ],
797 'default' => $config['content']['contact_section']['repeater']['tooltip_default'],
798 'placeholder' => $config['content']['contact_section']['repeater']['tooltip_placeholder'],
799 ],
800 );
801 }
802
803 if ( $config['content']['contact_section']['repeater']['has_title'] ) {
804 $repeater->add_control(
805 'contact_title',
806 [
807 'label' => 'Title',
808 'type' => Controls_Manager::TEXT,
809 'dynamic' => [
810 'active' => true,
811 ],
812 'default' => 'Title',
813 'placeholder' => esc_html__( 'Enter title', 'elementor' ),
814 ],
815 );
816 }
817
818 if ( $config['content']['contact_section']['repeater']['has_description'] ) {
819 $repeater->add_control(
820 'contact_description',
821 [
822 'label' => 'Description',
823 'type' => Controls_Manager::TEXT,
824 'dynamic' => [
825 'active' => true,
826 ],
827 'default' => 'Description',
828 'placeholder' => esc_html__( 'Enter description', 'elementor' ),
829 ],
830 );
831 }
832
833 $repeater->add_control(
834 'contact_icon_mail',
835 [
836 'label' => esc_html__( 'Email', 'elementor' ),
837 'type' => Controls_Manager::TEXT,
838 'placeholder' => esc_html__( 'Enter your email', 'elementor' ),
839 'dynamic' => [
840 'active' => true,
841 ],
842 'ai' => [
843 'active' => false,
844 ],
845 'label_block' => true,
846 'condition' => [
847 'contact_icon_platform' => [
848 Social_Network_Provider::EMAIL,
849 ],
850 ],
851 ],
852 );
853
854 $repeater->add_control(
855 'contact_icon_mail_subject',
856 [
857 'label' => esc_html__( 'Subject', 'elementor' ),
858 'type' => Controls_Manager::TEXT,
859 'placeholder' => esc_html__( 'Subject', 'elementor' ),
860 'label_block' => true,
861 'condition' => [
862 'contact_icon_platform' => [
863 Social_Network_Provider::EMAIL,
864 ],
865 ],
866 ]
867 );
868
869 $repeater->add_control(
870 'contact_icon_mail_body',
871 [
872 'label' => esc_html__( 'Message', 'elementor' ),
873 'type' => Controls_Manager::TEXTAREA,
874 'placeholder' => esc_html__( 'Message', 'elementor' ),
875 'label_block' => true,
876 'condition' => [
877 'contact_icon_platform' => [
878 Social_Network_Provider::EMAIL,
879 ],
880 ],
881 ]
882 );
883
884 $repeater->add_control(
885 'contact_icon_number',
886 [
887 'label' => esc_html__( 'Number', 'elementor' ),
888 'type' => Controls_Manager::TEXT,
889 'dynamic' => [
890 'active' => true,
891 ],
892 'ai' => [
893 'active' => false,
894 ],
895 'label_block' => true,
896 'placeholder' => esc_html__( '+', 'elementor' ),
897 'condition' => [
898 'contact_icon_platform' => [
899 Social_Network_Provider::SMS,
900 Social_Network_Provider::WHATSAPP,
901 Social_Network_Provider::VIBER,
902 Social_Network_Provider::TELEPHONE,
903 ],
904 ],
905 ],
906 );
907
908 $repeater->add_control(
909 'contact_icon_username',
910 [
911 'label' => esc_html__( 'Username', 'elementor' ),
912 'type' => Controls_Manager::TEXT,
913 'dynamic' => [
914 'active' => true,
915 ],
916 'ai' => [
917 'active' => false,
918 ],
919 'label_block' => true,
920 'placeholder' => esc_html__( 'Enter your username', 'elementor' ),
921 'condition' => [
922 'contact_icon_platform' => [
923 Social_Network_Provider::MESSENGER,
924 Social_Network_Provider::SKYPE,
925 ],
926 ],
927 ],
928 );
929
930 $repeater->add_control(
931 'contact_icon_url',
932 [
933 'label' => esc_html__( 'Link', 'elementor' ),
934 'type' => Controls_Manager::URL,
935 'dynamic' => [
936 'active' => true,
937 ],
938 'ai' => [
939 'active' => false,
940 ],
941 'autocomplete' => true,
942 'label_block' => true,
943 'condition' => [
944 'contact_icon_platform' => [
945 Social_Network_Provider::URL,
946 ],
947 ],
948 'default' => [
949 'is_external' => true,
950 ],
951 'placeholder' => esc_html__( 'Paste URL or type', 'elementor' ),
952 ],
953 );
954
955 $repeater->add_control(
956 'contact_icon_waze',
957 [
958 'label' => esc_html__( 'Location', 'elementor' ),
959 'type' => Controls_Manager::URL,
960 'default' => [
961 'is_external' => true,
962 ],
963 'dynamic' => [
964 'active' => true,
965 ],
966 'label_block' => true,
967 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
968 'condition' => [
969 'contact_icon_platform' => [
970 Social_Network_Provider::WAZE,
971 ],
972 ],
973 'ai' => [
974 'active' => false,
975 ],
976 ],
977 );
978
979 $repeater->add_control(
980 'contact_icon_viber_action',
981 [
982 'label' => esc_html__( 'Action', 'elementor' ),
983 'type' => Controls_Manager::SELECT,
984 'default' => 'chat',
985 'dynamic' => [
986 'active' => true,
987 ],
988 'options' => [
989 'chat' => 'Chat',
990 'contact' => 'Contact',
991 ],
992 'condition' => [
993 'contact_icon_platform' => Social_Network_Provider::VIBER,
994 ],
995 ]
996 );
997
998 $this->add_control(
999 'contact_repeater',
1000 [
1001 'max_items' => $config['content']['contact_section']['platform']['limit'],
1002 'min_items' => $config['content']['contact_section']['platform']['min_items'],
1003 'type' => Controls_Manager::REPEATER,
1004 'fields' => $repeater->get_controls(),
1005 'title_field' => $this->get_icon_title_field(),
1006 'prevent_empty' => true,
1007 'button_text' => esc_html__( 'Add Item', 'elementor' ),
1008 'default' => $config['content']['contact_section']['default'],
1009 ]
1010 );
1011
1012 $this->end_controls_section();
1013 }
1014
1015 protected function get_icon_title_field(): string {
1016 $platform_icons_js = json_encode( Social_Network_Provider::get_social_networks_icons() );
1017 $platform_text_js = json_encode( Social_Network_Provider::get_social_networks_text() );
1018
1019 return <<<JS
1020 <#
1021 elementor.helpers.enqueueIconFonts( 'fa-solid' );
1022 elementor.helpers.enqueueIconFonts( 'fa-brands' );
1023 const mapping = {$platform_icons_js};
1024 const text_mapping = {$platform_text_js};
1025 #>
1026 <i class='{{{ mapping[contact_icon_platform] }}}' ></i> {{{ text_mapping[contact_icon_platform] }}}
1027 JS;
1028 }
1029
1030 protected function add_send_button_section(): void {
1031 $config = static::get_configuration();
1032
1033 $this->start_controls_section(
1034 'send_button_section',
1035 [
1036 'label' => $config['content']['send_button_section']['section_name'],
1037 'tab' => Controls_Manager::TAB_CONTENT,
1038 ]
1039 );
1040
1041 $this->add_control(
1042 'send_button_text',
1043 [
1044 'label' => esc_html__( 'Text', 'elementor' ),
1045 'type' => Controls_Manager::TEXT,
1046 'default' => $config['content']['send_button_section']['text']['default'],
1047 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
1048 'dynamic' => [
1049 'active' => true,
1050 ],
1051 'ai' => [
1052 'active' => false,
1053 ],
1054 ]
1055 );
1056
1057 if ( $config['content']['send_button_section']['has_link'] ) {
1058 $this->add_control(
1059 'send_button_url',
1060 [
1061 'label' => esc_html__( 'Link', 'elementor' ),
1062 'type' => Controls_Manager::URL,
1063 'default' => [
1064 'is_external' => true,
1065 ],
1066 'dynamic' => [
1067 'active' => true,
1068 ],
1069 'ai' => [
1070 'active' => false,
1071 ],
1072 'autocomplete' => true,
1073 'label_block' => true,
1074 ],
1075 );
1076 }
1077
1078 $this->end_controls_section();
1079 }
1080
1081 protected function add_content_tab(): void {
1082 $this->add_chat_button_section();
1083
1084 $this->add_top_bar_section();
1085
1086 $this->add_message_bubble_section();
1087
1088 $this->add_send_button_section();
1089 }
1090
1091 private function get_platform_color_condition( $condition ) {
1092 $config = static::get_configuration();
1093
1094 if ( true == $config['style']['has_platform_colors'] ) {
1095 return $condition;
1096 }
1097
1098 return null;
1099 }
1100
1101 protected function add_style_chat_button_section(): void {
1102 $config = static::get_configuration();
1103
1104 $this->start_controls_section(
1105 'style_chat_button',
1106 [
1107 'label' => $config['content']['chat_button_section']['section_name'],
1108 'tab' => Controls_Manager::TAB_STYLE,
1109 ]
1110 );
1111
1112 if ( $config['style']['chat_button_section']['has_button_size'] ) {
1113 $this->add_control(
1114 'style_chat_button_size',
1115 [
1116 'label' => esc_html__( 'Size', 'elementor' ),
1117 'type' => Controls_Manager::SELECT,
1118 'default' => $config['style']['chat_button_section']['button_size_default'],
1119 'options' => [
1120 'small' => esc_html__( 'Small', 'elementor' ),
1121 'medium' => esc_html__( 'Medium', 'elementor' ),
1122 'large' => esc_html__( 'Large', 'elementor' ),
1123 ],
1124 ]
1125 );
1126 }
1127
1128 if ( $config['style']['chat_button_section']['has_icon_position'] ) {
1129 $this->add_responsive_control(
1130 'style_chat_button_horizontal_position',
1131 [
1132 'label' => esc_html__( 'Icon Position', 'elementor' ),
1133 'type' => Controls_Manager::CHOOSE,
1134 'options' => [
1135 'start' => [
1136 'title' => esc_html__( 'Left', 'elementor' ),
1137 'icon' => 'eicon-h-align-left',
1138 ],
1139 'end' => [
1140 'title' => esc_html__( 'Right', 'elementor' ),
1141 'icon' => 'eicon-h-align-right',
1142 ],
1143 ],
1144 'selectors' => [
1145 '{{WRAPPER}} .e-contact-buttons__chat-button svg' => 'order: {{VALUE}};',
1146 ],
1147 'selectors_dictionary' => [
1148 'start' => '-1',
1149 'end' => '2',
1150 ],
1151 'default' => 'start',
1152 'mobile_default' => 'start',
1153 'toggle' => true,
1154 ]
1155 );
1156 }
1157
1158 if ( $config['style']['chat_button_section']['has_icon_spacing'] ) {
1159 $this->add_responsive_control(
1160 'style_chat_button_spacing',
1161 [
1162 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
1163 'type' => Controls_Manager::SLIDER,
1164 'range' => [
1165 '%' => [
1166 'min' => 10,
1167 'max' => 100,
1168 ],
1169 'px' => [
1170 'min' => 0,
1171 'max' => 100,
1172 ],
1173 ],
1174 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1175 'selectors' => [
1176 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-gap: {{SIZE}}{{UNIT}}',
1177 ],
1178 'separator' => 'before',
1179 ]
1180 );
1181 }
1182
1183 if ( $config['style']['chat_button_section']['has_typography'] ) {
1184 $this->add_group_control(
1185 Group_Control_Typography::get_type(),
1186 [
1187 'name' => 'style_top_bar_title_typography',
1188 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button',
1189 ]
1190 );
1191 }
1192
1193 if ( $config['style']['chat_button_section']['has_tabs'] ) {
1194 $this->start_controls_tabs(
1195 'style_button_color_tabs'
1196 );
1197
1198 $this->start_controls_tab(
1199 'style_button_color_tabs_normal',
1200 [
1201 'label' => esc_html__( 'Normal', 'elementor' ),
1202 ]
1203 );
1204
1205 if ( $config['style']['has_platform_colors'] ) {
1206 $this->add_control(
1207 'style_button_color_select',
1208 [
1209 'label' => esc_html__( 'Colors', 'elementor' ),
1210 'type' => Controls_Manager::SELECT,
1211 'default' => 'default',
1212 'options' => [
1213 'default' => esc_html__( 'Default', 'elementor' ),
1214 'custom' => esc_html__( 'Custom', 'elementor' ),
1215 ],
1216 ]
1217 );
1218 }
1219
1220 $this->add_control(
1221 'style_button_color_icon',
1222 [
1223 'label' => $config['style']['chat_button_section']['icon_color_label'],
1224 'type' => Controls_Manager::COLOR,
1225 'selectors' => [
1226 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1227 ],
1228 'condition' => $this->get_platform_color_condition( [
1229 'style_button_color_select' => 'custom',
1230 ] ),
1231 ]
1232 );
1233
1234 $this->add_control(
1235 'style_button_color_background',
1236 [
1237 'label' => esc_html__( 'Background Color', 'elementor' ),
1238 'type' => Controls_Manager::COLOR,
1239 'selectors' => [
1240 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1241 ],
1242 'condition' => $this->get_platform_color_condition( [
1243 'style_button_color_select' => 'custom',
1244 ] ),
1245 ]
1246 );
1247
1248 $this->end_controls_tab();
1249
1250 $this->start_controls_tab(
1251 'style_button_color_tabs_hover',
1252 [
1253 'label' => esc_html__( 'Hover', 'elementor' ),
1254 ]
1255 );
1256
1257 if ( $config['style']['has_platform_colors'] ) {
1258 $this->add_control(
1259 'style_button_color_select_hover',
1260 [
1261 'label' => esc_html__( 'Colors', 'elementor' ),
1262 'type' => Controls_Manager::SELECT,
1263 'default' => 'default',
1264 'options' => [
1265 'default' => esc_html__( 'Default', 'elementor' ),
1266 'custom' => esc_html__( 'Custom', 'elementor' ),
1267 ],
1268 ]
1269 );
1270 }
1271
1272 $this->add_control(
1273 'style_button_color_icon_hover',
1274 [
1275 'label' => $config['style']['chat_button_section']['icon_color_label'],
1276 'type' => Controls_Manager::COLOR,
1277 'selectors' => [
1278 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon-hover: {{VALUE}}',
1279 ],
1280 'condition' => $this->get_platform_color_condition( [
1281 'style_button_color_select_hover' => 'custom',
1282 ] ),
1283 ]
1284 );
1285
1286 $this->add_control(
1287 'style_button_color_background_hover',
1288 [
1289 'label' => esc_html__( 'Background Color', 'elementor' ),
1290 'type' => Controls_Manager::COLOR,
1291 'selectors' => [
1292 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg-hover: {{VALUE}}',
1293 ],
1294 'condition' => $this->get_platform_color_condition( [
1295 'style_button_color_select_hover' => 'custom',
1296 ] ),
1297 ]
1298 );
1299
1300 if ( 'default' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1301 $this->add_hover_animation_control(
1302 'style_button_color_hover_animation',
1303 );
1304 }
1305
1306 $this->end_controls_tab();
1307
1308 if ( $config['content']['chat_button_section']['has_active_tab'] ) {
1309 $this->start_controls_tab(
1310 'style_button_color_tabs_active',
1311 [
1312 'label' => esc_html__( 'Active', 'elementor' ),
1313 ]
1314 );
1315
1316 $this->add_control(
1317 'style_button_color_icon_active',
1318 [
1319 'label' => esc_html__( 'Icon Color', 'elementor' ),
1320 'type' => Controls_Manager::COLOR,
1321 'selectors' => [
1322 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-color: {{VALUE}}',
1323 ],
1324 ]
1325 );
1326
1327 $this->add_control(
1328 'style_button_color_background_active',
1329 [
1330 'label' => esc_html__( 'Background Color', 'elementor' ),
1331 'type' => Controls_Manager::COLOR,
1332 'selectors' => [
1333 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-bg: {{VALUE}}',
1334 ],
1335 ]
1336 );
1337
1338 $this->end_controls_tab();
1339 }
1340
1341 $this->end_controls_tabs();
1342 }
1343
1344 if ( $config['style']['chat_button_section']['has_platform_color_controls'] ) {
1345 $this->add_control(
1346 'style_platform_control_select',
1347 [
1348 'label' => esc_html__( 'Colors', 'elementor' ),
1349 'type' => Controls_Manager::SELECT,
1350 'default' => 'default',
1351 'options' => [
1352 'default' => esc_html__( 'Default', 'elementor' ),
1353 'custom' => esc_html__( 'Custom', 'elementor' ),
1354 ],
1355 'separator' => 'before',
1356 ]
1357 );
1358
1359 $this->add_control(
1360 'style_button_color_icon',
1361 [
1362 'label' => $config['style']['chat_button_section']['icon_color_label'],
1363 'type' => Controls_Manager::COLOR,
1364 'selectors' => [
1365 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1366 ],
1367 'condition' => [
1368 'style_platform_control_select' => 'custom',
1369 ],
1370 ]
1371 );
1372
1373 $this->add_control(
1374 'style_button_color_background',
1375 [
1376 'label' => esc_html__( 'Background Color', 'elementor' ),
1377 'type' => Controls_Manager::COLOR,
1378 'selectors' => [
1379 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1380 ],
1381 'condition' => [
1382 'style_platform_control_select' => 'custom',
1383 ],
1384 ]
1385 );
1386 }
1387
1388 if ( $config['style']['chat_button_section']['has_entrance_animation'] ) {
1389 $this->add_responsive_control(
1390 'style_chat_button_animation',
1391 [
1392 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
1393 'type' => Controls_Manager::ANIMATION,
1394 'frontend_available' => true,
1395 'separator' => 'before',
1396 ]
1397 );
1398
1399 $this->add_control(
1400 'style_chat_button_animation_duration',
1401 [
1402 'label' => esc_html__( 'Animation Duration', 'elementor' ),
1403 'type' => Controls_Manager::SELECT,
1404 'default' => 'normal',
1405 'options' => [
1406 'slow' => esc_html__( 'Slow', 'elementor' ),
1407 'normal' => esc_html__( 'Normal', 'elementor' ),
1408 'fast' => esc_html__( 'Fast', 'elementor' ),
1409 ],
1410 'prefix_class' => 'animated-',
1411 ]
1412 );
1413
1414 $this->add_control(
1415 'style_chat_button_animation_delay',
1416 [
1417 'label' => esc_html__( 'Animation Delay', 'elementor' ) . ' (ms)',
1418 'type' => Controls_Manager::NUMBER,
1419 'min' => 0,
1420 'step' => 100,
1421 'selectors' => [
1422 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-button-chat-button-animation-delay: {{SIZE}}ms;',
1423 ],
1424 'render_type' => 'none',
1425 'frontend_available' => true,
1426 'separator' => 'after',
1427 ]
1428 );
1429 }
1430
1431 if ( $config['style']['chat_button_section']['has_box_shadow'] ) {
1432 $this->add_group_control(
1433 Group_Control_Box_Shadow::get_type(),
1434 [
1435 'name' => 'style_chat_button_box_shadow',
1436 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button-shadow',
1437 ]
1438 );
1439 }
1440
1441 if ( $config['style']['chat_button_section']['has_drop_shadow'] ) {
1442 $this->add_group_control(
1443 Group_Control_Box_Shadow::get_type(),
1444 [
1445 'name' => 'style_chat_button_drop_shadow',
1446 'fields_options' => [
1447 'box_shadow' => [
1448 'selectors' => [
1449 '{{WRAPPER}} .e-contact-buttons__chat-button-drop-shadow' => 'filter: drop-shadow({{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}});',
1450 ],
1451 ],
1452 ],
1453 ]
1454 );
1455 }
1456
1457 if ( $config['style']['chat_button_section']['has_padding'] ) {
1458 $this->add_responsive_control(
1459 'style_chat_button_padding',
1460 [
1461 'label' => esc_html__( 'Padding', 'elementor' ),
1462 'type' => Controls_Manager::DIMENSIONS,
1463 'size_units' => [ 'px', '%', 'em', 'rem' ],
1464 'selectors' => [
1465 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-start: {{LEFT}}{{UNIT}};',
1466 ],
1467 'separator' => 'before',
1468 ]
1469 );
1470 }
1471
1472 if ( 'custom' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1473 $this->add_control(
1474 'style_chat_button_custom_animation_heading',
1475 [
1476 'label' => esc_html__( 'Hover Animation', 'elementor' ),
1477 'type' => Controls_Manager::HEADING,
1478 'separator' => 'before',
1479 ]
1480 );
1481
1482 $this->add_control(
1483 'style_chat_button_custom_animation_alert',
1484 [
1485 'type' => Controls_Manager::ALERT,
1486 'alert_type' => 'info',
1487 'content' => __( 'Hover animation is <b>desktop only</b>', 'elementor' ),
1488 ]
1489 );
1490
1491 $this->add_control(
1492 'style_chat_button_custom_animation_transition',
1493 [
1494 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
1495 'type' => Controls_Manager::SLIDER,
1496 'range' => [
1497 's' => [
1498 'min' => 0,
1499 'max' => 3,
1500 'step' => 0.1,
1501 ],
1502 ],
1503 'default' => [
1504 'unit' => 's',
1505 'size' => 0.3,
1506 ],
1507 'selectors' => [
1508 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
1509 ],
1510 ]
1511 );
1512 }
1513
1514 $this->end_controls_section();
1515 }
1516
1517 protected function add_style_top_bar_section(): void {
1518 $config = static::get_configuration();
1519
1520 $this->start_controls_section(
1521 'style_top_bar_section',
1522 [
1523 'label' => $config['content']['top_bar_section']['section_name'],
1524 'tab' => Controls_Manager::TAB_STYLE,
1525 ]
1526 );
1527
1528 if ( $config['content']['top_bar_section']['has_image'] ) {
1529 $this->add_control(
1530 'style_top_bar_profile_heading',
1531 [
1532 'label' => esc_html__( 'Profile Image', 'elementor' ),
1533 'type' => Controls_Manager::HEADING,
1534 'separator' => 'before',
1535 ]
1536 );
1537
1538 $this->add_control(
1539 'style_top_bar_image_size',
1540 [
1541 'label' => esc_html__( 'Size', 'elementor' ),
1542 'type' => Controls_Manager::SELECT,
1543 'default' => 'medium',
1544 'options' => [
1545 'small' => esc_html__( 'Small', 'elementor' ),
1546 'medium' => esc_html__( 'Medium', 'elementor' ),
1547 'large' => esc_html__( 'Large', 'elementor' ),
1548 ],
1549 ]
1550 );
1551 }
1552
1553 if ( $config['style']['has_platform_colors'] ) {
1554 $this->add_control(
1555 'style_top_bar_colors',
1556 [
1557 'label' => esc_html__( 'Colors', 'elementor' ),
1558 'type' => Controls_Manager::SELECT,
1559 'default' => 'default',
1560 'options' => [
1561 'default' => esc_html__( 'Default', 'elementor' ),
1562 'custom' => esc_html__( 'Custom', 'elementor' ),
1563 ],
1564 'separator' => 'before',
1565 ]
1566 );
1567 }
1568
1569 if ( $config['style']['top_bar_section']['has_title_heading'] ) {
1570 $this->add_control(
1571 'style_top_bar_title_heading',
1572 [
1573 'label' => $config['style']['top_bar_section']['title_heading_label'],
1574 'type' => Controls_Manager::HEADING,
1575 'separator' => ! $config['style']['has_platform_colors'] ? 'before' : false,
1576 ]
1577 );
1578 }
1579
1580 $this->add_control(
1581 'style_top_bar_title_color',
1582 [
1583 'label' => esc_html__( 'Text Color', 'elementor' ),
1584 'type' => Controls_Manager::COLOR,
1585 'selectors' => [
1586 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-title: {{VALUE}}',
1587 ],
1588 'condition' => $this->get_platform_color_condition( [
1589 'style_top_bar_colors' => 'custom',
1590 ] ),
1591 ]
1592 );
1593
1594 $this->add_group_control(
1595 Group_Control_Typography::get_type(),
1596 [
1597 'name' => 'style_top_bar_title_typography',
1598 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-title',
1599 ]
1600 );
1601
1602 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
1603 $this->add_control(
1604 'style_top_bar_subtitle_heading',
1605 [
1606 'label' => $config['style']['top_bar_section']['subtitle_heading_label'],
1607 'type' => Controls_Manager::HEADING,
1608 'separator' => false,
1609 ]
1610 );
1611
1612 $this->add_control(
1613 'style_top_bar_subtitle_color',
1614 [
1615 'label' => esc_html__( 'Text Color', 'elementor' ),
1616 'type' => Controls_Manager::COLOR,
1617 'selectors' => [
1618 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-subtitle: {{VALUE}}',
1619 ],
1620 'condition' => $this->get_platform_color_condition( [
1621 'style_top_bar_colors' => 'custom',
1622 ] ),
1623 ]
1624 );
1625
1626 $this->add_group_control(
1627 Group_Control_Typography::get_type(),
1628 [
1629 'name' => 'style_top_bar_subtitle_typography',
1630 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-subtitle',
1631 ]
1632 );
1633 }
1634
1635 $close_and_background_partial_divider = 'before';
1636
1637 if ( $config['style']['top_bar_section']['has_style_close_button'] ) {
1638
1639 if ( $config['style']['top_bar_section']['has_close_button_heading'] ) {
1640 $this->add_control(
1641 'style_top_bar_close_button_heading',
1642 [
1643 'label' => esc_html__( 'Close Button', 'elementor' ),
1644 'type' => Controls_Manager::HEADING,
1645 'separator' => $close_and_background_partial_divider,
1646 'condition' => $this->get_platform_color_condition( [
1647 'style_top_bar_colors' => 'custom',
1648 ] ),
1649 ]
1650 );
1651 $close_and_background_partial_divider = false;
1652 }
1653
1654 $this->add_control(
1655 'style_top_bar_close_button_color',
1656 [
1657 'label' => esc_html__( 'Close Button Color', 'elementor' ),
1658 'type' => Controls_Manager::COLOR,
1659 'selectors' => [
1660 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-close-button-color: {{VALUE}}',
1661 ],
1662 'condition' => $this->get_platform_color_condition( [
1663 'style_top_bar_colors' => 'custom',
1664 ] ),
1665 'separator' => $close_and_background_partial_divider,
1666 ]
1667 );
1668
1669 $close_and_background_partial_divider = false;
1670 }
1671
1672 if ( $config['style']['top_bar_section']['has_background'] ) {
1673
1674 if ( $config['style']['top_bar_section']['has_background_heading'] ) {
1675 $this->add_control(
1676 'style_top_bar_background_heading',
1677 [
1678 'label' => esc_html__( 'Background', 'elementor' ),
1679 'type' => Controls_Manager::HEADING,
1680 'separator' => $close_and_background_partial_divider,
1681 'condition' => $this->get_platform_color_condition( [
1682 'style_top_bar_colors' => 'custom',
1683 ] ),
1684 ]
1685 );
1686 $close_and_background_partial_divider = false;
1687 }
1688
1689 $this->add_control(
1690 'style_top_bar_background_color',
1691 [
1692 'label' => esc_html__( 'Background Color', 'elementor' ),
1693 'type' => Controls_Manager::COLOR,
1694 'selectors' => [
1695 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-bg: {{VALUE}}',
1696 ],
1697 'condition' => $this->get_platform_color_condition( [
1698 'style_top_bar_colors' => 'custom',
1699 ] ),
1700 'separator' => $close_and_background_partial_divider,
1701 ]
1702 );
1703 }
1704
1705 $this->end_controls_section();
1706 }
1707
1708 protected function add_style_message_bubble_section(): void {
1709 $config = static::get_configuration();
1710
1711 $this->start_controls_section(
1712 'style_bubble_section',
1713 [
1714 'label' => esc_html__( 'Message Bubble', 'elementor' ),
1715 'tab' => Controls_Manager::TAB_STYLE,
1716 ]
1717 );
1718
1719 if ( $config['style']['has_platform_colors'] ) {
1720 $this->add_control(
1721 'style_bubble_colors',
1722 [
1723 'label' => esc_html__( 'Colors', 'elementor' ),
1724 'type' => Controls_Manager::SELECT,
1725 'default' => 'default',
1726 'options' => [
1727 'default' => esc_html__( 'Default', 'elementor' ),
1728 'custom' => esc_html__( 'Custom', 'elementor' ),
1729 ],
1730 ]
1731 );
1732 }
1733
1734 $this->add_control(
1735 'style_bubble_name_heading',
1736 [
1737 'label' => esc_html__( 'Name', 'elementor' ),
1738 'type' => Controls_Manager::HEADING,
1739 'separator' => false,
1740 ]
1741 );
1742
1743 $this->add_control(
1744 'style_bubble_name_color',
1745 [
1746 'label' => esc_html__( 'Text Color', 'elementor' ),
1747 'type' => Controls_Manager::COLOR,
1748 'selectors' => [
1749 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-name: {{VALUE}}',
1750 ],
1751 'condition' => $this->get_platform_color_condition( [
1752 'style_bubble_colors' => 'custom',
1753 ] ),
1754 ]
1755 );
1756
1757 $this->add_group_control(
1758 Group_Control_Typography::get_type(),
1759 [
1760 'name' => 'style_bubble_name_typography',
1761 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-name',
1762 ]
1763 );
1764
1765 $this->add_control(
1766 'style_bubble_message_heading',
1767 [
1768 'label' => esc_html__( 'Message', 'elementor' ),
1769 'type' => Controls_Manager::HEADING,
1770 'separator' => false,
1771 ]
1772 );
1773
1774 $this->add_control(
1775 'style_bubble_message_color',
1776 [
1777 'label' => esc_html__( 'Text Color', 'elementor' ),
1778 'type' => Controls_Manager::COLOR,
1779 'selectors' => [
1780 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-body: {{VALUE}}',
1781 ],
1782 'condition' => $this->get_platform_color_condition( [
1783 'style_bubble_colors' => 'custom',
1784 ] ),
1785 ]
1786 );
1787
1788 $this->add_group_control(
1789 Group_Control_Typography::get_type(),
1790 [
1791 'name' => 'style_bubble_message_typography',
1792 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-body',
1793 ]
1794 );
1795
1796 $this->add_control(
1797 'style_bubble_time_heading',
1798 [
1799 'label' => esc_html__( 'Time', 'elementor' ),
1800 'type' => Controls_Manager::HEADING,
1801 'separator' => false,
1802 ]
1803 );
1804
1805 $this->add_control(
1806 'style_bubble_time_color',
1807 [
1808 'label' => esc_html__( 'Text Color', 'elementor' ),
1809 'type' => Controls_Manager::COLOR,
1810 'selectors' => [
1811 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-time: {{VALUE}}',
1812 ],
1813 'condition' => $this->get_platform_color_condition( [
1814 'style_bubble_colors' => 'custom',
1815 ] ),
1816 ]
1817 );
1818
1819 $this->add_group_control(
1820 Group_Control_Typography::get_type(),
1821 [
1822 'name' => 'style_bubble_time_typography',
1823 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-time',
1824 ]
1825 );
1826
1827 $this->add_control(
1828 'style_bubble_background_color',
1829 [
1830 'label' => esc_html__( 'Bubble Background Color', 'elementor' ),
1831 'type' => Controls_Manager::COLOR,
1832 'selectors' => [
1833 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-bubble-bg: {{VALUE}}',
1834 ],
1835 'condition' => $this->get_platform_color_condition( [
1836 'style_bubble_colors' => 'custom',
1837 ] ),
1838 'separator' => 'before',
1839 ]
1840 );
1841
1842 if ( $config['style']['message_bubble_section']['has_chat_background'] ) {
1843 $this->add_control(
1844 'style_bubble_chat_color',
1845 [
1846 'label' => esc_html__( 'Chat Background Color', 'elementor' ),
1847 'type' => Controls_Manager::COLOR,
1848 'selectors' => [
1849 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-chat-bg: {{VALUE}}',
1850 ],
1851 'condition' => $this->get_platform_color_condition( [
1852 'style_bubble_colors' => 'custom',
1853 ] ),
1854 ]
1855 );
1856 }
1857
1858 $this->end_controls_section();
1859 }
1860
1861 protected function add_style_contact_section(): void {
1862 $config = static::get_configuration();
1863
1864 $this->start_controls_section(
1865 'style_contact_section',
1866 [
1867 'label' => $config['content']['contact_section']['section_name'],
1868 'tab' => Controls_Manager::TAB_STYLE,
1869 ]
1870 );
1871
1872 if ( $config['content']['contact_section']['has_cta_text'] ) {
1873 $this->add_control(
1874 'style_contact_text_heading',
1875 [
1876 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
1877 'type' => Controls_Manager::HEADING,
1878 'separator' => false,
1879 'condition' => $this->get_platform_color_condition( [
1880 'style_bubble_colors' => 'custom',
1881 ] ),
1882 ]
1883 );
1884
1885 $this->add_control(
1886 'style_contact_text_color',
1887 [
1888 'label' => esc_html__( 'Color', 'elementor' ),
1889 'type' => Controls_Manager::COLOR,
1890 'selectors' => [
1891 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-text: {{VALUE}}',
1892 ],
1893 ]
1894 );
1895
1896 $this->add_group_control(
1897 Group_Control_Typography::get_type(),
1898 [
1899 'name' => 'style_contact_text_typography',
1900 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-text',
1901 ]
1902 );
1903 }
1904
1905 if ( $config['style']['contact_section']['has_buttons_heading'] ) {
1906 $this->add_control(
1907 'style_contact_buttons_heading',
1908 [
1909 'label' => $config['style']['contact_section']['buttons_heading_label'],
1910 'type' => Controls_Manager::HEADING,
1911 'separator' => false,
1912 'condition' => $this->get_platform_color_condition( [
1913 'style_bubble_colors' => 'custom',
1914 ] ),
1915 ]
1916 );
1917 }
1918
1919 if ( $config['style']['contact_section']['has_buttons_size'] ) {
1920 $this->add_control(
1921 'style_contact_button_size',
1922 [
1923 'label' => esc_html__( 'Size', 'elementor' ),
1924 'type' => Controls_Manager::SELECT,
1925 'default' => 'small',
1926 'options' => [
1927 'small' => esc_html__( 'Small', 'elementor' ),
1928 'medium' => esc_html__( 'Medium', 'elementor' ),
1929 'large' => esc_html__( 'Large', 'elementor' ),
1930 ],
1931 ]
1932 );
1933 }
1934
1935 if ( $config['style']['contact_section']['has_text_color'] ) {
1936 $this->add_control(
1937 'style_contact_button_text_color',
1938 [
1939 'label' => $config['style']['contact_section']['icon_color_label'],
1940 'type' => Controls_Manager::COLOR,
1941 'selectors' => [
1942 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1943 ],
1944 ]
1945 );
1946 }
1947
1948 if ( $config['style']['contact_section']['has_typography'] ) {
1949 $this->add_group_control(
1950 Group_Control_Typography::get_type(),
1951 [
1952 'name' => 'style_contact_typography',
1953 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
1954 ]
1955 );
1956 }
1957
1958 if ( $config['style']['contact_section']['has_bg_color'] ) {
1959 $this->add_control(
1960 'style_contact_button_bg_color',
1961 [
1962 'label' => esc_html__( 'Background Color', 'elementor' ),
1963 'type' => Controls_Manager::COLOR,
1964 'selectors' => [
1965 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
1966 ],
1967 ]
1968 );
1969 }
1970
1971 if ( $config['style']['contact_section']['has_tabs'] ) {
1972 $this->start_controls_tabs(
1973 'style_contact_button_color_tabs'
1974 );
1975
1976 $this->start_controls_tab(
1977 'style_contact_button_color_tabs_normal',
1978 [
1979 'label' => esc_html__( 'Normal', 'elementor' ),
1980 ]
1981 );
1982
1983 $this->add_control(
1984 'style_contact_button_color_icon',
1985 [
1986 'label' => $config['style']['contact_section']['icon_color_label'],
1987 'type' => Controls_Manager::COLOR,
1988 'selectors' => [
1989 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1990 ],
1991 ]
1992 );
1993
1994 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
1995 $this->add_control(
1996 'style_contact_button_color_background',
1997 [
1998 'label' => esc_html__( 'Background Color', 'elementor' ),
1999 'type' => Controls_Manager::COLOR,
2000 'selectors' => [
2001 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
2002 ],
2003 ]
2004 );
2005 }
2006
2007 $this->end_controls_tab();
2008
2009 $this->start_controls_tab(
2010 'style_contact_button_color_tabs_hover',
2011 [
2012 'label' => esc_html__( 'Hover', 'elementor' ),
2013 ]
2014 );
2015
2016 $this->add_control(
2017 'style_contact_button_color_icon_hover',
2018 [
2019 'label' => esc_html__( 'Icon Color', 'elementor' ),
2020 'type' => Controls_Manager::COLOR,
2021 'selectors' => [
2022 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon-hover: {{VALUE}}',
2023 ],
2024 ]
2025 );
2026
2027 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
2028 $this->add_control(
2029 'style_contact_button_color_background_hover',
2030 [
2031 'label' => esc_html__( 'Background Color', 'elementor' ),
2032 'type' => Controls_Manager::COLOR,
2033 'selectors' => [
2034 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg-hover: {{VALUE}}',
2035 ],
2036 ]
2037 );
2038 }
2039
2040 if ( $config['style']['contact_section']['has_hover_animation'] ) {
2041 $this->add_hover_animation_control(
2042 'style_contact_button_hover_animation',
2043 );
2044 }
2045
2046 $this->end_controls_tab();
2047
2048 $this->end_controls_tabs();
2049 }
2050
2051 if ( $config['style']['contact_section']['has_buttons_spacing'] ) {
2052
2053 $this->add_responsive_control(
2054 'style_contact_buttons_spacing',
2055 [
2056 'label' => esc_html__( 'Buttons Spacing', 'elementor' ),
2057 'type' => Controls_Manager::SLIDER,
2058 'range' => [
2059 '%' => [
2060 'min' => 10,
2061 'max' => 100,
2062 ],
2063 'px' => [
2064 'min' => 0,
2065 'max' => 100,
2066 ],
2067 ],
2068 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2069 'selectors' => [
2070 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-gap: {{SIZE}}{{UNIT}}',
2071 ],
2072 'separator' => 'before',
2073 ]
2074 );
2075 }
2076
2077 if ( $config['style']['contact_section']['has_button_corners'] ) {
2078 $this->add_control(
2079 'style_contact_corners',
2080 [
2081 'label' => esc_html__( 'Corners', 'elementor' ),
2082 'type' => Controls_Manager::SELECT,
2083 'default' => 'round',
2084 'options' => [
2085 'round' => esc_html__( 'Round', 'elementor' ),
2086 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2087 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2088 ],
2089 ]
2090 );
2091 }
2092
2093 if ( $config['style']['contact_section']['has_box_shadow'] ) {
2094 $this->add_group_control(
2095 Group_Control_Box_Shadow::get_type(),
2096 [
2097 'name' => 'style_contact_icons_box_shadow',
2098 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-box-shadow',
2099 ]
2100 );
2101 }
2102
2103 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
2104 $this->add_control(
2105 'style_contact_tooltip_heading',
2106 [
2107 'label' => esc_html__( 'Tooltips', 'elementor' ),
2108 'type' => Controls_Manager::HEADING,
2109 'separator' => 'before',
2110 ]
2111 );
2112
2113 $this->add_control(
2114 'style_contact_tooltip_text_color',
2115 [
2116 'label' => esc_html__( 'Text Color', 'elementor' ),
2117 'type' => Controls_Manager::COLOR,
2118 'selectors' => [
2119 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-text: {{VALUE}}',
2120 ],
2121 ]
2122 );
2123
2124 $this->add_group_control(
2125 Group_Control_Typography::get_type(),
2126 [
2127 'name' => 'style_contact_tooltip_typography',
2128 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-tooltip',
2129 ]
2130 );
2131
2132 $this->add_control(
2133 'style_contact_tooltip_bg_color',
2134 [
2135 'label' => esc_html__( 'Background Color', 'elementor' ),
2136 'type' => Controls_Manager::COLOR,
2137 'selectors' => [
2138 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-bg: {{VALUE}}',
2139 ],
2140 ]
2141 );
2142 }
2143
2144 if ( $config['style']['contact_section']['has_chat_box_animation'] ) {
2145 $this->chat_box_animation_controls();
2146 }
2147
2148 if ( $config['style']['contact_section']['has_button_bar'] ) {
2149 $this->add_control(
2150 'style_contact_button_bar_heading',
2151 [
2152 'label' => esc_html__( 'Button Bar', 'elementor' ),
2153 'type' => Controls_Manager::HEADING,
2154 'separator' => 'before',
2155 ]
2156 );
2157
2158 $this->add_control(
2159 'style_contact_button_bar_bg_color',
2160 [
2161 'label' => esc_html__( 'Background Color', 'elementor' ),
2162 'type' => Controls_Manager::COLOR,
2163 'selectors' => [
2164 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-bg: {{VALUE}}',
2165 ],
2166 ]
2167 );
2168
2169 $this->add_control(
2170 'style_contact_button_bar_corners',
2171 [
2172 'label' => esc_html__( 'Corners', 'elementor' ),
2173 'type' => Controls_Manager::SELECT,
2174 'default' => 'round',
2175 'options' => [
2176 'round' => esc_html__( 'Round', 'elementor' ),
2177 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2178 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2179 ],
2180 ]
2181 );
2182
2183 $this->add_responsive_control(
2184 'style_contact_button_bar_padding',
2185 [
2186 'label' => esc_html__( 'Padding', 'elementor' ),
2187 'type' => Controls_Manager::DIMENSIONS,
2188 'size_units' => [ 'px', '%', 'em', 'rem' ],
2189 'selectors' => [
2190 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-button-bar-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-start: {{LEFT}}{{UNIT}};',
2191 ],
2192 'separator' => 'before',
2193 ]
2194 );
2195 }
2196
2197 if ( $config['style']['contact_section']['has_padding'] ) {
2198 $this->add_responsive_control(
2199 'style_contact_padding',
2200 [
2201 'label' => esc_html__( 'Padding', 'elementor' ),
2202 'type' => Controls_Manager::DIMENSIONS,
2203 'size_units' => [ 'px', '%', 'em', 'rem' ],
2204 'selectors' => [
2205 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-contact-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-start: {{LEFT}}{{UNIT}};',
2206 ],
2207 'separator' => 'before',
2208 ]
2209 );
2210 }
2211
2212 if ( $config['style']['contact_section']['has_hover_transition_duration'] ) {
2213 $this->add_control(
2214 'style_contact_custom_animation_heading',
2215 [
2216 'label' => esc_html__( 'Animation', 'elementor' ),
2217 'type' => Controls_Manager::HEADING,
2218 ]
2219 );
2220
2221 $this->add_control(
2222 'style_contact_custom_animation_alert',
2223 [
2224 'type' => Controls_Manager::ALERT,
2225 'alert_type' => 'info',
2226 'content' => __( 'Adjust transition duration to change the speed of the <b>hover animation on desktop</b> and the <b>click animation on touchscreen</b>.', 'elementor' ),
2227 ]
2228 );
2229
2230 $this->add_control(
2231 'style_contact_custom_animation_transition',
2232 [
2233 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
2234 'type' => Controls_Manager::SLIDER,
2235 'range' => [
2236 's' => [
2237 'min' => 0,
2238 'max' => 3,
2239 'step' => 0.1,
2240 ],
2241 ],
2242 'selectors' => [
2243 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
2244 ],
2245 ]
2246 );
2247 }
2248
2249 $this->end_controls_section();
2250 }
2251
2252 protected function add_style_resource_links_section(): void {
2253 $this->start_controls_section(
2254 'style_resource_links_section',
2255 [
2256 'label' => esc_html__( 'Resource Links', 'elementor' ),
2257 'tab' => Controls_Manager::TAB_STYLE,
2258 ]
2259 );
2260
2261 $this->add_control(
2262 'style_resource_links_icons_heading',
2263 [
2264 'label' => esc_html__( 'Icons', 'elementor' ),
2265 'type' => Controls_Manager::HEADING,
2266 'separator' => false,
2267 ]
2268 );
2269
2270 $this->add_control(
2271 'style_resource_links_button_size',
2272 [
2273 'label' => esc_html__( 'Size', 'elementor' ),
2274 'type' => Controls_Manager::SELECT,
2275 'default' => 'small',
2276 'options' => [
2277 'small' => esc_html__( 'Small', 'elementor' ),
2278 'medium' => esc_html__( 'Medium', 'elementor' ),
2279 'large' => esc_html__( 'Large', 'elementor' ),
2280 ],
2281 ]
2282 );
2283
2284 $this->add_control(
2285 'style_resource_links_color_select',
2286 [
2287 'label' => esc_html__( 'Color', 'elementor' ),
2288 'type' => Controls_Manager::SELECT,
2289 'default' => 'custom',
2290 'options' => [
2291 'default' => esc_html__( 'Default', 'elementor' ),
2292 'custom' => esc_html__( 'Custom', 'elementor' ),
2293 ],
2294 ]
2295 );
2296
2297 $this->add_control(
2298 'style_contact_icon_color',
2299 [
2300 'label' => esc_html__( 'Color', 'elementor' ),
2301 'type' => Controls_Manager::COLOR,
2302 'selectors' => [
2303 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
2304 ],
2305 'condition' => [
2306 'style_resource_links_color_select' => 'custom',
2307 ],
2308 ]
2309 );
2310
2311 $this->add_control(
2312 'style_resource_links_title_heading',
2313 [
2314 'label' => esc_html__( 'Title', 'elementor' ),
2315 'type' => Controls_Manager::HEADING,
2316 'separator' => false,
2317 ]
2318 );
2319
2320 $this->add_control(
2321 'style_resource_links_title_color',
2322 [
2323 'label' => esc_html__( 'Text Color', 'elementor' ),
2324 'type' => Controls_Manager::COLOR,
2325 'selectors' => [
2326 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-title-text-color: {{VALUE}}',
2327 ],
2328 ]
2329 );
2330
2331 $this->add_group_control(
2332 Group_Control_Typography::get_type(),
2333 [
2334 'name' => 'style_resource_links_title_typography',
2335 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-title',
2336 ]
2337 );
2338
2339 $this->add_control(
2340 'style_resource_links_description_heading',
2341 [
2342 'label' => esc_html__( 'Description', 'elementor' ),
2343 'type' => Controls_Manager::HEADING,
2344 'separator' => false,
2345 ]
2346 );
2347
2348 $this->add_control(
2349 'style_resource_links_description_color',
2350 [
2351 'label' => esc_html__( 'Text Color', 'elementor' ),
2352 'type' => Controls_Manager::COLOR,
2353 'selectors' => [
2354 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-description-text-color: {{VALUE}}',
2355 ],
2356 ]
2357 );
2358
2359 $this->add_group_control(
2360 Group_Control_Typography::get_type(),
2361 [
2362 'name' => 'style_resource_links_description_typography',
2363 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-description',
2364 ]
2365 );
2366
2367 $this->add_control(
2368 'style_resource_links_bg_color',
2369 [
2370 'label' => esc_html__( 'Background Color', 'elementor' ),
2371 'type' => Controls_Manager::COLOR,
2372 'selectors' => [
2373 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
2374 ],
2375 'separator' => 'before',
2376 ]
2377 );
2378
2379 $this->add_hover_animation_control(
2380 'style_resource_links_hover_animation',
2381 );
2382
2383 $this->end_controls_section();
2384 }
2385
2386 protected function add_style_info_links_section(): void {
2387 $this->start_controls_section(
2388 'style_info_links_section',
2389 [
2390 'label' => esc_html__( 'Info Links', 'elementor' ),
2391 'tab' => Controls_Manager::TAB_STYLE,
2392 ]
2393 );
2394
2395 $this->add_control(
2396 'style_info_links_icon_position',
2397 [
2398 'label' => esc_html__( 'Icon Position', 'elementor' ),
2399 'type' => Controls_Manager::CHOOSE,
2400 'options' => [
2401 'start' => [
2402 'title' => esc_html__( 'Left', 'elementor' ),
2403 'icon' => 'eicon-h-align-left',
2404 ],
2405 'end' => [
2406 'title' => esc_html__( 'Right', 'elementor' ),
2407 'icon' => 'eicon-h-align-right',
2408 ],
2409 ],
2410 'default' => 'start',
2411 'toggle' => true,
2412 ]
2413 );
2414
2415 $this->add_control(
2416 'style_info_links_icon_spacing',
2417 [
2418 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
2419 'type' => Controls_Manager::SLIDER,
2420 'range' => [
2421 '%' => [
2422 'min' => 10,
2423 'max' => 100,
2424 ],
2425 'px' => [
2426 'min' => 0,
2427 'max' => 20,
2428 ],
2429 ],
2430 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2431 'selectors' => [
2432 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-gap: {{SIZE}}{{UNIT}}',
2433 ],
2434 ]
2435 );
2436
2437 $this->add_responsive_control(
2438 'style_info_links_link_spacing',
2439 [
2440 'label' => esc_html__( 'Link Spacing', 'elementor' ),
2441 'type' => Controls_Manager::SLIDER,
2442 'range' => [
2443 '%' => [
2444 'min' => 10,
2445 'max' => 100,
2446 ],
2447 'px' => [
2448 'min' => 0,
2449 'max' => 10,
2450 ],
2451 ],
2452 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2453 'selectors' => [
2454 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-spacing: {{SIZE}}{{UNIT}}',
2455 ],
2456 ]
2457 );
2458
2459 $this->add_group_control(
2460 Group_Control_Typography::get_type(),
2461 [
2462 'name' => 'style_info_links_typography',
2463 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
2464 ]
2465 );
2466
2467 $this->start_controls_tabs(
2468 'style_info_links_tabs'
2469 );
2470
2471 $this->start_controls_tab(
2472 'style_info_links_tabs_normal',
2473 [
2474 'label' => esc_html__( 'Normal', 'elementor' ),
2475 ]
2476 );
2477
2478 $this->add_control(
2479 'style_info_links_normal_text_color',
2480 [
2481 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2482 'type' => Controls_Manager::COLOR,
2483 'selectors' => [
2484 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color: {{VALUE}}',
2485 ],
2486 ]
2487 );
2488
2489 $this->end_controls_tab();
2490
2491 $this->start_controls_tab(
2492 'style_info_links_tabs_hover',
2493 [
2494 'label' => esc_html__( 'Hover', 'elementor' ),
2495 ]
2496 );
2497
2498 $this->add_control(
2499 'style_info_links_hover_text_color',
2500 [
2501 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2502 'type' => Controls_Manager::COLOR,
2503 'selectors' => [
2504 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color-hover: {{VALUE}}',
2505 ],
2506 ]
2507 );
2508
2509 $this->add_control(
2510 'style_info_links_hover_animation',
2511 [
2512 'label' => esc_html__( 'Hover Animation', 'elementor' ),
2513 'type' => Controls_Manager::HOVER_ANIMATION,
2514 'frontend_available' => true,
2515 ]
2516 );
2517
2518 $this->end_controls_tab();
2519
2520 $this->end_controls_tabs();
2521
2522 $this->add_control(
2523 'style_info_links_dividers',
2524 [
2525 'label' => esc_html__( 'Dividers', 'elementor' ),
2526 'type' => Controls_Manager::SWITCHER,
2527 'label_on' => esc_html__( 'Show', 'elementor' ),
2528 'label_off' => esc_html__( 'Hide', 'elementor' ),
2529 'return_value' => 'yes',
2530 'default' => 'yes',
2531 'separator' => 'before',
2532 ]
2533 );
2534
2535 $this->add_control(
2536 'style_info_links_divider_color',
2537 [
2538 'label' => esc_html__( 'Color', 'elementor' ),
2539 'type' => Controls_Manager::COLOR,
2540 'selectors' => [
2541 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-color: {{VALUE}}',
2542 ],
2543 'condition' => [
2544 'style_info_links_dividers' => 'yes',
2545 ],
2546 ]
2547 );
2548
2549 $this->add_responsive_control(
2550 'style_info_links_divider_weight',
2551 [
2552 'label' => esc_html__( 'Weight', 'elementor' ),
2553 'type' => Controls_Manager::SLIDER,
2554 'range' => [
2555 '%' => [
2556 'min' => 10,
2557 'max' => 100,
2558 ],
2559 'px' => [
2560 'min' => 1,
2561 'max' => 10,
2562 ],
2563 ],
2564 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2565 'selectors' => [
2566 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-weight: {{SIZE}}{{UNIT}}',
2567 ],
2568 'condition' => [
2569 'style_info_links_dividers' => 'yes',
2570 ],
2571 ]
2572 );
2573
2574 $this->end_controls_section();
2575 }
2576
2577 protected function add_style_send_button_section(): void {
2578 $config = static::get_configuration();
2579
2580 $this->start_controls_section(
2581 'style_send_section',
2582 [
2583 'label' => $config['content']['send_button_section']['section_name'],
2584 'tab' => Controls_Manager::TAB_STYLE,
2585 ]
2586 );
2587
2588 if ( $config['style']['send_button_section']['has_typography'] ) {
2589 $this->add_group_control(
2590 Group_Control_Typography::get_type(),
2591 [
2592 'name' => 'style_send_typography',
2593 'selector' => $config['style']['send_button_section']['typography_selector'],
2594 ]
2595 );
2596 }
2597
2598 $this->start_controls_tabs(
2599 'style_send_tabs'
2600 );
2601
2602 $this->start_controls_tab(
2603 'style_send_tabs_normal',
2604 [
2605 'label' => esc_html__( 'Normal', 'elementor' ),
2606 ]
2607 );
2608
2609 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2610 $this->add_control(
2611 'style_send_normal_colors',
2612 [
2613 'label' => esc_html__( 'Colors', 'elementor' ),
2614 'type' => Controls_Manager::SELECT,
2615 'default' => 'default',
2616 'options' => [
2617 'default' => esc_html__( 'Default', 'elementor' ),
2618 'custom' => esc_html__( 'Custom', 'elementor' ),
2619 ],
2620 ]
2621 );
2622 }
2623
2624 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2625 $this->add_control(
2626 'style_send_normal_icon_color',
2627 [
2628 'label' => esc_html__( 'Icon Color', 'elementor' ),
2629 'type' => Controls_Manager::COLOR,
2630 'selectors' => [
2631 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon: {{VALUE}}',
2632 ],
2633 'condition' => [
2634 'style_send_normal_colors' => 'custom',
2635 ],
2636 ]
2637 );
2638 }
2639
2640 if ( $config['style']['send_button_section']['has_text_color'] ) {
2641 $this->add_control(
2642 'style_send_normal_text_color',
2643 [
2644 'label' => esc_html__( 'Text Color', 'elementor' ),
2645 'type' => Controls_Manager::COLOR,
2646 'selectors' => [
2647 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text: {{VALUE}}',
2648 ],
2649 ]
2650 );
2651 }
2652
2653 if ( $config['style']['send_button_section']['has_background_color'] ) {
2654 $this->add_control(
2655 'style_send_normal_background_color',
2656 [
2657 'label' => esc_html__( 'Background Color', 'elementor' ),
2658 'type' => Controls_Manager::COLOR,
2659 'selectors' => [
2660 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg: {{VALUE}}',
2661 ],
2662 'condition' => $this->get_platform_color_condition( [
2663 'style_send_normal_colors' => 'custom',
2664 ] ),
2665 ]
2666 );
2667 }
2668
2669 $this->end_controls_tab();
2670
2671 $this->start_controls_tab(
2672 'style_send_tabs_hover',
2673 [
2674 'label' => esc_html__( 'Hover', 'elementor' ),
2675 ]
2676 );
2677
2678 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2679 $this->add_control(
2680 'style_send_hover_colors',
2681 [
2682 'label' => esc_html__( 'Colors', 'elementor' ),
2683 'type' => Controls_Manager::SELECT,
2684 'default' => 'default',
2685 'options' => [
2686 'default' => esc_html__( 'Default', 'elementor' ),
2687 'custom' => esc_html__( 'Custom', 'elementor' ),
2688 ],
2689 ]
2690 );
2691 }
2692
2693 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2694 $this->add_control(
2695 'style_send_hover_icon_color',
2696 [
2697 'label' => esc_html__( 'Icon Color', 'elementor' ),
2698 'type' => Controls_Manager::COLOR,
2699 'selectors' => [
2700 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon-hover: {{VALUE}}',
2701 ],
2702 'condition' => [
2703 'style_send_hover_colors' => 'custom',
2704 ],
2705 ]
2706 );
2707 }
2708
2709 if ( $config['style']['send_button_section']['has_text_color'] ) {
2710 $this->add_control(
2711 'style_send_hover_text_color',
2712 [
2713 'label' => esc_html__( 'Text Color', 'elementor' ),
2714 'type' => Controls_Manager::COLOR,
2715 'selectors' => [
2716 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text-hover: {{VALUE}}',
2717 ],
2718 ]
2719 );
2720 }
2721
2722 if ( $config['style']['send_button_section']['has_background_color'] ) {
2723 $this->add_control(
2724 'style_send_hover_background_color',
2725 [
2726 'label' => esc_html__( 'Background Color', 'elementor' ),
2727 'type' => Controls_Manager::COLOR,
2728 'selectors' => [
2729 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg-hover: {{VALUE}}',
2730 ],
2731 'condition' => $this->get_platform_color_condition( [
2732 'style_send_hover_colors' => 'custom',
2733 ] ),
2734 ]
2735 );
2736 }
2737
2738 $this->add_hover_animation_control(
2739 'style_send_hover_animation',
2740 );
2741
2742 $this->end_controls_tab();
2743
2744 $this->end_controls_tabs();
2745
2746 $this->add_responsive_control(
2747 'style_chat_button_padding',
2748 [
2749 'label' => esc_html__( 'Padding', 'elementor' ),
2750 'type' => Controls_Manager::DIMENSIONS,
2751 'size_units' => [ 'px', '%', 'em', 'rem' ],
2752 'selectors' => [
2753 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-send-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-start: {{LEFT}}{{UNIT}};',
2754 ],
2755 'separator' => 'before',
2756 ]
2757 );
2758
2759 $this->end_controls_section();
2760 }
2761
2762 protected function chat_box_animation_controls(): void {
2763 $this->add_responsive_control(
2764 'style_chat_box_entrance_animation',
2765 [
2766 'label' => esc_html__( 'Open Animation', 'elementor' ),
2767 'type' => Controls_Manager::ANIMATION,
2768 'frontend_available' => true,
2769 'separator' => 'before',
2770 ]
2771 );
2772
2773 $this->add_responsive_control(
2774 'style_chat_box_exit_animation',
2775 [
2776 'label' => esc_html__( 'Close Animation', 'elementor' ),
2777 'type' => Controls_Manager::EXIT_ANIMATION,
2778 'frontend_available' => true,
2779 ]
2780 );
2781
2782 $this->add_control(
2783 'style_chat_box_animation_duration',
2784 [
2785 'label' => esc_html__( 'Animation Duration', 'elementor' ),
2786 'type' => Controls_Manager::SELECT,
2787 'default' => 'normal',
2788 'options' => [
2789 'slow' => esc_html__( 'Slow', 'elementor' ),
2790 'normal' => esc_html__( 'Normal', 'elementor' ),
2791 'fast' => esc_html__( 'Fast', 'elementor' ),
2792 ],
2793 'prefix_class' => 'animated-',
2794 ]
2795 );
2796 }
2797
2798 protected function add_style_chat_box_section(): void {
2799 $config = static::get_configuration();
2800
2801 $this->start_controls_section(
2802 'style_chat_box_section',
2803 [
2804 'label' => $config['style']['chat_box_section']['section_name'],
2805 'tab' => Controls_Manager::TAB_STYLE,
2806 ]
2807 );
2808
2809 if ( $config['style']['has_platform_colors'] ) {
2810 $this->add_control(
2811 'style_chat_box_bg_select',
2812 [
2813 'label' => esc_html__( 'Background Color', 'elementor' ),
2814 'type' => Controls_Manager::SELECT,
2815 'default' => 'default',
2816 'options' => [
2817 'default' => esc_html__( 'Default', 'elementor' ),
2818 'custom' => esc_html__( 'Custom', 'elementor' ),
2819 ],
2820 ]
2821 );
2822 }
2823
2824 $this->add_control(
2825 'style_chat_box_bg_color',
2826 [
2827 'label' => esc_html__( 'Background Color', 'elementor' ),
2828 'type' => Controls_Manager::COLOR,
2829 'selectors' => [
2830 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-bg: {{VALUE}}',
2831 ],
2832 'condition' => $this->get_platform_color_condition( [
2833 'style_chat_box_bg_select' => 'custom',
2834 ] ),
2835 ]
2836 );
2837
2838 if ( $config['style']['chat_box_section']['has_width'] ) {
2839 $this->add_responsive_control(
2840 'style_chat_box_width',
2841 [
2842 'label' => esc_html__( 'Width', 'elementor' ),
2843 'type' => Controls_Manager::SLIDER,
2844 'range' => [
2845 '%' => [
2846 'min' => 10,
2847 'max' => 100,
2848 ],
2849 'px' => [
2850 'min' => 0,
2851 'max' => 400,
2852 ],
2853 ],
2854 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2855 'selectors' => [
2856 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-width: {{SIZE}}{{UNIT}}',
2857 ],
2858 ]
2859 );
2860 }
2861
2862 $this->add_control(
2863 'style_chat_box_corners',
2864 [
2865 'label' => esc_html__( 'Corners', 'elementor' ),
2866 'type' => Controls_Manager::SELECT,
2867 'default' => 'rounded',
2868 'options' => [
2869 'round' => esc_html__( 'Round', 'elementor' ),
2870 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2871 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2872 ],
2873 'separator' => 'before',
2874 ]
2875 );
2876
2877 $this->add_group_control(
2878 Group_Control_Box_Shadow::get_type(),
2879 [
2880 'name' => 'style_chat_box_box_shadow',
2881 'selector' => '{{WRAPPER}} .e-contact-buttons__content',
2882 ]
2883 );
2884
2885 if ( $config['style']['chat_box_section']['has_padding'] ) {
2886 $this->add_responsive_control(
2887 'style_chat_box_padding',
2888 [
2889 'label' => esc_html__( 'Padding', 'elementor' ),
2890 'type' => Controls_Manager::DIMENSIONS,
2891 'size_units' => [ 'px', '%', 'em', 'rem' ],
2892 'selectors' => [
2893 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-box-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-start: {{LEFT}}{{UNIT}};',
2894 ],
2895 ]
2896 );
2897 }
2898
2899 $this->chat_box_animation_controls();
2900
2901 $this->end_controls_section();
2902 }
2903
2904 protected function add_style_tab(): void {
2905 $this->add_style_chat_button_section();
2906
2907 $this->add_style_top_bar_section();
2908
2909 $this->add_style_message_bubble_section();
2910
2911 $this->add_style_send_button_section();
2912
2913 $this->add_style_chat_box_section();
2914 }
2915
2916 private function add_advanced_tab(): void {
2917 $config = static::get_configuration();
2918
2919 Controls_Manager::add_tab(
2920 static::TAB_ADVANCED,
2921 esc_html__( 'Advanced', 'elementor' )
2922 );
2923
2924 if ( $config['advanced']['has_layout_position'] ) {
2925 $this->start_controls_section(
2926 'advanced_layout_section',
2927 [
2928 'label' => esc_html__( 'Layout', 'elementor' ),
2929 'tab' => static::TAB_ADVANCED,
2930 ]
2931 );
2932
2933 $this->add_control(
2934 'advanced_horizontal_position',
2935 [
2936 'label' => esc_html__( 'Horizontal Position', 'elementor' ),
2937 'type' => Controls_Manager::CHOOSE,
2938 'options' => [
2939 'start' => [
2940 'title' => esc_html__( 'Left', 'elementor' ),
2941 'icon' => 'eicon-h-align-left',
2942 ],
2943 'center' => [
2944 'title' => esc_html__( 'Center', 'elementor' ),
2945 'icon' => 'eicon-h-align-center',
2946 ],
2947 'end' => [
2948 'title' => esc_html__( 'Right', 'elementor' ),
2949 'icon' => 'eicon-h-align-right',
2950 ],
2951 ],
2952 'default' => $config['advanced']['horizontal_position_default'],
2953 'toggle' => false,
2954 ]
2955 );
2956
2957 if ( $config['advanced']['has_horizontal_offset'] ) {
2958 $this->add_responsive_control(
2959 'advanced_horizontal_offset',
2960 [
2961 'label' => esc_html__( 'Offset', 'elementor' ),
2962 'type' => Controls_Manager::SLIDER,
2963 'range' => [
2964 '%' => [
2965 'min' => 10,
2966 'max' => 100,
2967 ],
2968 'px' => [
2969 'min' => 0,
2970 'max' => 100,
2971 ],
2972 ],
2973 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2974 'selectors' => [
2975 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-horizontal-offset: {{SIZE}}{{UNIT}}',
2976 ],
2977 'condition' => [
2978 'advanced_horizontal_position' => [
2979 'start',
2980 'end',
2981 ],
2982 ],
2983 ]
2984 );
2985 }
2986
2987 $this->add_control(
2988 'advanced_vertical_position',
2989 [
2990 'label' => esc_html__( 'Vertical Position', 'elementor' ),
2991 'type' => Controls_Manager::CHOOSE,
2992 'options' => [
2993 'top' => [
2994 'title' => esc_html__( 'Top', 'elementor' ),
2995 'icon' => 'eicon-v-align-top',
2996 ],
2997 'middle' => [
2998 'title' => esc_html__( 'Middle', 'elementor' ),
2999 'icon' => 'eicon-v-align-middle',
3000 ],
3001 'bottom' => [
3002 'title' => esc_html__( 'Bottom', 'elementor' ),
3003 'icon' => 'eicon-v-align-bottom',
3004 ],
3005 ],
3006 'default' => 'bottom',
3007 'toggle' => false,
3008 ]
3009 );
3010
3011 if ( $config['advanced']['has_vertical_offset'] ) {
3012 $this->add_responsive_control(
3013 'advanced_vertical_offset',
3014 [
3015 'label' => esc_html__( 'Offset', 'elementor' ),
3016 'type' => Controls_Manager::SLIDER,
3017 'range' => [
3018 '%' => [
3019 'min' => 10,
3020 'max' => 100,
3021 ],
3022 'px' => [
3023 'min' => 0,
3024 'max' => 100,
3025 ],
3026 ],
3027 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
3028 'selectors' => [
3029 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-vertical-offset: {{SIZE}}{{UNIT}}',
3030 ],
3031 'condition' => [
3032 'advanced_vertical_position' => [
3033 'top',
3034 'bottom',
3035 ],
3036 ],
3037 ]
3038 );
3039 }
3040
3041 if ( $config['advanced']['has_mobile_full_width'] ) {
3042 $this->add_control(
3043 'advanced_mobile_full_width',
3044 [
3045 'label' => esc_html__( 'Full Width on Mobile', 'elementor' ),
3046 'type' => Controls_Manager::SWITCHER,
3047 'label_on' => esc_html__( 'Yes', 'elementor' ),
3048 'label_off' => esc_html__( 'No', 'elementor' ),
3049 'return_value' => 'yes',
3050 'default' => 'yes',
3051 ]
3052 );
3053 }
3054
3055 $this->end_controls_section();
3056 }
3057
3058 $this->start_controls_section(
3059 'advanced_responsive_section',
3060 [
3061 'label' => esc_html__( 'Responsive', 'elementor' ),
3062 'tab' => static::TAB_ADVANCED,
3063 ]
3064 );
3065
3066 $this->add_control(
3067 'responsive_description',
3068 [
3069 'raw' => __( 'Responsive visibility will take effect only on preview mode or live page, and not while editing in Elementor.', 'elementor' ),
3070 'type' => Controls_Manager::RAW_HTML,
3071 'content_classes' => 'elementor-descriptor',
3072 ]
3073 );
3074
3075 $this->add_hidden_device_controls();
3076
3077 $this->end_controls_section();
3078
3079 $this->start_controls_section(
3080 'advanced_custom_controls_section',
3081 [
3082 'label' => esc_html__( 'CSS', 'elementor' ),
3083 'tab' => static::TAB_ADVANCED,
3084 ]
3085 );
3086
3087 $this->add_control(
3088 'advanced_custom_css_id',
3089 [
3090 'label' => esc_html__( 'CSS ID', 'elementor' ),
3091 'type' => Controls_Manager::TEXT,
3092 'default' => '',
3093 'ai' => [
3094 'active' => false,
3095 ],
3096 'dynamic' => [
3097 'active' => true,
3098 ],
3099 'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),
3100 'style_transfer' => false,
3101 ]
3102 );
3103
3104 $this->add_control(
3105 'advanced_custom_css_classes',
3106 [
3107 'label' => esc_html__( 'CSS Classes', 'elementor' ),
3108 'type' => Controls_Manager::TEXT,
3109 'default' => '',
3110 'ai' => [
3111 'active' => false,
3112 ],
3113 'dynamic' => [
3114 'active' => true,
3115 ],
3116 'title' => esc_html__( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),
3117 ]
3118 );
3119
3120 $this->end_controls_section();
3121
3122 Plugin::$instance->controls_manager->add_custom_css_controls( $this, static::TAB_ADVANCED );
3123
3124 Plugin::$instance->controls_manager->add_custom_attributes_controls( $this, static::TAB_ADVANCED );
3125 }
3126
3127 protected function render(): void {
3128 $render_strategy = new Contact_Buttons_Core_Render( $this );
3129
3130 $render_strategy->render();
3131 }
3132 }
3133