Version Description
Download this release
Release Info
Developer | wpdevteam |
Plugin | EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor |
Version | 3.5.2 |
Comparing to | |
See all releases |
Code changes from version 3.5.1 to 3.5.2
- EmbedPress/Elementor/Widgets/Embedpress_Elementor.php +576 -424
- EmbedPress/Elementor/Widgets/Embedpress_Pdf.php +415 -124
- EmbedPress/Includes/Classes/Feature_Enhancer.php +365 -333
- EmbedPress/Providers/Youtube.php +223 -42
- EmbedPress/RestAPI.php +2 -6
- EmbedPress/Shortcode.php +560 -435
- Gutenberg/block-backend/block-embedpress.php +47 -8
- Gutenberg/block-backend/block-youtube.php +2 -1
- Gutenberg/dist/blocks.build.js +1 -1
- Gutenberg/dist/blocks.style.build.css +3 -3
- Gutenberg/plugin.php +295 -107
- assets/css/el-icon.css +26 -2
- assets/js/front.js +81 -39
- assets/pdf/web/viewer.css +2 -2
- assets/pdf/web/viewer.html +1 -1
- embedpress.php +12 -2
- includes.php +1 -1
- readme.txt +8 -3
EmbedPress/Elementor/Widgets/Embedpress_Elementor.php
CHANGED
@@ -10,225 +10,217 @@ use Elementor\Widget_Base as Widget_Base;
|
|
10 |
use EmbedPress\Includes\Traits\Branding;
|
11 |
use EmbedPress\Shortcode;
|
12 |
|
13 |
-
(defined(
|
14 |
-
|
15 |
-
class Embedpress_Elementor extends Widget_Base
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
$yt_condition = [
|
196 |
'embedpress_pro_embeded_source' => 'youtube'
|
197 |
];
|
198 |
$this->add_control(
|
199 |
'embedpress_pro_youtube_end_time',
|
200 |
[
|
201 |
-
'label' => __(
|
202 |
'type' => Controls_Manager::NUMBER,
|
203 |
-
'description' => __(
|
204 |
'condition' => $yt_condition,
|
205 |
]
|
206 |
);
|
207 |
-
|
208 |
-
|
209 |
-
[
|
210 |
-
'label' => __( 'Video Per Page', 'embedpress' ),
|
211 |
-
'description' => __( 'Specify the number of videos you wish to show on each page. Note: This option takes effect only when a YouTube channel is embedded.', 'embedpress' ),
|
212 |
-
'type' => Controls_Manager::NUMBER,
|
213 |
-
'label_block' => false,
|
214 |
-
'default' => 6,
|
215 |
-
'min' => 1,
|
216 |
-
'max' => 50,
|
217 |
-
'conditions' => [
|
218 |
-
'terms' => [
|
219 |
-
[
|
220 |
-
'name' => 'embedpress_pro_embeded_source',
|
221 |
-
'operator' => '===',
|
222 |
-
'value' => 'youtube',
|
223 |
-
],
|
224 |
-
],
|
225 |
-
]
|
226 |
-
]
|
227 |
-
);
|
228 |
$this->add_control(
|
229 |
'embedpress_pro_youtube_auto_play',
|
230 |
[
|
231 |
-
'label' => __(
|
232 |
'type' => Controls_Manager::SWITCHER,
|
233 |
'label_block' => false,
|
234 |
'return_value' => 'yes',
|
@@ -239,7 +231,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
239 |
$this->add_control(
|
240 |
'embedpress_pro_youtube_player_options',
|
241 |
[
|
242 |
-
'label' => __(
|
243 |
'type' => Controls_Manager::HEADING,
|
244 |
'condition' => $yt_condition,
|
245 |
]
|
@@ -247,14 +239,14 @@ class Embedpress_Elementor extends Widget_Base {
|
|
247 |
$this->add_control(
|
248 |
'embedpress_pro_youtube_display_controls',
|
249 |
[
|
250 |
-
'label' => __(
|
251 |
'type' => Controls_Manager::SELECT,
|
252 |
'label_block' => false,
|
253 |
'default' => 1,
|
254 |
'options' => [
|
255 |
-
'1' => __(
|
256 |
-
'2' => __(
|
257 |
-
'0' => __(
|
258 |
],
|
259 |
'condition' => $yt_condition,
|
260 |
]
|
@@ -262,7 +254,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
262 |
$this->add_control(
|
263 |
'embedpress_pro_youtube_enable_fullscreen_button',
|
264 |
[
|
265 |
-
'label' => __(
|
266 |
'type' => Controls_Manager::SWITCHER,
|
267 |
'label_block' => false,
|
268 |
'return_value' => 'yes',
|
@@ -276,28 +268,28 @@ class Embedpress_Elementor extends Widget_Base {
|
|
276 |
$this->add_control(
|
277 |
'embedpress_pro_youtube_display_video_annotations',
|
278 |
[
|
279 |
-
'label' => __(
|
280 |
'type' => Controls_Manager::SWITCHER,
|
281 |
'label_block' => false,
|
282 |
'default' => 1,
|
283 |
'options' => [
|
284 |
-
'1' => __(
|
285 |
-
'3' => __(
|
286 |
],
|
287 |
'condition' => $yt_condition,
|
288 |
]
|
289 |
);
|
290 |
-
|
291 |
$this->add_control(
|
292 |
'embedpress_pro_youtube_progress_bar_color',
|
293 |
[
|
294 |
-
'label' => __(
|
295 |
'type' => Controls_Manager::SELECT,
|
296 |
'label_block' => false,
|
297 |
'default' => 'red',
|
298 |
'options' => [
|
299 |
-
'red' => __(
|
300 |
-
'white' => __(
|
301 |
],
|
302 |
'condition' => $yt_condition,
|
303 |
]
|
@@ -305,7 +297,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
305 |
$this->add_control(
|
306 |
'embedpress_pro_youtube_force_closed_captions',
|
307 |
[
|
308 |
-
'label' => sprintf(__(
|
309 |
'type' => Controls_Manager::SWITCHER,
|
310 |
'label_block' => false,
|
311 |
'return_value' => 'yes',
|
@@ -318,13 +310,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
318 |
$this->add_control(
|
319 |
'embedpress_pro_youtube_modest_branding',
|
320 |
[
|
321 |
-
'label' => sprintf(__(
|
322 |
'type' => Controls_Manager::SELECT,
|
323 |
'label_block' => false,
|
324 |
'default' => 1,
|
325 |
'options' => [
|
326 |
-
'0' => __(
|
327 |
-
'1' => __(
|
328 |
],
|
329 |
'condition' => [
|
330 |
'embedpress_pro_embeded_source' => 'youtube',
|
@@ -337,8 +329,8 @@ class Embedpress_Elementor extends Widget_Base {
|
|
337 |
$this->add_control(
|
338 |
'embedpress_pro_youtube_display_related_videos',
|
339 |
[
|
340 |
-
'label' => __(
|
341 |
-
'description' => __(
|
342 |
'type' => Controls_Manager::SWITCHER,
|
343 |
'label_block' => false,
|
344 |
'return_value' => 'yes',
|
@@ -346,16 +338,141 @@ class Embedpress_Elementor extends Widget_Base {
|
|
346 |
'condition' => $yt_condition,
|
347 |
]
|
348 |
);
|
349 |
-
$this->init_branding_controls(
|
350 |
}
|
351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
$yt_condition = [
|
353 |
'embedpress_pro_embeded_source' => 'youtube',
|
354 |
];
|
355 |
$this->start_controls_section(
|
356 |
'embedpress_yt_subscription_section',
|
357 |
[
|
358 |
-
'label' => __(
|
359 |
'condition' => $yt_condition,
|
360 |
|
361 |
]
|
@@ -366,12 +483,12 @@ class Embedpress_Elementor extends Widget_Base {
|
|
366 |
'yt_sub_channel',
|
367 |
[
|
368 |
|
369 |
-
'label' => sprintf(
|
370 |
'type' => Controls_Manager::TEXT,
|
371 |
'dynamic' => [
|
372 |
'active' => true,
|
373 |
],
|
374 |
-
'placeholder' => __(
|
375 |
'label_block' => true,
|
376 |
'condition' => $yt_condition,
|
377 |
'classes' => $this->pro_class,
|
@@ -381,12 +498,12 @@ class Embedpress_Elementor extends Widget_Base {
|
|
381 |
'yt_sub_text',
|
382 |
[
|
383 |
|
384 |
-
'label' => sprintf(
|
385 |
'type' => Controls_Manager::TEXT,
|
386 |
'dynamic' => [
|
387 |
'active' => true,
|
388 |
],
|
389 |
-
'placeholder' => __(
|
390 |
'label_block' => true,
|
391 |
'condition' => $yt_condition,
|
392 |
'classes' => $this->pro_class,
|
@@ -397,13 +514,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
397 |
$this->add_control(
|
398 |
'yt_sub_layout',
|
399 |
[
|
400 |
-
'label' => sprintf(__(
|
401 |
'type' => Controls_Manager::SELECT,
|
402 |
'label_block' => false,
|
403 |
'default' => 'default',
|
404 |
'options' => [
|
405 |
-
'default' => __(
|
406 |
-
'full' => __(
|
407 |
],
|
408 |
'condition' => [
|
409 |
'embedpress_pro_embeded_source' => 'youtube',
|
@@ -415,13 +532,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
415 |
$this->add_control(
|
416 |
'yt_sub_theme',
|
417 |
[
|
418 |
-
'label' => sprintf(__(
|
419 |
'type' => Controls_Manager::SELECT,
|
420 |
'label_block' => false,
|
421 |
'default' => 'default',
|
422 |
'options' => [
|
423 |
-
'default' => __(
|
424 |
-
'dark' => __(
|
425 |
],
|
426 |
'condition' => [
|
427 |
'embedpress_pro_embeded_source' => 'youtube',
|
@@ -433,7 +550,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
433 |
$this->add_control(
|
434 |
'yt_sub_count',
|
435 |
[
|
436 |
-
'label' => sprintf(__(
|
437 |
'type' => Controls_Manager::SWITCHER,
|
438 |
'label_block' => false,
|
439 |
'return_value' => 'yes',
|
@@ -444,16 +561,16 @@ class Embedpress_Elementor extends Widget_Base {
|
|
444 |
);
|
445 |
|
446 |
$this->end_controls_section();
|
447 |
-
|
448 |
}
|
449 |
-
public function init_youtube_livechat_section()
|
|
|
450 |
$yt_condition = [
|
451 |
'embedpress_pro_embeded_source' => 'youtube',
|
452 |
];
|
453 |
$this->start_controls_section(
|
454 |
'embedpress_yt_livechat_section',
|
455 |
[
|
456 |
-
'label' => __(
|
457 |
'condition' => $yt_condition,
|
458 |
|
459 |
]
|
@@ -462,13 +579,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
462 |
$this->add_control(
|
463 |
'yt_lc_show',
|
464 |
[
|
465 |
-
'label' => sprintf(__(
|
466 |
'type' => Controls_Manager::SWITCHER,
|
467 |
'label_block' => false,
|
468 |
'return_value' => 'yes',
|
469 |
'default' => '',
|
470 |
-
'label_off' => __(
|
471 |
-
'label_on' => __(
|
472 |
'condition' => $yt_condition,
|
473 |
'classes' => $this->pro_class,
|
474 |
]
|
@@ -476,20 +593,20 @@ class Embedpress_Elementor extends Widget_Base {
|
|
476 |
|
477 |
|
478 |
$this->end_controls_section();
|
479 |
-
|
480 |
}
|
481 |
-
public function init_dailymotion_control
|
482 |
-
|
|
|
483 |
$this->add_control(
|
484 |
'embedpress_pro_dailymotion_ui_logo',
|
485 |
[
|
486 |
-
'label' => sprintf(__(
|
487 |
'type' => Controls_Manager::SWITCHER,
|
488 |
'label_block' => false,
|
489 |
'return_value' => 'yes',
|
490 |
'default' => 'yes',
|
491 |
-
'label_off' => __(
|
492 |
-
'label_on' => __(
|
493 |
'condition' => [
|
494 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
495 |
],
|
@@ -499,13 +616,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
499 |
$this->add_control(
|
500 |
'embedpress_pro_dailymotion_autoplay',
|
501 |
[
|
502 |
-
'label' => __(
|
503 |
'type' => Controls_Manager::SWITCHER,
|
504 |
'label_block' => false,
|
505 |
'return_value' => 'yes',
|
506 |
'default' => 'no',
|
507 |
-
'label_off' => __(
|
508 |
-
'label_on' => __(
|
509 |
'condition' => [
|
510 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
511 |
]
|
@@ -514,13 +631,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
514 |
$this->add_control(
|
515 |
'embedpress_pro_dailymotion_play_on_mobile',
|
516 |
[
|
517 |
-
'label' => __(
|
518 |
'type' => Controls_Manager::SWITCHER,
|
519 |
'label_block' => false,
|
520 |
'return_value' => 'yes',
|
521 |
'default' => 'no',
|
522 |
-
'label_off' => __(
|
523 |
-
'label_on' => __(
|
524 |
'condition' => [
|
525 |
'embedpress_pro_embeded_source' => 'dailymotion',
|
526 |
'embedpress_pro_dailymotion_autoplay' => 'yes'
|
@@ -530,13 +647,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
530 |
$this->add_control(
|
531 |
'embedpress_pro_dailymotion_mute',
|
532 |
[
|
533 |
-
'label' => __(
|
534 |
'type' => Controls_Manager::SWITCHER,
|
535 |
'label_block' => false,
|
536 |
'return_value' => 'yes',
|
537 |
'default' => 'no',
|
538 |
-
'label_off' => __(
|
539 |
-
'label_on' => __(
|
540 |
'condition' => [
|
541 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
542 |
]
|
@@ -545,13 +662,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
545 |
$this->add_control(
|
546 |
'embedpress_pro_dailymotion_player_control',
|
547 |
[
|
548 |
-
'label' => __(
|
549 |
'type' => Controls_Manager::SWITCHER,
|
550 |
'label_block' => false,
|
551 |
'return_value' => 'yes',
|
552 |
'default' => 'yes',
|
553 |
-
'label_off' => __(
|
554 |
-
'label_on' => __(
|
555 |
'condition' => [
|
556 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
557 |
]
|
@@ -560,13 +677,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
560 |
$this->add_control(
|
561 |
'embedpress_pro_dailymotion_video_info',
|
562 |
[
|
563 |
-
'label' => __(
|
564 |
'type' => Controls_Manager::SWITCHER,
|
565 |
'label_block' => false,
|
566 |
'return_value' => 'yes',
|
567 |
'default' => 'yes',
|
568 |
-
'label_off' => __(
|
569 |
-
'label_on' => __(
|
570 |
'condition' => [
|
571 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
572 |
]
|
@@ -575,7 +692,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
575 |
$this->add_control(
|
576 |
'embedpress_pro_dailymotion_control_color',
|
577 |
[
|
578 |
-
'label' => __(
|
579 |
'type' => Controls_Manager::COLOR,
|
580 |
'label_block' => false,
|
581 |
'default' => '#dd3333',
|
@@ -584,14 +701,14 @@ class Embedpress_Elementor extends Widget_Base {
|
|
584 |
]
|
585 |
]
|
586 |
);
|
587 |
-
$this->init_branding_controls(
|
588 |
-
|
589 |
}
|
590 |
-
public function init_wistia_controls(
|
|
|
591 |
$this->add_control(
|
592 |
'embedpress_pro_wistia_auto_play',
|
593 |
[
|
594 |
-
'label' => __(
|
595 |
'type' => Controls_Manager::SWITCHER,
|
596 |
'label_block' => false,
|
597 |
'return_value' => 'yes',
|
@@ -605,7 +722,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
605 |
$this->add_control(
|
606 |
'embedpress_pro_wistia_color',
|
607 |
[
|
608 |
-
'label' => __(
|
609 |
'type' => Controls_Manager::COLOR,
|
610 |
'label_block' => false,
|
611 |
'default' => '#dd3333',
|
@@ -620,7 +737,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
620 |
$this->add_control(
|
621 |
'embedpress_pro_wistia_captions_enabled_by_default',
|
622 |
[
|
623 |
-
'label' => __(
|
624 |
'type' => Controls_Manager::SWITCHER,
|
625 |
'label_block' => false,
|
626 |
'return_value' => 'yes',
|
@@ -636,7 +753,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
636 |
$this->add_control(
|
637 |
'embedpress_pro_wistia_player_options',
|
638 |
[
|
639 |
-
'label' => __(
|
640 |
'type' => Controls_Manager::HEADING,
|
641 |
'separator' => 'before',
|
642 |
'condition' => [
|
@@ -650,7 +767,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
650 |
$this->add_control(
|
651 |
'embedpress_pro_wistia_fullscreen_button',
|
652 |
[
|
653 |
-
'label' => __(
|
654 |
'type' => Controls_Manager::SWITCHER,
|
655 |
'label_block' => false,
|
656 |
'return_value' => 'yes',
|
@@ -664,7 +781,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
664 |
$this->add_control(
|
665 |
'embedpress_pro_wistia_small_play_button',
|
666 |
[
|
667 |
-
'label' => __(
|
668 |
'type' => Controls_Manager::SWITCHER,
|
669 |
'label_block' => false,
|
670 |
'return_value' => 'yes',
|
@@ -681,7 +798,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
681 |
$this->add_control(
|
682 |
'embedpress_pro_wistia_resumable',
|
683 |
[
|
684 |
-
'label' => __(
|
685 |
'type' => Controls_Manager::SWITCHER,
|
686 |
'label_block' => false,
|
687 |
'return_value' => 'yes',
|
@@ -696,7 +813,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
696 |
$this->add_control(
|
697 |
'embedpress_pro_wistia_focus',
|
698 |
[
|
699 |
-
'label' => __(
|
700 |
'type' => Controls_Manager::SWITCHER,
|
701 |
'label_block' => false,
|
702 |
'return_value' => 'yes',
|
@@ -711,7 +828,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
711 |
$this->add_control(
|
712 |
'embedpress_pro_wistia_captions',
|
713 |
[
|
714 |
-
'label' => sprintf(__(
|
715 |
'type' => Controls_Manager::SWITCHER,
|
716 |
'label_block' => false,
|
717 |
'return_value' => 'yes',
|
@@ -725,7 +842,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
725 |
$this->add_control(
|
726 |
'embedpress_pro_wistia_playbar',
|
727 |
[
|
728 |
-
'label' => __(
|
729 |
'type' => Controls_Manager::SWITCHER,
|
730 |
'label_block' => false,
|
731 |
'return_value' => 'yes',
|
@@ -739,7 +856,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
739 |
$this->add_control(
|
740 |
'embedpress_pro_wistia_volume_control',
|
741 |
[
|
742 |
-
'label' => sprintf(__(
|
743 |
'type' => Controls_Manager::SWITCHER,
|
744 |
'label_block' => false,
|
745 |
'return_value' => 'yes',
|
@@ -755,7 +872,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
755 |
$this->add_control(
|
756 |
'embedpress_pro_wistia_volume',
|
757 |
[
|
758 |
-
'label' => sprintf(__(
|
759 |
'type' => Controls_Manager::SLIDER,
|
760 |
'default' => [
|
761 |
'size' => 100,
|
@@ -777,7 +894,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
777 |
$this->add_control(
|
778 |
'embedpress_pro_wistia_rewind',
|
779 |
[
|
780 |
-
'label' => __(
|
781 |
'type' => Controls_Manager::SWITCHER,
|
782 |
'label_block' => false,
|
783 |
'return_value' => 'yes',
|
@@ -791,7 +908,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
791 |
$this->add_control(
|
792 |
'embedpress_pro_wistia_rewind_time',
|
793 |
[
|
794 |
-
'label' => __(
|
795 |
'type' => Controls_Manager::SLIDER,
|
796 |
'default' => [
|
797 |
'size' => 10,
|
@@ -808,20 +925,20 @@ class Embedpress_Elementor extends Widget_Base {
|
|
808 |
],
|
809 |
]
|
810 |
);
|
811 |
-
$this->init_branding_controls(
|
812 |
-
|
813 |
}
|
814 |
-
public function init_twitch_control(
|
|
|
815 |
$condition = [
|
816 |
'embedpress_pro_embeded_source' => 'twitch'
|
817 |
];
|
818 |
$this->add_control(
|
819 |
'embedpress_pro_twitch_autoplay',
|
820 |
[
|
821 |
-
'label' => __(
|
822 |
'type' => Controls_Manager::SWITCHER,
|
823 |
-
'label_off' => __(
|
824 |
-
'label_on' => __(
|
825 |
'default' => 'yes',
|
826 |
'condition' => $condition,
|
827 |
]
|
@@ -829,10 +946,10 @@ class Embedpress_Elementor extends Widget_Base {
|
|
829 |
$this->add_control(
|
830 |
'embedpress_pro_fs',
|
831 |
[
|
832 |
-
'label' => __(
|
833 |
'type' => Controls_Manager::SWITCHER,
|
834 |
-
'label_off' => __(
|
835 |
-
'label_on' => __(
|
836 |
'default' => 'yes',
|
837 |
'condition' => $condition,
|
838 |
]
|
@@ -842,10 +959,10 @@ class Embedpress_Elementor extends Widget_Base {
|
|
842 |
$this->add_control(
|
843 |
'embedpress_pro_twitch_chat',
|
844 |
[
|
845 |
-
'label' => sprintf(__(
|
846 |
'type' => Controls_Manager::SWITCHER,
|
847 |
-
'label_off' => __(
|
848 |
-
'label_on' => __(
|
849 |
'condition' => $condition,
|
850 |
'classes' => $this->pro_class,
|
851 |
|
@@ -854,41 +971,41 @@ class Embedpress_Elementor extends Widget_Base {
|
|
854 |
$this->add_control(
|
855 |
'embedpress_pro_twitch_mute',
|
856 |
[
|
857 |
-
'label' => __(
|
858 |
'type' => Controls_Manager::SWITCHER,
|
859 |
-
'label_off' => __(
|
860 |
-
'label_on' => __(
|
861 |
'condition' => $condition,
|
862 |
]
|
863 |
);
|
864 |
$this->add_control(
|
865 |
'embedpress_pro_twitch_theme',
|
866 |
[
|
867 |
-
'label' => __(
|
868 |
'type' => Controls_Manager::SELECT,
|
869 |
'default' => 'dark',
|
870 |
'options' => [
|
871 |
-
'dark' => __(
|
872 |
-
'light' => __(
|
873 |
],
|
874 |
'condition' => $condition,
|
875 |
]
|
876 |
);
|
877 |
|
878 |
-
$this->init_branding_controls(
|
879 |
-
|
880 |
}
|
881 |
-
public function init_soundcloud_controls(
|
|
|
882 |
$this->add_control(
|
883 |
'embedpress_pro_soundcloud_visual',
|
884 |
[
|
885 |
-
'label' => __(
|
886 |
'type' => Controls_Manager::SWITCHER,
|
887 |
'label_block' => false,
|
888 |
'return_value' => 'yes',
|
889 |
'default' => 'no',
|
890 |
-
'label_off' => __(
|
891 |
-
'label_on' => __(
|
892 |
'condition' => [
|
893 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
894 |
],
|
@@ -898,7 +1015,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
898 |
$this->add_control(
|
899 |
'embedpress_pro_soundcloud_color',
|
900 |
[
|
901 |
-
'label' => __(
|
902 |
'type' => Controls_Manager::COLOR,
|
903 |
'label_block' => false,
|
904 |
'default' => '#FF5500',
|
@@ -911,13 +1028,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
911 |
$this->add_control(
|
912 |
'embedpress_pro_soundcloud_autoplay',
|
913 |
[
|
914 |
-
'label' => __(
|
915 |
'type' => Controls_Manager::SWITCHER,
|
916 |
'label_block' => false,
|
917 |
'return_value' => 'yes',
|
918 |
'default' => 'no',
|
919 |
-
'label_off' => __(
|
920 |
-
'label_on' => __(
|
921 |
'condition' => [
|
922 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
923 |
],
|
@@ -929,13 +1046,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
929 |
$this->add_control(
|
930 |
'embedpress_pro_soundcloud_share_button',
|
931 |
[
|
932 |
-
'label' => __(
|
933 |
'type' => Controls_Manager::SWITCHER,
|
934 |
'label_block' => false,
|
935 |
'return_value' => 'yes',
|
936 |
'default' => 'yes',
|
937 |
-
'label_off' => __(
|
938 |
-
'label_on' => __(
|
939 |
'condition' => [
|
940 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
941 |
],
|
@@ -945,13 +1062,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
945 |
$this->add_control(
|
946 |
'embedpress_pro_soundcloud_comments',
|
947 |
[
|
948 |
-
'label' => __(
|
949 |
'type' => Controls_Manager::SWITCHER,
|
950 |
'label_block' => false,
|
951 |
'return_value' => 'yes',
|
952 |
'default' => 'yes',
|
953 |
-
'label_off' => __(
|
954 |
-
'label_on' => __(
|
955 |
'condition' => [
|
956 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
957 |
],
|
@@ -963,13 +1080,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
963 |
$this->add_control(
|
964 |
'embedpress_pro_soundcloud_artwork',
|
965 |
[
|
966 |
-
'label' => __(
|
967 |
'type' => Controls_Manager::SWITCHER,
|
968 |
'label_block' => false,
|
969 |
'return_value' => 'yes',
|
970 |
'default' => 'yes',
|
971 |
-
'label_off' => __(
|
972 |
-
'label_on' => __(
|
973 |
'condition' => [
|
974 |
'embedpress_pro_embeded_source' => 'soundcloud',
|
975 |
'embedpress_pro_soundcloud_visual!' => 'yes'
|
@@ -980,13 +1097,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
980 |
$this->add_control(
|
981 |
'embedpress_pro_soundcloud_play_count',
|
982 |
[
|
983 |
-
'label' => __(
|
984 |
'type' => Controls_Manager::SWITCHER,
|
985 |
'label_block' => false,
|
986 |
'return_value' => 'yes',
|
987 |
'default' => 'yes',
|
988 |
-
'label_off' => __(
|
989 |
-
'label_on' => __(
|
990 |
'condition' => [
|
991 |
'embedpress_pro_embeded_source' => 'soundcloud',
|
992 |
'embedpress_pro_soundcloud_visual!' => 'yes'
|
@@ -997,13 +1114,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
997 |
$this->add_control(
|
998 |
'embedpress_pro_soundcloud_user_name',
|
999 |
[
|
1000 |
-
'label' => __(
|
1001 |
'type' => Controls_Manager::SWITCHER,
|
1002 |
'label_block' => false,
|
1003 |
'return_value' => 'yes',
|
1004 |
'default' => 'yes',
|
1005 |
-
'label_off' => __(
|
1006 |
-
'label_on' => __(
|
1007 |
'condition' => [
|
1008 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1009 |
],
|
@@ -1013,13 +1130,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1013 |
$this->add_control(
|
1014 |
'embedpress_pro_soundcloud_buy_button',
|
1015 |
[
|
1016 |
-
'label' => sprintf(__(
|
1017 |
'type' => Controls_Manager::SWITCHER,
|
1018 |
'label_block' => false,
|
1019 |
'return_value' => 'yes',
|
1020 |
'default' => 'yes',
|
1021 |
-
'label_off' => __(
|
1022 |
-
'label_on' => __(
|
1023 |
'condition' => [
|
1024 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1025 |
],
|
@@ -1029,13 +1146,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1029 |
$this->add_control(
|
1030 |
'embedpress_pro_soundcloud_download_button',
|
1031 |
[
|
1032 |
-
'label' => sprintf(__(
|
1033 |
'type' => Controls_Manager::SWITCHER,
|
1034 |
'label_block' => false,
|
1035 |
'return_value' => 'yes',
|
1036 |
'default' => 'yes',
|
1037 |
-
'label_off' => __(
|
1038 |
-
'label_on' => __(
|
1039 |
'condition' => [
|
1040 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1041 |
],
|
@@ -1043,11 +1160,12 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1043 |
]
|
1044 |
);
|
1045 |
}
|
1046 |
-
public function init_vimeo_controls(
|
|
|
1047 |
$this->add_control(
|
1048 |
'embedpress_pro_vimeo_auto_play',
|
1049 |
[
|
1050 |
-
'label' => __(
|
1051 |
'type' => Controls_Manager::SWITCHER,
|
1052 |
'label_block' => false,
|
1053 |
'return_value' => 'yes',
|
@@ -1062,7 +1180,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1062 |
$this->add_control(
|
1063 |
'embedpress_pro_vimeo_color',
|
1064 |
[
|
1065 |
-
'label' => __(
|
1066 |
'type' => Controls_Manager::COLOR,
|
1067 |
'label_block' => false,
|
1068 |
'default' => '#00adef',
|
@@ -1075,7 +1193,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1075 |
$this->add_control(
|
1076 |
'embedpress_pro_vimeo_author_options',
|
1077 |
[
|
1078 |
-
'label' => __(
|
1079 |
'type' => Controls_Manager::HEADING,
|
1080 |
'separator' => 'before',
|
1081 |
'condition' => [
|
@@ -1087,7 +1205,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1087 |
$this->add_control(
|
1088 |
'embedpress_pro_vimeo_display_title',
|
1089 |
[
|
1090 |
-
'label' => __(
|
1091 |
'type' => Controls_Manager::SWITCHER,
|
1092 |
'label_block' => false,
|
1093 |
'return_value' => 'yes',
|
@@ -1103,7 +1221,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1103 |
$this->add_control(
|
1104 |
'embedpress_pro_vimeo_display_author',
|
1105 |
[
|
1106 |
-
'label' => __(
|
1107 |
'type' => Controls_Manager::SWITCHER,
|
1108 |
'label_block' => false,
|
1109 |
'return_value' => 'yes',
|
@@ -1117,7 +1235,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1117 |
$this->add_control(
|
1118 |
'embedpress_pro_vimeo_avatar',
|
1119 |
[
|
1120 |
-
'label' => __(
|
1121 |
'type' => Controls_Manager::SWITCHER,
|
1122 |
'label_block' => false,
|
1123 |
'return_value' => 'yes',
|
@@ -1131,7 +1249,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1131 |
$this->add_control(
|
1132 |
'embedpress_pro_vimeo_loop',
|
1133 |
[
|
1134 |
-
'label' => sprintf(__(
|
1135 |
'type' => Controls_Manager::SWITCHER,
|
1136 |
'label_block' => false,
|
1137 |
'return_value' => 'yes',
|
@@ -1146,7 +1264,7 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1146 |
$this->add_control(
|
1147 |
'embedpress_pro_vimeo_autopause',
|
1148 |
[
|
1149 |
-
'label' => sprintf(__(
|
1150 |
'type' => Controls_Manager::SWITCHER,
|
1151 |
'label_block' => false,
|
1152 |
'return_value' => 'yes',
|
@@ -1161,13 +1279,15 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1161 |
$this->add_control(
|
1162 |
'embedpress_pro_vimeo_dnt',
|
1163 |
[
|
1164 |
-
'label' => sprintf(__(
|
1165 |
'type' => Controls_Manager::SWITCHER,
|
1166 |
'label_block' => false,
|
1167 |
'return_value' => 'yes',
|
1168 |
'default' => 'yes',
|
1169 |
-
'description' => __(
|
1170 |
-
'
|
|
|
|
|
1171 |
'condition' => [
|
1172 |
'embedpress_pro_embeded_source' => 'vimeo'
|
1173 |
],
|
@@ -1176,37 +1296,37 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1176 |
);
|
1177 |
|
1178 |
|
1179 |
-
$this->init_branding_controls(
|
1180 |
-
|
1181 |
}
|
1182 |
-
public function init_spotify_controls()
|
|
|
1183 |
$condition = [
|
1184 |
'embedpress_pro_embeded_source' => 'spotify'
|
1185 |
];
|
1186 |
|
1187 |
-
|
1188 |
$this->add_control(
|
1189 |
'spotify_theme',
|
1190 |
[
|
1191 |
-
'label' => __(
|
1192 |
-
'description' => __(
|
1193 |
'type' => Controls_Manager::SELECT,
|
1194 |
'label_block' => false,
|
1195 |
'default' => '1',
|
1196 |
'options' => [
|
1197 |
-
'1' => __(
|
1198 |
-
'0' => __(
|
1199 |
],
|
1200 |
'condition' => $condition
|
1201 |
]
|
1202 |
);
|
1203 |
}
|
1204 |
|
1205 |
-
public function init_style_controls()
|
|
|
1206 |
$this->start_controls_section(
|
1207 |
'embedpress_style_section',
|
1208 |
[
|
1209 |
-
'label' => __(
|
1210 |
'tab' => Controls_Manager::TAB_STYLE,
|
1211 |
]
|
1212 |
);
|
@@ -1233,9 +1353,9 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1233 |
$this->add_control(
|
1234 |
'width',
|
1235 |
[
|
1236 |
-
'label' => __(
|
1237 |
'type' => Controls_Manager::SLIDER,
|
1238 |
-
'size_units' => [
|
1239 |
'range' => [
|
1240 |
'px' => [
|
1241 |
'min' => 0,
|
@@ -1252,9 +1372,9 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1252 |
$this->add_control(
|
1253 |
'height',
|
1254 |
[
|
1255 |
-
'label' => __(
|
1256 |
'type' => Controls_Manager::SLIDER,
|
1257 |
-
'size_units' => [
|
1258 |
'range' => [
|
1259 |
'px' => [
|
1260 |
'min' => 0,
|
@@ -1268,12 +1388,13 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1268 |
]
|
1269 |
]
|
1270 |
);
|
|
|
1271 |
$this->add_responsive_control(
|
1272 |
'margin',
|
1273 |
[
|
1274 |
-
'label' => __(
|
1275 |
'type' => Controls_Manager::DIMENSIONS,
|
1276 |
-
'size_units' => [
|
1277 |
'selectors' => [
|
1278 |
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1279 |
],
|
@@ -1282,9 +1403,9 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1282 |
$this->add_responsive_control(
|
1283 |
'padding',
|
1284 |
[
|
1285 |
-
'label' => __(
|
1286 |
'type' => Controls_Manager::DIMENSIONS,
|
1287 |
-
'size_units' => [
|
1288 |
'selectors' => [
|
1289 |
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1290 |
],
|
@@ -1293,19 +1414,19 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1293 |
$this->add_responsive_control(
|
1294 |
'align',
|
1295 |
[
|
1296 |
-
'label' => esc_html__(
|
1297 |
'type' => Controls_Manager::CHOOSE,
|
1298 |
'options' => [
|
1299 |
'left' => [
|
1300 |
-
'title' => esc_html__(
|
1301 |
'icon' => 'eicon-text-align-left',
|
1302 |
],
|
1303 |
'center' => [
|
1304 |
-
'title' => esc_html__(
|
1305 |
'icon' => 'eicon-text-align-center',
|
1306 |
],
|
1307 |
'right' => [
|
1308 |
-
'title' => esc_html__(
|
1309 |
'icon' => 'eicon-text-align-right',
|
1310 |
],
|
1311 |
],
|
@@ -1316,74 +1437,105 @@ class Embedpress_Elementor extends Widget_Base {
|
|
1316 |
$this->end_controls_section();
|
1317 |
}
|
1318 |
|
1319 |
-
public function render_plain_content()
|
|
|
1320 |
$args = "";
|
1321 |
-
|
1322 |
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
if(!empty( $settings['width']['size'] )){
|
1327 |
-
$args .= "width='{$settings['width']['size']}' ";
|
1328 |
-
}
|
1329 |
-
if(!empty( $settings['pagesize'] )){
|
1330 |
-
$args .= "pagesize='{$settings['pagesize']}' ";
|
1331 |
}
|
|
|
1332 |
$args = trim($args);
|
1333 |
echo "[embedpress $args]{$settings['embedpress_embeded_link']}\[/embedpress]";
|
1334 |
}
|
1335 |
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
? $settings['pagesize'] : 6;
|
1348 |
-
|
1349 |
-
$embed_content = Shortcode::parseContent( $settings['embedpress_embeded_link'], true, [ 'height'=> $height, 'width'=>$width, 'pagesize'=>$pagesize ] );
|
1350 |
-
$embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
|
1351 |
-
$embed = apply_filters( 'embedpress_elementor_embed', $embed_content, $settings );
|
1352 |
-
$content = is_object( $embed ) ? $embed->embed : $embed;
|
1353 |
-
|
1354 |
-
?>
|
1355 |
-
<div class="embedpress-elements-wrapper <?php echo !empty( $settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio': ''; ?>">
|
1356 |
-
<?php
|
1357 |
-
// handle notice display
|
1358 |
-
if ( $is_editor_view && $is_apple_podcast && !is_embedpress_pro_active() ) {
|
1359 |
-
?>
|
1360 |
-
<p><?php esc_html_e( 'You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
|
1361 |
-
<?php
|
1362 |
-
}else {
|
1363 |
-
echo $content;
|
1364 |
-
}
|
1365 |
-
?>
|
1366 |
-
</div>
|
1367 |
-
<?php
|
1368 |
-
}
|
1369 |
-
public function onAfterEmbedSpotify( $embed, $setting ) {
|
1370 |
-
if ( !isset( $embed->provider_name ) || strtolower( $embed->provider_name ) !== 'spotify' || !isset( $embed->embed ) ) {
|
1371 |
-
return $embed;
|
1372 |
}
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1383 |
}
|
1384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1385 |
|
1386 |
-
$embed->embed = str_replace(
|
1387 |
return $embed;
|
1388 |
}
|
1389 |
}
|
10 |
use EmbedPress\Includes\Traits\Branding;
|
11 |
use EmbedPress\Shortcode;
|
12 |
|
13 |
+
(defined('ABSPATH')) or die("No direct script access allowed.");
|
14 |
+
|
15 |
+
class Embedpress_Elementor extends Widget_Base
|
16 |
+
{
|
17 |
+
use Branding;
|
18 |
+
protected $pro_class = '';
|
19 |
+
protected $pro_text = '';
|
20 |
+
public function get_name()
|
21 |
+
{
|
22 |
+
return 'embedpres_elementor';
|
23 |
+
}
|
24 |
+
|
25 |
+
public function get_title()
|
26 |
+
{
|
27 |
+
return esc_html__('EmbedPress', 'embedpress');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function get_categories()
|
31 |
+
{
|
32 |
+
return ['embedpress'];
|
33 |
+
}
|
34 |
+
|
35 |
+
public function get_custom_help_url()
|
36 |
+
{
|
37 |
+
return 'https://embedpress.com/documentation';
|
38 |
+
}
|
39 |
+
|
40 |
+
public function get_icon()
|
41 |
+
{
|
42 |
+
return 'icon-embedpress';
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get widget keywords.
|
47 |
+
*
|
48 |
+
* Retrieve the list of keywords the widget belongs to.
|
49 |
+
*
|
50 |
+
* @return array Widget keywords.
|
51 |
+
* @since 2.4.1
|
52 |
+
* @access public
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
public function get_keywords()
|
56 |
+
{
|
57 |
+
return [
|
58 |
+
'embedpress',
|
59 |
+
'audio',
|
60 |
+
'video',
|
61 |
+
'map',
|
62 |
+
'youtube',
|
63 |
+
'vimeo',
|
64 |
+
'wistia',
|
65 |
+
'twitch',
|
66 |
+
'soundcloud',
|
67 |
+
'giphy gifs',
|
68 |
+
'spotify',
|
69 |
+
'smugmug',
|
70 |
+
'meetup',
|
71 |
+
'apple',
|
72 |
+
'apple podcast',
|
73 |
+
'podcast',
|
74 |
+
'dailymotion',
|
75 |
+
'instagram',
|
76 |
+
'slideshare',
|
77 |
+
'flickr',
|
78 |
+
'ted',
|
79 |
+
'google docs',
|
80 |
+
'google slides',
|
81 |
+
'google drawings'
|
82 |
+
];
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function register_controls()
|
86 |
+
{
|
87 |
+
$this->pro_class = is_embedpress_pro_active() ? '' : 'embedpress-pro-control';
|
88 |
+
$this->pro_text = is_embedpress_pro_active() ? '' : '<sup class="embedpress-pro-label" style="color:red">' . __('Pro', 'embedpress') . '</sup>';
|
89 |
+
/**
|
90 |
+
* EmbedPress Content Settings
|
91 |
+
*/
|
92 |
+
$this->start_controls_section(
|
93 |
+
'embedpress_elementor_content_settings',
|
94 |
+
[
|
95 |
+
'label' => esc_html__('Content Settings', 'embedpress'),
|
96 |
+
]
|
97 |
+
);
|
98 |
+
|
99 |
+
do_action('embedpress/embeded/extend', $this);
|
100 |
+
$this->add_control(
|
101 |
+
'embedpress_pro_embeded_source',
|
102 |
+
[
|
103 |
+
'label' => __('Source Name', 'embedpress'),
|
104 |
+
'type' => Controls_Manager::SELECT,
|
105 |
+
'label_block' => false,
|
106 |
+
'default' => ['default'],
|
107 |
+
'options' => [
|
108 |
+
'default' => __('Default', 'embedpress'),
|
109 |
+
'youtube' => __('YouTube', 'embedpress'),
|
110 |
+
'vimeo' => __('Vimeo', 'embedpress'),
|
111 |
+
'dailymotion' => __('Dailymotion', 'embedpress'),
|
112 |
+
'wistia' => __('Wistia', 'embedpress'),
|
113 |
+
'twitch' => __('Twitch', 'embedpress'),
|
114 |
+
'soundcloud' => __('SoundCloud', 'embedpress'),
|
115 |
+
]
|
116 |
+
]
|
117 |
+
);
|
118 |
+
$this->add_control(
|
119 |
+
'embedpress_embeded_link',
|
120 |
+
[
|
121 |
+
|
122 |
+
'label' => __('Embedded Link', 'embedpress'),
|
123 |
+
'type' => Controls_Manager::TEXT,
|
124 |
+
'dynamic' => [
|
125 |
+
'active' => true,
|
126 |
+
],
|
127 |
+
'placeholder' => __('Enter your Link', 'embedpress'),
|
128 |
+
'label_block' => true
|
129 |
+
|
130 |
+
]
|
131 |
+
);
|
132 |
+
$this->add_control(
|
133 |
+
'spotify_theme',
|
134 |
+
[
|
135 |
+
'label' => __('Player Background', 'embedpress'),
|
136 |
+
'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
|
137 |
+
'type' => Controls_Manager::SELECT,
|
138 |
+
'label_block' => false,
|
139 |
+
'default' => '1',
|
140 |
+
'options' => [
|
141 |
+
'1' => __('Dynamic', 'embedpress'),
|
142 |
+
'0' => __('Black & White', 'embedpress')
|
143 |
+
],
|
144 |
+
'condition' => [
|
145 |
+
'embedpress_pro_embeded_source' => 'spotify'
|
146 |
+
]
|
147 |
+
]
|
148 |
+
);
|
149 |
+
do_action('embedpress/control/extend', $this);
|
150 |
+
$this->add_control(
|
151 |
+
'embedpress_pro_video_start_time',
|
152 |
+
[
|
153 |
+
'label' => __('Start Time', 'embedpress'),
|
154 |
+
'type' => Controls_Manager::NUMBER,
|
155 |
+
'description' => __('Specify a start time (in seconds)', 'embedpress'),
|
156 |
+
'condition' => [
|
157 |
+
'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch']
|
158 |
+
],
|
159 |
+
]
|
160 |
+
);
|
161 |
+
|
162 |
+
$this->init_youtube_controls();
|
163 |
+
$this->init_vimeo_controls();
|
164 |
+
$this->init_wistia_controls();
|
165 |
+
$this->init_soundcloud_controls();
|
166 |
+
$this->init_dailymotion_control();
|
167 |
+
$this->init_twitch_control();
|
168 |
+
|
169 |
+
$this->end_controls_section();
|
170 |
+
|
171 |
+
$this->init_youtube_channel_section();
|
172 |
+
$this->init_youtube_subscription_section();
|
173 |
+
$this->init_youtube_livechat_section();
|
174 |
+
|
175 |
+
if (!is_embedpress_pro_active()) {
|
176 |
+
$this->start_controls_section(
|
177 |
+
'embedpress_pro_section',
|
178 |
+
[
|
179 |
+
'label' => __('Go Premium for More Features', 'embedpress'),
|
180 |
+
]
|
181 |
+
);
|
182 |
+
|
183 |
+
$this->add_control(
|
184 |
+
'embedpress_pro_cta',
|
185 |
+
[
|
186 |
+
'label' => __('Unlock more possibilities', 'embedpress'),
|
187 |
+
'type' => Controls_Manager::CHOOSE,
|
188 |
+
'options' => [
|
189 |
+
'1' => [
|
190 |
+
'title' => '',
|
191 |
+
'icon' => 'eicon-lock',
|
192 |
+
],
|
193 |
+
],
|
194 |
+
'default' => '1',
|
195 |
+
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Pro version</a> for more provider support and customization options.</span>',
|
196 |
+
]
|
197 |
+
);
|
198 |
+
|
199 |
+
$this->end_controls_section();
|
200 |
+
}
|
201 |
+
|
202 |
+
$this->init_style_controls();
|
203 |
+
}
|
204 |
+
public function init_youtube_controls()
|
205 |
+
{
|
206 |
$yt_condition = [
|
207 |
'embedpress_pro_embeded_source' => 'youtube'
|
208 |
];
|
209 |
$this->add_control(
|
210 |
'embedpress_pro_youtube_end_time',
|
211 |
[
|
212 |
+
'label' => __('End Time', 'embedpress'),
|
213 |
'type' => Controls_Manager::NUMBER,
|
214 |
+
'description' => __('Specify an end time (in seconds)', 'embedpress'),
|
215 |
'condition' => $yt_condition,
|
216 |
]
|
217 |
);
|
218 |
+
|
219 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
$this->add_control(
|
221 |
'embedpress_pro_youtube_auto_play',
|
222 |
[
|
223 |
+
'label' => __('Auto Play', 'embedpress'),
|
224 |
'type' => Controls_Manager::SWITCHER,
|
225 |
'label_block' => false,
|
226 |
'return_value' => 'yes',
|
231 |
$this->add_control(
|
232 |
'embedpress_pro_youtube_player_options',
|
233 |
[
|
234 |
+
'label' => __('Player Options', 'embedpress'),
|
235 |
'type' => Controls_Manager::HEADING,
|
236 |
'condition' => $yt_condition,
|
237 |
]
|
239 |
$this->add_control(
|
240 |
'embedpress_pro_youtube_display_controls',
|
241 |
[
|
242 |
+
'label' => __('Controls', 'embedpress'),
|
243 |
'type' => Controls_Manager::SELECT,
|
244 |
'label_block' => false,
|
245 |
'default' => 1,
|
246 |
'options' => [
|
247 |
+
'1' => __('Display immediately', 'embedpress'),
|
248 |
+
'2' => __('Display after user initiation', 'embedpress'),
|
249 |
+
'0' => __('Hide controls', 'embedpress')
|
250 |
],
|
251 |
'condition' => $yt_condition,
|
252 |
]
|
254 |
$this->add_control(
|
255 |
'embedpress_pro_youtube_enable_fullscreen_button',
|
256 |
[
|
257 |
+
'label' => __('Fullscreen button', 'embedpress'),
|
258 |
'type' => Controls_Manager::SWITCHER,
|
259 |
'label_block' => false,
|
260 |
'return_value' => 'yes',
|
268 |
$this->add_control(
|
269 |
'embedpress_pro_youtube_display_video_annotations',
|
270 |
[
|
271 |
+
'label' => __('Video Annotations', 'embedpress'),
|
272 |
'type' => Controls_Manager::SWITCHER,
|
273 |
'label_block' => false,
|
274 |
'default' => 1,
|
275 |
'options' => [
|
276 |
+
'1' => __('Display', 'embedpress'),
|
277 |
+
'3' => __('Do Not Display', 'embedpress')
|
278 |
],
|
279 |
'condition' => $yt_condition,
|
280 |
]
|
281 |
);
|
282 |
+
//--- YouTube Pro control starts ---
|
283 |
$this->add_control(
|
284 |
'embedpress_pro_youtube_progress_bar_color',
|
285 |
[
|
286 |
+
'label' => __('Progress Bar Color', 'embedpress'),
|
287 |
'type' => Controls_Manager::SELECT,
|
288 |
'label_block' => false,
|
289 |
'default' => 'red',
|
290 |
'options' => [
|
291 |
+
'red' => __('Red', 'embedpress'),
|
292 |
+
'white' => __('White', 'embedpress')
|
293 |
],
|
294 |
'condition' => $yt_condition,
|
295 |
]
|
297 |
$this->add_control(
|
298 |
'embedpress_pro_youtube_force_closed_captions',
|
299 |
[
|
300 |
+
'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text),
|
301 |
'type' => Controls_Manager::SWITCHER,
|
302 |
'label_block' => false,
|
303 |
'return_value' => 'yes',
|
310 |
$this->add_control(
|
311 |
'embedpress_pro_youtube_modest_branding',
|
312 |
[
|
313 |
+
'label' => sprintf(__('Modest Branding %s', 'embedpress'), $this->pro_text),
|
314 |
'type' => Controls_Manager::SELECT,
|
315 |
'label_block' => false,
|
316 |
'default' => 1,
|
317 |
'options' => [
|
318 |
+
'0' => __('Display', 'embedpress'),
|
319 |
+
'1' => __('Do Not Display', 'embedpress')
|
320 |
],
|
321 |
'condition' => [
|
322 |
'embedpress_pro_embeded_source' => 'youtube',
|
329 |
$this->add_control(
|
330 |
'embedpress_pro_youtube_display_related_videos',
|
331 |
[
|
332 |
+
'label' => __('Related Videos', 'embedpress'),
|
333 |
+
'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'),
|
334 |
'type' => Controls_Manager::SWITCHER,
|
335 |
'label_block' => false,
|
336 |
'return_value' => 'yes',
|
338 |
'condition' => $yt_condition,
|
339 |
]
|
340 |
);
|
341 |
+
$this->init_branding_controls('youtube');
|
342 |
}
|
343 |
+
|
344 |
+
public function init_youtube_channel_section()
|
345 |
+
{
|
346 |
+
$yt_condition = [
|
347 |
+
'embedpress_pro_embeded_source' => 'youtube',
|
348 |
+
];
|
349 |
+
$this->start_controls_section(
|
350 |
+
'embedpress_yt_channel_section',
|
351 |
+
[
|
352 |
+
'label' => __('YouTube Channel', 'embedpress'),
|
353 |
+
'condition' => $yt_condition,
|
354 |
+
|
355 |
+
]
|
356 |
+
);
|
357 |
+
|
358 |
+
$this->add_control(
|
359 |
+
'important_note',
|
360 |
+
[
|
361 |
+
'type' => \Elementor\Controls_Manager::RAW_HTML,
|
362 |
+
'raw' => esc_html__( 'These options take effect only when a YouTube channel is embedded.', 'embedpress' ),
|
363 |
+
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
|
364 |
+
]
|
365 |
+
);
|
366 |
+
|
367 |
+
$this->add_control(
|
368 |
+
'pagesize',
|
369 |
+
[
|
370 |
+
'label' => __('Video Per Page', 'embedpress'),
|
371 |
+
'type' => Controls_Manager::NUMBER,
|
372 |
+
'label_block' => false,
|
373 |
+
'default' => 6,
|
374 |
+
'min' => 1,
|
375 |
+
'max' => 50,
|
376 |
+
'conditions' => [
|
377 |
+
'terms' => [
|
378 |
+
[
|
379 |
+
'name' => 'embedpress_pro_embeded_source',
|
380 |
+
'operator' => '===',
|
381 |
+
'value' => 'youtube',
|
382 |
+
],
|
383 |
+
],
|
384 |
+
]
|
385 |
+
]
|
386 |
+
);
|
387 |
+
|
388 |
+
$this->add_control(
|
389 |
+
'columns',
|
390 |
+
[
|
391 |
+
'label' => __('Column', 'embedpress'),
|
392 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
393 |
+
'label_block' => false,
|
394 |
+
'default' => '3',
|
395 |
+
'options' => [
|
396 |
+
'2' => esc_html__('2', 'embedpress'),
|
397 |
+
'3' => esc_html__('3', 'embedpress'),
|
398 |
+
'4' => esc_html__('4', 'embedpress'),
|
399 |
+
'6' => esc_html__('6', 'embedpress'),
|
400 |
+
'auto' => esc_html__('Auto', 'embedpress'),
|
401 |
+
],
|
402 |
+
'conditions' => [
|
403 |
+
'terms' => [
|
404 |
+
[
|
405 |
+
'name' => 'embedpress_pro_embeded_source',
|
406 |
+
'operator' => '===',
|
407 |
+
'value' => 'youtube',
|
408 |
+
],
|
409 |
+
],
|
410 |
+
]
|
411 |
+
]
|
412 |
+
);
|
413 |
+
$this->add_control(
|
414 |
+
'gapbetweenvideos',
|
415 |
+
[
|
416 |
+
'label' => __('Gap Between Videos', 'embedpress'),
|
417 |
+
'label_block' => true,
|
418 |
+
'type' => \Elementor\Controls_Manager::SLIDER,
|
419 |
+
'size_units' => ['px', '%'],
|
420 |
+
'range' => [
|
421 |
+
'px' => [
|
422 |
+
'min' => 0,
|
423 |
+
'max' => 100,
|
424 |
+
'step' => 1,
|
425 |
+
],
|
426 |
+
'%' => [
|
427 |
+
'min' => 0,
|
428 |
+
'max' => 100,
|
429 |
+
],
|
430 |
+
],
|
431 |
+
'default' => [
|
432 |
+
'unit' => 'px',
|
433 |
+
'size' => 30,
|
434 |
+
],
|
435 |
+
'conditions' => [
|
436 |
+
'terms' => [
|
437 |
+
[
|
438 |
+
'name' => 'embedpress_pro_embeded_source',
|
439 |
+
'operator' => '===',
|
440 |
+
'value' => 'youtube',
|
441 |
+
],
|
442 |
+
],
|
443 |
+
],
|
444 |
+
'selectors' => [
|
445 |
+
'{{WRAPPER}} .ep-youtube__content__block .youtube__content__body .content__wrap' => 'gap: {{SIZE}}{{UNIT}}!important;margin-top: {{SIZE}}{{UNIT}}!important;',
|
446 |
+
],
|
447 |
+
]
|
448 |
+
);
|
449 |
+
|
450 |
+
$this->add_control(
|
451 |
+
'pagination',
|
452 |
+
[
|
453 |
+
'label' => __('Pagination', 'embedpress'),
|
454 |
+
'type' => Controls_Manager::SWITCHER,
|
455 |
+
'label_block' => false,
|
456 |
+
'label_on' => esc_html__('Show', 'embedpress'),
|
457 |
+
'label_off' => esc_html__('Hide', 'embedpress'),
|
458 |
+
'return_value' => 'show',
|
459 |
+
'default' => 'show',
|
460 |
+
'condition' => $yt_condition,
|
461 |
+
]
|
462 |
+
);
|
463 |
+
|
464 |
+
|
465 |
+
$this->end_controls_section();
|
466 |
+
}
|
467 |
+
public function init_youtube_subscription_section()
|
468 |
+
{
|
469 |
$yt_condition = [
|
470 |
'embedpress_pro_embeded_source' => 'youtube',
|
471 |
];
|
472 |
$this->start_controls_section(
|
473 |
'embedpress_yt_subscription_section',
|
474 |
[
|
475 |
+
'label' => __('YouTube Subscriber', 'embedpress'),
|
476 |
'condition' => $yt_condition,
|
477 |
|
478 |
]
|
483 |
'yt_sub_channel',
|
484 |
[
|
485 |
|
486 |
+
'label' => sprintf(__('Channel ID %s', 'embedpress'), $this->pro_text),
|
487 |
'type' => Controls_Manager::TEXT,
|
488 |
'dynamic' => [
|
489 |
'active' => true,
|
490 |
],
|
491 |
+
'placeholder' => __('Enter Channel ID', 'embedpress'),
|
492 |
'label_block' => true,
|
493 |
'condition' => $yt_condition,
|
494 |
'classes' => $this->pro_class,
|
498 |
'yt_sub_text',
|
499 |
[
|
500 |
|
501 |
+
'label' => sprintf(__('Subscription Text %s', 'embedpress'), $this->pro_text),
|
502 |
'type' => Controls_Manager::TEXT,
|
503 |
'dynamic' => [
|
504 |
'active' => true,
|
505 |
],
|
506 |
+
'placeholder' => __('Eg. Don\'t miss out! Subscribe', 'embedpress'),
|
507 |
'label_block' => true,
|
508 |
'condition' => $yt_condition,
|
509 |
'classes' => $this->pro_class,
|
514 |
$this->add_control(
|
515 |
'yt_sub_layout',
|
516 |
[
|
517 |
+
'label' => sprintf(__('Layout %s', 'embedpress'), $this->pro_text),
|
518 |
'type' => Controls_Manager::SELECT,
|
519 |
'label_block' => false,
|
520 |
'default' => 'default',
|
521 |
'options' => [
|
522 |
+
'default' => __('Default', 'embedpress'),
|
523 |
+
'full' => __('Full', 'embedpress')
|
524 |
],
|
525 |
'condition' => [
|
526 |
'embedpress_pro_embeded_source' => 'youtube',
|
532 |
$this->add_control(
|
533 |
'yt_sub_theme',
|
534 |
[
|
535 |
+
'label' => sprintf(__('Theme %s', 'embedpress'), $this->pro_text),
|
536 |
'type' => Controls_Manager::SELECT,
|
537 |
'label_block' => false,
|
538 |
'default' => 'default',
|
539 |
'options' => [
|
540 |
+
'default' => __('Default', 'embedpress'),
|
541 |
+
'dark' => __('Dark', 'embedpress')
|
542 |
],
|
543 |
'condition' => [
|
544 |
'embedpress_pro_embeded_source' => 'youtube',
|
550 |
$this->add_control(
|
551 |
'yt_sub_count',
|
552 |
[
|
553 |
+
'label' => sprintf(__('Subscriber Count %s', 'embedpress'), $this->pro_text),
|
554 |
'type' => Controls_Manager::SWITCHER,
|
555 |
'label_block' => false,
|
556 |
'return_value' => 'yes',
|
561 |
);
|
562 |
|
563 |
$this->end_controls_section();
|
|
|
564 |
}
|
565 |
+
public function init_youtube_livechat_section()
|
566 |
+
{
|
567 |
$yt_condition = [
|
568 |
'embedpress_pro_embeded_source' => 'youtube',
|
569 |
];
|
570 |
$this->start_controls_section(
|
571 |
'embedpress_yt_livechat_section',
|
572 |
[
|
573 |
+
'label' => __('YouTube Live Chat', 'embedpress'),
|
574 |
'condition' => $yt_condition,
|
575 |
|
576 |
]
|
579 |
$this->add_control(
|
580 |
'yt_lc_show',
|
581 |
[
|
582 |
+
'label' => sprintf(__('Show YouTube Live Chat %s', 'embedpress'), $this->pro_text),
|
583 |
'type' => Controls_Manager::SWITCHER,
|
584 |
'label_block' => false,
|
585 |
'return_value' => 'yes',
|
586 |
'default' => '',
|
587 |
+
'label_off' => __('Hide', 'embedpress'),
|
588 |
+
'label_on' => __('Show', 'embedpress'),
|
589 |
'condition' => $yt_condition,
|
590 |
'classes' => $this->pro_class,
|
591 |
]
|
593 |
|
594 |
|
595 |
$this->end_controls_section();
|
|
|
596 |
}
|
597 |
+
public function init_dailymotion_control()
|
598 |
+
{
|
599 |
+
//@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo'
|
600 |
$this->add_control(
|
601 |
'embedpress_pro_dailymotion_ui_logo',
|
602 |
[
|
603 |
+
'label' => sprintf(__('Logo %s', 'embedpress'), $this->pro_text),
|
604 |
'type' => Controls_Manager::SWITCHER,
|
605 |
'label_block' => false,
|
606 |
'return_value' => 'yes',
|
607 |
'default' => 'yes',
|
608 |
+
'label_off' => __('Hide', 'embedpress'),
|
609 |
+
'label_on' => __('Show', 'embedpress'),
|
610 |
'condition' => [
|
611 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
612 |
],
|
616 |
$this->add_control(
|
617 |
'embedpress_pro_dailymotion_autoplay',
|
618 |
[
|
619 |
+
'label' => __('Auto Play', 'embedpress'),
|
620 |
'type' => Controls_Manager::SWITCHER,
|
621 |
'label_block' => false,
|
622 |
'return_value' => 'yes',
|
623 |
'default' => 'no',
|
624 |
+
'label_off' => __('Hide', 'embedpress'),
|
625 |
+
'label_on' => __('Show', 'embedpress'),
|
626 |
'condition' => [
|
627 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
628 |
]
|
631 |
$this->add_control(
|
632 |
'embedpress_pro_dailymotion_play_on_mobile',
|
633 |
[
|
634 |
+
'label' => __('Play On Mobile', 'embedpress'),
|
635 |
'type' => Controls_Manager::SWITCHER,
|
636 |
'label_block' => false,
|
637 |
'return_value' => 'yes',
|
638 |
'default' => 'no',
|
639 |
+
'label_off' => __('Hide', 'embedpress'),
|
640 |
+
'label_on' => __('Show', 'embedpress'),
|
641 |
'condition' => [
|
642 |
'embedpress_pro_embeded_source' => 'dailymotion',
|
643 |
'embedpress_pro_dailymotion_autoplay' => 'yes'
|
647 |
$this->add_control(
|
648 |
'embedpress_pro_dailymotion_mute',
|
649 |
[
|
650 |
+
'label' => __('Mute', 'embedpress'),
|
651 |
'type' => Controls_Manager::SWITCHER,
|
652 |
'label_block' => false,
|
653 |
'return_value' => 'yes',
|
654 |
'default' => 'no',
|
655 |
+
'label_off' => __('Hide', 'embedpress'),
|
656 |
+
'label_on' => __('Show', 'embedpress'),
|
657 |
'condition' => [
|
658 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
659 |
]
|
662 |
$this->add_control(
|
663 |
'embedpress_pro_dailymotion_player_control',
|
664 |
[
|
665 |
+
'label' => __('Player Controls', 'embedpress'),
|
666 |
'type' => Controls_Manager::SWITCHER,
|
667 |
'label_block' => false,
|
668 |
'return_value' => 'yes',
|
669 |
'default' => 'yes',
|
670 |
+
'label_off' => __('Hide', 'embedpress'),
|
671 |
+
'label_on' => __('Show', 'embedpress'),
|
672 |
'condition' => [
|
673 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
674 |
]
|
677 |
$this->add_control(
|
678 |
'embedpress_pro_dailymotion_video_info',
|
679 |
[
|
680 |
+
'label' => __('Video Info', 'embedpress'),
|
681 |
'type' => Controls_Manager::SWITCHER,
|
682 |
'label_block' => false,
|
683 |
'return_value' => 'yes',
|
684 |
'default' => 'yes',
|
685 |
+
'label_off' => __('Hide', 'embedpress'),
|
686 |
+
'label_on' => __('Show', 'embedpress'),
|
687 |
'condition' => [
|
688 |
'embedpress_pro_embeded_source' => 'dailymotion'
|
689 |
]
|
692 |
$this->add_control(
|
693 |
'embedpress_pro_dailymotion_control_color',
|
694 |
[
|
695 |
+
'label' => __('Control Color', 'embedpress'),
|
696 |
'type' => Controls_Manager::COLOR,
|
697 |
'label_block' => false,
|
698 |
'default' => '#dd3333',
|
701 |
]
|
702 |
]
|
703 |
);
|
704 |
+
$this->init_branding_controls('dailymotion');
|
|
|
705 |
}
|
706 |
+
public function init_wistia_controls()
|
707 |
+
{
|
708 |
$this->add_control(
|
709 |
'embedpress_pro_wistia_auto_play',
|
710 |
[
|
711 |
+
'label' => __('Auto Play', 'embedpress'),
|
712 |
'type' => Controls_Manager::SWITCHER,
|
713 |
'label_block' => false,
|
714 |
'return_value' => 'yes',
|
722 |
$this->add_control(
|
723 |
'embedpress_pro_wistia_color',
|
724 |
[
|
725 |
+
'label' => __('Scheme', 'embedpress'),
|
726 |
'type' => Controls_Manager::COLOR,
|
727 |
'label_block' => false,
|
728 |
'default' => '#dd3333',
|
737 |
$this->add_control(
|
738 |
'embedpress_pro_wistia_captions_enabled_by_default',
|
739 |
[
|
740 |
+
'label' => __('Captions Enabled By Default', 'embedpress'),
|
741 |
'type' => Controls_Manager::SWITCHER,
|
742 |
'label_block' => false,
|
743 |
'return_value' => 'yes',
|
753 |
$this->add_control(
|
754 |
'embedpress_pro_wistia_player_options',
|
755 |
[
|
756 |
+
'label' => __('Player Options', 'embedpress'),
|
757 |
'type' => Controls_Manager::HEADING,
|
758 |
'separator' => 'before',
|
759 |
'condition' => [
|
767 |
$this->add_control(
|
768 |
'embedpress_pro_wistia_fullscreen_button',
|
769 |
[
|
770 |
+
'label' => __('Fullscreen Button', 'embedpress'),
|
771 |
'type' => Controls_Manager::SWITCHER,
|
772 |
'label_block' => false,
|
773 |
'return_value' => 'yes',
|
781 |
$this->add_control(
|
782 |
'embedpress_pro_wistia_small_play_button',
|
783 |
[
|
784 |
+
'label' => __('Small Play Button', 'embedpress'),
|
785 |
'type' => Controls_Manager::SWITCHER,
|
786 |
'label_block' => false,
|
787 |
'return_value' => 'yes',
|
798 |
$this->add_control(
|
799 |
'embedpress_pro_wistia_resumable',
|
800 |
[
|
801 |
+
'label' => __('Resumable', 'embedpress'),
|
802 |
'type' => Controls_Manager::SWITCHER,
|
803 |
'label_block' => false,
|
804 |
'return_value' => 'yes',
|
813 |
$this->add_control(
|
814 |
'embedpress_pro_wistia_focus',
|
815 |
[
|
816 |
+
'label' => __('Focus', 'embedpress'),
|
817 |
'type' => Controls_Manager::SWITCHER,
|
818 |
'label_block' => false,
|
819 |
'return_value' => 'yes',
|
828 |
$this->add_control(
|
829 |
'embedpress_pro_wistia_captions',
|
830 |
[
|
831 |
+
'label' => sprintf(__('Captions %s', 'embedpress'), $this->pro_text),
|
832 |
'type' => Controls_Manager::SWITCHER,
|
833 |
'label_block' => false,
|
834 |
'return_value' => 'yes',
|
842 |
$this->add_control(
|
843 |
'embedpress_pro_wistia_playbar',
|
844 |
[
|
845 |
+
'label' => __('Playbar ', 'embedpress'),
|
846 |
'type' => Controls_Manager::SWITCHER,
|
847 |
'label_block' => false,
|
848 |
'return_value' => 'yes',
|
856 |
$this->add_control(
|
857 |
'embedpress_pro_wistia_volume_control',
|
858 |
[
|
859 |
+
'label' => sprintf(__('Volume Control %s', 'embedpress'), $this->pro_text),
|
860 |
'type' => Controls_Manager::SWITCHER,
|
861 |
'label_block' => false,
|
862 |
'return_value' => 'yes',
|
872 |
$this->add_control(
|
873 |
'embedpress_pro_wistia_volume',
|
874 |
[
|
875 |
+
'label' => sprintf(__('Volume %s', 'embedpress'), $this->pro_text),
|
876 |
'type' => Controls_Manager::SLIDER,
|
877 |
'default' => [
|
878 |
'size' => 100,
|
894 |
$this->add_control(
|
895 |
'embedpress_pro_wistia_rewind',
|
896 |
[
|
897 |
+
'label' => __('Rewind', 'embedpress'),
|
898 |
'type' => Controls_Manager::SWITCHER,
|
899 |
'label_block' => false,
|
900 |
'return_value' => 'yes',
|
908 |
$this->add_control(
|
909 |
'embedpress_pro_wistia_rewind_time',
|
910 |
[
|
911 |
+
'label' => __('Rewind time', 'embedpress'),
|
912 |
'type' => Controls_Manager::SLIDER,
|
913 |
'default' => [
|
914 |
'size' => 10,
|
925 |
],
|
926 |
]
|
927 |
);
|
928 |
+
$this->init_branding_controls('wistia');
|
|
|
929 |
}
|
930 |
+
public function init_twitch_control()
|
931 |
+
{
|
932 |
$condition = [
|
933 |
'embedpress_pro_embeded_source' => 'twitch'
|
934 |
];
|
935 |
$this->add_control(
|
936 |
'embedpress_pro_twitch_autoplay',
|
937 |
[
|
938 |
+
'label' => __('Autoplay', 'embedpress'),
|
939 |
'type' => Controls_Manager::SWITCHER,
|
940 |
+
'label_off' => __('No', 'embedpress'),
|
941 |
+
'label_on' => __('Yes', 'embedpress'),
|
942 |
'default' => 'yes',
|
943 |
'condition' => $condition,
|
944 |
]
|
946 |
$this->add_control(
|
947 |
'embedpress_pro_fs',
|
948 |
[
|
949 |
+
'label' => __('Allow Full Screen Video', 'embedpress'),
|
950 |
'type' => Controls_Manager::SWITCHER,
|
951 |
+
'label_off' => __('No', 'embedpress'),
|
952 |
+
'label_on' => __('Yes', 'embedpress'),
|
953 |
'default' => 'yes',
|
954 |
'condition' => $condition,
|
955 |
]
|
959 |
$this->add_control(
|
960 |
'embedpress_pro_twitch_chat',
|
961 |
[
|
962 |
+
'label' => sprintf(__('Show Chat %s', 'embedpress'), $this->pro_text),
|
963 |
'type' => Controls_Manager::SWITCHER,
|
964 |
+
'label_off' => __('Hide', 'embedpress'),
|
965 |
+
'label_on' => __('Show', 'embedpress'),
|
966 |
'condition' => $condition,
|
967 |
'classes' => $this->pro_class,
|
968 |
|
971 |
$this->add_control(
|
972 |
'embedpress_pro_twitch_mute',
|
973 |
[
|
974 |
+
'label' => __('Mute on start', 'embedpress'),
|
975 |
'type' => Controls_Manager::SWITCHER,
|
976 |
+
'label_off' => __('Hide', 'embedpress'),
|
977 |
+
'label_on' => __('Show', 'embedpress'),
|
978 |
'condition' => $condition,
|
979 |
]
|
980 |
);
|
981 |
$this->add_control(
|
982 |
'embedpress_pro_twitch_theme',
|
983 |
[
|
984 |
+
'label' => __('Theme', 'embedpress'),
|
985 |
'type' => Controls_Manager::SELECT,
|
986 |
'default' => 'dark',
|
987 |
'options' => [
|
988 |
+
'dark' => __('Dark', 'embedpress'),
|
989 |
+
'light' => __('Light', 'embedpress'),
|
990 |
],
|
991 |
'condition' => $condition,
|
992 |
]
|
993 |
);
|
994 |
|
995 |
+
$this->init_branding_controls('twitch');
|
|
|
996 |
}
|
997 |
+
public function init_soundcloud_controls()
|
998 |
+
{
|
999 |
$this->add_control(
|
1000 |
'embedpress_pro_soundcloud_visual',
|
1001 |
[
|
1002 |
+
'label' => __('Visual Player', 'embedpress'),
|
1003 |
'type' => Controls_Manager::SWITCHER,
|
1004 |
'label_block' => false,
|
1005 |
'return_value' => 'yes',
|
1006 |
'default' => 'no',
|
1007 |
+
'label_off' => __('Hide', 'embedpress'),
|
1008 |
+
'label_on' => __('Show', 'embedpress'),
|
1009 |
'condition' => [
|
1010 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1011 |
],
|
1015 |
$this->add_control(
|
1016 |
'embedpress_pro_soundcloud_color',
|
1017 |
[
|
1018 |
+
'label' => __('Scheme', 'embedpress'),
|
1019 |
'type' => Controls_Manager::COLOR,
|
1020 |
'label_block' => false,
|
1021 |
'default' => '#FF5500',
|
1028 |
$this->add_control(
|
1029 |
'embedpress_pro_soundcloud_autoplay',
|
1030 |
[
|
1031 |
+
'label' => __('Auto Play', 'embedpress'),
|
1032 |
'type' => Controls_Manager::SWITCHER,
|
1033 |
'label_block' => false,
|
1034 |
'return_value' => 'yes',
|
1035 |
'default' => 'no',
|
1036 |
+
'label_off' => __('Hide', 'embedpress'),
|
1037 |
+
'label_on' => __('Show', 'embedpress'),
|
1038 |
'condition' => [
|
1039 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1040 |
],
|
1046 |
$this->add_control(
|
1047 |
'embedpress_pro_soundcloud_share_button',
|
1048 |
[
|
1049 |
+
'label' => __('Share Button', 'embedpress'),
|
1050 |
'type' => Controls_Manager::SWITCHER,
|
1051 |
'label_block' => false,
|
1052 |
'return_value' => 'yes',
|
1053 |
'default' => 'yes',
|
1054 |
+
'label_off' => __('Hide', 'embedpress'),
|
1055 |
+
'label_on' => __('Show', 'embedpress'),
|
1056 |
'condition' => [
|
1057 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1058 |
],
|
1062 |
$this->add_control(
|
1063 |
'embedpress_pro_soundcloud_comments',
|
1064 |
[
|
1065 |
+
'label' => __('Comments', 'embedpress'),
|
1066 |
'type' => Controls_Manager::SWITCHER,
|
1067 |
'label_block' => false,
|
1068 |
'return_value' => 'yes',
|
1069 |
'default' => 'yes',
|
1070 |
+
'label_off' => __('Hide', 'embedpress'),
|
1071 |
+
'label_on' => __('Show', 'embedpress'),
|
1072 |
'condition' => [
|
1073 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1074 |
],
|
1080 |
$this->add_control(
|
1081 |
'embedpress_pro_soundcloud_artwork',
|
1082 |
[
|
1083 |
+
'label' => __('Artwork', 'embedpress'),
|
1084 |
'type' => Controls_Manager::SWITCHER,
|
1085 |
'label_block' => false,
|
1086 |
'return_value' => 'yes',
|
1087 |
'default' => 'yes',
|
1088 |
+
'label_off' => __('Hide', 'embedpress'),
|
1089 |
+
'label_on' => __('Show', 'embedpress'),
|
1090 |
'condition' => [
|
1091 |
'embedpress_pro_embeded_source' => 'soundcloud',
|
1092 |
'embedpress_pro_soundcloud_visual!' => 'yes'
|
1097 |
$this->add_control(
|
1098 |
'embedpress_pro_soundcloud_play_count',
|
1099 |
[
|
1100 |
+
'label' => __('Play Count', 'embedpress'),
|
1101 |
'type' => Controls_Manager::SWITCHER,
|
1102 |
'label_block' => false,
|
1103 |
'return_value' => 'yes',
|
1104 |
'default' => 'yes',
|
1105 |
+
'label_off' => __('Hide', 'embedpress'),
|
1106 |
+
'label_on' => __('Show', 'embedpress'),
|
1107 |
'condition' => [
|
1108 |
'embedpress_pro_embeded_source' => 'soundcloud',
|
1109 |
'embedpress_pro_soundcloud_visual!' => 'yes'
|
1114 |
$this->add_control(
|
1115 |
'embedpress_pro_soundcloud_user_name',
|
1116 |
[
|
1117 |
+
'label' => __('User Name', 'embedpress'),
|
1118 |
'type' => Controls_Manager::SWITCHER,
|
1119 |
'label_block' => false,
|
1120 |
'return_value' => 'yes',
|
1121 |
'default' => 'yes',
|
1122 |
+
'label_off' => __('Hide', 'embedpress'),
|
1123 |
+
'label_on' => __('Show', 'embedpress'),
|
1124 |
'condition' => [
|
1125 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1126 |
],
|
1130 |
$this->add_control(
|
1131 |
'embedpress_pro_soundcloud_buy_button',
|
1132 |
[
|
1133 |
+
'label' => sprintf(__('Buy Button %s', 'embedpress'), $this->pro_text),
|
1134 |
'type' => Controls_Manager::SWITCHER,
|
1135 |
'label_block' => false,
|
1136 |
'return_value' => 'yes',
|
1137 |
'default' => 'yes',
|
1138 |
+
'label_off' => __('Hide', 'embedpress'),
|
1139 |
+
'label_on' => __('Show', 'embedpress'),
|
1140 |
'condition' => [
|
1141 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1142 |
],
|
1146 |
$this->add_control(
|
1147 |
'embedpress_pro_soundcloud_download_button',
|
1148 |
[
|
1149 |
+
'label' => sprintf(__('Download Button %s', 'embedpress'), $this->pro_text),
|
1150 |
'type' => Controls_Manager::SWITCHER,
|
1151 |
'label_block' => false,
|
1152 |
'return_value' => 'yes',
|
1153 |
'default' => 'yes',
|
1154 |
+
'label_off' => __('Hide', 'embedpress'),
|
1155 |
+
'label_on' => __('Show', 'embedpress'),
|
1156 |
'condition' => [
|
1157 |
'embedpress_pro_embeded_source' => 'soundcloud'
|
1158 |
],
|
1160 |
]
|
1161 |
);
|
1162 |
}
|
1163 |
+
public function init_vimeo_controls()
|
1164 |
+
{
|
1165 |
$this->add_control(
|
1166 |
'embedpress_pro_vimeo_auto_play',
|
1167 |
[
|
1168 |
+
'label' => __('Auto Play', 'embedpress'),
|
1169 |
'type' => Controls_Manager::SWITCHER,
|
1170 |
'label_block' => false,
|
1171 |
'return_value' => 'yes',
|
1180 |
$this->add_control(
|
1181 |
'embedpress_pro_vimeo_color',
|
1182 |
[
|
1183 |
+
'label' => __('Scheme', 'embedpress'),
|
1184 |
'type' => Controls_Manager::COLOR,
|
1185 |
'label_block' => false,
|
1186 |
'default' => '#00adef',
|
1193 |
$this->add_control(
|
1194 |
'embedpress_pro_vimeo_author_options',
|
1195 |
[
|
1196 |
+
'label' => __('Author Information', 'embedpress'),
|
1197 |
'type' => Controls_Manager::HEADING,
|
1198 |
'separator' => 'before',
|
1199 |
'condition' => [
|
1205 |
$this->add_control(
|
1206 |
'embedpress_pro_vimeo_display_title',
|
1207 |
[
|
1208 |
+
'label' => __('Title', 'embedpress'),
|
1209 |
'type' => Controls_Manager::SWITCHER,
|
1210 |
'label_block' => false,
|
1211 |
'return_value' => 'yes',
|
1221 |
$this->add_control(
|
1222 |
'embedpress_pro_vimeo_display_author',
|
1223 |
[
|
1224 |
+
'label' => __('Author', 'embedpress'),
|
1225 |
'type' => Controls_Manager::SWITCHER,
|
1226 |
'label_block' => false,
|
1227 |
'return_value' => 'yes',
|
1235 |
$this->add_control(
|
1236 |
'embedpress_pro_vimeo_avatar',
|
1237 |
[
|
1238 |
+
'label' => __('Avatar', 'embedpress'),
|
1239 |
'type' => Controls_Manager::SWITCHER,
|
1240 |
'label_block' => false,
|
1241 |
'return_value' => 'yes',
|
1249 |
$this->add_control(
|
1250 |
'embedpress_pro_vimeo_loop',
|
1251 |
[
|
1252 |
+
'label' => sprintf(__('Loop %s', 'embedpress'), $this->pro_text),
|
1253 |
'type' => Controls_Manager::SWITCHER,
|
1254 |
'label_block' => false,
|
1255 |
'return_value' => 'yes',
|
1264 |
$this->add_control(
|
1265 |
'embedpress_pro_vimeo_autopause',
|
1266 |
[
|
1267 |
+
'label' => sprintf(__('Auto Pause %s', 'embedpress'), $this->pro_text),
|
1268 |
'type' => Controls_Manager::SWITCHER,
|
1269 |
'label_block' => false,
|
1270 |
'return_value' => 'yes',
|
1279 |
$this->add_control(
|
1280 |
'embedpress_pro_vimeo_dnt',
|
1281 |
[
|
1282 |
+
'label' => sprintf(__('DNT %s', 'embedpress'), $this->pro_text),
|
1283 |
'type' => Controls_Manager::SWITCHER,
|
1284 |
'label_block' => false,
|
1285 |
'return_value' => 'yes',
|
1286 |
'default' => 'yes',
|
1287 |
+
'description' => __(
|
1288 |
+
'Set this parameter to "yes" will block the player from tracking any session data, including all cookies',
|
1289 |
+
'embedpress'
|
1290 |
+
),
|
1291 |
'condition' => [
|
1292 |
'embedpress_pro_embeded_source' => 'vimeo'
|
1293 |
],
|
1296 |
);
|
1297 |
|
1298 |
|
1299 |
+
$this->init_branding_controls('vimeo');
|
|
|
1300 |
}
|
1301 |
+
public function init_spotify_controls()
|
1302 |
+
{
|
1303 |
$condition = [
|
1304 |
'embedpress_pro_embeded_source' => 'spotify'
|
1305 |
];
|
1306 |
|
|
|
1307 |
$this->add_control(
|
1308 |
'spotify_theme',
|
1309 |
[
|
1310 |
+
'label' => __('Player Background', 'embedpress'),
|
1311 |
+
'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'),
|
1312 |
'type' => Controls_Manager::SELECT,
|
1313 |
'label_block' => false,
|
1314 |
'default' => '1',
|
1315 |
'options' => [
|
1316 |
+
'1' => __('Dynamic', 'embedpress'),
|
1317 |
+
'0' => __('Black & White', 'embedpress')
|
1318 |
],
|
1319 |
'condition' => $condition
|
1320 |
]
|
1321 |
);
|
1322 |
}
|
1323 |
|
1324 |
+
public function init_style_controls()
|
1325 |
+
{
|
1326 |
$this->start_controls_section(
|
1327 |
'embedpress_style_section',
|
1328 |
[
|
1329 |
+
'label' => __('Style', 'embedpress'),
|
1330 |
'tab' => Controls_Manager::TAB_STYLE,
|
1331 |
]
|
1332 |
);
|
1353 |
$this->add_control(
|
1354 |
'width',
|
1355 |
[
|
1356 |
+
'label' => __('Width', 'embedpress'),
|
1357 |
'type' => Controls_Manager::SLIDER,
|
1358 |
+
'size_units' => ['px'],
|
1359 |
'range' => [
|
1360 |
'px' => [
|
1361 |
'min' => 0,
|
1372 |
$this->add_control(
|
1373 |
'height',
|
1374 |
[
|
1375 |
+
'label' => __('Height', 'embedpress'),
|
1376 |
'type' => Controls_Manager::SLIDER,
|
1377 |
+
'size_units' => ['px'],
|
1378 |
'range' => [
|
1379 |
'px' => [
|
1380 |
'min' => 0,
|
1388 |
]
|
1389 |
]
|
1390 |
);
|
1391 |
+
|
1392 |
$this->add_responsive_control(
|
1393 |
'margin',
|
1394 |
[
|
1395 |
+
'label' => __('Margin', 'embedpress'),
|
1396 |
'type' => Controls_Manager::DIMENSIONS,
|
1397 |
+
'size_units' => ['px', '%', 'em'],
|
1398 |
'selectors' => [
|
1399 |
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1400 |
],
|
1403 |
$this->add_responsive_control(
|
1404 |
'padding',
|
1405 |
[
|
1406 |
+
'label' => __('Padding', 'embedpress'),
|
1407 |
'type' => Controls_Manager::DIMENSIONS,
|
1408 |
+
'size_units' => ['px', '%', 'em'],
|
1409 |
'selectors' => [
|
1410 |
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1411 |
],
|
1414 |
$this->add_responsive_control(
|
1415 |
'align',
|
1416 |
[
|
1417 |
+
'label' => esc_html__('Alignment', 'embedpress'),
|
1418 |
'type' => Controls_Manager::CHOOSE,
|
1419 |
'options' => [
|
1420 |
'left' => [
|
1421 |
+
'title' => esc_html__('Left', 'embedpress'),
|
1422 |
'icon' => 'eicon-text-align-left',
|
1423 |
],
|
1424 |
'center' => [
|
1425 |
+
'title' => esc_html__('Center', 'embedpress'),
|
1426 |
'icon' => 'eicon-text-align-center',
|
1427 |
],
|
1428 |
'right' => [
|
1429 |
+
'title' => esc_html__('Right', 'embedpress'),
|
1430 |
'icon' => 'eicon-text-align-right',
|
1431 |
],
|
1432 |
],
|
1437 |
$this->end_controls_section();
|
1438 |
}
|
1439 |
|
1440 |
+
public function render_plain_content()
|
1441 |
+
{
|
1442 |
$args = "";
|
1443 |
+
$settings = $this->get_settings_for_display();
|
1444 |
|
1445 |
+
$_settings = $this->convert_settings($settings);
|
1446 |
+
foreach ($_settings as $key => $value) {
|
1447 |
+
$args .= "$key='$value' ";
|
|
|
|
|
|
|
|
|
|
|
1448 |
}
|
1449 |
+
|
1450 |
$args = trim($args);
|
1451 |
echo "[embedpress $args]{$settings['embedpress_embeded_link']}\[/embedpress]";
|
1452 |
}
|
1453 |
|
1454 |
+
protected function convert_settings($settings)
|
1455 |
+
{
|
1456 |
+
$_settings = [];
|
1457 |
+
foreach ($settings as $key => $value) {
|
1458 |
+
if (!empty($value['size'])) {
|
1459 |
+
$_settings[$key] = $value['size'];
|
1460 |
+
} else if (!empty($value['url'])) {
|
1461 |
+
$_settings[$key] = $value['url'];
|
1462 |
+
} else if (\is_scalar($value)) {
|
1463 |
+
$_settings[$key] = $value;
|
1464 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1465 |
}
|
1466 |
+
|
1467 |
+
return $_settings;
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
protected function render()
|
1471 |
+
{
|
1472 |
+
add_filter('embedpress_should_modify_spotify', '__return_false');
|
1473 |
+
$settings = $this->get_settings_for_display();
|
1474 |
+
$is_editor_view = Plugin::$instance->editor->is_edit_mode();
|
1475 |
+
$link = $settings['embedpress_embeded_link'];
|
1476 |
+
$is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false);
|
1477 |
+
$_settings = $this->convert_settings($settings);
|
1478 |
+
|
1479 |
+
$embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings);
|
1480 |
+
$embed_content = $this->onAfterEmbedSpotify($embed_content, $settings);
|
1481 |
+
$embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings);
|
1482 |
+
$content = is_object($embed) ? $embed->embed : $embed;
|
1483 |
+
|
1484 |
+
$ispagination = 'flex';
|
1485 |
+
|
1486 |
+
if ($settings['pagination'] != 'show') {
|
1487 |
+
$ispagination = 'none';
|
1488 |
+
}
|
1489 |
+
|
1490 |
+
if (!empty($settings['columns']) && (int) $settings['columns'] > 0) {
|
1491 |
+
$calVal = 'calc(' . (100 / (int) $settings['columns']) . '% - ' . $settings['gapbetweenvideos']['size'] . 'px)';
|
1492 |
+
} else {
|
1493 |
+
$calVal = 'auto';
|
1494 |
+
}
|
1495 |
+
?>
|
1496 |
+
|
1497 |
+
<div class="embedpress-elements-wrapper <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : ''; ?>" id="ep-elements-id-<?php echo $this->get_id(); ?>">
|
1498 |
+
<?php
|
1499 |
+
// handle notice display
|
1500 |
+
if ($is_editor_view && $is_apple_podcast && !is_embedpress_pro_active()) {
|
1501 |
+
?>
|
1502 |
+
<p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p>
|
1503 |
+
<?php
|
1504 |
+
} else {
|
1505 |
+
echo $content;
|
1506 |
+
}
|
1507 |
+
?>
|
1508 |
+
</div>
|
1509 |
+
|
1510 |
+
<style>
|
1511 |
+
#ep-elements-id-<?php echo esc_html($this->get_id()); ?> .ep-youtube__content__block .youtube__content__body .content__wrap {
|
1512 |
+
grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important;
|
1513 |
}
|
1514 |
|
1515 |
+
#ep-elements-id-<?php echo esc_html($this->get_id()); ?> .ep-youtube__content__pagination {
|
1516 |
+
display: <?php echo esc_html($ispagination); ?> !important;
|
1517 |
+
}
|
1518 |
+
</style>
|
1519 |
+
<?php
|
1520 |
+
}
|
1521 |
+
public function onAfterEmbedSpotify($embed, $setting)
|
1522 |
+
{
|
1523 |
+
if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) {
|
1524 |
+
return $embed;
|
1525 |
+
}
|
1526 |
+
preg_match('/src=\"(.+?)\"/', $embed->embed, $match);
|
1527 |
+
$url_full = $match[1];
|
1528 |
+
$modified_url = str_replace('playlist-v2', 'playlist', $url_full);
|
1529 |
+
// apply elementor related mod
|
1530 |
+
if (isset($setting['spotify_theme'])) {
|
1531 |
+
if (strpos($modified_url, '?') !== false) {
|
1532 |
+
$modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']);
|
1533 |
+
} else {
|
1534 |
+
$modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']);
|
1535 |
+
}
|
1536 |
+
}
|
1537 |
|
1538 |
+
$embed->embed = str_replace($url_full, $modified_url, $embed->embed);
|
1539 |
return $embed;
|
1540 |
}
|
1541 |
}
|
EmbedPress/Elementor/Widgets/Embedpress_Pdf.php
CHANGED
@@ -9,13 +9,14 @@ use \Elementor\Widget_Base as Widget_Base;
|
|
9 |
use EmbedPress\Includes\Classes\Helper;
|
10 |
use EmbedPress\Includes\Traits\Branding;
|
11 |
|
12 |
-
(
|
13 |
|
14 |
class Embedpress_Pdf extends Widget_Base
|
15 |
{
|
|
|
16 |
use Branding;
|
17 |
-
|
18 |
-
|
19 |
public function get_name()
|
20 |
{
|
21 |
return 'embedpress_pdf';
|
@@ -23,7 +24,7 @@ class Embedpress_Pdf extends Widget_Base
|
|
23 |
|
24 |
public function get_title()
|
25 |
{
|
26 |
-
return esc_html__(
|
27 |
}
|
28 |
|
29 |
public function get_categories()
|
@@ -58,27 +59,27 @@ class Embedpress_Pdf extends Widget_Base
|
|
58 |
|
59 |
protected function register_controls()
|
60 |
{
|
61 |
-
|
62 |
-
|
63 |
/**
|
64 |
* EmbedPress Content Settings
|
65 |
*/
|
66 |
$this->start_controls_section(
|
67 |
-
'
|
68 |
[
|
69 |
-
'label' => esc_html__(
|
70 |
]
|
71 |
);
|
72 |
|
73 |
$this->add_control(
|
74 |
'embedpress_pdf_type',
|
75 |
[
|
76 |
-
'label' => __(
|
77 |
'type' => Controls_Manager::SELECT,
|
78 |
'default' => 'file',
|
79 |
'options' => [
|
80 |
-
'file' => __(
|
81 |
-
'url' => __(
|
82 |
],
|
83 |
]
|
84 |
);
|
@@ -86,8 +87,7 @@ class Embedpress_Pdf extends Widget_Base
|
|
86 |
$this->add_control(
|
87 |
'embedpress_pdf_Uploader',
|
88 |
[
|
89 |
-
|
90 |
-
'label' => __( 'Upload File', 'embedpress' ),
|
91 |
'type' => Controls_Manager::MEDIA,
|
92 |
'dynamic' => [
|
93 |
'active' => true,
|
@@ -98,8 +98,10 @@ class Embedpress_Pdf extends Widget_Base
|
|
98 |
'media_type' => [
|
99 |
'application/pdf',
|
100 |
],
|
101 |
-
'description' => __(
|
102 |
-
'
|
|
|
|
|
103 |
'condition' => [
|
104 |
'embedpress_pdf_type' => 'file'
|
105 |
],
|
@@ -109,9 +111,9 @@ class Embedpress_Pdf extends Widget_Base
|
|
109 |
$this->add_control(
|
110 |
'embedpress_pdf_file_link',
|
111 |
[
|
112 |
-
'label' => __(
|
113 |
'type' => Controls_Manager::URL,
|
114 |
-
'placeholder' => __(
|
115 |
'show_external' => false,
|
116 |
'default' => [
|
117 |
'url' => ''
|
@@ -125,30 +127,30 @@ class Embedpress_Pdf extends Widget_Base
|
|
125 |
$this->add_control(
|
126 |
'embedpress_pdf_zoom',
|
127 |
[
|
128 |
-
'label' => __(
|
129 |
'type' => Controls_Manager::SELECT,
|
130 |
'default' => 'auto',
|
131 |
'options' => [
|
132 |
-
'auto' => __(
|
133 |
-
'page-actual' => __(
|
134 |
-
'page-fit' => __(
|
135 |
-
'page-width' => __(
|
136 |
-
'custom' => __(
|
137 |
-
'50' => __(
|
138 |
-
'75' => __(
|
139 |
-
'100' => __(
|
140 |
-
'125' => __(
|
141 |
-
'150' => __(
|
142 |
-
'200' => __(
|
143 |
-
'300' => __(
|
144 |
-
'400' => __(
|
145 |
],
|
146 |
]
|
147 |
);
|
148 |
$this->add_control(
|
149 |
'embedpress_pdf_zoom_custom',
|
150 |
[
|
151 |
-
'label' => __(
|
152 |
'type' => Controls_Manager::NUMBER,
|
153 |
'condition' => [
|
154 |
'embedpress_pdf_zoom' => 'custom'
|
@@ -159,7 +161,7 @@ class Embedpress_Pdf extends Widget_Base
|
|
159 |
$this->add_control(
|
160 |
'embedpress_elementor_document_width',
|
161 |
[
|
162 |
-
'label' => __(
|
163 |
'type' => Controls_Manager::SLIDER,
|
164 |
'separator' => 'before',
|
165 |
'default' => [
|
@@ -183,7 +185,7 @@ class Embedpress_Pdf extends Widget_Base
|
|
183 |
$this->add_control(
|
184 |
'embedpress_elementor_document_height',
|
185 |
[
|
186 |
-
'label' => __(
|
187 |
'type' => Controls_Manager::SLIDER,
|
188 |
'default' => [
|
189 |
'unit' => 'px',
|
@@ -206,19 +208,19 @@ class Embedpress_Pdf extends Widget_Base
|
|
206 |
$this->add_responsive_control(
|
207 |
'embedpress_elementor_document_align',
|
208 |
[
|
209 |
-
'label' => __(
|
210 |
'type' => Controls_Manager::CHOOSE,
|
211 |
'options' => [
|
212 |
'left' => [
|
213 |
-
'title' => __(
|
214 |
'icon' => 'eicon-text-align-left',
|
215 |
],
|
216 |
'center' => [
|
217 |
-
'title' => __(
|
218 |
'icon' => 'eicon-text-align-center',
|
219 |
],
|
220 |
'right' => [
|
221 |
-
'title' => __(
|
222 |
'icon' => 'eicon-text-align-right',
|
223 |
]
|
224 |
],
|
@@ -230,51 +232,183 @@ class Embedpress_Pdf extends Widget_Base
|
|
230 |
$this->add_control(
|
231 |
'embedpress_pdf_powered_by',
|
232 |
[
|
233 |
-
'label' => __(
|
234 |
'type' => Controls_Manager::SWITCHER,
|
235 |
-
'label_on' => __(
|
236 |
-
'label_off' => __(
|
237 |
'return_value' => 'yes',
|
238 |
-
'default' => apply_filters(
|
239 |
]
|
240 |
);
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
-
private function is_pdf(
|
275 |
{
|
276 |
-
$arr = explode(
|
277 |
-
return end(
|
278 |
}
|
279 |
|
280 |
protected function render()
|
@@ -283,74 +417,231 @@ class Embedpress_Pdf extends Widget_Base
|
|
283 |
$url = $this->get_file_url();
|
284 |
$id = $this->get_id();
|
285 |
$this->_render($url, $settings, $id);
|
|
|
|
|
|
|
|
|
286 |
}
|
287 |
|
288 |
-
|
|
|
|
|
|
|
289 |
{
|
290 |
-
$id = 'embedpress-pdf-' . $id;
|
291 |
-
$dimension = "width: {$settings['embedpress_elementor_document_width']['size']}px;height: {$settings['embedpress_elementor_document_height']['size']}px";
|
292 |
-
$this->add_render_attribute( 'embedpres-pdf-render', [
|
293 |
-
'class' => ['embedpress-embed-document-pdf', $id],
|
294 |
-
'data-emid' => $id
|
295 |
-
] );
|
296 |
-
$this->add_render_attribute( 'embedpress-document', [
|
297 |
-
'class' => ['embedpress-document-embed', 'ep-doc-'.md5( $id), 'ose-document']
|
298 |
-
] );
|
299 |
?>
|
300 |
-
<
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
if($zoom == 'custom'){
|
312 |
-
if(!empty($settings['embedpress_pdf_zoom_custom'])){
|
313 |
-
$zoom = $settings['embedpress_pdf_zoom_custom'];
|
314 |
-
}
|
315 |
-
else{
|
316 |
-
$zoom = null;
|
317 |
}
|
|
|
318 |
}
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
-
?>
|
324 |
-
<iframe style="<?php echo esc_attr( $dimension); ?>; max-width:100%; display: inline-block" src="<?php echo esc_attr( $src); ?>" <?php $this->get_render_attribute_string( 'embedpres-pdf-render' ); ?>
|
325 |
-
frameborder="0"></iframe>
|
326 |
-
<?php
|
327 |
|
328 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
?>
|
330 |
-
|
331 |
-
|
332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
|
334 |
-
|
335 |
-
|
336 |
-
|
|
|
|
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
|
|
|
|
|
|
|
|
342 |
</div>
|
343 |
|
344 |
-
|
345 |
}
|
346 |
|
347 |
private function get_file_url()
|
348 |
{
|
349 |
$settings = $this->get_settings();
|
350 |
-
return $settings[
|
351 |
}
|
352 |
|
353 |
-
|
354 |
-
|
|
|
355 |
}
|
356 |
}
|
9 |
use EmbedPress\Includes\Classes\Helper;
|
10 |
use EmbedPress\Includes\Traits\Branding;
|
11 |
|
12 |
+
(defined('ABSPATH')) or die("No direct script access allowed.");
|
13 |
|
14 |
class Embedpress_Pdf extends Widget_Base
|
15 |
{
|
16 |
+
|
17 |
use Branding;
|
18 |
+
protected $pro_class = '';
|
19 |
+
protected $pro_text = '';
|
20 |
public function get_name()
|
21 |
{
|
22 |
return 'embedpress_pdf';
|
24 |
|
25 |
public function get_title()
|
26 |
{
|
27 |
+
return esc_html__('EmbedPress PDF', 'embedpress');
|
28 |
}
|
29 |
|
30 |
public function get_categories()
|
59 |
|
60 |
protected function register_controls()
|
61 |
{
|
62 |
+
$this->pro_class = is_embedpress_pro_active() ? '' : 'embedpress-pro-control not-active';
|
63 |
+
$this->pro_text = is_embedpress_pro_active() ? '' : '<sup class="embedpress-pro-label" style="color:red">' . __('Pro', 'embedpress') . '</sup>';
|
64 |
/**
|
65 |
* EmbedPress Content Settings
|
66 |
*/
|
67 |
$this->start_controls_section(
|
68 |
+
'embedpress_content_settings',
|
69 |
[
|
70 |
+
'label' => esc_html__('Content Settings', 'embedpress'),
|
71 |
]
|
72 |
);
|
73 |
|
74 |
$this->add_control(
|
75 |
'embedpress_pdf_type',
|
76 |
[
|
77 |
+
'label' => __('Document Type', 'embedpress'),
|
78 |
'type' => Controls_Manager::SELECT,
|
79 |
'default' => 'file',
|
80 |
'options' => [
|
81 |
+
'file' => __('File', 'embedpress'),
|
82 |
+
'url' => __('URL', 'embedpress')
|
83 |
],
|
84 |
]
|
85 |
);
|
87 |
$this->add_control(
|
88 |
'embedpress_pdf_Uploader',
|
89 |
[
|
90 |
+
'label' => __('Upload File', 'embedpress'),
|
|
|
91 |
'type' => Controls_Manager::MEDIA,
|
92 |
'dynamic' => [
|
93 |
'active' => true,
|
98 |
'media_type' => [
|
99 |
'application/pdf',
|
100 |
],
|
101 |
+
'description' => __(
|
102 |
+
'Upload a file or pick one from your media library for embed. Supported File Type: PDF',
|
103 |
+
'embedpress'
|
104 |
+
),
|
105 |
'condition' => [
|
106 |
'embedpress_pdf_type' => 'file'
|
107 |
],
|
111 |
$this->add_control(
|
112 |
'embedpress_pdf_file_link',
|
113 |
[
|
114 |
+
'label' => __('URL', 'embedpress'),
|
115 |
'type' => Controls_Manager::URL,
|
116 |
+
'placeholder' => __('https://your-link.com/file.pdf', 'embedpress'),
|
117 |
'show_external' => false,
|
118 |
'default' => [
|
119 |
'url' => ''
|
127 |
$this->add_control(
|
128 |
'embedpress_pdf_zoom',
|
129 |
[
|
130 |
+
'label' => __('Zoom', 'embedpress'),
|
131 |
'type' => Controls_Manager::SELECT,
|
132 |
'default' => 'auto',
|
133 |
'options' => [
|
134 |
+
'auto' => __('Automatic Zoom', 'embedpress'),
|
135 |
+
'page-actual' => __('Actual Size', 'embedpress'),
|
136 |
+
'page-fit' => __('Page Fit', 'embedpress'),
|
137 |
+
'page-width' => __('Page Width', 'embedpress'),
|
138 |
+
'custom' => __('Custom', 'embedpress'),
|
139 |
+
'50' => __('50%', 'embedpress'),
|
140 |
+
'75' => __('75%', 'embedpress'),
|
141 |
+
'100' => __('100%', 'embedpress'),
|
142 |
+
'125' => __('125%', 'embedpress'),
|
143 |
+
'150' => __('150%', 'embedpress'),
|
144 |
+
'200' => __('200%', 'embedpress'),
|
145 |
+
'300' => __('300%', 'embedpress'),
|
146 |
+
'400' => __('400%', 'embedpress'),
|
147 |
],
|
148 |
]
|
149 |
);
|
150 |
$this->add_control(
|
151 |
'embedpress_pdf_zoom_custom',
|
152 |
[
|
153 |
+
'label' => __('Custom Zoom', 'embedpress'),
|
154 |
'type' => Controls_Manager::NUMBER,
|
155 |
'condition' => [
|
156 |
'embedpress_pdf_zoom' => 'custom'
|
161 |
$this->add_control(
|
162 |
'embedpress_elementor_document_width',
|
163 |
[
|
164 |
+
'label' => __('Width', 'embedpress'),
|
165 |
'type' => Controls_Manager::SLIDER,
|
166 |
'separator' => 'before',
|
167 |
'default' => [
|
185 |
$this->add_control(
|
186 |
'embedpress_elementor_document_height',
|
187 |
[
|
188 |
+
'label' => __('Height', 'embedpress'),
|
189 |
'type' => Controls_Manager::SLIDER,
|
190 |
'default' => [
|
191 |
'unit' => 'px',
|
208 |
$this->add_responsive_control(
|
209 |
'embedpress_elementor_document_align',
|
210 |
[
|
211 |
+
'label' => __('Alignment', 'embedpress'),
|
212 |
'type' => Controls_Manager::CHOOSE,
|
213 |
'options' => [
|
214 |
'left' => [
|
215 |
+
'title' => __('Left', 'embedpress'),
|
216 |
'icon' => 'eicon-text-align-left',
|
217 |
],
|
218 |
'center' => [
|
219 |
+
'title' => __('Center', 'embedpress'),
|
220 |
'icon' => 'eicon-text-align-center',
|
221 |
],
|
222 |
'right' => [
|
223 |
+
'title' => __('Right', 'embedpress'),
|
224 |
'icon' => 'eicon-text-align-right',
|
225 |
]
|
226 |
],
|
232 |
$this->add_control(
|
233 |
'embedpress_pdf_powered_by',
|
234 |
[
|
235 |
+
'label' => __('Powered By', 'embedpress'),
|
236 |
'type' => Controls_Manager::SWITCHER,
|
237 |
+
'label_on' => __('Show', 'embedpress'),
|
238 |
+
'label_off' => __('Hide', 'embedpress'),
|
239 |
'return_value' => 'yes',
|
240 |
+
'default' => apply_filters('embedpress_document_powered_by_control', 'yes'),
|
241 |
]
|
242 |
);
|
243 |
|
244 |
+
$this->init_branding_controls('document');
|
245 |
+
|
246 |
+
$this->end_controls_section();
|
247 |
+
|
248 |
+
|
249 |
+
/**
|
250 |
+
* EmbedPress PDF Control Settings
|
251 |
+
*/
|
252 |
+
|
253 |
+
$this->start_controls_section(
|
254 |
+
'embedpress_pdf_content_settings',
|
255 |
+
[
|
256 |
+
'label' => esc_html__('PDF Control Settings', 'embedpress'),
|
257 |
+
'condition' => [
|
258 |
+
'embedpress_pdf_type' => 'file'
|
259 |
+
],
|
260 |
+
]
|
261 |
+
);
|
262 |
+
|
263 |
+
$this->add_control(
|
264 |
+
'pdf_toolbar',
|
265 |
+
[
|
266 |
+
'label' => sprintf(__('Toolbar %s', 'embedpress'), $this->pro_text),
|
267 |
+
'type' => Controls_Manager::SWITCHER,
|
268 |
+
'label_on' => __('Show', 'embedpress'),
|
269 |
+
'label_off' => __('Hide', 'embedpress'),
|
270 |
+
'return_value' => 'yes',
|
271 |
+
'default' => 'yes',
|
272 |
+
'classes' => $this->pro_class,
|
273 |
+
]
|
274 |
+
);
|
275 |
+
|
276 |
+
|
277 |
+
$this->add_control(
|
278 |
+
'pdf_toolbar_position',
|
279 |
+
[
|
280 |
+
'label' => esc_html__('Toolbar Position', 'embedpress'),
|
281 |
+
'type' => \Elementor\Controls_Manager::CHOOSE,
|
282 |
+
'options' => [
|
283 |
+
'top' => [
|
284 |
+
'title' => esc_html__('Top', 'embedpress'),
|
285 |
+
'icon' => 'eicon-arrow-up',
|
286 |
+
],
|
287 |
+
'bottom' => [
|
288 |
+
'title' => esc_html__('Bottom', 'embedpress'),
|
289 |
+
'icon' => 'eicon-arrow-down',
|
290 |
+
],
|
291 |
+
],
|
292 |
+
'default' => 'top',
|
293 |
+
'toggle' => true,
|
294 |
+
'condition' => [
|
295 |
+
'pdf_toolbar' => 'yes',
|
296 |
+
],
|
297 |
+
]
|
298 |
+
);
|
299 |
+
|
300 |
+
|
301 |
+
$this->add_control(
|
302 |
+
'pdf_presentation_mode',
|
303 |
+
[
|
304 |
+
'label' => __('PDF Presentation Mode', 'embedpress'),
|
305 |
+
'type' => Controls_Manager::SWITCHER,
|
306 |
+
'label_on' => __('Show', 'embedpress'),
|
307 |
+
'label_off' => __('Hide', 'embedpress'),
|
308 |
+
'return_value' => 'yes',
|
309 |
+
'default' => 'yes',
|
310 |
+
'condition' => [
|
311 |
+
'pdf_toolbar' => 'yes',
|
312 |
+
],
|
313 |
+
]
|
314 |
+
);
|
315 |
+
|
316 |
+
$this->add_control(
|
317 |
+
'pdf_print_download',
|
318 |
+
[
|
319 |
+
'label' => sprintf(__('Print/Download %s', 'embedpress'), $this->pro_text),
|
320 |
+
'type' => Controls_Manager::SWITCHER,
|
321 |
+
'label_on' => __('Show', 'embedpress'),
|
322 |
+
'label_off' => __('Hide', 'embedpress'),
|
323 |
+
'return_value' => 'yes',
|
324 |
+
'default' => 'yes',
|
325 |
+
'classes' => $this->pro_class,
|
326 |
+
'condition' => [
|
327 |
+
'pdf_toolbar' => 'yes',
|
328 |
+
],
|
329 |
+
]
|
330 |
+
);
|
331 |
+
$this->add_control(
|
332 |
+
'pdf_text_copy',
|
333 |
+
[
|
334 |
+
'label' => sprintf(__('Copy Text %s', 'embedpress'), $this->pro_text),
|
335 |
+
'type' => Controls_Manager::SWITCHER,
|
336 |
+
'label_on' => __('Show', 'embedpress'),
|
337 |
+
'label_off' => __('Hide', 'embedpress'),
|
338 |
+
'return_value' => 'yes',
|
339 |
+
'default' => 'yes',
|
340 |
+
'classes' => $this->pro_class,
|
341 |
+
'condition' => [
|
342 |
+
'pdf_toolbar' => 'yes',
|
343 |
+
],
|
344 |
+
]
|
345 |
+
);
|
346 |
+
|
347 |
+
$this->add_control(
|
348 |
+
'pdf_rotate_access',
|
349 |
+
[
|
350 |
+
'label' => __('Rotation', 'embedpress'),
|
351 |
+
'type' => Controls_Manager::SWITCHER,
|
352 |
+
'label_on' => __('Show', 'embedpress'),
|
353 |
+
'label_off' => __('Hide', 'embedpress'),
|
354 |
+
'return_value' => 'yes',
|
355 |
+
'default' => 'yes',
|
356 |
+
'condition' => [
|
357 |
+
'pdf_toolbar' => 'yes',
|
358 |
+
],
|
359 |
+
]
|
360 |
+
);
|
361 |
+
|
362 |
+
$this->add_control(
|
363 |
+
'pdf_details',
|
364 |
+
[
|
365 |
+
'label' => __('Properties', 'embedpress'),
|
366 |
+
'type' => Controls_Manager::SWITCHER,
|
367 |
+
'label_on' => __('Show', 'embedpress'),
|
368 |
+
'label_off' => __('Hide', 'embedpress'),
|
369 |
+
'return_value' => 'yes',
|
370 |
+
'default' => 'yes',
|
371 |
+
'condition' => [
|
372 |
+
'pdf_toolbar' => 'yes',
|
373 |
+
],
|
374 |
+
]
|
375 |
+
);
|
376 |
+
|
377 |
+
$this->end_controls_section();
|
378 |
+
|
379 |
+
|
380 |
+
if (!is_embedpress_pro_active()) {
|
381 |
+
$this->start_controls_section(
|
382 |
+
'embedpress_pro_section',
|
383 |
+
[
|
384 |
+
'label' => __('Go Premium for More Features', 'embedpress'),
|
385 |
+
]
|
386 |
+
);
|
387 |
+
|
388 |
+
$this->add_control(
|
389 |
+
'embedpress_pro_cta',
|
390 |
+
[
|
391 |
+
'label' => __('Unlock more possibilities', 'embedpress'),
|
392 |
+
'type' => Controls_Manager::CHOOSE,
|
393 |
+
'options' => [
|
394 |
+
'1' => [
|
395 |
+
'title' => '',
|
396 |
+
'icon' => 'eicon-lock',
|
397 |
+
],
|
398 |
+
],
|
399 |
+
'default' => '1',
|
400 |
+
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Pro version</a> for more provider support and customization options.</span>',
|
401 |
+
]
|
402 |
+
);
|
403 |
+
|
404 |
+
$this->end_controls_section();
|
405 |
+
}
|
406 |
}
|
407 |
|
408 |
+
private function is_pdf($url)
|
409 |
{
|
410 |
+
$arr = explode('.', $url);
|
411 |
+
return end($arr) === 'pdf';
|
412 |
}
|
413 |
|
414 |
protected function render()
|
417 |
$url = $this->get_file_url();
|
418 |
$id = $this->get_id();
|
419 |
$this->_render($url, $settings, $id);
|
420 |
+
|
421 |
+
if($settings['embedpress_pdf_type'] == 'file'){
|
422 |
+
$this->_scripts();
|
423 |
+
}
|
424 |
}
|
425 |
|
426 |
+
/**
|
427 |
+
* Generate scripts for PDF widgets
|
428 |
+
*/
|
429 |
+
public function _scripts()
|
430 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
?>
|
432 |
+
<script>
|
433 |
+
(function($) {
|
434 |
+
let x = 0;
|
435 |
+
const setEmbedInterval = setInterval(() => {
|
436 |
+
if ($('.embedpress-document-embed').length > 0) {
|
437 |
+
x++;
|
438 |
+
const isDisplay = ($selectorName) => {
|
439 |
+
if ($selectorName == 'no' || $selectorName == '') {
|
440 |
+
$selectorName = 'none';
|
441 |
+
} else {
|
442 |
+
$selectorName = 'block';
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
}
|
444 |
+
return $selectorName;
|
445 |
}
|
446 |
+
|
447 |
+
$('.embedpress-document-embed').each((index, element) => {
|
448 |
+
|
449 |
+
const frm = document.querySelector(`.${$(element).data('id')}`).contentWindow.document;
|
450 |
+
const otherhead = frm.getElementsByTagName("head")[0];
|
451 |
+
const style = frm.createElement("style");
|
452 |
+
style.setAttribute('id', 'EBiframeStyleID');
|
453 |
+
|
454 |
+
$toolbar = $(element).data('toolbar');
|
455 |
+
$toolbarPosition = $(element).data('toolbar-position');
|
456 |
+
$presentationMode = $(element).data('presentation-mode');
|
457 |
+
$open = $(element).data('open');
|
458 |
+
$download = $(element).data('download');
|
459 |
+
$copy_text = $(element).data('copy');
|
460 |
+
$doc_rotation = $(element).data('rotate');
|
461 |
+
$doc_details = $(element).data('details');
|
462 |
+
|
463 |
+
|
464 |
+
if ($toolbar == 'no' || $toolbar == '') {
|
465 |
+
$toolbar = 'no';
|
466 |
+
$toolbarPosition = 'top';
|
467 |
+
$open = 'no';
|
468 |
+
$presentationMode = 'no';
|
469 |
+
$download = 'no';
|
470 |
+
$copy_text = 'no';
|
471 |
+
$doc_rotation = 'no';
|
472 |
+
$details = 'no';
|
473 |
+
}
|
474 |
+
|
475 |
+
|
476 |
+
$toolbar = isDisplay($toolbar);
|
477 |
+
$presentation = isDisplay($presentationMode);
|
478 |
+
$download = isDisplay($download);
|
479 |
+
$open = isDisplay($open);
|
480 |
+
$copy_text = isDisplay($copy_text);
|
481 |
+
|
482 |
+
if ($copy_text === 'block') {
|
483 |
+
$copy_text = 'all';
|
484 |
+
}
|
485 |
+
|
486 |
+
$doc_details = isDisplay($doc_details);
|
487 |
+
$doc_rotation = isDisplay($doc_rotation);
|
488 |
+
|
489 |
+
if ($toolbarPosition == 'top') {
|
490 |
+
$toolbarPosition = 'top:0;bottom:auto;'
|
491 |
+
$settingsPos = '';
|
492 |
+
} else {
|
493 |
+
$toolbarPosition = 'bottom:0;top:auto;'
|
494 |
+
$settingsPos = `
|
495 |
+
.findbar, .secondaryToolbar {
|
496 |
+
top: auto;bottom: 32px;
|
497 |
+
}
|
498 |
+
.doorHangerRight:after{
|
499 |
+
transform: rotate(180deg);
|
500 |
+
bottom: -16px;
|
501 |
+
}
|
502 |
+
.doorHangerRight:before {
|
503 |
+
transform: rotate(180deg);
|
504 |
+
bottom: -18px;
|
505 |
+
}
|
506 |
+
#findbar:before {
|
507 |
+
bottom: -20px!important;
|
508 |
+
transform: rotate(180deg);
|
509 |
+
}
|
510 |
+
#findbar:after {
|
511 |
+
bottom: -19px!important;
|
512 |
+
transform: rotate(180deg);
|
513 |
+
}
|
514 |
+
`;
|
515 |
+
|
516 |
+
}
|
517 |
+
|
518 |
+
style.textContent = `
|
519 |
+
|
520 |
+
.toolbar{
|
521 |
+
display: ${$toolbar}!important;
|
522 |
+
position: absolute;
|
523 |
+
${$toolbarPosition}
|
524 |
+
}
|
525 |
+
#secondaryToolbar{
|
526 |
+
display: ${$toolbar};
|
527 |
+
}
|
528 |
+
#secondaryPresentationMode, #toolbarViewerRight #presentationMode{
|
529 |
+
display: ${$presentation}!important;
|
530 |
+
}
|
531 |
+
#secondaryOpenFile, #toolbarViewerRight #openFile{
|
532 |
+
display: none!important;
|
533 |
+
}
|
534 |
+
#secondaryDownload, #secondaryPrint, #toolbarViewerRight #print, #toolbarViewerRight #download{
|
535 |
+
display: ${$download}!important;
|
536 |
+
}
|
537 |
+
#pageRotateCw{
|
538 |
+
display: ${$doc_rotation}!important;
|
539 |
+
}
|
540 |
+
#pageRotateCcw{
|
541 |
+
display: ${$doc_rotation}!important;
|
542 |
+
}
|
543 |
+
#documentProperties{
|
544 |
+
display: ${$doc_details}!important;
|
545 |
+
}
|
546 |
+
.textLayer{
|
547 |
+
user-select: ${$copy_text}!important;
|
548 |
+
}
|
549 |
+
${$settingsPos}
|
550 |
+
`;
|
551 |
+
if (otherhead) {
|
552 |
+
if(frm.getElementById("EBiframeStyleID")){
|
553 |
+
frm.getElementById("EBiframeStyleID").remove();
|
554 |
+
}
|
555 |
+
otherhead.appendChild(style);
|
556 |
+
clearInterval(setEmbedInterval);
|
557 |
+
}
|
558 |
+
if (x > 50) {
|
559 |
+
clearInterval(setEmbedInterval);
|
560 |
+
}
|
561 |
+
|
562 |
+
});
|
563 |
}
|
|
|
|
|
|
|
|
|
564 |
|
565 |
+
}, 100);
|
566 |
+
}(jQuery));
|
567 |
+
</script>
|
568 |
+
<?php
|
569 |
+
}
|
570 |
+
|
571 |
+
public function _render($url, $settings, $id)
|
572 |
+
{
|
573 |
+
$id = 'embedpress-pdf-' . $id;
|
574 |
+
$dimension = "width: {$settings['embedpress_elementor_document_width']['size']}px;height: {$settings['embedpress_elementor_document_height']['size']}px";
|
575 |
+
$this->add_render_attribute('embedpres-pdf-render', [
|
576 |
+
'class' => ['embedpress-embed-document-pdf', $id],
|
577 |
+
'data-emid' => $id
|
578 |
+
]);
|
579 |
+
$this->add_render_attribute('embedpress-document', [
|
580 |
+
'class' => ['embedpress-document-embed', 'ep-doc-' . md5($id), 'ose-document'],
|
581 |
+
'data-toolbar' => $settings['pdf_toolbar'],
|
582 |
+
'data-toolbar-position' => $settings['pdf_toolbar_position'],
|
583 |
+
'data-open' => 'no',
|
584 |
+
'data-presentation-mode' => $settings['pdf_presentation_mode'],
|
585 |
+
'data-download' => defined('EMBEDPRESS_PRO_PLUGIN_VERSION')? $settings['pdf_print_download'] : 'yes',
|
586 |
+
'data-copy' => defined('EMBEDPRESS_PRO_PLUGIN_VERSION')? $settings['pdf_text_copy'] : 'yes',
|
587 |
+
'data-rotate' => $settings['pdf_rotate_access'],
|
588 |
+
'data-details' => $settings['pdf_details'],
|
589 |
+
'data-id' => $id
|
590 |
+
]);
|
591 |
+
?>
|
592 |
+
<div <?php echo $this->get_render_attribute_string('embedpress-document'); ?> style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block">
|
593 |
+
<?php
|
594 |
+
do_action('embedpress_pdf_after_embed', $settings, $url, $id, $this);
|
595 |
?>
|
596 |
+
<?php if ($url != '') {
|
597 |
+
if ($this->is_pdf($url) && !$this->is_external_url($url)) {
|
598 |
+
$this->add_render_attribute('embedpres-pdf-render', 'data-emsrc', $url);
|
599 |
+
$renderer = Helper::get_pdf_renderer();
|
600 |
+
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . $url;
|
601 |
+
if (!empty($settings['embedpress_pdf_zoom'])) {
|
602 |
+
$zoom = $settings['embedpress_pdf_zoom'];
|
603 |
+
if ($zoom == 'custom') {
|
604 |
+
if (!empty($settings['embedpress_pdf_zoom_custom'])) {
|
605 |
+
$zoom = $settings['embedpress_pdf_zoom_custom'];
|
606 |
+
} else {
|
607 |
+
$zoom = null;
|
608 |
+
}
|
609 |
+
}
|
610 |
+
if ($zoom) {
|
611 |
+
$src = $src . "#zoom=$zoom";
|
612 |
+
}
|
613 |
+
}
|
614 |
+
?>
|
615 |
+
<iframe class="embedpress-embed-document-pdf <?php echo esc_attr($id); ?>" style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block" src="<?php echo esc_attr($src); ?>" <?php $this->get_render_attribute_string('embedpres-pdf-render'); ?> frameborder="0"></iframe>
|
616 |
+
<?php
|
617 |
|
618 |
+
} else {
|
619 |
+
?>
|
620 |
+
<div>
|
621 |
+
<iframe class="embedpress-embed-document-pdf <?php echo esc_attr($id); ?>" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr($dimension); ?>; max-width:100%;" src="<?php echo esc_url($url); ?>" <?php $this->get_render_attribute_string('embedpres-pdf-render'); ?>></iframe>
|
622 |
+
</div>
|
623 |
|
624 |
+
<?php
|
625 |
+
}
|
626 |
+
if ($settings['embedpress_pdf_powered_by'] === 'yes') {
|
627 |
+
|
628 |
+
printf('<p class="embedpress-el-powered">%s</p>', __('Powered By EmbedPress', 'embedpress'));
|
629 |
+
}
|
630 |
+
}
|
631 |
+
?>
|
632 |
</div>
|
633 |
|
634 |
+
<?php
|
635 |
}
|
636 |
|
637 |
private function get_file_url()
|
638 |
{
|
639 |
$settings = $this->get_settings();
|
640 |
+
return $settings['embedpress_pdf_type'] === 'url' ? $settings['embedpress_pdf_file_link']['url'] : $settings['embedpress_pdf_Uploader']['url'];
|
641 |
}
|
642 |
|
643 |
+
protected function is_external_url($url)
|
644 |
+
{
|
645 |
+
return strpos($url, get_site_url()) === false;
|
646 |
}
|
647 |
}
|
EmbedPress/Includes/Classes/Feature_Enhancer.php
CHANGED
@@ -1,122 +1,129 @@
|
|
1 |
<?php
|
|
|
2 |
namespace EmbedPress\Includes\Classes;
|
3 |
|
4 |
use \EmbedPress\Providers\Youtube;
|
5 |
use EmbedPress\Shortcode;
|
6 |
|
7 |
-
class Feature_Enhancer
|
8 |
-
|
9 |
-
public
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
add_filter(
|
14 |
-
add_filter(
|
15 |
-
add_filter(
|
16 |
-
add_filter( '
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
-
|
28 |
-
|
|
|
29 |
$youtube = new Youtube($url, $atts);
|
30 |
-
if($youtube->validateUrl($youtube->getUrl(false))){
|
31 |
return true;
|
32 |
}
|
33 |
}
|
34 |
return $isEmbra;
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
$youtube = new Youtube($attributes['url']);
|
55 |
$is_youtube = $youtube->validateUrl($youtube->getUrl(false));
|
56 |
-
if($is_youtube){
|
57 |
$atts = [
|
58 |
-
'width' => intval(
|
59 |
-
'height' => intval(
|
60 |
'pagesize' => isset($attributes['pagesize']) ? intval($attributes['pagesize']) : 6,
|
|
|
|
|
|
|
61 |
];
|
62 |
|
63 |
-
$urlInfo = Shortcode::parseContent(
|
64 |
-
if(!empty($urlInfo->embed)){
|
65 |
$embedHTML = $urlInfo->embed;
|
66 |
}
|
67 |
}
|
68 |
}
|
|
|
|
|
69 |
return $embedHTML;
|
70 |
}
|
71 |
-
public function embra_attrs($emberaInstanceSettings, $attributes){
|
72 |
-
if ( isset( $attributes[ 'data-pagesize' ] ) ) {
|
73 |
-
$emberaInstanceSettings[ 'pageSize' ] = $attributes[ 'data-pagesize' ];
|
74 |
-
// unset( $attributes[ 'data-pagesize' ] );
|
75 |
-
}
|
76 |
-
if ( isset( $attributes[ 'data-thumbnail' ] ) ) {
|
77 |
-
$emberaInstanceSettings[ 'thumbnail' ] = $attributes[ 'data-thumbnail' ];
|
78 |
-
// unset( $attributes[ 'data-thumbnail' ] );
|
79 |
-
}
|
80 |
-
if ( isset( $attributes[ 'data-gallery' ] ) ) {
|
81 |
-
$emberaInstanceSettings[ 'gallery' ] = $attributes[ 'data-gallery' ];
|
82 |
-
// unset( $attributes[ 'data-gallery' ] );
|
83 |
-
}
|
84 |
-
if ( isset( $attributes[ 'data-hideprivate' ] ) ) {
|
85 |
-
$emberaInstanceSettings[ 'hideprivate' ] = $attributes[ 'data-hideprivate' ];
|
86 |
-
// unset( $attributes[ 'data-hideprivate' ] );
|
87 |
-
}
|
88 |
-
return $emberaInstanceSettings;
|
89 |
-
}
|
90 |
|
91 |
-
|
|
|
|
|
92 |
$this->remove_classic_filters();
|
93 |
-
add_filter(
|
94 |
-
add_filter(
|
95 |
-
add_filter(
|
96 |
-
add_filter(
|
97 |
-
add_filter(
|
98 |
-
add_filter(
|
99 |
-
add_filter(
|
100 |
}
|
101 |
-
public function remove_classic_filters(
|
102 |
-
|
103 |
-
remove_filter(
|
104 |
-
remove_filter(
|
105 |
-
remove_filter(
|
106 |
-
remove_filter(
|
107 |
-
remove_filter(
|
|
|
108 |
}
|
109 |
-
public function getOptions($provider='', $schema=[])
|
110 |
{
|
111 |
-
$options = (array)get_option(EMBEDPRESS_PLG_NAME . ':' . $provider, []);
|
112 |
if (empty($options) || (count($options) === 1 && empty($options[0]))) {
|
113 |
$options = [];
|
114 |
|
115 |
foreach ($schema as $fieldSlug => $field) {
|
116 |
$value = isset($field['default']) ? $field['default'] : "";
|
117 |
|
118 |
-
settype($value, isset($field['type']) && in_array(
|
119 |
-
|
|
|
|
|
120 |
|
121 |
if ($fieldSlug === "license_key") {
|
122 |
$options['license'] = [
|
@@ -133,48 +140,48 @@ class Feature_Enhancer {
|
|
133 |
'key' => true,
|
134 |
'status' => "missing",
|
135 |
];
|
136 |
-
|
137 |
}
|
138 |
-
public function get_youtube_params(
|
139 |
{
|
140 |
$params = [];
|
141 |
|
142 |
// Handle `autoplay` option.
|
143 |
-
if (
|
144 |
-
$params[
|
145 |
} else {
|
146 |
-
unset(
|
147 |
}
|
148 |
|
149 |
// Handle `controls` option.
|
150 |
-
if (
|
151 |
-
$params[
|
152 |
} else {
|
153 |
-
unset(
|
154 |
}
|
155 |
|
156 |
// Handle `fs` option.
|
157 |
-
if (
|
158 |
-
$params[
|
159 |
} else {
|
160 |
-
unset(
|
161 |
}
|
162 |
|
163 |
// Handle `iv_load_policy` option.
|
164 |
-
if (
|
165 |
-
$params[
|
166 |
} else {
|
167 |
-
unset(
|
168 |
}
|
169 |
|
170 |
-
return apply_filters(
|
171 |
-
|
172 |
}
|
173 |
-
public function get_vimeo_params($options)
|
|
|
174 |
$params = [];
|
175 |
|
176 |
// Handle `display_title` option.
|
177 |
-
if (isset($options['display_title']) && (bool)$options['display_title'] === true) {
|
178 |
$params['title'] = 1;
|
179 |
} else {
|
180 |
$params['title'] = 0;
|
@@ -193,104 +200,108 @@ class Feature_Enhancer {
|
|
193 |
} else {
|
194 |
unset($params['color']);
|
195 |
}
|
196 |
-
return apply_filters(
|
197 |
-
|
198 |
}
|
199 |
-
|
200 |
-
public function enhance_youtube(
|
201 |
{
|
202 |
-
$isYoutube = (
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
-
if ( $isYoutube && isset( $embed->embed )
|
205 |
-
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
206 |
// for compatibility only, @TODO; remove later after deep testing.
|
207 |
$options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
|
208 |
// Parse the url to retrieve all its info like variables etc.
|
209 |
-
$url_full = $match[
|
210 |
-
$query = parse_url(
|
211 |
-
parse_str(
|
212 |
-
|
213 |
-
if (
|
214 |
-
$params[
|
215 |
} else {
|
216 |
-
unset(
|
217 |
}
|
218 |
// Handle `rel` option.
|
219 |
-
if (
|
220 |
-
$params[
|
221 |
} else {
|
222 |
-
unset(
|
223 |
}
|
224 |
|
225 |
// Handle `autoplay` option.
|
226 |
-
if (
|
227 |
-
$params[
|
228 |
} else {
|
229 |
-
unset(
|
230 |
}
|
231 |
|
232 |
// Handle `controls` option.
|
233 |
-
if (
|
234 |
-
$params[
|
235 |
} else {
|
236 |
-
unset(
|
237 |
}
|
238 |
-
if (
|
239 |
-
$params[
|
240 |
-
}else {
|
241 |
-
|
242 |
-
|
243 |
-
if (
|
244 |
-
$params[
|
245 |
-
}else {
|
246 |
-
unset($params[
|
247 |
}
|
248 |
|
249 |
// Handle `fs` option.
|
250 |
-
if (
|
251 |
-
$params[
|
252 |
} else {
|
253 |
-
unset(
|
254 |
}
|
255 |
|
256 |
// Handle `iv_load_policy` option.
|
257 |
-
if (
|
258 |
-
$params[
|
259 |
} else {
|
260 |
-
unset(
|
261 |
}
|
262 |
|
263 |
|
264 |
// pro controls will be handled by the pro so remove it from the free.
|
265 |
-
$pro_controls = [
|
266 |
-
foreach (
|
267 |
-
if (
|
268 |
-
unset(
|
269 |
}
|
270 |
}
|
271 |
|
272 |
|
273 |
-
preg_match(
|
274 |
-
$url = $url[
|
275 |
|
276 |
// Reassemble the url with the new variables.
|
277 |
$url_modified = $url . '?';
|
278 |
-
foreach (
|
279 |
$url_modified .= $paramName . '=' . $paramValue . '&';
|
280 |
}
|
281 |
|
282 |
// Replaces the old url with the new one.
|
283 |
-
$embed->embed = str_replace(
|
284 |
-
|
285 |
}
|
286 |
|
287 |
return $embed;
|
288 |
}
|
289 |
-
public function enhance_vimeo(
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
294 |
// old schema is for backward compatibility only @todo; remove it in the next version after deep test
|
295 |
$options = $this->getOptions('vimeo', $this->get_vimeo_settings_schema());
|
296 |
|
@@ -298,34 +309,34 @@ class Feature_Enhancer {
|
|
298 |
$params = [];
|
299 |
|
300 |
// Handle `display_title` option.
|
301 |
-
if (
|
302 |
$params['title'] = 1;
|
303 |
} else {
|
304 |
$params['title'] = 0;
|
305 |
}
|
306 |
|
307 |
// Handle `autoplay` option.
|
308 |
-
if (
|
309 |
$params['autoplay'] = 1;
|
310 |
} else {
|
311 |
-
unset(
|
312 |
}
|
313 |
|
314 |
// Handle `color` option.
|
315 |
-
if (
|
316 |
-
$params['color'] = str_replace(
|
317 |
} else {
|
318 |
-
unset(
|
319 |
}
|
320 |
// Handle `display_author` option.
|
321 |
-
if (
|
322 |
$params['byline'] = 1;
|
323 |
} else {
|
324 |
$params['byline'] = 0;
|
325 |
}
|
326 |
|
327 |
// Handle `display_avatar` option.
|
328 |
-
if (
|
329 |
$params['portrait'] = 1;
|
330 |
} else {
|
331 |
$params['portrait'] = 0;
|
@@ -334,40 +345,42 @@ class Feature_Enhancer {
|
|
334 |
// NOTE: 'vimeo_dnt' is actually only 'dnt' in the params, so unset 'dnt' only
|
335 |
//@todo; maybe extract unsetting pro vars to a function later
|
336 |
$pro_controls = ['loop', 'autopause', 'dnt',];
|
337 |
-
foreach (
|
338 |
-
if (
|
339 |
-
unset(
|
340 |
}
|
341 |
}
|
342 |
// Reassemble the url with the new variables.
|
343 |
$url_modified = $url_full;
|
344 |
-
foreach (
|
345 |
-
$url_modified = add_query_arg(
|
346 |
}
|
347 |
-
if (
|
348 |
-
$url_modified .= '#t=' . $options[
|
349 |
}
|
350 |
|
351 |
-
do_action(
|
352 |
// Replaces the old url with the new one.
|
353 |
-
$embed->embed = str_replace(
|
354 |
-
|
355 |
}
|
356 |
|
357 |
return $embed;
|
358 |
}
|
359 |
-
public function enhance_wistia(
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
|
|
|
|
|
|
364 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
365 |
|
366 |
$url_full = $match[1];
|
367 |
|
368 |
// Parse the url to retrieve all its info like variables etc.
|
369 |
$query = parse_url($embed->url, PHP_URL_QUERY);
|
370 |
-
$url = str_replace('?'
|
371 |
|
372 |
parse_str($query, $params);
|
373 |
|
@@ -385,7 +398,7 @@ class Feature_Enhancer {
|
|
385 |
|
386 |
$embedOptions->autoPlay = (isset($options['autoplay']) && (bool) $options['autoplay'] === true);
|
387 |
|
388 |
-
$embedOptions->time = isset(
|
389 |
|
390 |
if (isset($options['player_color'])) {
|
391 |
$color = $options['player_color'];
|
@@ -395,7 +408,7 @@ class Feature_Enhancer {
|
|
395 |
}
|
396 |
|
397 |
// Plugins
|
398 |
-
$pluginsBaseURL = plugins_url('assets/js/wistia/min', dirname(__DIR__).'/embedpress-Wistia.php');
|
399 |
|
400 |
$pluginList = array();
|
401 |
|
@@ -405,7 +418,7 @@ class Feature_Enhancer {
|
|
405 |
if ($isResumableEnabled) {
|
406 |
// Add the resumable plugin
|
407 |
$pluginList['resumable'] = array(
|
408 |
-
'src' => $pluginsBaseURL.'/resumable.min.js',
|
409 |
'async' => false
|
410 |
);
|
411 |
}
|
@@ -415,7 +428,7 @@ class Feature_Enhancer {
|
|
415 |
if (isset($options->autoPlay)) {
|
416 |
if ($isResumableEnabled) {
|
417 |
$pluginList['fixautoplayresumable'] = array(
|
418 |
-
'src' => $pluginsBaseURL.'/fixautoplayresumable.min.js'
|
419 |
);
|
420 |
}
|
421 |
}
|
@@ -424,19 +437,19 @@ class Feature_Enhancer {
|
|
424 |
if (isset($options['plugin_focus'])) {
|
425 |
$isFocusEnabled = $options['plugin_focus'];
|
426 |
$pluginList['dimthelights'] = array(
|
427 |
-
'src' => $pluginsBaseURL.'/dimthelights.min.js',
|
428 |
'autoDim' => $isFocusEnabled
|
429 |
);
|
430 |
$embedOptions->focus = $isFocusEnabled;
|
431 |
}
|
432 |
|
433 |
-
|
434 |
if (isset($options['plugin_rewind'])) {
|
435 |
if ($options['plugin_rewind']) {
|
436 |
$embedOptions->rewindTime = isset($options['plugin_rewind_time']) ? (int) $options['plugin_rewind_time'] : 10;
|
437 |
|
438 |
$pluginList['rewind'] = array(
|
439 |
-
'src' => $pluginsBaseURL.'/rewind.min.js'
|
440 |
);
|
441 |
}
|
442 |
}
|
@@ -451,7 +464,7 @@ class Feature_Enhancer {
|
|
451 |
|
452 |
$class = array(
|
453 |
'wistia_embed',
|
454 |
-
'wistia_async_'
|
455 |
);
|
456 |
|
457 |
$attribs = array(
|
@@ -463,8 +476,10 @@ class Feature_Enhancer {
|
|
463 |
$labels = array(
|
464 |
'watch_from_beginning' => __('Watch from the beginning', 'embedpress'),
|
465 |
'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress'),
|
466 |
-
'you_have_watched_it_before' => __(
|
467 |
-
'
|
|
|
|
|
468 |
);
|
469 |
$labels = json_encode($labels);
|
470 |
|
@@ -475,174 +490,183 @@ class Feature_Enhancer {
|
|
475 |
$html .= '<script src="https://fast.wistia.com/assets/external/E-v1.js" async></script>';
|
476 |
$html .= "<script>window.pp_embed_wistia_labels = {$labels};</script>\n";
|
477 |
$html .= "<script>window._wq = window._wq || []; _wq.push({\"{$shortVideoId}\": {$embedOptions}});</script>\n";
|
478 |
-
$html .= '<div '.join(' ', $attribs)."></div>\n";
|
479 |
$html .= '</div>';
|
480 |
$embed->embed = $html;
|
481 |
}
|
482 |
|
483 |
return $embed;
|
484 |
}
|
485 |
-
public function enhance_twitch(
|
486 |
-
|
487 |
-
|
|
|
488 |
$settings = $this->getOptions('twitch', $this->get_twitch_settings_schema());
|
489 |
|
490 |
-
$atts = isset(
|
491 |
$time = '0h0m0s';
|
492 |
$type = $e['type'];
|
493 |
$content_id = $e['content_id'];
|
494 |
$channel = 'channel' === $type ? $content_id : '';
|
495 |
$video = 'video' === $type ? $content_id : '';
|
496 |
-
$muted = ('yes' === $settings['embedpress_pro_twitch_mute']) ? 'true': 'false';
|
497 |
-
$full_screen = ('yes' === $settings['embedpress_pro_fs']) ? 'true': 'false';
|
498 |
-
$autoplay = ('yes' === $settings['embedpress_pro_twitch_autoplay']) ? 'true': 'false';
|
499 |
-
$theme = !
|
500 |
|
501 |
$layout = 'video';
|
502 |
-
$width = !empty(
|
503 |
-
$height = !empty(
|
504 |
-
if (
|
505 |
-
$ta = explode(
|
506 |
$h = $ta[0] . 'h';
|
507 |
-
$m = (
|
508 |
-
$s = (
|
509 |
$time = $h . $m . $s;
|
510 |
}
|
511 |
$url = "https://embed.twitch.tv?autoplay={$autoplay}&channel={$channel}&height={$height}&layout={$layout}&migration=true&muted={$muted}&theme={$theme}&time={$time}&video={$video}&width={$width}&allowfullscreen={$full_screen}";
|
512 |
$pars_url = wp_parse_url(get_site_url());
|
513 |
-
$url = !empty($pars_url['host'])
|
514 |
ob_start();
|
515 |
?>
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
return $embed_content;
|
525 |
-
}
|
526 |
-
public function enhance_dailymotion( $embed ) {
|
527 |
-
$options = $this->getOptions('dailymotion', $this->get_dailymotion_settings_schema());
|
528 |
-
$isDailymotion = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'DAILYMOTION' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'DAILYMOTION');
|
529 |
-
|
530 |
-
if ( $isDailymotion && isset( $embed->embed )
|
531 |
-
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
532 |
-
// Parse the url to retrieve all its info like variables etc.
|
533 |
-
$url_full = $match[ 1 ];
|
534 |
-
$params = [
|
535 |
-
'ui-highlight' => str_replace( '#', '', isset($options[ 'color' ]) ? $options[ 'color' ] : null ),
|
536 |
-
'mute' => (int) isset($options[ 'mute' ]) ? $options[ 'mute' ] : null,
|
537 |
-
'autoplay' => (int) isset($options[ 'autoplay' ]) ? $options[ 'autoplay' ] : null,
|
538 |
-
'controls' => (int) isset($options[ 'controls' ]) ? $options[ 'controls' ] : null,
|
539 |
-
'ui-start-screen-info' => (int) isset($options[ 'video_info' ]) ? $options[ 'video_info' ] : null,
|
540 |
-
'endscreen-enable' => 0,
|
541 |
-
];
|
542 |
-
|
543 |
-
if ( isset($options[ 'play_on_mobile' ]) && $options[ 'play_on_mobile' ] == '1' ) {
|
544 |
-
$params[ 'playsinline' ] = 1;
|
545 |
-
}
|
546 |
-
$params['start'] = (int) isset($options[ 'start_time' ]) ? $options[ 'start_time' ] : null;
|
547 |
-
if ( is_embedpress_pro_active() ) {
|
548 |
-
$params['ui-logo'] = (int) isset($options[ 'show_logo' ]) ? $options[ 'show_logo' ] : null;
|
549 |
-
}
|
550 |
|
551 |
-
|
552 |
-
foreach ( $params as $param => $value ) {
|
553 |
-
$url_modified = add_query_arg( $param, $value, $url_modified );
|
554 |
}
|
555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
|
557 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
|
559 |
-
|
560 |
-
|
561 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
562 |
|
563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
|
565 |
-
|
566 |
-
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
567 |
-
$options = $this->getOptions('soundcloud', $this->get_soundcloud_settings_schema());
|
568 |
-
// Parse the url to retrieve all its info like variables etc.
|
569 |
-
$url_full = $match[ 1 ];
|
570 |
-
$params = [
|
571 |
-
'color' => str_replace( '#', '', $options[ 'color' ] ),
|
572 |
-
'visual' => isset($options[ 'visual' ] ) && $options['visual']== '1' ? 'true' : 'false',
|
573 |
-
'auto_play' => isset($options[ 'autoplay' ] ) && $options['autoplay']== '1' ? 'true' : 'false',
|
574 |
-
'sharing' => isset($options[ 'share_button' ] ) && $options['share_button']== '1' ? 'true' : 'false',
|
575 |
-
'show_comments' => isset($options[ 'comments' ] ) && $options['comments']== '1' ? 'true' : 'false',
|
576 |
-
'buying' => 'false',
|
577 |
-
'download' => 'false',
|
578 |
-
'show_artwork' => isset($options[ 'artwork' ] ) && $options['artwork']== '1' ? 'true' : 'false',
|
579 |
-
'show_playcount' => isset($options[ 'play_count' ] ) && $options['play_count']== '1' ? 'true' : 'false',
|
580 |
-
'show_user' => isset($options[ 'username' ] ) && $options['username']== '1' ? 'true' : 'false',
|
581 |
-
];
|
582 |
-
|
583 |
-
if ( is_embedpress_pro_active() ) {
|
584 |
-
$params['buying'] = isset($options[ 'buy_button' ] ) && $options['buy_button']== '1' ? 'true' : 'false';
|
585 |
-
$params['download'] = isset($options[ 'download_button' ] ) && $options['download_button']== '1' ? 'true' : 'false';
|
586 |
}
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
$
|
591 |
}
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
}
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
'url' => array(
|
612 |
-
'type' => 'string',
|
613 |
-
'default' => ''
|
614 |
-
),
|
615 |
-
'iframeSrc' => array(
|
616 |
-
'type' => 'string',
|
617 |
-
'default' => ''
|
618 |
-
),
|
619 |
-
),
|
620 |
-
'render_callback' => [ $this, 'embedpress_gutenberg_render_block_vimeo' ]
|
621 |
-
) );
|
622 |
-
endif;
|
623 |
-
}
|
624 |
-
public function embedpress_gutenberg_render_block_vimeo( $attributes ) {
|
625 |
-
ob_start();
|
626 |
-
if ( !empty( $attributes ) && !empty( $attributes['iframeSrc'] ) ) :
|
627 |
-
$vimeo_options = $this->getOptions('vimeo', $this->get_vimeo_settings_schema());
|
628 |
-
$vimeo_params = $this->get_vimeo_params( $vimeo_options );
|
629 |
-
$iframeUrl = $attributes['iframeSrc'];
|
630 |
-
$align = 'align' . ( isset( $attributes[ 'align' ] ) ? $attributes[ 'align' ] : 'center' );
|
631 |
-
foreach ( $vimeo_params as $param => $value ) {
|
632 |
-
$iframeUrl = add_query_arg( $param, $value, $iframeUrl );
|
633 |
-
}
|
634 |
-
//@TODO; test responsive without static height width, keeping for now backward compatibility
|
635 |
-
?>
|
636 |
<div class="ose-vimeo wp-block-embed-vimeo <?php echo $align; ?>">
|
637 |
<iframe src="<?php echo $iframeUrl; ?>" allowtransparency="true" frameborder="0" width="640" height="360">
|
638 |
</iframe>
|
639 |
</div>
|
640 |
-
|
641 |
endif;
|
642 |
|
643 |
-
return apply_filters(
|
644 |
}
|
645 |
-
public function get_youtube_settings_schema()
|
|
|
646 |
return [
|
647 |
'autoplay' => [
|
648 |
'type' => 'bool',
|
@@ -700,7 +724,8 @@ class Feature_Enhancer {
|
|
700 |
],
|
701 |
];
|
702 |
}
|
703 |
-
public function get_vimeo_settings_schema()
|
|
|
704 |
return array(
|
705 |
'start_time' => [
|
706 |
'type' => 'number',
|
@@ -741,7 +766,8 @@ class Feature_Enhancer {
|
|
741 |
)
|
742 |
);
|
743 |
}
|
744 |
-
public function get_wistia_settings_schema()
|
|
|
745 |
return array(
|
746 |
'start_time' => [
|
747 |
'type' => 'number',
|
@@ -801,7 +827,8 @@ class Feature_Enhancer {
|
|
801 |
),
|
802 |
);
|
803 |
}
|
804 |
-
public function getVideoIDFromURL
|
|
|
805 |
// https://fast.wistia.com/embed/medias/xf1edjzn92.jsonp
|
806 |
// https://ostraining-1.wistia.com/medias/xf1edjzn92
|
807 |
preg_match('#\/medias\\\?\/([a-z0-9]+)\.?#i', $url, $matches);
|
@@ -813,8 +840,9 @@ class Feature_Enhancer {
|
|
813 |
|
814 |
return $id;
|
815 |
}
|
816 |
-
public function embedpress_wistia_block_after_embed(
|
817 |
-
|
|
|
818 |
// Get the video ID
|
819 |
$videoId = $this->getVideoIDFromURL($attributes['url']);
|
820 |
$shortVideoId = $videoId;
|
@@ -832,14 +860,15 @@ class Feature_Enhancer {
|
|
832 |
$html .= "<script>wistiaEmbed = Wistia.embed( \"{$shortVideoId}\", {$embedOptions} );</script>\n";
|
833 |
echo $html;
|
834 |
}
|
835 |
-
public function embedpress_wistia_pro_get_options()
|
|
|
836 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
837 |
// Embed Options
|
838 |
$embedOptions = new \stdClass;
|
839 |
$embedOptions->videoFoam = true;
|
840 |
-
$embedOptions->fullscreenButton = (isset($options['display_fullscreen_button']) && (bool)$options['display_fullscreen_button'] === true);
|
841 |
-
$embedOptions->smallPlayButton = (isset($options['small_play_button']) && (bool)$options['small_play_button'] === true);
|
842 |
-
$embedOptions->autoPlay = (isset($options['autoplay']) && (bool)$options['autoplay'] === true);
|
843 |
|
844 |
if (isset($options['player_color'])) {
|
845 |
$color = $options['player_color'];
|
@@ -865,7 +894,7 @@ class Feature_Enhancer {
|
|
865 |
}
|
866 |
}
|
867 |
// Add a fix for the autoplay and resumable work better together
|
868 |
-
|
869 |
if ($options['autoplay']) {
|
870 |
if ($isResumableEnabled) {
|
871 |
$pluginList['fixautoplayresumable'] = array(
|
@@ -886,11 +915,12 @@ class Feature_Enhancer {
|
|
886 |
}
|
887 |
|
888 |
$embedOptions->plugin = $pluginList;
|
889 |
-
$embedOptions = apply_filters(
|
890 |
$embedOptions = json_encode($embedOptions);
|
891 |
-
|
892 |
}
|
893 |
-
public function get_twitch_settings_schema()
|
|
|
894 |
return [
|
895 |
'start_time' => [
|
896 |
'type' => 'number',
|
@@ -920,7 +950,8 @@ class Feature_Enhancer {
|
|
920 |
|
921 |
];
|
922 |
}
|
923 |
-
public function get_dailymotion_settings_schema()
|
|
|
924 |
return [
|
925 |
'autoplay' => [
|
926 |
'type' => 'string',
|
@@ -956,7 +987,8 @@ class Feature_Enhancer {
|
|
956 |
],
|
957 |
];
|
958 |
}
|
959 |
-
public function get_soundcloud_settings_schema()
|
|
|
960 |
return [
|
961 |
'visual' => [
|
962 |
'type' => 'string',
|
@@ -1007,4 +1039,4 @@ class Feature_Enhancer {
|
|
1007 |
}
|
1008 |
|
1009 |
|
1010 |
-
}
|
1 |
<?php
|
2 |
+
|
3 |
namespace EmbedPress\Includes\Classes;
|
4 |
|
5 |
use \EmbedPress\Providers\Youtube;
|
6 |
use EmbedPress\Shortcode;
|
7 |
|
8 |
+
class Feature_Enhancer
|
9 |
+
{
|
10 |
+
public static $attributes_data;
|
11 |
+
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_youtube'], 90);
|
15 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_vimeo'], 90);
|
16 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_wistia'], 90);
|
17 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_twitch'], 90);
|
18 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_dailymotion'], 90);
|
19 |
+
add_filter('embedpress:onAfterEmbed', [$this, 'enhance_soundcloud'], 90);
|
20 |
+
|
21 |
+
add_filter(
|
22 |
+
'embedpress_gutenberg_youtube_params',
|
23 |
+
[$this, 'embedpress_gutenberg_register_block_youtube']
|
24 |
+
);
|
25 |
+
add_action('init', array($this, 'embedpress_gutenberg_register_block_vimeo'));
|
26 |
+
add_action('embedpress_gutenberg_wistia_block_after_embed', array($this, 'embedpress_wistia_block_after_embed'));
|
27 |
+
add_action('elementor/widget/embedpres_elementor/skins_init', [$this, 'elementor_setting_init']);
|
28 |
+
add_action('wp_ajax_youtube_rest_api', [$this, 'youtube_rest_api']);
|
29 |
+
add_action('embedpress_gutenberg_embed', [$this, 'gutenberg_embed'], 10, 2);
|
30 |
+
|
31 |
+
add_action('embedpress:isEmbra', [$this, 'isEmbra'], 10, 3);
|
32 |
+
|
33 |
}
|
34 |
|
35 |
+
public function isEmbra($isEmbra, $url, $atts)
|
36 |
+
{
|
37 |
+
if (strpos($url, 'youtube.com') !== false) {
|
38 |
$youtube = new Youtube($url, $atts);
|
39 |
+
if ($youtube->validateUrl($youtube->getUrl(false))) {
|
40 |
return true;
|
41 |
}
|
42 |
}
|
43 |
return $isEmbra;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function youtube_rest_api()
|
47 |
+
{
|
48 |
+
$result = Youtube::get_gallery_page([
|
49 |
+
'playlistId' => isset($_POST['playlistid']) ? sanitize_text_field($_POST['playlistid']) : null,
|
50 |
+
'pageToken' => isset($_POST['pagetoken']) ? sanitize_text_field($_POST['pagetoken']) : null,
|
51 |
+
'pagesize' => isset($_POST['pagesize']) ? sanitize_text_field($_POST['pagesize']) : null,
|
52 |
+
'currentpage' => isset($_POST['currentpage']) ? sanitize_text_field($_POST['currentpage']) : null,
|
53 |
+
'columns' => isset($_POST['epcolumns']) ? sanitize_text_field($_POST['epcolumns']) : null,
|
54 |
+
'showTitle' => isset($_POST['showtitle']) ? sanitize_text_field($_POST['showtitle']) : null,
|
55 |
+
'showPaging' => isset($_POST['showpaging']) ? sanitize_text_field($_POST['showpaging']) : null,
|
56 |
+
'autonext' => isset($_POST['autonext']) ? sanitize_text_field($_POST['autonext']) : null,
|
57 |
+
'thumbplay' => isset($_POST['thumbplay']) ? sanitize_text_field($_POST['thumbplay']) : null,
|
58 |
+
'thumbnail_quality' => isset($_POST['thumbnail_quality']) ? sanitize_text_field($_POST['thumbnail_quality']) : null,
|
59 |
+
]);
|
60 |
+
|
61 |
+
|
62 |
+
|
63 |
+
wp_send_json($result);
|
64 |
+
}
|
65 |
+
|
66 |
+
public function gutenberg_embed($embedHTML, $attributes)
|
67 |
+
{
|
68 |
+
|
69 |
+
if (!empty($attributes['url'])) {
|
70 |
$youtube = new Youtube($attributes['url']);
|
71 |
$is_youtube = $youtube->validateUrl($youtube->getUrl(false));
|
72 |
+
if ($is_youtube) {
|
73 |
$atts = [
|
74 |
+
'width' => intval($attributes['width']),
|
75 |
+
'height' => intval($attributes['height']),
|
76 |
'pagesize' => isset($attributes['pagesize']) ? intval($attributes['pagesize']) : 6,
|
77 |
+
'columns' => isset($attributes['columns']) ? intval($attributes['columns']) : 2,
|
78 |
+
'ispagination' => isset($attributes['ispagination']) ? $attributes['ispagination'] : 0,
|
79 |
+
'gapbetweenvideos' => isset($attributes['gapbetweenvideos']) ? $attributes['gapbetweenvideos'] : 30,
|
80 |
];
|
81 |
|
82 |
+
$urlInfo = Shortcode::parseContent($attributes['url'], true, $atts);
|
83 |
+
if (!empty($urlInfo->embed)) {
|
84 |
$embedHTML = $urlInfo->embed;
|
85 |
}
|
86 |
}
|
87 |
}
|
88 |
+
|
89 |
+
|
90 |
return $embedHTML;
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
+
|
94 |
+
public function elementor_setting_init()
|
95 |
+
{
|
96 |
$this->remove_classic_filters();
|
97 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'youtube'], 10, 2);
|
98 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'wistia'], 10, 2);
|
99 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'twitch'], 10, 2);
|
100 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'soundcloud'], 10, 2);
|
101 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'dailymotion'], 10, 2);
|
102 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'spotify'], 10, 2);
|
103 |
+
add_filter('embedpress_elementor_embed', [Elementor_Enhancer::class, 'vimeo'], 10, 2);
|
104 |
}
|
105 |
+
public function remove_classic_filters()
|
106 |
+
{
|
107 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_youtube'], 90);
|
108 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_vimeo'], 90);
|
109 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_wistia'], 90);
|
110 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_twitch'], 90);
|
111 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_dailymotion'], 90);
|
112 |
+
remove_filter('embedpress:onAfterEmbed', [$this, 'enhance_soundcloud'], 90);
|
113 |
}
|
114 |
+
public function getOptions($provider = '', $schema = [])
|
115 |
{
|
116 |
+
$options = (array) get_option(EMBEDPRESS_PLG_NAME . ':' . $provider, []);
|
117 |
if (empty($options) || (count($options) === 1 && empty($options[0]))) {
|
118 |
$options = [];
|
119 |
|
120 |
foreach ($schema as $fieldSlug => $field) {
|
121 |
$value = isset($field['default']) ? $field['default'] : "";
|
122 |
|
123 |
+
settype($value, isset($field['type']) && in_array(
|
124 |
+
strtolower($field['type']),
|
125 |
+
['bool', 'boolean', 'int', 'integer', 'float', 'string']
|
126 |
+
) ? $field['type'] : 'string');
|
127 |
|
128 |
if ($fieldSlug === "license_key") {
|
129 |
$options['license'] = [
|
140 |
'key' => true,
|
141 |
'status' => "missing",
|
142 |
];
|
143 |
+
return apply_filters('emebedpress_get_options', $options);
|
144 |
}
|
145 |
+
public function get_youtube_params($options)
|
146 |
{
|
147 |
$params = [];
|
148 |
|
149 |
// Handle `autoplay` option.
|
150 |
+
if (isset($options['autoplay']) && (bool) $options['autoplay'] === true) {
|
151 |
+
$params['autoplay'] = 1;
|
152 |
} else {
|
153 |
+
unset($params['autoplay']);
|
154 |
}
|
155 |
|
156 |
// Handle `controls` option.
|
157 |
+
if (isset($options['controls']) && in_array((int) $options['controls'], [0, 1, 2])) {
|
158 |
+
$params['controls'] = (int) $options['controls'];
|
159 |
} else {
|
160 |
+
unset($params['controls']);
|
161 |
}
|
162 |
|
163 |
// Handle `fs` option.
|
164 |
+
if (isset($options['fs']) && in_array((int) $options['fs'], [0, 1])) {
|
165 |
+
$params['fs'] = (int) $options['fs'];
|
166 |
} else {
|
167 |
+
unset($params['fs']);
|
168 |
}
|
169 |
|
170 |
// Handle `iv_load_policy` option.
|
171 |
+
if (isset($options['iv_load_policy']) && in_array((int) $options['iv_load_policy'], [1, 3])) {
|
172 |
+
$params['iv_load_policy'] = (int) $options['iv_load_policy'];
|
173 |
} else {
|
174 |
+
unset($params['iv_load_policy']);
|
175 |
}
|
176 |
|
177 |
+
return apply_filters('embedpress_youtube_params', $params);
|
|
|
178 |
}
|
179 |
+
public function get_vimeo_params($options)
|
180 |
+
{
|
181 |
$params = [];
|
182 |
|
183 |
// Handle `display_title` option.
|
184 |
+
if (isset($options['display_title']) && (bool) $options['display_title'] === true) {
|
185 |
$params['title'] = 1;
|
186 |
} else {
|
187 |
$params['title'] = 0;
|
200 |
} else {
|
201 |
unset($params['color']);
|
202 |
}
|
203 |
+
return apply_filters('embedpress_vimeo_params', $params);
|
|
|
204 |
}
|
205 |
+
//--- For CLASSIC AND BLOCK EDITOR
|
206 |
+
public function enhance_youtube($embed)
|
207 |
{
|
208 |
+
$isYoutube = (isset($embed->provider_name) && strtoupper($embed->provider_name) === 'YOUTUBE') || (isset($embed->url) && isset($embed->{$embed->url}) && isset($embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name']) === 'YOUTUBE');
|
209 |
+
|
210 |
+
if (
|
211 |
+
$isYoutube && isset($embed->embed)
|
212 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
213 |
+
) {
|
214 |
|
|
|
|
|
215 |
// for compatibility only, @TODO; remove later after deep testing.
|
216 |
$options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
|
217 |
// Parse the url to retrieve all its info like variables etc.
|
218 |
+
$url_full = $match[1];
|
219 |
+
$query = parse_url($url_full, PHP_URL_QUERY);
|
220 |
+
parse_str($query, $params);
|
221 |
+
// Handle `color` option.
|
222 |
+
if (!empty($options['color'])) {
|
223 |
+
$params['color'] = $options['color'];
|
224 |
} else {
|
225 |
+
unset($params['color']);
|
226 |
}
|
227 |
// Handle `rel` option.
|
228 |
+
if (isset($options['rel']) && in_array((int) $options['rel'], [0, 1])) {
|
229 |
+
$params['rel'] = (int) $options['rel'];
|
230 |
} else {
|
231 |
+
unset($params['rel']);
|
232 |
}
|
233 |
|
234 |
// Handle `autoplay` option.
|
235 |
+
if (isset($options['autoplay']) && (bool) $options['autoplay'] === true) {
|
236 |
+
$params['autoplay'] = 1;
|
237 |
} else {
|
238 |
+
unset($params['autoplay']);
|
239 |
}
|
240 |
|
241 |
// Handle `controls` option.
|
242 |
+
if (isset($options['controls']) && in_array((int) $options['controls'], [0, 1, 2])) {
|
243 |
+
$params['controls'] = (int) $options['controls'];
|
244 |
} else {
|
245 |
+
unset($params['controls']);
|
246 |
}
|
247 |
+
if (isset($options['start_time'])) {
|
248 |
+
$params['start'] = $options['start_time'];
|
249 |
+
} else {
|
250 |
+
unset($params['start']);
|
251 |
+
}
|
252 |
+
if (isset($options['end_time'])) {
|
253 |
+
$params['end'] = $options['end_time'];
|
254 |
+
} else {
|
255 |
+
unset($params['end']);
|
256 |
}
|
257 |
|
258 |
// Handle `fs` option.
|
259 |
+
if (isset($options['fs']) && in_array((int) $options['fs'], [0, 1])) {
|
260 |
+
$params['fs'] = (int) $options['fs'];
|
261 |
} else {
|
262 |
+
unset($params['fs']);
|
263 |
}
|
264 |
|
265 |
// Handle `iv_load_policy` option.
|
266 |
+
if (isset($options['iv_load_policy']) && in_array((int) $options['iv_load_policy'], [1, 3])) {
|
267 |
+
$params['iv_load_policy'] = (int) $options['iv_load_policy'];
|
268 |
} else {
|
269 |
+
unset($params['iv_load_policy']);
|
270 |
}
|
271 |
|
272 |
|
273 |
// pro controls will be handled by the pro so remove it from the free.
|
274 |
+
$pro_controls = ['cc_load_policy', 'modestbranding'];
|
275 |
+
foreach ($pro_controls as $pro_control) {
|
276 |
+
if (isset($params[$pro_control])) {
|
277 |
+
unset($params[$pro_control]);
|
278 |
}
|
279 |
}
|
280 |
|
281 |
|
282 |
+
preg_match('/(.+)?\?/', $url_full, $url);
|
283 |
+
$url = $url[1];
|
284 |
|
285 |
// Reassemble the url with the new variables.
|
286 |
$url_modified = $url . '?';
|
287 |
+
foreach ($params as $paramName => $paramValue) {
|
288 |
$url_modified .= $paramName . '=' . $paramValue . '&';
|
289 |
}
|
290 |
|
291 |
// Replaces the old url with the new one.
|
292 |
+
$embed->embed = str_replace($url_full, rtrim($url_modified, '&'), $embed->embed);
|
|
|
293 |
}
|
294 |
|
295 |
return $embed;
|
296 |
}
|
297 |
+
public function enhance_vimeo($embed)
|
298 |
+
{
|
299 |
+
if (
|
300 |
+
isset($embed->provider_name)
|
301 |
+
&& strtoupper($embed->provider_name) === 'VIMEO'
|
302 |
+
&& isset($embed->embed)
|
303 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
304 |
+
) {
|
305 |
// old schema is for backward compatibility only @todo; remove it in the next version after deep test
|
306 |
$options = $this->getOptions('vimeo', $this->get_vimeo_settings_schema());
|
307 |
|
309 |
$params = [];
|
310 |
|
311 |
// Handle `display_title` option.
|
312 |
+
if (isset($options['display_title']) && (bool) $options['display_title'] === true) {
|
313 |
$params['title'] = 1;
|
314 |
} else {
|
315 |
$params['title'] = 0;
|
316 |
}
|
317 |
|
318 |
// Handle `autoplay` option.
|
319 |
+
if (isset($options['autoplay']) && (bool) $options['autoplay'] === true) {
|
320 |
$params['autoplay'] = 1;
|
321 |
} else {
|
322 |
+
unset($params['autoplay']);
|
323 |
}
|
324 |
|
325 |
// Handle `color` option.
|
326 |
+
if (!empty($options['color'])) {
|
327 |
+
$params['color'] = str_replace('#', '', $options['color']);
|
328 |
} else {
|
329 |
+
unset($params['color']);
|
330 |
}
|
331 |
// Handle `display_author` option.
|
332 |
+
if (isset($options['display_author']) && (bool) $options['display_author'] === true) {
|
333 |
$params['byline'] = 1;
|
334 |
} else {
|
335 |
$params['byline'] = 0;
|
336 |
}
|
337 |
|
338 |
// Handle `display_avatar` option.
|
339 |
+
if (isset($options['display_avatar']) && (bool) $options['display_avatar'] === true) {
|
340 |
$params['portrait'] = 1;
|
341 |
} else {
|
342 |
$params['portrait'] = 0;
|
345 |
// NOTE: 'vimeo_dnt' is actually only 'dnt' in the params, so unset 'dnt' only
|
346 |
//@todo; maybe extract unsetting pro vars to a function later
|
347 |
$pro_controls = ['loop', 'autopause', 'dnt',];
|
348 |
+
foreach ($pro_controls as $pro_control) {
|
349 |
+
if (isset($params[$pro_control])) {
|
350 |
+
unset($params[$pro_control]);
|
351 |
}
|
352 |
}
|
353 |
// Reassemble the url with the new variables.
|
354 |
$url_modified = $url_full;
|
355 |
+
foreach ($params as $param => $value) {
|
356 |
+
$url_modified = add_query_arg($param, $value, $url_modified);
|
357 |
}
|
358 |
+
if (isset($options['start_time'])) {
|
359 |
+
$url_modified .= '#t=' . $options['start_time'];
|
360 |
}
|
361 |
|
362 |
+
do_action('embedpress_after_modified_url', $url_modified, $url_full, $params);
|
363 |
// Replaces the old url with the new one.
|
364 |
+
$embed->embed = str_replace($url_full, $url_modified, $embed->embed);
|
|
|
365 |
}
|
366 |
|
367 |
return $embed;
|
368 |
}
|
369 |
+
public function enhance_wistia($embed)
|
370 |
+
{
|
371 |
+
if (
|
372 |
+
isset($embed->provider_name)
|
373 |
+
&& strtoupper($embed->provider_name) === 'WISTIA, INC.'
|
374 |
+
&& isset($embed->embed)
|
375 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
376 |
+
) {
|
377 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
378 |
|
379 |
$url_full = $match[1];
|
380 |
|
381 |
// Parse the url to retrieve all its info like variables etc.
|
382 |
$query = parse_url($embed->url, PHP_URL_QUERY);
|
383 |
+
$url = str_replace('?' . $query, '', $url_full);
|
384 |
|
385 |
parse_str($query, $params);
|
386 |
|
398 |
|
399 |
$embedOptions->autoPlay = (isset($options['autoplay']) && (bool) $options['autoplay'] === true);
|
400 |
|
401 |
+
$embedOptions->time = isset($options['start_time']) ? $options['start_time'] : 0;
|
402 |
|
403 |
if (isset($options['player_color'])) {
|
404 |
$color = $options['player_color'];
|
408 |
}
|
409 |
|
410 |
// Plugins
|
411 |
+
$pluginsBaseURL = plugins_url('assets/js/wistia/min', dirname(__DIR__) . '/embedpress-Wistia.php');
|
412 |
|
413 |
$pluginList = array();
|
414 |
|
418 |
if ($isResumableEnabled) {
|
419 |
// Add the resumable plugin
|
420 |
$pluginList['resumable'] = array(
|
421 |
+
'src' => $pluginsBaseURL . '/resumable.min.js',
|
422 |
'async' => false
|
423 |
);
|
424 |
}
|
428 |
if (isset($options->autoPlay)) {
|
429 |
if ($isResumableEnabled) {
|
430 |
$pluginList['fixautoplayresumable'] = array(
|
431 |
+
'src' => $pluginsBaseURL . '/fixautoplayresumable.min.js'
|
432 |
);
|
433 |
}
|
434 |
}
|
437 |
if (isset($options['plugin_focus'])) {
|
438 |
$isFocusEnabled = $options['plugin_focus'];
|
439 |
$pluginList['dimthelights'] = array(
|
440 |
+
'src' => $pluginsBaseURL . '/dimthelights.min.js',
|
441 |
'autoDim' => $isFocusEnabled
|
442 |
);
|
443 |
$embedOptions->focus = $isFocusEnabled;
|
444 |
}
|
445 |
|
446 |
+
// Rewind plugin
|
447 |
if (isset($options['plugin_rewind'])) {
|
448 |
if ($options['plugin_rewind']) {
|
449 |
$embedOptions->rewindTime = isset($options['plugin_rewind_time']) ? (int) $options['plugin_rewind_time'] : 10;
|
450 |
|
451 |
$pluginList['rewind'] = array(
|
452 |
+
'src' => $pluginsBaseURL . '/rewind.min.js'
|
453 |
);
|
454 |
}
|
455 |
}
|
464 |
|
465 |
$class = array(
|
466 |
'wistia_embed',
|
467 |
+
'wistia_async_' . $videoId
|
468 |
);
|
469 |
|
470 |
$attribs = array(
|
476 |
$labels = array(
|
477 |
'watch_from_beginning' => __('Watch from the beginning', 'embedpress'),
|
478 |
'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress'),
|
479 |
+
'you_have_watched_it_before' => __(
|
480 |
+
'It looks like you\'ve watched<br />part of this video before!',
|
481 |
+
'embedpress'
|
482 |
+
),
|
483 |
);
|
484 |
$labels = json_encode($labels);
|
485 |
|
490 |
$html .= '<script src="https://fast.wistia.com/assets/external/E-v1.js" async></script>';
|
491 |
$html .= "<script>window.pp_embed_wistia_labels = {$labels};</script>\n";
|
492 |
$html .= "<script>window._wq = window._wq || []; _wq.push({\"{$shortVideoId}\": {$embedOptions}});</script>\n";
|
493 |
+
$html .= '<div ' . join(' ', $attribs) . "></div>\n";
|
494 |
$html .= '</div>';
|
495 |
$embed->embed = $html;
|
496 |
}
|
497 |
|
498 |
return $embed;
|
499 |
}
|
500 |
+
public function enhance_twitch($embed_content)
|
501 |
+
{
|
502 |
+
$e = isset($embed_content->url) && isset($embed_content->{$embed_content->url}) ? $embed_content->{$embed_content->url} : [];
|
503 |
+
if (isset($e['provider_name']) && strtoupper($e['provider_name']) === 'TWITCH' && isset($embed_content->embed)) {
|
504 |
$settings = $this->getOptions('twitch', $this->get_twitch_settings_schema());
|
505 |
|
506 |
+
$atts = isset($embed_content->attributes) ? $embed_content->attributes : [];
|
507 |
$time = '0h0m0s';
|
508 |
$type = $e['type'];
|
509 |
$content_id = $e['content_id'];
|
510 |
$channel = 'channel' === $type ? $content_id : '';
|
511 |
$video = 'video' === $type ? $content_id : '';
|
512 |
+
$muted = ('yes' === $settings['embedpress_pro_twitch_mute']) ? 'true' : 'false';
|
513 |
+
$full_screen = ('yes' === $settings['embedpress_pro_fs']) ? 'true' : 'false';
|
514 |
+
$autoplay = ('yes' === $settings['embedpress_pro_twitch_autoplay']) ? 'true' : 'false';
|
515 |
+
$theme = !empty($settings['embedpress_pro_twitch_theme']) ? $settings['embedpress_pro_twitch_theme'] : 'dark';
|
516 |
|
517 |
$layout = 'video';
|
518 |
+
$width = !empty($atts->{'data-width'}) ? (int) $atts->{'data-width'} : 800;
|
519 |
+
$height = !empty($atts->{'data-height'}) ? (int) $atts->{'data-height'} : 450;
|
520 |
+
if (!empty($settings['start_time'])) {
|
521 |
+
$ta = explode(':', gmdate("G:i:s", $settings['start_time']));
|
522 |
$h = $ta[0] . 'h';
|
523 |
+
$m = ($ta[1] * 1) . 'm';
|
524 |
+
$s = ($ta[2] * 1) . 's';
|
525 |
$time = $h . $m . $s;
|
526 |
}
|
527 |
$url = "https://embed.twitch.tv?autoplay={$autoplay}&channel={$channel}&height={$height}&layout={$layout}&migration=true&muted={$muted}&theme={$theme}&time={$time}&video={$video}&width={$width}&allowfullscreen={$full_screen}";
|
528 |
$pars_url = wp_parse_url(get_site_url());
|
529 |
+
$url = !empty($pars_url['host']) ? $url . '&parent=' . $pars_url['host'] : $url;
|
530 |
ob_start();
|
531 |
?>
|
532 |
+
<div class="embedpress_wrapper" data-url="<?php echo esc_attr(esc_url($embed_content->url)); ?>">
|
533 |
+
<iframe src="<?php echo esc_url($url); ?>" allowfullscreen="" scrolling="no" frameborder="0" allow="autoplay; fullscreen" title="Twitch" sandbox="allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" width="<?php echo esc_attr($width); ?>" height="<?php echo esc_attr($height); ?>" style="max-width: 100%; max-height:<?php echo esc_attr($width); ?>px;"></iframe>
|
534 |
+
</div>
|
535 |
+
<?php
|
536 |
+
$c = ob_get_clean();
|
537 |
+
$embed_content->embed = $c;
|
538 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
|
540 |
+
return $embed_content;
|
|
|
|
|
541 |
}
|
542 |
+
public function enhance_dailymotion($embed)
|
543 |
+
{
|
544 |
+
$options = $this->getOptions('dailymotion', $this->get_dailymotion_settings_schema());
|
545 |
+
$isDailymotion = (isset($embed->provider_name) && strtoupper($embed->provider_name) === 'DAILYMOTION') || (isset($embed->url) && isset($embed->{$embed->url}) && isset($embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name']) === 'DAILYMOTION');
|
546 |
+
|
547 |
+
if (
|
548 |
+
$isDailymotion && isset($embed->embed)
|
549 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
550 |
+
) {
|
551 |
+
// Parse the url to retrieve all its info like variables etc.
|
552 |
+
$url_full = $match[1];
|
553 |
+
$params = [
|
554 |
+
'ui-highlight' => str_replace('#', '', isset($options['color']) ? $options['color'] : null),
|
555 |
+
'mute' => (int) isset($options['mute']) ? $options['mute'] : null,
|
556 |
+
'autoplay' => (int) isset($options['autoplay']) ? $options['autoplay'] : null,
|
557 |
+
'controls' => (int) isset($options['controls']) ? $options['controls'] : null,
|
558 |
+
'ui-start-screen-info' => (int) isset($options['video_info']) ? $options['video_info'] : null,
|
559 |
+
'endscreen-enable' => 0,
|
560 |
+
];
|
561 |
|
562 |
+
if (isset($options['play_on_mobile']) && $options['play_on_mobile'] == '1') {
|
563 |
+
$params['playsinline'] = 1;
|
564 |
+
}
|
565 |
+
$params['start'] = (int) isset($options['start_time']) ? $options['start_time'] : null;
|
566 |
+
if (is_embedpress_pro_active()) {
|
567 |
+
$params['ui-logo'] = (int) isset($options['show_logo']) ? $options['show_logo'] : null;
|
568 |
+
}
|
569 |
+
|
570 |
+
$url_modified = $url_full;
|
571 |
+
foreach ($params as $param => $value) {
|
572 |
+
$url_modified = add_query_arg($param, $value, $url_modified);
|
573 |
+
}
|
574 |
+
$embed->embed = str_replace($url_full, $url_modified, $embed->embed);
|
575 |
+
}
|
576 |
|
577 |
+
return $embed;
|
578 |
+
}
|
579 |
+
public function enhance_soundcloud($embed)
|
580 |
+
{
|
581 |
+
|
582 |
+
$isSoundcloud = (isset($embed->provider_name) && strtoupper($embed->provider_name) === 'SOUNDCLOUD') || (isset($embed->url) && isset($embed->{$embed->url}) && isset($embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name']) === 'SOUNDCLOUD');
|
583 |
+
|
584 |
+
if (
|
585 |
+
$isSoundcloud && isset($embed->embed)
|
586 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
587 |
+
) {
|
588 |
+
$options = $this->getOptions('soundcloud', $this->get_soundcloud_settings_schema());
|
589 |
+
// Parse the url to retrieve all its info like variables etc.
|
590 |
+
$url_full = $match[1];
|
591 |
+
$params = [
|
592 |
+
'color' => str_replace('#', '', $options['color']),
|
593 |
+
'visual' => isset($options['visual']) && $options['visual'] == '1' ? 'true' : 'false',
|
594 |
+
'auto_play' => isset($options['autoplay']) && $options['autoplay'] == '1' ? 'true' : 'false',
|
595 |
+
'sharing' => isset($options['share_button']) && $options['share_button'] == '1' ? 'true' : 'false',
|
596 |
+
'show_comments' => isset($options['comments']) && $options['comments'] == '1' ? 'true' : 'false',
|
597 |
+
'buying' => 'false',
|
598 |
+
'download' => 'false',
|
599 |
+
'show_artwork' => isset($options['artwork']) && $options['artwork'] == '1' ? 'true' : 'false',
|
600 |
+
'show_playcount' => isset($options['play_count']) && $options['play_count'] == '1' ? 'true' : 'false',
|
601 |
+
'show_user' => isset($options['username']) && $options['username'] == '1' ? 'true' : 'false',
|
602 |
+
];
|
603 |
|
604 |
+
if (is_embedpress_pro_active()) {
|
605 |
+
$params['buying'] = isset($options['buy_button']) && $options['buy_button'] == '1' ? 'true' : 'false';
|
606 |
+
$params['download'] = isset($options['download_button']) && $options['download_button'] == '1' ? 'true' : 'false';
|
607 |
+
}
|
608 |
+
|
609 |
+
$url_modified = $url_full;
|
610 |
+
foreach ($params as $param => $value) {
|
611 |
+
$url_modified = add_query_arg($param, $value, $url_modified);
|
612 |
+
}
|
613 |
+
|
614 |
+
// Replaces the old url with the new one.
|
615 |
+
$embed->embed = str_replace($url_full, $url_modified, $embed->embed);
|
616 |
+
if ('false' === $params['visual']) {
|
617 |
+
$embed->embed = str_replace('height="400"', 'height="200 !important"', $embed->embed);
|
618 |
+
}
|
619 |
+
}
|
620 |
|
621 |
+
return $embed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
}
|
623 |
+
public function embedpress_gutenberg_register_block_youtube($youtube_params)
|
624 |
+
{
|
625 |
+
$youtube_options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
|
626 |
+
return $this->get_youtube_params($youtube_options);
|
627 |
}
|
628 |
+
public function embedpress_gutenberg_register_block_vimeo()
|
629 |
+
{
|
630 |
+
if (function_exists('register_block_type')) :
|
631 |
+
register_block_type('embedpress/vimeo-block', array(
|
632 |
+
'attributes' => array(
|
633 |
+
'url' => array(
|
634 |
+
'type' => 'string',
|
635 |
+
'default' => ''
|
636 |
+
),
|
637 |
+
'iframeSrc' => array(
|
638 |
+
'type' => 'string',
|
639 |
+
'default' => ''
|
640 |
+
),
|
641 |
+
),
|
642 |
+
'render_callback' => [$this, 'embedpress_gutenberg_render_block_vimeo']
|
643 |
+
));
|
644 |
+
endif;
|
645 |
}
|
646 |
+
public function embedpress_gutenberg_render_block_vimeo($attributes)
|
647 |
+
{
|
648 |
+
ob_start();
|
649 |
+
if (!empty($attributes) && !empty($attributes['iframeSrc'])) :
|
650 |
+
$vimeo_options = $this->getOptions('vimeo', $this->get_vimeo_settings_schema());
|
651 |
+
$vimeo_params = $this->get_vimeo_params($vimeo_options);
|
652 |
+
$iframeUrl = $attributes['iframeSrc'];
|
653 |
+
$align = 'align' . (isset($attributes['align']) ? $attributes['align'] : 'center');
|
654 |
+
foreach ($vimeo_params as $param => $value) {
|
655 |
+
$iframeUrl = add_query_arg($param, $value, $iframeUrl);
|
656 |
+
}
|
657 |
+
//@TODO; test responsive without static height width, keeping for now backward compatibility
|
658 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
659 |
<div class="ose-vimeo wp-block-embed-vimeo <?php echo $align; ?>">
|
660 |
<iframe src="<?php echo $iframeUrl; ?>" allowtransparency="true" frameborder="0" width="640" height="360">
|
661 |
</iframe>
|
662 |
</div>
|
663 |
+
<?php
|
664 |
endif;
|
665 |
|
666 |
+
return apply_filters('embedpress_gutenberg_block_markup', ob_get_clean());
|
667 |
}
|
668 |
+
public function get_youtube_settings_schema()
|
669 |
+
{
|
670 |
return [
|
671 |
'autoplay' => [
|
672 |
'type' => 'bool',
|
724 |
],
|
725 |
];
|
726 |
}
|
727 |
+
public function get_vimeo_settings_schema()
|
728 |
+
{
|
729 |
return array(
|
730 |
'start_time' => [
|
731 |
'type' => 'number',
|
766 |
)
|
767 |
);
|
768 |
}
|
769 |
+
public function get_wistia_settings_schema()
|
770 |
+
{
|
771 |
return array(
|
772 |
'start_time' => [
|
773 |
'type' => 'number',
|
827 |
),
|
828 |
);
|
829 |
}
|
830 |
+
public function getVideoIDFromURL($url)
|
831 |
+
{
|
832 |
// https://fast.wistia.com/embed/medias/xf1edjzn92.jsonp
|
833 |
// https://ostraining-1.wistia.com/medias/xf1edjzn92
|
834 |
preg_match('#\/medias\\\?\/([a-z0-9]+)\.?#i', $url, $matches);
|
840 |
|
841 |
return $id;
|
842 |
}
|
843 |
+
public function embedpress_wistia_block_after_embed($attributes)
|
844 |
+
{
|
845 |
+
$embedOptions = $this->embedpress_wistia_pro_get_options();
|
846 |
// Get the video ID
|
847 |
$videoId = $this->getVideoIDFromURL($attributes['url']);
|
848 |
$shortVideoId = $videoId;
|
860 |
$html .= "<script>wistiaEmbed = Wistia.embed( \"{$shortVideoId}\", {$embedOptions} );</script>\n";
|
861 |
echo $html;
|
862 |
}
|
863 |
+
public function embedpress_wistia_pro_get_options()
|
864 |
+
{
|
865 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
866 |
// Embed Options
|
867 |
$embedOptions = new \stdClass;
|
868 |
$embedOptions->videoFoam = true;
|
869 |
+
$embedOptions->fullscreenButton = (isset($options['display_fullscreen_button']) && (bool) $options['display_fullscreen_button'] === true);
|
870 |
+
$embedOptions->smallPlayButton = (isset($options['small_play_button']) && (bool) $options['small_play_button'] === true);
|
871 |
+
$embedOptions->autoPlay = (isset($options['autoplay']) && (bool) $options['autoplay'] === true);
|
872 |
|
873 |
if (isset($options['player_color'])) {
|
874 |
$color = $options['player_color'];
|
894 |
}
|
895 |
}
|
896 |
// Add a fix for the autoplay and resumable work better together
|
897 |
+
//@TODO; check baseurl deeply, not looking good
|
898 |
if ($options['autoplay']) {
|
899 |
if ($isResumableEnabled) {
|
900 |
$pluginList['fixautoplayresumable'] = array(
|
915 |
}
|
916 |
|
917 |
$embedOptions->plugin = $pluginList;
|
918 |
+
$embedOptions = apply_filters('embedpress_wistia_params', $embedOptions);
|
919 |
$embedOptions = json_encode($embedOptions);
|
920 |
+
return apply_filters('embedpress_wistia_params_after_encode', $embedOptions);
|
921 |
}
|
922 |
+
public function get_twitch_settings_schema()
|
923 |
+
{
|
924 |
return [
|
925 |
'start_time' => [
|
926 |
'type' => 'number',
|
950 |
|
951 |
];
|
952 |
}
|
953 |
+
public function get_dailymotion_settings_schema()
|
954 |
+
{
|
955 |
return [
|
956 |
'autoplay' => [
|
957 |
'type' => 'string',
|
987 |
],
|
988 |
];
|
989 |
}
|
990 |
+
public function get_soundcloud_settings_schema()
|
991 |
+
{
|
992 |
return [
|
993 |
'visual' => [
|
994 |
'type' => 'string',
|
1039 |
}
|
1040 |
|
1041 |
|
1042 |
+
}
|
EmbedPress/Providers/Youtube.php
CHANGED
@@ -22,6 +22,8 @@ use Embera\Url;
|
|
22 |
* @link https://youtube.com
|
23 |
* @link https://youtube-eng.googleblog.com/2009/10/oembed-support_9.html
|
24 |
*/
|
|
|
|
|
25 |
class Youtube extends ProviderAdapter implements ProviderInterface {
|
26 |
/** inline {@inheritdoc} */
|
27 |
protected $shouldSendRequest = false;
|
@@ -30,7 +32,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
30 |
protected $endpoint = 'https://www.youtube.com/oembed?format=json&scheme=https';
|
31 |
protected static $channel_endpoint = 'https://www.googleapis.com/youtube/v3/';
|
32 |
/** @var array Array with allowed params for the current Provider */
|
33 |
-
protected $allowedParams = [ 'maxwidth', 'maxheight', '
|
34 |
|
35 |
/** inline {@inheritdoc} */
|
36 |
protected static $hosts = [
|
@@ -128,9 +130,11 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
128 |
* @param array $params Parameters for the query string
|
129 |
* @return string
|
130 |
*/
|
|
|
131 |
protected function constructUrl($endpoint, array $params = array())
|
132 |
{
|
133 |
$endpoint = self::$channel_endpoint . $endpoint;
|
|
|
134 |
return $endpoint . ((strpos($endpoint, '?') === false) ? '?' : '&') . http_build_query(array_filter($params));
|
135 |
}
|
136 |
|
@@ -159,7 +163,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
159 |
$transient_key = 'ep_embed_youtube_channel_playlist_id_' . md5($channel_url);
|
160 |
$jsonResult = get_transient($transient_key);
|
161 |
|
162 |
-
if(!empty($jsonResult)){
|
163 |
return $jsonResult;
|
164 |
}
|
165 |
|
@@ -182,6 +186,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
182 |
return $result;
|
183 |
}
|
184 |
$jsonResult = json_decode($apiResult['body']);
|
|
|
185 |
|
186 |
if (isset($jsonResult->error)) {
|
187 |
$result['error'] = true;
|
@@ -200,7 +205,6 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
200 |
set_transient($transient_key, $result, DAY_IN_SECONDS);
|
201 |
}
|
202 |
|
203 |
-
//
|
204 |
return $result;
|
205 |
}
|
206 |
|
@@ -234,17 +238,17 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
234 |
$gallery_args = [
|
235 |
'playlistId' => $the_playlist_id,
|
236 |
];
|
237 |
-
if(!empty($params['
|
238 |
-
$gallery_args['
|
239 |
}
|
240 |
$gallery = self::get_gallery_page($gallery_args);
|
241 |
|
242 |
if (!empty($gallery->first_vid)) {
|
243 |
$rel = "https://www.youtube.com/embed/{$gallery->first_vid}?feature=oembed";
|
244 |
-
$main_iframe = "<iframe width='{$params['maxwidth']}' height='{$params['maxheight']}' src='$rel' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen title='{$title}'></iframe>";
|
245 |
}
|
246 |
if($gallery->html){
|
247 |
-
$styles = self::styles();
|
248 |
return [
|
249 |
"title" => $title,
|
250 |
"html" => "<div class='ep-player-wrap'>$main_iframe {$gallery->html} $styles</div>",
|
@@ -256,6 +260,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
256 |
"html" => "<div class='ep-player-wrap'>" . __('Please enter your YouTube API key to embed YouTube Channel.', 'embedpress') . "</div>",
|
257 |
];
|
258 |
}
|
|
|
259 |
return $response;
|
260 |
}
|
261 |
|
@@ -272,8 +277,9 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
272 |
$options = wp_parse_args($options, [
|
273 |
'playlistId' => '',
|
274 |
'pageToken' => '',
|
275 |
-
'
|
276 |
-
'
|
|
|
277 |
'thumbnail' => 'medium',
|
278 |
'gallery' => true,
|
279 |
'autonext' => true,
|
@@ -281,8 +287,8 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
281 |
'apiKey' => self::get_api_key(),
|
282 |
'hideprivate' => '',
|
283 |
]);
|
284 |
-
$options['
|
285 |
-
$options['
|
286 |
|
287 |
if (empty($options['apiKey'])) {
|
288 |
$gallobj->html = self::get_api_key_error_message();
|
@@ -290,7 +296,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
290 |
}
|
291 |
|
292 |
$apiEndpoint = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=' . $options['playlistId']
|
293 |
-
. '&maxResults=' . $options['
|
294 |
. '&key=' . $options['apiKey'];
|
295 |
if ($options['pageToken'] != null) {
|
296 |
$apiEndpoint .= '&pageToken=' . $options['pageToken'];
|
@@ -329,6 +335,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
329 |
}
|
330 |
|
331 |
|
|
|
332 |
$resultsPerPage = $jsonResult->pageInfo->resultsPerPage;
|
333 |
$totalResults = $jsonResult->pageInfo->totalResults;
|
334 |
$totalPages = ceil($totalResults / $resultsPerPage);
|
@@ -340,6 +347,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
340 |
$prevPageToken = $jsonResult->prevPageToken;
|
341 |
}
|
342 |
|
|
|
343 |
if (!empty($jsonResult->items) && is_array($jsonResult->items)) :
|
344 |
if($options['gallery'] === "false"){
|
345 |
$gallobj->html = "";
|
@@ -362,7 +370,7 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
362 |
|
363 |
ob_start();
|
364 |
?>
|
365 |
-
<div class="ep-youtube__content__block">
|
366 |
<div class="youtube__content__body">
|
367 |
<div class="content__wrap">
|
368 |
<?php foreach ($jsonResult->items as $item) : ?>
|
@@ -391,29 +399,104 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
391 |
<?php endforeach; ?>
|
392 |
<div class="item" style="height: 0"></div>
|
393 |
</div>
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
<
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
</div>
|
416 |
-
|
|
|
417 |
<div class="ep-loader-wrap">
|
418 |
<div class="ep-loader"><img alt="loading" src="<?php echo EMBEDPRESS_URL_ASSETS . 'images/youtube/spin.gif'; ?>"></div>
|
419 |
</div>
|
@@ -499,7 +582,16 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
499 |
];
|
500 |
}
|
501 |
|
502 |
-
public static
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
ob_start();
|
504 |
?>
|
505 |
<style>
|
@@ -538,22 +630,36 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
538 |
cursor: pointer;
|
539 |
border: 1px solid rgba(0, 0, 0, .1);
|
540 |
border-radius: 30px;
|
541 |
-
padding: 0
|
542 |
-
|
543 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
}
|
545 |
.ep-youtube__content__pagination .ep-page-numbers {
|
546 |
display: flex;
|
547 |
align-items: center;
|
548 |
gap: 10px;
|
|
|
549 |
}
|
550 |
.ep-youtube__content__pagination .ep-page-numbers > span {
|
551 |
border: 1px solid rgba(0, 0, 0, .1);
|
552 |
border-radius: 30px;
|
553 |
-
padding: 0 10px;
|
554 |
display: inline-block;
|
555 |
-
|
556 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
}
|
558 |
|
559 |
.ep-youtube__content__block .youtube__content__body .content__wrap {
|
@@ -652,6 +758,81 @@ class Youtube extends ProviderAdapter implements ProviderInterface {
|
|
652 |
.ep-loader img {
|
653 |
width: 20px;
|
654 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
</style>
|
656 |
<?php
|
657 |
return ob_get_clean();
|
22 |
* @link https://youtube.com
|
23 |
* @link https://youtube-eng.googleblog.com/2009/10/oembed-support_9.html
|
24 |
*/
|
25 |
+
|
26 |
+
|
27 |
class Youtube extends ProviderAdapter implements ProviderInterface {
|
28 |
/** inline {@inheritdoc} */
|
29 |
protected $shouldSendRequest = false;
|
32 |
protected $endpoint = 'https://www.youtube.com/oembed?format=json&scheme=https';
|
33 |
protected static $channel_endpoint = 'https://www.googleapis.com/youtube/v3/';
|
34 |
/** @var array Array with allowed params for the current Provider */
|
35 |
+
protected $allowedParams = [ 'maxwidth', 'maxheight', 'pagesize', 'thumbnail', 'gallery', 'hideprivate', 'columns', 'ispagination', 'gapbetweenvideos' ];
|
36 |
|
37 |
/** inline {@inheritdoc} */
|
38 |
protected static $hosts = [
|
130 |
* @param array $params Parameters for the query string
|
131 |
* @return string
|
132 |
*/
|
133 |
+
|
134 |
protected function constructUrl($endpoint, array $params = array())
|
135 |
{
|
136 |
$endpoint = self::$channel_endpoint . $endpoint;
|
137 |
+
|
138 |
return $endpoint . ((strpos($endpoint, '?') === false) ? '?' : '&') . http_build_query(array_filter($params));
|
139 |
}
|
140 |
|
163 |
$transient_key = 'ep_embed_youtube_channel_playlist_id_' . md5($channel_url);
|
164 |
$jsonResult = get_transient($transient_key);
|
165 |
|
166 |
+
if(!empty($jsonResult)){
|
167 |
return $jsonResult;
|
168 |
}
|
169 |
|
186 |
return $result;
|
187 |
}
|
188 |
$jsonResult = json_decode($apiResult['body']);
|
189 |
+
|
190 |
|
191 |
if (isset($jsonResult->error)) {
|
192 |
$result['error'] = true;
|
205 |
set_transient($transient_key, $result, DAY_IN_SECONDS);
|
206 |
}
|
207 |
|
|
|
208 |
return $result;
|
209 |
}
|
210 |
|
238 |
$gallery_args = [
|
239 |
'playlistId' => $the_playlist_id,
|
240 |
];
|
241 |
+
if(!empty($params['pagesize'])){
|
242 |
+
$gallery_args['pagesize'] = $params['pagesize'];
|
243 |
}
|
244 |
$gallery = self::get_gallery_page($gallery_args);
|
245 |
|
246 |
if (!empty($gallery->first_vid)) {
|
247 |
$rel = "https://www.youtube.com/embed/{$gallery->first_vid}?feature=oembed";
|
248 |
+
$main_iframe = "<div class='ep-first-video'><iframe width='{$params['maxwidth']}' height='{$params['maxheight']}' src='$rel' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen title='{$title}'></iframe></div>";
|
249 |
}
|
250 |
if($gallery->html){
|
251 |
+
$styles = self::styles($params, $this->getUrl());
|
252 |
return [
|
253 |
"title" => $title,
|
254 |
"html" => "<div class='ep-player-wrap'>$main_iframe {$gallery->html} $styles</div>",
|
260 |
"html" => "<div class='ep-player-wrap'>" . __('Please enter your YouTube API key to embed YouTube Channel.', 'embedpress') . "</div>",
|
261 |
];
|
262 |
}
|
263 |
+
|
264 |
return $response;
|
265 |
}
|
266 |
|
277 |
$options = wp_parse_args($options, [
|
278 |
'playlistId' => '',
|
279 |
'pageToken' => '',
|
280 |
+
'pagesize' => self::get_pagesize() ? self::get_pagesize() : 6,
|
281 |
+
'currentpage' => '',
|
282 |
+
'columns' => 3,
|
283 |
'thumbnail' => 'medium',
|
284 |
'gallery' => true,
|
285 |
'autonext' => true,
|
287 |
'apiKey' => self::get_api_key(),
|
288 |
'hideprivate' => '',
|
289 |
]);
|
290 |
+
$options['pagesize'] = $options['pagesize'] > 50 ? 50 : $options['pagesize'];
|
291 |
+
$options['pagesize'] = $options['pagesize'] < 1 ? 1 : $options['pagesize'];
|
292 |
|
293 |
if (empty($options['apiKey'])) {
|
294 |
$gallobj->html = self::get_api_key_error_message();
|
296 |
}
|
297 |
|
298 |
$apiEndpoint = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=' . $options['playlistId']
|
299 |
+
. '&maxResults=' . $options['pagesize']
|
300 |
. '&key=' . $options['apiKey'];
|
301 |
if ($options['pageToken'] != null) {
|
302 |
$apiEndpoint .= '&pageToken=' . $options['pageToken'];
|
335 |
}
|
336 |
|
337 |
|
338 |
+
|
339 |
$resultsPerPage = $jsonResult->pageInfo->resultsPerPage;
|
340 |
$totalResults = $jsonResult->pageInfo->totalResults;
|
341 |
$totalPages = ceil($totalResults / $resultsPerPage);
|
347 |
$prevPageToken = $jsonResult->prevPageToken;
|
348 |
}
|
349 |
|
350 |
+
|
351 |
if (!empty($jsonResult->items) && is_array($jsonResult->items)) :
|
352 |
if($options['gallery'] === "false"){
|
353 |
$gallobj->html = "";
|
370 |
|
371 |
ob_start();
|
372 |
?>
|
373 |
+
<div class="ep-youtube__content__block" data-unique-id="<?php echo wp_rand(); ?>">
|
374 |
<div class="youtube__content__body">
|
375 |
<div class="content__wrap">
|
376 |
<?php foreach ($jsonResult->items as $item) : ?>
|
399 |
<?php endforeach; ?>
|
400 |
<div class="item" style="height: 0"></div>
|
401 |
</div>
|
402 |
+
|
403 |
+
|
404 |
+
<?php if ($totalPages > 1) : ?>
|
405 |
+
<div class="ep-youtube__content__pagination <?php echo (empty($prevPageToken) && empty($nextPageToken)) ? ' hide ' : ''; ?>">
|
406 |
+
<div
|
407 |
+
class="ep-prev" <?php echo empty($prevPageToken) ? ' style="display:none" ' : ''; ?>
|
408 |
+
data-playlistid="<?php echo esc_attr($options['playlistId']) ?>"
|
409 |
+
data-pagetoken="<?php echo esc_attr($prevPageToken) ?>"
|
410 |
+
data-pagesize="<?php echo intval($options['pagesize']) ?>"
|
411 |
+
>
|
412 |
+
<span><?php _e("Prev", "embedpress"); ?></span>
|
413 |
+
</div>
|
414 |
+
<div class="is_desktop_device ep-page-numbers <?php echo $totalPages > 1 ? '' : 'hide'; ?>">
|
415 |
+
<?php
|
416 |
+
|
417 |
+
$numOfPages = $totalPages;
|
418 |
+
$renderedEllipses = false;
|
419 |
+
|
420 |
+
$currentPage = !empty($options['currentpage'])?$options['currentpage'] : 1;
|
421 |
+
|
422 |
+
for($i = 1; $i<=$numOfPages; $i++)
|
423 |
+
{
|
424 |
+
//render pages 1 - 3
|
425 |
+
if($i < 4) {
|
426 |
+
//render link
|
427 |
+
$is_current = $i == (int)$currentPage? "active__current_page" : "";
|
428 |
+
|
429 |
+
echo wp_kses_post("<span class='page-number $is_current' data-page='$i'>$i</span>");
|
430 |
+
|
431 |
+
}
|
432 |
+
|
433 |
+
//render current page number
|
434 |
+
else if($i == (int)$currentPage) {
|
435 |
+
//render link
|
436 |
+
echo wp_kses_post('<span class="page-number active__current_page" data-page="'.$i.'">'.$i.'</span>');
|
437 |
+
//reset ellipses
|
438 |
+
$renderedEllipses = false;
|
439 |
+
}
|
440 |
+
|
441 |
+
//last page number
|
442 |
+
else if ($i >= $numOfPages - 1) {
|
443 |
+
//render link
|
444 |
+
echo wp_kses_post('<span class="page-number" data-page="'.$i.'">'.$i.'</span>');
|
445 |
+
}
|
446 |
+
|
447 |
+
//make sure you only do this once per ellipses group
|
448 |
+
else {
|
449 |
+
if (!$renderedEllipses){
|
450 |
+
print("...");
|
451 |
+
$renderedEllipses = true;
|
452 |
+
}
|
453 |
+
}
|
454 |
+
}
|
455 |
+
?>
|
456 |
+
|
457 |
+
</div>
|
458 |
+
|
459 |
+
<div class="is_mobile_device ep-page-numbers <?php echo $totalPages > 1 ? '' : 'hide'; ?>">
|
460 |
+
<?php
|
461 |
+
|
462 |
+
$numOfPages = $totalPages;
|
463 |
+
$renderedEllipses = false;
|
464 |
+
|
465 |
+
$currentPage = !empty($options['currentpage'])?$options['currentpage'] : 1;
|
466 |
+
|
467 |
+
for($i = 1; $i<=$numOfPages; $i++)
|
468 |
+
{
|
469 |
+
|
470 |
+
//render current page number
|
471 |
+
if($i == (int)$currentPage) {
|
472 |
+
//render link
|
473 |
+
echo wp_kses_post('<span class="page-number-mobile" data-page="'.$i.'">'.$i.'</span>');
|
474 |
+
//reset ellipses
|
475 |
+
$renderedEllipses = false;
|
476 |
+
}
|
477 |
+
|
478 |
+
//last page number
|
479 |
+
else if ($i >= $numOfPages ) {
|
480 |
+
//render link
|
481 |
+
echo wp_kses_post('...<span class="page-number-mobile" data-page="'.$i.'">'.$i.'</span>');
|
482 |
+
}
|
483 |
+
}
|
484 |
+
?>
|
485 |
+
|
486 |
+
</div>
|
487 |
+
|
488 |
+
|
489 |
+
<div
|
490 |
+
class="ep-next " <?php echo empty($nextPageToken) ? ' style="display:none" ' : ''; ?>
|
491 |
+
data-playlistid="<?php echo esc_attr($options['playlistId']) ?>"
|
492 |
+
data-pagetoken="<?php echo esc_attr($nextPageToken) ?>"
|
493 |
+
data-pagesize="<?php echo intval($options['pagesize']) ?>"
|
494 |
+
>
|
495 |
+
<span><?php _e("Next ", "embedpress"); ?> </span>
|
496 |
+
</div>
|
497 |
</div>
|
498 |
+
<?php endif; ?>
|
499 |
+
|
500 |
<div class="ep-loader-wrap">
|
501 |
<div class="ep-loader"><img alt="loading" src="<?php echo EMBEDPRESS_URL_ASSETS . 'images/youtube/spin.gif'; ?>"></div>
|
502 |
</div>
|
582 |
];
|
583 |
}
|
584 |
|
585 |
+
// public static $num = 0;
|
586 |
+
|
587 |
+
|
588 |
+
|
589 |
+
public static $x = 0;
|
590 |
+
|
591 |
+
public static function styles($params, $url){
|
592 |
+
|
593 |
+
$uniqid = '.ose-uid-'.md5($url);
|
594 |
+
|
595 |
ob_start();
|
596 |
?>
|
597 |
<style>
|
630 |
cursor: pointer;
|
631 |
border: 1px solid rgba(0, 0, 0, .1);
|
632 |
border-radius: 30px;
|
633 |
+
padding: 0 20px;
|
634 |
+
height: 40px;
|
635 |
+
transition: .3s;
|
636 |
+
display: flex;
|
637 |
+
align-items: center;
|
638 |
+
}
|
639 |
+
.ep-youtube__content__pagination .ep-prev:hover,
|
640 |
+
.ep-youtube__content__pagination .ep-next:hover{
|
641 |
+
background-color: #5B4E96;
|
642 |
+
color: #fff;
|
643 |
}
|
644 |
.ep-youtube__content__pagination .ep-page-numbers {
|
645 |
display: flex;
|
646 |
align-items: center;
|
647 |
gap: 10px;
|
648 |
+
flex-wrap: wrap;
|
649 |
}
|
650 |
.ep-youtube__content__pagination .ep-page-numbers > span {
|
651 |
border: 1px solid rgba(0, 0, 0, .1);
|
652 |
border-radius: 30px;
|
|
|
653 |
display: inline-block;
|
654 |
+
width: 45px;
|
655 |
+
height: 45px;
|
656 |
+
display: flex;
|
657 |
+
align-items: center;
|
658 |
+
justify-content: center;
|
659 |
+
}
|
660 |
+
.active__current_page{
|
661 |
+
background: #5B4E96;
|
662 |
+
color: #fff;
|
663 |
}
|
664 |
|
665 |
.ep-youtube__content__block .youtube__content__body .content__wrap {
|
758 |
.ep-loader img {
|
759 |
width: 20px;
|
760 |
}
|
761 |
+
.is_mobile_device{
|
762 |
+
display: none!important;
|
763 |
+
}
|
764 |
+
|
765 |
+
|
766 |
+
.is_mobile_devic.ep-page-numbers {
|
767 |
+
gap: 5px;
|
768 |
+
}
|
769 |
+
|
770 |
+
@media only screen and (max-width: 480px) {
|
771 |
+
.is_desktop_device{
|
772 |
+
display: none!important;
|
773 |
+
}
|
774 |
+
.ep-youtube__content__pagination .ep-page-numbers > span {
|
775 |
+
width: 35px;
|
776 |
+
height: 35px;
|
777 |
+
}
|
778 |
+
.ep-youtube__content__pagination .ep-prev, .ep-youtube__content__pagination .ep-next{
|
779 |
+
height: 35px;
|
780 |
+
}
|
781 |
+
.is_mobile_device{
|
782 |
+
display: flex!important;;
|
783 |
+
}
|
784 |
+
.ep-youtube__content__pagination .ep-page-numbers {
|
785 |
+
gap: 5px;
|
786 |
+
}
|
787 |
+
}
|
788 |
+
<?php
|
789 |
+
$attributes_data = $params;
|
790 |
+
|
791 |
+
$is_pagination = 'flex';
|
792 |
+
|
793 |
+
$gap = '30';
|
794 |
+
$columns = '';
|
795 |
+
|
796 |
+
if (isset($attributes_data['ispagination']) && $attributes_data['ispagination']) {
|
797 |
+
$is_pagination = 'none';
|
798 |
+
}
|
799 |
+
if(isset($attributes_data['gapbetweenvideos'])){
|
800 |
+
$gap = $attributes_data['gapbetweenvideos'];
|
801 |
+
}
|
802 |
+
if(isset($attributes_data['columns'])){
|
803 |
+
$columns = $attributes_data['columns'];
|
804 |
+
}
|
805 |
+
|
806 |
+
|
807 |
+
|
808 |
+
if(!empty($columns) && (int) $columns > 0){
|
809 |
+
$repeatCol = 'repeat(auto-fit, minmax('.esc_html('calc('.(100 / (int) $columns).'% - '.$gap.'px)').', 1fr))';
|
810 |
+
}
|
811 |
+
else{
|
812 |
+
$repeatCol = 'repeat(auto-fit, minmax(250px, 1fr))';
|
813 |
+
}
|
814 |
+
|
815 |
+
?>
|
816 |
+
<?php echo esc_attr($uniqid); ?> .ep-youtube__content__block .youtube__content__body .content__wrap {
|
817 |
+
gap: <?php echo esc_html($gap); ?>px !important;
|
818 |
+
margin-top: <?php echo esc_html($gap); ?>px !important;
|
819 |
+
}
|
820 |
+
<?php echo esc_attr($uniqid); ?> .ep-youtube__content__block .ep-youtube__content__pagination {
|
821 |
+
display: <?php echo esc_html($is_pagination); ?>!important;
|
822 |
+
}
|
823 |
+
<?php echo esc_attr($uniqid); ?> .ep-youtube__content__block .youtube__content__body .content__wrap {
|
824 |
+
grid-template-columns: <?php echo $repeatCol; ?>;
|
825 |
+
gap: <?php echo $gap.'px'; ?>;
|
826 |
+
}
|
827 |
+
|
828 |
+
<?php
|
829 |
+
if($is_pagination){
|
830 |
+
echo esc_attr($uniqid) ?> {
|
831 |
+
height: 100%!important;
|
832 |
+
}
|
833 |
+
<?php
|
834 |
+
}
|
835 |
+
?>
|
836 |
</style>
|
837 |
<?php
|
838 |
return ob_get_clean();
|
EmbedPress/RestAPI.php
CHANGED
@@ -33,11 +33,8 @@ class RestAPI
|
|
33 |
$url .= "&list=$playlist_id";
|
34 |
}
|
35 |
|
36 |
-
$atts =
|
37 |
-
|
38 |
-
'height' => intval( $request->get_param('height')),
|
39 |
-
'pagesize' => intval( $request->get_param('pagesize')),
|
40 |
-
];
|
41 |
|
42 |
if (empty($url)) {
|
43 |
return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
|
@@ -47,7 +44,6 @@ class RestAPI
|
|
47 |
if (empty($urlInfo)) {
|
48 |
return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
|
49 |
}
|
50 |
-
|
51 |
return new WP_REST_Response($urlInfo, 200);
|
52 |
}
|
53 |
}
|
33 |
$url .= "&list=$playlist_id";
|
34 |
}
|
35 |
|
36 |
+
$atts = $request->get_params();
|
37 |
+
|
|
|
|
|
|
|
38 |
|
39 |
if (empty($url)) {
|
40 |
return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
|
44 |
if (empty($urlInfo)) {
|
45 |
return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
|
46 |
}
|
|
|
47 |
return new WP_REST_Response($urlInfo, 200);
|
48 |
}
|
49 |
}
|
EmbedPress/Shortcode.php
CHANGED
@@ -7,7 +7,7 @@ use Embera\ProviderCollection\DefaultProviderCollection;
|
|
7 |
use EmbedPress\Includes\Classes\Helper;
|
8 |
use WP_oEmbed;
|
9 |
|
10 |
-
(
|
11 |
|
12 |
/**
|
13 |
* Entity responsible to handle the plugin's shortcode events and behaviors.
|
@@ -18,7 +18,9 @@ use WP_oEmbed;
|
|
18 |
* @license GPLv3 or later
|
19 |
* @since 1.0.0
|
20 |
*/
|
21 |
-
|
|
|
|
|
22 |
/**
|
23 |
* The WP_oEmbed class instance.
|
24 |
*
|
@@ -28,18 +30,22 @@ class Shortcode {
|
|
28 |
*
|
29 |
* @var WP_oEmbed $oEmbedInstance
|
30 |
*/
|
|
|
|
|
|
|
|
|
31 |
private static $oEmbedInstance = null;
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
/**
|
44 |
* The DefaultProviderCollection class instance.
|
45 |
*
|
@@ -52,9 +58,11 @@ class Shortcode {
|
|
52 |
private static $collection = null;
|
53 |
|
54 |
private static $emberaInstanceSettings = [];
|
55 |
-
|
|
|
56 |
|
57 |
-
|
|
|
58 |
* Register the plugin's shortcode into WordPress.
|
59 |
*
|
60 |
* @return void
|
@@ -62,12 +70,14 @@ class Shortcode {
|
|
62 |
* @static
|
63 |
*
|
64 |
*/
|
65 |
-
public static function register()
|
|
|
66 |
// Register the new shortcode for embeds.
|
67 |
-
add_shortcode(
|
68 |
-
add_shortcode(
|
69 |
-
add_shortcode(
|
70 |
-
add_shortcode(
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -82,18 +92,26 @@ class Shortcode {
|
|
82 |
*
|
83 |
*/
|
84 |
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
$default = [];
|
88 |
-
if (
|
89 |
$default = [
|
90 |
'width' => $plgSettings->enableEmbedResizeWidth,
|
91 |
'height' => $plgSettings->enableEmbedResizeHeight
|
92 |
];
|
93 |
}
|
94 |
-
$attributes = wp_parse_args(
|
95 |
-
$embed = self::parseContent(
|
96 |
-
|
|
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -106,141 +124,182 @@ class Shortcode {
|
|
106 |
* @since 1.0.0
|
107 |
* @static
|
108 |
*/
|
109 |
-
public static function parseContent(
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
}
|
114 |
-
self::set_default_size(
|
115 |
-
$url = preg_replace(
|
116 |
-
|
|
|
|
|
|
|
117 |
|
118 |
// Converts any special HTML entities back to characters.
|
119 |
-
$url = htmlspecialchars_decode(
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
// Identify what service provider the shortcode's link belongs to
|
133 |
$is_embra_provider = apply_filters('embedpress:isEmbra', false, $url, self::get_embera_settings());
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
139 |
// FIX FOR MEETUP as MEETUP API is OFF, use OUR custom embed
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
144 |
|
145 |
// Sanitize the data
|
146 |
-
$urlData = self::sanitizeUrlData(
|
|
|
|
|
147 |
|
148 |
// Stores the original content
|
149 |
-
if (
|
150 |
$urlData->originalContent = $url;
|
151 |
}
|
152 |
|
153 |
-
$embedResults = apply_filters(
|
154 |
|
155 |
-
if (
|
156 |
return $subject;
|
157 |
}
|
158 |
|
159 |
// Transform all shortcode attributes into html form. I.e.: {foo: "joe"} -> foo="joe"
|
160 |
-
$attributesHtml = ['class="ose-{provider_alias}
|
161 |
-
|
162 |
//foreach ( self::$ombed_attributes as $attrName => $attrValue ) {
|
163 |
// $attributesHtml[] = $attrName . '="' . $attrValue . '"';
|
164 |
//}
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
|
169 |
-
|
170 |
-
|
171 |
$provider_name = self::get_provider_name($urlData, $url);
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
unset(
|
184 |
|
185 |
// This assure that the iframe has the same dimensions the user wants to
|
186 |
-
if (
|
187 |
-
if (
|
188 |
-
$customWidth = (int)self::$emberaInstanceSettings[
|
189 |
-
$customHeight = (int)self::$emberaInstanceSettings[
|
190 |
} else {
|
191 |
-
if (
|
192 |
-
$iframeWidth = (int)$matches[
|
193 |
}
|
194 |
|
195 |
-
if (
|
196 |
-
$iframeHeight = (int)$matches[
|
197 |
}
|
198 |
|
199 |
-
if (
|
200 |
-
$iframeRatio = ceil(
|
201 |
|
202 |
-
if (
|
203 |
-
$customWidth = (int)self::$emberaInstanceSettings[
|
204 |
-
$customHeight = ceil(
|
205 |
} else {
|
206 |
-
$customHeight = (int)self::$emberaInstanceSettings[
|
207 |
$customWidth = $iframeRatio * $customHeight;
|
208 |
}
|
209 |
}
|
210 |
}
|
211 |
|
212 |
-
if (
|
213 |
-
if (
|
214 |
-
$parsedContent = preg_replace(
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
-
if (
|
223 |
-
$parsedContent = preg_replace(
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
|
230 |
-
if (
|
231 |
-
$parsedContent = preg_replace(
|
232 |
-
|
|
|
|
|
|
|
233 |
}
|
234 |
|
235 |
-
if (
|
236 |
-
$parsedContent = preg_replace(
|
237 |
-
|
|
|
|
|
|
|
238 |
}
|
239 |
-
if
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
$styles = "<style>
|
245 |
.ose-gfycat.ose-embedpress-responsive{
|
246 |
position: relative;
|
@@ -251,8 +310,11 @@ class Shortcode {
|
|
251 |
}
|
252 |
}
|
253 |
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
256 |
<style>
|
257 |
.ose-the-new-york-times iframe{
|
258 |
min-height: auto;
|
@@ -263,83 +325,102 @@ class Shortcode {
|
|
263 |
}
|
264 |
</style>
|
265 |
KAMAL;
|
266 |
-
|
267 |
-
|
268 |
}
|
269 |
|
270 |
-
if (
|
271 |
-
$parsedContent = preg_replace(
|
272 |
}
|
273 |
|
274 |
|
275 |
-
$parsedContent = apply_filters(
|
276 |
|
277 |
-
if (
|
278 |
-
$embed = (object) array_merge(
|
279 |
'attributes' => (object) self::get_oembed_attributes(),
|
280 |
'embed' => $parsedContent,
|
281 |
'url' => $url,
|
282 |
-
]
|
283 |
-
|
284 |
-
$embed = self::modify_spotify_content(
|
285 |
-
$embed = apply_filters(
|
286 |
return $embed;
|
287 |
}
|
288 |
}
|
289 |
|
|
|
|
|
|
|
290 |
return $subject;
|
291 |
}
|
292 |
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
}
|
305 |
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
|
|
314 |
}
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
return $urlData;
|
323 |
}
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
340 |
self::$embera_instance->setConfig(self::get_embera_settings());
|
341 |
}
|
342 |
-
|
343 |
}
|
344 |
|
345 |
/**
|
@@ -352,20 +433,21 @@ KAMAL;
|
|
352 |
* @static
|
353 |
*
|
354 |
*/
|
355 |
-
public static function addServiceProvider(
|
356 |
-
|
|
|
357 |
return false;
|
358 |
}
|
359 |
|
360 |
if (is_null(self::$collection)) {
|
361 |
self::$collection = new DefaultProviderCollection();
|
362 |
}
|
363 |
-
if (
|
364 |
-
self::$collection->addProvider(
|
365 |
return self::$collection;
|
366 |
-
} elseif (
|
367 |
-
foreach (
|
368 |
-
self::addServiceProvider(
|
369 |
}
|
370 |
return self::$collection;
|
371 |
} else {
|
@@ -383,15 +465,16 @@ KAMAL;
|
|
383 |
* @static
|
384 |
*
|
385 |
*/
|
386 |
-
public static function parseContentAttributesFromString(
|
|
|
387 |
$customAttributes = [];
|
388 |
-
if (
|
389 |
-
if (
|
390 |
-
$attributes = $matches[
|
391 |
-
$attrValues = $matches[
|
392 |
|
393 |
-
foreach (
|
394 |
-
$customAttributes[
|
395 |
}
|
396 |
}
|
397 |
}
|
@@ -410,118 +493,133 @@ KAMAL;
|
|
410 |
* @static
|
411 |
*
|
412 |
*/
|
413 |
-
|
|
|
|
|
|
|
414 |
$attributes = [
|
415 |
'class' => ["embedpress-wrapper ose-embedpress-responsive"],
|
416 |
];
|
417 |
|
418 |
$embedShouldBeResponsive = true;
|
419 |
$embedShouldHaveCustomDimensions = false;
|
420 |
-
if (
|
421 |
-
if (
|
422 |
-
if (
|
423 |
-
$customAttributes[
|
424 |
|
425 |
-
$attributes[
|
426 |
}
|
427 |
|
428 |
-
unset(
|
429 |
}
|
430 |
|
431 |
-
if (
|
432 |
-
if (
|
433 |
-
$attributes[
|
434 |
$embedShouldHaveCustomDimensions = true;
|
435 |
}
|
436 |
}
|
437 |
|
438 |
-
if (
|
439 |
-
if (
|
440 |
-
$attributes[
|
441 |
$embedShouldHaveCustomDimensions = true;
|
442 |
}
|
443 |
}
|
444 |
|
445 |
-
if (
|
446 |
$attrNameDefaultPrefix = "data-";
|
447 |
-
foreach (
|
448 |
-
if (
|
449 |
$attrName = $attrValue;
|
450 |
$attrValue = "";
|
451 |
}
|
452 |
|
453 |
-
$attrName = str_replace(
|
454 |
|
455 |
-
if (
|
456 |
-
if (
|
457 |
$attrValue = "false";
|
458 |
-
$attrName = substr(
|
459 |
} else {
|
460 |
$attrValue = "true";
|
461 |
}
|
462 |
}
|
463 |
|
464 |
-
$attributes[
|
465 |
}
|
466 |
}
|
467 |
|
468 |
// Check if there's any "responsive" parameter
|
469 |
$responsiveAttributes = ["responsive", "data-responsive"];
|
470 |
-
foreach (
|
471 |
-
if (
|
472 |
-
if (
|
473 |
$embedShouldBeResponsive = true;
|
474 |
} else {
|
475 |
-
$embedShouldBeResponsive = !self::valueIsFalse(
|
476 |
}
|
477 |
|
478 |
break;
|
479 |
}
|
480 |
}
|
481 |
-
unset(
|
482 |
}
|
483 |
|
484 |
-
$attributes[
|
485 |
|
486 |
-
if (
|
487 |
-
$attributes[
|
488 |
}
|
489 |
|
490 |
-
if (
|
491 |
-
$attributes[
|
492 |
} else {
|
493 |
-
$attributes[
|
494 |
}
|
495 |
|
496 |
-
$attributes[
|
497 |
-
if (
|
498 |
-
$attributes[
|
499 |
}
|
500 |
|
501 |
return $attributes;
|
502 |
}
|
503 |
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
|
|
|
|
511 |
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
|
519 |
-
|
|
|
|
|
|
|
|
|
|
|
520 |
|
521 |
}
|
522 |
|
523 |
-
|
524 |
-
|
|
|
|
|
|
|
|
|
|
|
525 |
}
|
526 |
|
527 |
/**
|
@@ -534,9 +632,11 @@ KAMAL;
|
|
534 |
* @static
|
535 |
*
|
536 |
*/
|
537 |
-
|
538 |
-
|
539 |
-
|
|
|
|
|
540 |
case "0":
|
541 |
case "false":
|
542 |
case "off":
|
@@ -563,12 +663,13 @@ KAMAL;
|
|
563 |
* @static
|
564 |
*
|
565 |
*/
|
566 |
-
private static function extractContentFromHeaderAsArray(
|
|
|
567 |
$headerValue = null;
|
568 |
|
569 |
-
foreach (
|
570 |
-
if (
|
571 |
-
$headerValue = $matches[
|
572 |
break;
|
573 |
}
|
574 |
}
|
@@ -589,25 +690,26 @@ KAMAL;
|
|
589 |
* @static
|
590 |
*
|
591 |
*/
|
592 |
-
private static function sanitizeUrlData(
|
593 |
-
|
594 |
-
|
|
|
595 |
|
596 |
-
foreach (
|
597 |
-
if (
|
598 |
-
unset(
|
599 |
|
600 |
-
$key = str_replace(
|
601 |
$data->$key = $value;
|
602 |
}
|
603 |
}
|
604 |
-
} elseif (
|
605 |
-
foreach (
|
606 |
-
if (
|
607 |
-
unset(
|
608 |
|
609 |
-
$key = str_replace(
|
610 |
-
$data[
|
611 |
}
|
612 |
}
|
613 |
}
|
@@ -620,211 +722,234 @@ KAMAL;
|
|
620 |
return self::$collection;
|
621 |
}
|
622 |
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
|
634 |
-
|
635 |
-
|
636 |
-
|
|
|
637 |
}
|
638 |
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
$iframe_url = str_replace( 'podcasts.apple.com', 'embed.podcasts.apple.com', $url);
|
643 |
-
$html = '<iframe allow="autoplay *; encrypted-media *; fullscreen *" frameborder="0" height="175" style="width:100%;max-width:660px;overflow:hidden;background:transparent;" src="'.esc_url( $iframe_url).'"></iframe>';
|
644 |
-
return str_replace( '{html}', $html, $template );
|
645 |
-
|
646 |
-
}
|
647 |
-
}
|
648 |
-
|
649 |
-
if ( empty($serviceProvider) ) {
|
650 |
-
$html = '';
|
651 |
-
}else{
|
652 |
-
$html = self::get_oembed()->get_html( $url, self::get_oembed_attributes() );
|
653 |
-
}
|
654 |
-
|
655 |
-
if ( !$html ) {
|
656 |
-
$html = self::get_embera_instance()->autoEmbed($url);
|
657 |
-
}
|
658 |
-
return str_replace( '{html}', $html, $template );
|
659 |
-
}
|
660 |
-
|
661 |
-
protected static function get_oembed_attributes() {
|
662 |
-
return self::$ombed_attributes;
|
663 |
-
}
|
664 |
-
protected static function set_oembed_attributes( $atts) {
|
665 |
-
self::$ombed_attributes = $atts;
|
666 |
-
}
|
667 |
-
|
668 |
-
protected static function check_for_google_url(&$url) {
|
669 |
-
if ( preg_match( '/http[s]?:\/\/goo\.gl\/(?:([a-z]+)\/)?[a-z0-9]+\/?$/i', $url, $matches ) ) {
|
670 |
-
// Fetch all headers from the short-url so we can know how to handle its original content depending on the service.
|
671 |
-
$headers = get_headers( $url );
|
672 |
-
|
673 |
-
$supportedServicesHeadersPatterns = [
|
674 |
-
'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i',
|
675 |
-
];
|
676 |
-
|
677 |
-
$service = isset( $matches[ 1 ] ) ? strtolower( $matches[ 1 ] ) : null;
|
678 |
-
// No specific service was found in the url.
|
679 |
-
if ( empty( $service ) ) {
|
680 |
-
// Let's try to guess which service the original url belongs to.
|
681 |
-
foreach ( $headers as $header ) {
|
682 |
-
// Check if the short-url reffers to a Google Maps url.
|
683 |
-
if ( preg_match( $supportedServicesHeadersPatterns[ 'maps' ], $header, $matches ) ) {
|
684 |
-
// Replace the shortened url with its original url.
|
685 |
-
$url = $matches[ 1 ];
|
686 |
-
break;
|
687 |
-
}
|
688 |
-
}
|
689 |
-
unset( $header );
|
690 |
-
} else {
|
691 |
-
// Check if the Google service is supported atm.
|
692 |
-
if ( isset( $supportedServicesHeadersPatterns[ $service ] ) ) {
|
693 |
-
// Tries to extract the url based on its headers.
|
694 |
-
$originalUrl = self::extractContentFromHeaderAsArray( $supportedServicesHeadersPatterns[ $service ],
|
695 |
-
$headers );
|
696 |
-
// Replace the shortened url with its original url if the specific header was found.
|
697 |
-
if ( !empty( $originalUrl ) ) {
|
698 |
-
$url = $originalUrl;
|
699 |
-
}
|
700 |
-
unset( $originalUrl );
|
701 |
-
}
|
702 |
-
}
|
703 |
-
unset( $service, $supportedServicesHeadersPatterns, $headers, $matches );
|
704 |
-
|
705 |
-
}
|
706 |
-
|
707 |
-
}
|
708 |
-
|
709 |
-
protected static function get_provider_name( $urlData, $url ) {
|
710 |
-
$provider_name = '';
|
711 |
-
if (isset( $urlData->provider_name )) {
|
712 |
-
$provider_name = str_replace( [' ', ','], '-', strtolower( $urlData->provider_name));
|
713 |
-
}elseif ( is_array( $urlData ) && !empty( $urlData) ) {
|
714 |
-
$data = array_shift( $urlData);
|
715 |
-
if ( isset( $data[ 'provider_name' ]) ) {
|
716 |
-
$provider_name = str_replace( [' ', ','], '-', strtolower( $data[ 'provider_name' ]));
|
717 |
-
|
718 |
-
}
|
719 |
-
}
|
720 |
-
return $provider_name;
|
721 |
-
}
|
722 |
-
|
723 |
-
protected static function modify_content_for_fb_and_canada( $provider_name, &$html ) {
|
724 |
-
if ( !empty($provider_name) ) {
|
725 |
-
// NFB seems to always return their embed code with all HTML entities into their applicable characters string.
|
726 |
-
$PROVIDER_NAME_IN_CAP = strtoupper($provider_name);
|
727 |
-
if ( $PROVIDER_NAME_IN_CAP === "NATIONAL FILM BOARD OF CANADA" ) {
|
728 |
-
$html = html_entity_decode( $html );
|
729 |
-
} elseif ( $PROVIDER_NAME_IN_CAP === "FACEBOOK" ) {
|
730 |
-
$plgSettings = Core::getSettings();
|
731 |
-
|
732 |
-
// Check if the user wants to force a certain language into Facebook embeds.
|
733 |
-
$locale = isset( $plgSettings->fbLanguage ) && !empty( $plgSettings->fbLanguage ) ? $plgSettings->fbLanguage : false;
|
734 |
-
if ( !!$locale ) {
|
735 |
-
// Replace the automatically detected language by Facebook's API with the language chosen by the user.
|
736 |
-
$html = preg_replace( '/\/[a-z]{2}\_[a-z]{2}\/sdk\.js/i', "/{$locale}/sdk.js",
|
737 |
-
$html );
|
738 |
-
}
|
739 |
-
|
740 |
-
// Make sure `adapt_container_width` parameter is set to false. Setting to true, as it is by default, might cause Facebook to render embeds inside editors (in admin) with only 180px wide.
|
741 |
-
if ( is_admin() ) {
|
742 |
-
$html = preg_replace( '~data\-adapt\-container\-width=\"(?:true|1)\"~i',
|
743 |
-
'data-adapt-container-width="0"', $html );
|
744 |
-
}
|
745 |
-
|
746 |
-
unset( $locale, $plgSettings );
|
747 |
-
}
|
748 |
-
}
|
749 |
-
}
|
750 |
-
|
751 |
-
public static function modify_spotify_content( $embed ) {
|
752 |
-
$should_modify = apply_filters( 'embedpress_should_modify_spotify', true);
|
753 |
-
$isSpotify = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'SPOTIFY' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'SPOTIFY');
|
754 |
-
if ($should_modify && $isSpotify && isset( $embed->embed )
|
755 |
-
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
756 |
-
$options = (array)get_option(EMBEDPRESS_PLG_NAME . ':spotify');
|
757 |
-
// Parse the url to retrieve all its info like variables etc.
|
758 |
-
$url_full = $match[ 1 ];
|
759 |
-
$modified_url = str_replace( 'playlist-v2', 'playlist', $url_full);
|
760 |
-
if(isset( $options['theme'])){
|
761 |
-
if ( strpos( $modified_url, '?') !== false ) {
|
762 |
-
$modified_url .= '&theme='.sanitize_text_field( $options['theme']);
|
763 |
-
}else{
|
764 |
-
$modified_url .= '?theme='.sanitize_text_field( $options['theme']);
|
765 |
-
}
|
766 |
-
}
|
767 |
-
|
768 |
-
// Replaces the old url with the new one.
|
769 |
-
$embed->embed = str_replace( $url_full, $modified_url, $embed->embed );
|
770 |
-
}
|
771 |
-
return $embed;
|
772 |
-
}
|
773 |
-
|
774 |
-
public static function do_shortcode_pdf($attributes = [], $subject = null ){
|
775 |
-
$plgSettings = Core::getSettings();
|
776 |
|
777 |
$default = [
|
778 |
'width' => $plgSettings->enableEmbedResizeWidth,
|
779 |
'height' => $plgSettings->enableEmbedResizeHeight,
|
780 |
'powered_by' => 'no',
|
781 |
];
|
782 |
-
$attributes = wp_parse_args(
|
783 |
-
|
784 |
-
|
|
|
|
|
|
|
|
|
785 |
|
786 |
ob_start();
|
787 |
|
788 |
$id = 'embedpress-pdf-shortcode';
|
789 |
$dimension = "width: {$attributes['width']}px;height: {$attributes['height']}px";
|
790 |
?>
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
frameborder="0"></iframe>
|
799 |
<?php
|
800 |
|
801 |
-
|
802 |
-
|
803 |
<div>
|
804 |
-
<iframe allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr(
|
805 |
</div>
|
806 |
|
807 |
-
|
808 |
-
|
809 |
-
|
|
|
|
|
|
|
|
|
|
|
810 |
|
811 |
-
|
812 |
-
}
|
813 |
-
}
|
814 |
-
?>
|
815 |
-
</div>
|
816 |
|
817 |
-
<?php
|
818 |
-
return ob_get_clean();
|
819 |
-
}
|
820 |
|
821 |
-
|
822 |
-
|
823 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
824 |
|
825 |
-
protected static function is_pdf( $url )
|
826 |
-
{
|
827 |
-
$arr = explode( '.', $url );
|
828 |
-
return end( $arr ) === 'pdf';
|
829 |
}
|
830 |
-
}
|
7 |
use EmbedPress\Includes\Classes\Helper;
|
8 |
use WP_oEmbed;
|
9 |
|
10 |
+
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
11 |
|
12 |
/**
|
13 |
* Entity responsible to handle the plugin's shortcode events and behaviors.
|
18 |
* @license GPLv3 or later
|
19 |
* @since 1.0.0
|
20 |
*/
|
21 |
+
|
22 |
+
class Shortcode
|
23 |
+
{
|
24 |
/**
|
25 |
* The WP_oEmbed class instance.
|
26 |
*
|
30 |
*
|
31 |
* @var WP_oEmbed $oEmbedInstance
|
32 |
*/
|
33 |
+
|
34 |
+
|
35 |
+
public static $y = 0;
|
36 |
+
|
37 |
private static $oEmbedInstance = null;
|
38 |
|
39 |
+
/**
|
40 |
+
* The Embera class instance.
|
41 |
+
*
|
42 |
+
* @since 2.7.4
|
43 |
+
* @access private
|
44 |
+
* @static
|
45 |
+
*
|
46 |
+
* @var Embera $embera_instance
|
47 |
+
*/
|
48 |
+
private static $embera_instance = null;
|
49 |
/**
|
50 |
* The DefaultProviderCollection class instance.
|
51 |
*
|
58 |
private static $collection = null;
|
59 |
|
60 |
private static $emberaInstanceSettings = [];
|
61 |
+
private static $ombed_attributes;
|
62 |
+
public static $attributes_data;
|
63 |
|
64 |
+
|
65 |
+
/**
|
66 |
* Register the plugin's shortcode into WordPress.
|
67 |
*
|
68 |
* @return void
|
70 |
* @static
|
71 |
*
|
72 |
*/
|
73 |
+
public static function register()
|
74 |
+
{
|
75 |
// Register the new shortcode for embeds.
|
76 |
+
add_shortcode(EMBEDPRESS_SHORTCODE, ['\\EmbedPress\\Shortcode', 'do_shortcode']);
|
77 |
+
add_shortcode('embed_oembed_html', ['\\EmbedPress\\Shortcode', 'do_shortcode']);
|
78 |
+
add_shortcode('embedpress', ['\\EmbedPress\\Shortcode', 'do_shortcode']);
|
79 |
+
add_shortcode('embedpress_pdf', ['\\EmbedPress\\Shortcode', 'do_shortcode_pdf']);
|
80 |
+
|
81 |
}
|
82 |
|
83 |
/**
|
92 |
*
|
93 |
*/
|
94 |
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
public static function do_shortcode($attributes = [], $subject = null)
|
99 |
+
{
|
100 |
+
$plgSettings = Core::getSettings();
|
101 |
+
|
102 |
+
|
103 |
$default = [];
|
104 |
+
if ($plgSettings->enableGlobalEmbedResize) {
|
105 |
$default = [
|
106 |
'width' => $plgSettings->enableEmbedResizeWidth,
|
107 |
'height' => $plgSettings->enableEmbedResizeHeight
|
108 |
];
|
109 |
}
|
110 |
+
$attributes = wp_parse_args($attributes, $default);
|
111 |
+
$embed = self::parseContent($subject, true, $attributes);
|
112 |
+
|
113 |
+
|
114 |
+
return is_object($embed) ? $embed->embed : $embed;
|
115 |
}
|
116 |
|
117 |
/**
|
124 |
* @since 1.0.0
|
125 |
* @static
|
126 |
*/
|
127 |
+
public static function parseContent($subject, $stripNewLine = false, $customAttributes = [])
|
128 |
+
{
|
129 |
+
|
130 |
+
if (!empty($subject)) {
|
131 |
+
if (empty($customAttributes)) {
|
132 |
+
$customAttributes = self::parseContentAttributesFromString($subject);
|
133 |
}
|
134 |
+
self::set_default_size($customAttributes);
|
135 |
+
$url = preg_replace(
|
136 |
+
'/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
|
137 |
+
"",
|
138 |
+
$subject
|
139 |
+
);
|
140 |
|
141 |
// Converts any special HTML entities back to characters.
|
142 |
+
$url = htmlspecialchars_decode($url);
|
143 |
+
|
144 |
+
$uniqid = 'ose-uid-'.md5($url);
|
145 |
+
|
146 |
+
$content_uid = md5($url);
|
147 |
+
|
148 |
+
//$hash = 'embedpress_'.$content_uid . md5( implode( ':', array_values( $customAttributes)));
|
149 |
+
|
150 |
+
// check if we have data cached
|
151 |
+
//@TODO; add caching later and remove caching on settings save
|
152 |
+
//if ( $embed = get_transient( $hash) ) {
|
153 |
+
// $embed = apply_filters( 'embedpress:onAfterEmbed', $embed );
|
154 |
+
// return $embed;
|
155 |
+
//}
|
156 |
+
self::$ombed_attributes = self::parseContentAttributes($customAttributes, $content_uid);
|
157 |
+
|
158 |
+
|
159 |
+
self::set_embera_settings(self::$ombed_attributes);
|
160 |
|
161 |
// Identify what service provider the shortcode's link belongs to
|
162 |
$is_embra_provider = apply_filters('embedpress:isEmbra', false, $url, self::get_embera_settings());
|
163 |
+
if ($is_embra_provider || (strpos($url, 'meetup.com') !== false) || (strpos($url, 'sway.office.com') !== false)) {
|
164 |
+
$serviceProvider = '';
|
165 |
+
} else {
|
166 |
+
$serviceProvider = self::get_oembed()->get_provider($url);
|
167 |
+
}
|
168 |
+
|
169 |
// FIX FOR MEETUP as MEETUP API is OFF, use OUR custom embed
|
170 |
+
if ('https://api.meetup.com/oembed' === $serviceProvider) {
|
171 |
+
$serviceProvider = '';
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
$urlData = self::get_url_data($url, self::$ombed_attributes, $serviceProvider);
|
176 |
+
|
177 |
|
178 |
// Sanitize the data
|
179 |
+
$urlData = self::sanitizeUrlData($urlData, $url);
|
180 |
+
|
181 |
+
|
182 |
|
183 |
// Stores the original content
|
184 |
+
if (is_object($urlData)) {
|
185 |
$urlData->originalContent = $url;
|
186 |
}
|
187 |
|
188 |
+
$embedResults = apply_filters('embedpress:onBeforeEmbed', $urlData, $subject);
|
189 |
|
190 |
+
if (empty($embedResults)) {
|
191 |
return $subject;
|
192 |
}
|
193 |
|
194 |
// Transform all shortcode attributes into html form. I.e.: {foo: "joe"} -> foo="joe"
|
195 |
+
$attributesHtml = ['class="ose-{provider_alias} ' . $uniqid .' ose-embedpress-responsive"'];
|
196 |
+
//$attributesHtml = [];
|
197 |
//foreach ( self::$ombed_attributes as $attrName => $attrValue ) {
|
198 |
// $attributesHtml[] = $attrName . '="' . $attrValue . '"';
|
199 |
//}
|
200 |
+
if (isset($customAttributes['width'])) {
|
201 |
+
$attributesHtml[] = "style=\"width:{$customAttributes['width']}px; max-width:100%; height: 100%; display:inline-block;\"";
|
202 |
+
}
|
203 |
|
204 |
+
// Check if $url is a google shortened url and tries to extract from it which Google service it refers to.
|
205 |
+
self::check_for_google_url($url);
|
206 |
$provider_name = self::get_provider_name($urlData, $url);
|
207 |
+
$embedTemplate = '<div ' . implode(' ', $attributesHtml) . '>{html}</div>';
|
208 |
|
209 |
+
$parsedContent = self::get_content_from_template($url, $embedTemplate, $serviceProvider);
|
210 |
+
// Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
|
211 |
+
$parsedContent = str_replace("'", '"', $parsedContent);
|
212 |
+
$parsedContent = str_replace("{provider_alias}", $provider_name, $parsedContent);
|
213 |
+
$parsedContent = str_replace('sandbox="allow-scripts"', 'sandbox="allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"', $parsedContent);
|
214 |
+
$parsedContent = str_replace('<iframe ', '<iframe allowFullScreen="true" ', $parsedContent);
|
215 |
|
216 |
+
self::purify_html_content($parsedContent);
|
217 |
+
self::modify_content_for_fb_and_canada($provider_name, $parsedContent);
|
218 |
+
unset($embedTemplate, $serviceProvider);
|
219 |
|
220 |
// This assure that the iframe has the same dimensions the user wants to
|
221 |
+
if (isset(self::$emberaInstanceSettings['maxwidth']) || isset(self::$emberaInstanceSettings['maxheight'])) {
|
222 |
+
if (isset(self::$emberaInstanceSettings['maxwidth']) && isset(self::$emberaInstanceSettings['maxheight'])) {
|
223 |
+
$customWidth = (int) self::$emberaInstanceSettings['maxwidth'];
|
224 |
+
$customHeight = (int) self::$emberaInstanceSettings['maxheight'];
|
225 |
} else {
|
226 |
+
if (preg_match('~width="(\d+)"|width\s+:\s+(\d+)~i', $parsedContent, $matches)) {
|
227 |
+
$iframeWidth = (int) $matches[1];
|
228 |
}
|
229 |
|
230 |
+
if (preg_match('~height="(\d+)"|height\s+:\s+(\d+)~i', $parsedContent, $matches)) {
|
231 |
+
$iframeHeight = (int) $matches[1];
|
232 |
}
|
233 |
|
234 |
+
if (isset($iframeWidth) && isset($iframeHeight) && $iframeWidth > 0 && $iframeHeight > 0) {
|
235 |
+
$iframeRatio = ceil($iframeWidth / $iframeHeight);
|
236 |
|
237 |
+
if (isset(self::$emberaInstanceSettings['maxwidth'])) {
|
238 |
+
$customWidth = (int) self::$emberaInstanceSettings['maxwidth'];
|
239 |
+
$customHeight = ceil($customWidth / $iframeRatio);
|
240 |
} else {
|
241 |
+
$customHeight = (int) self::$emberaInstanceSettings['maxheight'];
|
242 |
$customWidth = $iframeRatio * $customHeight;
|
243 |
}
|
244 |
}
|
245 |
}
|
246 |
|
247 |
+
if (isset($customWidth) && isset($customHeight)) {
|
248 |
+
if (preg_match('~width="(\d+)"~i', $parsedContent)) {
|
249 |
+
$parsedContent = preg_replace(
|
250 |
+
'~width="(\d+)"~i',
|
251 |
+
'width="' . $customWidth . '"',
|
252 |
+
$parsedContent
|
253 |
+
);
|
254 |
+
} elseif (preg_match('~width="({.+})"~i', $parsedContent)) {
|
255 |
+
// this block was needed for twitch that has width="{width}" in iframe
|
256 |
+
$parsedContent = preg_replace(
|
257 |
+
'~width="({.+})"~i',
|
258 |
+
'width="' . $customWidth . '"',
|
259 |
+
$parsedContent
|
260 |
+
);
|
261 |
}
|
262 |
|
263 |
+
if (preg_match('~height="(\d+)"~i', $parsedContent)) {
|
264 |
+
$parsedContent = preg_replace(
|
265 |
+
'~height="(\d+)"~i',
|
266 |
+
'height="' . $customHeight . '"',
|
267 |
+
$parsedContent
|
268 |
+
);
|
269 |
+
} elseif (preg_match('~height="({.+})"~i', $parsedContent)) {
|
270 |
+
$parsedContent = preg_replace(
|
271 |
+
'~height="({.+})"~i',
|
272 |
+
'height="' . $customHeight . '"',
|
273 |
+
$parsedContent
|
274 |
+
);
|
275 |
}
|
276 |
|
277 |
+
if (preg_match('~width\s+:\s+(\d+)~i', $parsedContent)) {
|
278 |
+
$parsedContent = preg_replace(
|
279 |
+
'~width\s+:\s+(\d+)~i',
|
280 |
+
'width: ' . $customWidth,
|
281 |
+
$parsedContent
|
282 |
+
);
|
283 |
}
|
284 |
|
285 |
+
if (preg_match('~height\s+:\s+(\d+)~i', $parsedContent)) {
|
286 |
+
$parsedContent = preg_replace(
|
287 |
+
'~height\s+:\s+(\d+)~i',
|
288 |
+
'height: ' . $customHeight,
|
289 |
+
$parsedContent
|
290 |
+
);
|
291 |
}
|
292 |
+
if ('gfycat' === $provider_name && preg_match('~height\s*:\s*auto\s*;~i', $parsedContent)) {
|
293 |
+
$parsedContent = preg_replace(
|
294 |
+
'~height\s*:\s*auto\s*~i',
|
295 |
+
'height: ' . $customHeight . 'px',
|
296 |
+
$parsedContent
|
297 |
+
);
|
298 |
+
$parsedContent = preg_replace(
|
299 |
+
'~style="position:relative;padding-bottom(.+?)"~i',
|
300 |
+
'',
|
301 |
+
$parsedContent
|
302 |
+
);
|
303 |
$styles = "<style>
|
304 |
.ose-gfycat.ose-embedpress-responsive{
|
305 |
position: relative;
|
310 |
}
|
311 |
}
|
312 |
|
313 |
+
|
314 |
+
|
315 |
+
|
316 |
+
if ('the-new-york-times' === $provider_name && isset($customAttributes['height']) && isset($customAttributes['width'])) {
|
317 |
+
$styles = <<<KAMAL
|
318 |
<style>
|
319 |
.ose-the-new-york-times iframe{
|
320 |
min-height: auto;
|
325 |
}
|
326 |
</style>
|
327 |
KAMAL;
|
328 |
+
$styles = str_replace(['{height}', '{width}'], [$customAttributes['height'], $customAttributes['width']], $styles);
|
329 |
+
$parsedContent = $styles . $parsedContent;
|
330 |
}
|
331 |
|
332 |
+
if ($stripNewLine) {
|
333 |
+
$parsedContent = preg_replace('/\n/', '', $parsedContent);
|
334 |
}
|
335 |
|
336 |
|
337 |
+
$parsedContent = apply_filters('pp_embed_parsed_content', $parsedContent, $urlData, self::get_oembed_attributes());
|
338 |
|
339 |
+
if (!empty($parsedContent)) {
|
340 |
+
$embed = (object) array_merge((array) $urlData, [
|
341 |
'attributes' => (object) self::get_oembed_attributes(),
|
342 |
'embed' => $parsedContent,
|
343 |
'url' => $url,
|
344 |
+
]);
|
345 |
+
|
346 |
+
$embed = self::modify_spotify_content($embed);
|
347 |
+
$embed = apply_filters('embedpress:onAfterEmbed', $embed);
|
348 |
return $embed;
|
349 |
}
|
350 |
}
|
351 |
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
return $subject;
|
356 |
}
|
357 |
|
358 |
+
protected static function get_oembed()
|
359 |
+
{
|
360 |
+
if (!self::$oEmbedInstance) {
|
361 |
+
global $wp_version;
|
362 |
+
if (version_compare($wp_version, '5.3.0', '>=')) {
|
363 |
+
require_once ABSPATH . 'wp-includes/class-wp-oembed.php';
|
364 |
+
} else {
|
365 |
+
require_once ABSPATH . 'wp-includes/class-oembed.php';
|
366 |
+
}
|
367 |
+
self::$oEmbedInstance = _wp_oembed_get_object();
|
368 |
+
}
|
369 |
+
return self::$oEmbedInstance;
|
370 |
+
}
|
371 |
+
|
372 |
+
protected static function set_default_size(&$customAttributes)
|
373 |
+
{
|
374 |
+
|
375 |
+
$plgSettings = Core::getSettings();
|
376 |
+
|
377 |
+
|
378 |
+
if (empty($customAttributes['width'])) {
|
379 |
+
$customAttributes['width'] = !empty($plgSettings->enableEmbedResizeWidth) ? $plgSettings->enableEmbedResizeWidth : 600;
|
380 |
+
}
|
381 |
+
if (empty($customAttributes['height'])) {
|
382 |
+
$customAttributes['height'] = !empty($plgSettings->enableEmbedResizeHeight) ? $plgSettings->enableEmbedResizeHeight : 550;
|
383 |
+
}
|
384 |
}
|
385 |
|
386 |
+
protected static function get_url_data($url, $attributes = [], $serviceProvider = '')
|
387 |
+
{
|
388 |
+
if (!empty($serviceProvider)) {
|
389 |
+
$urlData = self::get_oembed()->fetch($serviceProvider, $url, $attributes);
|
390 |
+
} else {
|
391 |
+
$urlData = self::get_embera_instance()->getUrlData($url);
|
392 |
+
}
|
393 |
+
|
394 |
+
return $urlData;
|
395 |
}
|
396 |
|
397 |
+
// self::$attributes_data = self::$ombed_attributes;
|
398 |
+
|
399 |
+
public static function getAttributesData(){
|
400 |
+
self::$attributes_data = self::get_oembed_attributes();
|
401 |
+
// return self::get_oembed_attributes();
|
402 |
+
return self::$attributes_data;
|
|
|
403 |
}
|
404 |
|
405 |
+
|
406 |
+
/**
|
407 |
+
* @return null|Embera
|
408 |
+
*/
|
409 |
+
public static function get_embera_instance()
|
410 |
+
{
|
411 |
+
if (!self::$embera_instance) {
|
412 |
+
$additionalServiceProviders = Core::getAdditionalServiceProviders();
|
413 |
+
if (!empty($additionalServiceProviders)) {
|
414 |
+
foreach ($additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls) {
|
415 |
+
self::addServiceProvider($serviceProviderClassName, $serviceProviderUrls);
|
416 |
+
}
|
417 |
+
unset($serviceProviderUrls, $serviceProviderClassName);
|
418 |
+
}
|
419 |
+
self::$embera_instance = new Embera(self::get_embera_settings(), self::get_collection());
|
420 |
+
} else {
|
421 |
self::$embera_instance->setConfig(self::get_embera_settings());
|
422 |
}
|
423 |
+
return self::$embera_instance;
|
424 |
}
|
425 |
|
426 |
/**
|
433 |
* @static
|
434 |
*
|
435 |
*/
|
436 |
+
public static function addServiceProvider($className, $reference)
|
437 |
+
{
|
438 |
+
if (empty($className) || empty($reference)) {
|
439 |
return false;
|
440 |
}
|
441 |
|
442 |
if (is_null(self::$collection)) {
|
443 |
self::$collection = new DefaultProviderCollection();
|
444 |
}
|
445 |
+
if (is_string($reference)) {
|
446 |
+
self::$collection->addProvider($reference, $className);
|
447 |
return self::$collection;
|
448 |
+
} elseif (is_array($reference)) {
|
449 |
+
foreach ($reference as $serviceProviderUrl) {
|
450 |
+
self::addServiceProvider($className, $serviceProviderUrl);
|
451 |
}
|
452 |
return self::$collection;
|
453 |
} else {
|
465 |
* @static
|
466 |
*
|
467 |
*/
|
468 |
+
public static function parseContentAttributesFromString($subject)
|
469 |
+
{
|
470 |
$customAttributes = [];
|
471 |
+
if (preg_match('/\[embed\s*(.*?)\]/i', stripslashes($subject), $m)) {
|
472 |
+
if (preg_match_all('/(\!?\w+-?\w*)(?:="(.+?)")?/i', stripslashes($m[1]), $matches)) {
|
473 |
+
$attributes = $matches[1];
|
474 |
+
$attrValues = $matches[2];
|
475 |
|
476 |
+
foreach ($attributes as $attrIndex => $attrName) {
|
477 |
+
$customAttributes[$attrName] = $attrValues[$attrIndex];
|
478 |
}
|
479 |
}
|
480 |
}
|
493 |
* @static
|
494 |
*
|
495 |
*/
|
496 |
+
|
497 |
+
private static function parseContentAttributes(array $customAttributes, $content_uid = null)
|
498 |
+
{
|
499 |
+
|
500 |
$attributes = [
|
501 |
'class' => ["embedpress-wrapper ose-embedpress-responsive"],
|
502 |
];
|
503 |
|
504 |
$embedShouldBeResponsive = true;
|
505 |
$embedShouldHaveCustomDimensions = false;
|
506 |
+
if (!empty($customAttributes)) {
|
507 |
+
if (isset($customAttributes['class'])) {
|
508 |
+
if (!empty($customAttributes['class'])) {
|
509 |
+
$customAttributes['class'] = explode(' ', $customAttributes['class']);
|
510 |
|
511 |
+
$attributes['class'] = array_merge($attributes['class'], $customAttributes['class']);
|
512 |
}
|
513 |
|
514 |
+
unset($customAttributes['class']);
|
515 |
}
|
516 |
|
517 |
+
if (isset($customAttributes['width'])) {
|
518 |
+
if (!empty($customAttributes['width'])) {
|
519 |
+
$attributes['width'] = (int) $customAttributes['width'];
|
520 |
$embedShouldHaveCustomDimensions = true;
|
521 |
}
|
522 |
}
|
523 |
|
524 |
+
if (isset($customAttributes['height'])) {
|
525 |
+
if (!empty($customAttributes['height'])) {
|
526 |
+
$attributes['height'] = (int) $customAttributes['height'];
|
527 |
$embedShouldHaveCustomDimensions = true;
|
528 |
}
|
529 |
}
|
530 |
|
531 |
+
if (!empty($customAttributes)) {
|
532 |
$attrNameDefaultPrefix = "data-";
|
533 |
+
foreach ($customAttributes as $attrName => $attrValue) {
|
534 |
+
if (is_numeric($attrName)) {
|
535 |
$attrName = $attrValue;
|
536 |
$attrValue = "";
|
537 |
}
|
538 |
|
539 |
+
$attrName = str_replace($attrNameDefaultPrefix, "", $attrName);
|
540 |
|
541 |
+
if (!strlen($attrValue)) {
|
542 |
+
if ($attrName[0] === "!") {
|
543 |
$attrValue = "false";
|
544 |
+
$attrName = substr($attrName, 1);
|
545 |
} else {
|
546 |
$attrValue = "true";
|
547 |
}
|
548 |
}
|
549 |
|
550 |
+
$attributes[$attrNameDefaultPrefix . $attrName] = $attrValue;
|
551 |
}
|
552 |
}
|
553 |
|
554 |
// Check if there's any "responsive" parameter
|
555 |
$responsiveAttributes = ["responsive", "data-responsive"];
|
556 |
+
foreach ($responsiveAttributes as $responsiveAttr) {
|
557 |
+
if (isset($attributes[$responsiveAttr])) {
|
558 |
+
if (!strlen($attributes[$responsiveAttr])) { // If the parameter is passed but have no value, it will be true by default
|
559 |
$embedShouldBeResponsive = true;
|
560 |
} else {
|
561 |
+
$embedShouldBeResponsive = !self::valueIsFalse($attributes[$responsiveAttr]);
|
562 |
}
|
563 |
|
564 |
break;
|
565 |
}
|
566 |
}
|
567 |
+
unset($responsiveAttr, $responsiveAttributes);
|
568 |
}
|
569 |
|
570 |
+
$attributes['class'][] = 'ose-{provider_alias}';
|
571 |
|
572 |
+
if (!empty($content_uid)) {
|
573 |
+
$attributes['class'][] = 'ose-uid-' . $content_uid;
|
574 |
}
|
575 |
|
576 |
+
if ($embedShouldBeResponsive && !$embedShouldHaveCustomDimensions) {
|
577 |
+
$attributes['class'][] = 'responsive';
|
578 |
} else {
|
579 |
+
$attributes['data-responsive'] = "false";
|
580 |
}
|
581 |
|
582 |
+
$attributes['class'] = implode(' ', array_unique(array_filter($attributes['class'])));
|
583 |
+
if (isset($attributes['width'])) {
|
584 |
+
$attributes['style'] = "width:{$attributes['width']}px;height:{$attributes['height']}px;";
|
585 |
}
|
586 |
|
587 |
return $attributes;
|
588 |
}
|
589 |
|
590 |
+
protected static function set_embera_settings(&$attributes)
|
591 |
+
{
|
592 |
+
|
593 |
+
if (isset($attributes['width']) || isset($attributes['height'])) {
|
594 |
+
if (isset($attributes['width'])) {
|
595 |
+
self::$emberaInstanceSettings['maxwidth'] = $attributes['width'];
|
596 |
+
self::$emberaInstanceSettings['width'] = $attributes['width'];
|
597 |
+
unset($attributes['width']);
|
598 |
+
}
|
599 |
|
600 |
+
if (isset($attributes['height'])) {
|
601 |
+
self::$emberaInstanceSettings['maxheight'] = $attributes['height'];
|
602 |
+
self::$emberaInstanceSettings['height'] = $attributes['height'];
|
603 |
+
unset($attributes['height']);
|
604 |
+
}
|
605 |
+
}
|
606 |
|
607 |
+
foreach ($attributes as $key => $value) {
|
608 |
+
if(strpos($key, 'data-') === 0){
|
609 |
+
$key = str_replace('data-', '', $key);
|
610 |
+
self::$emberaInstanceSettings[$key] = $value;
|
611 |
+
}
|
612 |
+
}
|
613 |
|
614 |
}
|
615 |
|
616 |
+
protected static function get_embera_settings()
|
617 |
+
{
|
618 |
+
return self::$emberaInstanceSettings;
|
619 |
+
}
|
620 |
+
|
621 |
+
public static function get_block_controls_data(){
|
622 |
+
var_dump(self::$emberaInstanceSettings);
|
623 |
}
|
624 |
|
625 |
/**
|
632 |
* @static
|
633 |
*
|
634 |
*/
|
635 |
+
|
636 |
+
public static function valueIsFalse($subject)
|
637 |
+
{
|
638 |
+
$subject = strtolower(trim((string) $subject));
|
639 |
+
switch ($subject) {
|
640 |
case "0":
|
641 |
case "false":
|
642 |
case "off":
|
663 |
* @static
|
664 |
*
|
665 |
*/
|
666 |
+
private static function extractContentFromHeaderAsArray($headerPattern, $headersList)
|
667 |
+
{
|
668 |
$headerValue = null;
|
669 |
|
670 |
+
foreach ($headersList as $header) {
|
671 |
+
if (preg_match($headerPattern, $header, $matches)) {
|
672 |
+
$headerValue = $matches[1];
|
673 |
break;
|
674 |
}
|
675 |
}
|
690 |
* @static
|
691 |
*
|
692 |
*/
|
693 |
+
private static function sanitizeUrlData($data, $url = '')
|
694 |
+
{
|
695 |
+
if (is_object($data)) {
|
696 |
+
$attributes = get_object_vars($data);
|
697 |
|
698 |
+
foreach ($attributes as $key => $value) {
|
699 |
+
if (substr_count($key, '-') && $key !== $url) {
|
700 |
+
unset($data->$key);
|
701 |
|
702 |
+
$key = str_replace('-', '_', $key);
|
703 |
$data->$key = $value;
|
704 |
}
|
705 |
}
|
706 |
+
} elseif (is_array($data)) {
|
707 |
+
foreach ($data as $key => $value) {
|
708 |
+
if (substr_count($key, '-') && $key !== $url) {
|
709 |
+
unset($data[$key]);
|
710 |
|
711 |
+
$key = str_replace('-', '_', $key);
|
712 |
+
$data[$key] = $value;
|
713 |
}
|
714 |
}
|
715 |
}
|
722 |
return self::$collection;
|
723 |
}
|
724 |
|
725 |
+
protected static function purify_html_content(&$html)
|
726 |
+
{
|
727 |
+
if (!class_exists('\simple_html_dom')) {
|
728 |
+
include_once EMBEDPRESS_PATH_CORE . 'simple_html_dom.php';
|
729 |
+
}
|
730 |
+
|
731 |
+
$dom = str_get_html($html);
|
732 |
+
$ifDom = $dom->find('iframe', 0);
|
733 |
+
if (!empty($ifDom) && is_object($ifDom)) {
|
734 |
+
$ifDom->removeAttribute('sandbox');
|
735 |
+
}
|
736 |
+
|
737 |
+
ob_start();
|
738 |
+
echo $dom;
|
739 |
+
return ob_get_clean();
|
740 |
+
}
|
741 |
+
|
742 |
+
protected static function get_content_from_template($url, $template, $serviceProvider)
|
743 |
+
{
|
744 |
+
if (is_embedpress_pro_active()) {
|
745 |
+
if (strpos($url, 'podcasts.apple.com')) {
|
746 |
+
$iframe_url = str_replace('podcasts.apple.com', 'embed.podcasts.apple.com', $url);
|
747 |
+
$html = '<iframe allow="autoplay *; encrypted-media *; fullscreen *" frameborder="0" height="175" style="width:100%;max-width:660px;overflow:hidden;background:transparent;" src="' . esc_url($iframe_url) . '"></iframe>';
|
748 |
+
return str_replace('{html}', $html, $template);
|
749 |
+
}
|
750 |
+
}
|
751 |
+
|
752 |
+
if (empty($serviceProvider)) {
|
753 |
+
$html = '';
|
754 |
+
} else {
|
755 |
+
$html = self::get_oembed()->get_html($url, self::get_oembed_attributes());
|
756 |
+
}
|
757 |
+
|
758 |
+
if (!$html) {
|
759 |
+
$html = self::get_embera_instance()->autoEmbed($url);
|
760 |
+
}
|
761 |
+
return str_replace('{html}', $html, $template);
|
762 |
+
}
|
763 |
+
|
764 |
+
protected static function get_oembed_attributes()
|
765 |
+
{
|
766 |
+
|
767 |
+
return self::$ombed_attributes;
|
768 |
+
}
|
769 |
+
protected static function set_oembed_attributes($atts)
|
770 |
+
{
|
771 |
+
self::$ombed_attributes = $atts;
|
772 |
+
}
|
773 |
+
|
774 |
+
protected static function check_for_google_url(&$url)
|
775 |
+
{
|
776 |
+
if (preg_match('/http[s]?:\/\/goo\.gl\/(?:([a-z]+)\/)?[a-z0-9]+\/?$/i', $url, $matches)) {
|
777 |
+
// Fetch all headers from the short-url so we can know how to handle its original content depending on the service.
|
778 |
+
$headers = get_headers($url);
|
779 |
+
|
780 |
+
$supportedServicesHeadersPatterns = [
|
781 |
+
'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i',
|
782 |
+
];
|
783 |
+
|
784 |
+
$service = isset($matches[1]) ? strtolower($matches[1]) : null;
|
785 |
+
// No specific service was found in the url.
|
786 |
+
if (empty($service)) {
|
787 |
+
// Let's try to guess which service the original url belongs to.
|
788 |
+
foreach ($headers as $header) {
|
789 |
+
// Check if the short-url reffers to a Google Maps url.
|
790 |
+
if (preg_match($supportedServicesHeadersPatterns['maps'], $header, $matches)) {
|
791 |
+
// Replace the shortened url with its original url.
|
792 |
+
$url = $matches[1];
|
793 |
+
break;
|
794 |
+
}
|
795 |
+
}
|
796 |
+
unset($header);
|
797 |
+
} else {
|
798 |
+
// Check if the Google service is supported atm.
|
799 |
+
if (isset($supportedServicesHeadersPatterns[$service])) {
|
800 |
+
// Tries to extract the url based on its headers.
|
801 |
+
$originalUrl = self::extractContentFromHeaderAsArray(
|
802 |
+
$supportedServicesHeadersPatterns[$service],
|
803 |
+
$headers
|
804 |
+
);
|
805 |
+
// Replace the shortened url with its original url if the specific header was found.
|
806 |
+
if (!empty($originalUrl)) {
|
807 |
+
$url = $originalUrl;
|
808 |
+
}
|
809 |
+
unset($originalUrl);
|
810 |
+
}
|
811 |
+
}
|
812 |
+
unset($service, $supportedServicesHeadersPatterns, $headers, $matches);
|
813 |
+
}
|
814 |
+
}
|
815 |
+
|
816 |
+
protected static function get_provider_name($urlData, $url)
|
817 |
+
{
|
818 |
+
$provider_name = '';
|
819 |
+
if (isset($urlData->provider_name)) {
|
820 |
+
$provider_name = str_replace([' ', ','], '-', strtolower($urlData->provider_name));
|
821 |
+
} elseif (is_array($urlData) && !empty($urlData)) {
|
822 |
+
$data = array_shift($urlData);
|
823 |
+
if (isset($data['provider_name'])) {
|
824 |
+
$provider_name = str_replace([' ', ','], '-', strtolower($data['provider_name']));
|
825 |
+
}
|
826 |
+
}
|
827 |
+
return $provider_name;
|
828 |
+
}
|
829 |
+
|
830 |
+
protected static function modify_content_for_fb_and_canada($provider_name, &$html)
|
831 |
+
{
|
832 |
+
if (!empty($provider_name)) {
|
833 |
+
// NFB seems to always return their embed code with all HTML entities into their applicable characters string.
|
834 |
+
$PROVIDER_NAME_IN_CAP = strtoupper($provider_name);
|
835 |
+
if ($PROVIDER_NAME_IN_CAP === "NATIONAL FILM BOARD OF CANADA") {
|
836 |
+
$html = html_entity_decode($html);
|
837 |
+
} elseif ($PROVIDER_NAME_IN_CAP === "FACEBOOK") {
|
838 |
+
$plgSettings = Core::getSettings();
|
839 |
+
|
840 |
+
// Check if the user wants to force a certain language into Facebook embeds.
|
841 |
+
$locale = isset($plgSettings->fbLanguage) && !empty($plgSettings->fbLanguage) ? $plgSettings->fbLanguage : false;
|
842 |
+
if (!!$locale) {
|
843 |
+
// Replace the automatically detected language by Facebook's API with the language chosen by the user.
|
844 |
+
$html = preg_replace(
|
845 |
+
'/\/[a-z]{2}\_[a-z]{2}\/sdk\.js/i',
|
846 |
+
"/{$locale}/sdk.js",
|
847 |
+
$html
|
848 |
+
);
|
849 |
+
}
|
850 |
+
|
851 |
+
// Make sure `adapt_container_width` parameter is set to false. Setting to true, as it is by default, might cause Facebook to render embeds inside editors (in admin) with only 180px wide.
|
852 |
+
if (is_admin()) {
|
853 |
+
$html = preg_replace(
|
854 |
+
'~data\-adapt\-container\-width=\"(?:true|1)\"~i',
|
855 |
+
'data-adapt-container-width="0"',
|
856 |
+
$html
|
857 |
+
);
|
858 |
+
}
|
859 |
+
|
860 |
+
unset($locale, $plgSettings);
|
861 |
+
}
|
862 |
+
}
|
863 |
+
}
|
864 |
|
865 |
+
public static function modify_spotify_content($embed)
|
866 |
+
{
|
867 |
+
$should_modify = apply_filters('embedpress_should_modify_spotify', true);
|
868 |
+
$isSpotify = (isset($embed->provider_name) && strtoupper($embed->provider_name) === 'SPOTIFY') || (isset($embed->url) && isset($embed->{$embed->url}) && isset($embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name']) === 'SPOTIFY');
|
869 |
+
if (
|
870 |
+
$should_modify && $isSpotify && isset($embed->embed)
|
871 |
+
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
|
872 |
+
) {
|
873 |
+
$options = (array) get_option(EMBEDPRESS_PLG_NAME . ':spotify');
|
874 |
+
// Parse the url to retrieve all its info like variables etc.
|
875 |
+
$url_full = $match[1];
|
876 |
+
$modified_url = str_replace('playlist-v2', 'playlist', $url_full);
|
877 |
+
if (isset($options['theme'])) {
|
878 |
+
if (strpos($modified_url, '?') !== false) {
|
879 |
+
$modified_url .= '&theme=' . sanitize_text_field($options['theme']);
|
880 |
+
} else {
|
881 |
+
$modified_url .= '?theme=' . sanitize_text_field($options['theme']);
|
882 |
+
}
|
883 |
+
}
|
884 |
|
885 |
+
// Replaces the old url with the new one.
|
886 |
+
$embed->embed = str_replace($url_full, $modified_url, $embed->embed);
|
887 |
+
}
|
888 |
+
return $embed;
|
889 |
}
|
890 |
|
891 |
+
public static function do_shortcode_pdf($attributes = [], $subject = null)
|
892 |
+
{
|
893 |
+
$plgSettings = Core::getSettings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
|
895 |
$default = [
|
896 |
'width' => $plgSettings->enableEmbedResizeWidth,
|
897 |
'height' => $plgSettings->enableEmbedResizeHeight,
|
898 |
'powered_by' => 'no',
|
899 |
];
|
900 |
+
$attributes = wp_parse_args($attributes, $default);
|
901 |
+
|
902 |
+
$url = preg_replace(
|
903 |
+
'/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
|
904 |
+
"",
|
905 |
+
$subject
|
906 |
+
);
|
907 |
|
908 |
ob_start();
|
909 |
|
910 |
$id = 'embedpress-pdf-shortcode';
|
911 |
$dimension = "width: {$attributes['width']}px;height: {$attributes['height']}px";
|
912 |
?>
|
913 |
+
<div class="embedpress-document-embed ose-document <?php echo 'ep-doc-' . md5($id); ?>" style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block">
|
914 |
+
<?php if ($url != '') {
|
915 |
+
if (self::is_pdf($url) && !self::is_external_url($url)) {
|
916 |
+
$renderer = Helper::get_pdf_renderer();
|
917 |
+
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . $url;
|
918 |
+
?>
|
919 |
+
<iframe style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block" data-emsrc="<?php echo esc_attr($url); ?>" data-emid="<?php echo esc_attr($id); ?>" class="embedpress-embed-document-pdf <?php echo esc_attr($id); ?>" src="<?php echo esc_attr($src); ?>" frameborder="0"></iframe>
|
|
|
920 |
<?php
|
921 |
|
922 |
+
} else {
|
923 |
+
?>
|
924 |
<div>
|
925 |
+
<iframe allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr($dimension); ?>; max-width:100%;" src="<?php echo esc_url($url); ?>" data-emsrc="<?php echo esc_attr($url); ?>" data-emid="<?php echo esc_attr($id); ?>" class="embedpress-embed-document-pdf <?php echo esc_attr($id); ?>"></iframe>
|
926 |
</div>
|
927 |
|
928 |
+
<?php
|
929 |
+
}
|
930 |
+
if ($attributes['powered_by'] === 'yes') {
|
931 |
+
printf('<p class="embedpress-el-powered">%s</p>', __('Powered By EmbedPress', 'embedpress'));
|
932 |
+
}
|
933 |
+
}
|
934 |
+
?>
|
935 |
+
</div>
|
936 |
|
937 |
+
<?php
|
|
|
|
|
|
|
|
|
938 |
|
|
|
|
|
|
|
939 |
|
940 |
+
return ob_get_clean();
|
941 |
+
}
|
942 |
+
|
943 |
+
protected static function is_external_url($url)
|
944 |
+
{
|
945 |
+
return strpos($url, get_site_url()) === false;
|
946 |
+
}
|
947 |
+
|
948 |
+
protected static function is_pdf($url)
|
949 |
+
{
|
950 |
+
$arr = explode('.', $url);
|
951 |
+
return end($arr) === 'pdf';
|
952 |
+
}
|
953 |
+
|
954 |
|
|
|
|
|
|
|
|
|
955 |
}
|
|
Gutenberg/block-backend/block-embedpress.php
CHANGED
@@ -1,15 +1,24 @@
|
|
1 |
<?php
|
2 |
// Exit if accessed directly.
|
3 |
-
|
|
|
|
|
|
|
4 |
exit;
|
5 |
}
|
6 |
/**
|
7 |
* It renders gutenberg block of embedpress on the frontend
|
8 |
* @param array $attributes
|
9 |
*/
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$aligns = [
|
14 |
'left' => 'alignleft',
|
15 |
'right' => 'alignright',
|
@@ -17,11 +26,12 @@ function embedpress_render_block($attributes){
|
|
17 |
'full' => 'alignfull',
|
18 |
'center' => 'aligncenter',
|
19 |
];
|
20 |
-
if (
|
21 |
-
$alignment = isset($aligns[$attributes['align']]) ? $aligns[$attributes['align']] .' clear' : '';
|
22 |
-
}else{
|
23 |
$alignment = 'aligncenter'; // default alignment is center in js, so keeping same here
|
24 |
}
|
|
|
25 |
ob_start();
|
26 |
?>
|
27 |
<div class="embedpress-gutenberg-wrapper">
|
@@ -29,7 +39,36 @@ function embedpress_render_block($attributes){
|
|
29 |
<?php echo $embed; ?>
|
30 |
</div>
|
31 |
</div>
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
return ob_get_clean();
|
34 |
}
|
35 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
// Exit if accessed directly.
|
3 |
+
|
4 |
+
use EmbedPress\Providers\Youtube;
|
5 |
+
|
6 |
+
if (!defined('ABSPATH')) {
|
7 |
exit;
|
8 |
}
|
9 |
/**
|
10 |
* It renders gutenberg block of embedpress on the frontend
|
11 |
* @param array $attributes
|
12 |
*/
|
13 |
+
|
14 |
+
|
15 |
+
function embedpress_render_block($attributes)
|
16 |
+
{
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
if (!empty($attributes['embedHTML'])) {
|
21 |
+
$embed = apply_filters('embedpress_gutenberg_embed', $attributes['embedHTML'], $attributes);
|
22 |
$aligns = [
|
23 |
'left' => 'alignleft',
|
24 |
'right' => 'alignright',
|
26 |
'full' => 'alignfull',
|
27 |
'center' => 'aligncenter',
|
28 |
];
|
29 |
+
if (isset($attributes['align'])) {
|
30 |
+
$alignment = isset($aligns[$attributes['align']]) ? $aligns[$attributes['align']] . ' clear' : '';
|
31 |
+
} else {
|
32 |
$alignment = 'aligncenter'; // default alignment is center in js, so keeping same here
|
33 |
}
|
34 |
+
|
35 |
ob_start();
|
36 |
?>
|
37 |
<div class="embedpress-gutenberg-wrapper">
|
39 |
<?php echo $embed; ?>
|
40 |
</div>
|
41 |
</div>
|
42 |
+
<?php
|
43 |
+
|
44 |
+
|
45 |
+
echo embedpress_render_block_style($attributes, 'youtube');
|
46 |
+
|
47 |
return ob_get_clean();
|
48 |
}
|
49 |
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Make style function for embedpress render block
|
53 |
+
*/
|
54 |
+
|
55 |
+
function embedpress_render_block_style($attributes, $providers)
|
56 |
+
{
|
57 |
+
if ($providers === 'youtube') {
|
58 |
+
$uniqid = '.ose-uid-' . md5($attributes['url']);
|
59 |
+
$youtubeStyles = '<style>
|
60 |
+
' . esc_attr($uniqid) . ' {
|
61 |
+
width: ' . esc_attr($attributes['width']) . 'px !important;
|
62 |
+
height: ' . esc_attr($attributes['height']) . 'px;
|
63 |
+
}
|
64 |
+
|
65 |
+
' . esc_attr($uniqid) . '>iframe {
|
66 |
+
height: ' . esc_attr($attributes['height']) . 'px !important;
|
67 |
+
max-height: ' . esc_attr($attributes['height']) . 'px !important;
|
68 |
+
width: 100%;
|
69 |
+
}
|
70 |
+
</style>';
|
71 |
+
|
72 |
+
return $youtubeStyles;
|
73 |
+
}
|
74 |
+
}
|
Gutenberg/block-backend/block-youtube.php
CHANGED
@@ -17,9 +17,10 @@ function embedpress_gutenberg_render_block_youtube( $attributes )
|
|
17 |
foreach ( $youtube_params as $param => $value ) {
|
18 |
$iframeUrl = add_query_arg( $param, $value, $iframeUrl );
|
19 |
}
|
|
|
20 |
|
21 |
?>
|
22 |
-
<div class="ose-youtube wp-block-embed-youtube <?php echo $align; ?>">
|
23 |
<iframe src="<?php echo $iframeUrl; ?>"
|
24 |
allowtransparency="true"
|
25 |
allowfullscreen="true"
|
17 |
foreach ( $youtube_params as $param => $value ) {
|
18 |
$iframeUrl = add_query_arg( $param, $value, $iframeUrl );
|
19 |
}
|
20 |
+
|
21 |
|
22 |
?>
|
23 |
+
<div class="ose-youtube wp-block-embed-youtube ose-youtube-single-video <?php echo $align; ?>">
|
24 |
<iframe src="<?php echo $iframeUrl; ?>"
|
25 |
allowtransparency="true"
|
26 |
allowfullscreen="true"
|
Gutenberg/dist/blocks.build.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";n.d(t,"e",function(){return a}),n.d(t,"j",function(){return c}),n.d(t,"i",function(){return s}),n.d(t,"g",function(){return u}),n.d(t,"f",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return h}),n.d(t,"b",function(){return b}),n.d(t,"d",function(){return w}),n.d(t,"c",function(){return y}),n.d(t,"a",function(){return v});var r=wp.components,i=r.G,o=r.Path,l=(r.Polygon,r.SVG),a=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(o,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(o,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(o,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(o,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(o,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(o,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),c=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",enableBackground:"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(o,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(o,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(o,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(o,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(o,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(o,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(o,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(o,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}}))),s=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(o,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(o,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(o,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(o,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(o,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(o,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(o,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(o,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(o,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(o,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(o,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(o,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(o,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(o,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(o,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(o,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(o,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(o,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(o,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(l,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"}," ",wp.element.createElement(i,null,wp.element.createElement(o,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(o,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(l,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(o,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),b=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"})))),w=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270",role:"img",focusable:"false"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"}))),y=wp.element.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 512 512"},wp.element.createElement("path",{fill:"#E2E5E7",d:"M128,0c-17.6,0-32,14.4-32,32v448c0,17.6,14.4,32,32,32h320c17.6,0,32-14.4,32-32V128L352,0H128z"}),wp.element.createElement("path",{fill:"#B0B7BD",d:"M384,128h96L352,0v96C352,113.6,366.4,128,384,128z"}),wp.element.createElement("polygon",{fill:"#CAD1D8",points:"480,224 384,128 480,128 "}),wp.element.createElement("path",{fill:"#F15642",d:"M416,416c0,8.8-7.2,16-16,16H48c-8.8,0-16-7.2-16-16V256c0-8.8,7.2-16,16-16h352c8.8,0,16,7.2,16,16 V416z"}),wp.element.createElement("g",null,wp.element.createElement("path",{fill:"#FFFFFF",d:"M101.744,303.152c0-4.224,3.328-8.832,8.688-8.832h29.552c16.64,0,31.616,11.136,31.616,32.48 c0,20.224-14.976,31.488-31.616,31.488h-21.36v16.896c0,5.632-3.584,8.816-8.192,8.816c-4.224,0-8.688-3.184-8.688-8.816V303.152z M118.624,310.432v31.872h21.36c8.576,0,15.36-7.568,15.36-15.504c0-8.944-6.784-16.368-15.36-16.368H118.624z"}),wp.element.createElement("path",{fill:"#FFFFFF",d:"M196.656,384c-4.224,0-8.832-2.304-8.832-7.92v-72.672c0-4.592,4.608-7.936,8.832-7.936h29.296 c58.464,0,57.184,88.528,1.152,88.528H196.656z M204.72,311.088V368.4h21.232c34.544,0,36.08-57.312,0-57.312H204.72z"}),wp.element.createElement("path",{fill:"#FFFFFF",d:"M303.872,312.112v20.336h32.624c4.608,0,9.216,4.608,9.216,9.072c0,4.224-4.608,7.68-9.216,7.68 h-32.624v26.864c0,4.48-3.184,7.92-7.664,7.92c-5.632,0-9.072-3.44-9.072-7.92v-72.672c0-4.592,3.456-7.936,9.072-7.936h44.912 c5.632,0,8.96,3.344,8.96,7.936c0,4.096-3.328,8.704-8.96,8.704h-37.248V312.112z"})),wp.element.createElement("path",{fill:"#CAD1D8",d:"M400,432H96v16h304c8.8,0,16-7.2,16-16v-16C416,424.8,408.8,432,400,432z"})),v=wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"186 38 76 76"},wp.element.createElement("path",{fill:"#fff",d:"M244 56h-40v40h40V56z"}),wp.element.createElement("path",{fill:"#EA4335",d:"M244 114l18-18h-18v18z"}),wp.element.createElement("path",{fill:"#FBBC04",d:"M262 56h-18v40h18V56z"}),wp.element.createElement("path",{fill:"#34A853",d:"M244 96h-40v18h40V96z"}),wp.element.createElement("path",{fill:"#188038",d:"M186 96v12c0 3.315 2.685 6 6 6h12V96h-18z"}),wp.element.createElement("path",{fill:"#1967D2",d:"M262 56V44c0-3.315-2.685-6-6-6h-12v18h18z"}),wp.element.createElement("path",{fill:"#4285F4",d:"M244 38h-52c-3.315 0 -6 2.685-6 6v52h18V56h40V38z"}),wp.element.createElement("path",{fill:"#4285F4",d:"M212.205 87.03c-1.495-1.01-2.53-2.485-3.095-4.435l3.47-1.43c.315 1.2.865 2.13 1.65 2.79.78.66 1.73.985 2.84.985 1.135 0 2.11-.345 2.925-1.035s1.225-1.57 1.225-2.635c0-1.09-.43-1.98-1.29-2.67-.86-.69-1.94-1.035-3.23-1.035h-2.005V74.13h1.8c1.11 0 2.045-.3 2.805-.9.76-.6 1.14-1.42 1.14-2.465 0 -.93-.34-1.67-1.02-2.225-.68-.555-1.54-.835-2.585-.835-1.02 0 -1.83.27-2.43.815a4.784 4.784 0 0 0 -1.31 2.005l-3.435-1.43c.455-1.29 1.29-2.43 2.515-3.415 1.225-.985 2.79-1.48 4.69-1.48 1.405 0 2.67.27 3.79.815 1.12.545 2 1.3 2.635 2.26.635.965.95 2.045.95 3.245 0 1.225-.295 2.26-.885 3.11-.59.85-1.315 1.5-2.175 1.955v.205a6.605 6.605 0 0 1 2.79 2.175c.725.975 1.09 2.14 1.09 3.5 0 1.36-.345 2.575-1.035 3.64s-1.645 1.905-2.855 2.515c-1.215.61-2.58.92-4.095.92-1.755.005-3.375-.5-4.87-1.51zM233.52 69.81l-3.81 2.755-1.905-2.89 6.835-4.93h2.62V88h-3.74V69.81z"}))},function(e,t,n){"use strict";var __=wp.i18n.__,r=wp.components.Spinner,i=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(r,null),wp.element.createElement("p",null,__("Embedding\u2026")))};t.a=i},function(e,t,n){"use strict";var __=wp.i18n.__,r=wp.element.Fragment,i=wp.components,o=i.Button,l=i.Toolbar,a=wp.blockEditor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(r,null,wp.element.createElement(a,null,wp.element.createElement(l,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:__("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=n(12),i=n.n(r),o=wp.i18n,__=o.__,_x=o._x,l=wp.components,a=l.Button,c=l.Placeholder,s=l.ExternalLink,u=wp.blockEditor.BlockIcon,p=function(e){var t=e.icon,n=e.label,r=e.value,o=e.onSubmit,l=e.onChange,p=e.cannotEmbed,m=e.docLink,d=e.DocTitle,f=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(c,{icon:wp.element.createElement(u,{icon:t,showColors:!0}),label:n,className:f},wp.element.createElement("form",{onSubmit:o},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:__("Enter URL to embed here\u2026"),onChange:l}),wp.element.createElement(a,{isSmall:!0,type:"submit"},_x("Embed","button label")),p&&wp.element.createElement("p",{className:"components-placeholder__error"},__("Sorry, we could not embed that content."),wp.element.createElement("br",null))),m&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(s,{href:m},d))))};t.a=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(6),a=n.n(l),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.myRef=React.createRef(),n}return o(t,e),s(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.myRef.current).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",c({ref:this.myRef},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";function r(e){var t=embedpressObj.document_cta,n="",r="";if(embedpressObj.embedpress_pro&&t&&t.logo_url){var o=t.cta_url?t.cta_url:null,l=t.logo_xpos?t.logo_xpos+"%":"10%",a=t.logo_ypos?t.logo_ypos+"%":"10%",c=t.logo_opacity?t.logo_opacity/100:"10%",s=".ep-doc-"+e.id;return n="\n "+s+"{\n text-align: left;\n position: relative;\n }\n "+s+" .watermark {\n \t\tdisplay:inline-block;\n border: 0;\n position: absolute;\n bottom: "+a+";\n right: "+l+";\n max-width: 150px;\n max-height: 75px;\n opacity: "+c+";\n z-index: 5;\n -o-transition: opacity 0.5s ease-in-out;\n -moz-transition: opacity 0.5s ease-in-out;\n -webkit-transition: opacity 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n }\n "+s+" .watermark:hover {\n\t\t\t\t\t opacity: 1;\n\t\t\t\t }\n\t\t",o&&""!==o&&(r+="<a href="+o+">"),r+='<img class="watermark" alt="" src="'+t.logo_url+'"/>',o&&""!==o&&(r+="</a>"),wp.element.createElement(i,null,wp.element.createElement("style",{dangerouslySetInnerHTML:{__html:n}}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))}return""}var i=wp.element.Fragment;t.a=r},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(8),n(13),n(17),n(21),n(25),n(29),n(33),n(37),n(41),n(45),n(49),n(57),n(61);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(9),i=(n.n(r),n(10)),o=(n.n(i),n(11)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-docs-block"]&&a("embedpress/google-docs-block",{title:__("Google Docs"),icon:l.e,category:"embedpress",keywords:[__("embedpress"),__("google"),__("docs")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element.Component,d=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,o=i.exec(r),l=o[1];l&&"document"===l?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Docs URL");return!m||r?wp.element.createElement("div",null,wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:__("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:m,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameBorder:"0",width:"600",height:"450"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(m);t.a=d},function(e,t,n){var r,i;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var l=n.apply(null,r);l&&e.push(l)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)o.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}var o={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t,n){"use strict";var r=n(14),i=(n.n(r),n(15)),o=(n.n(i),n(16)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-slides-block"]&&a("embedpress/google-slides-block",{title:__("Google Slides"),icon:l.j,category:"embedpress",keywords:[__("embedpress"),__("google"),__("slides")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,o=i.exec(r),l=o[1];l&&"presentation"==l?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Slides URL");return!m||r?wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.j,DocTitle:__("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(18),i=(n.n(r),n(19)),o=(n.n(i),n(20)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-sheets-block"]&&a("embedpress/google-sheets-block",{title:__("Google Sheets"),icon:l.i,category:"embedpress",keywords:[__("embedpress"),__("google"),__("sheets")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,o=i.exec(r),l=o[1];if(l&&"spreadsheets"==l){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var c=!1,s=!1;a.map(function(e){e.indexOf("widget=")?s=!0:e.indexOf("headers=")&&(c=!0)}),s||(r+="&widget=true"),c||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Sheets URL");return!m||r?wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:__("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(22),i=(n.n(r),n(23)),o=(n.n(i),n(24)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-forms-block"]&&a("embedpress/google-forms-block",{title:__("Google Forms"),icon:l.g,category:"embedpress",keywords:[__("embedpress"),__("google"),__("forms")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,o=i.exec(r),l=o[1];l&&"forms"==l?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Forms URL");return!m||r?wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:__("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d));t.a=h},function(e,t,n){"use strict";var r=n(26),i=(n.n(r),n(27)),o=(n.n(i),n(28)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-drawings-block"]&&a("embedpress/google-drawings-block",{title:__("Google Drawings"),icon:l.f,category:"embedpress",keywords:[__("embedpress"),__("google"),__("drawings")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,p=wp.element,m=p.Component,d=p.Fragment,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return o(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,o=i.exec(r),l=o[1];l&&"drawings"==l?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,u=this.props.attributes.iframeSrc,p=__("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(c.a,{label:p,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:s.f,DocTitle:__("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(d,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(l.a,{showEditButton:u&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(m);t.a=f},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(30),o=(n.n(i),n(31)),l=(n.n(o),n(32)),a=n(0),__=wp.i18n.__,c=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-maps-block"]&&c("embedpress/google-maps-block",{title:__("Google Maps"),icon:a.h,category:"embedpress",keywords:[__("embedpress"),__("google"),__("maps")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,o=i.exec(r);o&&o.length>1&&o[1]&&o[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+o[1]+"&spn="+o[1]+"&t=m&z="+Math.round(parseInt(o[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Maps URL");return!m||r?wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:__("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(34),i=(n.n(r),n(35)),o=(n.n(i),n(36)),l=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},__=wp.i18n.__,c=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["twitch-block"]&&c("embedpress/twitch-block",{title:__("Twitch"),icon:l.k,category:"embedpress",keywords:[__("embedpress"),__("twitch")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,i=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:i},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),o=r.exec(i),l=o[1];console.log(l);var a,c="channel";switch(t.indexOf("clips.twitch.tv")>-1?c="clip":t.indexOf("/videos/")>-1?c="video":t.indexOf("#/chat$#")>-1&&(c="chat"),console.log(c),c){case"channel":i="https://player.twitch.tv/?channel="+l,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+l+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":l=o[2],i="https://player.twitch.tv/?video="+l,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+l+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+l+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,m=t.interactive,d=this.props.attributes,f=d.iframeSrc,b=d.attrs,w=__("Twitch URL");if(!f||r)return wp.element.createElement(c.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.k,DocTitle:__("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var y=f+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:y},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:f&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=b},function(e,t,n){"use strict";var r=n(38),i=(n.n(r),n(39)),o=(n.n(i),n(40)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["wistia-block"]&&a("embedpress/wistia-block",{title:__("Wistia"),icon:l.l,category:"embedpress",keywords:[__("embedpress"),__("wistia")],supports:{align:["wide","full","right","left"],default:""},edit:o.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return o(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],o="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:o})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,p=t.interactive,m=this.props.attributes.iframeSrc,d=__("Wistia URL");return!m||r?wp.element.createElement(c.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.l,DocTitle:__("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(s.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:m&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(42),i=(n.n(r),n(43)),o=(n.n(i),n(44)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["youtube-block"]&&a("embedpress/youtube-block",{title:__("YouTube"),icon:l.m,category:"embedpress",keywords:[__("embedpress"),__("youtube")],supports:{align:["wide","full","right","left"],default:""},edit:o.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return o(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],o="https://www.youtube.com/embed/"+i,l=new URL(o);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)l.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:l.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,o=t.cannotEmbed,m=t.interactive,d=this.props.attributes,f=d.iframeSrc,b=d.attrs,w=__("YouTube URL");return!f||r?wp.element.createElement(c.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:o,onChange:function(t){return e.setState({url:t.target.value})},icon:u.m,DocTitle:__("Learn More About YouTube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:f},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(l.a,{showEditButton:f&&!o,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=b},function(e,t,n){"use strict";var r=n(46),i=(n.n(r),n(47)),o=(n.n(i),n(48)),l=n(0),a=n(5),__=wp.i18n.__,c=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks.document&&c("embedpress/document",{title:__("Document"),icon:l.b,category:"embedpress",keywords:[__("embedpress"),__("pdf"),__("doc"),__("ppt")],supports:{align:["wide","full","right","left"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:o.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,i=t.id,o=t.width,l=t.height,c=t.powered_by,s="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+i,style:{height:l,width:o}},"application/pdf"===r&&wp.element.createElement("div",{style:{height:l,width:o},className:"embedpress-embed-document-pdf "+i,"data-emid":i,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:l,width:o},src:s,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),c&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),embedpressObj.embedpress_pro&&wp.element.createElement(a.a,{id:i}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(4),a=n(5),c=n(1),s=n(0),u=function(){function e(e,t){var n=[],_n=!0,r=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(_n=(o=l.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,i=e}finally{try{!_n&&l.return&&l.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,b=wp.blockEditor,w=b.BlockIcon,y=b.MediaPlaceholder,v=b.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,O=k.PanelBody,S=k.ExternalLink,U=k.ToggleControl,j=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],C=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return o(t,e),p(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,o=n.href;if(f(o)){r({filesList:[d(o)],onFileChange:function(t){var n=u(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(o)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,o=t.mime,u=t.id,p=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,b=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(w,{icon:s.b}),labels:{title:__("Document"),instructions:__("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:j,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(S,{href:"https://embedpress.com/docs/embed-document/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==o?wp.element.createElement(c.a,null):null,wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+u,style:{height:m,width:p}},"application/pdf"===o&&wp.element.createElement("div",{style:{height:m,width:p},className:"embedpress-embed-document-pdf "+u,"data-emid":u,"data-emsrc":i}),"application/pdf"!==o&&wp.element.createElement(l.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:p,display:g||!E?"none":""},onLoad:this.onLoad,src:k}),!b&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),!g&&wp.element.createElement(a.a,{id:u})),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(O,{title:__("Embed Size","embedpress")},wp.element.createElement(_,{label:__("Width","embedpress"),value:p,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:__("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(U,{label:__("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=C},function(e,t,n){"use strict";var r=n(50),i=(n.n(r),n(51)),o=(n.n(i),n(52)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks.embedpress&&a("embedpress/embedpress",{title:__("EmbedPress"),icon:l.d,category:"embedpress",keywords:["embedpress","embed","google","youtube","docs"],supports:{align:["right","left","center"],default:"center",lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},embedHTML:{type:"string",default:""},height:{type:"string",default:"450"},width:{type:"string",default:"600"},editingURL:{type:"boolean",default:!1},fetching:{type:"boolean",default:!1},cannotEmbed:{type:"boolean",default:!1},interactive:{type:"boolean",default:!1},align:{type:"string",default:"center"},pagesize:{type:"number",default:6}},edit:o.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var l=t[i](o),a=l.value}catch(e){return void n(e)}if(!l.done)return Promise.resolve(a).then(function(e){r("next",e)},function(e){r("throw",e)});e(a)}return r("next")})}}function i(e){function t(){m({editingURL:!0})}function n(e){var t=this;if(e&&e.preventDefault(),h){m({fetching:!0});(function(){var e=r(l.a.mark(function e(n){var r;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=U?"&pagesize="+O:"",e.next=3,fetch(embedpressObj.site_url+"/wp-json/embedpress/v1/oembed/embedpress?url="+n+"&width="+_+"&height="+k+r).then(function(e){return e.json()});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,t)}));return function(_x){return e.apply(this,arguments)}})()(h).then(function(e){m({fetching:!1}),m(e.data&&404===e.data.status||!e.embed?{cannotEmbed:!0,editingURL:!0}:{embedHTML:e.embed,cannotEmbed:!1,editingURL:!1})})}else m({cannotEmbed:!0,fetching:!1,editingURL:!0})}var i=e.attributes,o=e.className,m=e.setAttributes,h=i.url,v=i.editingURL,g=i.fetching,E=i.cannotEmbed,L=(i.interactive,i.embedHTML),k=i.height,_=i.width,O=i.pagesize,S=w?w():[],U=h.match(/\/channel\/|\/c\/|\/user\/|(?:https?:\/\/)?(?:www\.)?(?:youtube.com\/)(\w+)[^?\/]*$/i);return wp.element.createElement(y,null,wp.element.createElement(b,null,wp.element.createElement(f,{title:__("Customize Embedded Link")},wp.element.createElement("p",null,__("You can adjust the width and height of embedded content.")),wp.element.createElement(d,{label:__("Width"),value:_,onChange:function(e){return m({width:e})}}),wp.element.createElement(d,{label:__("Height"),value:k,onChange:function(e){return m({height:e})}}),U&&wp.element.createElement("div",null,wp.element.createElement(d,{label:__("Video Per Page"),value:O,onChange:function(e){return m({pagesize:e})}}),wp.element.createElement("p",null,"Specify the number of videos you wish to show on each page.")),L&&!v&&wp.element.createElement("button",{onClick:n},__("Apply")))),(!L||v)&&!g&&wp.element.createElement("div",S,wp.element.createElement(s.a,{label:__("EmbedPress - Embed anything from 100+ sites"),onSubmit:n,value:h,cannotEmbed:E,onChange:function(e){return m({url:e.target.value})},icon:p.d,DocTitle:__("Learn more about EmbedPress"),docLink:"https://embedpress.com/docs/"})),g?wp.element.createElement("div",{className:o},wp.element.createElement(c.a,null)," "):null,L&&!v&&!g&&wp.element.createElement("figure",S,wp.element.createElement(u.a,{style:{display:g?"none":""},dangerouslySetInnerHTML:{__html:L}}),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:m({interactive:!0})}),wp.element.createElement(a.a,{showEditButton:L&&!E,switchBackToURLInput:t})))}t.a=i;var o=n(53),l=n.n(o),a=n(2),c=n(1),s=n(3),u=n(56),p=n(0),__=wp.i18n.__,m=wp.components,d=m.TextControl,f=m.PanelBody,h=wp.blockEditor,b=h.InspectorControls,w=h.useBlockProps,y=wp.element.Fragment},function(e,t,n){e.exports=n(54)},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(55),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,l=Object.create(o.prototype),a=new d(r||[]);return l._invoke=s(e,n,a),l}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function l(){}function a(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function c(e){function t(n,i,o,l){var a=r(e[n],e,i);if("throw"!==a.type){var c=a.arg,s=c.value;return s&&"object"===typeof s&&y.call(s,"__await")?Promise.resolve(s.__await).then(function(e){t("next",e,o,l)},function(e){t("throw",e,o,l)}):Promise.resolve(s).then(function(e){c.value=e,o(c)},l)}l(a.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function s(e,t,n){var i=O;return function(o,l){if(i===U)throw new Error("Generator is already running");if(i===j){if("throw"===o)throw l;return h()}for(n.method=o,n.arg=l;;){var a=n.delegate;if(a){var c=u(a,n);if(c){if(c===C)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===O)throw i=j,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=U;var s=r(e,t,n);if("normal"===s.type){if(i=n.done?j:S,s.arg===C)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=j,n.method="throw",n.arg=s.arg)}}}function u(e,t){var n=e.iterator[t.method];if(n===b){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=b,u(e,t),"throw"===t.method))return C;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return C}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,C;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=b),t.delegate=null,C):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,C)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function m(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function f(e){if(e){var t=e[g];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=b,t.done=!0,t};return r.next=r}}return{next:h}}function h(){return{value:b,done:!0}}var b,w=Object.prototype,y=w.hasOwnProperty,v="function"===typeof Symbol?Symbol:{},g=v.iterator||"@@iterator",E=v.asyncIterator||"@@asyncIterator",L=v.toStringTag||"@@toStringTag",k="object"===typeof e,_=t.regeneratorRuntime;if(_)return void(k&&(e.exports=_));_=t.regeneratorRuntime=k?e.exports:{},_.wrap=n;var O="suspendedStart",S="suspendedYield",U="executing",j="completed",C={},x={};x[g]=function(){return this};var R=Object.getPrototypeOf,M=R&&R(R(f([])));M&&M!==w&&y.call(M,g)&&(x=M);var T=l.prototype=i.prototype=Object.create(x);o.prototype=T.constructor=l,l.constructor=o,l[L]=o.displayName="GeneratorFunction",_.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},_.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,L in e||(e[L]="GeneratorFunction")),e.prototype=Object.create(T),e},_.awrap=function(e){return{__await:e}},a(c.prototype),c.prototype[E]=function(){return this},_.AsyncIterator=c,_.async=function(e,t,r,i){var o=new c(n(e,t,r,i));return _.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},a(T),T[L]="Generator",T[g]=function(){return this},T.toString=function(){return"[object Generator]"},_.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},_.values=f,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(m),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=b)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=b),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var l=y.call(i,"catchLoc"),a=y.call(i,"finallyLoc");if(l&&a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,C):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),C},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),m(n),C}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:f(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=b),C}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(6),a=n.n(l),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.myRef=React.createRef(),n}return o(t,e),s(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.myRef.current).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("div",c({ref:this.myRef},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";var r=n(58),i=(n.n(r),n(59)),o=(n.n(i),n(60)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["embedpress-pdf"]&&a("embedpress/embedpress-pdf",{title:__("EmbedPress PDF"),icon:l.c,category:"embedpress",keywords:[__("embedpress"),__("pdf"),__("doc"),__("document")],supports:{align:["left","center","right"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:"600"},height:{type:"number",default:"600"},fileName:{type:"string"},mime:{type:"string"}},edit:o.a,save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(4),a=n(5),c=n(1),s=n(0),u=function(){function e(e,t){var n=[],_n=!0,r=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(_n=(o=l.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,i=e}finally{try{!_n&&l.return&&l.return()}finally{if(r)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,b=wp.blockEditor,w=b.BlockIcon,y=b.MediaPlaceholder,v=b.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,O=k.PanelBody,S=k.ExternalLink,U=k.ToggleControl,j=["application/pdf"],C=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return o(t,e),p(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,o=n.href;if(f(o)){r({filesList:[d(o)],onFileChange:function(t){var n=u(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(o)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&this.setState({loadPdf:!1})}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),void 0!==embedpressObj.branding&&void 0!==embedpressObj.branding.powered_by&&this.props.setAttributes({powered_by:embedpressObj.branding.powered_by}),"application/pdf"===e.mime&&this.setState({loadPdf:!1}))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,o=t.mime,u=t.id,p=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,b=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(w,{icon:s.c}),labels:{title:__("EmbedPress PDF"),instructions:__("Upload a PDF file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:j,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(S,{href:"https://embedpress.com/docs/embed-document/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i,C=embedpressObj.pdf_renderer+"?file="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==o?wp.element.createElement(c.a,null):null,wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+u,style:{width:p,maxWidth:"100%"}},"application/pdf"===o&&wp.element.createElement("iframe",{style:{height:m,width:p},className:"embedpress-embed-document-pdf "+u,"data-emid":u,"data-emsrc":i,src:C}),"application/pdf"!==o&&wp.element.createElement(l.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:p,display:g||!E?"none":""},onLoad:this.onLoad,src:k}),!b&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),!g&&wp.element.createElement(a.a,{id:u})),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(O,{title:__("Embed Size","embedpress")},wp.element.createElement(_,{label:__("Width","embedpress"),value:p,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:__("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(U,{label:__("Powered By","embedpress"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=C},function(e,t,n){"use strict";var r=n(62),i=(n.n(r),n(63)),o=(n.n(i),n(64)),l=n(0),__=wp.i18n.__,a=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["embedpress-calendar"]&&a("embedpress/embedpress-calendar",{title:__("Google Calendar"),icon:l.a,category:"embedpress",keywords:["embedpress","embed","calendar","calender","google","cal","events","task","birthday"],supports:{align:["left","center","right"],default:"center",lightBlockWrapper:!0},attributes:{id:{type:"string"},powered_by:{type:"boolean",default:!0},is_public:{type:"boolean",default:!0},width:{type:"string",default:600},height:{type:"string",default:600},url:{type:"string",default:""},embedHTML:{type:"string",default:""}},edit:o.a,save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e){function t(){d({editingURL:!0,is_public:!0})}function n(e){e&&e.preventDefault(),w?(d({fetching:!0}),setTimeout(function(){d({fetching:!1,cannotEmbed:!1,editingURL:!1,embedHTML:"ready"})},500)):d({cannotEmbed:!0,fetching:!1,editingURL:!0})}var r=e.attributes,s=e.className,d=e.setAttributes,w=r.url,y=r.editingURL,v=r.fetching,g=r.cannotEmbed,E=r.embedHTML,L=r.height,k=r.width,_=r.powered_by,O=r.is_public,S=r.align,U=h?h({className:"align"+S,style:{width:k+"px",height:L+"px"}}):[];return wp.element.createElement(b,null,wp.element.createElement(f,null,wp.element.createElement(p,{title:__("Customize Embedded Calendar","embedpress")},wp.element.createElement("p",null,__("You can adjust the width and height of embedded content.","embedpress")),wp.element.createElement(u,{label:__("Width","embedpress"),value:k,onChange:function(e){return d({width:e})}}),wp.element.createElement(u,{label:__("Height","embedpress"),value:L,onChange:function(e){return d({height:e})}})),wp.element.createElement(p,{title:__("Calendar Type and other options","embedpress")},wp.element.createElement("p",null,__("You can show public calendar without any API key","embedpress")),wp.element.createElement(m,{label:__("Powered By","embedpress"),onChange:function(e){return d({powered_by:e})},checked:_}),wp.element.createElement(m,{label:__("Embedding Public Calendar","embedpress"),onChange:function(e){return d({is_public:e})},checked:O}))),(!E||y)&&!v&&O&&wp.element.createElement("div",U,wp.element.createElement(o.a,{label:__("Public Calendar Link"),onSubmit:n,value:w,cannotEmbed:g,onChange:function(e){return d({url:e.target.value})},icon:l.a,DocTitle:__("Learn more about EmbedPress Calendar"),docLink:"https://embedpress.com/docs/"})),v?wp.element.createElement("div",{className:s},wp.element.createElement(i.a,null)," "):null,E&&O&&!y&&!v&&wp.element.createElement("figure",U,O&&wp.element.createElement("iframe",{style:{display:v?"none":""},src:w,width:k,height:L}),_&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:d({interactive:!0})}),wp.element.createElement(a.a,{showEditButton:E&&!g,switchBackToURLInput:t})),!O&&wp.element.createElement("figure",c({className:"testing"},U),wp.element.createElement("p",null,"Private Calendar will show in the frontend only.",wp.element.createElement("br",null),wp.element.createElement("strong",null,"Note: Private calendar needs EmbedPress Pro.")),_&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:d({interactive:!0})}),wp.element.createElement(a.a,{showEditButton:E&&!g,switchBackToURLInput:t})))}t.a=r;var i=n(1),o=n(3),l=n(0),a=n(2),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.components,u=s.TextControl,p=s.PanelBody,m=s.ToggleControl,d=wp.blockEditor,f=d.InspectorControls,h=d.useBlockProps,b=wp.element.Fragment,__=wp.i18n.__}]);
|
1 |
+
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";n.d(t,"e",function(){return l}),n.d(t,"j",function(){return s}),n.d(t,"i",function(){return c}),n.d(t,"g",function(){return p}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return m}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return h}),n.d(t,"b",function(){return b}),n.d(t,"d",function(){return w}),n.d(t,"c",function(){return y}),n.d(t,"a",function(){return v});var r=wp.components,o=r.G,i=r.Path,a=(r.Polygon,r.SVG),l=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(i,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",enableBackground:"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(o,null,wp.element.createElement(i,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(i,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(i,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(i,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(i,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(i,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(i,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(i,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}}))),c=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),p=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(i,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(i,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(i,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),u=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(i,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(i,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(i,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(i,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(i,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(i,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(i,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(i,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(i,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(a,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"}," ",wp.element.createElement(o,null,wp.element.createElement(i,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(i,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(a,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(i,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),b=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0",stopColor:"#fff"}),wp.element.createElement("stop",{offset:"1",stopColor:"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"})))),w=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270",role:"img",focusable:"false"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"}))),y=wp.element.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 512 512"},wp.element.createElement("path",{fill:"#E2E5E7",d:"M128,0c-17.6,0-32,14.4-32,32v448c0,17.6,14.4,32,32,32h320c17.6,0,32-14.4,32-32V128L352,0H128z"}),wp.element.createElement("path",{fill:"#B0B7BD",d:"M384,128h96L352,0v96C352,113.6,366.4,128,384,128z"}),wp.element.createElement("polygon",{fill:"#CAD1D8",points:"480,224 384,128 480,128 "}),wp.element.createElement("path",{fill:"#F15642",d:"M416,416c0,8.8-7.2,16-16,16H48c-8.8,0-16-7.2-16-16V256c0-8.8,7.2-16,16-16h352c8.8,0,16,7.2,16,16 V416z"}),wp.element.createElement("g",null,wp.element.createElement("path",{fill:"#FFFFFF",d:"M101.744,303.152c0-4.224,3.328-8.832,8.688-8.832h29.552c16.64,0,31.616,11.136,31.616,32.48 c0,20.224-14.976,31.488-31.616,31.488h-21.36v16.896c0,5.632-3.584,8.816-8.192,8.816c-4.224,0-8.688-3.184-8.688-8.816V303.152z M118.624,310.432v31.872h21.36c8.576,0,15.36-7.568,15.36-15.504c0-8.944-6.784-16.368-15.36-16.368H118.624z"}),wp.element.createElement("path",{fill:"#FFFFFF",d:"M196.656,384c-4.224,0-8.832-2.304-8.832-7.92v-72.672c0-4.592,4.608-7.936,8.832-7.936h29.296 c58.464,0,57.184,88.528,1.152,88.528H196.656z M204.72,311.088V368.4h21.232c34.544,0,36.08-57.312,0-57.312H204.72z"}),wp.element.createElement("path",{fill:"#FFFFFF",d:"M303.872,312.112v20.336h32.624c4.608,0,9.216,4.608,9.216,9.072c0,4.224-4.608,7.68-9.216,7.68 h-32.624v26.864c0,4.48-3.184,7.92-7.664,7.92c-5.632,0-9.072-3.44-9.072-7.92v-72.672c0-4.592,3.456-7.936,9.072-7.936h44.912 c5.632,0,8.96,3.344,8.96,7.936c0,4.096-3.328,8.704-8.96,8.704h-37.248V312.112z"})),wp.element.createElement("path",{fill:"#CAD1D8",d:"M400,432H96v16h304c8.8,0,16-7.2,16-16v-16C416,424.8,408.8,432,400,432z"})),v=wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"186 38 76 76"},wp.element.createElement("path",{fill:"#fff",d:"M244 56h-40v40h40V56z"}),wp.element.createElement("path",{fill:"#EA4335",d:"M244 114l18-18h-18v18z"}),wp.element.createElement("path",{fill:"#FBBC04",d:"M262 56h-18v40h18V56z"}),wp.element.createElement("path",{fill:"#34A853",d:"M244 96h-40v18h40V96z"}),wp.element.createElement("path",{fill:"#188038",d:"M186 96v12c0 3.315 2.685 6 6 6h12V96h-18z"}),wp.element.createElement("path",{fill:"#1967D2",d:"M262 56V44c0-3.315-2.685-6-6-6h-12v18h18z"}),wp.element.createElement("path",{fill:"#4285F4",d:"M244 38h-52c-3.315 0 -6 2.685-6 6v52h18V56h40V38z"}),wp.element.createElement("path",{fill:"#4285F4",d:"M212.205 87.03c-1.495-1.01-2.53-2.485-3.095-4.435l3.47-1.43c.315 1.2.865 2.13 1.65 2.79.78.66 1.73.985 2.84.985 1.135 0 2.11-.345 2.925-1.035s1.225-1.57 1.225-2.635c0-1.09-.43-1.98-1.29-2.67-.86-.69-1.94-1.035-3.23-1.035h-2.005V74.13h1.8c1.11 0 2.045-.3 2.805-.9.76-.6 1.14-1.42 1.14-2.465 0 -.93-.34-1.67-1.02-2.225-.68-.555-1.54-.835-2.585-.835-1.02 0 -1.83.27-2.43.815a4.784 4.784 0 0 0 -1.31 2.005l-3.435-1.43c.455-1.29 1.29-2.43 2.515-3.415 1.225-.985 2.79-1.48 4.69-1.48 1.405 0 2.67.27 3.79.815 1.12.545 2 1.3 2.635 2.26.635.965.95 2.045.95 3.245 0 1.225-.295 2.26-.885 3.11-.59.85-1.315 1.5-2.175 1.955v.205a6.605 6.605 0 0 1 2.79 2.175c.725.975 1.09 2.14 1.09 3.5 0 1.36-.345 2.575-1.035 3.64s-1.645 1.905-2.855 2.515c-1.215.61-2.58.92-4.095.92-1.755.005-3.375-.5-4.87-1.51zM233.52 69.81l-3.81 2.755-1.905-2.89 6.835-4.93h2.62V88h-3.74V69.81z"}))},function(e,t,n){"use strict";var __=wp.i18n.__,r=wp.components.Spinner,o=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading text-center"},wp.element.createElement(r,null),wp.element.createElement("p",null,__("Embedding\u2026")))};t.a=o},function(e,t,n){"use strict";var __=wp.i18n.__,r=wp.element.Fragment,o=wp.components,i=o.Button,a=o.Toolbar,l=wp.blockEditor.BlockControls,s=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(r,null,wp.element.createElement(l,null,wp.element.createElement(a,null,t&&wp.element.createElement(i,{className:"components-toolbar__control",label:__("Edit URL"),icon:"edit",onClick:n}))))};t.a=s},function(e,t,n){"use strict";var r=n(12),o=n.n(r),i=wp.i18n,__=i.__,_x=i._x,a=wp.components,l=a.Button,s=a.Placeholder,c=a.ExternalLink,p=wp.blockEditor.BlockIcon,u=function(e){var t=e.icon,n=e.label,r=e.value,i=e.onSubmit,a=e.onChange,u=e.cannotEmbed,m=e.docLink,d=e.DocTitle,f=o()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(s,{icon:wp.element.createElement(p,{icon:t,showColors:!0}),label:n,className:f},wp.element.createElement("form",{onSubmit:i},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:__("Enter URL to embed here\u2026"),onChange:a}),wp.element.createElement(l,{isSmall:!0,type:"submit"},_x("Embed","button label")),u&&wp.element.createElement("p",{className:"components-placeholder__error"},__("Sorry, we could not embed that content."),wp.element.createElement("br",null))),m&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(c,{href:m},d))))};t.a=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(6),l=n.n(a),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.element.Component,u=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.myRef=React.createRef(),n}return i(t,e),c(t,[{key:"componentDidMount",value:function(){l.a.findDOMNode(this.myRef.current).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:this.myRef},this.props))}}]),t}(p);t.a=u},function(e,t,n){"use strict";function r(e){var t=embedpressObj.document_cta,n="",r="";if(embedpressObj.embedpress_pro&&t&&t.logo_url){var i=t.cta_url?t.cta_url:null,a=t.logo_xpos?t.logo_xpos+"%":"10%",l=t.logo_ypos?t.logo_ypos+"%":"10%",s=t.logo_opacity?t.logo_opacity/100:"10%",c=".ep-doc-"+e.id;return n="\n "+c+"{\n text-align: left;\n position: relative;\n }\n "+c+" .watermark {\n \t\tdisplay:inline-block;\n border: 0;\n position: absolute;\n bottom: "+l+";\n right: "+a+";\n max-width: 150px;\n max-height: 75px;\n opacity: "+s+";\n z-index: 5;\n -o-transition: opacity 0.5s ease-in-out;\n -moz-transition: opacity 0.5s ease-in-out;\n -webkit-transition: opacity 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n }\n "+c+" .watermark:hover {\n\t\t\t\t\t opacity: 1;\n\t\t\t\t }\n\t\t",i&&""!==i&&(r+="<a href="+i+">"),r+='<img class="watermark" alt="" src="'+t.logo_url+'"/>',i&&""!==i&&(r+="</a>"),wp.element.createElement(o,null,wp.element.createElement("style",{dangerouslySetInnerHTML:{__html:n}}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))}return""}var o=wp.element.Fragment;t.a=r},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(8),n(13),n(17),n(21),n(25),n(29),n(33),n(37),n(41),n(45),n(49),n(59),n(65);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(9),o=(n.n(r),n(10)),i=(n.n(o),n(11)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-docs-block"]&&l("embedpress/google-docs-block",{title:__("Google Docs"),icon:a.e,category:"embedpress",keywords:[__("embedpress"),__("google"),__("docs")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element.Component,d=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=o.exec(r),a=i[1];a&&"document"===a?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Docs URL");return!m||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.e,DocTitle:__("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,{src:m,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameBorder:"0",width:"600",height:"450"}),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(m);t.a=d},function(e,t,n){var r,o;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&e.push(a)}}else if("object"===o){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var l in r)i.call(r,l)&&r[l]&&e.push(l)}}}return e.join(" ")}var i={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";var r=n(14),o=(n.n(r),n(15)),i=(n.n(o),n(16)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-slides-block"]&&l("embedpress/google-slides-block",{title:__("Google Slides"),icon:a.j,category:"embedpress",keywords:[__("embedpress"),__("google"),__("slides")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=o.exec(r),a=i[1];a&&"presentation"==a?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Slides URL");return!m||r?wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.j,DocTitle:__("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(f,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450"}),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(18),o=(n.n(r),n(19)),i=(n.n(o),n(20)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-sheets-block"]&&l("embedpress/google-sheets-block",{title:__("Google Sheets"),icon:a.i,category:"embedpress",keywords:[__("embedpress"),__("google"),__("sheets")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=o.exec(r),a=i[1];if(a&&"spreadsheets"==a){if(r.indexOf("?")>-1){var l=r.split("?");if(l=l[1],l=l.split("&"),console.log(l),l.length>0){var s=!1,c=!1;l.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Sheets URL");return!m||r?wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.i,DocTitle:__("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(f,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450"}),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(22),o=(n.n(r),n(23)),i=(n.n(o),n(24)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-forms-block"]&&l("embedpress/google-forms-block",{title:__("Google Forms"),icon:a.g,category:"embedpress",keywords:[__("embedpress"),__("google"),__("forms")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=(wp.components.Disabled,function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=o.exec(r),a=i[1];a&&"forms"==a?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Forms URL");return!m||r?wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.g,DocTitle:__("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(f,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450"}),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d));t.a=h},function(e,t,n){"use strict";var r=n(26),o=(n.n(r),n(27)),i=(n.n(o),n(28)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-drawings-block"]&&l("embedpress/google-drawings-block",{title:__("Google Drawings"),icon:a.f,category:"embedpress",keywords:[__("embedpress"),__("google"),__("drawings")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,u=wp.element,m=u.Component,d=u.Fragment,f=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return i(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,i=o.exec(r),a=i[1];a&&"drawings"==a?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,p=this.props.attributes.iframeSrc,u=__("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!p||r?wp.element.createElement(s.a,{label:u,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:c.f,DocTitle:__("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(d,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement("img",{src:p,onLoad:this.onLoad,style:{display:o?"none":""},width:"960",height:"720"}),wp.element.createElement(a.a,{showEditButton:p&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(m);t.a=f},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(30),i=(n.n(o),n(31)),a=(n.n(i),n(32)),l=n(0),__=wp.i18n.__,s=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["google-maps-block"]&&s("embedpress/google-maps-block",{title:__("Google Maps"),icon:l.h,category:"embedpress",keywords:[__("embedpress"),__("google"),__("maps")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:a.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var o=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,i=o.exec(r);i&&i.length>1&&i[1]&&i[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+i[1]+"&spn="+i[1]+"&t=m&z="+Math.round(parseInt(i[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Google Maps URL");return!m||r?wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.h,DocTitle:__("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(f,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450"}),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(34),o=(n.n(r),n(35)),i=(n.n(o),n(36)),a=n(0),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},__=wp.i18n.__,s=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["twitch-block"]&&s("embedpress/twitch-block",{title:__("Twitch"),icon:a.k,category:"embedpress",keywords:[__("embedpress"),__("twitch")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,o=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",l({src:o},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var o=this.decodeHTMLEntities(t),i=r.exec(o),a=i[1];console.log(a);var l,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":o="https://player.twitch.tv/?channel="+a,l={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":o="https://clips.twitch.tv/embed?clip="+a+"&autoplay=false",l={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":a=i[2],o="https://player.twitch.tv/?video="+a,l={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":o="http://www.twitch.tv/embed/"+a+"/chat",l={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+a+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o,attrs:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,m=t.interactive,d=this.props.attributes,f=d.iframeSrc,b=d.attrs,w=__("Twitch URL");if(!f||r)return wp.element.createElement(s.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.k,DocTitle:__("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var y=f+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(h,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,u({src:y},b,{onLoad:this.onLoad,style:{display:o?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:f&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=b},function(e,t,n){"use strict";var r=n(38),o=(n.n(r),n(39)),i=(n.n(o),n(40)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["wistia-block"]&&l("embedpress/wistia-block",{title:__("Wistia"),icon:a.l,category:"embedpress",keywords:[__("embedpress"),__("wistia")],supports:{align:["wide","full","right","left"],default:""},edit:i.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return i(t,e),u(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),o=r[1],i="//fast.wistia.net/embed/iframe/"+o;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:o}),n({iframeSrc:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,u=t.interactive,m=this.props.attributes.iframeSrc,d=__("Wistia URL");return!m||r?wp.element.createElement(s.a,{label:d,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.l,DocTitle:__("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(f,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:m,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"330"})),!u&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:m&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=h},function(e,t,n){"use strict";var r=n(42),o=(n.n(r),n(43)),i=(n.n(o),n(44)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["youtube-block"]&&l("embedpress/youtube-block",{title:__("YouTube"),icon:a.m,category:"embedpress",keywords:[__("embedpress"),__("youtube")],supports:{align:["wide","full","right","left"],default:""},edit:i.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),l=n(1),s=n(3),c=n(4),p=n(0),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return i(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var o=r[1],i="https://www.youtube.com/embed/"+o,a=new URL(i);if("undefined"!==typeof embedpressProObj)for(var l in embedpressProObj.youtubeParams)a.searchParams.set(l,embedpressProObj.youtubeParams[l]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:a.href,mediaId:o})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,i=t.cannotEmbed,m=t.interactive,d=this.props.attributes,f=d.iframeSrc,b=d.attrs,w=__("YouTube URL");return!f||r?wp.element.createElement(s.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:i,onChange:function(t){return e.setState({url:t.target.value})},icon:p.m,DocTitle:__("Learn More About YouTube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(h,null,o?wp.element.createElement(l.a,null):null,wp.element.createElement(c.a,u({src:f},b,{onLoad:this.onLoad,style:{display:o?"none":""},width:"640",onFocus:this.hideOverlay,height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(a.a,{showEditButton:f&&!i,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=b},function(e,t,n){"use strict";var r=n(46),o=(n.n(r),n(47)),i=(n.n(o),n(48)),a=n(0),l=n(5),__=wp.i18n.__,s=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks.document&&s("embedpress/document",{title:__("Document"),icon:a.b,category:"embedpress",keywords:[__("embedpress"),__("pdf"),__("doc"),__("ppt")],supports:{align:["wide","full","right","left"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:i.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,o=t.id,i=t.width,a=t.height,s=t.powered_by,c="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+o,style:{height:a,width:i}},"application/pdf"===r&&wp.element.createElement("div",{style:{height:a,width:i},className:"embedpress-embed-document-pdf "+o,"data-emid":o,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:a,width:i},src:c,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),s&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),embedpressObj.embedpress_pro&&wp.element.createElement(l.a,{id:o}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(4),l=n(5),s=n(1),c=n(0),p=function(){function e(e,t){var n=[],_n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{!_n&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,b=wp.blockEditor,w=b.BlockIcon,y=b.MediaPlaceholder,v=b.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,_=wp.components,k=_.RangeControl,O=_.PanelBody,S=_.ExternalLink,U=_.ToggleControl,C=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],x=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return i(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,o=t.noticeOperations,i=n.href;if(f(i)){r({filesList:[d(i)],onFileChange:function(t){var n=p(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),o.createErrorNotice(t)}}),h(i)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,o=t.href,i=t.mime,p=t.id,u=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,b=f.interactive,g=f.fetching,E=f.loadPdf;if(!o||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(w,{icon:c.b}),labels:{title:__("Document"),instructions:__("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:C,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(S,{href:"https://embedpress.com/docs/embed-document/"},"Learn more about Embedded document "))));var _="//view.officeapps.live.com/op/embed.aspx?src="+o;return wp.element.createElement(L,null,g&&"application/pdf"!==i?wp.element.createElement(s.a,null):null,wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+p,style:{height:m,width:u}},"application/pdf"===i&&wp.element.createElement("div",{style:{height:m,width:u},className:"embedpress-embed-document-pdf "+p,"data-emid":p,"data-emsrc":o}),"application/pdf"!==i&&wp.element.createElement(a.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:u,display:g||!E?"none":""},onLoad:this.onLoad,src:_}),!b&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),!g&&wp.element.createElement(l.a,{id:p})),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(O,{title:__("Embed Size","embedpress")},wp.element.createElement(k,{label:__("Width","embedpress"),value:u||720,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(k,{label:__("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(U,{label:__("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=x},function(e,t,n){"use strict";var r=n(50),o=(n.n(r),n(51)),i=(n.n(o),n(52)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks.embedpress&&l("embedpress/embedpress",{title:__("EmbedPress"),icon:a.d,category:"embedpress",keywords:["embedpress","embed","google","youtube","docs"],supports:{align:["right","left","center"],default:"center",lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},embedHTML:{type:"string",default:""},height:{type:"string",default:"450"},width:{type:"string",default:"600"},editingURL:{type:"boolean",default:!1},fetching:{type:"boolean",default:!1},cannotEmbed:{type:"boolean",default:!1},interactive:{type:"boolean",default:!1},align:{type:"string",default:"center"},ispagination:{type:"boolean",default:!0},pagesize:{type:"number",default:6},columns:{type:"string",default:"2"},gapbetweenvideos:{type:"number",default:30}},edit:i.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(o,i){try{var a=t[o](i),l=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(l).then(function(e){r("next",e)},function(e){r("throw",e)});e(l)}return r("next")})}}function o(e){function t(){w({editingURL:!0})}function n(e){var t=this;if(e&&e.preventDefault(),y){w({fetching:!0});(function(){var e=r(a.a.mark(function e(n){var r,o,i,l;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=j?"&pagesize="+S:"",o=j?"&gapbetweenvideos="+C:"",i=!!j&&"&ispagination="+O,l=j?"&columns="+U:"",e.next=6,fetch(embedpressObj.site_url+"/wp-json/embedpress/v1/oembed/embedpress?url="+n+"&width="+k+"&height="+_+l+i+r+o).then(function(e){return e.json()});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e,t)}));return function(_x){return e.apply(this,arguments)}})()(y).then(function(e){w({fetching:!1}),w(e.data&&404===e.data.status||!e.embed?{cannotEmbed:!0,editingURL:!0}:{embedHTML:e.embed,cannotEmbed:!1,editingURL:!1})})}else w({cannotEmbed:!0,fetching:!1,editingURL:!0})}var o=e.clientId,i=e.attributes,f=e.className,w=e.setAttributes,y=i.url,v=i.editingURL,g=i.fetching,E=i.cannotEmbed,L=(i.interactive,i.embedHTML),_=i.height,k=i.width,O=i.ispagination,S=i.pagesize,U=i.columns,C=i.gapbetweenvideos,x=d?d():[],j=y.match(/\/channel\/|\/c\/|\/user\/|(?:https?:\/\/)?(?:www\.)?(?:youtube.com\/)(\w+)[^?\/]*$/i);b(function(){var e=setTimeout(function(){S&&(L&&!v||g)&&n()},300);return function(){return clearTimeout(e)}},[S,v]);var R="repeat(auto-fit, minmax(250px, 1fr))";return U>0&&(R="repeat(auto-fit, minmax(calc("+100/U+"% - "+C+"px), 1fr))"),wp.element.createElement(h,null,wp.element.createElement(u.a,{attributes:i,setAttributes:w,isYTChannel:j}),(!L||v)&&!g&&wp.element.createElement("div",x,wp.element.createElement(c.a,{label:__("EmbedPress - Embed anything from 100+ sites"),onSubmit:n,value:y,cannotEmbed:E,onChange:function(e){return w({url:e.target.value})},icon:m.d,DocTitle:__("Learn more about EmbedPress"),docLink:"https://embedpress.com/docs/"})),g?wp.element.createElement("div",{className:f},wp.element.createElement(s.a,null)," "):null,L&&!v&&!g&&wp.element.createElement("figure",x,wp.element.createElement(p.a,{style:{display:g?"none":""},dangerouslySetInnerHTML:{__html:L}}),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:w({interactive:!0})}),wp.element.createElement(l.a,{showEditButton:L&&!E,switchBackToURLInput:t})),wp.element.createElement("style",{style:{display:"none"}},"\n\t\t\t\t\t#block-"+o+" .ep-youtube__content__block .youtube__content__body .content__wrap{\n\t\t\t\t\t\tgap: "+C+"px!important;\n\t\t\t\t\t\tmargin-top: "+C+"px!important;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t#block-"+o+" .ose-youtube{\n\t\t\t\t\t\twidth: "+k+"px!important;\n\t\t\t\t\t} \n\t\t\t\t\t#block-"+o+" .ose-youtube .ep-first-video iframe{\n\t\t\t\t\t\tmax-height: "+_+"px!important;\n\t\t\t\t\t} \n\n\t\t\t\t\t#block-"+o+" .ose-youtube > iframe{\n\t\t\t\t\t\theight: "+_+"px!important;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t#block-"+o+" .ep-youtube__content__block .youtube__content__body .content__wrap {\n\t\t\t\t\t\tgrid-template-columns: "+R+";\n\t\t\t\t\t}\n\n\t\t\t\t\t#block-"+o+" .ep-youtube__content__block .ep-youtube__content__pagination{\n\t\t\t\t\t\tdisplay: flex!important;\n\t\t\t\t\t}\n\n\t\t\t\t\t"+(!O&&"#block-"+o+" .ep-youtube__content__block .ep-youtube__content__pagination{\n\t\t\t\t\t\t\tdisplay: none!important;\n\t\t\t\t\t\t}")+"\n\n\t\t\t\t\t"))}t.a=o;var i=n(53),a=n.n(i),l=n(2),s=n(1),c=n(3),p=n(56),u=n(57),m=n(0),__=wp.i18n.__,d=wp.blockEditor.useBlockProps,f=wp.element,h=f.Fragment,b=f.useEffect},function(e,t,n){e.exports=n(54)},function(e,t,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(55),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,r){var i=t&&t.prototype instanceof o?t:o,a=Object.create(i.prototype),l=new d(r||[]);return a._invoke=c(e,n,l),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function o(){}function i(){}function a(){}function l(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function s(e){function t(n,o,i,a){var l=r(e[n],e,o);if("throw"!==l.type){var s=l.arg,c=s.value;return c&&"object"===typeof c&&y.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,i,a)},function(e){t("throw",e,i,a)}):Promise.resolve(c).then(function(e){s.value=e,i(s)},a)}a(l.arg)}function n(e,n){function r(){return new Promise(function(r,o){t(e,n,r,o)})}return o=o?o.then(r,r):r()}var o;this._invoke=n}function c(e,t,n){var o=O;return function(i,a){if(o===U)throw new Error("Generator is already running");if(o===C){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var s=p(l,n);if(s){if(s===x)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===O)throw o=C,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=U;var c=r(e,t,n);if("normal"===c.type){if(o=n.done?C:S,c.arg===x)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=C,n.method="throw",n.arg=c.arg)}}}function p(e,t){var n=e.iterator[t.method];if(n===b){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=b,p(e,t),"throw"===t.method))return x;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var o=r(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,x;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=b),t.delegate=null,x):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,x)}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function m(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset(!0)}function f(e){if(e){var t=e[g];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=b,t.done=!0,t};return r.next=r}}return{next:h}}function h(){return{value:b,done:!0}}var b,w=Object.prototype,y=w.hasOwnProperty,v="function"===typeof Symbol?Symbol:{},g=v.iterator||"@@iterator",E=v.asyncIterator||"@@asyncIterator",L=v.toStringTag||"@@toStringTag",_="object"===typeof e,k=t.regeneratorRuntime;if(k)return void(_&&(e.exports=k));k=t.regeneratorRuntime=_?e.exports:{},k.wrap=n;var O="suspendedStart",S="suspendedYield",U="executing",C="completed",x={},j={};j[g]=function(){return this};var R=Object.getPrototypeOf,M=R&&R(R(f([])));M&&M!==w&&y.call(M,g)&&(j=M);var T=a.prototype=o.prototype=Object.create(j);i.prototype=T.constructor=a,a.constructor=i,a[L]=i.displayName="GeneratorFunction",k.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},k.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,L in e||(e[L]="GeneratorFunction")),e.prototype=Object.create(T),e},k.awrap=function(e){return{__await:e}},l(s.prototype),s.prototype[E]=function(){return this},k.AsyncIterator=s,k.async=function(e,t,r,o){var i=new s(n(e,t,r,o));return k.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},l(T),T[L]="Generator",T[g]=function(){return this},T.toString=function(){return"[object Generator]"},k.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},k.values=f,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(m),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=b)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=b),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=y.call(o,"catchLoc"),l=y.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,x):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),m(n),x}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;m(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:f(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=b),x}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(6),l=n.n(a),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.element.Component,u=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.myRef=React.createRef(),n}return i(t,e),c(t,[{key:"componentDidMount",value:function(){l.a.findDOMNode(this.myRef.current).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("div",s({ref:this.myRef},this.props))}}]),t}(p);t.a=u},function(e,t,n){"use strict";function r(e){var t=e.attributes,n=e.setAttributes,r=e.isYTChannel,i=t.width,c=t.height;return wp.element.createElement(s,null,wp.element.createElement(l,{title:__("Customize Embedded Link")},wp.element.createElement("p",null,__("You can adjust the width and height of embedded content.")),wp.element.createElement(a,{label:__("Width"),value:i,onChange:function(e){return n({width:e})}}),wp.element.createElement(a,{label:__("Height"),value:c,onChange:function(e){return n({height:e})}}),r&&wp.element.createElement(o.a,{attributes:t,setAttributes:n})))}t.a=r;var o=n(58),__=wp.i18n.__,i=wp.components,a=i.TextControl,l=i.PanelBody,s=wp.blockEditor.InspectorControls},function(e,t,n){"use strict";function r(e){var t=e.attributes,n=e.setAttributes,r=t.ispagination,o=t.pagesize,c=t.columns,p=t.gapbetweenvideos;return wp.element.createElement("div",null,wp.element.createElement(i,{label:__("Video Per Page"),value:o,onChange:function(e){return n({pagesize:e})},type:"number",max:50}),wp.element.createElement("p",null,"Specify the number of videos you wish to show on each page."),wp.element.createElement(a,{label:__("Column"),value:c,options:[{label:"Auto",value:"auto"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"6",value:"6"}],onChange:function(e){return n({columns:e})},__nextHasNoMarginBottom:!0}),wp.element.createElement(l,{label:__("Gap Between Videos"),value:p,onChange:function(e){return n({gapbetweenvideos:e})},min:1,max:100}),wp.element.createElement("p",null,"Specify the gap between youtube videos."),wp.element.createElement(s,{label:__("Pagination"),checked:r,onChange:function(e){return n({ispagination:e})}}))}t.a=r;var __=wp.i18n.__,o=wp.components,i=o.TextControl,a=o.SelectControl,l=o.RangeControl,s=o.ToggleControl},function(e,t,n){"use strict";var r=n(60),o=(n.n(r),n(61)),i=(n.n(o),n(62)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["embedpress-pdf"]&&l("embedpress/embedpress-pdf",{title:__("EmbedPress PDF"),icon:a.c,category:"embedpress",keywords:[__("embedpress"),__("pdf"),__("doc"),__("document")],supports:{align:["left","center","right"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},presentation:{type:"boolean",default:!0},position:{type:"string",default:"top"},download:{type:"boolean",default:!0},open:{type:"boolean",default:!1},copy_text:{type:"boolean",default:!0},toolbar:{type:"boolean",default:!0},doc_details:{type:"boolean",default:!0},doc_rotation:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:450},fileName:{type:"string"},mime:{type:"string"}},edit:i.a,save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(4),l=n(5),s=n(1),c=n(63),p=(n.n(c),n(64)),u=(n.n(p),n(0)),m=function(){function e(e,t){var n=[],_n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{!_n&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),__=wp.i18n.__,f=wp.blob,h=f.getBlobByURL,b=f.isBlobURL,w=f.revokeBlobURL,y=wp.blockEditor,v=y.BlockIcon,g=y.MediaPlaceholder,E=y.InspectorControls,L=wp.element,_=L.Component,k=L.Fragment,O=wp.components,S=O.RangeControl,U=O.PanelBody,C=O.ExternalLink,x=O.ToggleControl,j=["application/pdf"],R=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.iframeManupulate=e.iframeManupulate.bind(e),e.isPro=e.isPro.bind(e),e.addProAlert=e.addProAlert.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return i(t,e),d(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,o=t.noticeOperations,i=n.href;if(b(i)){r({filesList:[h(i)],onFileChange:function(t){var n=m(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),o.createErrorNotice(t)}}),w(i)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&this.setState({loadPdf:!1})}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),void 0!==embedpressObj.branding&&void 0!==embedpressObj.branding.powered_by&&this.props.setAttributes({powered_by:embedpressObj.branding.powered_by}),"application/pdf"===e.mime&&this.setState({loadPdf:!1}))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"isDisplay",value:function(e){return e=e?"block":"none"}},{key:"iframeManupulate",value:function(e,t,n,r,o,i,a,l,s,c){var p=this,u=setInterval(function(){var m="",d=document.querySelector(e).contentWindow.document,f=d.getElementsByTagName("head")[0],h=d.createElement("style");h.setAttribute("id","EBiframeStyleID"),!1===i&&(t=!1,r=!0,o=!1,a=!0,l=!1,s=!1,c=!1),i=p.isDisplay(i),t=p.isDisplay(t),r=p.isDisplay(r),o=p.isDisplay(o),a=p.isDisplay(a),"block"===a&&(a="all"),s=p.isDisplay(s),c=p.isDisplay(c),"top"===n?(n="top:0;bottom:auto;",m=""):(n="bottom:0;top:auto;",m="\n\t\t\t\t.findbar, .secondaryToolbar {\n\t\t\t\t\ttop: auto;bottom: 32px;\n\t\t\t\t}\n\t\t\t\t.doorHangerRight:after{\n\t\t\t\t\ttransform: rotate(180deg);\n\t\t\t\t\tbottom: -16px;\n\t\t\t\t}\n\t\t\t\t .doorHangerRight:before {\n\t\t\t\t\ttransform: rotate(180deg);\n\t\t\t\t\tbottom: -18px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.findbar.doorHanger:before {\n\t\t\t\t\tbottom: -18px;\n\t\t\t\t\ttransform: rotate(180deg);\n\t\t\t\t}\n\t\t\t\t.findbar.doorHanger:after {\n\t\t\t\t\tbottom: -16px;\n\t\t\t\t\ttransform: rotate(180deg);\n\t\t\t\t}\n\t\t\t"),h.textContent="\n\t\t\t.toolbar{\n\t\t\t\tdisplay: "+i+"!important;\n\t\t\t\tposition: absolute;\n\t\t\t\t"+n+"\n\n\t\t\t}\n\n\t\t\t#secondaryToolbar{\n\t\t\t\tdisplay: "+i+";\n\t\t\t}\n\t\t\t#secondaryPresentationMode, #toolbarViewerRight #presentationMode{\n\t\t\t\tdisplay: "+t+"!important;\n\t\t\t}\n\t\t\t#secondaryOpenFile, #toolbarViewerRight #openFile{\n\t\t\t\tdisplay: "+o+"!important;\n\t\t\t}\n\t\t\t#secondaryDownload, #secondaryPrint, #toolbarViewerRight #print, #toolbarViewerRight #download{\n\t\t\t\tdisplay: "+r+"!important;\n\t\t\t}\n\t\t\t#pageRotateCw{\n\t\t\t\tdisplay: "+c+"!important;\n\t\t\t}\n\t\t\t#pageRotateCcw{\n\t\t\t\tdisplay: "+c+"!important;\n\t\t\t}\n\t\t\t#documentProperties{\n\t\t\t\tdisplay: "+s+"!important;\n\t\t\t}\n\t\t\t.textLayer{\n\t\t\t\tuser-select: "+a+"!important;\n\t\t\t}\n\t\t\t\n\t\t\t"+m+"\n\t\t\t\n\t\t",f&&(d.getElementById("EBiframeStyleID")&&d.getElementById("EBiframeStyleID").remove(),f.appendChild(h),clearInterval(u))},100)}},{key:"addProAlert",value:function(e,t){t||(document.querySelector(".pro__alert__wrap").style.display="block")}},{key:"removeAlert",value:function(){document.querySelector(".pro__alert__wrap")&&document.querySelector(".pro__alert__wrap .pro__alert__card .button").addEventListener("click",function(e){document.querySelector(".pro__alert__wrap").style.display="none"})}},{key:"isPro",value:function(e){var t=document.createElement("div");return t.innerHTML='\n\t\t<div class="pro__alert__wrap" style="display: none;">\n\t\t\t<div class="pro__alert__card">\n\t\t\t\t<img src="../wp-content/plugins/embedpress/EmbedPress/Ends/Back/Settings/assets/img/alert.svg" alt=""/>\n\t\t\t\t\t<h2>Opps...</h2>\n\t\t\t\t\t<p>You need to upgrade to the <a href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p>\n\t\t\t\t\t<a href="#" class="button radius-10">Close</a>\n\t\t\t</div>\n\t\t</div>\n\t\t',t}},{key:"render",value:function(){var e=this,t=this.props,n=t.attributes,r=t.noticeUI,o=t.setAttributes,i=(t.clientId,n.href),c=n.mime,m=n.id,d=n.width,f=n.height,h=n.powered_by,b=n.presentation,w=n.position,y=n.download,L=n.open,_=n.toolbar,O=n.copy_text,R=n.toolbar_position,M=n.doc_details,T=n.doc_rotation,P=this.state,F=P.hasError,B=P.interactive,D=P.fetching,N=P.loadPdf,I=embedpressObj.is_pro_plugin_active;if(I||(o({download:!0}),o({copy_text:!0})),document.querySelector(".pro__alert__wrap")||(document.querySelector("body").append(this.isPro("none")),this.removeAlert()),!i||F)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(g,{icon:wp.element.createElement(v,{icon:u.c}),labels:{title:__("EmbedPress PDF"),instructions:__("Upload a PDF file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:r,allowedTypes:j,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(C,{href:"https://embedpress.com/docs/embed-document/"},"Learn more about Embedded document "))));var z="//view.officeapps.live.com/op/embed.aspx?src="+i,H=embedpressObj.pdf_renderer+"?file="+i;return this.iframeManupulate("."+m,b,w,y,L,_,O,R,M,T),wp.element.createElement(k,null,D&&"application/pdf"!==c?wp.element.createElement(s.a,null):null,wp.element.createElement("div",{className:"embedpress-document-embed ep-doc-"+m,style:{width:d,maxWidth:"100%"},id:"ep-doc-"+this.props.clientId},"application/pdf"===c&&wp.element.createElement("iframe",{powered_by:h,style:{height:f,width:d},className:"embedpress-embed-document-pdf "+m,"data-emid":m,"data-emsrc":i,src:H}),"application/pdf"!==c&&wp.element.createElement(a.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:f,width:d,display:D||!N?"none":""},onLoad:this.onLoad,src:z}),!B&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),h&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),!D&&wp.element.createElement(l.a,{id:m})),wp.element.createElement(E,{key:"inspector"},wp.element.createElement(U,{title:__("Embed Size(px)","embedpress")},wp.element.createElement(S,{label:__("Width","embedpress"),value:d,onChange:function(e){return o({width:e})},max:1e3,min:1}),wp.element.createElement(S,{label:__("Height","embedpress"),value:f,onChange:function(e){return o({height:e})},max:1e3,min:1})),wp.element.createElement(U,{title:__("PDF Control Settings","embedpress"),initialOpen:!1},wp.element.createElement("div",{className:I?"pro-control-active":"pro-control",onClick:function(t){e.addProAlert(t,I)}},wp.element.createElement(x,{label:__("Toolbar","embedpress"),description:__("Show or Hide toolbar. Note: If you disable toolbar access then every toolbar options will be disabled","embedpress"),onChange:function(e){return o({toolbar:e})},checked:_,style:{marginTop:"30px"}}),!I&&wp.element.createElement("span",{className:"isPro"},__("pro","embedpress"))),_&&wp.element.createElement(k,null,wp.element.createElement(p.__experimentalToggleGroupControl,{label:"Toolbar Position",value:w,onChange:function(e){return o({position:e})}},wp.element.createElement(p.__experimentalToggleGroupControlOption,{value:"top",label:"Top"}),wp.element.createElement(p.__experimentalToggleGroupControlOption,{value:"bottom",label:"Bottom"})),wp.element.createElement(x,{label:__("Presentation Mode","embedpress"),onChange:function(e){return o({presentation:e})},checked:b}),wp.element.createElement("div",{className:I?"pro-control-active":"pro-control",onClick:function(t){e.addProAlert(t,I)}},wp.element.createElement(x,{label:__("Print/Download","embedpress"),onChange:function(e){return o({download:e})},checked:y}),!I&&wp.element.createElement("span",{className:"isPro"},__("pro","embedpress"))),wp.element.createElement("div",{className:I?"pro-control-active":"pro-control",onClick:function(t){e.addProAlert(t,I)}},wp.element.createElement(x,{label:__("Copy Text","embedpress"),onChange:function(e){return o({copy_text:e})},checked:O,className:"disabled"}),!I&&wp.element.createElement("span",{className:"isPro"},__("pro","embedpress"))),wp.element.createElement(x,{label:__("Rotation","embedpress"),onChange:function(e){return o({doc_rotation:e})},checked:T}),wp.element.createElement(x,{label:__("Properties","embedpress"),onChange:function(e){return o({doc_details:e})},checked:M}),wp.element.createElement(x,{label:__("Powered By","embedpress"),onChange:function(e){return o({powered_by:e})},checked:h})))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(_);t.a=R},function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";var r=n(66),o=(n.n(r),n(67)),i=(n.n(o),n(68)),a=n(0),__=wp.i18n.__,l=wp.blocks.registerBlockType;embedpressObj&&embedpressObj.active_blocks&&embedpressObj.active_blocks["embedpress-calendar"]&&l("embedpress/embedpress-calendar",{title:__("Google Calendar"),icon:a.a,category:"embedpress",keywords:["embedpress","embed","calendar","calender","google","cal","events","task","birthday"],supports:{align:["left","center","right"],default:"center",lightBlockWrapper:!0},attributes:{id:{type:"string"},powered_by:{type:"boolean",default:!0},is_public:{type:"boolean",default:!0},width:{type:"string",default:600},height:{type:"string",default:600},url:{type:"string",default:""},embedHTML:{type:"string",default:""}},edit:i.a,save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e){function t(){d({editingURL:!0,is_public:!0})}function n(e){e&&e.preventDefault(),w?(d({fetching:!0}),setTimeout(function(){d({fetching:!1,cannotEmbed:!1,editingURL:!1,embedHTML:"ready"})},500)):d({cannotEmbed:!0,fetching:!1,editingURL:!0})}var r=e.attributes,c=e.className,d=e.setAttributes,w=r.url,y=r.editingURL,v=r.fetching,g=r.cannotEmbed,E=r.embedHTML,L=r.height,_=r.width,k=r.powered_by,O=r.is_public,S=r.align,U=h?h({className:"align"+S,style:{width:_+"px",height:L+"px"}}):[];return wp.element.createElement(b,null,wp.element.createElement(f,null,wp.element.createElement(u,{title:__("Customize Embedded Calendar","embedpress")},wp.element.createElement("p",null,__("You can adjust the width and height of embedded content.","embedpress")),wp.element.createElement(p,{label:__("Width","embedpress"),value:_,onChange:function(e){return d({width:e})}}),wp.element.createElement(p,{label:__("Height","embedpress"),value:L,onChange:function(e){return d({height:e})}})),wp.element.createElement(u,{title:__("Calendar Type and other options","embedpress")},wp.element.createElement("p",null,__("You can show public calendar without any API key","embedpress")),wp.element.createElement(m,{label:__("Powered By","embedpress"),onChange:function(e){return d({powered_by:e})},checked:k}),wp.element.createElement(m,{label:__("Embedding Public Calendar","embedpress"),onChange:function(e){return d({is_public:e})},checked:O}))),(!E||y)&&!v&&O&&wp.element.createElement("div",U,wp.element.createElement(i.a,{label:__("Public Calendar Link"),onSubmit:n,value:w,cannotEmbed:g,onChange:function(e){return d({url:e.target.value})},icon:a.a,DocTitle:__("Learn more about EmbedPress Calendar"),docLink:"https://embedpress.com/docs/"})),v?wp.element.createElement("div",{className:c},wp.element.createElement(o.a,null)," "):null,E&&O&&!y&&!v&&wp.element.createElement("figure",U,O&&wp.element.createElement("iframe",{style:{display:v?"none":""},src:w,width:_,height:L}),k&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:d({interactive:!0})}),wp.element.createElement(l.a,{showEditButton:E&&!g,switchBackToURLInput:t})),!O&&wp.element.createElement("figure",s({className:"testing"},U),wp.element.createElement("p",null,"Private Calendar will show in the frontend only.",wp.element.createElement("br",null),wp.element.createElement("strong",null,"Note: Private calendar needs EmbedPress Pro.")),k&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:d({interactive:!0})}),wp.element.createElement(l.a,{showEditButton:E&&!g,switchBackToURLInput:t})))}t.a=r;var o=n(1),i=n(3),a=n(0),l=n(2),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=wp.components,p=c.TextControl,u=c.PanelBody,m=c.ToggleControl,d=wp.blockEditor,f=d.InspectorControls,h=d.useBlockProps,b=wp.element.Fragment,__=wp.i18n.__}]);
|
Gutenberg/dist/blocks.style.build.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.pdfobject-container{height:600px;width:600px;margin:0 auto}.embedpress-el-powered{text-align:center;margin-top:0 !important;font-size:16px !important;font-weight:700}.embedpress-embed-document iframe,[data-type="embedpress/document"] iframe{margin:0 auto;display:block}.embedpress-document-editmode .components-form-file-upload{display:none !important}
|
2 |
-
.embedpress-gutenberg-wrapper{margin:30px auto}.embedpress-gutenberg-wrapper iframe{max-width:100%}.embedpress-gutenberg-wrapper.alignright{max-width:100%}.ose-the-new-york-times iframe{min-height:500px;max-height:100%}body.page .flexia-wrapper>.content-area{padding:0 !important}.flexia-wrapper.flexia-container>.content-area{margin:0 !important}.flexia-wrapper.flexia-container>.content-area .embedpress-gutenberg-wrapper{margin:0 auto}@media only screen and (min-width: 482px){.entry-content>.embedpress-gutenberg-wrapper.alignright,.entry-content>.embedpress-gutenberg-wrapper.alignleft,.embedpress-gutenberg-wrapper.alignright,.embedpress-gutenberg-wrapper.alignleft{max-width:100%}}.clear::after{content:'';display:block;clear:both;min-height:1px}.embedpress-gutenberg-wrapper .alignleft,.embedpress-gutenberg-wrapper .alignright,.embedpress-gutenberg-wrapper .aligncenter{float:none;display:block}.embedpress-gutenberg-wrapper .alignright{text-align:right}.embedpress-gutenberg-wrapper .alignleft{text-align:left}.embedpress-gutenberg-wrapper .aligncenter{clear:both;display:block;float:none;margin-right:auto;margin-left:auto;text-align:center}.embedpress-gutenberg-wrapper .ose-embedpress-responsive{display:inline-block}.embedpress-gutenberg-wrapper{max-width:100% !important}
|
3 |
-
.pdfobject-container{height:600px;width:600px;margin:0 auto}.embedpress-el-powered{text-align:center;margin-top:10px !important;font-size:16px !important;font-weight:700}.embedpress-embed-document iframe,[data-type="embedpress/document"] iframe{margin:0 auto;display:block}.embedpress-embed-document{max-width:100%}.embedpress-document-editmode .components-form-file-upload{display:none !important}.wp-block-embedpress-embedpress-pdf+*{clear:both}
|
4 |
.embedpress-calendar-gutenberg{margin:30px auto}.embedpress-calendar-gutenberg iframe{max-width:100%}.embedpress-calendar-gutenberg.alignright{max-width:100%}body.page .flexia-wrapper>.content-area{padding:0 !important}.flexia-wrapper.flexia-container>.content-area{margin:0 !important}.flexia-wrapper.flexia-container>.content-area .embedpress-calendar-gutenberg{margin:0 auto}@media only screen and (min-width: 482px){.entry-content>.embedpress-calendar-gutenberg.alignright,.entry-content>.embedpress-calendar-gutenberg.alignleft,.embedpress-calendar-gutenberg.alignright,.embedpress-calendar-gutenberg.alignleft{max-width:100%}}.clear::after{content:'';display:block;clear:both;min-height:1px}
|
1 |
+
.pdfobject-container{height:600px;width:600px;margin:0 auto}.embedpress-el-powered{text-align:center;margin-top:0 !important;font-size:16px !important;font-weight:700}.embedpress-embed-document iframe,[data-type="embedpress/document"] iframe{margin:0 auto;display:block}.embedpress-embed-document-pdf{width:100%}.embedpress-document-editmode .components-form-file-upload{display:none !important}
|
2 |
+
.embedpress-gutenberg-wrapper{margin:30px auto}.embedpress-gutenberg-wrapper iframe{max-width:100%}.embedpress-gutenberg-wrapper.alignright{max-width:100%}.ose-the-new-york-times iframe{min-height:500px;max-height:100%}body.page .flexia-wrapper>.content-area{padding:0 !important}.flexia-wrapper.flexia-container>.content-area{margin:0 !important}.flexia-wrapper.flexia-container>.content-area .embedpress-gutenberg-wrapper{margin:0 auto}@media only screen and (min-width: 482px){.entry-content>.embedpress-gutenberg-wrapper.alignright,.entry-content>.embedpress-gutenberg-wrapper.alignleft,.embedpress-gutenberg-wrapper.alignright,.embedpress-gutenberg-wrapper.alignleft{max-width:100%}}.clear::after{content:'';display:block;clear:both;min-height:1px}.embedpress-gutenberg-wrapper .alignleft,.embedpress-gutenberg-wrapper .alignright,.embedpress-gutenberg-wrapper .aligncenter{float:none;display:block}.embedpress-gutenberg-wrapper .alignright{text-align:right}.embedpress-gutenberg-wrapper .alignleft{text-align:left}.embedpress-gutenberg-wrapper .aligncenter{clear:both;display:block;float:none;margin-right:auto;margin-left:auto;text-align:center}.embedpress-gutenberg-wrapper .ose-embedpress-responsive{display:inline-block}.embedpress-gutenberg-wrapper{max-width:100% !important}.ep-first-video{position:relative;height:0;padding-bottom:56.25%}.ep-first-video iframe{position:absolute;top:0;left:0;width:100%;height:100%}.components-base-control__label{font-weight:600}.components-input-control__label{font-weight:600}.components-base-control__field,.components-input-control__label{font-weight:600}label.components-truncate.components-text.components-input-control__label.em5sgkm4.ecfd-bd--d-eecc-1iznhho.em57xhy0{font-weight:600 !important}.text-center{text-align:center !important}.wp-block-embed.is-loading{-ms-flex-align:center;align-items:center}.css-vwt1e3{margin:0px 11px 0px !important}.toolbar{display:none}.ep-youtube__content__pagination .ep-prev,.ep-youtube__content__pagination .ep-next{user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}
|
3 |
+
.pdfobject-container{height:600px;width:600px;margin:0 auto}.embedpress-el-powered{text-align:center;margin-top:10px !important;font-size:16px !important;font-weight:700}.embedpress-embed-document iframe,[data-type="embedpress/document"] iframe{margin:0 auto;display:block}.embedpress-embed-document{max-width:100%}.embedpress-document-editmode .components-form-file-upload{display:none !important}.wp-block-embedpress-embedpress-pdf+*{clear:both}.pro-control{position:relative}span.isPro{position:absolute;z-index:1;background:#5B4E96;border-radius:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:40px;height:18px;font-size:10px;right:0;color:#fff;font-weight:400;text-transform:uppercase;top:0}.pro-control:after{content:'';width:100%;height:100%;background:transparent;position:absolute;z-index:12;top:0;bottom:0}.theme-astra span.isPro{right:10px;top:5px}.pro-control:hover::after{cursor:pointer}.pro__alert__wrap{position:fixed;top:0;left:0;height:100%;width:100%;background:rgba(0,0,0,0.3);z-index:1;display:none}.pro__alert__wrap .pro__alert__card{width:calc(100% - 30px);max-width:500px;margin:7% auto 0;background:#fff;border-radius:20px;padding:30px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;text-align:center}.pro__alert__wrap .pro__alert__card h2{font-size:32px;font-weight:450;color:#131F4D;margin-bottom:15px}.pro__alert__wrap .pro__alert__card p{font-size:14px;font-weight:400;color:#7C8DB5;margin-top:10px}.pro__alert__wrap .pro__alert__card .button{-ms-flex-item-align:end;align-self:flex-end;margin-top:20px;padding:6px 30px;border-radius:10px}.pro__alert__wrap .pro__alert__card p a{text-decoration:underline;font-weight:700;color:#131F4D}.template__wrapper .button:hover{background:#5B4E96 !important;color:#fff !important;border-color:#5B4E96 !important}.pro__alert__wrap .pro__alert__card img{height:100px;margin-bottom:20px}.pro-control .components-toggle-control__label{color:#bbacac}.pro-control .components-form-toggle .components-form-toggle__track{border:1px solid #b89d9d}.pro-control .components-form-toggle .components-form-toggle__thumb{background-color:#b89d9d;border:5px solid #b89d9d}.embedpress-document-embed{display:inline-block}.block-editor-block-inspector .components-base-control{margin-top:15px}.pro-control-active{margin-bottom:24px}
|
4 |
.embedpress-calendar-gutenberg{margin:30px auto}.embedpress-calendar-gutenberg iframe{max-width:100%}.embedpress-calendar-gutenberg.alignright{max-width:100%}body.page .flexia-wrapper>.content-area{padding:0 !important}.flexia-wrapper.flexia-container>.content-area{margin:0 !important}.flexia-wrapper.flexia-container>.content-area .embedpress-calendar-gutenberg{margin:0 auto}@media only screen and (min-width: 482px){.entry-content>.embedpress-calendar-gutenberg.alignright,.entry-content>.embedpress-calendar-gutenberg.alignleft,.embedpress-calendar-gutenberg.alignright,.embedpress-calendar-gutenberg.alignleft{max-width:100%}}.clear::after{content:'';display:block;clear:both;min-height:1px}
|
Gutenberg/plugin.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Blocks Initializer
|
4 |
*
|
@@ -11,7 +12,7 @@
|
|
11 |
// Exit if accessed directly.
|
12 |
use EmbedPress\Includes\Classes\Helper;
|
13 |
|
14 |
-
if (
|
15 |
exit;
|
16 |
}
|
17 |
|
@@ -22,18 +23,19 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
22 |
* @uses {wp-editor} for WP editor styles.
|
23 |
* @since 1.0.0
|
24 |
*/
|
25 |
-
function embedpress_blocks_cgb_block_assets()
|
|
|
26 |
// Styles.
|
27 |
wp_enqueue_style(
|
28 |
'embedpress_blocks-cgb-style-css', // Handle.
|
29 |
-
EMBEDPRESS_GUTENBERG_DIR_URL.'dist/blocks.style.build.css', // Block style CSS.
|
30 |
-
is_admin() ? array(
|
31 |
-
filemtime(
|
32 |
);
|
33 |
}
|
34 |
|
35 |
// Hook: Frontend assets.
|
36 |
-
add_action(
|
37 |
|
38 |
/**
|
39 |
* Enqueue Gutenberg block assets for backend editor.
|
@@ -44,61 +46,68 @@ add_action( 'enqueue_block_assets', 'embedpress_blocks_cgb_block_assets' );
|
|
44 |
* @uses {wp-editor} for WP editor styles.
|
45 |
* @since 1.0.0
|
46 |
*/
|
47 |
-
function embedpress_blocks_cgb_editor_assets()
|
|
|
48 |
// Scripts.
|
49 |
-
if (!
|
50 |
-
wp_enqueue_script(
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
wp_enqueue_script(
|
55 |
'embedpress_blocks-cgb-block-js', // Handle.
|
56 |
-
EMBEDPRESS_GUTENBERG_DIR_URL.'/dist/blocks.build.js', // Block.build.js: We register the block here. Built with Webpack.
|
57 |
-
array(
|
58 |
-
filemtime(
|
59 |
true // Enqueue the script in the footer.
|
60 |
);
|
61 |
$wistia_labels = array(
|
62 |
-
'watch_from_beginning' => __(
|
63 |
-
'skip_to_where_you_left_off' => __(
|
64 |
-
'you_have_watched_it_before' => __(
|
65 |
);
|
66 |
-
$elements = (array) get_option(
|
67 |
-
$active_blocks = isset(
|
68 |
|
69 |
-
$wistia_labels = json_encode(
|
70 |
$wistia_options = null;
|
71 |
-
if (
|
72 |
$wistia_options = embedpress_wisita_pro_get_options();
|
73 |
endif;
|
74 |
$pars_url = wp_parse_url(get_site_url());
|
75 |
$documents_cta_options = (array) get_option(EMBEDPRESS_PLG_NAME . ':document');
|
76 |
-
wp_localize_script(
|
77 |
'wistia_labels' => $wistia_labels,
|
78 |
'wisita_options' => $wistia_options,
|
79 |
-
'embedpress_powered_by' => apply_filters('embedpress_document_block_powered_by',true),
|
80 |
'embedpress_pro' => defined('EMBEDPRESS_PRO_PLUGIN_FILE'),
|
81 |
-
'twitch_host' => !empty($pars_url['host'])
|
82 |
'site_url' => site_url(),
|
83 |
'active_blocks' => $active_blocks,
|
84 |
'document_cta' => $documents_cta_options,
|
85 |
'pdf_renderer' => Helper::get_pdf_renderer(),
|
86 |
-
|
|
|
87 |
|
88 |
// Styles.
|
89 |
wp_enqueue_style(
|
90 |
'embedpress_blocks-cgb-block-editor-css', // Handle.
|
91 |
EMBEDPRESS_GUTENBERG_DIR_URL . 'dist/blocks.editor.build.css', // Block editor CSS.
|
92 |
-
array(
|
93 |
-
filemtime(
|
94 |
);
|
95 |
}
|
96 |
|
97 |
// Hook: Editor assets.
|
98 |
-
add_action(
|
99 |
|
100 |
|
101 |
-
function embedpress_block_category(
|
|
|
102 |
return array_merge(
|
103 |
$categories,
|
104 |
array(
|
@@ -109,20 +118,18 @@ function embedpress_block_category( $categories, $post ) {
|
|
109 |
),
|
110 |
)
|
111 |
);
|
112 |
-
|
113 |
}
|
114 |
-
$wp_version = get_bloginfo(
|
115 |
-
if (
|
116 |
-
add_filter(
|
117 |
-
|
118 |
-
|
119 |
-
add_filter( 'block_categories', 'embedpress_block_category', 10, 2 );
|
120 |
}
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
-
foreach (
|
126 |
require_once $block_logic;
|
127 |
}
|
128 |
|
@@ -130,17 +137,18 @@ foreach ( glob( EMBEDPRESS_GUTENBERG_DIR_PATH . 'block-backend/*.php' ) as $bloc
|
|
130 |
* Registers the embedpress gutneberg block on server.
|
131 |
*/
|
132 |
|
133 |
-
function embedpress_gutenberg_register_all_block()
|
134 |
-
|
|
|
135 |
|
136 |
-
$elements = (array) get_option(
|
137 |
-
$g_blocks = isset(
|
138 |
-
$blocks_to_registers = [
|
139 |
|
140 |
-
foreach (
|
141 |
-
if (
|
142 |
-
if (
|
143 |
-
register_block_type(
|
144 |
'render_callback' => 'embedpress_render_block',
|
145 |
'attributes' => array(
|
146 |
'height' => [
|
@@ -153,119 +161,299 @@ function embedpress_gutenberg_register_all_block() {
|
|
153 |
],
|
154 |
),
|
155 |
]);
|
156 |
-
}elseif (
|
157 |
-
register_block_type(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
'render_callback' => 'embedpress_pdf_render_block',
|
159 |
]);
|
160 |
-
}elseif (
|
161 |
-
register_block_type(
|
162 |
-
|
163 |
]);
|
164 |
-
}else{
|
165 |
-
register_block_type(
|
166 |
}
|
167 |
-
}else{
|
168 |
|
169 |
-
if (
|
170 |
-
unregister_block_type(
|
171 |
}
|
172 |
-
|
173 |
}
|
174 |
}
|
175 |
|
176 |
endif;
|
177 |
}
|
178 |
|
179 |
-
add_action(
|
180 |
|
181 |
-
function embedpress_pdf_render_block(
|
|
|
182 |
|
183 |
-
if (
|
184 |
$renderer = Helper::get_pdf_renderer();
|
185 |
$pdf_url = $attributes['href'];
|
186 |
-
$id = !empty(
|
187 |
-
$width = !empty(
|
188 |
-
$height = !empty(
|
189 |
-
$gen_settings = get_option(
|
190 |
-
|
191 |
-
|
|
|
192 |
$powered_by = $attributes['powered_by'];
|
193 |
}
|
194 |
|
195 |
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . $attributes['href'];
|
196 |
-
$hash = md5(
|
197 |
$aligns = [
|
198 |
'left' => 'alignleft',
|
199 |
'right' => 'alignright',
|
200 |
'wide' => 'alignwide',
|
201 |
'full' => 'alignfull'
|
202 |
];
|
203 |
-
$alignment = isset($attributes['align']) && isset($aligns[$attributes['align']])
|
204 |
$dimension = "width:$width;height:$height";
|
205 |
ob_start();
|
206 |
?>
|
207 |
-
<div class="embedpress-document-embed embedpress-pdf ose-document ep-doc-<?php echo esc_attr(
|
208 |
-
<iframe style="<?php echo esc_attr(
|
209 |
-
frameborder="0"></iframe>
|
210 |
|
211 |
-
<?php do_action(
|
212 |
|
213 |
<?php
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
|
218 |
</div>
|
219 |
-
|
220 |
-
|
|
|
|
|
221 |
}
|
222 |
-
}
|
223 |
|
224 |
-
function embedpress_calendar_render_block(
|
225 |
-
|
226 |
-
|
227 |
-
$
|
|
|
|
|
228 |
$hash = md5($id);
|
229 |
-
$width = !empty(
|
230 |
-
$height = !empty(
|
231 |
-
$gen_settings = get_option(
|
232 |
-
$powered_by = isset(
|
233 |
-
if (
|
234 |
$powered_by = $attributes['powered_by'];
|
235 |
}
|
236 |
|
237 |
-
|
238 |
$aligns = [
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
];
|
244 |
-
$alignment = isset($attributes['align']) && isset($aligns[$attributes['align']])
|
245 |
$dimension = "width:$width;height:$height";
|
246 |
ob_start();
|
247 |
?>
|
248 |
-
|
249 |
|
250 |
-
|
251 |
-
if (
|
252 |
-
|
253 |
-
<iframe style="<?php echo esc_attr(
|
254 |
-
|
255 |
-
if (
|
256 |
echo Embedpress_Google_Helper::shortcode();
|
257 |
}
|
258 |
-
|
259 |
} ?>
|
260 |
-
|
261 |
-
|
262 |
-
<?php
|
263 |
-
if ($powered_by ) {
|
264 |
-
printf( '<p class="embedpress-el-powered">%s</p>', __( 'Powered By EmbedPress', 'embedpress' ) );
|
265 |
-
}?>
|
266 |
|
267 |
-
</div>
|
268 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
return ob_get_clean();
|
|
|
|
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Blocks Initializer
|
5 |
*
|
12 |
// Exit if accessed directly.
|
13 |
use EmbedPress\Includes\Classes\Helper;
|
14 |
|
15 |
+
if (!defined('ABSPATH')) {
|
16 |
exit;
|
17 |
}
|
18 |
|
23 |
* @uses {wp-editor} for WP editor styles.
|
24 |
* @since 1.0.0
|
25 |
*/
|
26 |
+
function embedpress_blocks_cgb_block_assets()
|
27 |
+
{ // phpcs:ignore
|
28 |
// Styles.
|
29 |
wp_enqueue_style(
|
30 |
'embedpress_blocks-cgb-style-css', // Handle.
|
31 |
+
EMBEDPRESS_GUTENBERG_DIR_URL . 'dist/blocks.style.build.css', // Block style CSS.
|
32 |
+
is_admin() ? array('wp-editor') : null, // Dependency to include the CSS after it.
|
33 |
+
filemtime(EMBEDPRESS_GUTENBERG_DIR_PATH . 'dist/blocks.style.build.css') // Version: File modification time.
|
34 |
);
|
35 |
}
|
36 |
|
37 |
// Hook: Frontend assets.
|
38 |
+
add_action('enqueue_block_assets', 'embedpress_blocks_cgb_block_assets');
|
39 |
|
40 |
/**
|
41 |
* Enqueue Gutenberg block assets for backend editor.
|
46 |
* @uses {wp-editor} for WP editor styles.
|
47 |
* @since 1.0.0
|
48 |
*/
|
49 |
+
function embedpress_blocks_cgb_editor_assets()
|
50 |
+
{ // phpcs:ignore
|
51 |
// Scripts.
|
52 |
+
if (!wp_script_is('embedpress-pdfobject')) {
|
53 |
+
wp_enqueue_script(
|
54 |
+
'embedpress-pdfobject',
|
55 |
+
EMBEDPRESS_URL_ASSETS . 'js/pdfobject.min.js',
|
56 |
+
[],
|
57 |
+
EMBEDPRESS_VERSION
|
58 |
+
);
|
59 |
}
|
60 |
|
61 |
wp_enqueue_script(
|
62 |
'embedpress_blocks-cgb-block-js', // Handle.
|
63 |
+
EMBEDPRESS_GUTENBERG_DIR_URL . '/dist/blocks.build.js', // Block.build.js: We register the block here. Built with Webpack.
|
64 |
+
array('wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-components', 'embedpress-pdfobject'), // Dependencies, defined above.
|
65 |
+
filemtime(EMBEDPRESS_GUTENBERG_DIR_PATH . 'dist/blocks.build.js'), // Version: File modification time.
|
66 |
true // Enqueue the script in the footer.
|
67 |
);
|
68 |
$wistia_labels = array(
|
69 |
+
'watch_from_beginning' => __('Watch from the beginning', 'embedpress'),
|
70 |
+
'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress'),
|
71 |
+
'you_have_watched_it_before' => __('It looks like you\'ve watched<br />part of this video before!', 'embedpress'),
|
72 |
);
|
73 |
+
$elements = (array) get_option(EMBEDPRESS_PLG_NAME . ":elements", []);
|
74 |
+
$active_blocks = isset($elements['gutenberg']) ? (array) $elements['gutenberg'] : [];
|
75 |
|
76 |
+
$wistia_labels = json_encode($wistia_labels);
|
77 |
$wistia_options = null;
|
78 |
+
if (function_exists('embedpress_wisita_pro_get_options')) :
|
79 |
$wistia_options = embedpress_wisita_pro_get_options();
|
80 |
endif;
|
81 |
$pars_url = wp_parse_url(get_site_url());
|
82 |
$documents_cta_options = (array) get_option(EMBEDPRESS_PLG_NAME . ':document');
|
83 |
+
wp_localize_script('embedpress_blocks-cgb-block-js', 'embedpressObj', array(
|
84 |
'wistia_labels' => $wistia_labels,
|
85 |
'wisita_options' => $wistia_options,
|
86 |
+
'embedpress_powered_by' => apply_filters('embedpress_document_block_powered_by', true),
|
87 |
'embedpress_pro' => defined('EMBEDPRESS_PRO_PLUGIN_FILE'),
|
88 |
+
'twitch_host' => !empty($pars_url['host']) ? $pars_url['host'] : '',
|
89 |
'site_url' => site_url(),
|
90 |
'active_blocks' => $active_blocks,
|
91 |
'document_cta' => $documents_cta_options,
|
92 |
'pdf_renderer' => Helper::get_pdf_renderer(),
|
93 |
+
'is_pro_plugin_active' => defined('EMBEDPRESS_SL_ITEM_SLUG'),
|
94 |
+
));
|
95 |
|
96 |
// Styles.
|
97 |
wp_enqueue_style(
|
98 |
'embedpress_blocks-cgb-block-editor-css', // Handle.
|
99 |
EMBEDPRESS_GUTENBERG_DIR_URL . 'dist/blocks.editor.build.css', // Block editor CSS.
|
100 |
+
array('wp-edit-blocks'), // Dependency to include the CSS after it.
|
101 |
+
filemtime(EMBEDPRESS_GUTENBERG_DIR_PATH . 'dist/blocks.editor.build.css') // Version: File modification time.
|
102 |
);
|
103 |
}
|
104 |
|
105 |
// Hook: Editor assets.
|
106 |
+
add_action('enqueue_block_editor_assets', 'embedpress_blocks_cgb_editor_assets');
|
107 |
|
108 |
|
109 |
+
function embedpress_block_category($categories, $post)
|
110 |
+
{
|
111 |
return array_merge(
|
112 |
$categories,
|
113 |
array(
|
118 |
),
|
119 |
)
|
120 |
);
|
|
|
121 |
}
|
122 |
+
$wp_version = get_bloginfo('version', 'display');
|
123 |
+
if (version_compare($wp_version, '5.8', '>=')) {
|
124 |
+
add_filter('block_categories_all', 'embedpress_block_category', 10, 2);
|
125 |
+
} else {
|
126 |
+
add_filter('block_categories', 'embedpress_block_category', 10, 2);
|
|
|
127 |
}
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
+
foreach (glob(EMBEDPRESS_GUTENBERG_DIR_PATH . 'block-backend/*.php') as $block_logic) {
|
133 |
require_once $block_logic;
|
134 |
}
|
135 |
|
137 |
* Registers the embedpress gutneberg block on server.
|
138 |
*/
|
139 |
|
140 |
+
function embedpress_gutenberg_register_all_block()
|
141 |
+
{
|
142 |
+
if (function_exists('register_block_type')) :
|
143 |
|
144 |
+
$elements = (array) get_option(EMBEDPRESS_PLG_NAME . ":elements", []);
|
145 |
+
$g_blocks = isset($elements['gutenberg']) ? (array) $elements['gutenberg'] : [];
|
146 |
+
$blocks_to_registers = ['twitch-block', 'google-slides-block', 'google-sheets-block', 'google-maps-block', 'google-forms-block', 'google-drawings-block', 'google-docs-block', 'embedpress', 'embedpress-pdf', 'embedpress-calendar', 'document'];
|
147 |
|
148 |
+
foreach ($blocks_to_registers as $blocks_to_register) {
|
149 |
+
if (!empty($g_blocks[$blocks_to_register])) {
|
150 |
+
if ('embedpress' === $blocks_to_register) {
|
151 |
+
register_block_type('embedpress/embedpress', [
|
152 |
'render_callback' => 'embedpress_render_block',
|
153 |
'attributes' => array(
|
154 |
'height' => [
|
161 |
],
|
162 |
),
|
163 |
]);
|
164 |
+
} elseif ('embedpress-pdf' === $blocks_to_register) {
|
165 |
+
register_block_type('embedpress/embedpress-pdf', [
|
166 |
+
'attributes' => array(
|
167 |
+
'powered_by' => [
|
168 |
+
'type' => 'boolean',
|
169 |
+
'default' => true
|
170 |
+
],
|
171 |
+
'presentation' => [
|
172 |
+
'type' => "boolean",
|
173 |
+
'default' => true,
|
174 |
+
],
|
175 |
+
'position' => [
|
176 |
+
'type' => "string",
|
177 |
+
'default' => 'top',
|
178 |
+
],
|
179 |
+
|
180 |
+
'print' => [
|
181 |
+
'type' => "boolean",
|
182 |
+
'default' => true,
|
183 |
+
],
|
184 |
+
|
185 |
+
'download' => [
|
186 |
+
'type' => "boolean",
|
187 |
+
'default' => true,
|
188 |
+
],
|
189 |
+
'open' => [
|
190 |
+
'type' => "boolean",
|
191 |
+
'default' => true,
|
192 |
+
],
|
193 |
+
'copy_text' => [
|
194 |
+
'type' => "boolean",
|
195 |
+
'default' => true,
|
196 |
+
],
|
197 |
+
'toolbar' => [
|
198 |
+
'type' => "boolean",
|
199 |
+
'default' => true,
|
200 |
+
],
|
201 |
+
'doc_details' => [
|
202 |
+
'type' => "boolean",
|
203 |
+
'default' => true,
|
204 |
+
],
|
205 |
+
'doc_rotation' => [
|
206 |
+
'type' => "boolean",
|
207 |
+
'default' => true,
|
208 |
+
],
|
209 |
+
),
|
210 |
'render_callback' => 'embedpress_pdf_render_block',
|
211 |
]);
|
212 |
+
} elseif ('embedpress-calendar' === $blocks_to_register) {
|
213 |
+
register_block_type('embedpress/embedpress-calendar', [
|
214 |
+
'render_callback' => 'embedpress_calendar_render_block',
|
215 |
]);
|
216 |
+
} else {
|
217 |
+
register_block_type('embedpress/' . $blocks_to_register);
|
218 |
}
|
219 |
+
} else {
|
220 |
|
221 |
+
if (WP_Block_Type_Registry::get_instance()->is_registered('embedpress/' . $blocks_to_register)) {
|
222 |
+
unregister_block_type('embedpress/' . $blocks_to_register);
|
223 |
}
|
|
|
224 |
}
|
225 |
}
|
226 |
|
227 |
endif;
|
228 |
}
|
229 |
|
230 |
+
add_action('init', 'embedpress_gutenberg_register_all_block');
|
231 |
|
232 |
+
function embedpress_pdf_render_block($attributes)
|
233 |
+
{
|
234 |
|
235 |
+
if (!empty($attributes['href'])) {
|
236 |
$renderer = Helper::get_pdf_renderer();
|
237 |
$pdf_url = $attributes['href'];
|
238 |
+
$id = !empty($attributes['id']) ? $attributes['id'] : 'embedpress-pdf-' . rand(100, 10000);
|
239 |
+
$width = !empty($attributes['width']) ? $attributes['width'] . 'px' : '600px';
|
240 |
+
$height = !empty($attributes['height']) ? $attributes['height'] . 'px' : '600px';
|
241 |
+
$gen_settings = get_option(EMBEDPRESS_PLG_NAME);
|
242 |
+
|
243 |
+
$powered_by = isset($gen_settings['embedpress_document_powered_by']) && 'yes' === $gen_settings['embedpress_document_powered_by'];
|
244 |
+
if (isset($attributes['powered_by'])) {
|
245 |
$powered_by = $attributes['powered_by'];
|
246 |
}
|
247 |
|
248 |
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . $attributes['href'];
|
249 |
+
$hash = md5($id);
|
250 |
$aligns = [
|
251 |
'left' => 'alignleft',
|
252 |
'right' => 'alignright',
|
253 |
'wide' => 'alignwide',
|
254 |
'full' => 'alignfull'
|
255 |
];
|
256 |
+
$alignment = isset($attributes['align']) && isset($aligns[$attributes['align']]) ? $aligns[$attributes['align']] : '';
|
257 |
$dimension = "width:$width;height:$height";
|
258 |
ob_start();
|
259 |
?>
|
260 |
+
<div class="embedpress-document-embed embedpress-pdf ose-document ep-doc-<?php echo esc_attr($hash) . ' ' . esc_attr($alignment) ?>">
|
261 |
+
<iframe class="embedpress-embed-document-pdf <?php echo esc_attr($id); ?>" style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block" src="<?php echo esc_attr($src); ?>" frameborder="0"></iframe>
|
|
|
262 |
|
263 |
+
<?php do_action('embedpress_pdf_gutenberg_after_embed', $hash, 'pdf', $attributes, $pdf_url); ?>
|
264 |
|
265 |
<?php
|
266 |
+
if ($powered_by) {
|
267 |
+
printf('<p class="embedpress-el-powered">%s</p>', __('Powered By EmbedPress', 'embedpress'));
|
268 |
+
} ?>
|
269 |
|
270 |
</div>
|
271 |
+
<?php ep_pdf_block_frontend_style($attributes, 'pdf');
|
272 |
+
|
273 |
+
return ob_get_clean();
|
274 |
+
}
|
275 |
}
|
|
|
276 |
|
277 |
+
function embedpress_calendar_render_block($attributes)
|
278 |
+
{
|
279 |
+
|
280 |
+
$id = !empty($attributes['id']) ? $attributes['id'] : 'embedpress-calendar-' . rand(100, 10000);
|
281 |
+
$url = !empty($attributes['url']) ? $attributes['url'] : '';
|
282 |
+
$is_private = isset($attributes['is_public']);
|
283 |
$hash = md5($id);
|
284 |
+
$width = !empty($attributes['width']) ? $attributes['width'] . 'px' : '600px';
|
285 |
+
$height = !empty($attributes['height']) ? $attributes['height'] . 'px' : '600px';
|
286 |
+
$gen_settings = get_option(EMBEDPRESS_PLG_NAME);
|
287 |
+
$powered_by = isset($gen_settings['embedpress_document_powered_by']) && 'yes' === $gen_settings['embedpress_document_powered_by'];
|
288 |
+
if (isset($attributes['powered_by'])) {
|
289 |
$powered_by = $attributes['powered_by'];
|
290 |
}
|
291 |
|
|
|
292 |
$aligns = [
|
293 |
+
'left' => 'alignleft',
|
294 |
+
'right' => 'alignright',
|
295 |
+
'wide' => 'alignwide',
|
296 |
+
'full' => 'alignfull'
|
297 |
];
|
298 |
+
$alignment = isset($attributes['align']) && isset($aligns[$attributes['align']]) ? $aligns[$attributes['align']] : '';
|
299 |
$dimension = "width:$width;height:$height";
|
300 |
ob_start();
|
301 |
?>
|
302 |
+
<div class="embedpress-calendar-gutenberg embedpress-calendar ose-calendar <?php echo esc_attr($alignment) ?>" style="<?php echo esc_attr($dimension); ?>; max-width:100%;">
|
303 |
|
304 |
+
<?php
|
305 |
+
if (!empty($url) && !$is_private) {
|
306 |
+
?>
|
307 |
+
<iframe style="<?php echo esc_attr($dimension); ?>; max-width:100%; display: inline-block" src="<?php echo esc_attr($url); ?>"></iframe>
|
308 |
+
<?php } else {
|
309 |
+
if (is_embedpress_pro_active()) {
|
310 |
echo Embedpress_Google_Helper::shortcode();
|
311 |
}
|
|
|
312 |
} ?>
|
313 |
+
<?php do_action('embedpress_calendar_gutenberg_after_embed', $hash, 'calendar', $attributes); ?>
|
|
|
|
|
|
|
|
|
|
|
314 |
|
|
|
315 |
<?php
|
316 |
+
if ($powered_by) {
|
317 |
+
printf('<p class="embedpress-el-powered">%s</p>', __('Powered By EmbedPress', 'embedpress'));
|
318 |
+
} ?>
|
319 |
+
|
320 |
+
</div>
|
321 |
+
<?php
|
322 |
return ob_get_clean();
|
323 |
+
}
|
324 |
+
|
325 |
|
326 |
+
/**
|
327 |
+
* FrontEnd Style for PDF Block
|
328 |
+
*/
|
329 |
+
function ep_pdf_block_frontend_style($attributes, $embed)
|
330 |
+
{
|
331 |
+
if ($embed === 'pdf') : ?>
|
332 |
+
<script>
|
333 |
+
{
|
334 |
+
let x = 0;
|
335 |
+
const setEmbedInterval = setInterval(() => {
|
336 |
+
x++;
|
337 |
+
if (document.querySelector('<?php echo esc_html('.' . $attributes['id']); ?>')) {
|
338 |
+
const isDisplay = (selectorName) => {
|
339 |
+
if (!selectorName) {
|
340 |
+
selectorName = 'none';
|
341 |
+
} else {
|
342 |
+
selectorName = 'block';
|
343 |
+
}
|
344 |
+
|
345 |
+
return selectorName;
|
346 |
+
}
|
347 |
+
|
348 |
+
const frm = document.querySelector('<?php echo esc_html('.' . $attributes['id']); ?>').contentWindow.document;
|
349 |
+
const otherhead = frm.getElementsByTagName("head")[0];
|
350 |
+
const style = frm.createElement("style");
|
351 |
+
style.setAttribute('id', 'EBiframeStyleID');
|
352 |
+
|
353 |
+
let toolbar = <?php echo esc_html($attributes['toolbar'] ? $attributes['toolbar'] : 0); ?>;
|
354 |
+
let presentation = <?php echo esc_html($attributes['presentation'] ? $attributes['presentation'] : 0); ?>;
|
355 |
+
let download = <?php echo esc_html($attributes['download'] ? $attributes['download'] : 0); ?>;
|
356 |
+
let open = <?php echo esc_html($attributes['open'] ? $attributes['open'] : 0); ?>;
|
357 |
+
let copy_text = <?php echo esc_html($attributes['copy_text'] ? $attributes['copy_text'] : 0); ?>;
|
358 |
+
let doc_details = <?php echo esc_html($attributes['doc_details'] ? $attributes['doc_details'] : 0); ?>;
|
359 |
+
let doc_rotation = <?php echo esc_html($attributes['doc_rotation'] ? $attributes['doc_rotation'] : 0); ?>;
|
360 |
+
let toolbar_position = '<?php echo esc_html($attributes['position'] ? $attributes['position'] : 0); ?>';
|
361 |
+
|
362 |
+
toolbar = isDisplay(toolbar);
|
363 |
+
presentation = isDisplay(presentation);
|
364 |
+
download = isDisplay(download);
|
365 |
+
open = isDisplay(open);
|
366 |
+
copy_text = isDisplay(copy_text);
|
367 |
+
|
368 |
+
|
369 |
+
<?php if(!defined('EMBEDPRESS_PRO_PLUGIN_FILE')): ?>
|
370 |
+
download = 'block';
|
371 |
+
copy_text = 'block';
|
372 |
+
<?php endif; ?>
|
373 |
+
|
374 |
+
if (copy_text === 'block') {
|
375 |
+
copy_text = 'all';
|
376 |
+
}
|
377 |
+
|
378 |
+
doc_details = isDisplay(doc_details);
|
379 |
+
doc_rotation = isDisplay(doc_rotation);
|
380 |
+
|
381 |
+
if (toolbar_position == 'top') {
|
382 |
+
toolbar_position = 'top:0;bottom:auto;';
|
383 |
+
settingsPos = '';
|
384 |
+
} else {
|
385 |
+
toolbar_position = 'bottom:0;top:auto;'
|
386 |
+
settingsPos = `
|
387 |
+
.findbar, .secondaryToolbar {
|
388 |
+
top: auto;bottom: 32px;
|
389 |
+
}
|
390 |
+
.doorHangerRight:after{
|
391 |
+
transform: rotate(180deg);
|
392 |
+
bottom: -16px;
|
393 |
+
}
|
394 |
+
.doorHangerRight:before {
|
395 |
+
transform: rotate(180deg);
|
396 |
+
bottom: -18px;
|
397 |
+
}
|
398 |
+
|
399 |
+
.findbar.doorHanger:before {
|
400 |
+
bottom: -18px;
|
401 |
+
transform: rotate(180deg);
|
402 |
+
}
|
403 |
+
.findbar.doorHanger:after {
|
404 |
+
bottom: -16px;
|
405 |
+
transform: rotate(180deg);
|
406 |
+
}
|
407 |
+
`;
|
408 |
+
}
|
409 |
+
style.textContent = `
|
410 |
+
.toolbar{
|
411 |
+
display: ${toolbar}!important;
|
412 |
+
position: absolute;
|
413 |
+
${toolbar_position}
|
414 |
+
|
415 |
+
}
|
416 |
+
#secondaryToolbar{
|
417 |
+
display: ${toolbar};
|
418 |
+
}
|
419 |
+
#secondaryPresentationMode, #toolbarViewerRight #presentationMode{
|
420 |
+
display: ${presentation}!important;
|
421 |
+
}
|
422 |
+
#secondaryOpenFile, #toolbarViewerRight #openFile{
|
423 |
+
display: none!important;
|
424 |
+
}
|
425 |
+
#secondaryDownload, #secondaryPrint, #toolbarViewerRight #print, #toolbarViewerRight #download{
|
426 |
+
display: ${download}!important;
|
427 |
+
}
|
428 |
+
|
429 |
+
#pageRotateCw{
|
430 |
+
display: ${doc_rotation}!important;
|
431 |
+
}
|
432 |
+
#pageRotateCcw{
|
433 |
+
display: ${doc_rotation}!important;
|
434 |
+
}
|
435 |
+
#documentProperties{
|
436 |
+
display: ${doc_details}!important;
|
437 |
+
}
|
438 |
+
.textLayer{
|
439 |
+
user-select: ${copy_text}!important;
|
440 |
+
}
|
441 |
+
${settingsPos}
|
442 |
+
`;
|
443 |
+
if (otherhead) {
|
444 |
+
if(frm.getElementById("EBiframeStyleID")){
|
445 |
+
frm.getElementById("EBiframeStyleID").remove();
|
446 |
+
}
|
447 |
+
otherhead.appendChild(style);
|
448 |
+
clearInterval(setEmbedInterval);
|
449 |
+
}
|
450 |
+
}
|
451 |
+
if (x > 50) {
|
452 |
+
clearInterval(setEmbedInterval);
|
453 |
+
}
|
454 |
+
}, 100);
|
455 |
+
}
|
456 |
+
</script>
|
457 |
+
<?php
|
458 |
+
endif;
|
459 |
}
|
assets/css/el-icon.css
CHANGED
@@ -60,18 +60,42 @@
|
|
60 |
content: '';
|
61 |
position: absolute;
|
62 |
width: 100%;
|
63 |
-
height: 100
|
64 |
display: block;
|
65 |
top: 0;
|
66 |
left: 0;
|
67 |
bottom: 0;
|
68 |
right: 0;
|
69 |
z-index: 99;
|
70 |
-
background: transparent;
|
71 |
}
|
72 |
|
73 |
|
74 |
.elementor-control.elementor-control-embedpress_pro_section.elementor-control-type-section.elementor-label-inline.elementor-control-separator-none .elementor-panel-heading-title {
|
75 |
color: #ff5544;
|
76 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
/*EmbedPress Pro Controls Style Ends*/
|
60 |
content: '';
|
61 |
position: absolute;
|
62 |
width: 100%;
|
63 |
+
height: 100%!important;
|
64 |
display: block;
|
65 |
top: 0;
|
66 |
left: 0;
|
67 |
bottom: 0;
|
68 |
right: 0;
|
69 |
z-index: 99;
|
70 |
+
background: transparent!important;
|
71 |
}
|
72 |
|
73 |
|
74 |
.elementor-control.elementor-control-embedpress_pro_section.elementor-control-type-section.elementor-label-inline.elementor-control-separator-none .elementor-panel-heading-title {
|
75 |
color: #ff5544;
|
76 |
}
|
77 |
+
|
78 |
+
.elementor-control-pagesize .elementor-label-inline>.elementor-control-content>.elementor-control-field>.elementor-control-input-wrapper, .elementor-control-gapbetweenvideos .elementor-slider-input, .elementor-control-columns .elementor-control-input-wrapper.elementor-control-unit-5 {
|
79 |
+
width: 54px!important;
|
80 |
+
}
|
81 |
+
.embedpress-pro-control .elementor-control-input-wrapper {
|
82 |
+
filter: grayscale(1);
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
.embedpress-pro-control:after {
|
87 |
+
content: '';
|
88 |
+
position: absolute;
|
89 |
+
width: 100%;
|
90 |
+
height: 100%!important;
|
91 |
+
display: block;
|
92 |
+
top: 0;
|
93 |
+
left: 0;
|
94 |
+
bottom: 0;
|
95 |
+
right: 0;
|
96 |
+
z-index: 99;
|
97 |
+
background: transparent!important;
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
/*EmbedPress Pro Controls Style Ends*/
|
assets/js/front.js
CHANGED
@@ -9,23 +9,23 @@
|
|
9 |
'use strict';
|
10 |
// function equivalent to jquery ready()
|
11 |
function ready(fn) {
|
12 |
-
if (document.readyState !== 'loading'){
|
13 |
fn();
|
14 |
} else {
|
15 |
document.addEventListener('DOMContentLoaded', fn);
|
16 |
}
|
17 |
}
|
18 |
|
19 |
-
ready(function() {
|
20 |
let option = {
|
21 |
forceObject: true,
|
22 |
};
|
23 |
let selector = document.querySelectorAll('.embedpress-embed-document-pdf');
|
24 |
if (selector.length) {
|
25 |
-
selector.forEach((function(value, index, thisArg) {
|
26 |
-
|
27 |
-
|
28 |
-
PDFObject.embed(src, "."+id, option);
|
29 |
}));
|
30 |
}
|
31 |
youtubeChannelGallery();
|
@@ -46,18 +46,18 @@
|
|
46 |
var proportion, parentWidth;
|
47 |
|
48 |
// Loop iframe elements.
|
49 |
-
document.querySelectorAll(
|
50 |
// Only continue if the iframe has a width & height defined.
|
51 |
-
if (
|
52 |
// Calculate the proportion/ratio based on the width & height.
|
53 |
-
proportion = parseFloat(
|
54 |
// Get the parent element's width.
|
55 |
-
parentWidth = parseFloat(
|
56 |
// Set the max-width & height.
|
57 |
iframe.style.maxWidth = '100%';
|
58 |
-
iframe.style.maxHeight = Math.round(
|
59 |
}
|
60 |
-
}
|
61 |
}
|
62 |
|
63 |
// Run on initial load.
|
@@ -88,15 +88,15 @@
|
|
88 |
Element.prototype.mozMatchesSelector ||
|
89 |
Element.prototype.msMatchesSelector ||
|
90 |
Element.prototype.oMatchesSelector ||
|
91 |
-
function(s) {
|
92 |
var matches = (this.document || this.ownerDocument).querySelectorAll(s),
|
93 |
i = matches.length;
|
94 |
-
while (--i >= 0 && matches.item(i) !== this) {}
|
95 |
return i > -1;
|
96 |
};
|
97 |
}
|
98 |
-
var delegate = function(el, evt, sel, handler) {
|
99 |
-
el.addEventListener(evt, function(event) {
|
100 |
var t = event.target;
|
101 |
while (t && t !== this) {
|
102 |
if (t.matches(sel)) {
|
@@ -115,7 +115,7 @@
|
|
115 |
if (postData) {
|
116 |
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
117 |
}
|
118 |
-
req.onreadystatechange = function() {
|
119 |
if (req.readyState != 4) return;
|
120 |
if (req.status != 200 && req.status != 304) {
|
121 |
return;
|
@@ -127,22 +127,22 @@
|
|
127 |
}
|
128 |
|
129 |
var XMLHttpFactories = [
|
130 |
-
function() {
|
131 |
return new XMLHttpRequest();
|
132 |
},
|
133 |
-
function() {
|
134 |
return new ActiveXObject("Msxml3.XMLHTTP");
|
135 |
},
|
136 |
-
function() {
|
137 |
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
|
138 |
},
|
139 |
-
function() {
|
140 |
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
|
141 |
},
|
142 |
-
function() {
|
143 |
return new ActiveXObject("Msxml2.XMLHTTP");
|
144 |
},
|
145 |
-
function() {
|
146 |
return new ActiveXObject("Microsoft.XMLHTTP");
|
147 |
},
|
148 |
];
|
@@ -162,25 +162,26 @@
|
|
162 |
function youtubeChannelGallery() {
|
163 |
var playerWraps = document.getElementsByClassName("ep-player-wrap");
|
164 |
if (playerWraps && playerWraps.length) {
|
165 |
-
for (var i=0, im=playerWraps.length; im>i; i++) {
|
166 |
youtubeChannelEvents(playerWraps[i])
|
167 |
}
|
168 |
}
|
169 |
}
|
170 |
-
function youtubeChannelEvents(playerWrap){
|
171 |
-
|
|
|
|
|
|
|
172 |
var embed = "https://www.youtube.com/embed/";
|
173 |
var vid = this.getAttribute("data-vid");
|
174 |
var iframe = playerWrap.getElementsByTagName("iframe");
|
175 |
-
if(vid) {
|
176 |
-
if(iframe){
|
177 |
var vidSrc = iframe[0].src.replace(/(.*\/embed\/)([^\?&"'>]+)(.+)?/, `\$1${vid}\$3`);
|
178 |
-
if (vidSrc.indexOf('autoplay') > 0)
|
179 |
-
{
|
180 |
vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
|
181 |
}
|
182 |
-
else
|
183 |
-
{
|
184 |
vidSrc += '&autoplay=1';
|
185 |
}
|
186 |
iframe[0].src = vidSrc;
|
@@ -188,19 +189,37 @@
|
|
188 |
}
|
189 |
}
|
190 |
});
|
|
|
|
|
191 |
var currentPage = 1;
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
var isNext = this.classList.contains("ep-next");
|
|
|
194 |
if (isNext) {
|
195 |
currentPage++;
|
196 |
} else {
|
197 |
currentPage--;
|
198 |
}
|
|
|
199 |
var data = {
|
200 |
action: "youtube_rest_api",
|
201 |
playlistid: this.getAttribute("data-playlistid"),
|
202 |
pagetoken: this.getAttribute("data-pagetoken"),
|
203 |
pagesize: this.getAttribute("data-pagesize"),
|
|
|
204 |
};
|
205 |
|
206 |
var formBody = [];
|
@@ -211,26 +230,49 @@
|
|
211 |
}
|
212 |
formBody = formBody.join("&");
|
213 |
|
214 |
-
var loader = playerWrap.getElementsByClassName("ep-loader");
|
215 |
var galleryWrapper = playerWrap.getElementsByClassName(
|
216 |
"ep-youtube__content__block"
|
217 |
);
|
218 |
-
removeClass(loader[0], "hide");
|
219 |
-
addClass(galleryWrapper[0], "loading");
|
220 |
-
sendRequest("/wp-admin/admin-ajax.php", formBody, function(request) {
|
221 |
-
addClass(loader[0], "hide");
|
222 |
-
removeClass(galleryWrapper[0], "loading");
|
223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
if (galleryWrapper && galleryWrapper[0] && request.responseText) {
|
225 |
var response = JSON.parse(request.responseText);
|
226 |
galleryWrapper[0].outerHTML = response.html;
|
|
|
227 |
var currentPageNode =
|
228 |
galleryWrapper[0].getElementsByClassName("current-page");
|
229 |
if (currentPageNode && currentPageNode[0]) {
|
230 |
currentPageNode[0].textContent = currentPage;
|
|
|
231 |
}
|
232 |
}
|
233 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
});
|
235 |
}
|
236 |
})();
|
9 |
'use strict';
|
10 |
// function equivalent to jquery ready()
|
11 |
function ready(fn) {
|
12 |
+
if (document.readyState !== 'loading') {
|
13 |
fn();
|
14 |
} else {
|
15 |
document.addEventListener('DOMContentLoaded', fn);
|
16 |
}
|
17 |
}
|
18 |
|
19 |
+
ready(function () {
|
20 |
let option = {
|
21 |
forceObject: true,
|
22 |
};
|
23 |
let selector = document.querySelectorAll('.embedpress-embed-document-pdf');
|
24 |
if (selector.length) {
|
25 |
+
selector.forEach((function (value, index, thisArg) {
|
26 |
+
let id = value.dataset['emid'];
|
27 |
+
let src = value.dataset['emsrc'];
|
28 |
+
PDFObject.embed(src, "." + id, option);
|
29 |
}));
|
30 |
}
|
31 |
youtubeChannelGallery();
|
46 |
var proportion, parentWidth;
|
47 |
|
48 |
// Loop iframe elements.
|
49 |
+
document.querySelectorAll('iframe').forEach(function (iframe) {
|
50 |
// Only continue if the iframe has a width & height defined.
|
51 |
+
if (iframe.width && iframe.height) {
|
52 |
// Calculate the proportion/ratio based on the width & height.
|
53 |
+
proportion = parseFloat(iframe.width) / parseFloat(iframe.height);
|
54 |
// Get the parent element's width.
|
55 |
+
parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement, null).width.replace('px', ''));
|
56 |
// Set the max-width & height.
|
57 |
iframe.style.maxWidth = '100%';
|
58 |
+
iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + 'px';
|
59 |
}
|
60 |
+
});
|
61 |
}
|
62 |
|
63 |
// Run on initial load.
|
88 |
Element.prototype.mozMatchesSelector ||
|
89 |
Element.prototype.msMatchesSelector ||
|
90 |
Element.prototype.oMatchesSelector ||
|
91 |
+
function (s) {
|
92 |
var matches = (this.document || this.ownerDocument).querySelectorAll(s),
|
93 |
i = matches.length;
|
94 |
+
while (--i >= 0 && matches.item(i) !== this) { }
|
95 |
return i > -1;
|
96 |
};
|
97 |
}
|
98 |
+
var delegate = function (el, evt, sel, handler) {
|
99 |
+
el.addEventListener(evt, function (event) {
|
100 |
var t = event.target;
|
101 |
while (t && t !== this) {
|
102 |
if (t.matches(sel)) {
|
115 |
if (postData) {
|
116 |
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
117 |
}
|
118 |
+
req.onreadystatechange = function () {
|
119 |
if (req.readyState != 4) return;
|
120 |
if (req.status != 200 && req.status != 304) {
|
121 |
return;
|
127 |
}
|
128 |
|
129 |
var XMLHttpFactories = [
|
130 |
+
function () {
|
131 |
return new XMLHttpRequest();
|
132 |
},
|
133 |
+
function () {
|
134 |
return new ActiveXObject("Msxml3.XMLHTTP");
|
135 |
},
|
136 |
+
function () {
|
137 |
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
|
138 |
},
|
139 |
+
function () {
|
140 |
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
|
141 |
},
|
142 |
+
function () {
|
143 |
return new ActiveXObject("Msxml2.XMLHTTP");
|
144 |
},
|
145 |
+
function () {
|
146 |
return new ActiveXObject("Microsoft.XMLHTTP");
|
147 |
},
|
148 |
];
|
162 |
function youtubeChannelGallery() {
|
163 |
var playerWraps = document.getElementsByClassName("ep-player-wrap");
|
164 |
if (playerWraps && playerWraps.length) {
|
165 |
+
for (var i = 0, im = playerWraps.length; im > i; i++) {
|
166 |
youtubeChannelEvents(playerWraps[i])
|
167 |
}
|
168 |
}
|
169 |
}
|
170 |
+
function youtubeChannelEvents(playerWrap) {
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
delegate(playerWrap, "click", ".item", function (event) {
|
175 |
var embed = "https://www.youtube.com/embed/";
|
176 |
var vid = this.getAttribute("data-vid");
|
177 |
var iframe = playerWrap.getElementsByTagName("iframe");
|
178 |
+
if (vid) {
|
179 |
+
if (iframe) {
|
180 |
var vidSrc = iframe[0].src.replace(/(.*\/embed\/)([^\?&"'>]+)(.+)?/, `\$1${vid}\$3`);
|
181 |
+
if (vidSrc.indexOf('autoplay') > 0) {
|
|
|
182 |
vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
|
183 |
}
|
184 |
+
else {
|
|
|
185 |
vidSrc += '&autoplay=1';
|
186 |
}
|
187 |
iframe[0].src = vidSrc;
|
189 |
}
|
190 |
}
|
191 |
});
|
192 |
+
|
193 |
+
|
194 |
var currentPage = 1;
|
195 |
+
|
196 |
+
let nearestEpContentId = playerWrap.querySelector('.ep-youtube__content__block').getAttribute('data-unique-id');
|
197 |
+
|
198 |
+
delegate(playerWrap, "click", ".ep-next, .ep-prev", function (event) {
|
199 |
+
const totalPages = event.target.closest('.ose-youtube').getAttribute('data-total-pages');
|
200 |
+
const closestClass = event.target.closest('.ose-youtube').classList;
|
201 |
+
|
202 |
+
const activePage = document.querySelector(`.${closestClass[1]} .embedpress-page-active`);
|
203 |
+
if (activePage) {
|
204 |
+
document.querySelector(`.${closestClass[1]} .embedpress-page-active`).classList.remove('embedpress-page-active');
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
var isNext = this.classList.contains("ep-next");
|
210 |
+
|
211 |
if (isNext) {
|
212 |
currentPage++;
|
213 |
} else {
|
214 |
currentPage--;
|
215 |
}
|
216 |
+
|
217 |
var data = {
|
218 |
action: "youtube_rest_api",
|
219 |
playlistid: this.getAttribute("data-playlistid"),
|
220 |
pagetoken: this.getAttribute("data-pagetoken"),
|
221 |
pagesize: this.getAttribute("data-pagesize"),
|
222 |
+
currentpage: currentPage
|
223 |
};
|
224 |
|
225 |
var formBody = [];
|
230 |
}
|
231 |
formBody = formBody.join("&");
|
232 |
|
|
|
233 |
var galleryWrapper = playerWrap.getElementsByClassName(
|
234 |
"ep-youtube__content__block"
|
235 |
);
|
|
|
|
|
|
|
|
|
|
|
236 |
|
237 |
+
playerWrap.setAttribute('data-current-page', currentPage);
|
238 |
+
|
239 |
+
|
240 |
+
let x = 1;
|
241 |
+
|
242 |
+
sendRequest("/wp-admin/admin-ajax.php", formBody, function (request) {
|
243 |
if (galleryWrapper && galleryWrapper[0] && request.responseText) {
|
244 |
var response = JSON.parse(request.responseText);
|
245 |
galleryWrapper[0].outerHTML = response.html;
|
246 |
+
|
247 |
var currentPageNode =
|
248 |
galleryWrapper[0].getElementsByClassName("current-page");
|
249 |
if (currentPageNode && currentPageNode[0]) {
|
250 |
currentPageNode[0].textContent = currentPage;
|
251 |
+
|
252 |
}
|
253 |
}
|
254 |
});
|
255 |
+
|
256 |
+
const intervalID = setInterval(() => {
|
257 |
+
x++
|
258 |
+
|
259 |
+
if (playerWrap.querySelector('.ep-youtube__content__block')) {
|
260 |
+
const newNearestEpContentId = playerWrap
|
261 |
+
.querySelector('.ep-youtube__content__block')
|
262 |
+
.getAttribute('data-unique-id');
|
263 |
+
|
264 |
+
if (newNearestEpContentId !== nearestEpContentId && playerWrap.querySelector(`[data-page="${currentPage}"]`)) {
|
265 |
+
playerWrap.querySelector(`[data-page="${currentPage}"]`).classList.add('embedpress-page-active');
|
266 |
+
nearestEpContentId = newNearestEpContentId;
|
267 |
+
clearInterval(intervalID);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
if (x > 100) {
|
272 |
+
clearInterval(intervalID);
|
273 |
+
}
|
274 |
+
}, 100);
|
275 |
+
|
276 |
});
|
277 |
}
|
278 |
})();
|
assets/pdf/web/viewer.css
CHANGED
@@ -2598,7 +2598,7 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * {
|
|
2598 |
display: none;
|
2599 |
}
|
2600 |
#outerContainer .visibleMediumView {
|
2601 |
-
display:
|
2602 |
}
|
2603 |
}
|
2604 |
|
@@ -2608,7 +2608,7 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * {
|
|
2608 |
display: none;
|
2609 |
}
|
2610 |
.visibleSmallView {
|
2611 |
-
display:
|
2612 |
}
|
2613 |
.toolbarButtonSpacer {
|
2614 |
width: 0;
|
2598 |
display: none;
|
2599 |
}
|
2600 |
#outerContainer .visibleMediumView {
|
2601 |
+
display: none;
|
2602 |
}
|
2603 |
}
|
2604 |
|
2608 |
display: none;
|
2609 |
}
|
2610 |
.visibleSmallView {
|
2611 |
+
display: none;
|
2612 |
}
|
2613 |
.toolbarButtonSpacer {
|
2614 |
width: 0;
|
assets/pdf/web/viewer.html
CHANGED
@@ -124,7 +124,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|
124 |
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
125 |
</button>
|
126 |
|
127 |
-
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
|
128 |
<span data-l10n-id="open_file_label">Open</span>
|
129 |
</button>
|
130 |
|
124 |
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
125 |
</button>
|
126 |
|
127 |
+
<button id="secondaryOpenFile" style="display: none;" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
|
128 |
<span data-l10n-id="open_file_label">Open</span>
|
129 |
</button>
|
130 |
|
embedpress.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
|
6 |
* Author: WPDeveloper
|
7 |
* Author URI: https://wpdeveloper.com
|
8 |
-
* Version: 3.5.
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
@@ -27,6 +27,7 @@ use EmbedPress\Elementor\Embedpress_Elementor_Integration;
|
|
27 |
use EmbedPress\Includes\Classes\Feature_Enhancer;
|
28 |
use EmbedPress\Shortcode;
|
29 |
|
|
|
30 |
defined('ABSPATH') or die("No direct script access allowed.");
|
31 |
|
32 |
define('EMBEDPRESS_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
@@ -88,7 +89,16 @@ if ( is_plugin_active('elementor/elementor.php')) {
|
|
88 |
|
89 |
Shortcode::register();
|
90 |
|
91 |
-
|
92 |
if ( !class_exists( '\simple_html_dom') ) {
|
93 |
include_once EMBEDPRESS_PATH_CORE . 'simple_html_dom.php';
|
94 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
|
6 |
* Author: WPDeveloper
|
7 |
* Author URI: https://wpdeveloper.com
|
8 |
+
* Version: 3.5.2
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
27 |
use EmbedPress\Includes\Classes\Feature_Enhancer;
|
28 |
use EmbedPress\Shortcode;
|
29 |
|
30 |
+
|
31 |
defined('ABSPATH') or die("No direct script access allowed.");
|
32 |
|
33 |
define('EMBEDPRESS_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
89 |
|
90 |
Shortcode::register();
|
91 |
|
|
|
92 |
if ( !class_exists( '\simple_html_dom') ) {
|
93 |
include_once EMBEDPRESS_PATH_CORE . 'simple_html_dom.php';
|
94 |
}
|
95 |
+
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Check is embedpress-pro active
|
99 |
+
*/
|
100 |
+
$is_pro_active = false;
|
101 |
+
if(class_exists('EmbedPress_Licensing')){
|
102 |
+
$is_pro_active = true;
|
103 |
+
}
|
104 |
+
|
includes.php
CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
|
|
22 |
}
|
23 |
|
24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
25 |
-
define('EMBEDPRESS_VERSION', "3.5.
|
26 |
/**
|
27 |
* @deprecated 2.2.0
|
28 |
*/
|
22 |
}
|
23 |
|
24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
25 |
+
define('EMBEDPRESS_VERSION', "3.5.2");
|
26 |
/**
|
27 |
* @deprecated 2.2.0
|
28 |
*/
|
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor ===
|
2 |
-
Contributors: EmbedPress, asif2bd, re_enter_rupok, wpdevteam,
|
3 |
Author: WPDeveloper
|
4 |
Author URI: https://wpdeveloper.com
|
5 |
Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress, elementor, WPML, Meetup, Boomplay, PDF Logo
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 6.0
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 3.5.
|
10 |
License: GPLv3 or later
|
11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
12 |
|
@@ -382,10 +382,15 @@ Not at all. You can set up everything your team needs without any coding knowled
|
|
382 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
383 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
384 |
|
|
|
|
|
|
|
|
|
|
|
385 |
= [3.5.1] - 2022-09-27 =
|
386 |
* Fixed: Meetup fatal error while event image was missing.
|
387 |
* Fixed: Conflict with Elementor old version.
|
388 |
-
* Improved: Changed library for
|
389 |
* Few minor bug fix and improvements.
|
390 |
|
391 |
= [3.5.0] - 2022-08-25 =
|
1 |
=== EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor ===
|
2 |
+
Contributors: EmbedPress, asif2bd, re_enter_rupok, wpdevteam, seakashdiu, alimuzzamanalim
|
3 |
Author: WPDeveloper
|
4 |
Author URI: https://wpdeveloper.com
|
5 |
Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress, elementor, WPML, Meetup, Boomplay, PDF Logo
|
6 |
Requires at least: 4.6
|
7 |
Tested up to: 6.0
|
8 |
Requires PHP: 5.6
|
9 |
+
Stable tag: 3.5.2
|
10 |
License: GPLv3 or later
|
11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
12 |
|
382 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
383 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
384 |
|
385 |
+
= [3.5.2] - 2022-10-20 =
|
386 |
+
* Improved: Added new options to PDF embed.
|
387 |
+
* Improved: YouTube channel embedding with new controls.
|
388 |
+
* Few minor bug fixes and improvements.
|
389 |
+
|
390 |
= [3.5.1] - 2022-09-27 =
|
391 |
* Fixed: Meetup fatal error while event image was missing.
|
392 |
* Fixed: Conflict with Elementor old version.
|
393 |
+
* Improved: Changed library for document viewing for Elementor.
|
394 |
* Few minor bug fix and improvements.
|
395 |
|
396 |
= [3.5.0] - 2022-08-25 =
|