Version Description
- Added - WooCommerce Blocks Pro Version
- Added - Accordion Block Pro Version
- Added - Testimonial Block Version
- Added - Abilty to Edit WordPress pafges with SeedProd, this can be disbaled in the SeedProd settings page.
- Fixed - IOS cover image bug
- Fixed - Yoast and AllinOne SEO Pro edit page links
- Fixed - WP Version filter not returning default value
- Tweak - Added filter to top level menu position 'seedprod_top_level_menu_postion'
- Tweak - Added imprint and privacy to default excluded pages
Download this release
Release Info
Developer | seedprod |
Plugin | Coming Soon Page & Maintenance Mode by SeedProd |
Version | 6.2.0 |
Comparing to | |
See all releases |
Code changes from version 6.0.11.1 to 6.2.0
- README.txt +35 -266
- app/admin-bar-menu.php +40 -41
- app/backwards/backwards_compatibility.php +350 -356
- app/backwards/csp4-functions.php +372 -385
- app/bootstrap.php +594 -271
- app/cpt.php +7 -7
- app/functions-addons.php +326 -334
- app/functions-utils.php +1205 -726
- app/includes/nameparse.php +206 -198
- app/includes/seedprod_lessc.inc.php +1831 -1578
- app/includes/skin.php +76 -83
- app/includes/skin53.php +76 -83
- app/includes/upgrade.php +172 -167
- app/license.php +147 -145
- app/load_controller.php +54 -44
- app/lpage.php +701 -728
- app/notifications.php +407 -425
- app/render-csp-mm.php +300 -316
- app/render-lp.php +22 -22
- app/review.php +6 -7
- app/routes.php +446 -294
- app/settings.php +98 -65
- app/subscriber.php +119 -125
- coming-soon.php +48 -50
- public/css/global-admin.css +16 -1
- public/css/tailwind-admin.min.css +12 -1
- public/css/tailwind-builder.min.css +23 -3
- public/css/tailwind.min.css +38 -4
- public/js/sp-scripts.js +108 -5
- public/js/sp-scripts.min.js +1 -1
- public/js/toolbar.js +103 -0
- public/lite/vue-backend/js/admin.js +1 -1
- public/lite/vue-backend/js/chunk-common.js +1 -1
- public/lite/vue-backend/js/index.js +0 -1
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: seedprod, smub
|
|
3 |
Donate link: http://www.seedprod.com
|
4 |
Tags: maintenance mode, coming soon page, coming soon, under construction, landing page, launch, maintenance, construction, offline, unavailable, under construction page, launch page
|
5 |
Requires at least: 5.0
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.6
|
8 |
Stable tag: 6.0.10.1
|
9 |
Text Domain: coming-soon
|
@@ -75,6 +75,9 @@ Create a Coming Soon Page, Maintenance Mode Page, Landing Pages and Custom 404 p
|
|
75 |
* Star Rating Block
|
76 |
* Shortcode Block
|
77 |
* Login Block
|
|
|
|
|
|
|
78 |
* Plus lots more...
|
79 |
|
80 |
* [Upgrade to the Pro Version Now!»](http://www.seedprod.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=coming-soon-from-wordpress.org)
|
@@ -135,6 +138,10 @@ This is always a caching issue. Go to the caching plugin's setting page and clea
|
|
135 |
|
136 |
This page builder is intended for landing pages only. If your website only had a small number of pages you could in theory only use SeedProd. However if you have a large website there are other page builders with the wordpress.org plugin repo that will let you build your entire site.
|
137 |
|
|
|
|
|
|
|
|
|
138 |
|
139 |
== Screenshots ==
|
140 |
|
@@ -149,6 +156,21 @@ This page builder is intended for landing pages only. If your website only had a
|
|
149 |
|
150 |
|
151 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
= 6.0.11.1 =
|
154 |
* Fixed - Some SEO plugins not adding title tag to landing pages
|
@@ -213,136 +235,19 @@ This page builder is intended for landing pages only. If your website only had a
|
|
213 |
* New - Landing Pages
|
214 |
* New - Custom 404 Pages
|
215 |
|
216 |
-
= 5.1.3 =
|
217 |
-
* Tweak - Prepping for upcoming new version
|
218 |
-
|
219 |
-
= 5.1.2 =
|
220 |
-
* Tweak - Escape logo and custom css fields: reported by security researcher (Jinson Varghese Behanan) from the company (Astra Security)
|
221 |
-
|
222 |
-
= 5.1.1 =
|
223 |
-
* Tweak - Escape script output on certain fields: reported by security researcher (Jinson Varghese Behanan) from the company (Astra Security)
|
224 |
-
|
225 |
-
= 5.1.0 =
|
226 |
-
* Added - Suggest a Feature
|
227 |
-
* Added - Quicklinks to Support
|
228 |
-
* Added - RafflePress support and recommendation
|
229 |
-
|
230 |
-
= 5.0.26 =
|
231 |
-
* Added - Giveaway Link to Submenu
|
232 |
-
|
233 |
-
= 5.0.25 =
|
234 |
-
* Fixed - Documentation Link
|
235 |
-
* Tweak - Removed plugin recommendation
|
236 |
-
|
237 |
-
= 5.0.24 =
|
238 |
-
* Tweak - Typos
|
239 |
-
* Tweak - Remove Install Plugins menu when dismissed
|
240 |
-
|
241 |
-
= 5.0.23 =
|
242 |
-
* Tweak - Typos
|
243 |
-
|
244 |
-
= 5.0.22 =
|
245 |
-
* Fixed - Bug with old php versions
|
246 |
-
|
247 |
-
= 5.0.21 =
|
248 |
-
* Added - Themes, Stock Images, Subscribers and Addons Previews
|
249 |
-
|
250 |
-
= 5.0.20 =
|
251 |
-
* Tweak - Autoclear popular caches.
|
252 |
-
|
253 |
-
= 5.0.19 =
|
254 |
-
* fixed z-index issue with supersize loader and focus link color
|
255 |
-
|
256 |
-
= 5.0.18 =
|
257 |
-
* fixed ios issue and no cache header issue
|
258 |
-
|
259 |
-
= 5.0.17 =
|
260 |
-
* Changed credit image
|
261 |
-
|
262 |
-
= 5.0.16 =
|
263 |
-
* Removed php warning notice of depreciated function
|
264 |
-
|
265 |
-
= 5.0.15 =
|
266 |
-
* Changed text on credit and added and tweaked inline optin for free bg images.
|
267 |
-
|
268 |
-
= 5.0.14 =
|
269 |
-
* Fixed a PHP 7 compatibility warning
|
270 |
-
|
271 |
-
= 5.0.12 =
|
272 |
-
* Added Review Request
|
273 |
-
|
274 |
-
= 5.0.11 =
|
275 |
-
* Removed blog feed from sidebar and change out images
|
276 |
-
|
277 |
-
= 5.0.10 =
|
278 |
-
* Added the ability to make the bg image stay contained within the browser window.
|
279 |
-
|
280 |
-
= 5.0.9 =
|
281 |
-
* Fixed CSS issues
|
282 |
-
|
283 |
-
= 5.0.8 =
|
284 |
-
* Fixed CSS issue and added cache control
|
285 |
-
|
286 |
-
= 5.0.6 =
|
287 |
-
* Added wp review request
|
288 |
-
|
289 |
-
= 5.0.5 =
|
290 |
-
* Disable REST API while in coming soon and maintenance mode
|
291 |
-
|
292 |
-
= 5.0.4 =
|
293 |
-
* PHP 7 Compatibility
|
294 |
-
|
295 |
-
= 5.0.3 =
|
296 |
-
* Updated ReadMe Text
|
297 |
-
* Ensure Full Size images are selected by default when selecting an image.
|
298 |
-
* Make sure all files are local to the plugin.
|
299 |
-
|
300 |
-
= 5.0.2 =
|
301 |
-
* More tweaks to the append html section.
|
302 |
-
|
303 |
-
= 5.0.1 =
|
304 |
-
* Added option to append to the html in addition of just replacing.
|
305 |
-
|
306 |
-
= 5.0.0 =
|
307 |
-
* Added the ability to add custom html, dim background and help video.
|
308 |
-
|
309 |
-
= 4.2.1 =
|
310 |
-
* Fixed undefined notice
|
311 |
-
|
312 |
-
= 4.2.0 =
|
313 |
-
* Language Packs
|
314 |
-
|
315 |
-
= 4.1.4 =
|
316 |
-
* Added Danish Translation
|
317 |
-
|
318 |
-
= 4.1.3 =
|
319 |
-
* Added Swedish Translation
|
320 |
-
|
321 |
-
= 4.1.2 =
|
322 |
-
* Tweak: Updated optin form again
|
323 |
-
|
324 |
-
= 4.1.1 =
|
325 |
-
* Tweak: Updated optin form
|
326 |
-
|
327 |
-
= 4.1.0 =
|
328 |
-
* Exclude default urls terms: login, admin, dashboard and account. Also provided a way to disable this behavior.
|
329 |
-
|
330 |
-
= 4.0.4 =
|
331 |
-
* Added launch course and WordPress 4.1.0 compatibility
|
332 |
-
|
333 |
-
= 4.0.3=
|
334 |
-
* Fixed preview link
|
335 |
-
|
336 |
-
= 4.0.2=
|
337 |
-
* Add link to free backgrounds
|
338 |
-
|
339 |
-
= 4.0.1 =
|
340 |
-
* Fixed a bug where website was not showing when logged in
|
341 |
-
|
342 |
-
= 4.0.0 =
|
343 |
-
* Initial Commit
|
344 |
-
|
345 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
= 6.0.11.1 =
|
347 |
* Fixed - Some SEO plugins not adding title tag to landing pages
|
348 |
* Tweak - Made settings more accessible
|
@@ -363,139 +268,3 @@ This page builder is intended for landing pages only. If your website only had a
|
|
363 |
= 6.0.8.2 =
|
364 |
* Reverted - Preview link ad added flush permalink
|
365 |
|
366 |
-
= 6.0.8.1 =
|
367 |
-
* Tweak - Added preview_nonce to preview link
|
368 |
-
|
369 |
-
= 6.0.8 =
|
370 |
-
* Fixed - PHP warning in admin to undefined database table
|
371 |
-
* Tweak - How Preview links are constructed
|
372 |
-
|
373 |
-
= 6.0.7 =
|
374 |
-
* Tweak - Flush Permalinks Programmatically
|
375 |
-
|
376 |
-
= 6.0.0 =
|
377 |
-
* New - Complete rebuild of the plugin.
|
378 |
-
* New - Drag and Drop Page Builder
|
379 |
-
* New - Page Blocks
|
380 |
-
* New - Coming Soon Pages
|
381 |
-
* New - Maintenance Pages
|
382 |
-
* New - Landing Pages
|
383 |
-
* New - Custom 404 Pages
|
384 |
-
|
385 |
-
= 5.1.3 =
|
386 |
-
* Tweak - Prepping for upcoming new version
|
387 |
-
|
388 |
-
= 5.1.2 =
|
389 |
-
* Tweak - Escape logo and custom css fields: reported by security researcher (Jinson Varghese Behanan) from the company (Astra Security)
|
390 |
-
|
391 |
-
= 5.1.1 =
|
392 |
-
* Tweak - Escape script output on certain fields: reported by security researcher (Jinson Varghese Behanan) from the company (Astra Security)
|
393 |
-
|
394 |
-
= 5.1.0 =
|
395 |
-
* Added - Suggest a Feature
|
396 |
-
* Added - Quicklinks to Support
|
397 |
-
* Added - RafflePress support and recommendation
|
398 |
-
|
399 |
-
= 5.0.26 =
|
400 |
-
* Added - Giveaway Link to Submenu
|
401 |
-
|
402 |
-
= 5.0.25 =
|
403 |
-
* Fixed - Documentation Link
|
404 |
-
* Tweak - Removed plugin recommendation
|
405 |
-
|
406 |
-
= 5.0.24 =
|
407 |
-
* Tweak - Typos
|
408 |
-
* Tweak - Remove Install Plugins menu when dismissed
|
409 |
-
|
410 |
-
= 5.0.23 =
|
411 |
-
* Tweak - Typos
|
412 |
-
|
413 |
-
= 5.0.22 =
|
414 |
-
* Fixed - Bug with old php versions
|
415 |
-
|
416 |
-
= 5.0.21 =
|
417 |
-
* Added - Themes, Stock Images, Subscribers and Addons Previews
|
418 |
-
|
419 |
-
= 5.0.20 =
|
420 |
-
* Tweak - Autoclear popular caches.
|
421 |
-
|
422 |
-
= 5.0.19 =
|
423 |
-
* fixed z-index issue with supersize loader and focus link color
|
424 |
-
|
425 |
-
= 5.0.18 =
|
426 |
-
* fixed ios issue and no cache header issue
|
427 |
-
|
428 |
-
= 5.0.17 =
|
429 |
-
* Changed credit image
|
430 |
-
|
431 |
-
= 5.0.16 =
|
432 |
-
* Removed php warning notice of depreciated function
|
433 |
-
|
434 |
-
= 5.0.15 =
|
435 |
-
* Changed text on credit and added and tweaked inline optin for free bg images.
|
436 |
-
|
437 |
-
= 5.0.14 =
|
438 |
-
* Fixed a PHP 7 compatibility warning
|
439 |
-
|
440 |
-
= 5.0.12 =
|
441 |
-
* Added Review Request
|
442 |
-
|
443 |
-
= 5.0.11 =
|
444 |
-
* Removed blog feed from sidebar and change out images
|
445 |
-
|
446 |
-
= 5.0.10 =
|
447 |
-
* Added the ability to make the bg image stay contained within the browser window.
|
448 |
-
|
449 |
-
= 5.0.9 =
|
450 |
-
* Fixed CSS issues
|
451 |
-
|
452 |
-
= 5.0.8 =
|
453 |
-
* Fixed CSS issue and added cache control
|
454 |
-
|
455 |
-
= 5.0.5 =
|
456 |
-
* Disable REST API while in coming soon and maintenance mode
|
457 |
-
|
458 |
-
= 5.0.4 =
|
459 |
-
* PHP 7 Compatibility
|
460 |
-
|
461 |
-
= 5.0.3 =
|
462 |
-
* Ensure Full Size images are selected by default when selecting an image.
|
463 |
-
* Make sure all files are local to the plugin.
|
464 |
-
* Updated ReadMe Text
|
465 |
-
|
466 |
-
= 5.0.2 =
|
467 |
-
* More tweaks to the append html section.
|
468 |
-
|
469 |
-
= 5.0.1 =
|
470 |
-
* Added option to append to the html in addition of just replacing.
|
471 |
-
|
472 |
-
= 5.0.0 =
|
473 |
-
* Added the ability to add custom html, dim background and help video.
|
474 |
-
|
475 |
-
= 4.2.0 =
|
476 |
-
* Language Packs
|
477 |
-
|
478 |
-
= 4.1.4 =
|
479 |
-
* Added Danish Translation
|
480 |
-
|
481 |
-
= 4.1.3 =
|
482 |
-
* Added Swedish Translation
|
483 |
-
|
484 |
-
= 4.1.0 =
|
485 |
-
* Exclude default urls terms: login, admin, dashboard and account. Also provided a way to disable this behavior.
|
486 |
-
|
487 |
-
= 4.0.4 =
|
488 |
-
* Added launch course and 4.1.0 compatibility
|
489 |
-
|
490 |
-
= 4.0.3=
|
491 |
-
* Fixed preview link
|
492 |
-
|
493 |
-
= 4.0.2=
|
494 |
-
* Add link to free backgrounds
|
495 |
-
|
496 |
-
= 4.0.1 =
|
497 |
-
* Fixed a bug where website was not showing when logged in
|
498 |
-
|
499 |
-
= 4.0.0 =
|
500 |
-
Initial Commit
|
501 |
-
|
3 |
Donate link: http://www.seedprod.com
|
4 |
Tags: maintenance mode, coming soon page, coming soon, under construction, landing page, launch, maintenance, construction, offline, unavailable, under construction page, launch page
|
5 |
Requires at least: 5.0
|
6 |
+
Tested up to: 5.7
|
7 |
Requires PHP: 5.6
|
8 |
Stable tag: 6.0.10.1
|
9 |
Text Domain: coming-soon
|
75 |
* Star Rating Block
|
76 |
* Shortcode Block
|
77 |
* Login Block
|
78 |
+
* Accordion Block
|
79 |
+
* Testimonials Block
|
80 |
+
* WooCommerce Blocks
|
81 |
* Plus lots more...
|
82 |
|
83 |
* [Upgrade to the Pro Version Now!»](http://www.seedprod.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=coming-soon-from-wordpress.org)
|
138 |
|
139 |
This page builder is intended for landing pages only. If your website only had a small number of pages you could in theory only use SeedProd. However if you have a large website there are other page builders with the wordpress.org plugin repo that will let you build your entire site.
|
140 |
|
141 |
+
= Does it work with WooCommerce? =
|
142 |
+
|
143 |
+
Yes, you cam build custom Product, Checkout and Cart pages with our WooCommerce integration. Note: WooCommerce Integration is only available in the Pro verison.
|
144 |
+
|
145 |
|
146 |
== Screenshots ==
|
147 |
|
156 |
|
157 |
|
158 |
== Changelog ==
|
159 |
+
= 6.2.0 =
|
160 |
+
|
161 |
+
* Added - WooCommerce Blocks Pro Version
|
162 |
+
* Added - Accordion Block Pro Version
|
163 |
+
* Added - Testimonial Block Version
|
164 |
+
* Added - Abilty to Edit WordPress pafges with SeedProd, this can be disbaled in the SeedProd settings page.
|
165 |
+
* Fixed - IOS cover image bug
|
166 |
+
* Fixed - Yoast and AllinOne SEO Pro edit page links
|
167 |
+
* Fixed - WP Version filter not returning default value
|
168 |
+
* Tweak - Added filter to top level menu position 'seedprod_top_level_menu_postion'
|
169 |
+
* Tweak - Added imprint and privacy to default excluded pages
|
170 |
+
|
171 |
+
= 6.0.11.2 =
|
172 |
+
* Tweak - Redirect Default Login Page Behavior and added inline explanation
|
173 |
+
|
174 |
|
175 |
= 6.0.11.1 =
|
176 |
* Fixed - Some SEO plugins not adding title tag to landing pages
|
235 |
* New - Landing Pages
|
236 |
* New - Custom 404 Pages
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
== Upgrade Notice ==
|
239 |
+
= 6.2.0 =
|
240 |
+
|
241 |
+
* Added - WooCommerce Blocks Pro Version
|
242 |
+
* Added - Accordion Block Pro Version
|
243 |
+
* Added - Testimonial Block Version
|
244 |
+
* Added - Abilty to Edit WordPress pafges with SeedProd, this can be disbaled in the SeedProd settings page.
|
245 |
+
* Fixed - IOS cover image bug
|
246 |
+
* Fixed - Yoast and AllinOne SEO Pro edit page links
|
247 |
+
* Fixed - WP Version filter not returning default value
|
248 |
+
* Tweak - Added filter to top level menu position 'seedprod_top_level_menu_postion'
|
249 |
+
* Tweak - Added imprint and privacy to default excluded pages
|
250 |
+
|
251 |
= 6.0.11.1 =
|
252 |
* Fixed - Some SEO plugins not adding title tag to landing pages
|
253 |
* Tweak - Made settings more accessible
|
268 |
= 6.0.8.2 =
|
269 |
* Reverted - Preview link ad added flush permalink
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/admin-bar-menu.php
CHANGED
@@ -1,25 +1,23 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
{
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
<span class="seedprod-mb-icon"><svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
24 |
<g filter="url(#filter0_d)">
|
25 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0C4 0 4.32666 0.022488 11.036 0.91214C17.7453 1.80179 20.0674 8.70527 15.9594 14.7304C16.5949 9.34689 15.4319 3.76206 10.7604 3.10916C6.08886 2.45626 6.49574 2.5563 6.49574 2.5563C6.49574 2.5563 6.57314 3.74204 7.01149 6.92954C7.44984 10.117 9.90279 11.6803 12.0495 12.485C12.0495 12.485 12.1754 8.75455 10.9777 7.1126C9.77997 5.47066 8.2899 4.38023 8.2899 4.38023C8.2899 4.38023 11.7916 4.80636 13.1137 7.28431C14.4358 9.76225 14.307 15 14.307 15L12.8808 14.9251C9.04318 14.4574 5.45792 12.1126 4.84831 7.19318C4.23871 2.27373 4 0 4 0Z" fill="black"/>
|
@@ -37,33 +35,34 @@
|
|
37 |
</filter>
|
38 |
</defs>
|
39 |
</svg></span>';
|
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 |
-
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Display admin bar when active
|
5 |
+
*/
|
6 |
+
function seedprod_lite_admin_bar_menu( $wp_admin_bar ) {
|
|
|
7 |
|
8 |
+
$ts = get_option( 'seedprod_settings' );
|
9 |
+
$seedprod_settings = json_decode( $ts, true );
|
|
|
10 |
|
11 |
+
// if (empty($seedprod_settings['enable_coming_soon_mode']) && empty($seedprod_settings['enable_maintenance_mode'])) {
|
12 |
+
// return false;
|
13 |
+
// }
|
14 |
|
15 |
+
// Disable if page line editor open
|
16 |
+
if ( isset( $_GET['pl_edit'] ) ) {
|
17 |
+
return false;
|
18 |
+
}
|
19 |
|
20 |
+
$icon = '
|
21 |
<span class="seedprod-mb-icon"><svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
22 |
<g filter="url(#filter0_d)">
|
23 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0C4 0 4.32666 0.022488 11.036 0.91214C17.7453 1.80179 20.0674 8.70527 15.9594 14.7304C16.5949 9.34689 15.4319 3.76206 10.7604 3.10916C6.08886 2.45626 6.49574 2.5563 6.49574 2.5563C6.49574 2.5563 6.57314 3.74204 7.01149 6.92954C7.44984 10.117 9.90279 11.6803 12.0495 12.485C12.0495 12.485 12.1754 8.75455 10.9777 7.1126C9.77997 5.47066 8.2899 4.38023 8.2899 4.38023C8.2899 4.38023 11.7916 4.80636 13.1137 7.28431C14.4358 9.76225 14.307 15 14.307 15L12.8808 14.9251C9.04318 14.4574 5.45792 12.1126 4.84831 7.19318C4.23871 2.27373 4 0 4 0Z" fill="black"/>
|
35 |
</filter>
|
36 |
</defs>
|
37 |
</svg></span>';
|
38 |
+
$text = '<span>SeedProd</span>';
|
39 |
+
if ( ! empty( $seedprod_settings['enable_coming_soon_mode'] ) ) {
|
40 |
+
$text = '<span>' . __( 'Coming Soon Mode Active', 'seedprod-coming-soon-pro' ) . '</span>';
|
41 |
+
} elseif ( ! empty( $seedprod_settings['enable_maintenance_mode'] ) ) {
|
42 |
+
$text = '<span>' . __( 'Maintenance Mode Active', 'seedprod-coming-soon-pro' ) . '</span>';
|
43 |
+
}
|
44 |
|
45 |
+
$notification = '';
|
46 |
|
47 |
+
//Add the main siteadmin menu item
|
48 |
+
$wp_admin_bar->add_menu(
|
49 |
+
array(
|
50 |
+
'id' => 'seedprod_admin_bar',
|
51 |
+
'href' => admin_url() . 'admin.php?page=seedprod_lite#/',
|
52 |
+
'parent' => 'top-secondary',
|
53 |
+
'title' => $icon . $text . $notification,
|
54 |
+
'meta' => array( 'class' => 'seedprod-mode-active' ),
|
55 |
+
)
|
56 |
+
);
|
57 |
|
58 |
+
// $args = array(
|
59 |
+
// 'id' => 'media_settings',
|
60 |
+
// 'title' => 'Media Settings',
|
61 |
+
// 'href' => admin_url() . 'options-media.php',
|
62 |
+
// 'parent' => 'seedprod_admin_bar'
|
63 |
+
// );
|
64 |
+
// $wp_admin_bar->add_node( $args );
|
65 |
+
|
66 |
+
}
|
67 |
|
|
|
68 |
|
|
app/backwards/backwards_compatibility.php
CHANGED
@@ -1,82 +1,80 @@
|
|
1 |
<?php
|
2 |
|
3 |
|
4 |
-
function seedprod_lite_check_for_free_version()
|
5 |
-
{
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
if (!empty($csp4_settings['html'])) {
|
79 |
-
$custom_html = json_decode('{
|
80 |
"id": "iuf8h9",
|
81 |
"elType": "block",
|
82 |
"type": "custom-html",
|
@@ -89,214 +87,214 @@ function seedprod_lite_check_for_free_version()
|
|
89 |
"paddingRight": "",
|
90 |
"paddingSync": true
|
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 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
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 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
"id": "iuf8h9",
|
296 |
"elType": "block",
|
297 |
"type": "custom-html",
|
298 |
"settings": {
|
299 |
-
"code": "'
|
300 |
"marginTop": "0",
|
301 |
"paddingTop": "",
|
302 |
"paddingBottom": "",
|
@@ -304,81 +302,77 @@ function seedprod_lite_check_for_free_version()
|
|
304 |
"paddingRight": "",
|
305 |
"paddingSync": true
|
306 |
}}
|
307 |
-
'
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
}
|
380 |
-
} catch (Exception $e) {
|
381 |
-
return $e;
|
382 |
-
}
|
383 |
}
|
384 |
|
1 |
<?php
|
2 |
|
3 |
|
4 |
+
function seedprod_lite_check_for_free_version() {
|
5 |
+
try {
|
6 |
+
$seedprod_unsupported_feature = array();
|
7 |
+
$migration = get_option( 'seedprod_migration_run_once' );
|
8 |
+
if ( empty( $migration ) || ! empty( $_GET['sp-force-migrate'] ) ) {
|
9 |
+
|
10 |
+
// migrate old licnese key if available
|
11 |
+
$old_key = get_option( 'seed_cspv5_license_key' );
|
12 |
+
if ( ! empty( $old_key ) ) {
|
13 |
+
update_option( 'seedprod_api_key', $old_key );
|
14 |
+
$r = seedprod_lite_save_api_key( $old_key );
|
15 |
+
}
|
16 |
+
|
17 |
+
// see if free version old settings exists and they do not have the pro version
|
18 |
+
// && empty(get_option('seed_cspv5_settings_content'))
|
19 |
+
if ( ! empty( $_GET['sp-force-migrate'] ) || empty( get_option( 'seed_cspv5_settings_content' ) ) && empty( get_option( 'seedprod_coming_soon_page_id' ) ) && empty( get_option( 'seedprod_maintenance_mode_page_id' ) ) && ! empty( get_option( 'seed_csp4_settings_content' ) ) && get_option( 'seedprod_csp4_migrated' ) === false && get_option( 'seedprod_csp4_imported' ) === false ) {
|
20 |
+
|
21 |
+
// import csp4 settings to plugin
|
22 |
+
|
23 |
+
// get settings
|
24 |
+
$s1 = get_option( 'seed_csp4_settings_content' );
|
25 |
+
$s2 = get_option( 'seed_csp4_settings_design' );
|
26 |
+
$s3 = get_option( 'seed_csp4_settings_advanced' );
|
27 |
+
|
28 |
+
if ( empty( $s1 ) ) {
|
29 |
+
$s1 = array();
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( empty( $s2 ) ) {
|
33 |
+
$s2 = array();
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( empty( $s3 ) ) {
|
37 |
+
$s3 = array();
|
38 |
+
}
|
39 |
+
|
40 |
+
$csp4_settings = $s1 + $s2 + $s3;
|
41 |
+
|
42 |
+
// update global settings
|
43 |
+
|
44 |
+
$ts = get_option( 'seedprod_settings' );
|
45 |
+
$seedprod_settings = json_decode( $ts, true );
|
46 |
+
|
47 |
+
$type = 'cs';
|
48 |
+
if ( ! empty( $csp4_settings['status'] ) && $csp4_settings['status'] == 1 ) {
|
49 |
+
$seedprod_settings['enable_coming_soon_mode'] = true;
|
50 |
+
$seedprod_settings['enable_maintenance_mode'] = false;
|
51 |
+
$type = 'cs';
|
52 |
+
}
|
53 |
+
if ( ! empty( $csp4_settings['status'] ) && $csp4_settings['status'] == 2 ) {
|
54 |
+
$seedprod_settings['enable_maintenance_mode'] = true;
|
55 |
+
$seedprod_settings['enable_coming_soon_mode'] = false;
|
56 |
+
$type = 'mm';
|
57 |
+
}
|
58 |
+
|
59 |
+
update_option( 'seedprod_settings', json_encode( $seedprod_settings ) );
|
60 |
+
|
61 |
+
// update page settings
|
62 |
+
$csp4_template_file = SEEDPROD_PLUGIN_PATH . 'app/backwards/csp4-template.json';
|
63 |
+
$csp4_template = json_decode( file_get_contents( $csp4_template_file ), true );
|
64 |
+
|
65 |
+
//$csp4_template
|
66 |
+
// page to publish if active from v4
|
67 |
+
if ( ! empty( $csp4_settings['status'] ) && $csp4_settings['status'] == 1 || $csp4_settings['status'] == 2 ) {
|
68 |
+
$csp4_template['post_status'] = 'published';
|
69 |
+
}
|
70 |
+
|
71 |
+
// set page type
|
72 |
+
$csp4_template['page_type'] = $type;
|
73 |
+
|
74 |
+
// set custom html
|
75 |
+
if ( ! empty( $csp4_settings['html'] ) ) {
|
76 |
+
$custom_html = json_decode(
|
77 |
+
'{
|
|
|
|
|
78 |
"id": "iuf8h9",
|
79 |
"elType": "block",
|
80 |
"type": "custom-html",
|
87 |
"paddingRight": "",
|
88 |
"paddingSync": true
|
89 |
}}
|
90 |
+
'
|
91 |
+
);
|
92 |
+
if ( ! empty( $custom_html ) ) {
|
93 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'] = array();
|
94 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][] = $custom_html;
|
95 |
+
}
|
96 |
+
|
97 |
+
$csp4_template['document']['settings']['contentPosition'] = '1';
|
98 |
+
$csp4_template['document']['sections'][0]['settings']['contentWidth'] = '1';
|
99 |
+
} else {
|
100 |
+
|
101 |
+
// set logo
|
102 |
+
if ( ! empty( $csp4_settings['logo'] ) ) {
|
103 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][0]['settings']['src'] = $csp4_settings['logo'];
|
104 |
+
} else {
|
105 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][0]['settings']['src'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==';
|
106 |
+
}
|
107 |
+
|
108 |
+
// set headline
|
109 |
+
if ( ! empty( $csp4_settings['headline'] ) ) {
|
110 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][1]['settings']['headerTxt'] = $csp4_settings['headline'];
|
111 |
+
} else {
|
112 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][1]['settings']['headerTxt'] = '';
|
113 |
+
}
|
114 |
+
|
115 |
+
// set description
|
116 |
+
if ( ! empty( $csp4_settings['description'] ) ) {
|
117 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][2]['settings']['txt'] = $csp4_settings['description'];
|
118 |
+
} else {
|
119 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][2]['settings']['txt'] = '';
|
120 |
+
}
|
121 |
+
|
122 |
+
// set footer credit
|
123 |
+
if ( ! empty( $csp4_settings['footer_credit'] ) ) {
|
124 |
+
$csp4_template['show_powered_by_link'] = true;
|
125 |
+
}
|
126 |
+
|
127 |
+
// favicon
|
128 |
+
if ( ! empty( $csp4_settings['favicon'] ) ) {
|
129 |
+
$csp4_template['favicon'] = $csp4_settings['favicon'];
|
130 |
+
}
|
131 |
+
|
132 |
+
// title
|
133 |
+
if ( ! empty( $csp4_settings['seo_title'] ) ) {
|
134 |
+
$csp4_template['seo_title'] .= $csp4_settings['seo_title'];
|
135 |
+
}
|
136 |
+
|
137 |
+
// meta
|
138 |
+
if ( ! empty( $csp4_settings['seo_description'] ) ) {
|
139 |
+
$csp4_template['seo_description'] .= $csp4_settings['seo_description'];
|
140 |
+
}
|
141 |
+
|
142 |
+
// set google analytics
|
143 |
+
if ( ! empty( $csp4_settings['ga_analytics'] ) ) {
|
144 |
+
$csp4_template['footer_scripts'] = $csp4_settings['ga_analytics'];
|
145 |
+
}
|
146 |
+
|
147 |
+
// set bg color
|
148 |
+
if ( ! empty( $csp4_settings['bg_color'] ) ) {
|
149 |
+
$csp4_template['document']['settings']['bgColor'] = $csp4_settings['bg_color'];
|
150 |
+
}
|
151 |
+
|
152 |
+
// set bg dimming
|
153 |
+
if ( ! empty( $csp4_settings['bg_overlay'] ) ) {
|
154 |
+
$csp4_template['document']['settings']['bgDimming'] = '50';
|
155 |
+
}
|
156 |
+
|
157 |
+
// set bg image
|
158 |
+
if ( ! empty( $csp4_settings['bg_image'] ) ) {
|
159 |
+
$csp4_template['document']['settings']['bgImage'] = $csp4_settings['bg_image'];
|
160 |
+
}
|
161 |
+
|
162 |
+
// set bg cover
|
163 |
+
if ( ! empty( $csp4_settings['bg_cover'] ) ) {
|
164 |
+
if ( ! empty( $csp4_settings['bg_size'] ) && $csp4_settings['bg_size'] == 'cover' ) {
|
165 |
+
$csp4_template['document']['settings']['bgPosition'] = 'cover';
|
166 |
+
}
|
167 |
+
|
168 |
+
if ( ! empty( $csp4_settings['bg_size'] ) && $csp4_settings['bg_size'] == 'contain' ) {
|
169 |
+
$csp4_template['document']['settings']['bgPosition'] = 'full';
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
if ( ! empty( $csp4_settings['bg_repeat'] ) && $csp4_settings['bg_repeat'] == 'repeat' ) {
|
173 |
+
$csp4_template['document']['settings']['bgPosition'] = 'repeat';
|
174 |
+
}
|
175 |
+
|
176 |
+
if ( ! empty( $csp4_settings['bg_repeat'] ) && $csp4_settings['bg_repeat'] == 'repeat-x' ) {
|
177 |
+
$csp4_template['document']['settings']['bgPosition'] = 'repeattop';
|
178 |
+
}
|
179 |
+
|
180 |
+
if ( ! empty( $csp4_settings['bg_repeat'] ) && $csp4_settings['bg_repeat'] == 'repeat-y' ) {
|
181 |
+
$csp4_template['document']['settings']['bgPosition'] = 'repeatvc';
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
//$csp4_template['document']['settings']['customCss'] .=
|
186 |
+
|
187 |
+
// set width
|
188 |
+
if ( ! empty( $csp4_settings['max_width'] ) ) {
|
189 |
+
$csp4_template['document']['sections'][0]['settings']['width'] = $csp4_settings['max_width'];
|
190 |
+
}
|
191 |
+
|
192 |
+
// enable well
|
193 |
+
if ( ! empty( $csp4_settings['enable_well'] ) ) {
|
194 |
+
$csp4_template['document']['sections'][0]['settings']['bgColor'] = '#ffffff';
|
195 |
+
$csp4_template['document']['sections'][0]['settings']['borderRadiusTL'] = '4';
|
196 |
+
}
|
197 |
+
|
198 |
+
// set text color
|
199 |
+
if ( ! empty( $csp4_settings['text_color'] ) ) {
|
200 |
+
$csp4_template['document']['settings']['textColor'] = $csp4_settings['text_color'];
|
201 |
+
}
|
202 |
+
|
203 |
+
// set headline color
|
204 |
+
if ( ! empty( $csp4_settings['headline_color'] ) ) {
|
205 |
+
$csp4_template['document']['settings']['headerColor'] = $csp4_settings['headline_color'];
|
206 |
+
} else {
|
207 |
+
$csp4_template['document']['settings']['headerColor'] = $csp4_settings['text_color'];
|
208 |
+
}
|
209 |
+
|
210 |
+
// set link color
|
211 |
+
if ( ! empty( $csp4_settings['link_color'] ) ) {
|
212 |
+
$csp4_template['document']['settings']['linkColor'] = $csp4_settings['link_color'];
|
213 |
+
$csp4_template['document']['settings']['buttonColor'] = $csp4_settings['link_color'];
|
214 |
+
}
|
215 |
+
|
216 |
+
// set font
|
217 |
+
if ( ! empty( $csp4_settings['text_font'] ) ) {
|
218 |
+
$csp4_template['document']['settings']['textFontVariant'] = '400';
|
219 |
+
$csp4_template['document']['settings']['headerFontVariant'] = '400';
|
220 |
+
|
221 |
+
if ( $csp4_settings['text_font'] == '_arial' ) {
|
222 |
+
$csp4_template['document']['settings']['textFont'] = "'Helvetica Neue', Arial, sans-serif";
|
223 |
+
$csp4_template['document']['settings']['headerFont'] = "'Helvetica Neue', Arial, sans-serif";
|
224 |
+
}
|
225 |
+
if ( $csp4_settings['text_font'] == '_arial_black' ) {
|
226 |
+
$csp4_template['document']['settings']['textFont'] = "'Helvetica Neue', Arial, sans-serif";
|
227 |
+
$csp4_template['document']['settings']['headerFont'] = "'Helvetica Neue', Arial, sans-serif";
|
228 |
+
$csp4_template['document']['settings']['textFontVariant'] = '700';
|
229 |
+
$csp4_template['document']['settings']['headerFontVariant'] = '700';
|
230 |
+
}
|
231 |
+
if ( $csp4_settings['text_font'] == '_georgia' ) {
|
232 |
+
$csp4_template['document']['settings']['textFont'] = 'Georgia, serif';
|
233 |
+
$csp4_template['document']['settings']['headerFont'] = 'Georgia, serif';
|
234 |
+
}
|
235 |
+
if ( $csp4_settings['text_font'] == '_helvetica_neue' ) {
|
236 |
+
$csp4_template['document']['settings']['textFont'] = "'Helvetica Neue', Arial, sans-serif";
|
237 |
+
$csp4_template['document']['settings']['headerFont'] = "'Helvetica Neue', Arial, sans-serif";
|
238 |
+
}
|
239 |
+
if ( $csp4_settings['text_font'] == '_impact' ) {
|
240 |
+
$csp4_template['document']['settings']['textFont'] = 'Impact, Charcoal, sans-serif';
|
241 |
+
$csp4_template['document']['settings']['headerFont'] = 'Impact, Charcoal, sans-serif';
|
242 |
+
}
|
243 |
+
if ( $csp4_settings['text_font'] == '_lucida' ) {
|
244 |
+
$csp4_template['document']['settings']['textFont'] = "'Helvetica Neue', Arial, sans-serif";
|
245 |
+
$csp4_template['document']['settings']['headerFont'] = "'Helvetica Neue', Arial, sans-serif";
|
246 |
+
}
|
247 |
+
if ( $csp4_settings['text_font'] == '_palatino' ) {
|
248 |
+
$csp4_template['document']['settings']['textFont'] = "'Helvetica Neue', Arial, sans-serif";
|
249 |
+
$csp4_template['document']['settings']['headerFont'] = "'Helvetica Neue', Arial, sans-serif";
|
250 |
+
}
|
251 |
+
if ( $csp4_settings['text_font'] == '_tahoma' ) {
|
252 |
+
$csp4_template['document']['settings']['textFont'] = 'Tahoma, Geneva, sans-serif';
|
253 |
+
$csp4_template['document']['settings']['headerFont'] = 'Tahoma, Geneva, sans-serif';
|
254 |
+
}
|
255 |
+
if ( $csp4_settings['text_font'] == '_times' ) {
|
256 |
+
$csp4_template['document']['settings']['textFont'] = "'Times New Roman', Times, serif";
|
257 |
+
$csp4_template['document']['settings']['headerFont'] = "'Times New Roman', Times, serif";
|
258 |
+
}
|
259 |
+
if ( $csp4_settings['text_font'] == '_trebuchet' ) {
|
260 |
+
$csp4_template['document']['settings']['textFont'] = "'Trebuchet MS', Helvetica, sans-serif";
|
261 |
+
$csp4_template['document']['settings']['headerFont'] = "'Trebuchet MS', Helvetica, sans-serif";
|
262 |
+
}
|
263 |
+
if ( $csp4_settings['text_font'] == '_verdana' ) {
|
264 |
+
$csp4_template['document']['settings']['textFont'] = 'Verdana, Geneva, sans-serif';
|
265 |
+
$csp4_template['document']['settings']['headerFont'] = 'Verdana, Geneva, sans-serif';
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
// set custom css
|
270 |
+
if ( ! empty( $csp4_settings['custom_css'] ) ) {
|
271 |
+
$csp4_template['document']['settings']['customCss'] .= $csp4_settings['custom_css'];
|
272 |
+
}
|
273 |
+
|
274 |
+
// set exclude urls
|
275 |
+
if ( ! empty( $csp4_settings['disable_default_excluded_urls'] ) ) {
|
276 |
+
$csp4_template['disable_default_excluded_urls'] = true;
|
277 |
+
}
|
278 |
+
|
279 |
+
// set header scripts
|
280 |
+
if ( ! empty( $csp4_settings['header_scripts'] ) ) {
|
281 |
+
$csp4_template['header_scripts'] .= $csp4_settings['header_scripts'];
|
282 |
+
}
|
283 |
+
|
284 |
+
// set footer scripts
|
285 |
+
if ( ! empty( $csp4_settings['footer_scripts'] ) ) {
|
286 |
+
$csp4_template['footer_scripts'] .= $csp4_settings['footer_scripts'];
|
287 |
+
}
|
288 |
+
|
289 |
+
// set append html
|
290 |
+
if ( ! empty( $csp4_settings['append_html'] ) ) {
|
291 |
+
$append_html = json_decode(
|
292 |
+
'{
|
293 |
"id": "iuf8h9",
|
294 |
"elType": "block",
|
295 |
"type": "custom-html",
|
296 |
"settings": {
|
297 |
+
"code": "' . $csp4_settings['append_html'] . '",
|
298 |
"marginTop": "0",
|
299 |
"paddingTop": "",
|
300 |
"paddingBottom": "",
|
302 |
"paddingRight": "",
|
303 |
"paddingSync": true
|
304 |
}}
|
305 |
+
'
|
306 |
+
);
|
307 |
+
if ( ! empty( $append_html ) ) {
|
308 |
+
$csp4_template['document']['sections'][0]['rows'][0]['cols'][0]['blocks'][] = $append_html;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
// create the coming soon or maintenance page and inject settings
|
314 |
+
$slug = '';
|
315 |
+
$cpt = 'page';
|
316 |
+
if ( $type == 'cs' || $type == 'mm' || $type == 'p404' ) {
|
317 |
+
$cpt = 'seedprod';
|
318 |
+
}
|
319 |
+
if ( $type == 'cs' ) {
|
320 |
+
$slug = 'sp-cs';
|
321 |
+
}
|
322 |
+
if ( $type == 'mm' ) {
|
323 |
+
$slug = 'sp-mm';
|
324 |
+
}
|
325 |
+
|
326 |
+
$id = wp_insert_post(
|
327 |
+
array(
|
328 |
+
'comment_status' => 'closed',
|
329 |
+
'ping_status' => 'closed',
|
330 |
+
'post_content' => '',
|
331 |
+
'post_status' => 'publish',
|
332 |
+
'post_title' => 'seedprod',
|
333 |
+
'post_type' => $cpt,
|
334 |
+
'post_name' => $slug,
|
335 |
+
'meta_input' => array(
|
336 |
+
'_seedprod_page' => true,
|
337 |
+
'_seedprod_page_uuid' => wp_generate_uuid4(),
|
338 |
+
),
|
339 |
+
),
|
340 |
+
true
|
341 |
+
);
|
342 |
+
|
343 |
+
// update post because wp screws our json settings
|
344 |
+
global $wpdb;
|
345 |
+
$tablename = $wpdb->prefix . 'posts';
|
346 |
+
$r = $wpdb->update(
|
347 |
+
$tablename,
|
348 |
+
array(
|
349 |
+
'post_content_filtered' => json_encode( $csp4_template ),
|
350 |
+
),
|
351 |
+
array( 'ID' => $id ),
|
352 |
+
array(
|
353 |
+
'%s',
|
354 |
+
),
|
355 |
+
array( '%d' )
|
356 |
+
);
|
357 |
+
|
358 |
+
if ( $type == 'cs' ) {
|
359 |
+
update_option( 'seedprod_coming_soon_page_id', $id );
|
360 |
+
}
|
361 |
+
if ( $type == 'mm' ) {
|
362 |
+
update_option( 'seedprod_maintenance_mode_page_id', $id );
|
363 |
+
}
|
364 |
+
|
365 |
+
// do we need to show it?
|
366 |
+
update_option( 'seedprod_csp4_imported', true );
|
367 |
+
update_option( 'seedprod_show_csp4', true );
|
368 |
+
// flush rewrite rules
|
369 |
+
flush_rewrite_rules();
|
370 |
+
}
|
371 |
+
|
372 |
+
update_option( 'seedprod_migration_run_once', true );
|
373 |
+
}
|
374 |
+
} catch ( Exception $e ) {
|
375 |
+
return $e;
|
376 |
+
}
|
|
|
|
|
|
|
|
|
377 |
}
|
378 |
|
app/backwards/csp4-functions.php
CHANGED
@@ -2,211 +2,203 @@
|
|
2 |
/**
|
3 |
* Display the legacy free coming soon page
|
4 |
*/
|
5 |
-
if (!function_exists('seedprod_lite_csp4_render_comingsoon_page')) {
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
} else {
|
98 |
-
echo $html;
|
99 |
-
}
|
100 |
-
exit();
|
101 |
-
}
|
102 |
}
|
103 |
|
104 |
// Template Tags
|
105 |
-
if (!function_exists('seedprod_lite_seed_csp4_title')) {
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
}
|
118 |
}
|
119 |
|
120 |
-
if (!function_exists('seedprod_lite_seed_csp4_metadescription')) {
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
extract($o);
|
125 |
|
126 |
-
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
|
132 |
-
|
133 |
-
|
134 |
}
|
135 |
|
136 |
-
if (!function_exists('seedprod_lite_seed_csp4_privacy')) {
|
137 |
-
|
138 |
-
|
139 |
-
$output = '';
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
-
|
146 |
-
|
147 |
}
|
148 |
|
149 |
-
if (!function_exists('seedprod_lite_seed_csp4_favicon')) {
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
extract($o);
|
154 |
|
155 |
-
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
|
162 |
-
|
163 |
-
|
164 |
}
|
165 |
|
166 |
-
if (!function_exists('seedprod_lite_seed_csp4_customcss')) {
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
extract($o);
|
171 |
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
|
178 |
-
|
179 |
-
|
180 |
}
|
181 |
|
182 |
-
if (!function_exists('seed_csp4_head')) {
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
extract($o);
|
187 |
|
188 |
-
|
189 |
-
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
|
199 |
-
|
200 |
|
201 |
-
|
202 |
-
|
203 |
|
204 |
/* Background Style */
|
205 |
-
|
206 |
-
<?php
|
207 |
-
|
|
|
|
|
|
|
208 |
background: <?php echo $bg_color; ?> url('<?php echo $bg_image; ?>') no-repeat top center fixed;
|
209 |
-
<?php if (isset($bg_size) && $bg_size == 'contain') : ?>
|
210 |
-webkit-background-size: contain;
|
211 |
-moz-background-size: contain;
|
212 |
-o-background-size: contain;
|
@@ -218,36 +210,42 @@ if (!function_exists('seed_csp4_head')) {
|
|
218 |
-o-background-size: cover;
|
219 |
background-size: cover;
|
220 |
<?php endif ?>
|
221 |
-
<?php else: ?>
|
222 |
background: <?php echo $bg_color; ?> url('<?php echo $bg_image; ?>') <?php echo $bg_repeat; ?> <?php echo $bg_position; ?> <?php echo $bg_attahcment; ?>;
|
223 |
<?php endif ?>
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
235 |
background: transparent;
|
236 |
<?php endif; ?>
|
237 |
}
|
238 |
-
|
|
|
|
|
|
|
239 |
#seed-csp4-page{
|
240 |
background-color: rgba(0,0,0,0.5);
|
241 |
}
|
242 |
<?php endif ?>
|
243 |
|
244 |
-
|
245 |
#seed-csp4-content{
|
246 |
-
|
247 |
}
|
248 |
<?php endif; ?>
|
249 |
|
250 |
-
|
251 |
#seed-csp4-content{
|
252 |
min-height: 20px;
|
253 |
padding: 19px;
|
@@ -257,48 +255,53 @@ if (!function_exists('seed_csp4_head')) {
|
|
257 |
}
|
258 |
<?php endif; ?>
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
|
271 |
-
|
272 |
.seed-csp4 body{
|
273 |
-
color:<?php echo $text_color
|
274 |
}
|
275 |
-
|
276 |
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
|
|
|
|
282 |
|
283 |
|
284 |
-
|
285 |
.seed-csp4 h1, .seed-csp4 h2, .seed-csp4 h3, .seed-csp4 h4, .seed-csp4 h5, .seed-csp4 h6{
|
286 |
-
color:<?php echo $headline_color
|
287 |
}
|
288 |
-
|
289 |
|
290 |
|
291 |
-
|
292 |
.seed-csp4 a, .seed-csp4 a:visited, .seed-csp4 a:hover, .seed-csp4 a:active, .seed-csp4 a:focus{
|
293 |
-
color:<?php echo $link_color
|
294 |
}
|
295 |
|
296 |
|
297 |
-
|
298 |
|
299 |
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
302 |
@supports (-webkit-overflow-scrolling: touch) {
|
303 |
html {
|
304 |
height: 100%;
|
@@ -314,225 +317,209 @@ if (!function_exists('seed_csp4_head')) {
|
|
314 |
<?php endif; ?>
|
315 |
<?php endif; ?>
|
316 |
|
317 |
-
|
318 |
-
|
319 |
-
$output .= ob_get_clean();
|
320 |
-
|
321 |
-
$output .= '</style>'."\n";
|
322 |
-
|
323 |
-
|
324 |
|
325 |
-
|
326 |
-
$output .= "<!-- JS -->\n";
|
327 |
-
$include_url = includes_url();
|
328 |
-
$last = $include_url[strlen($include_url)-1];
|
329 |
-
if ($last != '/') {
|
330 |
-
$include_url = $include_url . '/';
|
331 |
-
}
|
332 |
-
if (empty($enable_wp_head_footer)) {
|
333 |
-
$output .= '<script src="'.$include_url.'js/jquery/jquery.js"></script>'."\n";
|
334 |
-
}
|
335 |
-
$output .= '<script src="'.SEEDPROD_PLUGIN_URL.'app/backwards/themes/default/bootstrap/js/bootstrap.min.js"></script>'."\n";
|
336 |
|
|
|
337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
// Google Analytics
|
346 |
-
if (!empty($ga_analytics)) {
|
347 |
-
$output .= "<!-- Google Analytics -->\n";
|
348 |
-
$output .= $ga_analytics;
|
349 |
-
}
|
350 |
|
|
|
|
|
|
|
|
|
|
|
351 |
|
352 |
-
|
353 |
-
|
354 |
}
|
355 |
|
356 |
-
if (!function_exists('seedprod_lite_seed_csp4_get_font_family')) {
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
}
|
377 |
-
|
378 |
-
echo $font_family;
|
379 |
-
}
|
380 |
-
}
|
381 |
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
$o = seedprod_lite_seed_csp4_get_settings();
|
386 |
-
extract($o);
|
387 |
|
388 |
-
|
|
|
|
|
|
|
389 |
|
|
|
390 |
|
391 |
-
|
392 |
-
|
393 |
<script>
|
394 |
jQuery(document).ready(function($){';
|
395 |
|
|
|
|
|
|
|
396 |
|
397 |
-
|
398 |
-
$output .= "slides:[ {image : '$bg_image'} ]";
|
399 |
-
$output .= '});';
|
400 |
-
|
401 |
-
|
402 |
-
$output .= '});
|
403 |
</script>
|
404 |
<![endif]-->';
|
405 |
-
|
406 |
-
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
|
413 |
-
|
414 |
-
|
415 |
}
|
416 |
|
417 |
-
if (!function_exists('seedprod_lite_seed_csp4_logo')) {
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
extract($o);
|
422 |
|
423 |
-
|
424 |
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
|
429 |
-
|
430 |
-
|
431 |
}
|
432 |
|
433 |
-
if (!function_exists('seedprod_lite_seed_csp4_headline')) {
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
|
|
455 |
}
|
456 |
|
457 |
-
if (!function_exists('seedprod_lite_seed_csp4_description')) {
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
extract($o);
|
462 |
|
463 |
-
|
464 |
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
|
473 |
-
|
474 |
-
|
475 |
}
|
476 |
|
477 |
-
if (!function_exists('seed_csp4_append_html')) {
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
extract($o);
|
482 |
|
483 |
-
|
484 |
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
|
489 |
-
|
490 |
-
|
491 |
}
|
492 |
|
493 |
-
if (!function_exists('seedprod_lite_seed_csp4_credit')) {
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
extract($o);
|
498 |
|
499 |
-
|
500 |
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
|
507 |
-
|
508 |
-
|
509 |
}
|
510 |
|
511 |
-
if (!function_exists('seedprod_lite_seed_csp4_get_settings')) {
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
$s3 = get_option('seed_csp4_settings_advanced');
|
517 |
-
|
518 |
-
if (empty($s1)) {
|
519 |
-
$s1 = array();
|
520 |
-
}
|
521 |
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
|
530 |
-
|
|
|
|
|
531 |
|
|
|
532 |
|
533 |
-
|
534 |
-
|
535 |
-
}
|
536 |
}
|
537 |
|
538 |
|
2 |
/**
|
3 |
* Display the legacy free coming soon page
|
4 |
*/
|
5 |
+
if ( ! function_exists( 'seedprod_lite_csp4_render_comingsoon_page' ) ) {
|
6 |
+
function seedprod_lite_csp4_render_comingsoon_page() {
|
7 |
+
extract( seedprod_lite_seed_csp4_get_settings() );
|
8 |
+
|
9 |
+
if ( ! isset( $status ) ) {
|
10 |
+
$err = new WP_Error( 'error', __( 'Please enter your settings.', 'coming-soon' ) );
|
11 |
+
echo $err->get_error_message();
|
12 |
+
exit();
|
13 |
+
}
|
14 |
+
|
15 |
+
if ( empty( $_GET['cs_preview'] ) ) {
|
16 |
+
$_GET['cs_preview'] = false;
|
17 |
+
}
|
18 |
+
|
19 |
+
// Check if Preview
|
20 |
+
$is_preview = false;
|
21 |
+
if ( ( isset( $_GET['cs_preview'] ) && $_GET['cs_preview'] == 'true' ) ) {
|
22 |
+
$is_preview = true;
|
23 |
+
}
|
24 |
+
|
25 |
+
// Exit if a custom login page
|
26 |
+
if ( empty( $disable_default_excluded_urls ) ) {
|
27 |
+
if ( preg_match( '/login|admin|dashboard|account/i', $_SERVER['REQUEST_URI'] ) > 0 && $is_preview == false ) {
|
28 |
+
return false;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
// Check if user is logged in.
|
33 |
+
if ( $is_preview === false ) {
|
34 |
+
if ( is_user_logged_in() ) {
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
// set headers
|
40 |
+
if ( $status == '2' ) {
|
41 |
+
header( 'HTTP/1.1 503 Service Temporarily Unavailable' );
|
42 |
+
header( 'Status: 503 Service Temporarily Unavailable' );
|
43 |
+
header( 'Retry-After: 86400' ); // retry in a day
|
44 |
+
$csp4_maintenance_file = WP_CONTENT_DIR . '/maintenance.php';
|
45 |
+
if ( ! empty( $enable_maintenance_php ) and file_exists( $csp4_maintenance_file ) ) {
|
46 |
+
include_once $csp4_maintenance_file;
|
47 |
+
exit();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
// Prevetn Plugins from caching
|
52 |
+
// Disable caching plugins. This should take care of:
|
53 |
+
// - W3 Total Cache
|
54 |
+
// - WP Super Cache
|
55 |
+
// - ZenCache (Previously QuickCache)
|
56 |
+
if ( ! defined( 'DONOTCACHEPAGE' ) ) {
|
57 |
+
define( 'DONOTCACHEPAGE', true );
|
58 |
+
}
|
59 |
+
if ( ! defined( 'DONOTCDN' ) ) {
|
60 |
+
define( 'DONOTCDN', true );
|
61 |
+
}
|
62 |
+
if ( ! defined( 'DONOTCACHEDB' ) ) {
|
63 |
+
define( 'DONOTCACHEDB', true );
|
64 |
+
}
|
65 |
+
if ( ! defined( 'DONOTMINIFY' ) ) {
|
66 |
+
define( 'DONOTMINIFY', true );
|
67 |
+
}
|
68 |
+
if ( ! defined( 'DONOTCACHEOBJECT' ) ) {
|
69 |
+
define( 'DONOTCACHEOBJECT', true );
|
70 |
+
}
|
71 |
+
//ob_end_clean();
|
72 |
+
nocache_headers();
|
73 |
+
|
74 |
+
// render template tags
|
75 |
+
if ( empty( $html ) ) {
|
76 |
+
$template = file_get_contents( SEEDPROD_PLUGIN_PATH . 'app/backwards/themes/default/index.php' );
|
77 |
+
$template_tags = array(
|
78 |
+
'{Title}' => seedprod_lite_seed_csp4_title(),
|
79 |
+
'{MetaDescription}' => seedprod_lite_seed_csp4_metadescription(),
|
80 |
+
'{Privacy}' => seedprod_lite_seed_csp4_privacy(),
|
81 |
+
'{Favicon}' => seedprod_lite_seed_csp4_favicon(),
|
82 |
+
'{CustomCSS}' => seedprod_lite_seed_csp4_customcss(),
|
83 |
+
'{Head}' => seedprod_lite_seed_csp4_head(),
|
84 |
+
'{Footer}' => seedprod_lite_seed_csp4_footer(),
|
85 |
+
'{Logo}' => seedprod_lite_seed_csp4_logo(),
|
86 |
+
'{Headline}' => seedprod_lite_seed_csp4_headline(),
|
87 |
+
'{Description}' => seedprod_lite_seed_csp4_description(),
|
88 |
+
'{Credit}' => seedprod_lite_seed_csp4_credit(),
|
89 |
+
'{Append_HTML}' => seed_csp4_append_html(),
|
90 |
+
);
|
91 |
+
echo strtr( $template, $template_tags );
|
92 |
+
} else {
|
93 |
+
echo $html;
|
94 |
+
}
|
95 |
+
exit();
|
96 |
+
}
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
|
99 |
// Template Tags
|
100 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_title' ) ) {
|
101 |
+
function seedprod_lite_seed_csp4_title() {
|
102 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
103 |
+
extract( $o );
|
104 |
+
|
105 |
+
$output = '';
|
106 |
+
|
107 |
+
if ( ! empty( $seo_title ) ) {
|
108 |
+
$output = esc_html( $seo_title );
|
109 |
+
}
|
110 |
+
return $output;
|
111 |
+
}
|
|
|
112 |
}
|
113 |
|
114 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_metadescription' ) ) {
|
115 |
+
function seedprod_lite_seed_csp4_metadescription() {
|
116 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
117 |
+
extract( $o );
|
|
|
118 |
|
119 |
+
$output = '';
|
120 |
|
121 |
+
if ( ! empty( $seo_description ) ) {
|
122 |
+
$output = '<meta name="description" content="' . esc_attr( $seo_description ) . '">';
|
123 |
+
}
|
124 |
|
125 |
+
return $output;
|
126 |
+
}
|
127 |
}
|
128 |
|
129 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_privacy' ) ) {
|
130 |
+
function seedprod_lite_seed_csp4_privacy() {
|
131 |
+
$output = '';
|
|
|
132 |
|
133 |
+
if ( get_option( 'blog_public' ) == 0 ) {
|
134 |
+
$output = "<meta name='robots' content='noindex,nofollow' />";
|
135 |
+
}
|
136 |
|
137 |
+
return $output;
|
138 |
+
}
|
139 |
}
|
140 |
|
141 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_favicon' ) ) {
|
142 |
+
function seedprod_lite_seed_csp4_favicon() {
|
143 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
144 |
+
extract( $o );
|
|
|
145 |
|
146 |
+
$output = '';
|
147 |
|
148 |
+
if ( ! empty( $favicon ) ) {
|
149 |
+
$output .= "<!-- Favicon -->\n";
|
150 |
+
$output .= '<link href="' . esc_attr( $favicon ) . '" rel="shortcut icon" type="image/x-icon" />';
|
151 |
+
}
|
152 |
|
153 |
+
return $output;
|
154 |
+
}
|
155 |
}
|
156 |
|
157 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_customcss' ) ) {
|
158 |
+
function seedprod_lite_seed_csp4_customcss() {
|
159 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
160 |
+
extract( $o );
|
|
|
161 |
|
162 |
+
$output = '';
|
163 |
|
164 |
+
if ( ! empty( $custom_css ) ) {
|
165 |
+
$output = '<style type="text/css">' . esc_html( $custom_css ) . '</style>';
|
166 |
+
}
|
167 |
|
168 |
+
return $output;
|
169 |
+
}
|
170 |
}
|
171 |
|
172 |
+
if ( ! function_exists( 'seed_csp4_head' ) ) {
|
173 |
+
function seedprod_lite_seed_csp4_head() {
|
174 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
175 |
+
extract( $o );
|
|
|
176 |
|
177 |
+
// CSS
|
178 |
+
$output = '';
|
179 |
|
180 |
+
$output .= "<!-- Bootstrap and default Style -->\n";
|
181 |
+
$output .= '<link rel="stylesheet" href="' . SEEDPROD_PLUGIN_URL . 'app/backwards/themes/default/bootstrap/css/bootstrap.min.css">' . "\n";
|
182 |
+
$output .= '<link rel="stylesheet" href="' . SEEDPROD_PLUGIN_URL . 'app/backwards/themes/default/style.css">' . "\n";
|
183 |
+
if ( is_rtl() ) {
|
184 |
+
$output .= '<link rel="stylesheet" href="' . SEEDPROD_PLUGIN_URL . 'app/backwards/themes/default/rtl.css">' . "\n";
|
185 |
+
}
|
186 |
+
$output .= '<style type="text/css">' . "\n";
|
187 |
|
188 |
+
// Calculated Styles
|
189 |
|
190 |
+
$output .= '/* calculated styles */' . "\n";
|
191 |
+
ob_start(); ?>
|
192 |
|
193 |
/* Background Style */
|
194 |
+
html{
|
195 |
+
<?php
|
196 |
+
if ( ! empty( $bg_image ) ) :
|
197 |
+
;
|
198 |
+
?>
|
199 |
+
<?php if ( isset( $bg_cover ) && in_array( '1', $bg_cover ) ) : ?>
|
200 |
background: <?php echo $bg_color; ?> url('<?php echo $bg_image; ?>') no-repeat top center fixed;
|
201 |
+
<?php if ( isset( $bg_size ) && $bg_size == 'contain' ) : ?>
|
202 |
-webkit-background-size: contain;
|
203 |
-moz-background-size: contain;
|
204 |
-o-background-size: contain;
|
210 |
-o-background-size: cover;
|
211 |
background-size: cover;
|
212 |
<?php endif ?>
|
213 |
+
<?php else : ?>
|
214 |
background: <?php echo $bg_color; ?> url('<?php echo $bg_image; ?>') <?php echo $bg_repeat; ?> <?php echo $bg_position; ?> <?php echo $bg_attahcment; ?>;
|
215 |
<?php endif ?>
|
216 |
+
<?php
|
217 |
+
else :
|
218 |
+
if ( ! empty( $bg_color ) ) :
|
219 |
+
?>
|
220 |
+
background: <?php echo $bg_color; ?>;
|
221 |
+
<?php
|
222 |
+
endif;
|
223 |
+
endif;
|
224 |
+
?>
|
225 |
+
}
|
226 |
+
.seed-csp4 body{
|
227 |
+
<?php if ( ! empty( $bg_effect ) ) : ?>
|
228 |
+
background: transparent url('<?php echo plugins_url( 'images/bg-' . $bg_effect . '.png', __FILE__ ); ?>') repeat;
|
229 |
+
<?php else : ?>
|
230 |
background: transparent;
|
231 |
<?php endif; ?>
|
232 |
}
|
233 |
+
<?php
|
234 |
+
if ( ! empty( $bg_overlay ) ) :
|
235 |
+
;
|
236 |
+
?>
|
237 |
#seed-csp4-page{
|
238 |
background-color: rgba(0,0,0,0.5);
|
239 |
}
|
240 |
<?php endif ?>
|
241 |
|
242 |
+
<?php if ( ! empty( $max_width ) ) : ?>
|
243 |
#seed-csp4-content{
|
244 |
+
max-width: <?php echo intval( $max_width ); ?>px;
|
245 |
}
|
246 |
<?php endif; ?>
|
247 |
|
248 |
+
<?php if ( ! empty( $enable_well ) ) : ?>
|
249 |
#seed-csp4-content{
|
250 |
min-height: 20px;
|
251 |
padding: 19px;
|
255 |
}
|
256 |
<?php endif; ?>
|
257 |
|
258 |
+
/* Text Styles */
|
259 |
+
<?php if ( ! empty( $text_font ) ) : ?>
|
260 |
+
.seed-csp4 body{
|
261 |
+
font-family: <?php echo seedprod_lite_seed_csp4_get_font_family( $text_font ); ?>
|
262 |
+
}
|
263 |
|
264 |
+
.seed-csp4 h1, .seed-csp4 h2, .seed-csp4 h3, .seed-csp4 h4, .seed-csp4 h5, .seed-csp4 h6{
|
265 |
+
font-family: <?php echo seedprod_lite_seed_csp4_get_font_family( $text_font ); ?>
|
266 |
+
}
|
267 |
+
<?php endif; ?>
|
268 |
|
269 |
+
<?php if ( ! empty( $text_color ) ) { ?>
|
270 |
.seed-csp4 body{
|
271 |
+
color:<?php echo $text_color; ?>;
|
272 |
}
|
273 |
+
<?php } ?>
|
274 |
|
275 |
+
<?php if ( ! empty( $link_color ) ) { ?>
|
276 |
+
<?php
|
277 |
+
if ( empty( $headline_color ) ) {
|
278 |
+
$headline_color = $link_color;
|
279 |
+
}
|
280 |
+
?>
|
281 |
+
<?php } ?>
|
282 |
|
283 |
|
284 |
+
<?php if ( ! empty( $headline_color ) ) { ?>
|
285 |
.seed-csp4 h1, .seed-csp4 h2, .seed-csp4 h3, .seed-csp4 h4, .seed-csp4 h5, .seed-csp4 h6{
|
286 |
+
color:<?php echo $headline_color; ?>;
|
287 |
}
|
288 |
+
<?php } ?>
|
289 |
|
290 |
|
291 |
+
<?php if ( ! empty( $link_color ) ) { ?>
|
292 |
.seed-csp4 a, .seed-csp4 a:visited, .seed-csp4 a:hover, .seed-csp4 a:active, .seed-csp4 a:focus{
|
293 |
+
color:<?php echo $link_color; ?>;
|
294 |
}
|
295 |
|
296 |
|
297 |
+
<?php } ?>
|
298 |
|
299 |
|
300 |
+
<?php
|
301 |
+
if ( ! empty( $bg_image ) ) :
|
302 |
+
;
|
303 |
+
?>
|
304 |
+
<?php if ( isset( $bg_cover ) && in_array( '1', $bg_cover ) ) : ?>
|
305 |
@supports (-webkit-overflow-scrolling: touch) {
|
306 |
html {
|
307 |
height: 100%;
|
317 |
<?php endif; ?>
|
318 |
<?php endif; ?>
|
319 |
|
320 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
|
322 |
+
$output .= ob_get_clean();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
|
324 |
+
$output .= '</style>' . "\n";
|
325 |
|
326 |
+
// Javascript
|
327 |
+
$output .= "<!-- JS -->\n";
|
328 |
+
$include_url = includes_url();
|
329 |
+
$last = $include_url[ strlen( $include_url ) - 1 ];
|
330 |
+
if ( $last != '/' ) {
|
331 |
+
$include_url = $include_url . '/';
|
332 |
+
}
|
333 |
+
if ( empty( $enable_wp_head_footer ) ) {
|
334 |
+
$output .= '<script src="' . $include_url . 'js/jquery/jquery.js"></script>' . "\n";
|
335 |
+
}
|
336 |
+
$output .= '<script src="' . SEEDPROD_PLUGIN_URL . 'app/backwards/themes/default/bootstrap/js/bootstrap.min.js"></script>' . "\n";
|
337 |
|
338 |
+
// Header Scripts
|
339 |
+
if ( ! empty( $header_scripts ) ) {
|
340 |
+
$output .= "<!-- Header Scripts -->\n";
|
341 |
+
$output .= $header_scripts;
|
342 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
|
344 |
+
// Google Analytics
|
345 |
+
if ( ! empty( $ga_analytics ) ) {
|
346 |
+
$output .= "<!-- Google Analytics -->\n";
|
347 |
+
$output .= $ga_analytics;
|
348 |
+
}
|
349 |
|
350 |
+
return $output;
|
351 |
+
}
|
352 |
}
|
353 |
|
354 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_get_font_family' ) ) {
|
355 |
+
function seedprod_lite_seed_csp4_get_font_family( $font ) {
|
356 |
+
$fonts = array();
|
357 |
+
$fonts['_arial'] = 'Helvetica, Arial, sans-serif';
|
358 |
+
$fonts['_arial_black'] = 'Arial Black, Arial Black, Gadget, sans-serif';
|
359 |
+
$fonts['_georgia'] = 'Georgia,serif';
|
360 |
+
$fonts['_helvetica_neue'] = '"Helvetica Neue", Helvetica, Arial, sans-serif';
|
361 |
+
$fonts['_impact'] = 'Charcoal,Impact,sans-serif';
|
362 |
+
$fonts['_lucida'] = 'Lucida Grande,Lucida Sans Unicode, sans-serif';
|
363 |
+
$fonts['_palatino'] = 'Palatino,Palatino Linotype, Book Antiqua, serif';
|
364 |
+
$fonts['_tahoma'] = 'Geneva,Tahoma,sans-serif';
|
365 |
+
$fonts['_times'] = 'Times,Times New Roman, serif';
|
366 |
+
$fonts['_trebuchet'] = 'Trebuchet MS, sans-serif';
|
367 |
+
$fonts['_verdana'] = 'Verdana, Geneva, sans-serif';
|
368 |
+
|
369 |
+
if ( ! empty( $fonts[ $font ] ) ) {
|
370 |
+
$font_family = $fonts[ $font ];
|
371 |
+
} else {
|
372 |
+
$font_family = 'Helvetica Neue, Arial, sans-serif';
|
373 |
+
}
|
|
|
|
|
|
|
|
|
|
|
374 |
|
375 |
+
echo $font_family;
|
376 |
+
}
|
377 |
+
}
|
|
|
|
|
378 |
|
379 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_footer' ) ) {
|
380 |
+
function seedprod_lite_seed_csp4_footer() {
|
381 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
382 |
+
extract( $o );
|
383 |
|
384 |
+
$output = '';
|
385 |
|
386 |
+
if ( ! empty( $bg_cover ) ) {
|
387 |
+
$output .= '<!--[if lt IE 9]>
|
388 |
<script>
|
389 |
jQuery(document).ready(function($){';
|
390 |
|
391 |
+
$output .= '$.supersized({';
|
392 |
+
$output .= "slides:[ {image : '$bg_image'} ]";
|
393 |
+
$output .= '});';
|
394 |
|
395 |
+
$output .= '});
|
|
|
|
|
|
|
|
|
|
|
396 |
</script>
|
397 |
<![endif]-->';
|
398 |
+
}
|
|
|
399 |
|
400 |
+
if ( ! empty( $footer_scripts ) ) {
|
401 |
+
$output .= "<!-- Footer Scripts -->\n";
|
402 |
+
$output .= $footer_scripts;
|
403 |
+
}
|
404 |
|
405 |
+
return $output;
|
406 |
+
}
|
407 |
}
|
408 |
|
409 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_logo' ) ) {
|
410 |
+
function seedprod_lite_seed_csp4_logo() {
|
411 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
412 |
+
extract( $o );
|
|
|
413 |
|
414 |
+
$output = '';
|
415 |
|
416 |
+
if ( ! empty( $logo ) ) {
|
417 |
+
$output .= "<img id='seed-csp4-image' src='" . esc_attr( $logo ) . "'>";
|
418 |
+
}
|
419 |
|
420 |
+
return $output;
|
421 |
+
}
|
422 |
}
|
423 |
|
424 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_headline' ) ) {
|
425 |
+
function seedprod_lite_seed_csp4_headline() {
|
426 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
427 |
+
extract( $o );
|
428 |
+
|
429 |
+
$output = '';
|
430 |
+
|
431 |
+
if ( ! empty( $headline ) ) {
|
432 |
+
$output .= '<h1 id="seed-csp4-headline">' . wp_kses(
|
433 |
+
$headline,
|
434 |
+
array(
|
435 |
+
'a' => array(
|
436 |
+
'href' => array(),
|
437 |
+
'title' => array(),
|
438 |
+
),
|
439 |
+
'br' => array(),
|
440 |
+
'em' => array(),
|
441 |
+
'strong' => array(),
|
442 |
+
)
|
443 |
+
) . '</h1>';
|
444 |
+
}
|
445 |
+
|
446 |
+
return $output;
|
447 |
+
}
|
448 |
}
|
449 |
|
450 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_description' ) ) {
|
451 |
+
function seedprod_lite_seed_csp4_description() {
|
452 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
453 |
+
extract( $o );
|
|
|
454 |
|
455 |
+
$output = '';
|
456 |
|
457 |
+
if ( ! empty( $description ) ) {
|
458 |
+
if ( has_shortcode( $description, 'rafflepress' ) ) {
|
459 |
+
$output .= '<div id="seed-csp4-description">' . do_shortcode( shortcode_unautop( wpautop( convert_chars( wptexturize( $description ) ) ) ) ) . '</div>';
|
460 |
+
} else {
|
461 |
+
$output .= '<div id="seed-csp4-description">' . shortcode_unautop( wpautop( convert_chars( wptexturize( $description ) ) ) ) . '</div>';
|
462 |
+
}
|
463 |
+
}
|
464 |
|
465 |
+
return $output;
|
466 |
+
}
|
467 |
}
|
468 |
|
469 |
+
if ( ! function_exists( 'seed_csp4_append_html' ) ) {
|
470 |
+
function seed_csp4_append_html() {
|
471 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
472 |
+
extract( $o );
|
|
|
473 |
|
474 |
+
$output = '';
|
475 |
|
476 |
+
if ( ! empty( $append_html ) ) {
|
477 |
+
$output .= '<div id="coming-soon-custom-html">' . $append_html . '</div>';
|
478 |
+
}
|
479 |
|
480 |
+
return $output;
|
481 |
+
}
|
482 |
}
|
483 |
|
484 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_credit' ) ) {
|
485 |
+
function seedprod_lite_seed_csp4_credit() {
|
486 |
+
$o = seedprod_lite_seed_csp4_get_settings();
|
487 |
+
extract( $o );
|
|
|
488 |
|
489 |
+
$output = '';
|
490 |
|
491 |
+
if ( ! empty( $footer_credit ) ) {
|
492 |
+
$output = '<div id="seed-csp4-credit">';
|
493 |
+
$output .= '<a target="_blank" href="http://www.seedprod.com/?utm_source=coming-soon-credit-link&utm_medium=banner&utm_campaign=coming-soon-plugin-credit-link"><img style="width:75px" src="' . SEEDPROD_PLUGIN_URL . 'public/svg/powered-by-logo.svg"></a>';
|
494 |
+
$output .= '</div>';
|
495 |
+
}
|
496 |
|
497 |
+
return $output;
|
498 |
+
}
|
499 |
}
|
500 |
|
501 |
+
if ( ! function_exists( 'seedprod_lite_seed_csp4_get_settings' ) ) {
|
502 |
+
function seedprod_lite_seed_csp4_get_settings() {
|
503 |
+
$s1 = get_option( 'seed_csp4_settings_content' );
|
504 |
+
$s2 = get_option( 'seed_csp4_settings_design' );
|
505 |
+
$s3 = get_option( 'seed_csp4_settings_advanced' );
|
|
|
|
|
|
|
|
|
|
|
506 |
|
507 |
+
if ( empty( $s1 ) ) {
|
508 |
+
$s1 = array();
|
509 |
+
}
|
510 |
|
511 |
+
if ( empty( $s2 ) ) {
|
512 |
+
$s2 = array();
|
513 |
+
}
|
514 |
|
515 |
+
if ( empty( $s3 ) ) {
|
516 |
+
$s3 = array();
|
517 |
+
}
|
518 |
|
519 |
+
$settings = $s1 + $s2 + $s3;
|
520 |
|
521 |
+
return apply_filters( 'seedprod_lite_seed_csp4_get_settings', $settings );
|
522 |
+
}
|
|
|
523 |
}
|
524 |
|
525 |
|
app/bootstrap.php
CHANGED
@@ -4,318 +4,641 @@
|
|
4 |
/**
|
5 |
* Enqueue Styles and Scripts
|
6 |
*/
|
7 |
-
function seedprod_lite_admin_enqueue_scripts($hook_suffix)
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
if (strpos($hook_suffix, 'seedprod_lite_builder') !== false) {
|
97 |
-
wp_enqueue_style(
|
98 |
-
'seedprod-css',
|
99 |
-
SEEDPROD_PLUGIN_URL . 'public/css/admin-style.min.css',
|
100 |
-
false,
|
101 |
-
SEEDPROD_VERSION
|
102 |
-
);
|
103 |
-
wp_enqueue_style(
|
104 |
-
'seedprod-builder-css',
|
105 |
-
SEEDPROD_PLUGIN_URL . 'public/css/tailwind-builder.min.css',
|
106 |
-
false,
|
107 |
-
SEEDPROD_VERSION
|
108 |
-
);
|
109 |
-
|
110 |
-
// Load WPForms CSS assets.
|
111 |
-
if (function_exists('wpforms')) {
|
112 |
-
add_filter( 'wpforms_global_assets', '__return_true' );
|
113 |
-
wpforms()->frontend->assets_css();
|
114 |
-
}
|
115 |
-
}
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
false,
|
122 |
-
SEEDPROD_VERSION
|
123 |
-
);
|
124 |
-
wp_enqueue_style(
|
125 |
-
'seedprod-builder-css',
|
126 |
-
SEEDPROD_PLUGIN_URL . 'public/css/tailwind-builder.min.css',
|
127 |
-
false,
|
128 |
-
SEEDPROD_VERSION
|
129 |
-
);
|
130 |
-
}
|
131 |
|
|
|
|
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
);
|
140 |
-
}
|
141 |
|
142 |
-
|
|
|
|
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
-
wp_register_script(
|
152 |
-
'seedprod-iframeresizer',
|
153 |
-
SEEDPROD_PLUGIN_URL . 'public/js/iframeResizer.min.js',
|
154 |
-
array(),
|
155 |
-
SEEDPROD_VERSION,
|
156 |
-
false
|
157 |
-
);
|
158 |
-
wp_enqueue_script('seedprod-iframeresizer');
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
-
add_action('admin_enqueue_scripts', 'seedprod_lite_admin_enqueue_scripts',99999);
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
function seedprod_lite_wp_enqueue_styles()
|
170 |
-
{
|
171 |
-
// wp_register_style(
|
172 |
-
// 'seedprod-style',
|
173 |
-
// SEEDPROD_PLUGIN_URL . 'public/css/seedprod-style.min.css',
|
174 |
-
// false,
|
175 |
-
// SEEDPROD_VERSION
|
176 |
-
// );
|
177 |
-
//wp_enqueue_style('seedprod-style');
|
178 |
-
|
179 |
-
$is_user_logged_in = is_user_logged_in();
|
180 |
-
if ($is_user_logged_in) {
|
181 |
-
wp_enqueue_style(
|
182 |
-
'seedprod-global-admin',
|
183 |
-
SEEDPROD_PLUGIN_URL . 'public/css/global-admin.css',
|
184 |
-
false,
|
185 |
-
SEEDPROD_VERSION
|
186 |
-
);
|
187 |
-
}
|
188 |
|
189 |
-
wp_register_style(
|
190 |
-
'seedprod-fontawesome',
|
191 |
-
SEEDPROD_PLUGIN_URL . 'public/fontawesome/css/all.min.css',
|
192 |
-
false,
|
193 |
-
SEEDPROD_VERSION
|
194 |
-
);
|
195 |
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
-
add_action('init', 'seedprod_lite_wp_enqueue_styles');
|
199 |
|
200 |
|
201 |
-
/**
|
202 |
-
* Display settings link on plugin page
|
203 |
-
*/
|
204 |
-
add_filter('plugin_action_links', 'seedprod_lite_plugin_action_links', 10, 2);
|
205 |
|
206 |
-
function
|
207 |
-
{
|
208 |
-
|
|
|
209 |
|
210 |
-
|
211 |
-
$settings_link = '<a href="admin.php?page=seedprod_lite">Setup</a>';
|
212 |
-
array_unshift($links, $settings_link);
|
213 |
-
}
|
214 |
-
return $links;
|
215 |
}
|
|
|
216 |
|
217 |
-
/**
|
218 |
-
* Remove other plugin's style from our page so they don't conflict
|
219 |
-
*/
|
220 |
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
{
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
}
|
245 |
-
|
246 |
-
}
|
247 |
|
248 |
-
|
249 |
-
// //echo '<br> '.$handle;
|
250 |
-
// if (!in_array($handle, $s)) {
|
251 |
-
// if (strpos($handle, 'seedprod') === false && strpos($asset->src, $wpforms_url) === false) {
|
252 |
-
// wp_dequeue_style($handle);
|
253 |
-
// wp_deregister_style($handle);
|
254 |
-
// echo '<br>removed '.$handle;
|
255 |
-
// }
|
256 |
-
// }
|
257 |
-
// }
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
|
261 |
|
|
|
|
|
262 |
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
|
265 |
-
$s = 'admin-bar|common|utils|wp-auth-check|media-upload|jquery|media-editor|media-audiovideo|mce-view|image-edit|wp-tinymce|editor|quicktags|wplink|jquery-ui-autocomplete|thickbox|svg-painter|jquery-ui-core|jquery-ui-mouse|jquery-ui-accordion|jquery-ui-datepicker|jquery-ui-dialog|jquery-ui-slider|jquery-ui-sortable|jquery-ui-droppable|jquery-ui-tabs|jquery-ui-widget|wp-mediaelement|wp-util|underscore|wp-dom-ready|wp-components|wp-element|wp-i18n|wp-polyfill';
|
266 |
-
$d = explode("|", urldecode($s));
|
267 |
|
268 |
-
global $wp_scripts;
|
269 |
-
foreach ($wp_scripts->queue as $handle) :
|
270 |
-
//echo '<br>removed '.$handle;
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
}
|
283 |
}
|
284 |
}
|
285 |
|
|
|
|
|
|
|
286 |
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
$classes .= ' seedprod-body seedprod-lite';
|
292 |
-
}
|
293 |
-
if (!empty($_GET['page']) && (strpos($_GET['page'], 'seedprod_lite_builder') !== false)) {
|
294 |
-
$classes .= ' seedprod-builder seedprod-lite';
|
295 |
-
}
|
296 |
-
return $classes;
|
297 |
}
|
298 |
|
299 |
|
300 |
-
// Review Request
|
301 |
-
add_action('admin_footer_text', 'seedprod_lite_admin_footer');
|
302 |
|
303 |
-
function seedprod_lite_admin_footer($text)
|
304 |
-
{
|
305 |
-
global $current_screen;
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
|
|
|
314 |
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
}
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
/**
|
5 |
* Enqueue Styles and Scripts
|
6 |
*/
|
7 |
+
function seedprod_lite_admin_enqueue_scripts( $hook_suffix ) {
|
8 |
+
// global admin style
|
9 |
+
wp_enqueue_style(
|
10 |
+
'seedprod-global-admin',
|
11 |
+
SEEDPROD_PLUGIN_URL . 'public/css/global-admin.css',
|
12 |
+
false,
|
13 |
+
SEEDPROD_VERSION
|
14 |
+
);
|
15 |
+
|
16 |
+
$is_localhost = seedprod_lite_is_localhost();
|
17 |
+
|
18 |
+
// Load our admin styles and scripts only on our pages
|
19 |
+
if ( strpos( $hook_suffix, 'seedprod_lite' ) !== false ) {
|
20 |
+
// remove conflicting scripts
|
21 |
+
wp_dequeue_script( 'googlesitekit_admin' );
|
22 |
+
|
23 |
+
$vue_app_folder = 'lite';
|
24 |
+
if ( strpos( $hook_suffix, 'seedprod_lite_builder' ) !== false || strpos( $hook_suffix, 'seedprod_lite_template' ) !== false ) {
|
25 |
+
if ( $is_localhost ) {
|
26 |
+
} else {
|
27 |
+
wp_register_script(
|
28 |
+
'seedprod_vue_builder_app_1',
|
29 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/index.js',
|
30 |
+
array( 'wp-i18n' ),
|
31 |
+
SEEDPROD_VERSION,
|
32 |
+
true
|
33 |
+
);
|
34 |
+
wp_register_script(
|
35 |
+
'seedprod_vue_builder_app_2',
|
36 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/chunk-vendors.js',
|
37 |
+
array( 'wp-i18n' ),
|
38 |
+
SEEDPROD_VERSION,
|
39 |
+
true
|
40 |
+
);
|
41 |
+
wp_register_script(
|
42 |
+
'seedprod_vue_builder_app_3',
|
43 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/chunk-common.js',
|
44 |
+
array( 'wp-i18n' ),
|
45 |
+
SEEDPROD_VERSION,
|
46 |
+
true
|
47 |
+
);
|
48 |
+
|
49 |
+
wp_set_script_translations( 'seedprod_vue_builder_app_1', 'coming-soon' );
|
50 |
+
wp_set_script_translations( 'seedprod_vue_builder_app_2', 'coming-soon' );
|
51 |
+
wp_set_script_translations( 'seedprod_vue_builder_app_3', 'coming-soon' );
|
52 |
+
|
53 |
+
wp_enqueue_script( 'seedprod_vue_builder_app_1' );
|
54 |
+
wp_enqueue_script( 'seedprod_vue_builder_app_2' );
|
55 |
+
wp_enqueue_script( 'seedprod_vue_builder_app_3' );
|
56 |
+
wp_enqueue_style( 'seedprod_vue_builder_app_css_1', SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/css/chunk-vendors.css', false, SEEDPROD_VERSION );
|
57 |
+
}
|
58 |
+
} else {
|
59 |
+
if ( $is_localhost ) {
|
60 |
+
} else {
|
61 |
+
wp_register_script(
|
62 |
+
'seedprod_vue_admin_app_1',
|
63 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/admin.js',
|
64 |
+
array( 'wp-i18n' ),
|
65 |
+
SEEDPROD_VERSION,
|
66 |
+
true
|
67 |
+
);
|
68 |
+
wp_register_script(
|
69 |
+
'seedprod_vue_admin_app_2',
|
70 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/chunk-vendors.js',
|
71 |
+
array( 'wp-i18n' ),
|
72 |
+
SEEDPROD_VERSION,
|
73 |
+
true
|
74 |
+
);
|
75 |
+
wp_register_script(
|
76 |
+
'seedprod_vue_admin_app_3',
|
77 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/js/chunk-common.js',
|
78 |
+
array( 'wp-i18n' ),
|
79 |
+
SEEDPROD_VERSION,
|
80 |
+
true
|
81 |
+
);
|
82 |
+
|
83 |
+
wp_set_script_translations( 'seedprod_vue_admin_app_1', 'coming-soon' );
|
84 |
+
wp_set_script_translations( 'seedprod_vue_admin_app_2', 'coming-soon' );
|
85 |
+
wp_set_script_translations( 'seedprod_vue_admin_app_3', 'coming-soon' );
|
86 |
+
|
87 |
+
wp_enqueue_script( 'seedprod_vue_admin_app_1' );
|
88 |
+
wp_enqueue_script( 'seedprod_vue_admin_app_2' );
|
89 |
+
wp_enqueue_script( 'seedprod_vue_admin_app_3' );
|
90 |
+
wp_enqueue_style(
|
91 |
+
'seedprod_vue_admin_app_css_1',
|
92 |
+
SEEDPROD_PLUGIN_URL . 'public/' . $vue_app_folder . '/vue-backend/css/chunk-vendors.css',
|
93 |
+
false,
|
94 |
+
SEEDPROD_VERSION
|
95 |
+
);
|
96 |
+
// wp_enqueue_style(
|
97 |
+
// 'seedprod_vue_admin_app_css_2',
|
98 |
+
// SEEDPROD_PLUGIN_URL . 'public/'.$vue_app_folder.'/vue-backend/css/admin.css',
|
99 |
+
// false,
|
100 |
+
// SEEDPROD_VERSION
|
101 |
+
// );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( strpos( $hook_suffix, 'seedprod_lite_builder' ) !== false ) {
|
106 |
+
wp_enqueue_style(
|
107 |
+
'seedprod-css',
|
108 |
+
SEEDPROD_PLUGIN_URL . 'public/css/admin-style.min.css',
|
109 |
+
false,
|
110 |
+
SEEDPROD_VERSION
|
111 |
+
);
|
112 |
+
wp_enqueue_style(
|
113 |
+
'seedprod-builder-css',
|
114 |
+
SEEDPROD_PLUGIN_URL . 'public/css/tailwind-builder.min.css',
|
115 |
+
false,
|
116 |
+
SEEDPROD_VERSION
|
117 |
+
);
|
118 |
+
|
119 |
+
// Load WPForms CSS assets.
|
120 |
+
if ( function_exists( 'wpforms' ) ) {
|
121 |
+
add_filter( 'wpforms_global_assets', '__return_true' );
|
122 |
+
wpforms()->frontend->assets_css();
|
123 |
+
}
|
124 |
+
|
125 |
+
// Load WooCommerce default styles if WooCommerce is active
|
126 |
+
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
127 |
+
wp_enqueue_style(
|
128 |
+
'seedprod-woocommerce-layout',
|
129 |
+
str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/woocommerce-layout.css',
|
130 |
+
'',
|
131 |
+
defined( 'WC_VERSION' ) ? WC_VERSION : null,
|
132 |
+
'all'
|
133 |
+
);
|
134 |
+
wp_enqueue_style(
|
135 |
+
'seedprod-woocommerce-smallscreen',
|
136 |
+
str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/woocommerce-smallscreen.css',
|
137 |
+
'',
|
138 |
+
defined( 'WC_VERSION' ) ? WC_VERSION : null,
|
139 |
+
'only screen and (max-width: 1088px)' // 768px default break + 320px for sidebar
|
140 |
+
);
|
141 |
+
wp_enqueue_style(
|
142 |
+
'seedprod-woocommerce-general',
|
143 |
+
str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/woocommerce.css',
|
144 |
+
'',
|
145 |
+
defined( 'WC_VERSION' ) ? WC_VERSION : null,
|
146 |
+
'all'
|
147 |
+
);
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
if ( strpos( $hook_suffix, 'seedprod_lite_template' ) !== false ) {
|
152 |
+
wp_enqueue_style(
|
153 |
+
'seedprod-css',
|
154 |
+
SEEDPROD_PLUGIN_URL . 'public/css/admin-style.min.css',
|
155 |
+
false,
|
156 |
+
SEEDPROD_VERSION
|
157 |
+
);
|
158 |
+
wp_enqueue_style(
|
159 |
+
'seedprod-builder-css',
|
160 |
+
SEEDPROD_PLUGIN_URL . 'public/css/tailwind-builder.min.css',
|
161 |
+
false,
|
162 |
+
SEEDPROD_VERSION
|
163 |
+
);
|
164 |
+
}
|
165 |
+
|
166 |
+
if ( strpos( $hook_suffix, 'seedprod_lite_builder' ) === false ) {
|
167 |
+
wp_enqueue_style(
|
168 |
+
'seedprod-css',
|
169 |
+
SEEDPROD_PLUGIN_URL . 'public/css/tailwind-admin.min.css',
|
170 |
+
false,
|
171 |
+
SEEDPROD_VERSION
|
172 |
+
);
|
173 |
+
}
|
174 |
+
|
175 |
+
wp_enqueue_style( 'seedprod-google-fonts', 'https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,600,700&display=swap', false );
|
176 |
+
|
177 |
+
wp_enqueue_style(
|
178 |
+
'seedprod-fontawesome',
|
179 |
+
SEEDPROD_PLUGIN_URL . 'public/fontawesome/css/all.min.css',
|
180 |
+
false,
|
181 |
+
SEEDPROD_VERSION
|
182 |
+
);
|
183 |
+
|
184 |
+
wp_register_script(
|
185 |
+
'seedprod-iframeresizer',
|
186 |
+
SEEDPROD_PLUGIN_URL . 'public/js/iframeResizer.min.js',
|
187 |
+
array(),
|
188 |
+
SEEDPROD_VERSION,
|
189 |
+
false
|
190 |
+
);
|
191 |
+
wp_enqueue_script( 'seedprod-iframeresizer' );
|
192 |
+
|
193 |
+
wp_enqueue_media();
|
194 |
+
wp_enqueue_script( 'wp-tinymce' );
|
195 |
+
wp_enqueue_editor();
|
196 |
+
}
|
197 |
+
}
|
198 |
+
add_action( 'admin_enqueue_scripts', 'seedprod_lite_admin_enqueue_scripts', 99999 );
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
function seedprod_lite_wp_enqueue_styles() {
|
203 |
+
// wp_register_style(
|
204 |
+
// 'seedprod-style',
|
205 |
+
// SEEDPROD_PLUGIN_URL . 'public/css/seedprod-style.min.css',
|
206 |
+
// false,
|
207 |
+
// SEEDPROD_VERSION
|
208 |
+
// );
|
209 |
+
//wp_enqueue_style('seedprod-style');
|
210 |
+
|
211 |
+
$is_user_logged_in = is_user_logged_in();
|
212 |
+
if ( $is_user_logged_in ) {
|
213 |
+
wp_enqueue_style(
|
214 |
+
'seedprod-global-admin',
|
215 |
+
SEEDPROD_PLUGIN_URL . 'public/css/global-admin.css',
|
216 |
+
false,
|
217 |
+
SEEDPROD_VERSION
|
218 |
+
);
|
219 |
+
}
|
220 |
+
|
221 |
+
wp_register_style(
|
222 |
+
'seedprod-fontawesome',
|
223 |
+
SEEDPROD_PLUGIN_URL . 'public/fontawesome/css/all.min.css',
|
224 |
+
false,
|
225 |
+
SEEDPROD_VERSION
|
226 |
+
);
|
227 |
+
|
228 |
+
//wp_enqueue_style('seedprod-fontawesome');
|
229 |
+
}
|
230 |
+
add_action( 'init', 'seedprod_lite_wp_enqueue_styles' );
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
/**
|
234 |
+
* Display settings link on plugin page
|
235 |
+
*/
|
236 |
+
add_filter( 'plugin_action_links', 'seedprod_lite_plugin_action_links', 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
+
function seedprod_lite_plugin_action_links( $links, $file ) {
|
239 |
+
$plugin_file = SEEDPROD_SLUG;
|
240 |
|
241 |
+
if ( $file == $plugin_file ) {
|
242 |
+
$settings_link = '<a href="admin.php?page=seedprod_lite">Setup</a>';
|
243 |
+
array_unshift( $links, $settings_link );
|
244 |
+
}
|
245 |
+
return $links;
|
246 |
+
}
|
|
|
|
|
247 |
|
248 |
+
/**
|
249 |
+
* Remove other plugin's style from our page so they don't conflict
|
250 |
+
*/
|
251 |
|
252 |
+
add_action( 'admin_enqueue_scripts', 'seedprod_lite_deregister_backend_styles', PHP_INT_MAX );
|
253 |
+
|
254 |
+
function seedprod_lite_deregister_backend_styles() {
|
255 |
+
// remove scripts registered by the theme so they don't screw up our page's style
|
256 |
+
if ( isset( $_GET['page'] ) && strpos( $_GET['page'], 'seedprod_lite_builder' ) !== false ) {
|
257 |
+
wp_dequeue_style( 'dashicons', 9999 );
|
258 |
+
$seedprod_builder_debug = get_option( 'seedprod_builder_debug' );
|
259 |
+
if ( empty( $seedprod_builder_debug ) ) {
|
260 |
+
global $wp_styles;
|
261 |
+
// list of styles to keep else remove
|
262 |
+
$keep_styles = 'media-views|editor-buttons|imgareaselect|buttons|wp-auth-check|wpforms-full|thickbox|wp-mediaelement|wp-util';
|
263 |
+
$s = explode( '|', $keep_styles );
|
264 |
+
|
265 |
+
$wpforms_url = plugins_url( 'wpforms' );
|
266 |
+
|
267 |
+
foreach ( $wp_styles->queue as $handle ) {
|
268 |
+
//echo '<br> '.$handle;
|
269 |
+
if ( ! in_array( $handle, $s ) ) {
|
270 |
+
if ( strpos( $handle, 'seedprod' ) === false ) {
|
271 |
+
wp_dequeue_style( $handle );
|
272 |
+
wp_deregister_style( $handle );
|
273 |
+
//echo '<br>removed '.$handle;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
// foreach ($wp_styles->registered as $handle => $asset) {
|
279 |
+
// //echo '<br> '.$handle;
|
280 |
+
// if (!in_array($handle, $s)) {
|
281 |
+
// if (strpos($handle, 'seedprod') === false && strpos($asset->src, $wpforms_url) === false) {
|
282 |
+
// wp_dequeue_style($handle);
|
283 |
+
// wp_deregister_style($handle);
|
284 |
+
// echo '<br>removed '.$handle;
|
285 |
+
// }
|
286 |
+
// }
|
287 |
+
// }
|
288 |
+
|
289 |
+
// remove scripts
|
290 |
+
|
291 |
+
$s = 'admin-bar|common|utils|wp-auth-check|media-upload|jquery|media-editor|media-audiovideo|mce-view|image-edit|wp-tinymce|editor|quicktags|wplink|jquery-ui-autocomplete|thickbox|svg-painter|jquery-ui-core|jquery-ui-mouse|jquery-ui-accordion|jquery-ui-datepicker|jquery-ui-dialog|jquery-ui-slider|jquery-ui-sortable|jquery-ui-droppable|jquery-ui-tabs|jquery-ui-widget|wp-mediaelement|wp-util|underscore|wp-dom-ready|wp-components|wp-element|wp-i18n|wp-polyfill';
|
292 |
+
$d = explode( '|', urldecode( $s ) );
|
293 |
+
|
294 |
+
global $wp_scripts;
|
295 |
+
foreach ( $wp_scripts->queue as $handle ) :
|
296 |
+
//echo '<br>removed '.$handle;
|
297 |
+
|
298 |
+
if ( ! empty( $d ) ) {
|
299 |
+
if ( ! in_array( $handle, $d ) ) {
|
300 |
+
if ( strpos( $handle, 'seedprod' ) === false ) {
|
301 |
+
wp_dequeue_script( $handle );
|
302 |
+
wp_deregister_script( $handle );
|
303 |
+
//echo '<br>removed '.$handle;
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
endforeach;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
}
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
|
313 |
+
add_filter( 'admin_body_class', 'seedprod_lite_add_admin_body_classes' );
|
314 |
+
function seedprod_lite_add_admin_body_classes( $classes ) {
|
315 |
+
if ( ! empty( $_GET['page'] ) && strpos( $_GET['page'], 'seedprod_lite' ) !== false ) {
|
316 |
+
$classes .= ' seedprod-body seedprod-lite';
|
317 |
+
}
|
318 |
+
if ( ! empty( $_GET['page'] ) && ( strpos( $_GET['page'], 'seedprod_lite_builder' ) !== false ) ) {
|
319 |
+
$classes .= ' seedprod-builder seedprod-lite';
|
320 |
+
}
|
321 |
+
return $classes;
|
322 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
+
// Review Request
|
326 |
+
add_action( 'admin_footer_text', 'seedprod_lite_admin_footer' );
|
327 |
+
|
328 |
+
function seedprod_lite_admin_footer( $text ) {
|
329 |
+
global $current_screen;
|
330 |
+
|
331 |
+
if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'seedprod' ) !== false && SEEDPROD_BUILD == 'lite' ) {
|
332 |
+
$url = 'https://wordpress.org/support/plugin/coming-soon/reviews/?filter=5#new-post';
|
333 |
+
$text = sprintf( __( 'Please rate <strong>SeedProd</strong> <a href="%1$s" target="_blank">★★★★★</a> on <a href="%2$s" target="_blank">WordPress.org</a> to help us spread the word. Thank you from the SeedProd team!', 'coming-soon' ), $url, $url );
|
334 |
+
}
|
335 |
+
return $text;
|
336 |
}
|
|
|
337 |
|
338 |
|
|
|
|
|
|
|
|
|
339 |
|
340 |
+
function seedprod_lite_change_footer_version( $str ) {
|
341 |
+
if ( ! empty( $_GET['page'] ) && strpos( $_GET['page'], 'seedprod_lite' ) !== false ) {
|
342 |
+
return $str . ' - SeedProd ' . SEEDPROD_VERSION;
|
343 |
+
}
|
344 |
|
345 |
+
return $str;
|
|
|
|
|
|
|
|
|
346 |
}
|
347 |
+
add_filter( 'update_footer', 'seedprod_lite_change_footer_version', 9999 );
|
348 |
|
|
|
|
|
|
|
349 |
|
350 |
+
|
351 |
+
/*
|
352 |
+
add_action( 'admin_footer', 'seedprod_lite_print_admin_js_template');
|
353 |
+
function seedprod_lite_print_admin_js_template() {
|
354 |
+
?>
|
355 |
+
<script id="seedprod-button-switch-mode" type="text/html">
|
356 |
+
<div id="seedprod-switch-mode">
|
357 |
+
<?php echo __( 'Edit with SeedProd', 'elementor' ); ?>
|
358 |
+
</div>
|
359 |
+
</script>
|
360 |
+
<?php
|
361 |
+
}
|
362 |
+
*/
|
363 |
+
|
364 |
+
|
365 |
+
function seedprod_lite_add_admin_edit_seedprod() {
|
366 |
+
$screen = get_current_screen();
|
367 |
+
if ( 'page' === $screen->post_type ) {
|
368 |
+
$id = 0;
|
369 |
+
$is_seedprod = 0;
|
370 |
+
$seedprod_template_label = 'seedprod_lite';
|
371 |
+
$is_seedprod_true = 'seed_editor_false';
|
372 |
+
$remove_post_callback = 'seedprod_lite_remove_post';
|
373 |
+
$seedprod_template_type = 'template';
|
374 |
+
|
375 |
+
|
376 |
+
if ( ! empty( $_GET['post'] ) ) {
|
377 |
+
$id = $_GET['post'];
|
378 |
+
|
379 |
+
if ( ! empty( get_post_meta( $id, '_seedprod_page', true ) ) ) {
|
380 |
+
$is_seedprod = get_post_meta( $id, '_seedprod_page', true );
|
381 |
+
$is_seedprod_true = 'seed_editor_true';
|
382 |
+
$seedprod_template_type = 'builder';
|
383 |
+
}
|
384 |
+
|
385 |
+
if ( ! empty( get_post_field( 'post_content_filtered', $id ) ) ) {
|
386 |
+
$seedprod_template_type = 'builder';
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
if ( $seedprod_template_type == 'template' ) {
|
391 |
+
$edit_url = admin_url() . 'admin.php?page=' . $seedprod_template_label . '_template&id=' . $id . '#/template/' . $id;
|
392 |
+
} else {
|
393 |
+
$edit_url = admin_url() . 'admin.php?page=' . $seedprod_template_label . '_builder&id=' . $id . '#/setup/' . $id;
|
394 |
+
}
|
395 |
+
|
396 |
+
$edit_seedprod_label = '<img src="' . SEEDPROD_PLUGIN_URL . 'public/svg/admin-bar-icon.svg" style="margin-right:7px; margin-top:5px">' . __( 'Edit with SeedProd', 'coming-soon' );
|
397 |
+
$back_wordpress_label = __( 'Back to WordPress Editor', 'coming-soon' );
|
398 |
+
|
399 |
+
$localizations = array( 'ajax_url' => admin_url( 'admin-ajax.php' ) );
|
400 |
+
|
401 |
+
printf(
|
402 |
+
'
|
403 |
+
<div class="active-seed-prod-buttons">
|
404 |
+
<div class="' . $is_seedprod_true . '">
|
405 |
+
<span class="seedprod-off">
|
406 |
+
<a href="' . $edit_url . '" id="edit_seedprod_custom_link" class="edit_seedprod_custom_link button button-primary">
|
407 |
+
' . $edit_seedprod_label . '
|
408 |
+
</a></span>
|
409 |
+
<span class="seedprod-on">
|
410 |
+
<a href="#back" class="back_to_wp_editor button">' . $back_wordpress_label . '</a>
|
411 |
+
</span>
|
412 |
+
</div>
|
413 |
+
</div>
|
414 |
+
<div class="seedprod_hidden_data">
|
415 |
+
<input type="hidden" class="_seedprod_template_type" name="_seedprod_template_type" value="' . $seedprod_template_type . '"/>
|
416 |
+
<input type="hidden" class="_seedprod_label" name="_seedprod_label" value="' . $seedprod_template_label . '"/>
|
417 |
+
<input type="hidden" class="_seedprod_template_edit_url" name="_seedprod_template_edit_url" value="' . $edit_url . '"/>
|
418 |
+
<input type="hidden" class="_seedprod_true" name="_seedprod_true" value="' . $is_seedprod_true . '"/>
|
419 |
+
</div>
|
420 |
+
'
|
421 |
+
);
|
422 |
+
|
423 |
+
echo '
|
424 |
+
<script type="text/javascript">
|
425 |
+
|
426 |
+
jQuery(document).ready(function(){
|
427 |
+
|
428 |
+
jQuery(document).on("click", ".edit_seedprod_custom_link", function(event) {
|
429 |
+
|
430 |
+
if(confirm("Please note by switching to SeedProd the current page\'s content will be replaced.")){
|
431 |
+
|
432 |
+
var url_string = window.location;
|
433 |
+
var url = new URL(url_string);
|
434 |
+
var postid = url.searchParams.get("post");
|
435 |
+
//console.log(postid);
|
436 |
+
|
437 |
+
var post_ID = 0;
|
438 |
+
if(postid!=null){
|
439 |
+
post_ID = jQuery("#post_ID").val();
|
440 |
+
}
|
441 |
+
//console.log(post_ID);
|
442 |
+
|
443 |
+
var seedprod_template_type = jQuery("._seedprod_template_type").val();
|
444 |
+
var seedprod_label = jQuery("._seedprod_label").val();
|
445 |
+
var seedprod_template_edit_url = jQuery("._seedprod_template_edit_url").val();
|
446 |
+
var seedprod_true = jQuery("._seedprod_true").val();
|
447 |
+
|
448 |
+
var seedprod_template_edit_url_ = "";
|
449 |
+
var admin_url = localizedVars.admin_url;
|
450 |
+
|
451 |
+
if(seedprod_template_type=="template"){
|
452 |
+
seedprod_template_edit_url_ = `${admin_url}?page=${seedprod_label}_${seedprod_template_type}&id=${post_ID}#/template/${post_ID}`;
|
453 |
+
}else{
|
454 |
+
seedprod_template_edit_url_ = `${admin_url}?page=${seedprod_label}_${seedprod_template_type}&id=${post_ID}#/setup/${post_ID}`;
|
455 |
+
}
|
456 |
+
|
457 |
+
location.href = seedprod_template_edit_url_;
|
458 |
+
|
459 |
}
|
460 |
+
|
|
|
461 |
|
462 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
|
464 |
+
jQuery(document).on("click", ".back_to_wp_editor", function(event) {
|
465 |
+
|
466 |
+
if (jQuery(".edit-post-header-toolbar").length) {
|
467 |
+
wp.data.dispatch( "core/block-editor" ).resetBlocks([]);
|
468 |
+
jQuery(".block-editor-block-list__layout").show();
|
469 |
+
}
|
470 |
|
471 |
+
if (jQuery("#postdivrich").length) {
|
472 |
+
//jQuery("#postdivrich").show();
|
473 |
+
//jQuery("#postdivrich .wp-editor-area").html("");
|
474 |
+
}
|
475 |
+
jQuery(".managed_by_seedprod").hide();
|
476 |
+
|
477 |
+
var ajax_url = "' . $localizations['ajax_url'] . '";
|
478 |
+
var post_id = jQuery("#post_ID").val();
|
479 |
+
|
480 |
+
var formData = new FormData();
|
481 |
+
formData.append("action", "' . $remove_post_callback . '");
|
482 |
+
formData.append("post_id", post_id);
|
483 |
+
//console.log(formData);
|
484 |
+
|
485 |
+
jQuery.ajax({
|
486 |
+
type: "POST",
|
487 |
+
url: ajax_url,
|
488 |
+
data: formData,
|
489 |
+
cache: false,
|
490 |
+
processData : false,
|
491 |
+
contentType: false,
|
492 |
+
success: function(data) {
|
493 |
+
|
494 |
+
jQuery(".seed_editor_true").addClass("seed_editor_false");
|
495 |
+
jQuery(".seed_editor_false").addClass("seed_editor_true");
|
496 |
+
//console.log("removed seedprod settings");
|
497 |
+
|
498 |
+
location.reload();
|
499 |
+
|
500 |
+
},
|
501 |
+
});
|
502 |
+
|
503 |
+
});
|
504 |
+
});
|
505 |
+
</script>
|
506 |
+
';
|
507 |
+
}
|
508 |
+
}
|
509 |
|
510 |
|
511 |
+
add_action( 'admin_footer', 'seedprod_lite_add_admin_edit_seedprod' );
|
512 |
+
add_action( 'edit_form_after_title', 'seedprod_lite_before_editor' );
|
513 |
|
514 |
+
function seedprod_lite_before_editor() {
|
515 |
+
$seedprod_app_settings = get_option('seedprod_app_settings');
|
516 |
+
if(!empty($seedprod_app_settings)){
|
517 |
+
$seedprod_app_settings = json_decode(stripslashes ($seedprod_app_settings));
|
518 |
+
}else{
|
519 |
+
// fail safe incase settings go missing
|
520 |
+
require_once(SEEDPROD_PLUGIN_PATH.'resources/data-templates/default-settings.php');
|
521 |
+
update_option('seedprod_app_settings', $seedprod_app_default_settings);
|
522 |
+
$seedprod_app_settings = json_decode($seedprod_app_default_settings);
|
523 |
+
}
|
524 |
+
$disable_seedprod_button = $seedprod_app_settings->disable_seedprod_button;
|
525 |
+
|
526 |
+
if ($disable_seedprod_button==false) {
|
527 |
+
echo '
|
528 |
+
<div class="active-seed-prod-buttons-classic"></div>
|
529 |
+
<script type="text/javascript">
|
530 |
+
jQuery(document).ready(function(){
|
531 |
+
var active_seedprod_btn = jQuery(".active-seed-prod-buttons").html();
|
532 |
+
jQuery(".active-seed-prod-buttons-classic").html(active_seedprod_btn);
|
533 |
+
});
|
534 |
+
</script>
|
535 |
+
';
|
536 |
+
}
|
537 |
+
}
|
538 |
|
|
|
|
|
539 |
|
|
|
|
|
|
|
540 |
|
541 |
+
|
542 |
+
add_action( 'enqueue_block_editor_assets', 'seedprod_lite_link_injection_to_gutenberg_toolbar' );
|
543 |
+
function seedprod_lite_link_injection_to_gutenberg_toolbar() {
|
544 |
+
$seedprod_app_settings = get_option('seedprod_app_settings');
|
545 |
+
if(!empty($seedprod_app_settings)){
|
546 |
+
$seedprod_app_settings = json_decode(stripslashes ($seedprod_app_settings));
|
547 |
+
}else{
|
548 |
+
// fail safe incase settings go missing
|
549 |
+
require_once(SEEDPROD_PLUGIN_PATH.'resources/data-templates/default-settings.php');
|
550 |
+
update_option('seedprod_app_settings', $seedprod_app_default_settings);
|
551 |
+
$seedprod_app_settings = json_decode($seedprod_app_default_settings);
|
552 |
+
}
|
553 |
+
$disable_seedprod_button = $seedprod_app_settings->disable_seedprod_button;
|
554 |
+
|
555 |
+
if ($disable_seedprod_button==false) {
|
556 |
+
$screen = get_current_screen();
|
557 |
+
if ('page' === $screen->post_type) {
|
558 |
+
$localizations = array(
|
559 |
+
'admin_url' => admin_url() . 'admin.php',
|
560 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
561 |
+
'_wp_nonce' => wp_create_nonce('ajax-nonce'),
|
562 |
+
'plugin_url' => SEEDPROD_PLUGIN_URL,
|
563 |
+
);
|
564 |
+
wp_enqueue_script('seedprod-link-in-toolbar', SEEDPROD_PLUGIN_URL . 'public/js/toolbar.js', array(), '1.0', true);
|
565 |
+
wp_localize_script('seedprod-link-in-toolbar', 'localizedVars', $localizations);
|
566 |
}
|
567 |
}
|
568 |
}
|
569 |
|
570 |
+
add_filter( 'display_post_states', 'seedprod_lite_add_post_state', 10, 2 );
|
571 |
+
function seedprod_lite_add_post_state( $post_states, $post ) {
|
572 |
+
$has_settings = get_post_meta( $post->ID, '_seedprod_page', true );
|
573 |
|
574 |
+
if ( $post->post_type == 'page' && ! empty( $has_settings ) ) {
|
575 |
+
$post_states['seedprod'] = 'SeedProd';
|
576 |
+
}
|
577 |
+
return $post_states;
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
}
|
579 |
|
580 |
|
|
|
|
|
581 |
|
|
|
|
|
|
|
582 |
|
583 |
+
function seedprod_lite_add_menu_item( $wp_admin_bar ) {
|
584 |
+
$seedprod_menu_link = 'admin.php?page=seedprod_lite_template&id=0#/template';
|
585 |
+
|
586 |
+
$args = array(
|
587 |
+
'id' => 'seedprod_template',
|
588 |
+
'title' => 'SeedProd Landing Page',
|
589 |
+
'href' => $seedprod_menu_link,
|
590 |
+
'parent' => 'new-content',
|
591 |
+
);
|
592 |
+
|
593 |
+
$wp_admin_bar->add_node( $args );
|
594 |
}
|
595 |
|
596 |
+
add_action( 'admin_bar_menu', 'seedprod_lite_add_menu_item', 80 );
|
597 |
|
598 |
|
599 |
+
add_action( 'wp_ajax_seedprod_lite_remove_post', 'seedprod_lite_remove_post' );
|
600 |
+
|
601 |
+
function seedprod_lite_remove_post() {
|
602 |
+
$post_id = $_POST['post_id'];
|
603 |
+
$data = array(
|
604 |
+
'ID' => $post_id,
|
605 |
+
'post_content' => '',
|
606 |
+
);
|
607 |
+
|
608 |
+
delete_post_meta( $post_id, '_seedprod_page' );
|
609 |
+
wp_update_post( $data );
|
610 |
+
wp_die();
|
611 |
}
|
612 |
+
|
613 |
+
|
614 |
+
function seedprod_lite_adding_facebook_xfbml() {
|
615 |
+
$facebook_app_id = '383341908396413';
|
616 |
+
$page_builder = 'seedprod_lite_builder';
|
617 |
+
|
618 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == $page_builder ) {
|
619 |
+
|
620 |
+
echo '<div id="fb-root"></div>
|
621 |
+
<script async defer crossorigin="anonymous"
|
622 |
+
src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v9.0&appId=' . $facebook_app_id . '&autoLogAppEvents=1"
|
623 |
+
>
|
624 |
+
</script>';
|
625 |
+
|
626 |
+
/*
|
627 |
+
echo '
|
628 |
+
<div id="fb-root"></div>
|
629 |
+
<script>
|
630 |
+
window.fbAsyncInit = function() {
|
631 |
+
FB.init({
|
632 |
+
appId :'.$facebook_app_id.',
|
633 |
+
autoLogAppEvents : true,
|
634 |
+
xfbml : true,
|
635 |
+
version : "v9.0"
|
636 |
+
});
|
637 |
+
};
|
638 |
+
</script>
|
639 |
+
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
|
640 |
+
';*/
|
641 |
+
}
|
642 |
+
}
|
643 |
+
add_action( 'admin_head', 'seedprod_lite_adding_facebook_xfbml' );
|
644 |
+
|
app/cpt.php
CHANGED
@@ -3,17 +3,17 @@
|
|
3 |
// Register Custom Post Type
|
4 |
function seedprod_lite_post_type() {
|
5 |
|
6 |
-
$args = array(
|
7 |
-
'supports'
|
8 |
-
'public'
|
9 |
-
'capability_type'
|
10 |
-
'show_ui'
|
11 |
'publicly_queryable' => true,
|
12 |
);
|
13 |
register_post_type( 'seedprod', $args );
|
14 |
|
15 |
}
|
16 |
-
$sedprod_pt = post_type_exists('seedprod');
|
17 |
-
if($sedprod_pt === false){
|
18 |
add_action( 'init', 'seedprod_lite_post_type', 0 );
|
19 |
}
|
3 |
// Register Custom Post Type
|
4 |
function seedprod_lite_post_type() {
|
5 |
|
6 |
+
$args = array(
|
7 |
+
'supports' => array( 'title', 'editor', 'revisions' ),
|
8 |
+
'public' => false,
|
9 |
+
'capability_type' => 'page',
|
10 |
+
'show_ui' => false,
|
11 |
'publicly_queryable' => true,
|
12 |
);
|
13 |
register_post_type( 'seedprod', $args );
|
14 |
|
15 |
}
|
16 |
+
$sedprod_pt = post_type_exists( 'seedprod' );
|
17 |
+
if ( $sedprod_pt === false ) {
|
18 |
add_action( 'init', 'seedprod_lite_post_type', 0 );
|
19 |
}
|
app/functions-addons.php
CHANGED
@@ -4,81 +4,76 @@
|
|
4 |
*
|
5 |
* @since 1.0.0
|
6 |
*/
|
7 |
-
function seedprod_lite_install_addon()
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
// Send back a response.
|
80 |
-
echo json_encode(true);
|
81 |
-
wp_die();
|
82 |
}
|
83 |
|
84 |
|
@@ -87,33 +82,31 @@ function seedprod_lite_install_addon()
|
|
87 |
*
|
88 |
* @since 1.0.0
|
89 |
*/
|
90 |
-
function seedprod_lite_deactivate_addon()
|
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 |
-
wp_send_json_error(esc_html__('Could not deactivate the addon. Please deactivate from the Plugins page.', 'coming-soon'));
|
117 |
}
|
118 |
|
119 |
|
@@ -122,254 +115,253 @@ function seedprod_lite_deactivate_addon()
|
|
122 |
*
|
123 |
* @since 1.0.0
|
124 |
*/
|
125 |
-
function seedprod_lite_activate_addon()
|
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 |
-
wp_send_json_error(esc_html__('Could not activate addon. Please activate from the Plugins page.', 'coming-soon'));
|
154 |
}
|
155 |
|
156 |
-
function seedprod_lite_get_plugins_list()
|
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 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
|
199 |
-
function seedprod_lite_get_plugins_array()
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
}
|
240 |
|
241 |
-
function seedprod_lite_get_form_plugins_list()
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
return $response;
|
266 |
}
|
267 |
|
268 |
-
function seedprod_lite_get_giveaway_plugins_list()
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
return $response;
|
293 |
}
|
294 |
|
295 |
|
296 |
-
function seedprod_lite_get_seo_plugins_list()
|
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 $response;
|
323 |
}
|
324 |
|
325 |
-
function seedprod_lite_get_analytics_plugins_list()
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
return $response;
|
350 |
}
|
351 |
|
352 |
-
function seedprod_lite_get_plugins_install_url($slug)
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
return $url;
|
367 |
|
368 |
}
|
369 |
|
370 |
-
function seedprod_lite_get_plugins_activate_url($slug)
|
371 |
-
|
372 |
-
|
373 |
-
return $url;
|
374 |
|
375 |
-
}
|
4 |
*
|
5 |
* @since 1.0.0
|
6 |
*/
|
7 |
+
function seedprod_lite_install_addon() {
|
8 |
+
// Run a security check.
|
9 |
+
check_ajax_referer( 'seedprod_lite_install_addon', 'nonce' );
|
10 |
+
|
11 |
+
// Check for permissions.
|
12 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
13 |
+
wp_send_json_error();
|
14 |
+
}
|
15 |
+
|
16 |
+
// Install the addon.
|
17 |
+
if ( isset( $_POST['plugin'] ) ) {
|
18 |
+
$download_url = $_POST['plugin'];
|
19 |
+
|
20 |
+
global $hook_suffix;
|
21 |
+
|
22 |
+
// Set the current screen to avoid undefined notices.
|
23 |
+
set_current_screen();
|
24 |
+
|
25 |
+
// Prepare variables.
|
26 |
+
$method = '';
|
27 |
+
$url = add_query_arg(
|
28 |
+
array(
|
29 |
+
'page' => 'seedprod_lite',
|
30 |
+
),
|
31 |
+
admin_url( 'admin.php' )
|
32 |
+
);
|
33 |
+
$url = esc_url( $url );
|
34 |
+
|
35 |
+
// Start output bufferring to catch the filesystem form if credentials are needed.
|
36 |
+
ob_start();
|
37 |
+
if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) {
|
38 |
+
$form = ob_get_clean();
|
39 |
+
echo json_encode( array( 'form' => $form ) );
|
40 |
+
wp_die();
|
41 |
+
}
|
42 |
+
|
43 |
+
// If we are not authenticated, make it happen now.
|
44 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
45 |
+
ob_start();
|
46 |
+
request_filesystem_credentials( $url, $method, true, false, null );
|
47 |
+
$form = ob_get_clean();
|
48 |
+
echo json_encode( array( 'form' => $form ) );
|
49 |
+
wp_die();
|
50 |
+
}
|
51 |
+
|
52 |
+
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
|
53 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
54 |
+
global $wp_version;
|
55 |
+
if ( version_compare( $wp_version, '5.3.0' ) >= 0 ) {
|
56 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/skin53.php';
|
57 |
+
} else {
|
58 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/skin.php';
|
59 |
+
}
|
60 |
+
|
61 |
+
// Create the plugin upgrader with our custom skin.
|
62 |
+
$installer = new Plugin_Upgrader( $skin = new SeedProd_Skin() );
|
63 |
+
$installer->install( $download_url );
|
64 |
+
|
65 |
+
// Flush the cache and return the newly installed plugin basename.
|
66 |
+
wp_cache_flush();
|
67 |
+
if ( $installer->plugin_info() ) {
|
68 |
+
$plugin_basename = $installer->plugin_info();
|
69 |
+
echo json_encode( array( 'plugin' => $plugin_basename ) );
|
70 |
+
wp_die();
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
// Send back a response.
|
75 |
+
echo json_encode( true );
|
76 |
+
wp_die();
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
|
82 |
*
|
83 |
* @since 1.0.0
|
84 |
*/
|
85 |
+
function seedprod_lite_deactivate_addon() {
|
86 |
+
// Run a security check.
|
87 |
+
check_ajax_referer( 'seedprod_lite_deactivate_addon', 'nonce' );
|
88 |
+
|
89 |
+
// Check for permissions.
|
90 |
+
if ( ! current_user_can( 'activate_plugins' ) ) {
|
91 |
+
wp_send_json_error();
|
92 |
+
}
|
93 |
+
|
94 |
+
$type = 'addon';
|
95 |
+
if ( ! empty( $_POST['type'] ) ) {
|
96 |
+
$type = sanitize_key( $_POST['type'] );
|
97 |
+
}
|
98 |
+
|
99 |
+
if ( isset( $_POST['plugin'] ) ) {
|
100 |
+
deactivate_plugins( $_POST['plugin'] );
|
101 |
+
|
102 |
+
if ( 'plugin' === $type ) {
|
103 |
+
wp_send_json_success( esc_html__( 'Plugin deactivated.', 'coming-soon' ) );
|
104 |
+
} else {
|
105 |
+
wp_send_json_success( esc_html__( 'Addon deactivated.', 'coming-soon' ) );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
wp_send_json_error( esc_html__( 'Could not deactivate the addon. Please deactivate from the Plugins page.', 'coming-soon' ) );
|
|
|
|
|
110 |
}
|
111 |
|
112 |
|
115 |
*
|
116 |
* @since 1.0.0
|
117 |
*/
|
118 |
+
function seedprod_lite_activate_addon() {
|
119 |
+
// Run a security check.
|
120 |
+
check_ajax_referer( 'seedprod_lite_activate_addon', 'nonce' );
|
121 |
+
|
122 |
+
// Check for permissions.
|
123 |
+
if ( ! current_user_can( 'activate_plugins' ) ) {
|
124 |
+
wp_send_json_error();
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( isset( $_POST['plugin'] ) ) {
|
128 |
+
$type = 'addon';
|
129 |
+
if ( ! empty( $_POST['type'] ) ) {
|
130 |
+
$type = sanitize_key( $_POST['type'] );
|
131 |
+
}
|
132 |
+
|
133 |
+
$activate = activate_plugins( $_POST['plugin'] );
|
134 |
+
|
135 |
+
if ( ! is_wp_error( $activate ) ) {
|
136 |
+
if ( 'plugin' === $type ) {
|
137 |
+
wp_send_json_success( esc_html__( 'Plugin activated.', 'coming-soon' ) );
|
138 |
+
} else {
|
139 |
+
wp_send_json_success( esc_html__( 'Addon activated.', 'coming-soon' ) );
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
wp_send_json_error( esc_html__( 'Could not activate addon. Please activate from the Plugins page.', 'coming-soon' ) );
|
|
|
|
|
145 |
}
|
146 |
|
147 |
+
function seedprod_lite_get_plugins_list() {
|
148 |
+
check_ajax_referer( 'seedprod_lite_get_plugins_list', 'nonce' );
|
149 |
+
|
150 |
+
$am_plugins = array(
|
151 |
+
'google-analytics-for-wordpress/googleanalytics.php' => 'monsterinsights',
|
152 |
+
'google-analytics-premium/googleanalytics-premium.php' => 'monsterinsights-pro',
|
153 |
+
'optinmonster/optin-monster-wp-api.php' => 'optinmonster',
|
154 |
+
'wp-mail-smtp/wp_mail_smtp.php' => 'wpmailsmtp',
|
155 |
+
'wp-mail-smtp-pro/wp_mail_smtp.php' => 'wpmailsmtp-pro',
|
156 |
+
'wpforms-lite/wpforms.php' => 'wpforms',
|
157 |
+
'wpforms/wpforms.php' => 'wpforms-pro',
|
158 |
+
'rafflepress/rafflepress.php' => 'rafflepress',
|
159 |
+
'rafflepress-pro/rafflepress-pro.php' => 'rafflepress-pro',
|
160 |
+
'trustpulse-api/trustpulse.php' => 'trustpulse',
|
161 |
+
'google-analytics-dashboard-for-wp/gadwp.php' => 'exactmetrics',
|
162 |
+
'exactmetrics-premium/exactmetrics-premium.php' => 'exactmetrics-pro',
|
163 |
+
'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'all-in-one',
|
164 |
+
'all-in-one-seo-pack-pro/all_in_one_seo_pack.php' => 'all-in-one-pro',
|
165 |
+
'seo-by-rank-math/rank-math.php' => 'rank-math',
|
166 |
+
'wordpress-seo/wp-seo.php' => 'yoast',
|
167 |
+
'autodescription/autodescription.php' => 'seo-framework',
|
168 |
+
);
|
169 |
+
$all_plugins = get_plugins();
|
170 |
+
|
171 |
+
$response = array();
|
172 |
+
|
173 |
+
foreach ( $am_plugins as $slug => $label ) {
|
174 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
175 |
+
if ( is_plugin_active( $slug ) ) {
|
176 |
+
$response[ $label ] = array(
|
177 |
+
'label' => __( 'Active', 'coming-soon' ),
|
178 |
+
'status' => 1,
|
179 |
+
);
|
180 |
+
} else {
|
181 |
+
$response[ $label ] = array(
|
182 |
+
'label' => __( 'Inactive', 'coming-soon' ),
|
183 |
+
'status' => 2,
|
184 |
+
);
|
185 |
+
}
|
186 |
+
} else {
|
187 |
+
$response[ $label ] = array(
|
188 |
+
'label' => __( 'Not Installed', 'coming-soon' ),
|
189 |
+
'status' => 0,
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
wp_send_json( $response );
|
195 |
}
|
196 |
|
197 |
+
function seedprod_lite_get_plugins_array() {
|
198 |
+
$am_plugins = array(
|
199 |
+
'google-analytics-for-wordpress/googleanalytics.php' => 'monsterinsights',
|
200 |
+
'google-analytics-premium/googleanalytics-premium.php' => 'monsterinsights-pro',
|
201 |
+
'optinmonster/optin-monster-wp-api.php' => 'optinmonster',
|
202 |
+
'wp-mail-smtp/wp_mail_smtp.php' => 'wpmailsmtp',
|
203 |
+
'wp-mail-smtp-pro/wp_mail_smtp.php' => 'wpmailsmtp-pro',
|
204 |
+
'wpforms-lite/wpforms.php' => 'wpforms',
|
205 |
+
'wpforms/wpforms.php' => 'wpforms-pro',
|
206 |
+
'rafflepress/rafflepress.php' => 'rafflepress',
|
207 |
+
'rafflepress-pro/rafflepress-pro.php' => 'rafflepress-pro',
|
208 |
+
'trustpulse-api/trustpulse.php' => 'trustpulse',
|
209 |
+
'google-analytics-dashboard-for-wp/gadwp.php' => 'exactmetrics',
|
210 |
+
'exactmetrics-premium/exactmetrics-premium.php' => 'exactmetrics-pro',
|
211 |
+
'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'all-in-one',
|
212 |
+
'all-in-one-seo-pack-pro/all_in_one_seo_pack.php' => 'all-in-one-pro',
|
213 |
+
'seo-by-rank-math/rank-math.php' => 'rank-math',
|
214 |
+
'wordpress-seo/wp-seo.php' => 'yoast',
|
215 |
+
'autodescription/autodescription.php' => 'seo-framework',
|
216 |
+
);
|
217 |
+
$all_plugins = get_plugins();
|
218 |
+
|
219 |
+
$response = array();
|
220 |
+
|
221 |
+
foreach ( $am_plugins as $slug => $label ) {
|
222 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
223 |
+
if ( is_plugin_active( $slug ) ) {
|
224 |
+
$response[ $label ] = array(
|
225 |
+
'label' => __( 'Active', 'coming-soon' ),
|
226 |
+
'status' => 1,
|
227 |
+
);
|
228 |
+
} else {
|
229 |
+
$response[ $label ] = array(
|
230 |
+
'label' => __( 'Inactive', 'coming-soon' ),
|
231 |
+
'status' => 2,
|
232 |
+
);
|
233 |
+
}
|
234 |
+
} else {
|
235 |
+
$response[ $label ] = array(
|
236 |
+
'label' => __( 'Not Installed', 'coming-soon' ),
|
237 |
+
'status' => 0,
|
238 |
+
);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
return $response;
|
243 |
}
|
244 |
|
245 |
+
function seedprod_lite_get_form_plugins_list() {
|
246 |
+
$am_plugins = array(
|
247 |
+
'wpforms/wpforms.php' => 'wpforms',
|
248 |
+
'wpforms-lite/wpforms.php' => 'wpforms-lite',
|
249 |
+
);
|
250 |
+
$all_plugins = get_plugins();
|
251 |
+
|
252 |
+
$response = array();
|
253 |
+
|
254 |
+
foreach ( $am_plugins as $slug => $label ) {
|
255 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
256 |
+
if ( is_plugin_active( $slug ) ) {
|
257 |
+
$response[ $label ] = 1; // Active
|
258 |
+
} else {
|
259 |
+
$response[ $label ] = 2; // InActive
|
260 |
+
}
|
261 |
+
} else {
|
262 |
+
$response[ $label ] = 0; // Not installed
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
return $response;
|
|
|
|
|
|
|
267 |
}
|
268 |
|
269 |
+
function seedprod_lite_get_giveaway_plugins_list() {
|
270 |
+
$am_plugins = array(
|
271 |
+
'rafflepress-pro/rafflepress-pro.php' => 'rafflepress-pro',
|
272 |
+
'rafflepress/rafflepress.php' => 'rafflepress',
|
273 |
+
);
|
274 |
+
$all_plugins = get_plugins();
|
275 |
+
|
276 |
+
$response = array();
|
277 |
+
|
278 |
+
foreach ( $am_plugins as $slug => $label ) {
|
279 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
280 |
+
if ( is_plugin_active( $slug ) ) {
|
281 |
+
$response[ $label ] = 1; // Active
|
282 |
+
} else {
|
283 |
+
$response[ $label ] = 2; // InActive
|
284 |
+
}
|
285 |
+
} else {
|
286 |
+
$response[ $label ] = 0; // Not installed
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
return $response;
|
|
|
|
|
|
|
291 |
}
|
292 |
|
293 |
|
294 |
+
function seedprod_lite_get_seo_plugins_list() {
|
295 |
+
$am_plugins = array(
|
296 |
+
'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'all-in-one',
|
297 |
+
'all-in-one-seo-pack-pro/all_in_one_seo_pack.php' => 'all-in-one-pro',
|
298 |
+
'seo-by-rank-math/rank-math.php' => 'rank-math',
|
299 |
+
'wordpress-seo/wp-seo.php' => 'yoast',
|
300 |
+
'wordpress-seo-premium/wp-seo-premium.php' => 'yoast-pro',
|
301 |
+
'autodescription/autodescription.php' => 'seo-framework',
|
302 |
+
);
|
303 |
+
$all_plugins = get_plugins();
|
304 |
+
|
305 |
+
$response = array();
|
306 |
+
|
307 |
+
foreach ( $am_plugins as $slug => $label ) {
|
308 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
309 |
+
if ( is_plugin_active( $slug ) ) {
|
310 |
+
$response[ $label ] = 1; // Active
|
311 |
+
} else {
|
312 |
+
$response[ $label ] = 2; // InActive
|
313 |
+
}
|
314 |
+
} else {
|
315 |
+
$response[ $label ] = 0; // Not installed
|
316 |
+
}
|
317 |
+
}
|
318 |
+
|
319 |
+
return $response;
|
|
|
320 |
}
|
321 |
|
322 |
+
function seedprod_lite_get_analytics_plugins_list() {
|
323 |
+
$am_plugins = array(
|
324 |
+
'google-analytics-for-wordpress/googleanalytics.php' => 'monster-insights',
|
325 |
+
'google-analytics-dashboard-for-wp/gadwp.php' => 'exactmetrics',
|
326 |
+
);
|
327 |
+
$all_plugins = get_plugins();
|
328 |
+
|
329 |
+
$response = array();
|
330 |
+
|
331 |
+
foreach ( $am_plugins as $slug => $label ) {
|
332 |
+
if ( array_key_exists( $slug, $all_plugins ) ) {
|
333 |
+
if ( is_plugin_active( $slug ) ) {
|
334 |
+
$response[ $label ] = 1; // Active
|
335 |
+
} else {
|
336 |
+
$response[ $label ] = 2; // InActive
|
337 |
+
}
|
338 |
+
} else {
|
339 |
+
$response[ $label ] = 0; // Not installed
|
340 |
+
}
|
341 |
+
}
|
342 |
+
|
343 |
+
return $response;
|
|
|
|
|
|
|
344 |
}
|
345 |
|
346 |
+
function seedprod_lite_get_plugins_install_url( $slug ) {
|
347 |
+
$action = 'install-plugin';
|
348 |
+
$url = wp_nonce_url(
|
349 |
+
add_query_arg(
|
350 |
+
array(
|
351 |
+
'action' => $action,
|
352 |
+
'plugin' => $slug,
|
353 |
+
),
|
354 |
+
admin_url( 'update.php' )
|
355 |
+
),
|
356 |
+
$action . '_' . $slug
|
357 |
+
);
|
358 |
+
|
359 |
+
return $url;
|
|
|
360 |
|
361 |
}
|
362 |
|
363 |
+
function seedprod_lite_get_plugins_activate_url( $slug ) {
|
364 |
+
$url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $slug ), 'activate-plugin_' . $slug );
|
365 |
+
return $url;
|
|
|
366 |
|
367 |
+
}
|
app/functions-utils.php
CHANGED
@@ -3,32 +3,31 @@
|
|
3 |
/**
|
4 |
* Get IP
|
5 |
*/
|
6 |
-
function seedprod_lite_get_ip()
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
return strip_tags($ip);
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* Update cookie length for bypass url
|
24 |
*/
|
25 |
function seedprod_lite_change_wp_cookie_logout( $expirein ) {
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
}
|
33 |
|
34 |
|
@@ -36,44 +35,44 @@ function seedprod_lite_change_wp_cookie_logout( $expirein ) {
|
|
36 |
* Get roles
|
37 |
*/
|
38 |
function seedprod_lite_get_roles() {
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
}
|
52 |
|
53 |
|
54 |
/**
|
55 |
* Get Enviroment
|
56 |
*/
|
57 |
-
function seedprod_lite_is_localhost()
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
return $is_localhost;
|
71 |
}
|
72 |
|
73 |
// YouTube video ID
|
74 |
-
function seedprod_lite_youtube_id_from_url($url) {
|
75 |
-
|
76 |
-
|
77 |
(?:https?://)? # Optional scheme. Either http or https
|
78 |
(?:www\.)? # Optional www subdomain
|
79 |
(?: # Group host alternatives
|
@@ -86,115 +85,450 @@ function seedprod_lite_youtube_id_from_url($url) {
|
|
86 |
) # End path alternatives.
|
87 |
) # End host alternatives.
|
88 |
([\w-]{10,12}) # Allow 10-12 for 11 char youtube id.
|
89 |
-
$%x'
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
* Entry Options
|
101 |
*/
|
102 |
-
function seedprod_lite_block_options()
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
<path d="M9 0.800049V7.04005H3V0.800049H0V16.4H3V10.16H9V16.4H12V0.800049H9Z"/>
|
118 |
</svg>
|
119 |
-
'
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
<path d="M161.294,281.219 C151.445,281.219 143.462,289.202 143.462,299.049 C143.462,308.896 151.445,316.878 161.294,316.878 C171.139,316.878 179.122,308.896 179.122,299.049 C179.122,289.202 171.139,281.219 161.294,281.219 Z M232.979,281.219 C223.132,281.219 215.149,289.202 215.149,299.049 C215.149,308.896 223.132,316.878 232.979,316.878 C242.826,316.878 250.806,308.896 250.806,299.049 C250.806,289.202 242.826,281.219 232.979,281.219 Z M32.608,123.757 C30.714,158.655 31.726,255.445 32.608,292.617 C32.68,295.618 34.565,297.889 37.042,299.527 C58.017,313.458 79.698,326.395 101.835,338.541 C98.77,308.445 98.261,273.714 107.731,252.542 C111.467,244.191 119.577,237.434 130.383,232.272 C111.019,204.919 98.751,172.762 95.699,143.461 C91.243,100.685 159.191,80.829 161.091,113.506 C163.202,149.839 167.026,185.74 173.214,221.056 C180.966,220.166 188.963,219.72 196.962,219.708 C205.077,219.704 213.195,220.154 221.06,221.056 C227.245,185.74 231.071,149.839 233.18,113.506 C235.079,80.829 303.03,100.685 298.574,143.461 C295.523,172.762 283.254,204.919 263.891,232.272 C274.694,237.434 282.806,244.191 286.542,252.542 C295.99,273.665 295.504,308.286 292.458,338.332 C314.469,326.252 336.023,313.381 356.885,299.527 C359.356,297.889 361.245,295.618 361.316,292.617 C362.199,255.445 363.21,158.655 361.316,123.757 C361.008,120.766 359.356,118.487 356.885,116.846 C307.739,84.205 254.723,57.023 201.025,32.736 C199.667,32.123 198.314,31.818 196.962,31.818 C195.61,31.818 194.257,32.123 192.902,32.736 C139.201,57.023 86.185,84.205 37.042,116.846 C34.565,118.487 32.913,120.766 32.608,123.757 Z M1.328,120.554 C2.595,108.178 9.333,97.499 19.644,90.651 C70.294,57.012 124.602,29.116 179.943,4.087 C190.893,-0.864 203.032,-0.864 213.981,4.087 C269.323,29.116 323.628,57.012 374.28,90.651 C384.913,97.713 392.019,109.24 392.712,122.052 C394.273,150.787 393.913,180.541 393.792,209.337 C393.674,237.33 393.416,265.374 392.75,293.359 C392.432,306.785 385.326,318.385 374.28,325.719 C323.628,359.361 269.323,387.262 213.981,412.29 C203.032,417.237 190.893,417.237 179.943,412.29 C124.602,387.262 70.294,359.361 19.644,325.719 C8.596,318.385 1.493,306.785 1.174,293.359 C0.509,265.374 0.248,237.33 0.132,209.337 C0.047,189.407 -0.464,137.991 1.328,120.554 L1.328,120.554 Z" id="Fill-5"></path>
|
133 |
-
</svg>'
|
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 |
* Get times
|
184 |
*/
|
185 |
-
function seedprod_lite_get_default_timezone()
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
return $timezone;
|
198 |
}
|
199 |
|
200 |
|
@@ -202,182 +536,323 @@ function seedprod_lite_get_default_timezone()
|
|
202 |
/**
|
203 |
* Get times
|
204 |
*/
|
205 |
-
function seedprod_lite_get_times()
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
}
|
260 |
|
261 |
/**
|
262 |
* Check per
|
263 |
*/
|
264 |
-
function seedprod_lite_get_api_key()
|
265 |
-
|
266 |
-
$seedprod_api_key = '';
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
|
276 |
-
|
277 |
}
|
278 |
|
279 |
/**
|
280 |
* Get timezones
|
281 |
*/
|
282 |
-
function seedprod_lite_get_timezones()
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
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 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
$structure['UTC'][] = array('v'=> "UTC", 'l'=>"UTC");
|
367 |
-
|
368 |
-
return $structure;
|
369 |
}
|
370 |
|
371 |
|
372 |
/**
|
373 |
* Add to array if value does not exist
|
374 |
*/
|
375 |
-
function seedprod_lite_array_add($arr, $key, $value)
|
376 |
-
{
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
return $arr;
|
381 |
}
|
382 |
|
383 |
|
@@ -386,486 +861,490 @@ function seedprod_lite_array_add($arr, $key, $value)
|
|
386 |
/**
|
387 |
* Check per
|
388 |
*/
|
389 |
-
function seedprod_lite_cu($rper = null)
|
390 |
-
{
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
}
|
406 |
}
|
407 |
|
408 |
|
409 |
-
function seedprod_lite_upgrade_link($medium = 'link')
|
410 |
-
|
411 |
-
return apply_filters('seedprod_lite_upgrade_link', 'https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=' . sanitize_key(apply_filters('seedprod_lite_upgrade_link_medium', $medium)));
|
412 |
}
|
413 |
|
414 |
|
415 |
-
function seedprod_lite_disable_admin_notices()
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
}
|
428 |
}
|
429 |
-
if (!empty($_GET['page']) && strpos($_GET['page'], 'seedprod') !==
|
430 |
-
|
431 |
}
|
432 |
|
433 |
|
434 |
-
function seedprod_lite_plugin_nonce()
|
435 |
-
|
436 |
-
check_ajax_referer('seedprod_lite_plugin_nonce', 'nonce');
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
}
|
446 |
|
447 |
-
function seedprod_lite_is_dev_url($url = '')
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
return $is_local_url;
|
487 |
}
|
488 |
|
489 |
|
490 |
-
function seedprod_lite_find_fonts_in_doc($someArray) {
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
}
|
523 |
|
524 |
-
function seedprod_lite_construct_font_str($doc_settings) {
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
}
|
568 |
|
569 |
|
570 |
-
add_filter('_wp_post_revision_fields','seedprod_lite_wp_post_revision_fields',11,2);
|
571 |
-
function seedprod_lite_wp_post_revision_fields($fields, $post){
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
}
|
579 |
|
580 |
|
581 |
add_filter( 'page_row_actions', 'seedprod_lite_filter_page_row_actions', 11, 2 );
|
582 |
function seedprod_lite_filter_page_row_actions( $actions, $post ) {
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
}
|
596 |
|
597 |
//add_filter( 'get_edit_post_link', 'seedprod_lite_filter_get_edit_post_link', 11, 3 );
|
598 |
function seedprod_lite_filter_get_edit_post_link( $link, $id, $context ) {
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
}
|
605 |
|
606 |
/**
|
607 |
* Dismiss Settings Lite CTA
|
608 |
*/
|
609 |
-
function seedprod_lite_dismiss_settings_lite_cta()
|
610 |
-
{
|
611 |
-
|
612 |
-
$_POST = stripslashes_deep($_POST);
|
613 |
-
|
614 |
-
if (!empty($_POST['dismiss'])) {
|
615 |
-
update_option('seedprod_dismiss_settings_lite_cta', true);
|
616 |
|
617 |
-
|
618 |
-
|
619 |
|
620 |
-
|
621 |
-
|
622 |
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
|
|
|
|
|
|
627 |
}
|
628 |
|
629 |
/**
|
630 |
* Dismiss Lite Banners
|
631 |
*/
|
632 |
-
function seedprod_lite_dismiss_upsell()
|
633 |
-
{
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
}
|
650 |
}
|
651 |
|
652 |
-
function seedprod_lite_get_expire_times(){
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
}
|
710 |
|
711 |
|
712 |
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
}
|
863 |
|
864 |
/**
|
865 |
* If site uses WP Rocket, disable minify for CSS & JS
|
866 |
*/
|
867 |
function seedprod_lite_wprocket_disable_minify() {
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
}
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
* Get IP
|
5 |
*/
|
6 |
+
function seedprod_lite_get_ip() {
|
7 |
+
$ip = '';
|
8 |
+
if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) and strlen( $_SERVER['HTTP_X_FORWARDED_FOR'] ) > 6 ) {
|
9 |
+
$ip = strip_tags( $_SERVER['HTTP_X_FORWARDED_FOR'] );
|
10 |
+
} elseif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) and strlen( $_SERVER['HTTP_CLIENT_IP'] ) > 6 ) {
|
11 |
+
$ip = strip_tags( $_SERVER['HTTP_CLIENT_IP'] );
|
12 |
+
} elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) and strlen( $_SERVER['REMOTE_ADDR'] ) > 6 ) {
|
13 |
+
$ip = strip_tags( $_SERVER['REMOTE_ADDR'] );
|
14 |
+
}//endif
|
15 |
+
if ( ! $ip ) {
|
16 |
+
$ip = '127.0.0.1';
|
17 |
+
}
|
18 |
+
return strip_tags( $ip );
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
22 |
* Update cookie length for bypass url
|
23 |
*/
|
24 |
function seedprod_lite_change_wp_cookie_logout( $expirein ) {
|
25 |
+
global $seed_cspv5_bypass_expires;
|
26 |
+
if ( ! empty( $seed_cspv5_bypass_expires ) ) {
|
27 |
+
return $seed_cspv5_bypass_expires; // Modify the exire cookie
|
28 |
+
} else {
|
29 |
+
return $expirein;
|
30 |
+
}
|
31 |
}
|
32 |
|
33 |
|
35 |
* Get roles
|
36 |
*/
|
37 |
function seedprod_lite_get_roles() {
|
38 |
+
global $wp_roles;
|
39 |
+
|
40 |
+
if ( ! isset( $wp_roles ) ) {
|
41 |
+
$wp_roles = new WP_Roles();
|
42 |
+
}
|
43 |
+
$roles = $wp_roles->get_names();
|
44 |
+
|
45 |
+
if ( is_multisite() ) {
|
46 |
+
$roles['superadmin'] = __( 'SuperAdmin', 'coming-soon' );
|
47 |
+
}
|
48 |
+
$roles['anyoneloggedin'] = __( 'Anyone Logged In', 'coming-soon' );
|
49 |
+
|
50 |
+
return $roles;
|
51 |
}
|
52 |
|
53 |
|
54 |
/**
|
55 |
* Get Enviroment
|
56 |
*/
|
57 |
+
function seedprod_lite_is_localhost() {
|
58 |
+
// $localhost = array('127.0.0.1','::1');
|
59 |
+
|
60 |
+
// $is_localhost = false;
|
61 |
+
// if (in_array($_SERVER['REMOTE_ADDR'], $localhost) || !empty($_GET['debug'])) {
|
62 |
+
// $is_localhost = true;
|
63 |
+
// }
|
64 |
+
$is_localhost = false;
|
65 |
+
if ( defined( 'SEEDPROD_LOCAL_JS' ) ) {
|
66 |
+
$is_localhost = true;
|
67 |
+
}
|
68 |
+
|
69 |
+
return $is_localhost;
|
|
|
70 |
}
|
71 |
|
72 |
// YouTube video ID
|
73 |
+
function seedprod_lite_youtube_id_from_url( $url ) {
|
74 |
+
$pattern =
|
75 |
+
'%^# Match any youtube URL
|
76 |
(?:https?://)? # Optional scheme. Either http or https
|
77 |
(?:www\.)? # Optional www subdomain
|
78 |
(?: # Group host alternatives
|
85 |
) # End path alternatives.
|
86 |
) # End host alternatives.
|
87 |
([\w-]{10,12}) # Allow 10-12 for 11 char youtube id.
|
88 |
+
$%x';
|
89 |
+
$result = preg_match( $pattern, $url, $matches );
|
90 |
+
if ( false !== $result ) {
|
91 |
+
if ( isset( $matches[1] ) ) {
|
92 |
+
return $matches[1];
|
93 |
+
}
|
94 |
+
}
|
95 |
+
return false;
|
96 |
}
|
97 |
|
98 |
/**
|
99 |
* Entry Options
|
100 |
*/
|
101 |
+
function seedprod_lite_block_options() {
|
102 |
+
$block_options = array(
|
103 |
+
array(
|
104 |
+
'name' => __( 'Column', 'coming-soon' ),
|
105 |
+
'is_pro' => false,
|
106 |
+
'cat' => 'layout',
|
107 |
+
'type' => 'column',
|
108 |
+
'id' => 1,
|
109 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 5v13h17V5H4zm10 2v9h-3V7h3zM6 7h3v9H6V7zm13 9h-3V7h3v9z"/></svg>',
|
110 |
+
),
|
111 |
+
// array('name'=>__('2 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'2-col', 'id'=>2),
|
112 |
+
// array('name'=>__('3 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'3-col', 'id'=>3),
|
113 |
+
// array('name'=>__('4 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'4-col', 'id'=>4),
|
114 |
+
// array('name'=>__('5 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'5-col', 'id'=>5),
|
115 |
+
// array('name'=>__('6 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'6-col', 'id'=>6),
|
116 |
+
// array('name'=>__('Left Sidebar','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'left-sidebar', 'id'=>7),
|
117 |
+
// array('name'=>__('Right Sidebar','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'right-sidebar', 'id'=>8),
|
118 |
+
|
119 |
+
// array('name'=>__('6 Column','coming-soon'),'is_pro'=> false ,'cat'=>'layout','type'=>'6-col', 'id'=>6),
|
120 |
+
|
121 |
+
array(
|
122 |
+
'name' => __( 'Headline', 'coming-soon' ),
|
123 |
+
'is_pro' => false,
|
124 |
+
'cat' => 'common',
|
125 |
+
'type' => 'header',
|
126 |
+
'id' => 9,
|
127 |
+
'icon' => '<svg viewBox="0 0 12 17" class="sp-w-14px sp-fill-current sp-pb-2" xmlns="http://www.w3.org/2000/svg">
|
128 |
<path d="M9 0.800049V7.04005H3V0.800049H0V16.4H3V10.16H9V16.4H12V0.800049H9Z"/>
|
129 |
</svg>
|
130 |
+
',
|
131 |
+
),
|
132 |
+
//array('name'=>__('Sub Headline','coming-soon'),'is_pro'=> false,'cat'=>'common','type'=>'sub-header', 'id'=>10, 'icon' => 'fas fa-heading'),
|
133 |
+
array(
|
134 |
+
'name' => __( 'Text', 'coming-soon' ),
|
135 |
+
'is_pro' => false,
|
136 |
+
'cat' => 'common',
|
137 |
+
'type' => 'text',
|
138 |
+
'id' => 11,
|
139 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="sp-w-6 sp-fill-current "><rect x="0" fill="none"/><g><path d="M15 2H7.54c-.83 0-1.59.2-2.28.6-.7.41-1.25.96-1.65 1.65C3.2 4.94 3 5.7 3 6.52s.2 1.58.61 2.27c.4.69.95 1.24 1.65 1.64.69.41 1.45.61 2.28.61h.43V17c0 .27.1.51.29.71.2.19.44.29.71.29.28 0 .51-.1.71-.29.2-.2.3-.44.3-.71V5c0-.27.09-.51.29-.71.2-.19.44-.29.71-.29s.51.1.71.29c.19.2.29.44.29.71v12c0 .27.1.51.3.71.2.19.43.29.71.29.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71V4H15c.27 0 .5-.1.7-.3.2-.19.3-.43.3-.7s-.1-.51-.3-.71C15.5 2.1 15.27 2 15 2z"/></g></svg>',
|
140 |
+
),
|
141 |
+
array(
|
142 |
+
'name' => __( 'List', 'coming-soon' ),
|
143 |
+
'is_pro' => false,
|
144 |
+
'cat' => 'common',
|
145 |
+
'type' => 'bullet-list',
|
146 |
+
'id' => 12,
|
147 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current"><g fill="none"><path d="M0 0h24v24H0V0z"/><path d="M0 0h24v24H0V0z" opacity=".87"/></g><path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"/></svg>',
|
148 |
+
),
|
149 |
+
array(
|
150 |
+
'name' => __( 'Button', 'coming-soon' ),
|
151 |
+
'is_pro' => false,
|
152 |
+
'cat' => 'common',
|
153 |
+
'type' => 'button',
|
154 |
+
'id' => 13,
|
155 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" class="sp-w-6 sp-fill-current " viewBox="0 0 24 24" ><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M18.19,12.44l-3.24-1.62c1.29-1,2.12-2.56,2.12-4.32c0-3.03-2.47-5.5-5.5-5.5s-5.5,2.47-5.5,5.5c0,2.13,1.22,3.98,3,4.89 v3.26c-2.15-0.46-2.02-0.44-2.26-0.44c-0.53,0-1.03,0.21-1.41,0.59L4,16.22l5.09,5.09C9.52,21.75,10.12,22,10.74,22h6.3 c0.98,0,1.81-0.7,1.97-1.67l0.8-4.71C20.03,14.32,19.38,13.04,18.19,12.44z M17.84,15.29L17.04,20h-6.3 c-0.09,0-0.17-0.04-0.24-0.1l-3.68-3.68l4.25,0.89V6.5c0-0.28,0.22-0.5,0.5-0.5c0.28,0,0.5,0.22,0.5,0.5v6h1.76l3.46,1.73 C17.69,14.43,17.91,14.86,17.84,15.29z M8.07,6.5c0-1.93,1.57-3.5,3.5-3.5s3.5,1.57,3.5,3.5c0,0.95-0.38,1.81-1,2.44V6.5 c0-1.38-1.12-2.5-2.5-2.5c-1.38,0-2.5,1.12-2.5,2.5v2.44C8.45,8.31,8.07,7.45,8.07,6.5z"/></g></g></svg>',
|
156 |
+
),
|
157 |
+
array(
|
158 |
+
'name' => __( 'Image', 'coming-soon' ),
|
159 |
+
'is_pro' => false,
|
160 |
+
'cat' => 'common',
|
161 |
+
'type' => 'image',
|
162 |
+
'id' => 14,
|
163 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>',
|
164 |
+
),
|
165 |
+
array(
|
166 |
+
'name' => __( 'Video', 'coming-soon' ),
|
167 |
+
'is_pro' => false,
|
168 |
+
'cat' => 'common',
|
169 |
+
'type' => 'video',
|
170 |
+
'id' => 15,
|
171 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" ><path d="M0 0h24v24H0V0z" fill="none"/><path d="M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"/></svg>',
|
172 |
+
),
|
173 |
+
array(
|
174 |
+
'name' => __( 'Divider', 'coming-soon' ),
|
175 |
+
'is_pro' => false,
|
176 |
+
'cat' => 'common',
|
177 |
+
'type' => 'divider',
|
178 |
+
'id' => 17,
|
179 |
+
'icon' => '
|
180 |
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><g><rect fill="none" height="24" width="24"/></g><g><g><g><path d="M20,9H4v2h16V9z M4,15h16v-2H4V15z"/></g></g></g></svg>',
|
181 |
+
),
|
182 |
+
array(
|
183 |
+
'name' => __( 'Spacer', 'coming-soon' ),
|
184 |
+
'is_pro' => false,
|
185 |
+
'cat' => 'common',
|
186 |
+
'type' => 'spacer',
|
187 |
+
'id' => 24,
|
188 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current sp-transform sp-rotate-90" ><path d="M0 0h24v24H0z" fill="none"/><path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z"/></svg>',
|
189 |
+
),
|
190 |
+
|
191 |
+
array(
|
192 |
+
'name' => __( 'Giveaway', 'coming-soon' ),
|
193 |
+
'is_pro' => false,
|
194 |
+
'cat' => 'adv',
|
195 |
+
'type' => 'giveaway',
|
196 |
+
'id' => 32,
|
197 |
+
'icon' => '<svg class="sp-w-5 sp-fill-current " viewBox="0 0 394 416" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
198 |
<path d="M161.294,281.219 C151.445,281.219 143.462,289.202 143.462,299.049 C143.462,308.896 151.445,316.878 161.294,316.878 C171.139,316.878 179.122,308.896 179.122,299.049 C179.122,289.202 171.139,281.219 161.294,281.219 Z M232.979,281.219 C223.132,281.219 215.149,289.202 215.149,299.049 C215.149,308.896 223.132,316.878 232.979,316.878 C242.826,316.878 250.806,308.896 250.806,299.049 C250.806,289.202 242.826,281.219 232.979,281.219 Z M32.608,123.757 C30.714,158.655 31.726,255.445 32.608,292.617 C32.68,295.618 34.565,297.889 37.042,299.527 C58.017,313.458 79.698,326.395 101.835,338.541 C98.77,308.445 98.261,273.714 107.731,252.542 C111.467,244.191 119.577,237.434 130.383,232.272 C111.019,204.919 98.751,172.762 95.699,143.461 C91.243,100.685 159.191,80.829 161.091,113.506 C163.202,149.839 167.026,185.74 173.214,221.056 C180.966,220.166 188.963,219.72 196.962,219.708 C205.077,219.704 213.195,220.154 221.06,221.056 C227.245,185.74 231.071,149.839 233.18,113.506 C235.079,80.829 303.03,100.685 298.574,143.461 C295.523,172.762 283.254,204.919 263.891,232.272 C274.694,237.434 282.806,244.191 286.542,252.542 C295.99,273.665 295.504,308.286 292.458,338.332 C314.469,326.252 336.023,313.381 356.885,299.527 C359.356,297.889 361.245,295.618 361.316,292.617 C362.199,255.445 363.21,158.655 361.316,123.757 C361.008,120.766 359.356,118.487 356.885,116.846 C307.739,84.205 254.723,57.023 201.025,32.736 C199.667,32.123 198.314,31.818 196.962,31.818 C195.61,31.818 194.257,32.123 192.902,32.736 C139.201,57.023 86.185,84.205 37.042,116.846 C34.565,118.487 32.913,120.766 32.608,123.757 Z M1.328,120.554 C2.595,108.178 9.333,97.499 19.644,90.651 C70.294,57.012 124.602,29.116 179.943,4.087 C190.893,-0.864 203.032,-0.864 213.981,4.087 C269.323,29.116 323.628,57.012 374.28,90.651 C384.913,97.713 392.019,109.24 392.712,122.052 C394.273,150.787 393.913,180.541 393.792,209.337 C393.674,237.33 393.416,265.374 392.75,293.359 C392.432,306.785 385.326,318.385 374.28,325.719 C323.628,359.361 269.323,387.262 213.981,412.29 C203.032,417.237 190.893,417.237 179.943,412.29 C124.602,387.262 70.294,359.361 19.644,325.719 C8.596,318.385 1.493,306.785 1.174,293.359 C0.509,265.374 0.248,237.33 0.132,209.337 C0.047,189.407 -0.464,137.991 1.328,120.554 L1.328,120.554 Z" id="Fill-5"></path>
|
199 |
+
</svg>',
|
200 |
+
),
|
201 |
+
|
202 |
+
array(
|
203 |
+
'name' => __( 'Contact Form', 'coming-soon' ),
|
204 |
+
'is_pro' => false,
|
205 |
+
'cat' => 'adv',
|
206 |
+
'type' => 'contact-form',
|
207 |
+
'id' => 23,
|
208 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="sp-w-5 sp-fill-current "><path fill="currentColor" d="M448 75.2v361.7c0 24.3-19 43.2-43.2 43.2H43.2C19.3 480 0 461.4 0 436.8V75.2C0 51.1 18.8 32 43.2 32h361.7c24 0 43.1 18.8 43.1 43.2zm-37.3 361.6V75.2c0-3-2.6-5.8-5.8-5.8h-9.3L285.3 144 224 94.1 162.8 144 52.5 69.3h-9.3c-3.2 0-5.8 2.8-5.8 5.8v361.7c0 3 2.6 5.8 5.8 5.8h361.7c3.2.1 5.8-2.7 5.8-5.8zM150.2 186v37H76.7v-37h73.5zm0 74.4v37.3H76.7v-37.3h73.5zm11.1-147.3l54-43.7H96.8l64.5 43.7zm210 72.9v37h-196v-37h196zm0 74.4v37.3h-196v-37.3h196zm-84.6-147.3l64.5-43.7H232.8l53.9 43.7zM371.3 335v37.3h-99.4V335h99.4z"></path></svg>',
|
209 |
+
),
|
210 |
+
|
211 |
+
array(
|
212 |
+
'name' => __( 'Optin Form', 'coming-soon' ),
|
213 |
+
'is_pro' => true,
|
214 |
+
'cat' => 'adv',
|
215 |
+
'type' => 'optin-form',
|
216 |
+
'id' => 22,
|
217 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 4.99L4 6h16zm0 12H4V8l8 5 8-5v10z"/></svg>',
|
218 |
+
),
|
219 |
+
|
220 |
+
array(
|
221 |
+
'name' => __( 'Countdown', 'coming-soon' ),
|
222 |
+
'is_pro' => true,
|
223 |
+
'cat' => 'adv',
|
224 |
+
'type' => 'countdown',
|
225 |
+
'id' => 16,
|
226 |
+
'icon' => '
|
227 |
|
228 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M15.07 1.01h-6v2h6v-2zm-4 13h2v-6h-2v6zm8.03-6.62l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.14 4.74 14.19 4 12.07 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.11-.74-4.06-1.97-5.61zm-7.03 12.62c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>',
|
229 |
+
),
|
230 |
+
array(
|
231 |
+
'name' => __( 'Social Profiles', 'coming-soon' ),
|
232 |
+
'is_pro' => true,
|
233 |
+
'cat' => 'adv',
|
234 |
+
'type' => 'social-profiles',
|
235 |
+
'id' => 18,
|
236 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 13.75c-2.34 0-7 1.17-7 3.5V19h14v-1.75c0-2.33-4.66-3.5-7-3.5zM4.34 17c.84-.58 2.87-1.25 4.66-1.25s3.82.67 4.66 1.25H4.34zM9 12c1.93 0 3.5-1.57 3.5-3.5S10.93 5 9 5 5.5 6.57 5.5 8.5 7.07 12 9 12zm0-5c.83 0 1.5.67 1.5 1.5S9.83 10 9 10s-1.5-.67-1.5-1.5S8.17 7 9 7zm7.04 6.81c1.16.84 1.96 1.96 1.96 3.44V19h4v-1.75c0-2.02-3.5-3.17-5.96-3.44zM15 12c1.93 0 3.5-1.57 3.5-3.5S16.93 5 15 5c-.54 0-1.04.13-1.5.35.63.89 1 1.98 1 3.15s-.37 2.26-1 3.15c.46.22.96.35 1.5.35z"/></svg>',
|
237 |
+
),
|
238 |
+
array(
|
239 |
+
'name' => __( 'Social Sharing', 'coming-soon' ),
|
240 |
+
'is_pro' => true,
|
241 |
+
'cat' => 'adv',
|
242 |
+
'type' => 'social-sharing',
|
243 |
+
'id' => 19,
|
244 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92zM18 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm12 7.02c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/></svg>',
|
245 |
+
),
|
246 |
+
//array('name'=>__('Form','coming-soon'),'is_pro'=> false ,'cat'=>'adv','type'=>'form', 'id'=>25, 'icon' => 'far fa-envelope'),
|
247 |
+
|
248 |
+
array(
|
249 |
+
'name' => __( 'Progress Bar', 'coming-soon' ),
|
250 |
+
'is_pro' => true,
|
251 |
+
'cat' => 'adv',
|
252 |
+
'type' => 'progress-bar',
|
253 |
+
'id' => 24,
|
254 |
+
'icon' => '
|
255 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current sp-transform sp-rotate-90"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M5 9.2h3V19H5V9.2zM10.6 5h2.8v14h-2.8V5zm5.6 8H19v6h-2.8v-6z"/></svg>',
|
256 |
+
),
|
257 |
+
array(
|
258 |
+
'name' => __( 'Icon', 'coming-soon' ),
|
259 |
+
'is_pro' => true,
|
260 |
+
'cat' => 'adv',
|
261 |
+
'type' => 'icon',
|
262 |
+
'id' => 24,
|
263 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>',
|
264 |
+
),
|
265 |
+
|
266 |
+
array(
|
267 |
+
'name' => __( 'Testimonials', 'coming-soon' ),
|
268 |
+
'is_pro' => true,
|
269 |
+
'cat' => 'adv',
|
270 |
+
'type' => 'testimonial',
|
271 |
+
'id' => 34,
|
272 |
+
'icon' => '
|
273 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>',
|
274 |
+
),
|
275 |
+
|
276 |
+
array(
|
277 |
+
'name' => __( 'Image Box', 'coming-soon' ),
|
278 |
+
'is_pro' => true,
|
279 |
+
'cat' => 'adv',
|
280 |
+
'type' => 'feature',
|
281 |
+
'id' => 24,
|
282 |
+
'icon' => '
|
283 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M0 0h24v24H0V0z" fill="none"/><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM4 6h9v7H4z"/></svg>',
|
284 |
+
),
|
285 |
+
|
286 |
+
array(
|
287 |
+
'name' => __( 'Icon Box', 'coming-soon' ),
|
288 |
+
'is_pro' => true,
|
289 |
+
'cat' => 'adv',
|
290 |
+
'type' => 'iconfeature',
|
291 |
+
'id' => 26,
|
292 |
+
'icon' => '
|
293 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM5 10h9v2H5zm0-3h9v2H5z"/></svg>',
|
294 |
+
),
|
295 |
+
|
296 |
+
array(
|
297 |
+
'name' => __( 'Nav Menu', 'coming-soon' ),
|
298 |
+
'is_pro' => true,
|
299 |
+
'cat' => 'adv',
|
300 |
+
'type' => 'nav',
|
301 |
+
'id' => 25,
|
302 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',
|
303 |
+
),
|
304 |
+
|
305 |
+
array(
|
306 |
+
'name' => __( 'Anchor', 'coming-soon' ),
|
307 |
+
'is_pro' => true,
|
308 |
+
'cat' => 'adv',
|
309 |
+
'type' => 'anchor',
|
310 |
+
'id' => 30,
|
311 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current" ><path d="M17,15l1.55,1.55c-0.96,1.69-3.33,3.04-5.55,3.37V11h3V9h-3V7.82C14.16,7.4,15,6.3,15,5c0-1.65-1.35-3-3-3S9,3.35,9,5 c0,1.3,0.84,2.4,2,2.82V9H8v2h3v8.92c-2.22-0.33-4.59-1.68-5.55-3.37L7,15l-4-3v3c0,3.88,4.92,7,9,7s9-3.12,9-7v-3L17,15z M12,4 c0.55,0,1,0.45,1,1s-0.45,1-1,1s-1-0.45-1-1S11.45,4,12,4z"/></g></svg>',
|
312 |
+
),
|
313 |
+
|
314 |
+
array(
|
315 |
+
'name' => __( 'Star Rating', 'coming-soon' ),
|
316 |
+
'is_pro' => true,
|
317 |
+
'cat' => 'adv',
|
318 |
+
'type' => 'starrating',
|
319 |
+
'id' => 31,
|
320 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 7.13l.97 2.29.47 1.11 1.2.1 2.47.21-1.88 1.63-.91.79.27 1.18.56 2.41-2.12-1.28-1.03-.64-1.03.62-2.12 1.28.56-2.41.27-1.18-.91-.79-1.88-1.63 2.47-.21 1.2-.1.47-1.11.97-2.27M12 2L9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2z"/></svg>',
|
321 |
+
),
|
322 |
+
|
323 |
+
array(
|
324 |
+
'name' => __( 'Accordion', 'coming-soon' ),
|
325 |
+
'is_pro' => true,
|
326 |
+
'cat' => 'adv',
|
327 |
+
'type' => 'accordion',
|
328 |
+
'id' => 34,
|
329 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M21 18H2v2h19v-2zm-2-8v4H4v-4h15m1-2H3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h17c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zm1-4H2v2h19V4z"/></svg>',
|
330 |
+
),
|
331 |
+
|
332 |
+
array(
|
333 |
+
'name' => __( 'Shortcode', 'coming-soon' ),
|
334 |
+
'is_pro' => true,
|
335 |
+
'cat' => 'adv',
|
336 |
+
'type' => 'shortcode',
|
337 |
+
'id' => 21,
|
338 |
+
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="sp-w-6 sp-fill-current"><path d="M256 8C119.3 8 8 119.2 8 256c0 136.7 111.3 248 248 248s248-111.3 248-248C504 119.2 392.7 8 256 8zM33 256c0-32.3 6.9-63 19.3-90.7l106.4 291.4C84.3 420.5 33 344.2 33 256zm223 223c-21.9 0-43-3.2-63-9.1l66.9-194.4 68.5 187.8c.5 1.1 1 2.1 1.6 3.1-23.1 8.1-48 12.6-74 12.6zm30.7-327.5c13.4-.7 25.5-2.1 25.5-2.1 12-1.4 10.6-19.1-1.4-18.4 0 0-36.1 2.8-59.4 2.8-21.9 0-58.7-2.8-58.7-2.8-12-.7-13.4 17.7-1.4 18.4 0 0 11.4 1.4 23.4 2.1l34.7 95.2L200.6 393l-81.2-241.5c13.4-.7 25.5-2.1 25.5-2.1 12-1.4 10.6-19.1-1.4-18.4 0 0-36.1 2.8-59.4 2.8-4.2 0-9.1-.1-14.4-.3C109.6 73 178.1 33 256 33c58 0 110.9 22.2 150.6 58.5-1-.1-1.9-.2-2.9-.2-21.9 0-37.4 19.1-37.4 39.6 0 18.4 10.6 33.9 21.9 52.3 8.5 14.8 18.4 33.9 18.4 61.5 0 19.1-7.3 41.2-17 72.1l-22.2 74.3-80.7-239.6zm81.4 297.2l68.1-196.9c12.7-31.8 17-57.2 17-79.9 0-8.2-.5-15.8-1.5-22.9 17.4 31.8 27.3 68.2 27.3 107 0 82.3-44.6 154.1-110.9 192.7z"/></svg>',
|
339 |
+
),
|
340 |
+
|
341 |
+
array(
|
342 |
+
'name' => __( 'Login Form', 'coming-soon' ),
|
343 |
+
'is_pro' => true,
|
344 |
+
'cat' => 'adv',
|
345 |
+
'type' => 'login',
|
346 |
+
'id' => 33,
|
347 |
+
'icon' => '
|
348 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="sp-w-6 sp-fill-current " enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><rect fill="none" height="24" width="24"/></g><g><path d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z"/></g></svg>',
|
349 |
+
),
|
350 |
+
|
351 |
+
array(
|
352 |
+
'name' => __( 'Custom HTML', 'coming-soon' ),
|
353 |
+
'is_pro' => false,
|
354 |
+
'cat' => 'adv',
|
355 |
+
'type' => 'custom-html',
|
356 |
+
'id' => 20,
|
357 |
+
'icon' => '
|
358 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="sp-w-6 sp-fill-current " viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/></svg>',
|
359 |
+
),
|
360 |
+
|
361 |
+
// array(
|
362 |
+
// 'name' => __( 'Facebook Like', 'coming-soon' ),
|
363 |
+
// 'is_pro' => true,
|
364 |
+
// 'cat' => 'adv',
|
365 |
+
// 'type' => 'facebooklike',
|
366 |
+
// 'id' => 35,
|
367 |
+
// 'icon' => '
|
368 |
+
// <svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
369 |
+
// <path d="M11.66 14.44H7.02C7.00895 14.44 7 14.449 7 14.46V22.5C7 22.511 7.00895 22.52 7.02 22.52H11.66C11.671 22.52 11.68 22.511 11.68 22.5V14.46C11.68 14.449 11.671 14.44 11.66 14.44Z" />
|
370 |
+
// <path d="M23 16.58C23.0003 16.3506 22.9544 16.1235 22.865 15.9121C22.7757 15.7008 22.6448 15.5097 22.48 15.35C22.7099 15.0664 22.84 14.715 22.85 14.35C22.8473 13.9028 22.6676 13.4749 22.35 13.16C22.0146 12.8194 21.558 12.6252 21.08 12.62H17.35L17.59 11C17.6217 10.8015 17.6384 10.601 17.64 10.4C17.64 8.88001 16.64 7.10001 15.27 7.10001C14.9031 7.10899 14.5503 7.24306 14.27 7.48001L14.13 7.60001L14.32 10.13C14.3352 10.2361 14.3352 10.3439 14.32 10.45C14.2922 10.5545 14.252 10.6552 14.2 10.75L12.2 14.52L12.13 14.58C12.1036 14.4113 12.0172 14.2579 11.8868 14.1477C11.7564 14.0375 11.5907 13.9779 11.42 13.98H7.37C7.27592 13.9787 7.18252 13.9961 7.09522 14.0312C7.00792 14.0662 6.92847 14.1183 6.86148 14.1844C6.79448 14.2505 6.74129 14.3292 6.70499 14.416C6.66868 14.5028 6.64999 14.5959 6.65 14.69V22.13C6.64999 22.2241 6.66868 22.3172 6.70499 22.404C6.74129 22.4908 6.79448 22.5696 6.86148 22.6356C6.92847 22.7017 7.00792 22.7538 7.09522 22.7889C7.18252 22.8239 7.27592 22.8413 7.37 22.84H11.31C11.4983 22.84 11.6789 22.7652 11.812 22.6321C11.9452 22.4989 12.02 22.3183 12.02 22.13V21.75C12.5073 22.1373 13.1077 22.3549 13.73 22.37H19.67C20.1027 22.3498 20.5116 22.1662 20.8141 21.8563C21.1167 21.5463 21.2903 21.1331 21.3 20.7C21.3153 20.5638 21.3153 20.4262 21.3 20.29C21.6037 20.1543 21.8605 19.932 22.0384 19.6509C22.2163 19.3698 22.3073 19.0425 22.3 18.71C22.3024 18.4834 22.2582 18.2587 22.17 18.05C22.4224 17.8963 22.6312 17.6804 22.7765 17.4231C22.9218 17.1658 22.9987 16.8755 23 16.58ZM11.33 22.16H7.37V14.72H11.31V22.16H11.33ZM21.57 17.56L21.1 17.7L21.39 18.1C21.5255 18.2746 21.5993 18.4891 21.6 18.71C21.6027 18.9512 21.5182 19.1852 21.362 19.369C21.2058 19.5527 20.9885 19.6738 20.75 19.71L20.28 19.79L20.5 20.22C20.5745 20.3653 20.6123 20.5267 20.61 20.69C20.61 20.9552 20.5046 21.2096 20.3171 21.3971C20.1296 21.5846 19.8752 21.69 19.61 21.69H13.74C13.2818 21.6743 12.8405 21.5132 12.48 21.23C12.3821 21.1426 12.2707 21.0716 12.15 21.02L12 21V15.52L12.62 14.99L14.7 11.13C14.7912 10.9814 14.8586 10.8194 14.9 10.65C14.9463 10.474 14.9632 10.2915 14.95 10.11L14.8 8.00001C14.9435 7.91855 15.105 7.87389 15.27 7.87001C16.17 7.87001 16.94 9.31001 16.94 10.48C16.9502 10.6432 16.9502 10.8068 16.94 10.97L16.57 13.31H21.09C21.3832 13.3137 21.6632 13.4322 21.87 13.64C21.9645 13.7326 22.0397 13.8431 22.0912 13.9649C22.1427 14.0868 22.1695 14.2177 22.17 14.35C22.1652 14.5068 22.126 14.6607 22.0552 14.8006C21.9843 14.9406 21.8835 15.0633 21.76 15.16L21.34 15.48L21.8 15.74C21.9847 15.8301 22.1372 15.9749 22.2367 16.1548C22.3362 16.3346 22.3779 16.5408 22.356 16.7452C22.3341 16.9495 22.2498 17.1422 22.1146 17.297C21.9793 17.4517 21.7996 17.561 21.6 17.61L21.57 17.56Z" />
|
371 |
+
// <path d="M25.48 27.93H4.48C3.82043 27.9247 3.18967 27.659 2.72515 27.1907C2.26062 26.7225 1.99998 26.0896 2 25.43V4.42999C2 3.76695 2.26339 3.13107 2.73223 2.66223C3.20107 2.19338 3.83696 1.92999 4.5 1.92999H25.5C26.163 1.92999 26.7989 2.19338 27.2678 2.66223C27.7366 3.13107 28 3.76695 28 4.42999V25.43C28 25.76 27.9347 26.0867 27.8078 26.3913C27.6809 26.696 27.495 26.9725 27.2607 27.2049C27.0264 27.4373 26.7485 27.621 26.4429 27.7455C26.1372 27.8699 25.81 27.9326 25.48 27.93ZM4.48 3.92999C4.34819 3.93255 4.2225 3.98605 4.12928 4.07927C4.03606 4.17249 3.98256 4.29819 3.98 4.42999V25.43C3.98 25.5626 4.03268 25.6898 4.12645 25.7835C4.22021 25.8773 4.34739 25.93 4.48 25.93H25.48C25.6126 25.93 25.7398 25.8773 25.8336 25.7835C25.9273 25.6898 25.98 25.5626 25.98 25.43V4.42999C25.98 4.29738 25.9273 4.17021 25.8336 4.07644C25.7398 3.98267 25.6126 3.92999 25.48 3.92999H4.48Z" />
|
372 |
+
// </svg>',
|
373 |
+
// ),
|
374 |
+
|
375 |
+
// array(
|
376 |
+
// 'name' => __( 'Facebook Comments', 'coming-soon' ),
|
377 |
+
// 'is_pro' => true,
|
378 |
+
// 'cat' => 'adv',
|
379 |
+
// 'type' => 'facebookcomments',
|
380 |
+
// 'id' => 36,
|
381 |
+
// 'icon' => '<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
382 |
+
// <path fill-rule="evenodd" clip-rule="evenodd" d="M3.13 28C2.94034 27.9985 2.75305 27.9576 2.58 27.88C2.31249 27.7733 2.08344 27.5882 1.92286 27.3491C1.76227 27.11 1.67762 26.828 1.68 26.54V5.34999C1.68 4.37665 2.06666 3.44317 2.75492 2.75491C3.44318 2.06665 4.37666 1.67999 5.35 1.67999H24.65C25.6225 1.68263 26.5545 2.07014 27.2422 2.75783C27.9299 3.44551 28.3174 4.37746 28.32 5.34999V19.83C28.3174 20.8016 27.9295 21.7325 27.2416 22.4186C26.5536 23.1047 25.6216 23.49 24.65 23.49H8.28L4.16 27.61C3.88133 27.8704 3.51127 28.0105 3.13 28ZM5.35 4.17999C5.19683 4.17999 5.04516 4.21032 4.90377 4.26924C4.76238 4.32816 4.63405 4.4145 4.5262 4.52328C4.41836 4.63205 4.33312 4.76111 4.27542 4.90301C4.21771 5.0449 4.18868 5.19682 4.19 5.34999V24.05L7.24 21H24.65C24.8032 21.0013 24.9551 20.9723 25.097 20.9146C25.2389 20.8569 25.3679 20.7716 25.4767 20.6638C25.5855 20.5559 25.6718 20.4276 25.7308 20.2862C25.7897 20.1448 25.82 19.9932 25.82 19.84V5.34999C25.82 5.03969 25.6967 4.7421 25.4773 4.52268C25.2579 4.30326 24.9603 4.17999 24.65 4.17999H5.35ZM11.59 13.31L11.9 11.31H10V10C9.9827 9.84694 10.001 9.69194 10.0535 9.54712C10.1059 9.40229 10.1911 9.27154 10.3025 9.16506C10.4138 9.05859 10.5482 8.97927 10.6952 8.93329C10.8422 8.88731 10.9979 8.87592 11.15 8.9H12V7.15C11.4746 7.05974 10.943 7.0096 10.41 7C10.0473 6.97295 9.683 7.02603 9.34306 7.15548C9.00313 7.28492 8.69582 7.48756 8.44294 7.74903C8.19006 8.0105 7.99779 8.3244 7.87977 8.66847C7.76175 9.01254 7.72086 9.37836 7.76 9.74V11.28H6V13.28H7.76V18.18C8.12352 18.2406 8.49147 18.2707 8.86 18.27C9.24102 18.2835 9.62249 18.2634 10 18.21V13.31H11.59ZM13.98 8.92999H23.98V9.92999H13.98V8.92999ZM22.98 14.93H13.98V15.93H22.98V14.93ZM13.98 11.93H20.98V12.93H13.98V11.93Z" />
|
383 |
+
// </svg>
|
384 |
+
// ',
|
385 |
+
// ),
|
386 |
+
|
387 |
+
// array(
|
388 |
+
// 'name' => __( 'Facebook Page', 'coming-soon' ),
|
389 |
+
// 'is_pro' => true,
|
390 |
+
// 'cat' => 'adv',
|
391 |
+
// 'type' => 'facebookpage',
|
392 |
+
// 'id' => 37,
|
393 |
+
// 'icon' => '
|
394 |
+
// <svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
395 |
+
// <path fill-rule="evenodd" clip-rule="evenodd" d="M29 13.32C29 13.8723 28.5523 14.32 28 14.32H13.4V16.94C13.4 17.4923 12.9523 17.94 12.4 17.94H5.3C4.74772 17.94 4.3 17.4923 4.3 16.94V14.32H2C1.44771 14.32 1 13.8723 1 13.32V2C1 1.44771 1.44772 1 2 1H28C28.5523 1 29 1.44772 29 2V13.32ZM27 12.32H13.4V8.61999C13.4 8.06771 12.9523 7.62 12.4 7.62H5.3C4.74772 7.62 4.3 8.06771 4.3 8.62V12.32H3V4C3 3.44772 3.44772 3 4 3H26C26.5523 3 27 3.44771 27 4V12.32ZM14 9.48001L17.46 4.76001C17.4973 4.71033 17.5456 4.67001 17.6011 4.64224C17.6567 4.61446 17.7179 4.60001 17.78 4.60001C17.8421 4.60001 17.9033 4.61446 17.9589 4.64224C18.0144 4.67001 18.0627 4.71033 18.1 4.76001L20.84 8.46001C20.8532 8.48285 20.8721 8.50183 20.8949 8.51503C20.9177 8.52822 20.9436 8.53517 20.97 8.53517C20.9964 8.53517 21.0223 8.52822 21.0451 8.51503C21.0679 8.50183 21.0868 8.48285 21.1 8.46001L22.83 6.00001C22.8656 5.94637 22.9139 5.90238 22.9706 5.87195C23.0273 5.84151 23.0906 5.82559 23.155 5.82559C23.2194 5.82559 23.2827 5.84151 23.3394 5.87195C23.3961 5.90238 23.4444 5.94637 23.48 6.00001L25.92 9.49001C25.9628 9.55127 25.9886 9.62286 25.9945 9.69739C26.0004 9.77191 25.9864 9.84667 25.9537 9.91394C25.9211 9.98121 25.8711 10.0386 25.809 10.0801C25.7468 10.1216 25.6746 10.1457 25.6 10.15H14.32C14.2437 10.1469 14.1697 10.123 14.106 10.081C14.0422 10.0389 13.9911 9.98028 13.9582 9.91137C13.9253 9.84247 13.9118 9.76589 13.9192 9.68989C13.9265 9.61388 13.9545 9.54132 14 9.48001ZM17 24.29L19.43 21.05C19.4553 21.0187 19.4873 20.9934 19.5236 20.9761C19.56 20.9587 19.5997 20.9497 19.64 20.9497C19.6803 20.9497 19.72 20.9587 19.7564 20.9761C19.7927 20.9934 19.8247 21.0187 19.85 21.05L21.74 23.59C21.749 23.6045 21.7615 23.6164 21.7764 23.6247C21.7912 23.633 21.808 23.6373 21.825 23.6373C21.842 23.6373 21.8588 23.633 21.8736 23.6247C21.8885 23.6164 21.901 23.6045 21.91 23.59L23.1 21.87C23.1246 21.8329 23.1581 21.8024 23.1973 21.7813C23.2366 21.7603 23.2804 21.7493 23.325 21.7493C23.3696 21.7493 23.4134 21.7603 23.4527 21.7813C23.4919 21.8024 23.5254 21.8329 23.55 21.87L25.23 24.3C25.2584 24.3429 25.2749 24.3925 25.2778 24.4439C25.2807 24.4952 25.2699 24.5464 25.2465 24.5922C25.2231 24.638 25.1879 24.6768 25.1446 24.7045C25.1013 24.7322 25.0514 24.7479 25 24.75H17.22C17.1678 24.7474 17.1174 24.7307 17.0739 24.7017C17.0304 24.6728 16.9956 24.6326 16.9731 24.5855C16.9505 24.5384 16.9411 24.4861 16.9459 24.434C16.9506 24.382 16.9693 24.3323 17 24.29ZM12.4 8.62V16.94H5.3V8.62H12.4ZM15 15.93H28V16.92H15V15.93ZM27 18.94V27H16V18.94H27ZM28 18.94C28 18.3877 27.5523 17.94 27 17.94H16C15.4477 17.94 15 18.3877 15 18.94V27C15 27.5523 15.4477 28 16 28H27C27.5523 28 28 27.5523 28 27V18.94ZM4.3 18.93H13.4V19.93H4.3V18.93ZM13.4 20.93H4.3V21.93H13.4V20.93ZM4.3 22.93H13.4V23.93H4.3V22.93ZM13.4 24.93H4.3V25.93H13.4V24.93ZM4.3 26.93H13.4V27.93H4.3V26.93ZM10.13 12.3L10 13.16H9.26V15.25C9.10684 15.2603 8.95316 15.2603 8.8 15.25C8.6435 15.2603 8.4865 15.2603 8.33 15.25V13.16H7.57V12.3H8.33V11.64C8.31327 11.4862 8.33074 11.3306 8.38117 11.1843C8.4316 11.038 8.51374 10.9046 8.62172 10.7938C8.72969 10.683 8.86083 10.5974 9.00575 10.5431C9.15067 10.4889 9.30578 10.4673 9.46 10.48C9.68453 10.483 9.9085 10.5031 10.13 10.54V11.27H9.75C9.68555 11.2625 9.62023 11.2692 9.55871 11.2899C9.4972 11.3106 9.44101 11.3446 9.39418 11.3895C9.34735 11.4344 9.31104 11.4891 9.28784 11.5497C9.26464 11.6103 9.25513 11.6753 9.26 11.74V12.3H10.13Z"/>
|
396 |
+
// </svg>',
|
397 |
+
// ),
|
398 |
+
|
399 |
+
// array(
|
400 |
+
// 'name' => __( 'Facebook Embed', 'coming-soon' ),
|
401 |
+
// 'is_pro' => true,
|
402 |
+
// 'cat' => 'adv',
|
403 |
+
// 'type' => 'facebookembed',
|
404 |
+
// 'id' => 38,
|
405 |
+
// 'icon' => '
|
406 |
+
// <svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
407 |
+
// <path fill-rule="evenodd" clip-rule="evenodd" d="M23.6023 7.34992H3.17535V21.4816H11.9735C12.13 21.4816 12.2801 21.5438 12.3908 21.6545C12.5015 21.7651 12.5637 21.9153 12.5637 22.0718V23.2522C12.5637 23.4087 12.5015 23.5588 12.3908 23.6695C12.2801 23.7802 12.13 23.8423 11.9735 23.8423H3.15349C2.52738 23.8423 1.92692 23.5936 1.48419 23.1509C1.04147 22.7082 0.792746 22.1077 0.792746 21.4816V7.34992C0.794172 7.03897 0.857013 6.73137 0.977659 6.44478C1.09831 6.1582 1.27438 5.89827 1.49577 5.67992C1.71716 5.46158 1.97951 5.28912 2.26774 5.17246C2.55597 5.05579 2.86441 4.99722 3.17535 5.0001H23.5805C24.2028 5.00298 24.7988 5.25147 25.2389 5.69152C25.6789 6.13158 25.9274 6.72759 25.9303 7.34992V15.0005C25.9304 15.1533 25.8712 15.3002 25.7652 15.4103C25.6592 15.5203 25.5147 15.585 25.362 15.5907H24.1925C24.036 15.5907 23.8859 15.5285 23.7752 15.4178C23.6645 15.3071 23.6023 15.157 23.6023 15.0005V7.34992ZM29.1873 21.6127V20.6947L28.3238 20.2138L26.2473 19.0771L24.4221 18.0498V19.6127L24.8046 19.7985L27.3402 21.0881L24.6188 22.3232L24.4221 22.4215V23.9626L29.1873 21.6127ZM16.6185 13.9731L11.0882 10.279C11.0056 10.2231 10.9092 10.1909 10.8096 10.1859C10.71 10.1809 10.6109 10.2033 10.5231 10.2506C10.4353 10.2979 10.362 10.3683 10.3114 10.4542C10.2607 10.5401 10.2346 10.6383 10.2357 10.738V18.1044C10.2346 18.2042 10.2607 18.3023 10.3114 18.3882C10.362 18.4742 10.4353 18.5446 10.5231 18.5919C10.6109 18.6392 10.71 18.6615 10.8096 18.6565C10.9092 18.6515 11.0056 18.6193 11.0882 18.5635L16.6185 14.8803C16.6929 14.8303 16.7538 14.7628 16.796 14.6837C16.8381 14.6046 16.8601 14.5163 16.8601 14.4267C16.8601 14.3371 16.8381 14.2488 16.796 14.1697C16.7538 14.0906 16.6929 14.0231 16.6185 13.9731ZM24.0614 17.1098L23.1761 19.7985L22.3564 22.3231L21.482 24.9899H19.8536L20.717 22.3231L21.5476 19.7985L22.422 17.1098H24.0614ZM19.0557 19.7985L16.5201 21.0881L19.2415 22.3232L19.4383 22.4215V23.9626L16.1157 22.3232L14.6621 21.6127V20.6947L16.2906 19.7985L19.4383 18.0498V19.6127L19.0557 19.7985Z" />
|
408 |
+
// </svg>
|
409 |
+
// ',
|
410 |
+
// ),
|
411 |
+
|
412 |
+
array(
|
413 |
+
'name' => __( 'Add To Cart', 'coming-soon' ),
|
414 |
+
'is_pro' => true,
|
415 |
+
'cat' => 'wc',
|
416 |
+
'type' => 'wcaddtocart',
|
417 |
+
'id' => 34,
|
418 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.48 11.69H17.09C17.22 11.69 17.3446 11.6384 17.4365 11.5465C17.5284 11.4546 17.58 11.3299 17.58 11.2V7.71999H21C21.0639 7.72 21.1271 7.70726 21.186 7.68252C21.2449 7.65777 21.2983 7.62152 21.343 7.57588C21.3877 7.53025 21.4228 7.47614 21.4464 7.41675C21.4699 7.35735 21.4813 7.29386 21.48 7.22999V5.55999C21.48 5.43175 21.4298 5.3086 21.34 5.21699C21.2503 5.12538 21.1282 5.07261 21 5.06999H17.58V1.58999C17.5774 1.45912 17.5236 1.3345 17.4301 1.24288C17.3366 1.15127 17.2109 1.09996 17.08 1.09999H15.47C15.4061 1.09866 15.3426 1.11009 15.2832 1.13362C15.2238 1.15714 15.1697 1.19229 15.1241 1.23699C15.0785 1.2817 15.0422 1.33506 15.0175 1.39396C14.9927 1.45286 14.98 1.5161 14.98 1.57999V5.06999H11.58C11.4518 5.06996 11.3286 5.12021 11.237 5.20995C11.1454 5.29969 11.0926 5.42177 11.09 5.54999V7.21999C11.0926 7.35179 11.1461 7.47749 11.2393 7.57071C11.3325 7.66393 11.4582 7.71743 11.59 7.71999H15V11.19C14.9999 11.3192 15.0498 11.4434 15.1393 11.5367C15.2288 11.6299 15.3509 11.6848 15.48 11.69ZM9.8 23.61C9.27349 23.5981 8.75536 23.7433 8.31175 24.0271C7.86814 24.311 7.51916 24.7206 7.30936 25.2036C7.09956 25.6867 7.03844 26.2213 7.13382 26.7392C7.22919 27.2572 7.47673 27.7349 7.84483 28.1116C8.21294 28.4882 8.68492 28.7466 9.20054 28.8538C9.71616 28.961 10.252 28.9122 10.7398 28.7135C11.2275 28.5148 11.645 28.1753 11.9389 27.7383C12.2328 27.3013 12.3899 26.7866 12.39 26.26C12.3953 25.9156 12.3323 25.5735 12.2048 25.2535C12.0773 24.9335 11.8876 24.642 11.6469 24.3956C11.4061 24.1493 11.1189 23.953 10.802 23.8182C10.485 23.6833 10.1445 23.6126 9.8 23.61ZM22.8 23.61C22.2735 23.5981 21.7554 23.7433 21.3118 24.0271C20.8681 24.311 20.5192 24.7206 20.3094 25.2036C20.0996 25.6867 20.0384 26.2213 20.1338 26.7392C20.2292 27.2572 20.4767 27.7349 20.8448 28.1116C21.2129 28.4882 21.6849 28.7466 22.2005 28.8538C22.7162 28.961 23.252 28.9122 23.7398 28.7135C24.2275 28.5148 24.645 28.1753 24.9389 27.7383C25.2328 27.3013 25.3899 26.7866 25.39 26.26C25.394 25.9126 25.3288 25.5678 25.1983 25.2458C25.0678 24.9238 24.8745 24.631 24.6298 24.3844C24.385 24.1378 24.0937 23.9423 23.7727 23.8094C23.4517 23.6764 23.1074 23.6086 22.76 23.61H22.8ZM10 19.3V19.14L11.22 17H20.88C21.3469 16.9984 21.8047 16.8702 22.2044 16.6289C22.6042 16.3876 22.931 16.0424 23.15 15.63L27.92 6.77999C27.9817 6.66553 27.9963 6.53155 27.9608 6.40647C27.9254 6.28139 27.8426 6.17505 27.73 6.10999L26.21 5.25999C26.1521 5.22778 26.0882 5.2079 26.0223 5.2016C25.9563 5.1953 25.8898 5.20272 25.8269 5.22338C25.7639 5.24405 25.706 5.27751 25.6566 5.32167C25.6072 5.36584 25.5675 5.41974 25.54 5.47999L24.46 7.71999L20.88 14.34H11.78L11.61 14L8.71 7.71999L7.48 5.06999L6.39 2.70999C6.35668 2.63132 6.30297 2.56296 6.23442 2.51198C6.16586 2.461 6.08493 2.42924 6 2.41999H2.51C2.4448 2.41997 2.38026 2.43297 2.32015 2.45822C2.26004 2.48347 2.20557 2.52046 2.15993 2.56702C2.1143 2.61359 2.07842 2.66879 2.05439 2.7294C2.03036 2.79001 2.01867 2.8548 2.02 2.91999V4.56999C2.01867 4.63517 2.03036 4.69997 2.05439 4.76058C2.07842 4.82118 2.1143 4.87639 2.15993 4.92295C2.20557 4.96952 2.26004 5.00651 2.32015 5.03176C2.38026 5.057 2.4448 5.07 2.51 5.06999H4.61L9.28 15.07L7.53 18.36C7.26814 18.8355 7.15985 19.3805 7.22 19.92C7.3034 20.5774 7.62564 21.1811 8.12536 21.6163C8.62508 22.0515 9.26739 22.2877 9.93 22.28H24.87C24.9339 22.28 24.9971 22.2673 25.056 22.2425C25.1149 22.2178 25.1683 22.1815 25.213 22.1359C25.2577 22.0902 25.2928 22.0361 25.3164 21.9767C25.3399 21.9174 25.3513 21.8539 25.35 21.79V20.13C25.3513 20.0656 25.34 20.0017 25.3166 19.9417C25.2931 19.8817 25.2582 19.827 25.2136 19.7805C25.169 19.7341 25.1157 19.6969 25.0568 19.6711C24.9978 19.6453 24.9344 19.6313 24.87 19.63H10.34C10.2955 19.6328 10.2508 19.6263 10.209 19.6108C10.1671 19.5954 10.129 19.5713 10.097 19.5403C10.0649 19.5092 10.0398 19.4717 10.0231 19.4304C10.0064 19.389 9.99852 19.3446 10 19.3Z" />
|
419 |
+
</svg>',
|
420 |
+
),
|
421 |
+
|
422 |
+
array(
|
423 |
+
'name' => __( 'Checkout', 'coming-soon' ),
|
424 |
+
'is_pro' => true,
|
425 |
+
'cat' => 'wc',
|
426 |
+
'type' => 'wccheckout',
|
427 |
+
'id' => 35,
|
428 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
429 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.90441 23.8719C9.36486 23.5642 9.90621 23.4 10.46 23.4C10.8281 23.3987 11.1928 23.4702 11.5331 23.6104C11.8734 23.7507 12.1826 23.9569 12.4428 24.2172C12.7031 24.4774 12.9093 24.7866 13.0496 25.1269C13.1898 25.4672 13.2613 25.8319 13.26 26.2C13.26 26.7538 13.0958 27.2951 12.7881 27.7556C12.4804 28.2161 12.0431 28.5749 11.5315 28.7869C11.0199 28.9988 10.4569 29.0542 9.91375 28.9462C9.3706 28.8382 8.87169 28.5715 8.4801 28.1799C8.08852 27.7883 7.82184 27.2894 7.7138 26.7463C7.60576 26.2031 7.66121 25.6401 7.87314 25.1285C8.08506 24.6169 8.44395 24.1796 8.90441 23.8719ZM22.9044 23.8719C23.3649 23.5642 23.9062 23.4 24.46 23.4H24.43C24.8002 23.396 25.1675 23.4655 25.5107 23.6045C25.8539 23.7434 26.1661 23.949 26.4293 24.2094C26.6925 24.4698 26.9014 24.7798 27.044 25.1215C27.1866 25.4632 27.26 25.8298 27.26 26.2C27.26 26.7538 27.0958 27.2951 26.7881 27.7556C26.4804 28.2161 26.0431 28.5749 25.5315 28.7869C25.0199 28.9988 24.4569 29.0542 23.9137 28.9462C23.3706 28.8382 22.8717 28.5715 22.4801 28.1799C22.0885 27.7883 21.8218 27.2894 21.7138 26.7463C21.6058 26.2031 21.6612 25.6401 21.8731 25.1285C22.0851 24.6169 22.4439 24.1796 22.9044 23.8719ZM23.9752 11.3809L25.26 7.43C25.2955 7.32386 25.2881 7.20807 25.2396 7.10724C25.191 7.00641 25.1051 6.92848 25 6.89L13.85 3.27C13.7426 3.23505 13.6257 3.24377 13.5246 3.2943C13.4236 3.34482 13.3465 3.43308 13.31 3.54L11.18 10.09C11.1613 10.1431 11.1535 10.1995 11.157 10.2557C11.1605 10.3119 11.1753 10.3669 11.2005 10.4172C11.2257 10.4676 11.2608 10.5124 11.3036 10.549C11.3465 10.5855 11.3963 10.6131 11.45 10.63L20.5645 13.6H12.6L12.42 13.22L9.29 6.6L8 3.8L6.79 1.3C6.74823 1.21053 6.68184 1.13481 6.59861 1.08168C6.51538 1.02855 6.41874 1.00022 6.32 1H2.61C2.46944 1 2.33463 1.05584 2.23524 1.15523C2.13584 1.25463 2.08 1.38944 2.08 1.53V3.28C2.07999 3.34914 2.09376 3.41758 2.12052 3.48133C2.14727 3.54508 2.18647 3.60286 2.23582 3.65128C2.28518 3.6997 2.34369 3.73779 2.40793 3.76332C2.47218 3.78886 2.54088 3.80133 2.61 3.8H4.88L9.88 14.43L8 17.86C7.71649 18.357 7.60077 18.9321 7.67 19.5C7.76359 20.2049 8.11465 20.8503 8.6556 21.3119C9.19656 21.7734 9.88914 22.0185 10.6 22H26.7C26.8406 22 26.9754 21.9442 27.0748 21.8448C27.1742 21.7454 27.23 21.6106 27.23 21.47V19.72C27.23 19.6509 27.2162 19.5824 27.1895 19.5187C27.1627 19.4549 27.1235 19.3971 27.0742 19.3487C27.0248 19.3003 26.9663 19.2622 26.9021 19.2367C26.8378 19.2111 26.7691 19.1987 26.7 19.2H11.05C10.9572 19.2 10.8682 19.1631 10.8025 19.0975C10.7369 19.0318 10.7 18.9428 10.7 18.85V18.68L12 16.4H22.41C22.9047 16.4058 23.3919 16.279 23.8209 16.0328C24.25 15.7866 24.6054 15.43 24.85 15L27.85 10.89C27.8833 10.8297 27.9043 10.7634 27.9118 10.6949C27.9192 10.6264 27.913 10.5571 27.8935 10.4911C27.8739 10.425 27.8415 10.3635 27.798 10.3101C27.7544 10.2567 27.7008 10.2125 27.64 10.18L26 9.24C25.9381 9.2058 25.8698 9.18461 25.7994 9.17771C25.7289 9.17082 25.6579 9.17837 25.5905 9.1999C25.5231 9.22143 25.4608 9.25649 25.4074 9.30293C25.354 9.34938 25.3107 9.40623 25.28 9.47L23.9752 11.3809ZM22.45 13.31L24.31 7.58L14 4.22L12.13 10L22.45 13.31ZM21.49 8.9C21.5728 8.92615 21.6496 8.96839 21.7161 9.02429C21.7825 9.08019 21.8373 9.14865 21.8773 9.22576C21.9172 9.30286 21.9415 9.38709 21.9489 9.47362C21.9562 9.56015 21.9464 9.64727 21.92 9.73C21.863 9.89385 21.7446 10.0292 21.5898 10.1075C21.435 10.1858 21.2558 10.2011 21.09 10.15C21.0489 10.137 21.0092 10.1201 20.9716 10.0994C21.1255 9.93458 21.2415 9.73681 21.31 9.52C21.3718 9.32899 21.3948 9.12758 21.3778 8.92756C21.3762 8.90889 21.3743 8.89026 21.372 8.87169C21.412 8.87741 21.4515 8.88687 21.49 8.9ZM20.9954 8.0451C21.2484 7.99146 21.5117 8.00314 21.76 8.08C21.9514 8.13924 22.1292 8.23573 22.2832 8.36393C22.4372 8.49214 22.5643 8.64952 22.6572 8.82703C22.7502 9.00453 22.8071 9.19867 22.8247 9.39825C22.8424 9.59784 22.8204 9.79894 22.76 9.99C22.6695 10.2763 22.4963 10.5294 22.2622 10.7173C22.0281 10.9053 21.7435 11.0197 21.4444 11.0462C21.1453 11.0726 20.8451 11.0098 20.5817 10.8659C20.43 10.783 20.2944 10.6753 20.1801 10.5481C20.1191 10.5612 20.0571 10.5706 19.9944 10.5762C19.6953 10.6026 19.3951 10.5398 19.1317 10.3959C18.8682 10.2519 18.6533 10.0331 18.514 9.76708C18.3748 9.50109 18.3174 9.19981 18.3492 8.90125C18.3809 8.60269 18.5004 8.32022 18.6925 8.08948C18.8846 7.85874 19.1408 7.69007 19.4286 7.60474C19.7165 7.5194 20.0232 7.52123 20.31 7.61C20.5022 7.66806 20.6808 7.76386 20.8355 7.89179C20.8926 7.93902 20.946 7.99028 20.9954 8.0451ZM20.1964 8.49823C20.1508 8.46973 20.1017 8.44675 20.05 8.43C19.968 8.402 19.8812 8.39069 19.7947 8.39673C19.7083 8.40277 19.6239 8.42604 19.5465 8.46517C19.4692 8.50431 19.4005 8.55851 19.3444 8.6246C19.2883 8.69069 19.246 8.76732 19.22 8.85C19.1788 8.97408 19.1754 9.10758 19.2103 9.23359C19.2451 9.35959 19.3165 9.47242 19.4156 9.55776C19.5146 9.64311 19.6367 9.69712 19.7665 9.71296C19.7783 9.71439 19.79 9.71551 19.8018 9.71631C19.7879 9.60234 19.7869 9.48659 19.7992 9.37125C19.8309 9.07269 19.9504 8.79022 20.1425 8.55948C20.1599 8.53855 20.1779 8.51813 20.1964 8.49823ZM16.29 6.75L14.7 6.23C14.5846 6.19544 14.4603 6.20749 14.3537 6.26359C14.2472 6.31968 14.1668 6.41533 14.13 6.53C14.1113 6.58646 14.104 6.64606 14.1085 6.70536C14.113 6.76466 14.1292 6.82248 14.1561 6.87548C14.1831 6.92849 14.2203 6.97562 14.2656 7.01416C14.3109 7.05269 14.3634 7.08187 14.42 7.1L16 7.62C16.1154 7.65541 16.24 7.64504 16.348 7.59105C16.456 7.53706 16.5391 7.44358 16.58 7.33C16.6149 7.2133 16.6031 7.0876 16.5472 6.9794C16.4912 6.8712 16.3954 6.78896 16.28 6.75H16.29ZM14.16 7.89999L16.58 8.67999C16.6828 8.72665 16.7648 8.80947 16.8105 8.9127C16.8562 9.01592 16.8623 9.13233 16.8277 9.23978C16.7932 9.34723 16.7203 9.43822 16.623 9.49542C16.5257 9.55262 16.4107 9.57204 16.3 9.54999L13.88 8.75999C13.8235 8.74161 13.7712 8.71228 13.7261 8.67369C13.681 8.63509 13.6439 8.58798 13.617 8.53506C13.59 8.48213 13.5738 8.42441 13.5692 8.3652C13.5645 8.306 13.5716 8.24646 13.59 8.18999C13.6084 8.13352 13.6377 8.08123 13.6763 8.0361C13.7149 7.99096 13.762 7.95387 13.8149 7.92694C13.8679 7.90001 13.9256 7.88377 13.9848 7.87915C14.044 7.87453 14.1035 7.88161 14.16 7.89999Z" />
|
430 |
+
</svg>
|
431 |
+
',
|
432 |
+
),
|
433 |
+
|
434 |
+
array(
|
435 |
+
'name' => __( 'Cart', 'coming-soon' ),
|
436 |
+
'is_pro' => true,
|
437 |
+
'cat' => 'wc',
|
438 |
+
'type' => 'wccart',
|
439 |
+
'id' => 36,
|
440 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
441 |
+
<path d="M23.37 23.33C22.8166 23.332 22.2763 23.4979 21.8171 23.8067C21.358 24.1156 21.0007 24.5536 20.7903 25.0654C20.5799 25.5772 20.5259 26.1399 20.635 26.6824C20.7442 27.2248 21.0117 27.7228 21.4036 28.1134C21.7956 28.504 22.2945 28.7697 22.8374 28.8769C23.3803 28.9841 23.9428 28.9281 24.4538 28.7159C24.9649 28.5037 25.4016 28.1448 25.7088 27.6846C26.016 27.2243 26.18 26.6834 26.18 26.13C26.1813 25.7611 26.1095 25.3956 25.9686 25.0546C25.8277 24.7136 25.6207 24.404 25.3593 24.1436C25.098 23.8832 24.7876 23.6772 24.4461 23.5375C24.1047 23.3979 23.7389 23.3274 23.37 23.33ZM9.37 23.33C8.81621 23.33 8.27486 23.4942 7.8144 23.8019C7.35395 24.1096 6.99506 24.5469 6.78314 25.0585C6.57121 25.5701 6.51576 26.1331 6.6238 26.6762C6.73184 27.2194 6.99851 27.7183 7.3901 28.1099C7.78169 28.5015 8.2806 28.7682 8.82375 28.8762C9.36689 28.9842 9.92988 28.9288 10.4415 28.7169C10.9531 28.5049 11.3904 28.1461 11.6981 27.6856C12.0058 27.2251 12.17 26.6838 12.17 26.13C12.1713 25.7636 12.1005 25.4005 11.9615 25.0615C11.8225 24.7225 11.6181 24.4142 11.3599 24.1542C11.1018 23.8942 10.7949 23.6876 10.4569 23.5462C10.1189 23.4048 9.75639 23.3313 9.39 23.33H9.37Z" />
|
442 |
+
<path d="M29 4.70999V5.18999C29.016 5.27592 29.016 5.36406 29 5.44999C28.9861 5.49589 28.9659 5.53963 28.94 5.57999C28.9206 5.62532 28.8972 5.66883 28.87 5.70999L23.82 14.88C23.5806 15.3174 23.2275 15.6821 22.798 15.9356C22.3686 16.189 21.8787 16.3218 21.38 16.32H11H10.94L9.67 18.61L9.62 18.78C9.6226 18.8737 9.66168 18.9627 9.72891 19.0281C9.79615 19.0935 9.88623 19.13 9.98 19.13H25.65C25.7906 19.13 25.9254 19.1858 26.0248 19.2852C26.1242 19.3846 26.18 19.5194 26.18 19.66V21.4C26.18 21.5406 26.1242 21.6754 26.0248 21.7748C25.9254 21.8742 25.7906 21.93 25.65 21.93H9.53C8.82028 21.9441 8.13004 21.6974 7.59003 21.2367C7.05003 20.7759 6.69777 20.1331 6.6 19.43C6.54061 18.8581 6.65936 18.2818 6.94 17.78L8.81 14.38V14.33L3.8 3.75999H1.52C1.44865 3.75876 1.37828 3.74313 1.31311 3.71404C1.24794 3.68496 1.18932 3.64301 1.14076 3.59071C1.09221 3.53842 1.05471 3.47685 1.03052 3.40971C1.00633 3.34257 0.99595 3.27124 1 3.19999V1.45999C0.999975 1.32114 1.05444 1.18783 1.15168 1.08872C1.24892 0.989606 1.38118 0.932612 1.52 0.929993H5.18C5.29158 0.930348 5.40093 0.961303 5.49614 1.01949C5.59135 1.07767 5.66878 1.16086 5.72 1.25999L6.88 3.72999L8.21 6.52999L11.35 13.16L11.53 13.53H21.32H21.37L25.21 6.52999L25.41 6.11999H13.41C13.3404 6.12132 13.2712 6.10892 13.2064 6.0835C13.1416 6.05808 13.0824 6.02015 13.0323 5.97186C12.9821 5.92357 12.942 5.86587 12.9141 5.80207C12.8863 5.73826 12.8713 5.6696 12.87 5.59999V4.18999C12.8713 4.12039 12.8863 4.05172 12.9141 3.98792C12.942 3.92411 12.9821 3.86642 13.0323 3.81813C13.0824 3.76984 13.1416 3.7319 13.2064 3.70648C13.2712 3.68107 13.3404 3.66867 13.41 3.66999H27.93C28.2094 3.66731 28.4786 3.77507 28.679 3.96983C28.8794 4.16459 28.9947 4.4306 29 4.70999Z" />
|
443 |
+
</svg>
|
444 |
+
',
|
445 |
+
),
|
446 |
+
|
447 |
+
array(
|
448 |
+
'name' => __( 'Products Grid', 'coming-soon' ),
|
449 |
+
'is_pro' => true,
|
450 |
+
'cat' => 'wc',
|
451 |
+
'type' => 'wccustomproductsgrid',
|
452 |
+
'id' => 37,
|
453 |
+
'icon' => '
|
454 |
+
<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
455 |
+
<path d="M16.44 8.50999H23.65V11.39H16.44V8.50999ZM16.44 18.61H23.65V21.49H16.44V18.61ZM25.1 1.99999H4.9C4.5188 1.99867 4.1411 2.07277 3.78866 2.21804C3.43622 2.36332 3.116 2.57688 2.84645 2.84643C2.57689 3.11598 2.36333 3.4362 2.21806 3.78864C2.07279 4.14108 1.99868 4.51878 2 4.89999V25.1C1.99868 25.4812 2.07279 25.8589 2.21806 26.2113C2.36333 26.5638 2.57689 26.884 2.84645 27.1535C3.116 27.4231 3.43622 27.6367 3.78866 27.7819C4.1411 27.9272 4.5188 28.0013 4.9 28H25.1C25.4812 28.0013 25.8589 27.9272 26.2113 27.7819C26.5638 27.6367 26.884 27.4231 27.1536 27.1535C27.4231 26.884 27.6367 26.5638 27.7819 26.2113C27.9272 25.8589 28.0013 25.4812 28 25.1V4.89999C28.0013 4.51878 27.9272 4.14108 27.7819 3.78864C27.6367 3.4362 27.4231 3.11598 27.1536 2.84643C26.884 2.57688 26.5638 2.36332 26.2113 2.21804C25.8589 2.07277 25.4812 1.99867 25.1 1.99999ZM25.1 25.08H4.9V4.89999H25.1V25.08ZM13.56 6.34999H6.35V13.56H13.56V6.34999ZM12.12 12.12H7.79V7.78999H12.12V12.12ZM13.56 16.44H6.35V23.65H13.56V16.44ZM12.12 22.21H7.79V17.88H12.12V22.21Z" />
|
456 |
+
</svg>',
|
457 |
+
),
|
458 |
+
|
459 |
+
array(
|
460 |
+
'name' => __( 'Recent Products', 'coming-soon' ),
|
461 |
+
'is_pro' => true,
|
462 |
+
'cat' => 'wc',
|
463 |
+
'type' => 'wcrecentproductsgrid',
|
464 |
+
'id' => 42,
|
465 |
+
'icon' => '<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
466 |
+
<path d="M13.56 9.23V16.44L19.69 20.08L20.8 18.23L15.72 15.23V9.23H13.56ZM28 12.12V2L24.17 5.83C22.0377 3.70809 19.2355 2.39134 16.2411 2.10417C13.2467 1.817 10.2453 2.57719 7.74859 4.25518C5.25189 5.93316 3.41438 8.42507 2.54927 11.3062C1.68416 14.1873 1.84499 17.2792 3.00434 20.055C4.1637 22.8308 6.24982 25.1186 8.90714 26.5285C11.5645 27.9384 14.6285 28.3831 17.577 27.7868C20.5255 27.1906 23.1759 25.5902 25.0765 23.2585C26.9772 20.9268 28.0104 18.0082 28 15H25.1C25.111 17.3387 24.3109 19.6088 22.8359 21.4237C21.361 23.2387 19.3024 24.4861 17.0109 24.9536C14.7195 25.421 12.3368 25.0796 10.2688 23.9875C8.20076 22.8953 6.57536 21.1199 5.66944 18.9639C4.76351 16.8078 4.6331 14.4043 5.30043 12.1628C5.96775 9.92135 7.39152 7.98057 9.32922 6.67107C11.2669 5.36156 13.5987 4.76434 15.9273 4.98113C18.2559 5.19792 20.4373 6.21531 22.1 7.86L17.84 12.12H28Z" />
|
467 |
+
</svg>',
|
468 |
+
),
|
469 |
+
|
470 |
+
array(
|
471 |
+
'name' => __( 'Sale Products', 'coming-soon' ),
|
472 |
+
'is_pro' => true,
|
473 |
+
'cat' => 'wc',
|
474 |
+
'type' => 'wcsaleproductsgrid',
|
475 |
+
'id' => 40,
|
476 |
+
'icon' => '
|
477 |
+
<svg class="sp-w-6 sp-fill-current " viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
478 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 4.3C17.1163 4.3 19.185 4.92754 20.9446 6.10328C22.7042 7.27901 24.0757 8.95012 24.8855 10.9053C25.6954 12.8605 25.9073 15.0119 25.4944 17.0875C25.0815 19.1631 24.0625 21.0696 22.566 22.566C21.0696 24.0625 19.1631 25.0815 17.0875 25.4944C15.0119 25.9073 12.8605 25.6954 10.9053 24.8855C8.95012 24.0757 7.27901 22.7042 6.10328 20.9446C4.92755 19.185 4.30001 17.1163 4.30001 15C4.30265 12.163 5.43082 9.44295 7.43689 7.43688C9.44295 5.43082 12.163 4.30265 15 4.3ZM15 2C12.4288 2 9.91543 2.76244 7.77759 4.1909C5.63975 5.61935 3.97351 7.64968 2.98957 10.0251C2.00563 12.4006 1.74819 15.0144 2.2498 17.5362C2.75141 20.0579 3.98953 22.3743 5.80762 24.1924C7.6257 26.0105 9.94208 27.2486 12.4638 27.7502C14.9856 28.2518 17.5995 27.9944 19.9749 27.0104C22.3503 26.0265 24.3807 24.3603 25.8091 22.2224C27.2376 20.0846 28 17.5712 28 15C28 11.5522 26.6304 8.24558 24.1924 5.80761C21.7544 3.36964 18.4478 2 15 2ZM6.23 17.16V15.91C6.44916 16.0962 6.69975 16.2418 6.97 16.34C7.22889 16.4379 7.50322 16.4887 7.78 16.49C7.91827 16.4914 8.05611 16.4745 8.19 16.44C8.29585 16.4165 8.39717 16.376 8.49 16.32C8.56399 16.2758 8.62584 16.214 8.67 16.14C8.7216 16.065 8.74923 15.9761 8.74923 15.885C8.74923 15.7939 8.7216 15.705 8.67 15.63C8.60472 15.5331 8.51948 15.4513 8.42 15.39C8.2992 15.3041 8.1682 15.2336 8.03 15.18L7.55 14.97C7.16689 14.8318 6.82353 14.6018 6.55 14.3C6.3687 14.0587 6.25934 13.771 6.23457 13.4702C6.2098 13.1694 6.27062 12.8677 6.41 12.6C6.51312 12.3853 6.67199 12.2023 6.87 12.07C7.0811 11.9245 7.31906 11.8225 7.57 11.77C7.84529 11.7048 8.12711 11.6713 8.41 11.67C8.67124 11.6677 8.93219 11.6878 9.19 11.73C9.40179 11.7611 9.60964 11.8147 9.81 11.89V13.07C9.71588 12.998 9.61135 12.9406 9.5 12.9C9.39086 12.8464 9.27705 12.8029 9.16 12.77L8.81 12.7C8.70022 12.6903 8.58979 12.6903 8.48 12.7C8.35048 12.6842 8.21952 12.6842 8.09 12.7C7.98376 12.7166 7.88182 12.754 7.79 12.81C7.71602 12.8542 7.65416 12.916 7.61 12.99C7.56303 13.0574 7.53854 13.1379 7.54 13.22C7.53564 13.3087 7.56021 13.3965 7.61 13.47C7.66638 13.5552 7.73749 13.6297 7.82 13.69C7.92967 13.7597 8.04318 13.8231 8.16 13.88L8.6 14.08C8.80768 14.1638 9.00832 14.2642 9.2 14.38C9.36895 14.4746 9.52379 14.5924 9.66 14.73C9.78755 14.8615 9.88631 15.0182 9.95 15.19C10.0221 15.3816 10.0561 15.5854 10.05 15.79C10.0624 16.0604 10.0038 16.3293 9.88 16.57C9.76295 16.7818 9.59443 16.9606 9.39 17.09C9.17547 17.2248 8.93832 17.3197 8.69 17.37C8.40743 17.431 8.11908 17.4612 7.83 17.46C7.53817 17.46 7.24695 17.4332 6.96 17.38C6.70689 17.3443 6.46072 17.2701 6.23 17.16ZM14.53 17.38H15.9L13.88 11.78H12.38L10.38 17.38H11.73L12.13 16.13H14.13L14.53 17.38ZM13.24 13.28L13.84 15.16H12.44L13.05 13.27C13.0984 13.1106 13.1286 12.9462 13.14 12.78C13.1539 12.95 13.1875 13.1177 13.24 13.28ZM19.94 17.38H16.6V11.78H17.86V16.36H19.94V17.38ZM20.69 17.38H24.08V16.36H21.95V15.07H23.76V14.07H21.92V12.78H23.92V11.78H20.69V17.38Z" />
|
479 |
+
</svg>',
|
480 |
+
),
|
481 |
+
|
482 |
+
array(
|
483 |
+
'name' => __( 'Best Selling Products', 'coming-soon' ),
|
484 |
+
'is_pro' => true,
|
485 |
+
'cat' => 'wc',
|
486 |
+
'type' => 'wcbestsellingproductsgrid',
|
487 |
+
'id' => 41,
|
488 |
+
'icon' => '
|
489 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"/></svg> ',
|
490 |
+
),
|
491 |
+
|
492 |
+
array(
|
493 |
+
'name' => __( 'Featured Products', 'coming-soon' ),
|
494 |
+
'is_pro' => true,
|
495 |
+
'cat' => 'wc',
|
496 |
+
'type' => 'wcfeaturedproductsgrid',
|
497 |
+
'id' => 39,
|
498 |
+
'icon' => ' <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" viewBox="0 0 24 24" class="sp-w-6 sp-fill-current "><rect fill="none" height="24" width="24"/><path d="M19,5h-2V3H7v2H5C3.9,5,3,5.9,3,7v1c0,2.55,1.92,4.63,4.39,4.94c0.63,1.5,1.98,2.63,3.61,2.96V19H7v2h10v-2h-4v-3.1 c1.63-0.33,2.98-1.46,3.61-2.96C19.08,12.63,21,10.55,21,8V7C21,5.9,20.1,5,19,5z M5,8V7h2v3.82C5.84,10.4,5,9.3,5,8z M12,14 c-1.65,0-3-1.35-3-3V5h6v6C15,12.65,13.65,14,12,14z M19,8c0,1.3-0.84,2.4-2,2.82V7h2V8z"/></svg>',
|
499 |
+
),
|
500 |
+
|
501 |
+
array(
|
502 |
+
'name' => __( 'Top Rated Products', 'coming-soon' ),
|
503 |
+
'is_pro' => true,
|
504 |
+
'cat' => 'wc',
|
505 |
+
'type' => 'wctopratedproductsgrid',
|
506 |
+
'id' => 43,
|
507 |
+
'icon' => '
|
508 |
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" class="sp-w-6 sp-fill-current " viewBox="0 0 24 24" ><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M17,10.43V2H7v8.43c0,0.35,0.18,0.68,0.49,0.86l4.18,2.51l-0.99,2.34l-3.41,0.29l2.59,2.24L9.07,22L12,20.23L14.93,22 l-0.78-3.33l2.59-2.24l-3.41-0.29l-0.99-2.34l4.18-2.51C16.82,11.11,17,10.79,17,10.43z M11,11.07l-2-1.2V4h2V11.07z M15,9.87 l-2,1.2V4h2V9.87z"/></g></g></svg>',
|
509 |
+
),
|
510 |
+
|
511 |
+
);
|
512 |
+
|
513 |
+
return $block_options;
|
514 |
}
|
515 |
|
516 |
|
517 |
/**
|
518 |
* Get times
|
519 |
*/
|
520 |
+
function seedprod_lite_get_default_timezone() {
|
521 |
+
$general_settings = get_option( 'seedprod_settings' );
|
522 |
+
$timezone = 'UTC';
|
523 |
+
|
524 |
+
if ( ! empty( $general_settings ) ) {
|
525 |
+
$general_settings = json_decode( $general_settings );
|
526 |
+
if ( ! empty( $general_settings->default_timezone ) ) {
|
527 |
+
$timezone = $general_settings->default_timezone;
|
528 |
+
}
|
529 |
+
}
|
530 |
+
|
531 |
+
return $timezone;
|
|
|
532 |
}
|
533 |
|
534 |
|
536 |
/**
|
537 |
* Get times
|
538 |
*/
|
539 |
+
function seedprod_lite_get_times() {
|
540 |
+
$times = array();
|
541 |
+
$times[] = array(
|
542 |
+
'v' => '',
|
543 |
+
'l' => __( 'Select Time', 'coming-soon' ),
|
544 |
+
);
|
545 |
+
$times[] = array(
|
546 |
+
'v' => '00:00',
|
547 |
+
'l' => '12:00 A.M.',
|
548 |
+
);
|
549 |
+
$times[] = array(
|
550 |
+
'v' => '00:30',
|
551 |
+
'l' => '12:30 A.M.',
|
552 |
+
);
|
553 |
+
$times[] = array(
|
554 |
+
'v' => '01:00',
|
555 |
+
'l' => '1:00 A.M.',
|
556 |
+
);
|
557 |
+
$times[] = array(
|
558 |
+
'v' => '01:30',
|
559 |
+
'l' => '1:30 A.M.',
|
560 |
+
);
|
561 |
+
$times[] = array(
|
562 |
+
'v' => '02:00',
|
563 |
+
'l' => '2:00 A.M.',
|
564 |
+
);
|
565 |
+
$times[] = array(
|
566 |
+
'v' => '02:30',
|
567 |
+
'l' => '2:30 A.M.',
|
568 |
+
);
|
569 |
+
$times[] = array(
|
570 |
+
'v' => '03:00',
|
571 |
+
'l' => '3:00 A.M.',
|
572 |
+
);
|
573 |
+
$times[] = array(
|
574 |
+
'v' => '03:30',
|
575 |
+
'l' => '3:30 A.M.',
|
576 |
+
);
|
577 |
+
$times[] = array(
|
578 |
+
'v' => '04:00',
|
579 |
+
'l' => '4:00 A.M.',
|
580 |
+
);
|
581 |
+
$times[] = array(
|
582 |
+
'v' => '04:30',
|
583 |
+
'l' => '4:30 A.M.',
|
584 |
+
);
|
585 |
+
$times[] = array(
|
586 |
+
'v' => '05:00',
|
587 |
+
'l' => '5:00 A.M.',
|
588 |
+
);
|
589 |
+
$times[] = array(
|
590 |
+
'v' => '05:30',
|
591 |
+
'l' => '5:30 A.M.',
|
592 |
+
);
|
593 |
+
$times[] = array(
|
594 |
+
'v' => '06:00',
|
595 |
+
'l' => '6:00 A.M.',
|
596 |
+
);
|
597 |
+
$times[] = array(
|
598 |
+
'v' => '06:30',
|
599 |
+
'l' => '6:30 A.M.',
|
600 |
+
);
|
601 |
+
$times[] = array(
|
602 |
+
'v' => '07:00',
|
603 |
+
'l' => '7:00 A.M.',
|
604 |
+
);
|
605 |
+
$times[] = array(
|
606 |
+
'v' => '07:30',
|
607 |
+
'l' => '7:30 A.M.',
|
608 |
+
);
|
609 |
+
$times[] = array(
|
610 |
+
'v' => '08:00',
|
611 |
+
'l' => '8:00 A.M.',
|
612 |
+
);
|
613 |
+
$times[] = array(
|
614 |
+
'v' => '08:30',
|
615 |
+
'l' => '8:30 A.M.',
|
616 |
+
);
|
617 |
+
$times[] = array(
|
618 |
+
'v' => '09:00',
|
619 |
+
'l' => '9:00 A.M.',
|
620 |
+
);
|
621 |
+
$times[] = array(
|
622 |
+
'v' => '09:30',
|
623 |
+
'l' => '9:30 A.M.',
|
624 |
+
);
|
625 |
+
$times[] = array(
|
626 |
+
'v' => '10:00',
|
627 |
+
'l' => '10:00 A.M.',
|
628 |
+
);
|
629 |
+
$times[] = array(
|
630 |
+
'v' => '10:30',
|
631 |
+
'l' => '10:30 A.M.',
|
632 |
+
);
|
633 |
+
$times[] = array(
|
634 |
+
'v' => '11:00',
|
635 |
+
'l' => '11:00 A.M.',
|
636 |
+
);
|
637 |
+
$times[] = array(
|
638 |
+
'v' => '11:30',
|
639 |
+
'l' => '11:30 A.M.',
|
640 |
+
);
|
641 |
+
$times[] = array(
|
642 |
+
'v' => '12:00',
|
643 |
+
'l' => '12:00 P.M.',
|
644 |
+
);
|
645 |
+
$times[] = array(
|
646 |
+
'v' => '12:30',
|
647 |
+
'l' => '12:30 P.M.',
|
648 |
+
);
|
649 |
+
$times[] = array(
|
650 |
+
'v' => '13:00',
|
651 |
+
'l' => '1:00 P.M.',
|
652 |
+
);
|
653 |
+
$times[] = array(
|
654 |
+
'v' => '13:30',
|
655 |
+
'l' => '1:30 P.M.',
|
656 |
+
);
|
657 |
+
$times[] = array(
|
658 |
+
'v' => '14:00',
|
659 |
+
'l' => '2:00 P.M.',
|
660 |
+
);
|
661 |
+
$times[] = array(
|
662 |
+
'v' => '14:30',
|
663 |
+
'l' => '2:30 P.M.',
|
664 |
+
);
|
665 |
+
$times[] = array(
|
666 |
+
'v' => '15:00',
|
667 |
+
'l' => '3:00 P.M.',
|
668 |
+
);
|
669 |
+
$times[] = array(
|
670 |
+
'v' => '15:30',
|
671 |
+
'l' => '3:30 P.M.',
|
672 |
+
);
|
673 |
+
$times[] = array(
|
674 |
+
'v' => '16:00',
|
675 |
+
'l' => '4:00 P.M.',
|
676 |
+
);
|
677 |
+
$times[] = array(
|
678 |
+
'v' => '16:30',
|
679 |
+
'l' => '4:30 P.M.',
|
680 |
+
);
|
681 |
+
$times[] = array(
|
682 |
+
'v' => '17:00',
|
683 |
+
'l' => '5:00 P.M.',
|
684 |
+
);
|
685 |
+
$times[] = array(
|
686 |
+
'v' => '17:30',
|
687 |
+
'l' => '5:30 P.M.',
|
688 |
+
);
|
689 |
+
$times[] = array(
|
690 |
+
'v' => '18:00',
|
691 |
+
'l' => '6:00 P.M.',
|
692 |
+
);
|
693 |
+
$times[] = array(
|
694 |
+
'v' => '18:30',
|
695 |
+
'l' => '6:30 P.M.',
|
696 |
+
);
|
697 |
+
$times[] = array(
|
698 |
+
'v' => '19:00',
|
699 |
+
'l' => '7:00 P.M.',
|
700 |
+
);
|
701 |
+
$times[] = array(
|
702 |
+
'v' => '19:30',
|
703 |
+
'l' => '7:30 P.M.',
|
704 |
+
);
|
705 |
+
$times[] = array(
|
706 |
+
'v' => '20:00',
|
707 |
+
'l' => '8:00 P.M.',
|
708 |
+
);
|
709 |
+
$times[] = array(
|
710 |
+
'v' => '20:30',
|
711 |
+
'l' => '8:30 P.M.',
|
712 |
+
);
|
713 |
+
$times[] = array(
|
714 |
+
'v' => '21:00',
|
715 |
+
'l' => '9:00 P.M.',
|
716 |
+
);
|
717 |
+
$times[] = array(
|
718 |
+
'v' => '21:30',
|
719 |
+
'l' => '9:30 P.M.',
|
720 |
+
);
|
721 |
+
$times[] = array(
|
722 |
+
'v' => '22:00',
|
723 |
+
'l' => '10:00 P.M.',
|
724 |
+
);
|
725 |
+
$times[] = array(
|
726 |
+
'v' => '22:30',
|
727 |
+
'l' => '10:30 P.M.',
|
728 |
+
);
|
729 |
+
$times[] = array(
|
730 |
+
'v' => '23:00',
|
731 |
+
'l' => '11:00 P.M.',
|
732 |
+
);
|
733 |
+
$times[] = array(
|
734 |
+
'v' => '23:30',
|
735 |
+
'l' => '11:30 P.M.',
|
736 |
+
);
|
737 |
+
|
738 |
+
return $times;
|
739 |
}
|
740 |
|
741 |
/**
|
742 |
* Check per
|
743 |
*/
|
744 |
+
function seedprod_lite_get_api_key() {
|
745 |
+
$seedprod_api_key = '';
|
|
|
746 |
|
747 |
+
if ( defined( 'SEEDPROD_API_KEY' ) ) {
|
748 |
+
$seedprod_api_key = SEEDPROD_API_KEY;
|
749 |
+
}
|
750 |
|
751 |
+
if ( empty( $seedprod_api_key ) ) {
|
752 |
+
$seedprod_api_key = get_option( 'seedprod_api_key ' );
|
753 |
+
}
|
754 |
|
755 |
+
return $seedprod_api_key;
|
756 |
}
|
757 |
|
758 |
/**
|
759 |
* Get timezones
|
760 |
*/
|
761 |
+
function seedprod_lite_get_timezones() {
|
762 |
+
// timezones
|
763 |
+
$zonen = array();
|
764 |
+
$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' );
|
765 |
+
|
766 |
+
foreach ( timezone_identifiers_list() as $zone ) {
|
767 |
+
$zone = explode( '/', $zone );
|
768 |
+
if ( ! in_array( $zone[0], $continents ) ) {
|
769 |
+
continue;
|
770 |
+
}
|
771 |
+
|
772 |
+
// This determines what gets set and translated - we don't translate Etc/* strings here, they are done later
|
773 |
+
$exists = array(
|
774 |
+
0 => ( isset( $zone[0] ) && $zone[0] ),
|
775 |
+
1 => ( isset( $zone[1] ) && $zone[1] ),
|
776 |
+
2 => ( isset( $zone[2] ) && $zone[2] ),
|
777 |
+
);
|
778 |
+
$exists[3] = ( $exists[0] && 'Etc' !== $zone[0] );
|
779 |
+
$exists[4] = ( $exists[1] && $exists[3] );
|
780 |
+
$exists[5] = ( $exists[2] && $exists[3] );
|
781 |
+
|
782 |
+
$zonen[] = array(
|
783 |
+
'continent' => ( $exists[0] ? $zone[0] : '' ),
|
784 |
+
'city' => ( $exists[1] ? $zone[1] : '' ),
|
785 |
+
'subcity' => ( $exists[2] ? $zone[2] : '' ),
|
786 |
+
't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ),
|
787 |
+
't_city' => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
|
788 |
+
't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ),
|
789 |
+
);
|
790 |
+
}
|
791 |
+
usort( $zonen, '_wp_timezone_choice_usort_callback' );
|
792 |
+
|
793 |
+
$structure = array();
|
794 |
+
|
795 |
+
foreach ( $zonen as $key => $zone ) {
|
796 |
+
// Build value in an array to join later
|
797 |
+
$value = array( $zone['continent'] );
|
798 |
+
|
799 |
+
if ( empty( $zone['city'] ) ) {
|
800 |
+
// It's at the continent level (generally won't happen)
|
801 |
+
$display = $zone['t_continent'];
|
802 |
+
} else {
|
803 |
+
// It's inside a continent group
|
804 |
+
|
805 |
+
// Continent optgroup
|
806 |
+
if ( ! isset( $zonen[ $key - 1 ] ) || $zonen[ $key - 1 ]['continent'] !== $zone['continent'] ) {
|
807 |
+
$label = $zone['t_continent'];
|
808 |
+
//$structure[] = $label ;
|
809 |
+
}
|
810 |
+
|
811 |
+
// Add the city to the value
|
812 |
+
$value[] = $zone['city'];
|
813 |
+
|
814 |
+
// get offset
|
815 |
+
// $timezone = $label.'/'.str_replace(' ', '_', $zone['t_city']);
|
816 |
+
// $time = new \DateTime('now', new DateTimeZone($timezone));
|
817 |
+
// $timezoneOffset = $time->format('P');
|
818 |
+
|
819 |
+
$display = $zone['t_city'];
|
820 |
+
if ( ! empty( $zone['subcity'] ) ) {
|
821 |
+
// Add the subcity to the value
|
822 |
+
$value[] = $zone['subcity'];
|
823 |
+
$display .= ' - ' . $zone['t_subcity'];
|
824 |
+
}
|
825 |
+
}
|
826 |
+
|
827 |
+
// Build the value
|
828 |
+
$value = join( '/', $value );
|
829 |
+
|
830 |
+
// get offset
|
831 |
+
$time = new \DateTime( 'now', new DateTimeZone( $value ) );
|
832 |
+
$timezoneOffset = $time->format( 'P' );
|
833 |
+
$structure[ $label ][] = array(
|
834 |
+
'v' => $value,
|
835 |
+
'l' => $display . ' (' . $timezoneOffset . ' GMT)',
|
836 |
+
);
|
837 |
+
}
|
838 |
+
|
839 |
+
$structure['UTC'][] = array(
|
840 |
+
'v' => 'UTC',
|
841 |
+
'l' => 'UTC',
|
842 |
+
);
|
843 |
+
|
844 |
+
return $structure;
|
|
|
|
|
|
|
845 |
}
|
846 |
|
847 |
|
848 |
/**
|
849 |
* Add to array if value does not exist
|
850 |
*/
|
851 |
+
function seedprod_lite_array_add( $arr, $key, $value ) {
|
852 |
+
if ( ! array_key_exists( $key, $arr ) ) {
|
853 |
+
$arr[ $key ] = $value;
|
854 |
+
}
|
855 |
+
return $arr;
|
|
|
856 |
}
|
857 |
|
858 |
|
861 |
/**
|
862 |
* Check per
|
863 |
*/
|
864 |
+
function seedprod_lite_cu( $rper = null ) {
|
865 |
+
if ( ! empty( $rper ) ) {
|
866 |
+
$uper = explode( ',', get_option( 'seedprod_per' ) );
|
867 |
+
if ( in_array( $rper, $uper ) ) {
|
868 |
+
return true;
|
869 |
+
} else {
|
870 |
+
return false;
|
871 |
+
}
|
872 |
+
} else {
|
873 |
+
$a = get_option( 'seedprod_a' );
|
874 |
+
if ( $a ) {
|
875 |
+
return true;
|
876 |
+
} else {
|
877 |
+
return false;
|
878 |
+
}
|
879 |
+
}
|
|
|
880 |
}
|
881 |
|
882 |
|
883 |
+
function seedprod_lite_upgrade_link( $medium = 'link' ) {
|
884 |
+
return apply_filters( 'seedprod_lite_upgrade_link', 'https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=' . sanitize_key( apply_filters( 'seedprod_lite_upgrade_link_medium', $medium ) ) );
|
|
|
885 |
}
|
886 |
|
887 |
|
888 |
+
function seedprod_lite_disable_admin_notices() {
|
889 |
+
global $wp_filter;
|
890 |
+
if ( is_user_admin() ) {
|
891 |
+
if ( isset( $wp_filter['user_admin_notices'] ) ) {
|
892 |
+
unset( $wp_filter['user_admin_notices'] );
|
893 |
+
}
|
894 |
+
} elseif ( isset( $wp_filter['admin_notices'] ) ) {
|
895 |
+
unset( $wp_filter['admin_notices'] );
|
896 |
+
}
|
897 |
+
if ( isset( $wp_filter['all_admin_notices'] ) ) {
|
898 |
+
unset( $wp_filter['all_admin_notices'] );
|
899 |
+
}
|
|
|
900 |
}
|
901 |
+
if ( ! empty( $_GET['page'] ) && strpos( $_GET['page'], 'seedprod' ) !== false ) {
|
902 |
+
add_action( 'admin_print_scripts', 'seedprod_lite_disable_admin_notices' );
|
903 |
}
|
904 |
|
905 |
|
906 |
+
function seedprod_lite_plugin_nonce() {
|
907 |
+
check_ajax_referer( 'seedprod_lite_plugin_nonce', 'nonce' );
|
|
|
908 |
|
909 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
910 |
+
wp_send_json_error();
|
911 |
+
}
|
912 |
|
913 |
+
$install_plugin_nonce = wp_create_nonce( 'install-plugin_' . sanitize_text_field( $_POST['plugin'] ) );
|
914 |
+
|
915 |
+
wp_send_json( $install_plugin_nonce );
|
916 |
}
|
917 |
|
918 |
+
function seedprod_lite_is_dev_url( $url = '' ) {
|
919 |
+
$is_local_url = false;
|
920 |
+
// Trim it up
|
921 |
+
$url = strtolower( trim( $url ) );
|
922 |
+
// Need to get the host...so let's add the scheme so we can use parse_url
|
923 |
+
if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) {
|
924 |
+
$url = 'http://' . $url;
|
925 |
+
}
|
926 |
+
$url_parts = parse_url( $url );
|
927 |
+
$host = ! empty( $url_parts['host'] ) ? $url_parts['host'] : false;
|
928 |
+
if ( ! empty( $url ) && ! empty( $host ) ) {
|
929 |
+
if ( false !== ip2long( $host ) ) {
|
930 |
+
if ( ! filter_var( $host, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) {
|
931 |
+
$is_local_url = true;
|
932 |
+
}
|
933 |
+
} elseif ( 'localhost' === $host ) {
|
934 |
+
$is_local_url = true;
|
935 |
+
}
|
936 |
+
|
937 |
+
$tlds_to_check = array( '.local', ':8888', ':8080', ':8081', '.invalid', '.example', '.test' );
|
938 |
+
foreach ( $tlds_to_check as $tld ) {
|
939 |
+
if ( false !== strpos( $host, $tld ) ) {
|
940 |
+
$is_local_url = true;
|
941 |
+
break;
|
942 |
+
}
|
943 |
+
}
|
944 |
+
if ( substr_count( $host, '.' ) > 1 ) {
|
945 |
+
$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
|
946 |
+
foreach ( $subdomains_to_check as $subdomain ) {
|
947 |
+
$subdomain = str_replace( '.', '(.)', $subdomain );
|
948 |
+
$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
|
949 |
+
if ( preg_match( '/^(' . $subdomain . ')/', $host ) ) {
|
950 |
+
$is_local_url = true;
|
951 |
+
break;
|
952 |
+
}
|
953 |
+
}
|
954 |
+
}
|
955 |
+
}
|
956 |
+
return $is_local_url;
|
|
|
957 |
}
|
958 |
|
959 |
|
960 |
+
function seedprod_lite_find_fonts_in_doc( $someArray ) {
|
961 |
+
if ( empty( $someArray ) ) {
|
962 |
+
return false;
|
963 |
+
}
|
964 |
+
$load_fonts = array();
|
965 |
+
$load_variants = array();
|
966 |
+
$iterator = new RecursiveIteratorIterator( new RecursiveArrayIterator( $someArray ), RecursiveIteratorIterator::SELF_FIRST );
|
967 |
+
foreach ( $iterator as $k => $v ) {
|
968 |
+
$indent = str_repeat( ' ', 10 * $iterator->getDepth() );
|
969 |
+
// Not at end: show key only
|
970 |
+
if ( $iterator->hasChildren() ) {
|
971 |
+
//echo "$indent$k :<br>";
|
972 |
+
// At end: show key, value and path
|
973 |
+
} else {
|
974 |
+
for ( $p = array(), $i = 0, $z = $iterator->getDepth(); $i <= $z; $i++ ) {
|
975 |
+
$p[] = $iterator->getSubIterator( $i )->key();
|
976 |
+
}
|
977 |
+
$path = implode( ',', $p );
|
978 |
+
//echo "$indent$k : $v : path -> $path<br>";
|
979 |
+
// get font
|
980 |
+
if ( stripos( $k, 'font' ) !== false && stripos( $k, 'variant' ) === false && ! empty( $v ) && strpos( $v, ',' ) === false && stripos( $k, 'fontSize' ) === false ) {
|
981 |
+
$load_fonts[] = array(
|
982 |
+
'k' => $k,
|
983 |
+
'v' => $v,
|
984 |
+
'p' => $path,
|
985 |
+
);
|
986 |
+
}
|
987 |
+
// get variant
|
988 |
+
if ( stripos( $k, 'font' ) !== false && stripos( $k, 'variant' ) !== false && ! empty( $v ) && strpos( $v, ',' ) === false ) {
|
989 |
+
$load_variants[] = array(
|
990 |
+
'k' => $k,
|
991 |
+
'v' => $v,
|
992 |
+
'p' => $path,
|
993 |
+
);
|
994 |
+
}
|
995 |
+
}
|
996 |
+
}
|
997 |
+
return array_merge( $load_fonts, $load_variants );
|
998 |
}
|
999 |
|
1000 |
+
function seedprod_lite_construct_font_str( $doc_settings ) {
|
1001 |
+
$fonts = seedprod_lite_find_fonts_in_doc( $doc_settings );
|
1002 |
+
$myfonts = array();
|
1003 |
+
$myvariants = array();
|
1004 |
+
if ( ! empty( $fonts ) ) {
|
1005 |
+
foreach ( $fonts as $k => $v ) {
|
1006 |
+
if ( stripos( $v['k'], 'font' ) !== false && stripos( $v['k'], 'variant' ) === false ) {
|
1007 |
+
if ( empty( $myfonts[ $v['v'] ] ) ) {
|
1008 |
+
$myfonts[ $v['v'] ] = array();
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
foreach ( $fonts as $k2 => $v2 ) {
|
1012 |
+
if ( $v['p'] . 'Variant' === $v2['p'] ) {
|
1013 |
+
$myfonts[ $v['v'] ][] = $v2['v'];
|
1014 |
+
}
|
1015 |
+
}
|
1016 |
+
}
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
foreach ( $myfonts as $k3 => $v3 ) {
|
1020 |
+
$myfonts[ $k3 ] = array_unique( $v3 );
|
1021 |
+
}
|
1022 |
+
}
|
1023 |
+
$google_fonts_str = '';
|
1024 |
+
if ( ! empty( $myfonts ) ) {
|
1025 |
+
$google_fonts_str = 'https://fonts.googleapis.com/css?family=';
|
1026 |
+
$c = 1;
|
1027 |
+
foreach ( $myfonts as $k4 => $v4 ) {
|
1028 |
+
$end = '|';
|
1029 |
+
if ( count( $myfonts ) == $c ) {
|
1030 |
+
$end = '';
|
1031 |
+
}
|
1032 |
+
$google_fonts_str .= urlencode( $k4 );
|
1033 |
+
if ( ! empty( $v4 ) ) {
|
1034 |
+
$google_fonts_str .= ':' . implode( ',', $v4 );
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
$google_fonts_str .= $end;
|
1038 |
+
$c++;
|
1039 |
+
}
|
1040 |
+
$google_fonts_str .= '&display=swap';
|
1041 |
+
}
|
1042 |
+
return $google_fonts_str;
|
1043 |
}
|
1044 |
|
1045 |
|
1046 |
+
add_filter( '_wp_post_revision_fields', 'seedprod_lite_wp_post_revision_fields', 11, 2 );
|
1047 |
+
function seedprod_lite_wp_post_revision_fields( $fields, $post ) {
|
1048 |
+
if ( ! empty( $post['post_content_filtered'] ) && strpos( $post['post_content'], 'sp-page' ) !== false ) {
|
1049 |
+
$fields['post_content_filtered'] = 'Content Filtered';
|
1050 |
+
return $fields;
|
1051 |
+
} else {
|
1052 |
+
return $fields;
|
1053 |
+
}
|
1054 |
}
|
1055 |
|
1056 |
|
1057 |
add_filter( 'page_row_actions', 'seedprod_lite_filter_page_row_actions', 11, 2 );
|
1058 |
function seedprod_lite_filter_page_row_actions( $actions, $post ) {
|
1059 |
+
$has_settings = get_post_meta( $post->ID, '_seedprod_page', true );
|
1060 |
+
if ( ! empty( $has_settings ) ) {
|
1061 |
+
$id = $post->ID;
|
1062 |
+
$actions['edit_seedprod'] = sprintf(
|
1063 |
+
'<a href="%1$s">%2$s</a>',
|
1064 |
+
admin_url() . 'admin.php?page=seedprod_lite_builder&id=' . $id . '#/setup/' . $id,
|
1065 |
+
__( 'Edit with SeedProd', 'seedprod' )
|
1066 |
+
);
|
1067 |
+
// unset($actions['inline hide-if-no-js']);
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
return $actions;
|
1071 |
}
|
1072 |
|
1073 |
//add_filter( 'get_edit_post_link', 'seedprod_lite_filter_get_edit_post_link', 11, 3 );
|
1074 |
function seedprod_lite_filter_get_edit_post_link( $link, $id, $context ) {
|
1075 |
+
$has_settings = get_post_meta( $id, '_seedprod_page', true );
|
1076 |
+
if ( ! empty( $has_settings ) ) {
|
1077 |
+
$link = admin_url() . 'admin.php?page=seedprod_lite_builder&id=' . $id . '#/setup/' . $id;
|
1078 |
+
}
|
1079 |
+
return $link;
|
1080 |
}
|
1081 |
|
1082 |
/**
|
1083 |
* Dismiss Settings Lite CTA
|
1084 |
*/
|
1085 |
+
function seedprod_lite_dismiss_settings_lite_cta() {
|
1086 |
+
if ( check_ajax_referer( 'seedprod_lite_dismiss_settings_lite_cta' ) ) {
|
1087 |
+
$_POST = stripslashes_deep( $_POST );
|
|
|
|
|
|
|
|
|
1088 |
|
1089 |
+
if ( ! empty( $_POST['dismiss'] ) ) {
|
1090 |
+
update_option( 'seedprod_dismiss_settings_lite_cta', true );
|
1091 |
|
1092 |
+
$response = array(
|
1093 |
+
'status' => 'true',
|
1094 |
|
1095 |
+
);
|
1096 |
+
}
|
1097 |
+
|
1098 |
+
// Send Response
|
1099 |
+
wp_send_json( $response );
|
1100 |
+
exit;
|
1101 |
+
}
|
1102 |
}
|
1103 |
|
1104 |
/**
|
1105 |
* Dismiss Lite Banners
|
1106 |
*/
|
1107 |
+
function seedprod_lite_dismiss_upsell() {
|
1108 |
+
if ( check_ajax_referer( 'seedprod_lite_dismiss_upsell' ) ) {
|
1109 |
+
$_POST = stripslashes_deep( $_POST );
|
1110 |
+
|
1111 |
+
if ( ! empty( $_POST['id'] ) ) {
|
1112 |
+
$ts = time();
|
1113 |
+
update_option( 'seedprod_dismiss_upsell_' . $_POST['id'], $ts );
|
1114 |
+
$response = array(
|
1115 |
+
'status' => 'true',
|
1116 |
+
|
1117 |
+
);
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
// Send Response
|
1121 |
+
wp_send_json( $response );
|
1122 |
+
exit;
|
1123 |
+
}
|
|
|
1124 |
}
|
1125 |
|
1126 |
+
function seedprod_lite_get_expire_times() {
|
1127 |
+
return array(
|
1128 |
+
'1' => '1 Hour',
|
1129 |
+
'2' => '2 Hours',
|
1130 |
+
'3' => '3 Hours',
|
1131 |
+
'4' => '4 Hours',
|
1132 |
+
'5' => '5 Hours',
|
1133 |
+
'6' => '6 Hours',
|
1134 |
+
'7' => '7 Hours',
|
1135 |
+
'8' => '8 Hours',
|
1136 |
+
'9' => '9 Hours',
|
1137 |
+
'10' => '10 Hours',
|
1138 |
+
'11' => '11 Hours',
|
1139 |
+
'12' => '12 Hours',
|
1140 |
+
'13' => '13 Hours',
|
1141 |
+
'14' => '14 Hours',
|
1142 |
+
'15' => '15 Hours',
|
1143 |
+
'16' => '16 Hours',
|
1144 |
+
'17' => '17 Hours',
|
1145 |
+
'18' => '18 Hours',
|
1146 |
+
'19' => '19 Hours',
|
1147 |
+
'20' => '20 Hours',
|
1148 |
+
'21' => '21 Hours',
|
1149 |
+
'21' => '22 Hours',
|
1150 |
+
'23' => '23 Hours',
|
1151 |
+
'24' => '1 Day',
|
1152 |
+
'48' => '2 Days',
|
1153 |
+
'72' => '3 Days',
|
1154 |
+
'96' => '4 Days',
|
1155 |
+
'120' => '5 Days',
|
1156 |
+
'144' => '6 Days',
|
1157 |
+
'168' => '7 Days',
|
1158 |
+
'192' => '8 Days',
|
1159 |
+
'216' => '9 Days',
|
1160 |
+
'240' => '10 Days',
|
1161 |
+
'264' => '11 Days',
|
1162 |
+
'288' => '12 Days',
|
1163 |
+
'312' => '13 Days',
|
1164 |
+
'336' => '14 Days',
|
1165 |
+
'360' => '15 Days',
|
1166 |
+
'384' => '16 Days',
|
1167 |
+
'408' => '17 Days',
|
1168 |
+
'432' => '18 Days',
|
1169 |
+
'456' => '19 Days',
|
1170 |
+
'480' => '20 Days',
|
1171 |
+
'504' => '21 Days',
|
1172 |
+
'528' => '22 Days',
|
1173 |
+
'552' => '23 Days',
|
1174 |
+
'576' => '24 Days',
|
1175 |
+
'600' => '25 Days',
|
1176 |
+
'624' => '26 Days',
|
1177 |
+
'648' => '27 Days',
|
1178 |
+
'672' => '28 Days',
|
1179 |
+
'696' => '29 Days',
|
1180 |
+
'720' => '30 Days',
|
1181 |
+
'8760' => '1 Year',
|
1182 |
+
);
|
1183 |
}
|
1184 |
|
1185 |
|
1186 |
|
1187 |
+
function seedprod_lite_get_system_info() {
|
1188 |
+
|
1189 |
+
global $wpdb;
|
1190 |
+
|
1191 |
+
// Get theme info.
|
1192 |
+
$theme_data = wp_get_theme();
|
1193 |
+
$theme = $theme_data->Name . ' ' . $theme_data->Version;
|
1194 |
+
|
1195 |
+
$return = '### Begin System Info ###' . "\n\n";
|
1196 |
+
|
1197 |
+
// WPForms info.
|
1198 |
+
$return .= '-- SeedProd Info' . "\n\n";
|
1199 |
+
|
1200 |
+
// Now the basics...
|
1201 |
+
$return .= "\n" . '-- Site Info' . "\n\n";
|
1202 |
+
$return .= 'Site URL: ' . site_url() . "\n";
|
1203 |
+
$return .= 'Home URL: ' . home_url() . "\n";
|
1204 |
+
$return .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
|
1205 |
+
|
1206 |
+
// WordPress configuration.
|
1207 |
+
$return .= "\n" . '-- WordPress Configuration' . "\n\n";
|
1208 |
+
$return .= 'Version: ' . get_bloginfo( 'version' ) . "\n";
|
1209 |
+
$return .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
|
1210 |
+
$return .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
|
1211 |
+
$return .= 'Active Theme: ' . $theme . "\n";
|
1212 |
+
$return .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n";
|
1213 |
+
// Only show page specs if front page is set to 'page'.
|
1214 |
+
if ( get_option( 'show_on_front' ) === 'page' ) {
|
1215 |
+
$front_page_id = get_option( 'page_on_front' );
|
1216 |
+
$blog_page_id = get_option( 'page_for_posts' );
|
1217 |
+
|
1218 |
+
$return .= 'Page On Front: ' . ( 0 != $front_page_id ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
|
1219 |
+
$return .= 'Page For Posts: ' . ( 0 != $blog_page_id ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
|
1220 |
+
}
|
1221 |
+
$return .= 'ABSPATH: ' . ABSPATH . "\n";
|
1222 |
+
$return .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
|
1223 |
+
$return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
|
1224 |
+
$return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n";
|
1225 |
+
$return .= 'Registered Post Stati: ' . implode( ', ', get_post_stati() ) . "\n";
|
1226 |
+
|
1227 |
+
// @todo WPForms configuration/specific details.
|
1228 |
+
$return .= "\n" . '-- WordPress Uploads/Constants' . "\n\n";
|
1229 |
+
$return .= 'WP_CONTENT_DIR: ' . ( defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR ? WP_CONTENT_DIR : 'Disabled' : 'Not set' ) . "\n";
|
1230 |
+
$return .= 'WP_CONTENT_URL: ' . ( defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL ? WP_CONTENT_URL : 'Disabled' : 'Not set' ) . "\n";
|
1231 |
+
$return .= 'UPLOADS: ' . ( defined( 'UPLOADS' ) ? UPLOADS ? UPLOADS : 'Disabled' : 'Not set' ) . "\n";
|
1232 |
+
|
1233 |
+
$uploads_dir = wp_upload_dir();
|
1234 |
+
|
1235 |
+
$return .= 'wp_uploads_dir() path: ' . $uploads_dir['path'] . "\n";
|
1236 |
+
$return .= 'wp_uploads_dir() url: ' . $uploads_dir['url'] . "\n";
|
1237 |
+
$return .= 'wp_uploads_dir() basedir: ' . $uploads_dir['basedir'] . "\n";
|
1238 |
+
$return .= 'wp_uploads_dir() baseurl: ' . $uploads_dir['baseurl'] . "\n";
|
1239 |
+
|
1240 |
+
// Get plugins that have an update.
|
1241 |
+
$updates = get_plugin_updates();
|
1242 |
+
|
1243 |
+
// Must-use plugins.
|
1244 |
+
// NOTE: MU plugins can't show updates!
|
1245 |
+
$muplugins = get_mu_plugins();
|
1246 |
+
if ( count( $muplugins ) > 0 && ! empty( $muplugins ) ) {
|
1247 |
+
$return .= "\n" . '-- Must-Use Plugins' . "\n\n";
|
1248 |
+
|
1249 |
+
foreach ( $muplugins as $plugin => $plugin_data ) {
|
1250 |
+
$return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
|
1251 |
+
}
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
// WordPress active plugins.
|
1255 |
+
$return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
|
1256 |
+
|
1257 |
+
$plugins = get_plugins();
|
1258 |
+
$active_plugins = get_option( 'active_plugins', array() );
|
1259 |
+
|
1260 |
+
foreach ( $plugins as $plugin_path => $plugin ) {
|
1261 |
+
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
|
1262 |
+
continue;
|
1263 |
+
}
|
1264 |
+
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
|
1265 |
+
$return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
|
1266 |
+
}
|
1267 |
+
|
1268 |
+
// WordPress inactive plugins.
|
1269 |
+
$return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
|
1270 |
+
|
1271 |
+
foreach ( $plugins as $plugin_path => $plugin ) {
|
1272 |
+
if ( in_array( $plugin_path, $active_plugins, true ) ) {
|
1273 |
+
continue;
|
1274 |
+
}
|
1275 |
+
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
|
1276 |
+
$return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
if ( is_multisite() ) {
|
1280 |
+
// WordPress Multisite active plugins.
|
1281 |
+
$return .= "\n" . '-- Network Active Plugins' . "\n\n";
|
1282 |
+
|
1283 |
+
$plugins = wp_get_active_network_plugins();
|
1284 |
+
$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
|
1285 |
+
|
1286 |
+
foreach ( $plugins as $plugin_path ) {
|
1287 |
+
$plugin_base = plugin_basename( $plugin_path );
|
1288 |
+
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
|
1289 |
+
continue;
|
1290 |
+
}
|
1291 |
+
$update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
|
1292 |
+
$plugin = get_plugin_data( $plugin_path );
|
1293 |
+
$return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
|
1294 |
+
}
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
// Server configuration (really just versions).
|
1298 |
+
$return .= "\n" . '-- Webserver Configuration' . "\n\n";
|
1299 |
+
$return .= 'PHP Version: ' . PHP_VERSION . "\n";
|
1300 |
+
$return .= 'MySQL Version: ' . $wpdb->db_version() . "\n";
|
1301 |
+
$return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
|
1302 |
+
|
1303 |
+
// PHP configs... now we're getting to the important stuff.
|
1304 |
+
$return .= "\n" . '-- PHP Configuration' . "\n\n";
|
1305 |
+
$return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n";
|
1306 |
+
$return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n";
|
1307 |
+
$return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n";
|
1308 |
+
$return .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n";
|
1309 |
+
$return .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n";
|
1310 |
+
$return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n";
|
1311 |
+
$return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
|
1312 |
+
|
1313 |
+
// PHP extensions and such.
|
1314 |
+
$return .= "\n" . '-- PHP Extensions' . "\n\n";
|
1315 |
+
$return .= 'cURL: ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
|
1316 |
+
$return .= 'fsockopen: ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
|
1317 |
+
$return .= 'SOAP Client: ' . ( class_exists( 'SoapClient', false ) ? 'Installed' : 'Not Installed' ) . "\n";
|
1318 |
+
$return .= 'Suhosin: ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
|
1319 |
+
|
1320 |
+
// Session stuff.
|
1321 |
+
$return .= "\n" . '-- Session Configuration' . "\n\n";
|
1322 |
+
$return .= 'Session: ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
|
1323 |
+
|
1324 |
+
// The rest of this is only relevant if session is enabled.
|
1325 |
+
if ( isset( $_SESSION ) ) {
|
1326 |
+
$return .= 'Session Name: ' . esc_html( ini_get( 'session.name' ) ) . "\n";
|
1327 |
+
$return .= 'Cookie Path: ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
|
1328 |
+
$return .= 'Save Path: ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
|
1329 |
+
$return .= 'Use Cookies: ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
|
1330 |
+
$return .= 'Use Only Cookies: ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
$return .= "\n" . '### End System Info ###';
|
1334 |
+
|
1335 |
+
return $return;
|
1336 |
}
|
1337 |
|
1338 |
/**
|
1339 |
* If site uses WP Rocket, disable minify for CSS & JS
|
1340 |
*/
|
1341 |
function seedprod_lite_wprocket_disable_minify() {
|
1342 |
+
if ( function_exists( 'rocket_define_donotminify_constants' ) ) {
|
1343 |
+
rocket_define_donotminify_constants( 'true' );
|
1344 |
+
}
|
1345 |
}
|
1346 |
+
|
1347 |
+
|
1348 |
+
|
1349 |
+
|
1350 |
+
|
app/includes/nameparse.php
CHANGED
@@ -20,244 +20,252 @@ Bugs: If one of the words in the middle name is Ben (or St., for that matter),
|
|
20 |
|
21 |
*/
|
22 |
|
23 |
-
function
|
24 |
-
return
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
$prefices = array('ben','bin','da','dal','de','del','der','de','e',
|
35 |
-
'la','le','san','st','ste','van','vel','von');
|
36 |
-
$suffices = array('esq','esquire','jr','sr','2','ii','iii','iv');
|
37 |
-
|
38 |
-
$pieces = explode(',',preg_replace('/\s+/',' ',trim($fullname)));
|
39 |
-
$n_pieces = count($pieces);
|
40 |
-
|
41 |
-
switch($n_pieces) {
|
42 |
-
case 1: // array(title first middles last suffix)
|
43 |
-
$subp = explode(' ',trim($pieces[0]));
|
44 |
-
$n_subp = count($subp);
|
45 |
-
for($i = 0; $i < $n_subp; $i++) {
|
46 |
-
$curr = trim($subp[$i]);
|
47 |
-
$next = trim(@$subp[$i+1]);
|
48 |
-
|
49 |
-
if($i == 0 && seedprod_lite_in_array_norm($curr,$titles)) {
|
50 |
-
$out['title'] = $curr;
|
51 |
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
|
|
|
|
|
|
53 |
|
54 |
-
if(
|
55 |
-
$out['
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
-
if(
|
60 |
-
$out['
|
|
|
|
|
|
|
|
|
61 |
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
|
|
|
|
63 |
|
64 |
-
if(
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
-
$out['suffix'] = $next;
|
72 |
-
break;
|
73 |
-
}
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
}
|
79 |
-
|
80 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
-
continue;
|
83 |
-
}
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
-
|
90 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
-
continue;
|
93 |
-
}
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
}
|
99 |
-
|
100 |
-
$out['
|
|
|
|
|
|
|
101 |
}
|
102 |
-
continue;
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
}
|
117 |
-
break;
|
118 |
-
case 2:
|
119 |
-
switch(seedprod_lite_in_array_norm($pieces[1],$suffices)) {
|
120 |
-
case TRUE: // array(title first middles last,suffix)
|
121 |
-
$subp = explode(' ',trim($pieces[0]));
|
122 |
-
$n_subp = count($subp);
|
123 |
-
for($i = 0; $i < $n_subp; $i++) {
|
124 |
-
$curr = trim($subp[$i]);
|
125 |
-
$next = trim($subp[$i+1]);
|
126 |
-
|
127 |
-
if($i == 0 && seedprod_lite_in_array_norm($curr,$titles)) {
|
128 |
-
$out['title'] = $curr;
|
129 |
-
continue;
|
130 |
-
}
|
131 |
-
|
132 |
-
if(!$out['first']) {
|
133 |
-
$out['first'] = $curr;
|
134 |
-
continue;
|
135 |
-
}
|
136 |
-
|
137 |
-
if($i == $n_subp-1) {
|
138 |
-
if($out['last']) {
|
139 |
-
$out['last'] .= " $curr";
|
140 |
-
}
|
141 |
-
else {
|
142 |
-
$out['last'] = $curr;
|
143 |
-
}
|
144 |
-
continue;
|
145 |
-
}
|
146 |
-
|
147 |
-
if(seedprod_lite_in_array_norm($curr,$prefices)) {
|
148 |
-
if($out['last']) {
|
149 |
-
$out['last'] .= " $curr";
|
150 |
-
}
|
151 |
-
else {
|
152 |
-
$out['last'] = $curr;
|
153 |
-
}
|
154 |
-
continue;
|
155 |
-
}
|
156 |
-
|
157 |
-
if($next == 'y' || $next == 'Y') {
|
158 |
-
if($out['last']) {
|
159 |
-
$out['last'] .= " $curr";
|
160 |
-
}
|
161 |
-
else {
|
162 |
-
$out['last'] = $curr;
|
163 |
-
}
|
164 |
-
continue;
|
165 |
-
}
|
166 |
-
|
167 |
-
if($out['last']) {
|
168 |
-
$out['last'] .= " $curr";
|
169 |
-
continue;
|
170 |
-
}
|
171 |
-
|
172 |
-
if($out['middle']) {
|
173 |
-
$out['middle'] .= " $curr";
|
174 |
-
}
|
175 |
-
else {
|
176 |
-
$out['middle'] = $curr;
|
177 |
-
}
|
178 |
}
|
179 |
-
|
180 |
-
break;
|
181 |
-
case FALSE: // array(last,title first middles suffix)
|
182 |
-
$subp = explode(' ',trim($pieces[1]));
|
183 |
-
$n_subp = count($subp);
|
184 |
-
for($i = 0; $i < $n_subp; $i++) {
|
185 |
-
$curr = trim($subp[$i]);
|
186 |
-
$next = trim($subp[$i+1]);
|
187 |
-
|
188 |
-
if($i == 0 && seedprod_lite_in_array_norm($curr,$titles)) {
|
189 |
-
$out['title'] = $curr;
|
190 |
-
continue;
|
191 |
-
}
|
192 |
-
|
193 |
-
if(!$out['first']) {
|
194 |
-
$out['first'] = $curr;
|
195 |
-
continue;
|
196 |
-
}
|
197 |
-
|
198 |
-
if($i == $n_subp-2 && $next &&
|
199 |
-
seedprod_lite_in_array_norm($next,$suffices)) {
|
200 |
-
if($out['middle']) {
|
201 |
-
$out['middle'] .= " $curr";
|
202 |
-
}
|
203 |
-
else {
|
204 |
-
$out['middle'] = $curr;
|
205 |
-
}
|
206 |
-
$out['suffix'] = $next;
|
207 |
break;
|
208 |
-
|
209 |
|
210 |
-
if($i == $n_subp-1 && seedprod_lite_in_array_norm($curr
|
211 |
-
$out['suffix']
|
212 |
continue;
|
213 |
-
|
214 |
|
215 |
-
if($out['middle']) {
|
216 |
-
$out['middle']
|
217 |
-
|
218 |
-
|
219 |
-
$out['middle'] = $curr;
|
220 |
-
}
|
221 |
}
|
222 |
-
$out['last'] = $pieces[0];
|
223 |
-
break;
|
224 |
}
|
225 |
-
|
|
|
|
|
|
|
226 |
break;
|
227 |
-
case
|
228 |
-
$subp
|
229 |
-
$n_subp
|
230 |
-
for($i = 0; $i < $n_subp; $i++) {
|
231 |
-
$curr
|
232 |
-
$next
|
233 |
-
if($i == 0 && seedprod_lite_in_array_norm($curr
|
234 |
-
$out['title']
|
235 |
continue;
|
236 |
-
|
237 |
|
238 |
-
if(
|
239 |
-
$out['first']
|
240 |
continue;
|
241 |
-
|
242 |
|
243 |
-
if($out['middle']) {
|
244 |
-
$out['middle']
|
245 |
-
|
246 |
-
|
247 |
-
$out['middle'] = $curr;
|
248 |
-
}
|
249 |
}
|
|
|
250 |
|
251 |
-
$out['last']
|
252 |
-
$out['suffix']
|
253 |
break;
|
254 |
-
default:
|
255 |
-
unset($pieces);
|
256 |
break;
|
257 |
-
|
258 |
|
259 |
return $out;
|
260 |
-
|
|
|
261 |
|
262 |
|
263 |
-
?>
|
20 |
|
21 |
*/
|
22 |
|
23 |
+
function seedprod_lite_norm_str( $string ) {
|
24 |
+
return trim(
|
25 |
+
strtolower(
|
26 |
+
str_replace( '.', '', $string )
|
27 |
+
)
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
function seedprod_lite_in_array_norm( $needle, $haystack ) {
|
32 |
+
return in_array( seedprod_lite_norm_str( $needle ), $haystack );
|
33 |
+
}
|
34 |
+
|
35 |
+
function seedprod_lite_parse_name( $fullname ) {
|
36 |
+
$titles = array( 'dr', 'miss', 'mr', 'mrs', 'ms', 'judge' );
|
37 |
+
$prefices = array(
|
38 |
+
'ben',
|
39 |
+
'bin',
|
40 |
+
'da',
|
41 |
+
'dal',
|
42 |
+
'de',
|
43 |
+
'del',
|
44 |
+
'der',
|
45 |
+
'de',
|
46 |
+
'e',
|
47 |
+
'la',
|
48 |
+
'le',
|
49 |
+
'san',
|
50 |
+
'st',
|
51 |
+
'ste',
|
52 |
+
'van',
|
53 |
+
'vel',
|
54 |
+
'von',
|
55 |
+
);
|
56 |
+
$suffices = array( 'esq', 'esquire', 'jr', 'sr', '2', 'ii', 'iii', 'iv' );
|
57 |
+
|
58 |
+
$pieces = explode( ',', preg_replace( '/\s+/', ' ', trim( $fullname ) ) );
|
59 |
+
$n_pieces = count( $pieces );
|
60 |
+
|
61 |
+
switch ( $n_pieces ) {
|
62 |
+
case 1: // array(title first middles last suffix)
|
63 |
+
$subp = explode( ' ', trim( $pieces[0] ) );
|
64 |
+
$n_subp = count( $subp );
|
65 |
+
for ( $i = 0; $i < $n_subp; $i++ ) {
|
66 |
+
$curr = trim( $subp[ $i ] );
|
67 |
+
$next = trim( @$subp[ $i + 1 ] );
|
68 |
+
|
69 |
+
if ( $i == 0 && seedprod_lite_in_array_norm( $curr, $titles ) ) {
|
70 |
+
$out['title'] = $curr;
|
71 |
+
continue;
|
72 |
+
}
|
73 |
|
74 |
+
if ( empty( $out ) ) {
|
75 |
+
$out['first'] = '';
|
76 |
+
$out['last'] = '';
|
77 |
+
}
|
78 |
|
79 |
+
if ( ! $out['first'] ) {
|
80 |
+
$out['first'] = $curr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
continue;
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( $i == $n_subp - 2 && $next && seedprod_lite_in_array_norm( $next, $suffices ) ) {
|
85 |
+
if ( $out['last'] ) {
|
86 |
+
$out['last'] .= " $curr";
|
87 |
+
} else {
|
88 |
+
$out['last'] = $curr;
|
89 |
}
|
90 |
+
$out['suffix'] = $next;
|
91 |
+
break;
|
92 |
+
}
|
93 |
|
94 |
+
if ( $i == $n_subp - 1 ) {
|
95 |
+
if ( $out['last'] ) {
|
96 |
+
$out['last'] .= " $curr";
|
97 |
+
} else {
|
98 |
+
$out['last'] = $curr;
|
99 |
+
}
|
100 |
+
continue;
|
101 |
}
|
102 |
|
103 |
+
if ( seedprod_lite_in_array_norm( $curr, $prefices ) ) {
|
104 |
+
if ( $out['last'] ) {
|
105 |
+
$out['last'] .= " $curr";
|
106 |
+
} else {
|
107 |
+
$out['last'] = $curr;
|
108 |
+
}
|
109 |
continue;
|
110 |
+
}
|
111 |
+
|
112 |
+
if ( $next == 'y' || $next == 'Y' ) {
|
113 |
+
if ( $out['last'] ) {
|
114 |
+
$out['last'] .= " $curr";
|
115 |
+
} else {
|
116 |
+
$out['last'] = $curr;
|
117 |
}
|
118 |
+
continue;
|
119 |
+
}
|
120 |
|
121 |
+
if ( $out['last'] ) {
|
122 |
+
$out['last'] .= " $curr";
|
123 |
+
continue;
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( $out['middle'] ) {
|
127 |
+
$out['middle'] .= " $curr";
|
128 |
+
} else {
|
129 |
+
$out['middle'] = $curr;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
break;
|
133 |
+
case 2:
|
134 |
+
switch ( seedprod_lite_in_array_norm( $pieces[1], $suffices ) ) {
|
135 |
+
case true: // array(title first middles last,suffix)
|
136 |
+
$subp = explode( ' ', trim( $pieces[0] ) );
|
137 |
+
$n_subp = count( $subp );
|
138 |
+
for ( $i = 0; $i < $n_subp; $i++ ) {
|
139 |
+
$curr = trim( $subp[ $i ] );
|
140 |
+
$next = trim( $subp[ $i + 1 ] );
|
141 |
+
|
142 |
+
if ( $i == 0 && seedprod_lite_in_array_norm( $curr, $titles ) ) {
|
143 |
+
$out['title'] = $curr;
|
144 |
+
continue;
|
145 |
}
|
|
|
|
|
|
|
146 |
|
147 |
+
if ( ! $out['first'] ) {
|
148 |
+
$out['first'] = $curr;
|
149 |
+
continue;
|
150 |
}
|
151 |
+
|
152 |
+
if ( $i == $n_subp - 1 ) {
|
153 |
+
if ( $out['last'] ) {
|
154 |
+
$out['last'] .= " $curr";
|
155 |
+
} else {
|
156 |
+
$out['last'] = $curr;
|
157 |
+
}
|
158 |
+
continue;
|
159 |
}
|
|
|
|
|
160 |
|
161 |
+
if ( seedprod_lite_in_array_norm( $curr, $prefices ) ) {
|
162 |
+
if ( $out['last'] ) {
|
163 |
+
$out['last'] .= " $curr";
|
164 |
+
} else {
|
165 |
+
$out['last'] = $curr;
|
166 |
+
}
|
167 |
+
continue;
|
168 |
}
|
169 |
+
|
170 |
+
if ( $next == 'y' || $next == 'Y' ) {
|
171 |
+
if ( $out['last'] ) {
|
172 |
+
$out['last'] .= " $curr";
|
173 |
+
} else {
|
174 |
+
$out['last'] = $curr;
|
175 |
+
}
|
176 |
+
continue;
|
177 |
}
|
|
|
|
|
178 |
|
179 |
+
if ( $out['last'] ) {
|
180 |
+
$out['last'] .= " $curr";
|
181 |
+
continue;
|
182 |
}
|
183 |
+
|
184 |
+
if ( $out['middle'] ) {
|
185 |
+
$out['middle'] .= " $curr";
|
186 |
+
} else {
|
187 |
+
$out['middle'] = $curr;
|
188 |
}
|
|
|
189 |
}
|
190 |
+
$out['suffix'] = trim( $pieces[1] );
|
191 |
+
break;
|
192 |
+
case false: // array(last,title first middles suffix)
|
193 |
+
$subp = explode( ' ', trim( $pieces[1] ) );
|
194 |
+
$n_subp = count( $subp );
|
195 |
+
for ( $i = 0; $i < $n_subp; $i++ ) {
|
196 |
+
$curr = trim( $subp[ $i ] );
|
197 |
+
$next = trim( $subp[ $i + 1 ] );
|
198 |
+
|
199 |
+
if ( $i == 0 && seedprod_lite_in_array_norm( $curr, $titles ) ) {
|
200 |
+
$out['title'] = $curr;
|
201 |
+
continue;
|
202 |
+
}
|
203 |
|
204 |
+
if ( ! $out['first'] ) {
|
205 |
+
$out['first'] = $curr;
|
206 |
+
continue;
|
207 |
+
}
|
208 |
|
209 |
+
if ( $i == $n_subp - 2 && $next &&
|
210 |
+
seedprod_lite_in_array_norm( $next, $suffices ) ) {
|
211 |
+
if ( $out['middle'] ) {
|
212 |
+
$out['middle'] .= " $curr";
|
213 |
+
} else {
|
214 |
+
$out['middle'] = $curr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
}
|
216 |
+
$out['suffix'] = $next;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
break;
|
218 |
+
}
|
219 |
|
220 |
+
if ( $i == $n_subp - 1 && seedprod_lite_in_array_norm( $curr, $suffices ) ) {
|
221 |
+
$out['suffix'] = $curr;
|
222 |
continue;
|
223 |
+
}
|
224 |
|
225 |
+
if ( $out['middle'] ) {
|
226 |
+
$out['middle'] .= " $curr";
|
227 |
+
} else {
|
228 |
+
$out['middle'] = $curr;
|
|
|
|
|
229 |
}
|
|
|
|
|
230 |
}
|
231 |
+
$out['last'] = $pieces[0];
|
232 |
+
break;
|
233 |
+
}
|
234 |
+
unset( $pieces );
|
235 |
break;
|
236 |
+
case 3: // array(last,title first middles,suffix)
|
237 |
+
$subp = explode( ' ', trim( $pieces[1] ) );
|
238 |
+
$n_subp = count( $subp );
|
239 |
+
for ( $i = 0; $i < $n_subp; $i++ ) {
|
240 |
+
$curr = trim( $subp[ $i ] );
|
241 |
+
$next = trim( $subp[ $i + 1 ] );
|
242 |
+
if ( $i == 0 && seedprod_lite_in_array_norm( $curr, $titles ) ) {
|
243 |
+
$out['title'] = $curr;
|
244 |
continue;
|
245 |
+
}
|
246 |
|
247 |
+
if ( ! $out['first'] ) {
|
248 |
+
$out['first'] = $curr;
|
249 |
continue;
|
250 |
+
}
|
251 |
|
252 |
+
if ( $out['middle'] ) {
|
253 |
+
$out['middle'] .= " $curr";
|
254 |
+
} else {
|
255 |
+
$out['middle'] = $curr;
|
|
|
|
|
256 |
}
|
257 |
+
}
|
258 |
|
259 |
+
$out['last'] = trim( $pieces[0] );
|
260 |
+
$out['suffix'] = trim( $pieces[2] );
|
261 |
break;
|
262 |
+
default: // unparseable
|
263 |
+
unset( $pieces );
|
264 |
break;
|
265 |
+
}
|
266 |
|
267 |
return $out;
|
268 |
+
}
|
269 |
+
|
270 |
|
271 |
|
|
app/includes/seedprod_lessc.inc.php
CHANGED
@@ -38,37 +38,37 @@
|
|
38 |
* handling things like indentation.
|
39 |
*/
|
40 |
class seedprod_lessc {
|
41 |
-
static
|
42 |
-
static
|
43 |
-
static
|
44 |
|
45 |
-
protected $libFunctions
|
46 |
-
protected $registeredVars
|
47 |
protected $preserveComments = false;
|
48 |
|
49 |
-
public $vPrefix
|
50 |
-
public $mPrefix
|
51 |
public $parentSelector = '&';
|
52 |
|
53 |
public $importDisabled = false;
|
54 |
-
public $importDir
|
55 |
|
56 |
protected $numberPrecision = null;
|
57 |
|
58 |
// set to the parser that generated the current line when compiling
|
59 |
// so we know how to create error messages
|
60 |
protected $sourceParser = null;
|
61 |
-
protected $sourceLoc
|
62 |
|
63 |
-
static
|
64 |
|
65 |
-
static
|
66 |
|
67 |
// attempts to find the path of an import url, returns null for css files
|
68 |
-
protected function findImport($url) {
|
69 |
-
foreach ((array)$this->importDir as $dir) {
|
70 |
-
$full = $dir.(substr($dir, -1) != '/' ? '/' : '')
|
71 |
-
if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) {
|
72 |
return $file;
|
73 |
}
|
74 |
}
|
@@ -76,46 +76,55 @@ class seedprod_lessc {
|
|
76 |
return null;
|
77 |
}
|
78 |
|
79 |
-
protected function fileExists($name) {
|
80 |
-
return is_file($name);
|
81 |
}
|
82 |
|
83 |
-
static
|
84 |
-
if (!isset($items[1]) && isset($items[0]))
|
85 |
-
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
-
static
|
89 |
-
return preg_quote($what, '/');
|
90 |
}
|
91 |
|
92 |
-
protected function tryImport($importPath, $parentBlock, $out) {
|
93 |
-
if ($importPath[0] ==
|
94 |
-
$importPath = $this->flattenList($importPath[2]);
|
95 |
}
|
96 |
|
97 |
-
$str = $this->coerceString($importPath);
|
98 |
-
if ($str === null)
|
|
|
|
|
99 |
|
100 |
-
$url = $this->compileValue($this->lib_e($str));
|
101 |
|
102 |
// don't import if it ends in css
|
103 |
-
if (substr_compare($url, '.css', -4, 4) === 0)
|
|
|
|
|
104 |
|
105 |
-
$realPath = $this->findImport($url);
|
106 |
-
if ($realPath === null)
|
|
|
|
|
107 |
|
108 |
-
if ($this->importDisabled) {
|
109 |
-
return array(false,
|
110 |
}
|
111 |
|
112 |
-
$this->addParsedFile($realPath);
|
113 |
-
$parser = $this->makeParser($realPath);
|
114 |
-
$root
|
115 |
|
116 |
// set the parents of all the block props
|
117 |
-
foreach ($root->props as $prop) {
|
118 |
-
if ($prop[0] ==
|
119 |
$prop[1]->parent = $parentBlock;
|
120 |
}
|
121 |
}
|
@@ -123,39 +132,40 @@ class seedprod_lessc {
|
|
123 |
// copy mixins into scope, set their parents
|
124 |
// bring blocks from import into current block
|
125 |
// TODO: need to mark the source parser these came from this file
|
126 |
-
foreach ($root->children as $childName => $child) {
|
127 |
-
if (isset($parentBlock->children[$childName])) {
|
128 |
-
$parentBlock->children[$childName] = array_merge(
|
129 |
-
$parentBlock->children[$childName],
|
130 |
-
$child
|
|
|
131 |
} else {
|
132 |
-
$parentBlock->children[$childName] = $child;
|
133 |
}
|
134 |
}
|
135 |
|
136 |
-
$pi
|
137 |
-
$dir = $pi[
|
138 |
|
139 |
-
list($top, $bottom) = $this->sortProps($root->props, true);
|
140 |
-
$this->compileImportedProps($top, $parentBlock, $out, $parser, $dir);
|
141 |
|
142 |
-
return array(true, $bottom, $parser, $dir);
|
143 |
}
|
144 |
|
145 |
-
protected function compileImportedProps($props, $block, $out, $sourceParser, $importDir) {
|
146 |
$oldSourceParser = $this->sourceParser;
|
147 |
|
148 |
$oldImport = $this->importDir;
|
149 |
|
150 |
// TODO: this is because the importDir api is stupid
|
151 |
-
$this->importDir = (array)$this->importDir;
|
152 |
-
array_unshift($this->importDir, $importDir);
|
153 |
|
154 |
-
foreach ($props as $prop) {
|
155 |
-
$this->compileProp($prop, $block, $out);
|
156 |
}
|
157 |
|
158 |
-
$this->importDir
|
159 |
$this->sourceParser = $oldSourceParser;
|
160 |
}
|
161 |
|
@@ -180,61 +190,61 @@ class seedprod_lessc {
|
|
180 |
* See seedprod_lessc::compileProp()
|
181 |
*
|
182 |
*/
|
183 |
-
protected function compileBlock($block) {
|
184 |
-
switch ($block->type) {
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
}
|
205 |
}
|
206 |
|
207 |
-
protected function compileCSSBlock($block) {
|
208 |
$env = $this->pushEnv();
|
209 |
|
210 |
-
$selectors
|
211 |
-
$env->selectors = $this->multiplySelectors($selectors);
|
212 |
-
$out
|
213 |
|
214 |
$this->scope->children[] = $out;
|
215 |
-
$this->compileProps($block, $out);
|
216 |
|
217 |
$block->scope = $env; // mixins carry scope with them!
|
218 |
$this->popEnv();
|
219 |
}
|
220 |
|
221 |
-
protected function compileMedia($media) {
|
222 |
-
$env
|
223 |
-
$parentScope = $this->mediaParent($this->scope);
|
224 |
|
225 |
-
$query = $this->compileMediaQuery($this->multiplyMedia($env));
|
226 |
|
227 |
-
$this->scope
|
228 |
$parentScope->children[] = $this->scope;
|
229 |
|
230 |
-
$this->compileProps($media, $this->scope);
|
231 |
|
232 |
-
if (count($this->scope->lines) > 0) {
|
233 |
$orphanSelelectors = $this->findClosestSelectors();
|
234 |
-
if (!is_null($orphanSelelectors)) {
|
235 |
-
$orphan
|
236 |
$orphan->lines = $this->scope->lines;
|
237 |
-
array_unshift($this->scope->children, $orphan);
|
238 |
$this->scope->lines = array();
|
239 |
}
|
240 |
}
|
@@ -243,9 +253,9 @@ class seedprod_lessc {
|
|
243 |
$this->popEnv();
|
244 |
}
|
245 |
|
246 |
-
protected function mediaParent($scope) {
|
247 |
-
while (!empty($scope->parent)) {
|
248 |
-
if (!empty($scope->type) && $scope->type !=
|
249 |
break;
|
250 |
}
|
251 |
$scope = $scope->parent;
|
@@ -254,138 +264,137 @@ class seedprod_lessc {
|
|
254 |
return $scope;
|
255 |
}
|
256 |
|
257 |
-
protected function compileNestedBlock($block, $selectors) {
|
258 |
-
$this->pushEnv($block);
|
259 |
-
$this->scope
|
260 |
$this->scope->parent->children[] = $this->scope;
|
261 |
|
262 |
-
$this->compileProps($block, $this->scope);
|
263 |
|
264 |
$this->scope = $this->scope->parent;
|
265 |
$this->popEnv();
|
266 |
}
|
267 |
|
268 |
-
protected function compileRoot($root) {
|
269 |
$this->pushEnv();
|
270 |
-
$this->scope = $this->makeOutputBlock($root->type);
|
271 |
-
$this->compileProps($root, $this->scope);
|
272 |
$this->popEnv();
|
273 |
}
|
274 |
|
275 |
-
protected function compileProps($block, $out) {
|
276 |
-
foreach ($this->sortProps($block->props) as $prop) {
|
277 |
-
$this->compileProp($prop, $block, $out);
|
278 |
}
|
279 |
}
|
280 |
|
281 |
-
protected function sortProps($props, $split = false) {
|
282 |
-
$vars
|
283 |
$imports = array();
|
284 |
-
$other
|
285 |
|
286 |
-
foreach ($props as $prop) {
|
287 |
-
switch ($prop[0]) {
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
$other[] = $prop;
|
293 |
-
}
|
294 |
-
break;
|
295 |
-
case "import":
|
296 |
-
$id = self::$nextImportId++;
|
297 |
-
$prop[] = $id;
|
298 |
-
$imports[] = $prop;
|
299 |
-
$other[] = array("import_mixin", $id);
|
300 |
-
break;
|
301 |
-
default:
|
302 |
-
$other[] = $prop;
|
303 |
}
|
304 |
}
|
305 |
|
306 |
-
if ($split) {
|
307 |
-
return array(array_merge($vars, $imports), $other);
|
308 |
} else {
|
309 |
-
return array_merge($vars, $imports, $other);
|
310 |
}
|
311 |
}
|
312 |
|
313 |
-
protected function compileMediaQuery($queries) {
|
314 |
$compiledQueries = array();
|
315 |
-
foreach ($queries as $query) {
|
316 |
$parts = array();
|
317 |
-
foreach ($query as $q) {
|
318 |
-
switch ($q[0]) {
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
$this->compileValue($this->reduce($q[2])) .
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
}
|
331 |
}
|
332 |
|
333 |
-
if (count($parts) > 0) {
|
334 |
-
$compiledQueries[] =
|
335 |
}
|
336 |
}
|
337 |
|
338 |
-
$out =
|
339 |
-
if (!empty($parts)) {
|
340 |
-
$out .=
|
341 |
-
implode($this->formatter->selectorSeparator, $compiledQueries);
|
342 |
}
|
343 |
return $out;
|
344 |
}
|
345 |
|
346 |
-
protected function multiplyMedia($env, $childQueries = null) {
|
347 |
-
if (is_null($env) ||
|
348 |
-
!empty($env->block->type) && $env->block->type !=
|
349 |
-
{
|
350 |
return $childQueries;
|
351 |
}
|
352 |
|
353 |
// plain old block, skip
|
354 |
-
if (empty($env->block->type)) {
|
355 |
-
return $this->multiplyMedia($env->parent, $childQueries);
|
356 |
}
|
357 |
|
358 |
-
$out
|
359 |
$queries = $env->block->queries;
|
360 |
-
if (is_null($childQueries)) {
|
361 |
$out = $queries;
|
362 |
} else {
|
363 |
-
foreach ($queries as $parent) {
|
364 |
-
foreach ($childQueries as $child) {
|
365 |
-
$out[] = array_merge($parent, $child);
|
366 |
}
|
367 |
}
|
368 |
}
|
369 |
|
370 |
-
return $this->multiplyMedia($env->parent, $out);
|
371 |
}
|
372 |
|
373 |
-
protected function expandParentSelectors(&$tag, $replace) {
|
374 |
-
$parts = explode(
|
375 |
$count = 0;
|
376 |
-
foreach ($parts as &$part) {
|
377 |
-
$part
|
378 |
$count += $c;
|
379 |
}
|
380 |
-
$tag = implode($this->parentSelector, $parts);
|
381 |
return $count;
|
382 |
}
|
383 |
|
384 |
protected function findClosestSelectors() {
|
385 |
-
$env
|
386 |
$selectors = null;
|
387 |
-
while ($env !== null) {
|
388 |
-
if (isset($env->selectors)) {
|
389 |
$selectors = $env->selectors;
|
390 |
break;
|
391 |
}
|
@@ -397,29 +406,29 @@ class seedprod_lessc {
|
|
397 |
|
398 |
|
399 |
// multiply $selectors against the nearest selectors in env
|
400 |
-
protected function multiplySelectors($selectors) {
|
401 |
// find parent selectors
|
402 |
|
403 |
$parentSelectors = $this->findClosestSelectors();
|
404 |
-
if (is_null($parentSelectors)) {
|
405 |
// kill parent reference in top level selector
|
406 |
-
foreach ($selectors as &$s) {
|
407 |
-
$this->expandParentSelectors($s,
|
408 |
}
|
409 |
|
410 |
return $selectors;
|
411 |
}
|
412 |
|
413 |
$out = array();
|
414 |
-
foreach ($parentSelectors as $parent) {
|
415 |
-
foreach ($selectors as $child) {
|
416 |
-
$count = $this->expandParentSelectors($child, $parent);
|
417 |
|
418 |
// don't prepend the parent tag if & was used
|
419 |
-
if ($count > 0) {
|
420 |
-
$out[] = trim($child);
|
421 |
} else {
|
422 |
-
$out[] = trim($parent . ' ' . $child);
|
423 |
}
|
424 |
}
|
425 |
}
|
@@ -428,13 +437,13 @@ class seedprod_lessc {
|
|
428 |
}
|
429 |
|
430 |
// reduces selector expressions
|
431 |
-
protected function compileSelectors($selectors) {
|
432 |
$out = array();
|
433 |
|
434 |
-
foreach ($selectors as $s) {
|
435 |
-
if (is_array($s)) {
|
436 |
list(, $value) = $s;
|
437 |
-
$out[]
|
438 |
} else {
|
439 |
$out[] = $s;
|
440 |
}
|
@@ -443,32 +452,34 @@ class seedprod_lessc {
|
|
443 |
return $out;
|
444 |
}
|
445 |
|
446 |
-
protected function eq($left, $right) {
|
447 |
return $left == $right;
|
448 |
}
|
449 |
|
450 |
-
protected function patternMatch($block, $callingArgs) {
|
451 |
// match the guards if it has them
|
452 |
// any one of the groups must have all its guards pass for a match
|
453 |
-
if (!empty($block->guards)) {
|
454 |
$groupPassed = false;
|
455 |
-
foreach ($block->guards as $guardGroup) {
|
456 |
-
foreach ($guardGroup as $guard) {
|
457 |
$this->pushEnv();
|
458 |
-
$this->zipSetArgs($block->args, $callingArgs);
|
459 |
|
460 |
$negate = false;
|
461 |
-
if ($guard[0] ==
|
462 |
-
$guard
|
463 |
$negate = true;
|
464 |
}
|
465 |
|
466 |
-
$passed = $this->reduce($guard) == self::$TRUE;
|
467 |
-
if ($negate)
|
|
|
|
|
468 |
|
469 |
$this->popEnv();
|
470 |
|
471 |
-
if ($passed) {
|
472 |
$groupPassed = true;
|
473 |
} else {
|
474 |
$groupPassed = false;
|
@@ -476,42 +487,44 @@ class seedprod_lessc {
|
|
476 |
}
|
477 |
}
|
478 |
|
479 |
-
if ($groupPassed)
|
|
|
|
|
480 |
}
|
481 |
|
482 |
-
if (
|
483 |
return false;
|
484 |
}
|
485 |
}
|
486 |
|
487 |
-
$numCalling = count($callingArgs);
|
488 |
|
489 |
-
if (empty($block->args)) {
|
490 |
return $block->isVararg || $numCalling == 0;
|
491 |
}
|
492 |
|
493 |
$i = -1; // no args
|
494 |
// try to match by arity or by argument literal
|
495 |
-
foreach ($block->args as $i => $arg) {
|
496 |
-
switch ($arg[0]) {
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
}
|
512 |
}
|
513 |
|
514 |
-
if ($block->isVararg) {
|
515 |
return true; // not having enough is handled above
|
516 |
} else {
|
517 |
$numMatched = $i + 1;
|
@@ -520,10 +533,10 @@ class seedprod_lessc {
|
|
520 |
}
|
521 |
}
|
522 |
|
523 |
-
protected function patternMatchAll($blocks, $callingArgs) {
|
524 |
$matches = null;
|
525 |
-
foreach ($blocks as $block) {
|
526 |
-
if ($this->patternMatch($block, $callingArgs)) {
|
527 |
$matches[] = $block;
|
528 |
}
|
529 |
}
|
@@ -532,181 +545,201 @@ class seedprod_lessc {
|
|
532 |
}
|
533 |
|
534 |
// attempt to find blocks matched by path and args
|
535 |
-
protected function findBlocks($searchIn, $path, $args, $seen=array()) {
|
536 |
-
if ($searchIn == null)
|
537 |
-
|
538 |
-
|
|
|
|
|
|
|
|
|
539 |
|
540 |
$name = $path[0];
|
541 |
|
542 |
-
if (isset($searchIn->children[$name])) {
|
543 |
-
$blocks = $searchIn->children[$name];
|
544 |
-
if (count($path) == 1) {
|
545 |
-
$matches = $this->patternMatchAll($blocks, $args);
|
546 |
-
if (!empty($matches)) {
|
547 |
// This will return all blocks that match in the closest
|
548 |
// scope that has any matching block, like lessjs
|
549 |
return $matches;
|
550 |
}
|
551 |
} else {
|
552 |
$matches = array();
|
553 |
-
foreach ($blocks as $subBlock) {
|
554 |
-
$subMatches = $this->findBlocks(
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
|
|
|
|
|
|
|
|
559 |
$matches[] = $sm;
|
560 |
}
|
561 |
}
|
562 |
}
|
563 |
|
564 |
-
return count($matches) > 0 ? $matches : null;
|
565 |
}
|
566 |
}
|
567 |
|
568 |
-
if ($searchIn->parent === $searchIn)
|
569 |
-
|
|
|
|
|
570 |
}
|
571 |
|
572 |
// sets all argument names in $args to either the default value
|
573 |
// or the one passed in through $values
|
574 |
-
protected function zipSetArgs($args, $values) {
|
575 |
-
$i
|
576 |
$assignedValues = array();
|
577 |
-
foreach ($args as $a) {
|
578 |
-
if ($a[0] ==
|
579 |
-
if ($i < count($values) && !is_null($values[$i])) {
|
580 |
-
$value = $values[$i];
|
581 |
-
} elseif (isset($a[2])) {
|
582 |
$value = $a[2];
|
583 |
-
} else
|
|
|
|
|
584 |
|
585 |
-
$value = $this->reduce($value);
|
586 |
-
$this->set($a[1], $value);
|
587 |
$assignedValues[] = $value;
|
588 |
}
|
589 |
$i++;
|
590 |
}
|
591 |
|
592 |
// check for a rest
|
593 |
-
$last = end($args);
|
594 |
-
if (is_array($last) && $last[0] ==
|
595 |
-
$rest = array_slice($values, count($args) - 1);
|
596 |
-
$this->set($last[1], $this->reduce(array(
|
597 |
}
|
598 |
|
599 |
$this->env->arguments = $assignedValues;
|
600 |
}
|
601 |
|
602 |
// compile a prop and update $lines or $blocks appropriately
|
603 |
-
protected function compileProp($prop, $block, $out) {
|
604 |
// set error position context
|
605 |
-
$this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1;
|
606 |
-
|
607 |
-
switch ($prop[0]) {
|
608 |
-
case 'assign':
|
609 |
-
list(, $name, $value) = $prop;
|
610 |
-
if ($name[0] == $this->vPrefix) {
|
611 |
-
$this->set($name, $value);
|
612 |
-
} else {
|
613 |
-
$out->lines[] = $this->formatter->property($name,
|
614 |
-
$this->compileValue($this->reduce($value)));
|
615 |
-
}
|
616 |
-
break;
|
617 |
-
case 'block':
|
618 |
-
list(, $child) = $prop;
|
619 |
-
$this->compileBlock($child);
|
620 |
-
break;
|
621 |
-
case 'mixin':
|
622 |
-
list(, $path, $args, $suffix) = $prop;
|
623 |
|
624 |
-
|
625 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
626 |
|
627 |
-
|
628 |
-
|
629 |
-
break; // throw error here??
|
630 |
-
}
|
631 |
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
$haveScope = true;
|
636 |
-
$mixinParentEnv = $this->pushEnv();
|
637 |
-
$mixinParentEnv->storeParent = $mixin->parent->scope;
|
638 |
}
|
639 |
|
640 |
-
$
|
641 |
-
|
642 |
-
$
|
643 |
-
|
644 |
-
|
645 |
-
|
|
|
646 |
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
$subProp[0] == "assign" &&
|
653 |
-
is_string($subProp[1]) &&
|
654 |
-
$subProp[1][0] != $this->vPrefix)
|
655 |
-
{
|
656 |
-
$subProp[2] = array(
|
657 |
-
'list', ' ',
|
658 |
-
array($subProp[2], array('keyword', $suffix))
|
659 |
-
);
|
660 |
}
|
661 |
|
662 |
-
$
|
663 |
-
|
|
|
|
|
664 |
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
|
667 |
-
|
668 |
-
|
669 |
-
}
|
670 |
|
671 |
-
|
672 |
-
case 'raw':
|
673 |
-
$out->lines[] = $prop[1];
|
674 |
-
break;
|
675 |
-
case "directive":
|
676 |
-
list(, $name, $value) = $prop;
|
677 |
-
$out->lines[] = "@$name " . $this->compileValue($this->reduce($value)).';';
|
678 |
-
break;
|
679 |
-
case "comment":
|
680 |
-
$out->lines[] = $prop[1];
|
681 |
-
break;
|
682 |
-
case "import";
|
683 |
-
list(, $importPath, $importId) = $prop;
|
684 |
-
$importPath = $this->reduce($importPath);
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
|
|
|
|
|
|
|
|
689 |
|
690 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
691 |
|
692 |
-
|
693 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
694 |
$result;
|
695 |
|
696 |
break;
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
}
|
711 |
}
|
712 |
|
@@ -722,366 +755,403 @@ class seedprod_lessc {
|
|
722 |
* The input is expected to be reduced. This function will not work on
|
723 |
* things like expressions and variables.
|
724 |
*/
|
725 |
-
protected function compileValue($value) {
|
726 |
-
switch ($value[0]) {
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
753 |
}
|
754 |
-
}
|
755 |
-
return $delim . implode($content) . $delim;
|
756 |
-
case 'color':
|
757 |
-
// [1] - red component (either number or a %)
|
758 |
-
// [2] - green component
|
759 |
-
// [3] - blue component
|
760 |
-
// [4] - optional alpha component
|
761 |
-
list(, $r, $g, $b) = $value;
|
762 |
-
$r = round($r);
|
763 |
-
$g = round($g);
|
764 |
-
$b = round($b);
|
765 |
-
|
766 |
-
if (count($value) == 5 && $value[4] != 1) { // rgba
|
767 |
-
return 'rgba('.$r.','.$g.','.$b.','.$value[4].')';
|
768 |
-
}
|
769 |
|
770 |
-
|
771 |
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
|
|
776 |
}
|
777 |
-
}
|
778 |
|
779 |
-
|
780 |
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
}
|
787 |
}
|
788 |
|
789 |
-
protected function lib_isnumber($value) {
|
790 |
-
return $this->toBool($value[0] ==
|
791 |
}
|
792 |
|
793 |
-
protected function lib_isstring($value) {
|
794 |
-
return $this->toBool($value[0] ==
|
795 |
}
|
796 |
|
797 |
-
protected function lib_iscolor($value) {
|
798 |
-
return $this->toBool($this->coerceColor($value));
|
799 |
}
|
800 |
|
801 |
-
protected function lib_iskeyword($value) {
|
802 |
-
return $this->toBool($value[0] ==
|
803 |
}
|
804 |
|
805 |
-
protected function lib_ispixel($value) {
|
806 |
-
return $this->toBool($value[0] ==
|
807 |
}
|
808 |
|
809 |
-
protected function lib_ispercentage($value) {
|
810 |
-
return $this->toBool($value[0] ==
|
811 |
}
|
812 |
|
813 |
-
protected function lib_isem($value) {
|
814 |
-
return $this->toBool($value[0] ==
|
815 |
}
|
816 |
|
817 |
-
protected function lib_rgbahex($color) {
|
818 |
-
$color = $this->coerceColor($color);
|
819 |
-
if (is_null($color))
|
820 |
-
$this->throwError(
|
|
|
821 |
|
822 |
-
return sprintf(
|
823 |
-
|
824 |
-
$color[
|
|
|
|
|
|
|
|
|
825 |
}
|
826 |
|
827 |
-
protected function lib_argb($color){
|
828 |
-
return $this->lib_rgbahex($color);
|
829 |
}
|
830 |
|
831 |
// utility func to unquote a string
|
832 |
-
protected function lib_e($arg) {
|
833 |
-
switch ($arg[0]) {
|
834 |
-
case
|
835 |
$items = $arg[2];
|
836 |
-
if (isset($items[0])) {
|
837 |
-
return $this->lib_e($items[0]);
|
838 |
}
|
839 |
return self::$defaultValue;
|
840 |
-
case
|
841 |
-
$arg[1] =
|
842 |
return $arg;
|
843 |
-
case
|
844 |
return $arg;
|
845 |
default:
|
846 |
-
return array(
|
847 |
}
|
848 |
}
|
849 |
|
850 |
-
protected function lib__sprintf($args) {
|
851 |
-
if ($args[0] !=
|
852 |
-
|
853 |
-
|
854 |
-
$
|
|
|
|
|
855 |
|
856 |
$i = 0;
|
857 |
-
if (preg_match_all('/%[dsa]/', $template, $m)) {
|
858 |
-
foreach ($m[0] as $match) {
|
859 |
-
$val = isset($values[$i]) ?
|
860 |
-
$this->reduce($values[$i]) : array('keyword', '');
|
861 |
|
862 |
// lessjs compat, renders fully expanded color, not raw color
|
863 |
-
if ($color = $this->coerceColor($val)) {
|
864 |
$val = $color;
|
865 |
}
|
866 |
|
867 |
$i++;
|
868 |
-
$rep
|
869 |
-
$template = preg_replace(
|
870 |
-
|
|
|
|
|
|
|
|
|
871 |
}
|
872 |
}
|
873 |
|
874 |
-
$d = $string[0] ==
|
875 |
-
return array(
|
876 |
}
|
877 |
|
878 |
-
protected function lib_floor($arg) {
|
879 |
-
$value = $this->assertNumber($arg);
|
880 |
-
return array(
|
881 |
}
|
882 |
|
883 |
-
protected function lib_ceil($arg) {
|
884 |
-
$value = $this->assertNumber($arg);
|
885 |
-
return array(
|
886 |
}
|
887 |
|
888 |
-
protected function lib_round($arg) {
|
889 |
-
$value = $this->assertNumber($arg);
|
890 |
-
return array(
|
891 |
}
|
892 |
|
893 |
/**
|
894 |
* Helper function to get arguments for color manipulation functions.
|
895 |
* takes a list that contains a color like thing and a percentage
|
896 |
*/
|
897 |
-
protected function colorArgs($args) {
|
898 |
-
if ($args[0] != 'list' || count($args[2]) < 2) {
|
899 |
-
return array(array('color', 0, 0, 0), 0);
|
900 |
}
|
901 |
list($color, $delta) = $args[2];
|
902 |
-
$color
|
903 |
-
$delta
|
904 |
|
905 |
-
return array($color, $delta);
|
906 |
}
|
907 |
|
908 |
-
protected function lib_darken($args) {
|
909 |
-
list($color, $delta) = $this->colorArgs($args);
|
910 |
|
911 |
-
$hsl
|
912 |
-
$hsl[3] = $this->clamp($hsl[3] - $delta, 100);
|
913 |
-
return $this->toRGB($hsl);
|
914 |
}
|
915 |
|
916 |
-
protected function lib_lighten($args) {
|
917 |
-
list($color, $delta) = $this->colorArgs($args);
|
918 |
|
919 |
-
$hsl
|
920 |
-
$hsl[3] = $this->clamp($hsl[3] + $delta, 100);
|
921 |
-
return $this->toRGB($hsl);
|
922 |
}
|
923 |
|
924 |
-
protected function lib_saturate($args) {
|
925 |
-
list($color, $delta) = $this->colorArgs($args);
|
926 |
|
927 |
-
$hsl
|
928 |
-
$hsl[2] = $this->clamp($hsl[2] + $delta, 100);
|
929 |
-
return $this->toRGB($hsl);
|
930 |
}
|
931 |
|
932 |
-
protected function lib_desaturate($args) {
|
933 |
-
list($color, $delta) = $this->colorArgs($args);
|
934 |
|
935 |
-
$hsl
|
936 |
-
$hsl[2] = $this->clamp($hsl[2] - $delta, 100);
|
937 |
-
return $this->toRGB($hsl);
|
938 |
}
|
939 |
|
940 |
-
protected function lib_spin($args) {
|
941 |
-
list($color, $delta) = $this->colorArgs($args);
|
942 |
|
943 |
-
$hsl = $this->toHSL($color);
|
944 |
|
945 |
$hsl[1] = $hsl[1] + $delta % 360;
|
946 |
-
if ($hsl[1] < 0)
|
|
|
|
|
947 |
|
948 |
-
return $this->toRGB($hsl);
|
949 |
}
|
950 |
|
951 |
-
protected function lib_fadeout($args) {
|
952 |
-
list($color, $delta) = $this->colorArgs($args);
|
953 |
-
$color[4]
|
954 |
return $color;
|
955 |
}
|
956 |
|
957 |
-
protected function lib_fadein($args) {
|
958 |
-
list($color, $delta) = $this->colorArgs($args);
|
959 |
-
$color[4]
|
960 |
return $color;
|
961 |
}
|
962 |
|
963 |
-
protected function lib_hue($color) {
|
964 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
965 |
-
return round($hsl[1]);
|
966 |
}
|
967 |
|
968 |
-
protected function lib_saturation($color) {
|
969 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
970 |
-
return round($hsl[2]);
|
971 |
}
|
972 |
|
973 |
-
protected function lib_lightness($color) {
|
974 |
-
$hsl = $this->toHSL($this->assertColor($color));
|
975 |
-
return round($hsl[3]);
|
976 |
}
|
977 |
|
978 |
// get the alpha of a color
|
979 |
// defaults to 1 for non-colors or colors without an alpha
|
980 |
-
protected function lib_alpha($value) {
|
981 |
-
if (!is_null($color = $this->coerceColor($value))) {
|
982 |
-
return isset($color[4]) ? $color[4] : 1;
|
983 |
}
|
984 |
}
|
985 |
|
986 |
// set the alpha of the color
|
987 |
-
protected function lib_fade($args) {
|
988 |
-
list($color, $alpha) = $this->colorArgs($args);
|
989 |
-
$color[4]
|
990 |
return $color;
|
991 |
}
|
992 |
|
993 |
-
protected function lib_percentage($arg) {
|
994 |
-
$num = $this->assertNumber($arg);
|
995 |
-
return array(
|
996 |
}
|
997 |
|
998 |
// mixes two colors by weight
|
999 |
// mix(@color1, @color2, @weight);
|
1000 |
// http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method
|
1001 |
-
protected function lib_mix($args) {
|
1002 |
-
if ($args[0] !=
|
1003 |
-
$this->throwError(
|
|
|
1004 |
|
1005 |
list($first, $second, $weight) = $args[2];
|
1006 |
-
$first
|
1007 |
-
$second
|
1008 |
|
1009 |
-
$first_a
|
1010 |
-
$second_a = $this->lib_alpha($second);
|
1011 |
-
$weight
|
1012 |
|
1013 |
$w = $weight * 2 - 1;
|
1014 |
$a = $first_a - $second_a;
|
1015 |
|
1016 |
-
$w1 = (($w * $a == -1 ? $w : ($w + $a)/(1 + $w * $a)) + 1) / 2.0;
|
1017 |
$w2 = 1.0 - $w1;
|
1018 |
|
1019 |
-
$new = array(
|
|
|
1020 |
$w1 * $first[1] + $w2 * $second[1],
|
1021 |
$w1 * $first[2] + $w2 * $second[2],
|
1022 |
$w1 * $first[3] + $w2 * $second[3],
|
1023 |
);
|
1024 |
|
1025 |
-
if ($first_a != 1.0 || $second_a != 1.0) {
|
1026 |
-
$new[] = $first_a * $weight + $second_a * ($weight - 1);
|
1027 |
}
|
1028 |
|
1029 |
-
return $this->fixColor($new);
|
1030 |
}
|
1031 |
|
1032 |
-
protected function assertColor($value, $error =
|
1033 |
-
$color = $this->coerceColor($value);
|
1034 |
-
if (is_null($color))
|
|
|
|
|
1035 |
return $color;
|
1036 |
}
|
1037 |
|
1038 |
-
protected function assertNumber($value, $error =
|
1039 |
-
if ($value[0] ==
|
1040 |
-
|
|
|
|
|
1041 |
}
|
1042 |
|
1043 |
-
protected function toHSL($color) {
|
1044 |
-
if ($color[0] == 'hsl')
|
|
|
|
|
1045 |
|
1046 |
$r = $color[1] / 255;
|
1047 |
$g = $color[2] / 255;
|
1048 |
$b = $color[3] / 255;
|
1049 |
|
1050 |
-
$min = min($r, $g, $b);
|
1051 |
-
$max = max($r, $g, $b);
|
1052 |
|
1053 |
-
$L = ($min + $max) / 2;
|
1054 |
-
if ($min == $max) {
|
1055 |
$S = $H = 0;
|
1056 |
} else {
|
1057 |
-
if ($L < 0.5)
|
1058 |
-
$S = ($max - $min)/($max + $min);
|
1059 |
-
else
|
1060 |
-
$S = ($max - $min)/(2.0 - $max - $min);
|
1061 |
-
|
1062 |
-
if ($r == $max) $H = ($g - $b)/($max - $min);
|
1063 |
-
elseif ($g == $max) $H = 2.0 + ($b - $r)/($max - $min);
|
1064 |
-
elseif ($b == $max) $H = 4.0 + ($r - $g)/($max - $min);
|
1065 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1066 |
}
|
1067 |
|
1068 |
-
$out = array(
|
1069 |
-
|
1070 |
-
$
|
1071 |
-
$
|
|
|
1072 |
);
|
1073 |
|
1074 |
-
if (count($color) > 4)
|
|
|
|
|
1075 |
return $out;
|
1076 |
}
|
1077 |
|
1078 |
-
protected function toRGB_helper($comp, $temp1, $temp2) {
|
1079 |
-
if ($comp < 0)
|
1080 |
-
|
|
|
|
|
|
|
1081 |
|
1082 |
-
if (6 * $comp < 1
|
1083 |
-
|
1084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1085 |
|
1086 |
return $temp1;
|
1087 |
}
|
@@ -1090,187 +1160,220 @@ class seedprod_lessc {
|
|
1090 |
* Converts a hsl array into a color value in rgb.
|
1091 |
* Expects H to be in range of 0 to 360, S and L in 0 to 100
|
1092 |
*/
|
1093 |
-
protected function toRGB($color) {
|
1094 |
-
if ($color == 'color')
|
|
|
|
|
1095 |
|
1096 |
$H = $color[1] / 360;
|
1097 |
$S = $color[2] / 100;
|
1098 |
$L = $color[3] / 100;
|
1099 |
|
1100 |
-
if ($S == 0) {
|
1101 |
$r = $g = $b = $L;
|
1102 |
} else {
|
1103 |
$temp2 = $L < 0.5 ?
|
1104 |
-
$L*(1.0 + $S) :
|
1105 |
$L + $S - $L * $S;
|
1106 |
|
1107 |
$temp1 = 2.0 * $L - $temp2;
|
1108 |
|
1109 |
-
$r = $this->toRGB_helper($H + 1/3, $temp1, $temp2);
|
1110 |
-
$g = $this->toRGB_helper($H, $temp1, $temp2);
|
1111 |
-
$b = $this->toRGB_helper($H - 1/3, $temp1, $temp2);
|
1112 |
}
|
1113 |
|
1114 |
// $out = array('color', round($r*255), round($g*255), round($b*255));
|
1115 |
-
$out = array('color', $r*255, $g*255, $b*255);
|
1116 |
-
if (count($color) > 4)
|
|
|
|
|
1117 |
return $out;
|
1118 |
}
|
1119 |
|
1120 |
-
protected function clamp($v, $max = 1, $min = 0) {
|
1121 |
-
return min($max, max($min, $v));
|
1122 |
}
|
1123 |
|
1124 |
/**
|
1125 |
* Convert the rgb, rgba, hsl color literals of function type
|
1126 |
* as returned by the parser into values of color type.
|
1127 |
*/
|
1128 |
-
protected function funcToColor($func) {
|
1129 |
$fname = $func[1];
|
1130 |
-
if ($func[2][0] != 'list')
|
|
|
|
|
1131 |
$rawComponents = $func[2][2];
|
1132 |
|
1133 |
-
if ($fname == 'hsl' || $fname == 'hsla') {
|
1134 |
-
$hsl = array('hsl');
|
1135 |
-
$i
|
1136 |
-
foreach ($rawComponents as $c) {
|
1137 |
-
$val = $this->reduce($c);
|
1138 |
-
$val = isset($val[1]) ? floatval($val[1]) : 0;
|
1139 |
-
|
1140 |
-
if ($i == 0)
|
1141 |
-
|
1142 |
-
|
|
|
|
|
|
|
|
|
1143 |
|
1144 |
-
$hsl[] = $this->clamp($val, $clamp);
|
1145 |
$i++;
|
1146 |
}
|
1147 |
|
1148 |
-
while (count($hsl) < 4)
|
1149 |
-
|
|
|
|
|
1150 |
|
1151 |
-
} elseif ($fname == 'rgb' || $fname == 'rgba') {
|
1152 |
$components = array();
|
1153 |
-
$i
|
1154 |
-
foreach
|
1155 |
-
$c = $this->reduce($c);
|
1156 |
-
if ($i < 4) {
|
1157 |
-
if ($c[0] ==
|
1158 |
-
$components[] = 255 * ($c[1] / 100);
|
1159 |
} else {
|
1160 |
-
$components[] = floatval($c[1]);
|
1161 |
}
|
1162 |
-
} elseif ($i == 4) {
|
1163 |
-
if ($c[0] ==
|
1164 |
-
$components[] = 1.0 * ($c[1] / 100);
|
1165 |
} else {
|
1166 |
-
$components[] = floatval($c[1]);
|
1167 |
}
|
1168 |
-
} else
|
|
|
|
|
1169 |
|
1170 |
$i++;
|
1171 |
}
|
1172 |
-
while (count($components) < 3)
|
1173 |
-
|
1174 |
-
|
|
|
|
|
1175 |
}
|
1176 |
|
1177 |
return false;
|
1178 |
}
|
1179 |
|
1180 |
-
protected function reduce($value, $forExpression = false) {
|
1181 |
-
switch ($value[0]) {
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
|
1189 |
-
|
1190 |
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
}
|
1203 |
-
return $value;
|
1204 |
-
case "expression":
|
1205 |
-
return $this->evaluate($value);
|
1206 |
-
case "string":
|
1207 |
-
foreach ($value[2] as &$part) {
|
1208 |
-
if (is_array($part)) {
|
1209 |
-
$strip = $part[0] == "variable";
|
1210 |
-
$part = $this->reduce($part);
|
1211 |
-
if ($strip) $part = $this->lib_e($part);
|
1212 |
}
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
$
|
1232 |
-
|
1233 |
-
|
1234 |
-
return array("string", "", array(
|
1235 |
-
$name, "(", $args, ")"
|
1236 |
-
));
|
1237 |
}
|
1238 |
|
1239 |
-
|
1240 |
-
if (
|
1241 |
-
|
|
|
|
|
|
|
1242 |
|
1243 |
-
|
1244 |
-
|
|
|
|
|
1245 |
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1252 |
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
|
|
1260 |
}
|
1261 |
-
}
|
1262 |
-
return array("string", "", array($op, $exp));
|
1263 |
-
}
|
1264 |
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1270 |
}
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1274 |
}
|
1275 |
}
|
1276 |
|
@@ -1279,69 +1382,73 @@ class seedprod_lessc {
|
|
1279 |
|
1280 |
|
1281 |
// coerce a value for use in color operation
|
1282 |
-
protected function coerceColor($value) {
|
1283 |
-
switch($value[0]) {
|
1284 |
-
case 'color':
|
|
|
1285 |
case 'raw_color':
|
1286 |
-
$c
|
1287 |
-
$colorStr = substr($value[1], 1);
|
1288 |
-
$num
|
1289 |
-
$width
|
1290 |
|
1291 |
-
for ($i = 3; $i > 0; $i--) { // 3 2 1
|
1292 |
-
$t
|
1293 |
$num /= $width;
|
1294 |
|
1295 |
-
$c[$i] = $t * (256
|
1296 |
}
|
1297 |
|
1298 |
return $c;
|
1299 |
case 'keyword':
|
1300 |
$name = $value[1];
|
1301 |
-
if (isset(self::$cssColors[$name])) {
|
1302 |
-
list($r, $g, $b) = explode(',', self::$cssColors[$name]);
|
1303 |
-
return array('color', $r, $g, $b);
|
1304 |
}
|
1305 |
return null;
|
1306 |
}
|
1307 |
}
|
1308 |
|
1309 |
// make something string like into a string
|
1310 |
-
protected function coerceString($value) {
|
1311 |
-
switch ($value[0]) {
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
}
|
1317 |
return null;
|
1318 |
}
|
1319 |
|
1320 |
// turn list of length 1 into value type
|
1321 |
-
protected function flattenList($value) {
|
1322 |
-
if ($value[0] ==
|
1323 |
-
return $this->flattenList($value[2][0]);
|
1324 |
}
|
1325 |
return $value;
|
1326 |
}
|
1327 |
|
1328 |
-
protected function toBool($a) {
|
1329 |
-
if ($a)
|
1330 |
-
|
|
|
|
|
|
|
1331 |
}
|
1332 |
|
1333 |
// evaluate an expression
|
1334 |
-
protected function evaluate($exp) {
|
1335 |
list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp;
|
1336 |
|
1337 |
-
$left
|
1338 |
-
$right = $this->reduce($right, true);
|
1339 |
|
1340 |
-
if ($leftColor = $this->coerceColor($left)) {
|
1341 |
$left = $leftColor;
|
1342 |
}
|
1343 |
|
1344 |
-
if ($rightColor = $this->coerceColor($right)) {
|
1345 |
$right = $rightColor;
|
1346 |
}
|
1347 |
|
@@ -1349,158 +1456,177 @@ class seedprod_lessc {
|
|
1349 |
$rtype = $right[0];
|
1350 |
|
1351 |
// operators that work on all types
|
1352 |
-
if ($op ==
|
1353 |
-
return $this->toBool($left == self::$TRUE && $right == self::$TRUE);
|
1354 |
}
|
1355 |
|
1356 |
-
if ($op ==
|
1357 |
-
return $this->toBool($this->eq($left, $right) );
|
1358 |
}
|
1359 |
|
1360 |
-
if ($op ==
|
1361 |
return $str;
|
1362 |
}
|
1363 |
|
1364 |
// type based operators
|
1365 |
$fname = "op_${ltype}_${rtype}";
|
1366 |
-
if (is_callable(array($this, $fname))) {
|
1367 |
-
$out = $this->$fname($op, $left, $right);
|
1368 |
-
if (!is_null($out))
|
|
|
|
|
1369 |
}
|
1370 |
|
1371 |
// make the expression look it did before being parsed
|
1372 |
$paddedOp = $op;
|
1373 |
-
if ($whiteBefore)
|
1374 |
-
|
|
|
|
|
|
|
|
|
1375 |
|
1376 |
-
return array(
|
1377 |
}
|
1378 |
|
1379 |
-
protected function stringConcatenate($left, $right) {
|
1380 |
-
if ($strLeft = $this->coerceString($left)) {
|
1381 |
-
if ($right[0] ==
|
1382 |
-
$right[1] =
|
1383 |
}
|
1384 |
$strLeft[2][] = $right;
|
1385 |
return $strLeft;
|
1386 |
}
|
1387 |
|
1388 |
-
if ($strRight = $this->coerceString($right)) {
|
1389 |
-
array_unshift($strRight[2], $left);
|
1390 |
return $strRight;
|
1391 |
}
|
1392 |
}
|
1393 |
|
1394 |
|
1395 |
// make sure a color's components don't go out of bounds
|
1396 |
-
protected function fixColor($c) {
|
1397 |
-
foreach (range(1, 3) as $i) {
|
1398 |
-
if ($c[$i] < 0)
|
1399 |
-
|
|
|
|
|
|
|
|
|
1400 |
}
|
1401 |
|
1402 |
return $c;
|
1403 |
}
|
1404 |
|
1405 |
-
protected function op_number_color($op, $lft, $rgt) {
|
1406 |
-
if ($op == '+' || $op == '*') {
|
1407 |
-
return $this->op_color_number($op, $rgt, $lft);
|
1408 |
}
|
1409 |
}
|
1410 |
|
1411 |
-
protected function op_color_number($op, $lft, $rgt) {
|
1412 |
-
if ($rgt[0] == '%')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1413 |
|
1414 |
-
|
1415 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1416 |
}
|
1417 |
|
1418 |
-
|
1419 |
-
|
1420 |
-
$
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
switch ($op) {
|
1425 |
case '+':
|
1426 |
-
$
|
1427 |
-
break;
|
1428 |
-
case '-':
|
1429 |
-
$out[] = $lval - $rval;
|
1430 |
break;
|
1431 |
case '*':
|
1432 |
-
$
|
|
|
|
|
|
|
1433 |
break;
|
1434 |
case '%':
|
1435 |
-
$
|
1436 |
break;
|
1437 |
case '/':
|
1438 |
-
if ($
|
1439 |
-
|
|
|
|
|
1440 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
default:
|
1442 |
-
$this->throwError('
|
1443 |
-
}
|
1444 |
}
|
1445 |
-
return $this->fixColor($out);
|
1446 |
-
}
|
1447 |
|
1448 |
-
|
1449 |
-
protected function op_number_number($op, $left, $right) {
|
1450 |
-
$unit = empty($left[2]) ? $right[2] : $left[2];
|
1451 |
-
|
1452 |
-
$value = 0;
|
1453 |
-
switch ($op) {
|
1454 |
-
case '+':
|
1455 |
-
$value = $left[1] + $right[1];
|
1456 |
-
break;
|
1457 |
-
case '*':
|
1458 |
-
$value = $left[1] * $right[1];
|
1459 |
-
break;
|
1460 |
-
case '-':
|
1461 |
-
$value = $left[1] - $right[1];
|
1462 |
-
break;
|
1463 |
-
case '%':
|
1464 |
-
$value = $left[1] % $right[1];
|
1465 |
-
break;
|
1466 |
-
case '/':
|
1467 |
-
if ($right[1] == 0) $this->throwError('parse error: divide by zero');
|
1468 |
-
$value = $left[1] / $right[1];
|
1469 |
-
break;
|
1470 |
-
case '<':
|
1471 |
-
return $this->toBool($left[1] < $right[1]);
|
1472 |
-
case '>':
|
1473 |
-
return $this->toBool($left[1] > $right[1]);
|
1474 |
-
case '>=':
|
1475 |
-
return $this->toBool($left[1] >= $right[1]);
|
1476 |
-
case '=<':
|
1477 |
-
return $this->toBool($left[1] <= $right[1]);
|
1478 |
-
default:
|
1479 |
-
$this->throwError('parse error: unknown number operator: '.$op);
|
1480 |
-
}
|
1481 |
-
|
1482 |
-
return array("number", $value, $unit);
|
1483 |
}
|
1484 |
|
1485 |
|
1486 |
/* environment functions */
|
1487 |
|
1488 |
-
protected function makeOutputBlock($type, $selectors = null) {
|
1489 |
-
$b
|
1490 |
-
$b->lines
|
1491 |
-
$b->children
|
1492 |
$b->selectors = $selectors;
|
1493 |
-
$b->type
|
1494 |
-
$b->parent
|
1495 |
return $b;
|
1496 |
}
|
1497 |
|
1498 |
// the state of execution
|
1499 |
-
protected function pushEnv($block = null) {
|
1500 |
-
$e
|
1501 |
$e->parent = $this->env;
|
1502 |
-
$e->store
|
1503 |
-
$e->block
|
1504 |
|
1505 |
$this->env = $e;
|
1506 |
return $e;
|
@@ -1508,31 +1634,31 @@ class seedprod_lessc {
|
|
1508 |
|
1509 |
// pop something off the stack
|
1510 |
protected function popEnv() {
|
1511 |
-
$old
|
1512 |
$this->env = $this->env->parent;
|
1513 |
return $old;
|
1514 |
}
|
1515 |
|
1516 |
// set something in the current env
|
1517 |
-
protected function set($name, $value) {
|
1518 |
-
$this->env->store[$name] = $value;
|
1519 |
}
|
1520 |
|
1521 |
|
1522 |
// get the highest occurrence entry for a name
|
1523 |
-
protected function get($name, $default=null) {
|
1524 |
$current = $this->env;
|
1525 |
|
1526 |
$isArguments = $name == $this->vPrefix . 'arguments';
|
1527 |
-
while ($current) {
|
1528 |
-
if ($isArguments && isset($current->arguments)) {
|
1529 |
-
return array('list', ' ', $current->arguments);
|
1530 |
}
|
1531 |
|
1532 |
-
if (isset($current->store[$name]))
|
1533 |
-
return $current->store[$name];
|
1534 |
-
else {
|
1535 |
-
$current = isset($current->storeParent) ?
|
1536 |
$current->storeParent : $current->parent;
|
1537 |
}
|
1538 |
}
|
@@ -1541,18 +1667,20 @@ class seedprod_lessc {
|
|
1541 |
}
|
1542 |
|
1543 |
// inject array of unparsed strings into environment as variables
|
1544 |
-
protected function injectVariables($args) {
|
1545 |
$this->pushEnv();
|
1546 |
-
$parser = new seedprod_lessc_parser($this, __METHOD__);
|
1547 |
-
foreach ($args as $name => $strValue) {
|
1548 |
-
if ($name[0] != '@')
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
|
|
|
|
1553 |
}
|
1554 |
|
1555 |
-
$this->set($name, $value);
|
1556 |
}
|
1557 |
}
|
1558 |
|
@@ -1560,69 +1688,69 @@ class seedprod_lessc {
|
|
1560 |
* Initialize any static state, can initialize parser for a file
|
1561 |
* $opts isn't used yet
|
1562 |
*/
|
1563 |
-
public function __construct($fname = null) {
|
1564 |
-
if ($fname !== null) {
|
1565 |
// used for deprecated parse method
|
1566 |
$this->_parseFile = $fname;
|
1567 |
}
|
1568 |
}
|
1569 |
|
1570 |
-
public function compile($string, $name = null) {
|
1571 |
-
$locale = setlocale(LC_NUMERIC, 0);
|
1572 |
-
setlocale(LC_NUMERIC,
|
1573 |
|
1574 |
-
$this->parser = $this->makeParser($name);
|
1575 |
-
$root
|
1576 |
|
1577 |
-
$this->env
|
1578 |
$this->scope = null;
|
1579 |
|
1580 |
$this->formatter = $this->newFormatter();
|
1581 |
|
1582 |
-
if (!empty($this->registeredVars)) {
|
1583 |
-
$this->injectVariables($this->registeredVars);
|
1584 |
}
|
1585 |
|
1586 |
$this->sourceParser = $this->parser; // used for error messages
|
1587 |
-
$this->compileBlock($root);
|
1588 |
|
1589 |
ob_start();
|
1590 |
-
$this->formatter->block($this->scope);
|
1591 |
$out = ob_get_clean();
|
1592 |
-
setlocale(LC_NUMERIC, $locale);
|
1593 |
return $out;
|
1594 |
}
|
1595 |
|
1596 |
-
public function compileFile($fname, $outFname = null) {
|
1597 |
-
if (!is_readable($fname)) {
|
1598 |
-
throw new Exception('load error: failed to find '
|
1599 |
}
|
1600 |
|
1601 |
-
$pi = pathinfo($fname);
|
1602 |
|
1603 |
$oldImport = $this->importDir;
|
1604 |
|
1605 |
-
$this->importDir
|
1606 |
-
$this->importDir[] = $pi['dirname'].'/';
|
1607 |
|
1608 |
$this->allParsedFiles = array();
|
1609 |
-
$this->addParsedFile($fname);
|
1610 |
|
1611 |
-
$out = $this->compile(file_get_contents($fname), $fname);
|
1612 |
|
1613 |
$this->importDir = $oldImport;
|
1614 |
|
1615 |
-
if ($outFname !== null) {
|
1616 |
-
return file_put_contents($outFname, $out);
|
1617 |
}
|
1618 |
|
1619 |
return $out;
|
1620 |
}
|
1621 |
|
1622 |
// compile only if changed input has changed or output doesn't exist
|
1623 |
-
public function checkedCompile($in, $out) {
|
1624 |
-
if (!is_file($out) || filemtime($in) > filemtime($out)) {
|
1625 |
-
$this->compileFile($in, $out);
|
1626 |
return true;
|
1627 |
}
|
1628 |
return false;
|
@@ -1648,21 +1776,21 @@ class seedprod_lessc {
|
|
1648 |
* @param bool $force Force rebuild?
|
1649 |
* @return array lessphp cache structure
|
1650 |
*/
|
1651 |
-
public function cachedCompile($in, $force = false) {
|
1652 |
// assume no root
|
1653 |
$root = null;
|
1654 |
|
1655 |
-
if (is_string($in)) {
|
1656 |
$root = $in;
|
1657 |
-
} elseif (is_array($in) and isset($in['root'])) {
|
1658 |
-
if ($force or ! isset($in['files'])) {
|
1659 |
// If we are forcing a recompile or if for some reason the
|
1660 |
// structure does not contain any file information we should
|
1661 |
// specify the root to trigger a rebuild.
|
1662 |
$root = $in['root'];
|
1663 |
-
} elseif (isset($in['files']) and is_array($in['files'])) {
|
1664 |
-
foreach ($in['files'] as $fname => $ftime ) {
|
1665 |
-
if (!file_exists($fname) or filemtime($fname) > $ftime) {
|
1666 |
// One of the files we knew about previously has changed
|
1667 |
// so we should look at our incoming root again.
|
1668 |
$root = $in['root'];
|
@@ -1676,13 +1804,13 @@ class seedprod_lessc {
|
|
1676 |
return null;
|
1677 |
}
|
1678 |
|
1679 |
-
if ($root !== null) {
|
1680 |
// If we have a root value which means we should rebuild.
|
1681 |
-
$out
|
1682 |
-
$out['root']
|
1683 |
-
$out['compiled'] = $this->compileFile($root);
|
1684 |
-
$out['files']
|
1685 |
-
$out['updated']
|
1686 |
return $out;
|
1687 |
} else {
|
1688 |
// No changes, pass back the structure
|
@@ -1694,79 +1822,80 @@ class seedprod_lessc {
|
|
1694 |
|
1695 |
// parse and compile buffer
|
1696 |
// This is deprecated
|
1697 |
-
public function parse($str = null, $initialVariables = null) {
|
1698 |
-
if (is_array($str)) {
|
1699 |
$initialVariables = $str;
|
1700 |
-
$str
|
1701 |
}
|
1702 |
|
1703 |
$oldVars = $this->registeredVars;
|
1704 |
-
if ($initialVariables !== null) {
|
1705 |
-
$this->setVariables($initialVariables);
|
1706 |
}
|
1707 |
|
1708 |
-
if ($str == null) {
|
1709 |
-
if (empty($this->_parseFile)) {
|
1710 |
-
throw new exception(
|
1711 |
}
|
1712 |
|
1713 |
-
$out = $this->compileFile($this->_parseFile);
|
1714 |
} else {
|
1715 |
-
$out = $this->compile($str);
|
1716 |
}
|
1717 |
|
1718 |
$this->registeredVars = $oldVars;
|
1719 |
return $out;
|
1720 |
}
|
1721 |
|
1722 |
-
protected function makeParser($name) {
|
1723 |
-
$parser
|
1724 |
$parser->writeComments = $this->preserveComments;
|
1725 |
|
1726 |
return $parser;
|
1727 |
}
|
1728 |
|
1729 |
-
public function setFormatter($name) {
|
1730 |
$this->formatterName = $name;
|
1731 |
}
|
1732 |
|
1733 |
protected function newFormatter() {
|
1734 |
-
$className =
|
1735 |
-
if (!empty($this->formatterName)) {
|
1736 |
-
if (!is_string($this->formatterName))
|
1737 |
return $this->formatterName;
|
|
|
1738 |
$className = "seedprod_lessc_formatter_$this->formatterName";
|
1739 |
}
|
1740 |
|
1741 |
-
return new $className;
|
1742 |
}
|
1743 |
|
1744 |
-
public function setPreserveComments($preserve) {
|
1745 |
$this->preserveComments = $preserve;
|
1746 |
}
|
1747 |
|
1748 |
-
public function registerFunction($name, $func) {
|
1749 |
-
$this->libFunctions[$name] = $func;
|
1750 |
}
|
1751 |
|
1752 |
-
public function unregisterFunction($name) {
|
1753 |
-
unset($this->libFunctions[$name]);
|
1754 |
}
|
1755 |
|
1756 |
-
public function setVariables($variables) {
|
1757 |
-
$this->registeredVars = array_merge($this->registeredVars, $variables);
|
1758 |
}
|
1759 |
|
1760 |
-
public function unsetVariable($name) {
|
1761 |
-
unset($this->registeredVars[$name]);
|
1762 |
}
|
1763 |
|
1764 |
-
public function setImportDir($dirs) {
|
1765 |
-
$this->importDir = (array)$dirs;
|
1766 |
}
|
1767 |
|
1768 |
-
public function addImportDir($dir) {
|
1769 |
-
$this->importDir
|
1770 |
$this->importDir[] = $dir;
|
1771 |
}
|
1772 |
|
@@ -1774,222 +1903,222 @@ class seedprod_lessc {
|
|
1774 |
return $this->allParsedFiles;
|
1775 |
}
|
1776 |
|
1777 |
-
protected function addParsedFile($file) {
|
1778 |
-
$this->allParsedFiles[realpath($file)] = filemtime($file);
|
1779 |
}
|
1780 |
|
1781 |
/**
|
1782 |
* Uses the current value of $this->count to show line and line number
|
1783 |
*/
|
1784 |
-
protected function throwError($msg = null) {
|
1785 |
-
if ($this->sourceLoc >= 0) {
|
1786 |
-
$this->sourceParser->throwError($msg, $this->sourceLoc);
|
1787 |
}
|
1788 |
-
throw new exception($msg);
|
1789 |
}
|
1790 |
|
1791 |
// compile file $in to file $out if $in is newer than $out
|
1792 |
// returns true when it compiles, false otherwise
|
1793 |
-
public static function ccompile($in, $out, $less = null) {
|
1794 |
-
if ($less === null) {
|
1795 |
-
$less = new self;
|
1796 |
-
}
|
1797 |
-
return $less->checkedCompile($in, $out);
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
public static function cexecute($in, $force = false, $less = null) {
|
1801 |
-
if ($less === null) {
|
1802 |
-
$less = new self;
|
1803 |
-
}
|
1804 |
-
return $less->cachedCompile($in, $force);
|
1805 |
-
}
|
1806 |
-
|
1807 |
-
static
|
1808 |
-
'aliceblue'
|
1809 |
-
'antiquewhite'
|
1810 |
-
'aqua'
|
1811 |
-
'aquamarine'
|
1812 |
-
'azure'
|
1813 |
-
'beige'
|
1814 |
-
'bisque'
|
1815 |
-
'black'
|
1816 |
-
'blanchedalmond'
|
1817 |
-
'blue'
|
1818 |
-
'blueviolet'
|
1819 |
-
'brown'
|
1820 |
-
'burlywood'
|
1821 |
-
'cadetblue'
|
1822 |
-
'chartreuse'
|
1823 |
-
'chocolate'
|
1824 |
-
'coral'
|
1825 |
-
'cornflowerblue'
|
1826 |
-
'cornsilk'
|
1827 |
-
'crimson'
|
1828 |
-
'cyan'
|
1829 |
-
'darkblue'
|
1830 |
-
'darkcyan'
|
1831 |
-
'darkgoldenrod'
|
1832 |
-
'darkgray'
|
1833 |
-
'darkgreen'
|
1834 |
-
'darkgrey'
|
1835 |
-
'darkkhaki'
|
1836 |
-
'darkmagenta'
|
1837 |
-
'darkolivegreen'
|
1838 |
-
'darkorange'
|
1839 |
-
'darkorchid'
|
1840 |
-
'darkred'
|
1841 |
-
'darksalmon'
|
1842 |
-
'darkseagreen'
|
1843 |
-
'darkslateblue'
|
1844 |
-
'darkslategray'
|
1845 |
-
'darkslategrey'
|
1846 |
-
'darkturquoise'
|
1847 |
-
'darkviolet'
|
1848 |
-
'deeppink'
|
1849 |
-
'deepskyblue'
|
1850 |
-
'dimgray'
|
1851 |
-
'dimgrey'
|
1852 |
-
'dodgerblue'
|
1853 |
-
'firebrick'
|
1854 |
-
'floralwhite'
|
1855 |
-
'forestgreen'
|
1856 |
-
'fuchsia'
|
1857 |
-
'gainsboro'
|
1858 |
-
'ghostwhite'
|
1859 |
-
'gold'
|
1860 |
-
'goldenrod'
|
1861 |
-
'gray'
|
1862 |
-
'green'
|
1863 |
-
'greenyellow'
|
1864 |
-
'grey'
|
1865 |
-
'honeydew'
|
1866 |
-
'hotpink'
|
1867 |
-
'indianred'
|
1868 |
-
'indigo'
|
1869 |
-
'ivory'
|
1870 |
-
'khaki'
|
1871 |
-
'lavender'
|
1872 |
-
'lavenderblush'
|
1873 |
-
'lawngreen'
|
1874 |
-
'lemonchiffon'
|
1875 |
-
'lightblue'
|
1876 |
-
'lightcoral'
|
1877 |
-
'lightcyan'
|
1878 |
'lightgoldenrodyellow' => '250,250,210',
|
1879 |
-
'lightgray'
|
1880 |
-
'lightgreen'
|
1881 |
-
'lightgrey'
|
1882 |
-
'lightpink'
|
1883 |
-
'lightsalmon'
|
1884 |
-
'lightseagreen'
|
1885 |
-
'lightskyblue'
|
1886 |
-
'lightslategray'
|
1887 |
-
'lightslategrey'
|
1888 |
-
'lightsteelblue'
|
1889 |
-
'lightyellow'
|
1890 |
-
'lime'
|
1891 |
-
'limegreen'
|
1892 |
-
'linen'
|
1893 |
-
'magenta'
|
1894 |
-
'maroon'
|
1895 |
-
'mediumaquamarine'
|
1896 |
-
'mediumblue'
|
1897 |
-
'mediumorchid'
|
1898 |
-
'mediumpurple'
|
1899 |
-
'mediumseagreen'
|
1900 |
-
'mediumslateblue'
|
1901 |
-
'mediumspringgreen'
|
1902 |
-
'mediumturquoise'
|
1903 |
-
'mediumvioletred'
|
1904 |
-
'midnightblue'
|
1905 |
-
'mintcream'
|
1906 |
-
'mistyrose'
|
1907 |
-
'moccasin'
|
1908 |
-
'navajowhite'
|
1909 |
-
'navy'
|
1910 |
-
'oldlace'
|
1911 |
-
'olive'
|
1912 |
-
'olivedrab'
|
1913 |
-
'orange'
|
1914 |
-
'orangered'
|
1915 |
-
'orchid'
|
1916 |
-
'palegoldenrod'
|
1917 |
-
'palegreen'
|
1918 |
-
'paleturquoise'
|
1919 |
-
'palevioletred'
|
1920 |
-
'papayawhip'
|
1921 |
-
'peachpuff'
|
1922 |
-
'peru'
|
1923 |
-
'pink'
|
1924 |
-
'plum'
|
1925 |
-
'powderblue'
|
1926 |
-
'purple'
|
1927 |
-
'red'
|
1928 |
-
'rosybrown'
|
1929 |
-
'royalblue'
|
1930 |
-
'saddlebrown'
|
1931 |
-
'salmon'
|
1932 |
-
'sandybrown'
|
1933 |
-
'seagreen'
|
1934 |
-
'seashell'
|
1935 |
-
'sienna'
|
1936 |
-
'silver'
|
1937 |
-
'skyblue'
|
1938 |
-
'slateblue'
|
1939 |
-
'slategray'
|
1940 |
-
'slategrey'
|
1941 |
-
'snow'
|
1942 |
-
'springgreen'
|
1943 |
-
'steelblue'
|
1944 |
-
'tan'
|
1945 |
-
'teal'
|
1946 |
-
'thistle'
|
1947 |
-
'tomato'
|
1948 |
-
'turquoise'
|
1949 |
-
'violet'
|
1950 |
-
'wheat'
|
1951 |
-
'white'
|
1952 |
-
'whitesmoke'
|
1953 |
-
'yellow'
|
1954 |
-
'yellowgreen'
|
1955 |
);
|
1956 |
}
|
1957 |
|
1958 |
// responsible for taking a string of LESS code and converting it into a
|
1959 |
// syntax tree
|
1960 |
class seedprod_lessc_parser {
|
1961 |
-
static
|
1962 |
|
1963 |
-
static
|
1964 |
'=<' => 0,
|
1965 |
'>=' => 0,
|
1966 |
-
'='
|
1967 |
-
'<'
|
1968 |
-
'>'
|
1969 |
-
|
1970 |
-
'+'
|
1971 |
-
'-'
|
1972 |
-
'*'
|
1973 |
-
'/'
|
1974 |
-
'%'
|
1975 |
);
|
1976 |
|
1977 |
-
static
|
1978 |
-
static
|
1979 |
|
1980 |
-
static
|
1981 |
-
static
|
1982 |
-
static
|
1983 |
|
1984 |
// regex string to match any of the operators
|
1985 |
-
static
|
1986 |
|
1987 |
// these properties will supress division unless it's inside parenthases
|
1988 |
-
static
|
1989 |
-
array('/border-radius$/i', '/^font$/i');
|
1990 |
|
1991 |
-
protected $blockDirectives = array(
|
1992 |
-
protected $lineDirectives
|
1993 |
|
1994 |
/**
|
1995 |
* if we are in parens we can be more liberal with whitespace around
|
@@ -2003,9 +2132,9 @@ class seedprod_lessc_parser {
|
|
2003 |
protected $inParens = false;
|
2004 |
|
2005 |
// caches preg escaped literals
|
2006 |
-
static
|
2007 |
|
2008 |
-
public function __construct($seedprod_lessc, $sourceName = null) {
|
2009 |
$this->eatWhiteDefault = true;
|
2010 |
// reference to less needed for vPrefix, mPrefix, and parentSelector
|
2011 |
$this->seedprod_lessc = $seedprod_lessc;
|
@@ -2014,29 +2143,34 @@ class seedprod_lessc_parser {
|
|
2014 |
|
2015 |
$this->writeComments = false;
|
2016 |
|
2017 |
-
if (!self::$operatorString) {
|
2018 |
self::$operatorString =
|
2019 |
-
'('.implode(
|
2020 |
-
|
|
|
|
|
|
|
|
|
|
|
2021 |
|
2022 |
-
$commentSingle
|
2023 |
-
$commentMultiLeft
|
2024 |
-
$commentMultiRight = seedprod_lessc::preg_quote(self::$commentMultiRight);
|
2025 |
|
2026 |
-
self::$commentMulti = $commentMultiLeft.'.*?'
|
2027 |
-
self::$whitePattern = '/'
|
2028 |
}
|
2029 |
}
|
2030 |
|
2031 |
-
public function parse($buffer) {
|
2032 |
$this->count = 0;
|
2033 |
-
$this->line
|
2034 |
|
2035 |
-
$this->env
|
2036 |
-
$this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer);
|
2037 |
-
$this->pushSpecialBlock(
|
2038 |
$this->eatWhiteDefault = true;
|
2039 |
-
$this->seenComments
|
2040 |
|
2041 |
// trim whitespace on head
|
2042 |
// if (preg_match('/^\s+/', $this->buffer, $m)) {
|
@@ -2047,14 +2181,16 @@ class seedprod_lessc_parser {
|
|
2047 |
|
2048 |
// parse the entire file
|
2049 |
$lastCount = $this->count;
|
2050 |
-
while (false !== $this->parseChunk());
|
2051 |
|
2052 |
-
if ($this->count != strlen($this->buffer))
|
2053 |
$this->throwError();
|
|
|
2054 |
|
2055 |
// TODO report where the block was opened
|
2056 |
-
if (!is_null($this->env->parent))
|
2057 |
-
throw new exception('parse error: unclosed block');
|
|
|
2058 |
|
2059 |
return $this->env;
|
2060 |
}
|
@@ -2096,127 +2232,127 @@ class seedprod_lessc_parser {
|
|
2096 |
* go back where we started.
|
2097 |
*/
|
2098 |
protected function parseChunk() {
|
2099 |
-
if (empty($this->buffer))
|
|
|
|
|
2100 |
$s = $this->seek();
|
2101 |
|
2102 |
// setting a property
|
2103 |
-
if ($this->keyword($key) && $this->assign() &&
|
2104 |
-
$this->propertyValue($value, $key) && $this->end())
|
2105 |
-
|
2106 |
-
$this->append(array('assign', $key, $value), $s);
|
2107 |
return true;
|
2108 |
} else {
|
2109 |
-
$this->seek($s);
|
2110 |
}
|
2111 |
|
2112 |
-
|
2113 |
// look for special css blocks
|
2114 |
-
if ($this->literal('@', false)) {
|
2115 |
$this->count--;
|
2116 |
|
2117 |
// media
|
2118 |
-
if ($this->literal('@media')) {
|
2119 |
-
if (($this->mediaQueryList($mediaQueries) || true)
|
2120 |
-
&& $this->literal('{'))
|
2121 |
-
|
2122 |
-
$media = $
|
2123 |
-
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
|
2124 |
return true;
|
2125 |
} else {
|
2126 |
-
$this->seek($s);
|
2127 |
return false;
|
2128 |
}
|
2129 |
}
|
2130 |
|
2131 |
-
if ($this->literal(
|
2132 |
-
if ($this->isDirective($dirName, $this->blockDirectives)) {
|
2133 |
-
if (($this->openString(
|
2134 |
-
$this->literal(
|
2135 |
-
|
2136 |
-
$dir = $this->pushSpecialBlock("directive");
|
2137 |
$dir->name = $dirName;
|
2138 |
-
if (isset($dirValue))
|
|
|
|
|
2139 |
return true;
|
2140 |
}
|
2141 |
-
} elseif ($this->isDirective($dirName, $this->lineDirectives)) {
|
2142 |
-
if ($this->propertyValue($dirValue) && $this->end()) {
|
2143 |
-
$this->append(array(
|
2144 |
return true;
|
2145 |
}
|
2146 |
}
|
2147 |
}
|
2148 |
|
2149 |
-
$this->seek($s);
|
2150 |
}
|
2151 |
|
2152 |
// setting a variable
|
2153 |
-
if ($this->variable($var) && $this->assign() &&
|
2154 |
-
$this->propertyValue($value) && $this->end())
|
2155 |
-
|
2156 |
-
$this->append(array('assign', $var, $value), $s);
|
2157 |
return true;
|
2158 |
} else {
|
2159 |
-
$this->seek($s);
|
2160 |
}
|
2161 |
|
2162 |
-
if ($this->import($importValue)) {
|
2163 |
-
$this->append($importValue, $s);
|
2164 |
return true;
|
2165 |
}
|
2166 |
|
2167 |
// opening parametric mixin
|
2168 |
-
if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) &&
|
2169 |
-
($this->guards($guards) || true) &&
|
2170 |
-
$this->literal('{'))
|
2171 |
-
|
2172 |
-
$block
|
2173 |
-
$block->args = $args;
|
2174 |
$block->isVararg = $isVararg;
|
2175 |
-
if (!empty($guards))
|
|
|
|
|
2176 |
return true;
|
2177 |
} else {
|
2178 |
-
$this->seek($s);
|
2179 |
}
|
2180 |
|
2181 |
// opening a simple block
|
2182 |
-
if ($this->tags($tags) && $this->literal('{')) {
|
2183 |
-
$tags = $this->fixTags($tags);
|
2184 |
-
$this->pushBlock($tags);
|
2185 |
return true;
|
2186 |
} else {
|
2187 |
-
$this->seek($s);
|
2188 |
}
|
2189 |
|
2190 |
// closing a block
|
2191 |
-
if ($this->literal('}', false)) {
|
2192 |
try {
|
2193 |
$block = $this->pop();
|
2194 |
-
} catch (exception $e) {
|
2195 |
-
$this->seek($s);
|
2196 |
-
$this->throwError($e->getMessage());
|
2197 |
}
|
2198 |
|
2199 |
$hidden = false;
|
2200 |
-
if (is_null($block->type)) {
|
2201 |
$hidden = true;
|
2202 |
-
if (!isset($block->args)) {
|
2203 |
-
foreach ($block->tags as $tag) {
|
2204 |
-
if (!is_string($tag) || $tag[0] != $this->seedprod_lessc->mPrefix) {
|
2205 |
$hidden = false;
|
2206 |
break;
|
2207 |
}
|
2208 |
}
|
2209 |
}
|
2210 |
|
2211 |
-
foreach ($block->tags as $tag) {
|
2212 |
-
if (is_string($tag)) {
|
2213 |
-
$this->env->children[$tag][] = $block;
|
2214 |
}
|
2215 |
}
|
2216 |
}
|
2217 |
|
2218 |
-
if (
|
2219 |
-
$this->append(array('block', $block), $s);
|
2220 |
}
|
2221 |
|
2222 |
// this is done here so comments aren't bundled into he block that
|
@@ -2226,52 +2362,58 @@ class seedprod_lessc_parser {
|
|
2226 |
}
|
2227 |
|
2228 |
// mixin
|
2229 |
-
if ($this->mixinTags($tags) &&
|
2230 |
-
($this->argumentValues($argv) || true) &&
|
2231 |
-
($this->keyword($suffix) || true) && $this->end())
|
2232 |
-
|
2233 |
-
$
|
2234 |
-
$this->append(array('mixin', $tags, $argv, $suffix), $s);
|
2235 |
return true;
|
2236 |
} else {
|
2237 |
-
$this->seek($s);
|
2238 |
}
|
2239 |
|
2240 |
// spare ;
|
2241 |
-
if ($this->literal(';'))
|
|
|
|
|
2242 |
|
2243 |
return false; // got nothing, throw error
|
2244 |
}
|
2245 |
|
2246 |
-
protected function isDirective($dirname, $directives) {
|
2247 |
// TODO: cache pattern in parser
|
2248 |
-
$pattern = implode(
|
2249 |
-
|
|
|
|
|
2250 |
$pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i';
|
2251 |
|
2252 |
-
return preg_match($pattern, $dirname);
|
2253 |
}
|
2254 |
|
2255 |
-
protected function fixTags($tags) {
|
2256 |
// move @ tags out of variable namespace
|
2257 |
-
foreach ($tags as &$tag) {
|
2258 |
-
if ($tag[0] == $this->seedprod_lessc->vPrefix)
|
2259 |
$tag[0] = $this->seedprod_lessc->mPrefix;
|
|
|
2260 |
}
|
2261 |
return $tags;
|
2262 |
}
|
2263 |
|
2264 |
// a list of expressions
|
2265 |
-
protected function expressionList(&$exps) {
|
2266 |
$values = array();
|
2267 |
|
2268 |
-
while ($this->expression($exp)) {
|
2269 |
$values[] = $exp;
|
2270 |
}
|
2271 |
|
2272 |
-
if (count($values) == 0)
|
|
|
|
|
2273 |
|
2274 |
-
$exps = seedprod_lessc::compressList($values, ' ');
|
2275 |
return true;
|
2276 |
}
|
2277 |
|
@@ -2279,19 +2421,22 @@ class seedprod_lessc_parser {
|
|
2279 |
* Attempt to consume an expression.
|
2280 |
* @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code
|
2281 |
*/
|
2282 |
-
protected function expression(&$out) {
|
2283 |
-
if ($this->value($lhs)) {
|
2284 |
-
$out = $this->expHelper($lhs, 0);
|
2285 |
|
2286 |
// look for / shorthand
|
2287 |
-
if (!empty($this->env->supressedDivision)) {
|
2288 |
-
unset($this->env->supressedDivision);
|
2289 |
$s = $this->seek();
|
2290 |
-
if ($this->literal(
|
2291 |
-
$out = array(
|
2292 |
-
|
|
|
|
|
|
|
2293 |
} else {
|
2294 |
-
$this->seek($s);
|
2295 |
}
|
2296 |
}
|
2297 |
|
@@ -2303,41 +2448,42 @@ class seedprod_lessc_parser {
|
|
2303 |
/**
|
2304 |
* recursively parse infix equation with $lhs at precedence $minP
|
2305 |
*/
|
2306 |
-
protected function expHelper($lhs, $minP) {
|
2307 |
$this->inExp = true;
|
2308 |
-
$ss
|
2309 |
|
2310 |
-
while (true) {
|
2311 |
-
$whiteBefore = isset($this->buffer[$this->count - 1]) &&
|
2312 |
-
ctype_space($this->buffer[$this->count - 1]);
|
2313 |
|
2314 |
// If there is whitespace before the operator, then we require
|
2315 |
// whitespace after the operator for it to be an expression
|
2316 |
-
$needWhite = $whiteBefore &&
|
2317 |
|
2318 |
-
if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) {
|
2319 |
-
if (
|
2320 |
-
foreach (self::$supressDivisionProps as $pattern) {
|
2321 |
-
if (preg_match($pattern, $this->env->currentProperty)) {
|
2322 |
$this->env->supressedDivision = true;
|
2323 |
break 2;
|
2324 |
}
|
2325 |
}
|
2326 |
}
|
2327 |
|
|
|
|
|
2328 |
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
if (!$this->value($rhs)) break;
|
2333 |
|
2334 |
// peek for next operator to see what to do with rhs
|
2335 |
-
if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) {
|
2336 |
-
$rhs = $this->expHelper($rhs, self::$precedence[$next[1]]);
|
2337 |
}
|
2338 |
|
2339 |
-
$lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter);
|
2340 |
-
$ss
|
2341 |
|
2342 |
continue;
|
2343 |
}
|
@@ -2345,162 +2491,187 @@ class seedprod_lessc_parser {
|
|
2345 |
break;
|
2346 |
}
|
2347 |
|
2348 |
-
$this->seek($ss);
|
2349 |
|
2350 |
return $lhs;
|
2351 |
}
|
2352 |
|
2353 |
// consume a list of values for a property
|
2354 |
-
public function propertyValue(&$value, $keyName = null) {
|
2355 |
$values = array();
|
2356 |
|
2357 |
-
if ($keyName !== null)
|
|
|
|
|
2358 |
|
2359 |
$s = null;
|
2360 |
-
while ($this->expressionList($v)) {
|
2361 |
$values[] = $v;
|
2362 |
-
$s
|
2363 |
-
if (
|
|
|
|
|
2364 |
}
|
2365 |
|
2366 |
-
if ($s)
|
|
|
|
|
2367 |
|
2368 |
-
if ($keyName !== null)
|
|
|
|
|
2369 |
|
2370 |
-
if (count($values) == 0)
|
|
|
|
|
2371 |
|
2372 |
-
$value = seedprod_lessc::compressList($values, ', ');
|
2373 |
return true;
|
2374 |
}
|
2375 |
|
2376 |
-
protected function parenValue(&$out) {
|
2377 |
$s = $this->seek();
|
2378 |
|
2379 |
// speed shortcut
|
2380 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] !=
|
2381 |
return false;
|
2382 |
}
|
2383 |
|
2384 |
$inParens = $this->inParens;
|
2385 |
-
if ($this->literal(
|
2386 |
-
($this->inParens = true) && $this->expression($exp) &&
|
2387 |
-
$this->literal(
|
2388 |
-
|
2389 |
-
$out = $exp;
|
2390 |
$this->inParens = $inParens;
|
2391 |
return true;
|
2392 |
} else {
|
2393 |
$this->inParens = $inParens;
|
2394 |
-
$this->seek($s);
|
2395 |
}
|
2396 |
|
2397 |
return false;
|
2398 |
}
|
2399 |
|
2400 |
// a single value
|
2401 |
-
protected function value(&$value) {
|
2402 |
$s = $this->seek();
|
2403 |
|
2404 |
// speed shortcut
|
2405 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] ==
|
2406 |
// negation
|
2407 |
-
if ($this->literal(
|
2408 |
-
(($this->variable($inner) && $inner = array(
|
2409 |
-
$this->unit($inner) ||
|
2410 |
-
$this->parenValue($inner)))
|
2411 |
-
|
2412 |
-
$value = array("unary", "-", $inner);
|
2413 |
return true;
|
2414 |
} else {
|
2415 |
-
$this->seek($s);
|
2416 |
}
|
2417 |
}
|
2418 |
|
2419 |
-
if ($this->parenValue($value))
|
2420 |
-
|
2421 |
-
|
2422 |
-
if ($this->
|
2423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2424 |
|
2425 |
-
if ($this->keyword($word)) {
|
2426 |
-
$value = array('keyword', $word);
|
2427 |
return true;
|
2428 |
}
|
2429 |
|
2430 |
// try a variable
|
2431 |
-
if ($this->variable($var)) {
|
2432 |
-
$value = array('variable', $var);
|
2433 |
return true;
|
2434 |
}
|
2435 |
|
2436 |
// unquote string (should this work on any type?
|
2437 |
-
if ($this->literal(
|
2438 |
-
$value = array(
|
2439 |
return true;
|
2440 |
} else {
|
2441 |
-
$this->seek($s);
|
2442 |
}
|
2443 |
|
2444 |
// css hack: \0
|
2445 |
-
if ($this->literal('\\') && $this->match('([0-9]+)', $m)) {
|
2446 |
-
$value = array('keyword', '\\'
|
2447 |
return true;
|
2448 |
} else {
|
2449 |
-
$this->seek($s);
|
2450 |
}
|
2451 |
|
2452 |
return false;
|
2453 |
}
|
2454 |
|
2455 |
// an import statement
|
2456 |
-
protected function import(&$out) {
|
2457 |
$s = $this->seek();
|
2458 |
-
if (
|
|
|
|
|
2459 |
|
2460 |
// @import "something.css" media;
|
2461 |
// @import url("something.css") media;
|
2462 |
// @import url(something.css) media;
|
2463 |
|
2464 |
-
if ($this->propertyValue($value)) {
|
2465 |
-
$out = array(
|
2466 |
return true;
|
2467 |
}
|
2468 |
}
|
2469 |
|
2470 |
-
protected function mediaQueryList(&$out) {
|
2471 |
-
if ($this->genericList($list,
|
2472 |
$out = $list[2];
|
2473 |
return true;
|
2474 |
}
|
2475 |
return false;
|
2476 |
}
|
2477 |
|
2478 |
-
protected function mediaQuery(&$out) {
|
2479 |
$s = $this->seek();
|
2480 |
|
2481 |
$expressions = null;
|
2482 |
-
$parts
|
2483 |
|
2484 |
-
if (($this->literal(
|
2485 |
-
$prop = array(
|
2486 |
-
if (isset($only))
|
2487 |
-
|
2488 |
-
|
|
|
|
|
|
|
|
|
2489 |
$parts[] = $prop;
|
2490 |
} else {
|
2491 |
-
$this->seek($s);
|
2492 |
}
|
2493 |
|
2494 |
-
|
2495 |
-
if (!empty($mediaType) && !$this->literal("and")) {
|
2496 |
// ~
|
2497 |
} else {
|
2498 |
-
$this->genericList($expressions,
|
2499 |
-
if (is_array($expressions))
|
|
|
|
|
2500 |
}
|
2501 |
|
2502 |
-
if (count($parts) == 0) {
|
2503 |
-
$this->seek($s);
|
2504 |
return false;
|
2505 |
}
|
2506 |
|
@@ -2508,98 +2679,100 @@ class seedprod_lessc_parser {
|
|
2508 |
return true;
|
2509 |
}
|
2510 |
|
2511 |
-
protected function mediaExpression(&$out) {
|
2512 |
-
$s
|
2513 |
$value = null;
|
2514 |
-
if ($this->literal(
|
2515 |
-
$this->keyword($feature) &&
|
2516 |
-
($this->literal(
|
2517 |
-
$this->literal(
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
|
|
2521 |
return true;
|
2522 |
}
|
2523 |
|
2524 |
-
$this->seek($s);
|
2525 |
return false;
|
2526 |
}
|
2527 |
|
2528 |
// an unbounded string stopped by $end
|
2529 |
-
protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null) {
|
2530 |
-
$oldWhite
|
2531 |
$this->eatWhiteDefault = false;
|
2532 |
|
2533 |
-
$stop = array("'", '"',
|
2534 |
-
$stop = array_map(array(
|
2535 |
// $stop[] = self::$commentMulti;
|
2536 |
|
2537 |
-
if (!is_null($rejectStrs)) {
|
2538 |
-
$stop = array_merge($stop, $rejectStrs);
|
2539 |
}
|
2540 |
|
2541 |
-
$patt = '(.*?)('.implode(
|
2542 |
|
2543 |
$nestingLevel = 0;
|
2544 |
|
2545 |
$content = array();
|
2546 |
-
while ($this->match($patt, $m, false)) {
|
2547 |
-
if (!empty($m[1])) {
|
2548 |
$content[] = $m[1];
|
2549 |
-
if ($nestingOpen) {
|
2550 |
-
$nestingLevel += substr_count($m[1], $nestingOpen);
|
2551 |
}
|
2552 |
}
|
2553 |
|
2554 |
$tok = $m[2];
|
2555 |
|
2556 |
-
$this->count-= strlen($tok);
|
2557 |
-
if ($tok == $end) {
|
2558 |
-
if ($nestingLevel == 0) {
|
2559 |
break;
|
2560 |
} else {
|
2561 |
$nestingLevel--;
|
2562 |
}
|
2563 |
}
|
2564 |
|
2565 |
-
if (($tok == "'" || $tok == '"') && $this->lstring($str)) {
|
2566 |
$content[] = $str;
|
2567 |
continue;
|
2568 |
}
|
2569 |
|
2570 |
-
if ($tok ==
|
2571 |
$content[] = $inter;
|
2572 |
continue;
|
2573 |
}
|
2574 |
|
2575 |
-
if (in_array($tok, $rejectStrs)) {
|
2576 |
$count = null;
|
2577 |
break;
|
2578 |
}
|
2579 |
|
2580 |
-
|
2581 |
-
$
|
2582 |
-
$this->count+= strlen($tok);
|
2583 |
}
|
2584 |
|
2585 |
$this->eatWhiteDefault = $oldWhite;
|
2586 |
|
2587 |
-
if (count($content) == 0)
|
|
|
|
|
2588 |
|
2589 |
// trim the end
|
2590 |
-
if (is_string(end($content))) {
|
2591 |
-
$content[count($content) - 1] = rtrim(end($content));
|
2592 |
}
|
2593 |
|
2594 |
-
$out = array(
|
2595 |
return true;
|
2596 |
}
|
2597 |
|
2598 |
-
protected function lstring(&$out) {
|
2599 |
$s = $this->seek();
|
2600 |
-
if ($this->literal('"', false)) {
|
2601 |
$delim = '"';
|
2602 |
-
} elseif ($this->literal("'", false)) {
|
2603 |
$delim = "'";
|
2604 |
} else {
|
2605 |
return false;
|
@@ -2609,84 +2782,87 @@ class seedprod_lessc_parser {
|
|
2609 |
|
2610 |
// look for either ending delim , escape, or string interpolation
|
2611 |
$patt = '([^\n]*?)(@\{|\\\\|' .
|
2612 |
-
seedprod_lessc::preg_quote($delim).')';
|
2613 |
|
2614 |
-
$oldWhite
|
2615 |
$this->eatWhiteDefault = false;
|
2616 |
|
2617 |
-
while ($this->match($patt, $m, false)) {
|
2618 |
$content[] = $m[1];
|
2619 |
-
if ($m[2] ==
|
2620 |
-
$this->count -= strlen($m[2]);
|
2621 |
-
if ($this->interpolation($inter, false)) {
|
2622 |
$content[] = $inter;
|
2623 |
} else {
|
2624 |
-
$this->count += strlen($m[2]);
|
2625 |
-
$content[]
|
2626 |
}
|
2627 |
-
} elseif ($m[2] == '\\') {
|
2628 |
$content[] = $m[2];
|
2629 |
-
if ($this->literal($delim, false)) {
|
2630 |
$content[] = $delim;
|
2631 |
}
|
2632 |
} else {
|
2633 |
-
$this->count -= strlen($delim);
|
2634 |
break; // delim
|
2635 |
}
|
2636 |
}
|
2637 |
|
2638 |
$this->eatWhiteDefault = $oldWhite;
|
2639 |
|
2640 |
-
if ($this->literal($delim)) {
|
2641 |
-
$out = array(
|
2642 |
return true;
|
2643 |
}
|
2644 |
|
2645 |
-
$this->seek($s);
|
2646 |
return false;
|
2647 |
}
|
2648 |
|
2649 |
-
protected function interpolation(&$out) {
|
2650 |
-
$oldWhite
|
2651 |
$this->eatWhiteDefault = true;
|
2652 |
|
2653 |
$s = $this->seek();
|
2654 |
-
if ($this->literal(
|
2655 |
-
$this->keyword($var) &&
|
2656 |
-
$this->literal(
|
2657 |
-
|
2658 |
-
$out = array("variable", $this->seedprod_lessc->vPrefix . $var);
|
2659 |
$this->eatWhiteDefault = $oldWhite;
|
2660 |
-
if ($this->eatWhiteDefault)
|
|
|
|
|
2661 |
return true;
|
2662 |
}
|
2663 |
|
2664 |
$this->eatWhiteDefault = $oldWhite;
|
2665 |
-
$this->seek($s);
|
2666 |
return false;
|
2667 |
}
|
2668 |
|
2669 |
-
protected function unit(&$unit) {
|
2670 |
// speed shortcut
|
2671 |
-
if (isset($this->buffer[$this->count])) {
|
2672 |
-
$char = $this->buffer[$this->count];
|
2673 |
-
if (!ctype_digit($char) && $char !=
|
|
|
|
|
2674 |
}
|
2675 |
|
2676 |
-
if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) {
|
2677 |
-
$unit = array(
|
2678 |
return true;
|
2679 |
}
|
2680 |
return false;
|
2681 |
}
|
2682 |
|
2683 |
// a # color
|
2684 |
-
protected function color(&$out) {
|
2685 |
-
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
|
2686 |
-
if (strlen($m[1]) > 7) {
|
2687 |
-
$out = array(
|
2688 |
} else {
|
2689 |
-
$out = array(
|
2690 |
}
|
2691 |
return true;
|
2692 |
}
|
@@ -2695,22 +2871,29 @@ class seedprod_lessc_parser {
|
|
2695 |
}
|
2696 |
|
2697 |
// consume a list of property values delimited by ; and wrapped in ()
|
2698 |
-
protected function argumentValues(&$args, $delim = ',') {
|
2699 |
$s = $this->seek();
|
2700 |
-
if (
|
|
|
|
|
2701 |
|
2702 |
$values = array();
|
2703 |
-
while (true) {
|
2704 |
-
if ($this->expressionList($value))
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
|
|
|
|
|
|
|
|
|
|
2708 |
$value = null;
|
2709 |
}
|
2710 |
}
|
2711 |
|
2712 |
-
if (
|
2713 |
-
$this->seek($s);
|
2714 |
return false;
|
2715 |
}
|
2716 |
|
@@ -2721,45 +2904,51 @@ class seedprod_lessc_parser {
|
|
2721 |
// consume an argument definition list surrounded by ()
|
2722 |
// each argument is a variable name with optional value
|
2723 |
// or at the end a ... or a variable named followed by ...
|
2724 |
-
protected function argumentDef(&$args, &$isVararg, $delim = ',') {
|
2725 |
$s = $this->seek();
|
2726 |
-
if (
|
|
|
|
|
2727 |
|
2728 |
$values = array();
|
2729 |
|
2730 |
$isVararg = false;
|
2731 |
-
while (true) {
|
2732 |
-
if ($this->literal(
|
2733 |
$isVararg = true;
|
2734 |
break;
|
2735 |
}
|
2736 |
|
2737 |
-
if ($this->variable($vname)) {
|
2738 |
-
$arg = array(
|
2739 |
-
$ss
|
2740 |
-
if ($this->assign() && $this->expressionList($value)) {
|
2741 |
$arg[] = $value;
|
2742 |
} else {
|
2743 |
-
$this->seek($ss);
|
2744 |
-
if ($this->literal(
|
2745 |
-
$arg[0]
|
2746 |
$isVararg = true;
|
2747 |
}
|
2748 |
}
|
2749 |
$values[] = $arg;
|
2750 |
-
if ($isVararg)
|
|
|
|
|
2751 |
continue;
|
2752 |
}
|
2753 |
|
2754 |
-
if ($this->value($literal)) {
|
2755 |
-
$values[] = array(
|
2756 |
}
|
2757 |
|
2758 |
-
if (
|
|
|
|
|
2759 |
}
|
2760 |
|
2761 |
-
if (
|
2762 |
-
$this->seek($s);
|
2763 |
return false;
|
2764 |
}
|
2765 |
|
@@ -2770,159 +2959,176 @@ class seedprod_lessc_parser {
|
|
2770 |
|
2771 |
// consume a list of tags
|
2772 |
// this accepts a hanging delimiter
|
2773 |
-
protected function tags(&$tags, $simple = false, $delim = ',') {
|
2774 |
$tags = array();
|
2775 |
-
while ($this->tag($tt, $simple)) {
|
2776 |
$tags[] = $tt;
|
2777 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
2778 |
}
|
2779 |
-
if (count($tags) == 0) return false;
|
2780 |
|
2781 |
return true;
|
2782 |
}
|
2783 |
|
2784 |
// list of tags of specifying mixin path
|
2785 |
// optionally separated by > (lazy, accepts extra >)
|
2786 |
-
protected function mixinTags(&$tags) {
|
2787 |
-
$s
|
2788 |
$tags = array();
|
2789 |
-
while ($this->tag($tt, true)) {
|
2790 |
$tags[] = $tt;
|
2791 |
-
$this->literal(
|
2792 |
}
|
2793 |
|
2794 |
-
if (count($tags) == 0)
|
|
|
|
|
2795 |
|
2796 |
return true;
|
2797 |
}
|
2798 |
|
2799 |
// a bracketed value (contained within in a tag definition)
|
2800 |
-
protected function tagBracket(&$value) {
|
2801 |
// speed shortcut
|
2802 |
-
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] !=
|
2803 |
return false;
|
2804 |
}
|
2805 |
|
2806 |
$s = $this->seek();
|
2807 |
-
if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) {
|
2808 |
-
$value = '['
|
2809 |
// whitespace?
|
2810 |
-
if ($this->whitespace())
|
|
|
|
|
2811 |
|
2812 |
// escape parent selector, (yuck)
|
2813 |
-
$value = str_replace($this->seedprod_lessc->parentSelector,
|
2814 |
return true;
|
2815 |
}
|
2816 |
|
2817 |
-
$this->seek($s);
|
2818 |
return false;
|
2819 |
}
|
2820 |
|
2821 |
-
protected function tagExpression(&$value) {
|
2822 |
$s = $this->seek();
|
2823 |
-
if ($this->literal(
|
2824 |
-
$value = array('exp', $exp);
|
2825 |
return true;
|
2826 |
}
|
2827 |
|
2828 |
-
$this->seek($s);
|
2829 |
return false;
|
2830 |
}
|
2831 |
|
2832 |
// a single tag
|
2833 |
-
protected function tag(&$tag, $simple = false) {
|
2834 |
-
if ($simple)
|
2835 |
$chars = '^,:;{}\][>\(\) "\'';
|
2836 |
-
else
|
2837 |
$chars = '^,;{}["\'';
|
|
|
2838 |
|
2839 |
-
if (
|
2840 |
return true;
|
2841 |
}
|
2842 |
|
2843 |
$tag = '';
|
2844 |
-
while ($this->tagBracket($first))
|
|
|
|
|
2845 |
|
2846 |
-
while (true) {
|
2847 |
-
if ($this->match('(['
|
2848 |
$tag .= $m[1];
|
2849 |
-
if ($simple)
|
|
|
|
|
2850 |
|
2851 |
-
while ($this->tagBracket($brack))
|
|
|
|
|
2852 |
continue;
|
2853 |
-
} elseif ($this->unit($unit)) { // for keyframes
|
2854 |
$tag .= $unit[1] . $unit[2];
|
2855 |
continue;
|
2856 |
}
|
2857 |
break;
|
2858 |
}
|
2859 |
|
2860 |
-
|
2861 |
-
$tag
|
2862 |
-
|
|
|
2863 |
|
2864 |
return true;
|
2865 |
}
|
2866 |
|
2867 |
// a css function
|
2868 |
-
protected function func(&$func) {
|
2869 |
$s = $this->seek();
|
2870 |
|
2871 |
-
if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
|
2872 |
$fname = $m[1];
|
2873 |
|
2874 |
$sPreArgs = $this->seek();
|
2875 |
|
2876 |
$args = array();
|
2877 |
-
while (true) {
|
2878 |
$ss = $this->seek();
|
2879 |
// this ugly nonsense is for ie filter properties
|
2880 |
-
if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) {
|
2881 |
-
$args[] = array(
|
2882 |
} else {
|
2883 |
-
$this->seek($ss);
|
2884 |
-
if ($this->expressionList($value)) {
|
2885 |
$args[] = $value;
|
2886 |
}
|
2887 |
}
|
2888 |
|
2889 |
-
if (
|
|
|
|
|
2890 |
}
|
2891 |
-
$args = array('list', ',', $args);
|
2892 |
|
2893 |
-
if ($this->literal(')')) {
|
2894 |
-
$func = array('function', $fname, $args);
|
2895 |
return true;
|
2896 |
-
} elseif ($fname == 'url') {
|
2897 |
// couldn't parse and in url? treat as string
|
2898 |
-
$this->seek($sPreArgs);
|
2899 |
-
if ($this->openString(
|
2900 |
-
$func = array('function', $fname, $string);
|
2901 |
return true;
|
2902 |
}
|
2903 |
}
|
2904 |
}
|
2905 |
|
2906 |
-
$this->seek($s);
|
2907 |
return false;
|
2908 |
}
|
2909 |
|
2910 |
// consume a less variable
|
2911 |
-
protected function variable(&$name) {
|
2912 |
$s = $this->seek();
|
2913 |
-
if ($this->literal($this->seedprod_lessc->vPrefix, false) &&
|
2914 |
-
($this->variable($sub) || $this->keyword($name)))
|
2915 |
-
|
2916 |
-
|
2917 |
-
$name = array('variable', $sub);
|
2918 |
} else {
|
2919 |
-
$name = $this->seedprod_lessc->vPrefix
|
2920 |
}
|
2921 |
return true;
|
2922 |
}
|
2923 |
|
2924 |
$name = null;
|
2925 |
-
$this->seek($s);
|
2926 |
return false;
|
2927 |
}
|
2928 |
|
@@ -2930,14 +3136,16 @@ class seedprod_lessc_parser {
|
|
2930 |
* Consume an assignment operator
|
2931 |
* Can optionally take a name that will be set to the current property name
|
2932 |
*/
|
2933 |
-
protected function assign($name = null) {
|
2934 |
-
if ($name)
|
2935 |
-
|
|
|
|
|
2936 |
}
|
2937 |
|
2938 |
// consume a keyword
|
2939 |
-
protected function keyword(&$word) {
|
2940 |
-
if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) {
|
2941 |
$word = $m[1];
|
2942 |
return true;
|
2943 |
}
|
@@ -2946,33 +3154,35 @@ class seedprod_lessc_parser {
|
|
2946 |
|
2947 |
// consume an end of statement delimiter
|
2948 |
protected function end() {
|
2949 |
-
if ($this->literal(';')) {
|
2950 |
return true;
|
2951 |
-
} elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') {
|
2952 |
// if there is end of file or a closing block next then we don't need a ;
|
2953 |
return true;
|
2954 |
}
|
2955 |
return false;
|
2956 |
}
|
2957 |
|
2958 |
-
protected function guards(&$guards) {
|
2959 |
$s = $this->seek();
|
2960 |
|
2961 |
-
if (
|
2962 |
-
$this->seek($s);
|
2963 |
return false;
|
2964 |
}
|
2965 |
|
2966 |
$guards = array();
|
2967 |
|
2968 |
-
while ($this->guardGroup($g)) {
|
2969 |
$guards[] = $g;
|
2970 |
-
if (
|
|
|
|
|
2971 |
}
|
2972 |
|
2973 |
-
if (count($guards) == 0) {
|
2974 |
$guards = null;
|
2975 |
-
$this->seek($s);
|
2976 |
return false;
|
2977 |
}
|
2978 |
|
@@ -2981,46 +3191,52 @@ class seedprod_lessc_parser {
|
|
2981 |
|
2982 |
// a bunch of guards that are and'd together
|
2983 |
// TODO rename to guardGroup
|
2984 |
-
protected function guardGroup(&$guardGroup) {
|
2985 |
-
$s
|
2986 |
$guardGroup = array();
|
2987 |
-
while ($this->guard($guard)) {
|
2988 |
$guardGroup[] = $guard;
|
2989 |
-
if (
|
|
|
|
|
2990 |
}
|
2991 |
|
2992 |
-
if (count($guardGroup) == 0) {
|
2993 |
$guardGroup = null;
|
2994 |
-
$this->seek($s);
|
2995 |
return false;
|
2996 |
}
|
2997 |
|
2998 |
return true;
|
2999 |
}
|
3000 |
|
3001 |
-
protected function guard(&$guard) {
|
3002 |
-
$s
|
3003 |
-
$negate = $this->literal(
|
3004 |
|
3005 |
-
if ($this->literal(
|
3006 |
$guard = $exp;
|
3007 |
-
if (
|
|
|
|
|
3008 |
return true;
|
3009 |
}
|
3010 |
|
3011 |
-
$this->seek($s);
|
3012 |
return false;
|
3013 |
}
|
3014 |
|
3015 |
/* raw parsing functions */
|
3016 |
|
3017 |
-
protected function literal($what, $eatWhitespace = null) {
|
3018 |
-
if ($eatWhitespace === null)
|
|
|
|
|
3019 |
|
3020 |
// shortcut on single letter
|
3021 |
-
if (!isset($what[1]) && isset($this->buffer[$this->count])) {
|
3022 |
-
if ($this->buffer[$this->count] == $what) {
|
3023 |
-
if (
|
3024 |
$this->count++;
|
3025 |
return true;
|
3026 |
}
|
@@ -3030,32 +3246,34 @@ class seedprod_lessc_parser {
|
|
3030 |
}
|
3031 |
}
|
3032 |
|
3033 |
-
if (!isset(self::$literalCache[$what])) {
|
3034 |
-
self::$literalCache[$what] = seedprod_lessc::preg_quote($what);
|
3035 |
}
|
3036 |
|
3037 |
-
return $this->match(self::$literalCache[$what], $m, $eatWhitespace);
|
3038 |
}
|
3039 |
|
3040 |
-
protected function genericList(&$out, $parseItem, $delim=
|
3041 |
-
$s
|
3042 |
$items = array();
|
3043 |
-
while ($this->$parseItem($value)) {
|
3044 |
$items[] = $value;
|
3045 |
-
if ($delim) {
|
3046 |
-
if (
|
|
|
|
|
3047 |
}
|
3048 |
}
|
3049 |
|
3050 |
-
if (count($items) == 0) {
|
3051 |
-
$this->seek($s);
|
3052 |
return false;
|
3053 |
}
|
3054 |
|
3055 |
-
if ($flatten && count($items) == 1) {
|
3056 |
$out = $items[0];
|
3057 |
} else {
|
3058 |
-
$out = array(
|
3059 |
}
|
3060 |
|
3061 |
return true;
|
@@ -3065,26 +3283,34 @@ class seedprod_lessc_parser {
|
|
3065 |
// advance counter to next occurrence of $what
|
3066 |
// $until - don't include $what in advance
|
3067 |
// $allowNewline, if string, will be used as valid char set
|
3068 |
-
protected function to($what, &$out, $until = false, $allowNewline = false) {
|
3069 |
-
if (is_string($allowNewline)) {
|
3070 |
$validChars = $allowNewline;
|
3071 |
} else {
|
3072 |
-
$validChars = $allowNewline ?
|
|
|
|
|
|
|
|
|
|
|
|
|
3073 |
}
|
3074 |
-
if (!$this->match('('.$validChars.'*?)'.seedprod_lessc::preg_quote($what), $m, !$until)) return false;
|
3075 |
-
if ($until) $this->count -= strlen($what); // give back $what
|
3076 |
$out = $m[1];
|
3077 |
return true;
|
3078 |
}
|
3079 |
|
3080 |
// try to match something on head of buffer
|
3081 |
-
protected function match($regex, &$out, $eatWhitespace = null) {
|
3082 |
-
if ($eatWhitespace === null)
|
|
|
|
|
3083 |
|
3084 |
-
$r = '/'
|
3085 |
-
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
|
3086 |
-
$this->count += strlen($out[0]);
|
3087 |
-
if ($eatWhitespace && $this->writeComments)
|
|
|
|
|
3088 |
return true;
|
3089 |
}
|
3090 |
return false;
|
@@ -3092,72 +3318,77 @@ class seedprod_lessc_parser {
|
|
3092 |
|
3093 |
// match some whitespace
|
3094 |
protected function whitespace() {
|
3095 |
-
if ($this->writeComments) {
|
3096 |
$gotWhite = false;
|
3097 |
-
while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) {
|
3098 |
-
if (isset($m[1]) && empty($this->commentsSeen[$this->count])) {
|
3099 |
-
$this->append(array(
|
3100 |
-
$this->commentsSeen[$this->count] = true;
|
3101 |
}
|
3102 |
-
$this->count += strlen($m[0]);
|
3103 |
-
$gotWhite
|
3104 |
}
|
3105 |
return $gotWhite;
|
3106 |
} else {
|
3107 |
-
$this->match(
|
3108 |
-
return strlen($m[0]) > 0;
|
3109 |
}
|
3110 |
}
|
3111 |
|
3112 |
// match something without consuming it
|
3113 |
-
protected function peek($regex, &$out = null, $from=null) {
|
3114 |
-
if (is_null($from))
|
3115 |
-
|
3116 |
-
|
|
|
|
|
3117 |
|
3118 |
return $result;
|
3119 |
}
|
3120 |
|
3121 |
// seek to a spot in the buffer or return where we are on no argument
|
3122 |
-
protected function seek($where = null) {
|
3123 |
-
if ($where === null)
|
3124 |
-
|
|
|
|
|
|
|
3125 |
return true;
|
3126 |
}
|
3127 |
|
3128 |
/* misc functions */
|
3129 |
|
3130 |
-
public function throwError($msg =
|
3131 |
-
$count = is_null($count) ? $this->count : $count;
|
3132 |
|
3133 |
$line = $this->line +
|
3134 |
-
substr_count(substr($this->buffer, 0, $count), "\n");
|
3135 |
|
3136 |
-
if (!empty($this->sourceName)) {
|
3137 |
$loc = "$this->sourceName on line $line";
|
3138 |
} else {
|
3139 |
$loc = "line: $line";
|
3140 |
}
|
3141 |
|
3142 |
// TODO this depends on $this->count
|
3143 |
-
if ($this->peek("(.*?)(\n|$)", $m, $count)) {
|
3144 |
-
throw new exception("$msg: failed at `$m[1]` $loc");
|
3145 |
} else {
|
3146 |
-
throw new exception("$msg: $loc");
|
3147 |
}
|
3148 |
}
|
3149 |
|
3150 |
-
protected function pushBlock($selectors=null, $type=null) {
|
3151 |
-
$b
|
3152 |
$b->parent = $this->env;
|
3153 |
|
3154 |
$b->type = $type;
|
3155 |
-
$b->id
|
3156 |
|
3157 |
$b->isVararg = false; // TODO: kill me from here
|
3158 |
-
$b->tags
|
3159 |
|
3160 |
-
$b->props
|
3161 |
$b->children = array();
|
3162 |
|
3163 |
$this->env = $b;
|
@@ -3165,95 +3396,112 @@ class seedprod_lessc_parser {
|
|
3165 |
}
|
3166 |
|
3167 |
// push a block that doesn't multiply tags
|
3168 |
-
protected function pushSpecialBlock($type) {
|
3169 |
-
return $this->pushBlock(null, $type);
|
3170 |
}
|
3171 |
|
3172 |
// append a property to the current block
|
3173 |
-
protected function append($prop, $pos = null) {
|
3174 |
-
if ($pos !== null)
|
|
|
|
|
3175 |
$this->env->props[] = $prop;
|
3176 |
}
|
3177 |
|
3178 |
// pop something off the stack
|
3179 |
protected function pop() {
|
3180 |
-
$old
|
3181 |
$this->env = $this->env->parent;
|
3182 |
return $old;
|
3183 |
}
|
3184 |
|
3185 |
// remove comments from $text
|
3186 |
// todo: make it work for all functions, not just url
|
3187 |
-
protected function removeComments($text) {
|
3188 |
$look = array(
|
3189 |
-
'url(',
|
|
|
|
|
|
|
|
|
3190 |
);
|
3191 |
|
3192 |
$out = '';
|
3193 |
$min = null;
|
3194 |
-
while (true) {
|
3195 |
// find the next item
|
3196 |
-
foreach ($look as $token) {
|
3197 |
-
$pos = strpos($text, $token);
|
3198 |
-
if ($pos !== false) {
|
3199 |
-
if (!isset($min) || $pos < $min[1])
|
|
|
|
|
3200 |
}
|
3201 |
}
|
3202 |
|
3203 |
-
if (is_null($min))
|
|
|
|
|
3204 |
|
3205 |
-
$count
|
3206 |
-
$skip
|
3207 |
$newlines = 0;
|
3208 |
-
switch ($min[0]) {
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
|
|
|
|
|
|
|
|
|
|
3229 |
}
|
3230 |
|
3231 |
-
if ($skip == 0)
|
|
|
|
|
3232 |
|
3233 |
-
$out .= substr($text, 0, $count).str_repeat("\n", $newlines);
|
3234 |
-
$text = substr($text, $count + $skip);
|
3235 |
|
3236 |
$min = null;
|
3237 |
}
|
3238 |
|
3239 |
-
return $out
|
3240 |
}
|
3241 |
|
3242 |
}
|
3243 |
|
3244 |
class seedprod_lessc_formatter_classic {
|
3245 |
-
public $indentChar =
|
3246 |
|
3247 |
-
public $break
|
3248 |
-
public $open
|
3249 |
-
public $close
|
3250 |
-
public $selectorSeparator =
|
3251 |
-
public $assignSeparator
|
3252 |
|
3253 |
-
public $openSingle
|
3254 |
-
public $closeSingle =
|
3255 |
|
3256 |
-
public $disableSingle
|
3257 |
public $breakSelectors = false;
|
3258 |
|
3259 |
public $compressColors = false;
|
@@ -3262,18 +3510,20 @@ class seedprod_lessc_formatter_classic {
|
|
3262 |
$this->indentLevel = 0;
|
3263 |
}
|
3264 |
|
3265 |
-
public function indentStr($n = 0) {
|
3266 |
-
return str_repeat($this->indentChar, max($this->indentLevel + $n, 0));
|
3267 |
}
|
3268 |
|
3269 |
-
public function property($name, $value) {
|
3270 |
-
return $name . $this->assignSeparator . $value .
|
3271 |
}
|
3272 |
|
3273 |
-
protected function isEmpty($block) {
|
3274 |
-
if (empty($block->lines)) {
|
3275 |
-
foreach ($block->children as $child) {
|
3276 |
-
if (
|
|
|
|
|
3277 |
}
|
3278 |
|
3279 |
return true;
|
@@ -3281,51 +3531,54 @@ class seedprod_lessc_formatter_classic {
|
|
3281 |
return false;
|
3282 |
}
|
3283 |
|
3284 |
-
public function block($block) {
|
3285 |
-
if ($this->isEmpty($block))
|
|
|
|
|
3286 |
|
3287 |
$inner = $pre = $this->indentStr();
|
3288 |
|
3289 |
-
$isSingle =
|
3290 |
-
is_null($block->type) && count($block->lines) == 1;
|
3291 |
|
3292 |
-
if (!empty($block->selectors)) {
|
3293 |
$this->indentLevel++;
|
3294 |
|
3295 |
-
if ($this->breakSelectors) {
|
3296 |
$selectorSeparator = $this->selectorSeparator . $this->break . $pre;
|
3297 |
} else {
|
3298 |
$selectorSeparator = $this->selectorSeparator;
|
3299 |
}
|
3300 |
|
3301 |
echo $pre .
|
3302 |
-
implode($selectorSeparator, $block->selectors);
|
3303 |
-
if ($isSingle) {
|
3304 |
echo $this->openSingle;
|
3305 |
-
$inner =
|
3306 |
} else {
|
3307 |
echo $this->open . $this->break;
|
3308 |
$inner = $this->indentStr();
|
3309 |
}
|
3310 |
-
|
3311 |
}
|
3312 |
|
3313 |
-
if (!empty($block->lines)) {
|
3314 |
-
$glue = $this->break
|
3315 |
-
echo $inner . implode($glue, $block->lines);
|
3316 |
-
if (
|
3317 |
echo $this->break;
|
3318 |
}
|
3319 |
}
|
3320 |
|
3321 |
-
foreach ($block->children as $child) {
|
3322 |
-
$this->block($child);
|
3323 |
}
|
3324 |
|
3325 |
-
if (!empty($block->selectors)) {
|
3326 |
-
if (
|
|
|
|
|
3327 |
|
3328 |
-
if ($isSingle) {
|
3329 |
echo $this->closeSingle . $this->break;
|
3330 |
} else {
|
3331 |
echo $pre . $this->close . $this->break;
|
@@ -3337,23 +3590,23 @@ class seedprod_lessc_formatter_classic {
|
|
3337 |
}
|
3338 |
|
3339 |
class seedprod_lessc_formatter_compressed extends seedprod_lessc_formatter_classic {
|
3340 |
-
public $disableSingle
|
3341 |
-
public $open
|
3342 |
-
public $selectorSeparator =
|
3343 |
-
public $assignSeparator
|
3344 |
-
public $break
|
3345 |
-
public $compressColors
|
3346 |
|
3347 |
-
public function indentStr($n = 0) {
|
3348 |
-
return
|
3349 |
}
|
3350 |
}
|
3351 |
|
3352 |
class seedprod_lessc_formatter_lessjs extends seedprod_lessc_formatter_classic {
|
3353 |
-
public $disableSingle
|
3354 |
-
public $breakSelectors
|
3355 |
-
public $assignSeparator
|
3356 |
-
public $selectorSeparator =
|
3357 |
}
|
3358 |
|
3359 |
|
38 |
* handling things like indentation.
|
39 |
*/
|
40 |
class seedprod_lessc {
|
41 |
+
public static $VERSION = 'v0.3.8';
|
42 |
+
protected static $TRUE = array( 'keyword', 'true' );
|
43 |
+
protected static $FALSE = array( 'keyword', 'false' );
|
44 |
|
45 |
+
protected $libFunctions = array();
|
46 |
+
protected $registeredVars = array();
|
47 |
protected $preserveComments = false;
|
48 |
|
49 |
+
public $vPrefix = '@'; // prefix of abstract properties
|
50 |
+
public $mPrefix = '$'; // prefix of abstract blocks
|
51 |
public $parentSelector = '&';
|
52 |
|
53 |
public $importDisabled = false;
|
54 |
+
public $importDir = '';
|
55 |
|
56 |
protected $numberPrecision = null;
|
57 |
|
58 |
// set to the parser that generated the current line when compiling
|
59 |
// so we know how to create error messages
|
60 |
protected $sourceParser = null;
|
61 |
+
protected $sourceLoc = null;
|
62 |
|
63 |
+
public static $defaultValue = array( 'keyword', '' );
|
64 |
|
65 |
+
protected static $nextImportId = 0; // uniquely identify imports
|
66 |
|
67 |
// attempts to find the path of an import url, returns null for css files
|
68 |
+
protected function findImport( $url ) {
|
69 |
+
foreach ( (array) $this->importDir as $dir ) {
|
70 |
+
$full = $dir . ( substr( $dir, -1 ) != '/' ? '/' : '' ) . $url;
|
71 |
+
if ( $this->fileExists( $file = $full . '.less' ) || $this->fileExists( $file = $full ) ) {
|
72 |
return $file;
|
73 |
}
|
74 |
}
|
76 |
return null;
|
77 |
}
|
78 |
|
79 |
+
protected function fileExists( $name ) {
|
80 |
+
return is_file( $name );
|
81 |
}
|
82 |
|
83 |
+
public static function compressList( $items, $delim ) {
|
84 |
+
if ( ! isset( $items[1] ) && isset( $items[0] ) ) {
|
85 |
+
return $items[0];
|
86 |
+
} else {
|
87 |
+
return array( 'list', $delim, $items );
|
88 |
+
}
|
89 |
}
|
90 |
|
91 |
+
public static function preg_quote( $what ) {
|
92 |
+
return preg_quote( $what, '/' );
|
93 |
}
|
94 |
|
95 |
+
protected function tryImport( $importPath, $parentBlock, $out ) {
|
96 |
+
if ( $importPath[0] == 'function' && $importPath[1] == 'url' ) {
|
97 |
+
$importPath = $this->flattenList( $importPath[2] );
|
98 |
}
|
99 |
|
100 |
+
$str = $this->coerceString( $importPath );
|
101 |
+
if ( $str === null ) {
|
102 |
+
return false;
|
103 |
+
}
|
104 |
|
105 |
+
$url = $this->compileValue( $this->lib_e( $str ) );
|
106 |
|
107 |
// don't import if it ends in css
|
108 |
+
if ( substr_compare( $url, '.css', -4, 4 ) === 0 ) {
|
109 |
+
return false;
|
110 |
+
}
|
111 |
|
112 |
+
$realPath = $this->findImport( $url );
|
113 |
+
if ( $realPath === null ) {
|
114 |
+
return false;
|
115 |
+
}
|
116 |
|
117 |
+
if ( $this->importDisabled ) {
|
118 |
+
return array( false, '/* import disabled */' );
|
119 |
}
|
120 |
|
121 |
+
$this->addParsedFile( $realPath );
|
122 |
+
$parser = $this->makeParser( $realPath );
|
123 |
+
$root = $parser->parse( file_get_contents( $realPath ) );
|
124 |
|
125 |
// set the parents of all the block props
|
126 |
+
foreach ( $root->props as $prop ) {
|
127 |
+
if ( $prop[0] == 'block' ) {
|
128 |
$prop[1]->parent = $parentBlock;
|
129 |
}
|
130 |
}
|
132 |
// copy mixins into scope, set their parents
|
133 |
// bring blocks from import into current block
|
134 |
// TODO: need to mark the source parser these came from this file
|
135 |
+
foreach ( $root->children as $childName => $child ) {
|
136 |
+
if ( isset( $parentBlock->children[ $childName ] ) ) {
|
137 |
+
$parentBlock->children[ $childName ] = array_merge(
|
138 |
+
$parentBlock->children[ $childName ],
|
139 |
+
$child
|
140 |
+
);
|
141 |
} else {
|
142 |
+
$parentBlock->children[ $childName ] = $child;
|
143 |
}
|
144 |
}
|
145 |
|
146 |
+
$pi = pathinfo( $realPath );
|
147 |
+
$dir = $pi['dirname'];
|
148 |
|
149 |
+
list($top, $bottom) = $this->sortProps( $root->props, true );
|
150 |
+
$this->compileImportedProps( $top, $parentBlock, $out, $parser, $dir );
|
151 |
|
152 |
+
return array( true, $bottom, $parser, $dir );
|
153 |
}
|
154 |
|
155 |
+
protected function compileImportedProps( $props, $block, $out, $sourceParser, $importDir ) {
|
156 |
$oldSourceParser = $this->sourceParser;
|
157 |
|
158 |
$oldImport = $this->importDir;
|
159 |
|
160 |
// TODO: this is because the importDir api is stupid
|
161 |
+
$this->importDir = (array) $this->importDir;
|
162 |
+
array_unshift( $this->importDir, $importDir );
|
163 |
|
164 |
+
foreach ( $props as $prop ) {
|
165 |
+
$this->compileProp( $prop, $block, $out );
|
166 |
}
|
167 |
|
168 |
+
$this->importDir = $oldImport;
|
169 |
$this->sourceParser = $oldSourceParser;
|
170 |
}
|
171 |
|
190 |
* See seedprod_lessc::compileProp()
|
191 |
*
|
192 |
*/
|
193 |
+
protected function compileBlock( $block ) {
|
194 |
+
switch ( $block->type ) {
|
195 |
+
case 'root':
|
196 |
+
$this->compileRoot( $block );
|
197 |
+
break;
|
198 |
+
case null:
|
199 |
+
$this->compileCSSBlock( $block );
|
200 |
+
break;
|
201 |
+
case 'media':
|
202 |
+
$this->compileMedia( $block );
|
203 |
+
break;
|
204 |
+
case 'directive':
|
205 |
+
$name = '@' . $block->name;
|
206 |
+
if ( ! empty( $block->value ) ) {
|
207 |
+
$name .= ' ' . $this->compileValue( $this->reduce( $block->value ) );
|
208 |
+
}
|
209 |
|
210 |
+
$this->compileNestedBlock( $block, array( $name ) );
|
211 |
+
break;
|
212 |
+
default:
|
213 |
+
$this->throwError( "unknown block type: $block->type\n" );
|
214 |
}
|
215 |
}
|
216 |
|
217 |
+
protected function compileCSSBlock( $block ) {
|
218 |
$env = $this->pushEnv();
|
219 |
|
220 |
+
$selectors = $this->compileSelectors( $block->tags );
|
221 |
+
$env->selectors = $this->multiplySelectors( $selectors );
|
222 |
+
$out = $this->makeOutputBlock( null, $env->selectors );
|
223 |
|
224 |
$this->scope->children[] = $out;
|
225 |
+
$this->compileProps( $block, $out );
|
226 |
|
227 |
$block->scope = $env; // mixins carry scope with them!
|
228 |
$this->popEnv();
|
229 |
}
|
230 |
|
231 |
+
protected function compileMedia( $media ) {
|
232 |
+
$env = $this->pushEnv( $media );
|
233 |
+
$parentScope = $this->mediaParent( $this->scope );
|
234 |
|
235 |
+
$query = $this->compileMediaQuery( $this->multiplyMedia( $env ) );
|
236 |
|
237 |
+
$this->scope = $this->makeOutputBlock( $media->type, array( $query ) );
|
238 |
$parentScope->children[] = $this->scope;
|
239 |
|
240 |
+
$this->compileProps( $media, $this->scope );
|
241 |
|
242 |
+
if ( count( $this->scope->lines ) > 0 ) {
|
243 |
$orphanSelelectors = $this->findClosestSelectors();
|
244 |
+
if ( ! is_null( $orphanSelelectors ) ) {
|
245 |
+
$orphan = $this->makeOutputBlock( null, $orphanSelelectors );
|
246 |
$orphan->lines = $this->scope->lines;
|
247 |
+
array_unshift( $this->scope->children, $orphan );
|
248 |
$this->scope->lines = array();
|
249 |
}
|
250 |
}
|
253 |
$this->popEnv();
|
254 |
}
|
255 |
|
256 |
+
protected function mediaParent( $scope ) {
|
257 |
+
while ( ! empty( $scope->parent ) ) {
|
258 |
+
if ( ! empty( $scope->type ) && $scope->type != 'media' ) {
|
259 |
break;
|
260 |
}
|
261 |
$scope = $scope->parent;
|
264 |
return $scope;
|
265 |
}
|
266 |
|
267 |
+
protected function compileNestedBlock( $block, $selectors ) {
|
268 |
+
$this->pushEnv( $block );
|
269 |
+
$this->scope = $this->makeOutputBlock( $block->type, $selectors );
|
270 |
$this->scope->parent->children[] = $this->scope;
|
271 |
|
272 |
+
$this->compileProps( $block, $this->scope );
|
273 |
|
274 |
$this->scope = $this->scope->parent;
|
275 |
$this->popEnv();
|
276 |
}
|
277 |
|
278 |
+
protected function compileRoot( $root ) {
|
279 |
$this->pushEnv();
|
280 |
+
$this->scope = $this->makeOutputBlock( $root->type );
|
281 |
+
$this->compileProps( $root, $this->scope );
|
282 |
$this->popEnv();
|
283 |
}
|
284 |
|
285 |
+
protected function compileProps( $block, $out ) {
|
286 |
+
foreach ( $this->sortProps( $block->props ) as $prop ) {
|
287 |
+
$this->compileProp( $prop, $block, $out );
|
288 |
}
|
289 |
}
|
290 |
|
291 |
+
protected function sortProps( $props, $split = false ) {
|
292 |
+
$vars = array();
|
293 |
$imports = array();
|
294 |
+
$other = array();
|
295 |
|
296 |
+
foreach ( $props as $prop ) {
|
297 |
+
switch ( $prop[0] ) {
|
298 |
+
case 'assign':
|
299 |
+
if ( isset( $prop[1][0] ) && $prop[1][0] == $this->vPrefix ) {
|
300 |
+
$vars[] = $prop;
|
301 |
+
} else {
|
302 |
+
$other[] = $prop;
|
303 |
+
}
|
304 |
+
break;
|
305 |
+
case 'import':
|
306 |
+
$id = self::$nextImportId++;
|
307 |
+
$prop[] = $id;
|
308 |
+
$imports[] = $prop;
|
309 |
+
$other[] = array( 'import_mixin', $id );
|
310 |
+
break;
|
311 |
+
default:
|
312 |
$other[] = $prop;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
}
|
314 |
}
|
315 |
|
316 |
+
if ( $split ) {
|
317 |
+
return array( array_merge( $vars, $imports ), $other );
|
318 |
} else {
|
319 |
+
return array_merge( $vars, $imports, $other );
|
320 |
}
|
321 |
}
|
322 |
|
323 |
+
protected function compileMediaQuery( $queries ) {
|
324 |
$compiledQueries = array();
|
325 |
+
foreach ( $queries as $query ) {
|
326 |
$parts = array();
|
327 |
+
foreach ( $query as $q ) {
|
328 |
+
switch ( $q[0] ) {
|
329 |
+
case 'mediaType':
|
330 |
+
$parts[] = implode( ' ', array_slice( $q, 1 ) );
|
331 |
+
break;
|
332 |
+
case 'mediaExp':
|
333 |
+
if ( isset( $q[2] ) ) {
|
334 |
+
$parts[] = "($q[1]: " .
|
335 |
+
$this->compileValue( $this->reduce( $q[2] ) ) . ')';
|
336 |
+
} else {
|
337 |
+
$parts[] = "($q[1])";
|
338 |
+
}
|
339 |
+
break;
|
340 |
}
|
341 |
}
|
342 |
|
343 |
+
if ( count( $parts ) > 0 ) {
|
344 |
+
$compiledQueries[] = implode( ' and ', $parts );
|
345 |
}
|
346 |
}
|
347 |
|
348 |
+
$out = '@media';
|
349 |
+
if ( ! empty( $parts ) ) {
|
350 |
+
$out .= ' ' .
|
351 |
+
implode( $this->formatter->selectorSeparator, $compiledQueries );
|
352 |
}
|
353 |
return $out;
|
354 |
}
|
355 |
|
356 |
+
protected function multiplyMedia( $env, $childQueries = null ) {
|
357 |
+
if ( is_null( $env ) ||
|
358 |
+
! empty( $env->block->type ) && $env->block->type != 'media' ) {
|
|
|
359 |
return $childQueries;
|
360 |
}
|
361 |
|
362 |
// plain old block, skip
|
363 |
+
if ( empty( $env->block->type ) ) {
|
364 |
+
return $this->multiplyMedia( $env->parent, $childQueries );
|
365 |
}
|
366 |
|
367 |
+
$out = array();
|
368 |
$queries = $env->block->queries;
|
369 |
+
if ( is_null( $childQueries ) ) {
|
370 |
$out = $queries;
|
371 |
} else {
|
372 |
+
foreach ( $queries as $parent ) {
|
373 |
+
foreach ( $childQueries as $child ) {
|
374 |
+
$out[] = array_merge( $parent, $child );
|
375 |
}
|
376 |
}
|
377 |
}
|
378 |
|
379 |
+
return $this->multiplyMedia( $env->parent, $out );
|
380 |
}
|
381 |
|
382 |
+
protected function expandParentSelectors( &$tag, $replace ) {
|
383 |
+
$parts = explode( '$&$', $tag );
|
384 |
$count = 0;
|
385 |
+
foreach ( $parts as &$part ) {
|
386 |
+
$part = str_replace( $this->parentSelector, $replace, $part, $c );
|
387 |
$count += $c;
|
388 |
}
|
389 |
+
$tag = implode( $this->parentSelector, $parts );
|
390 |
return $count;
|
391 |
}
|
392 |
|
393 |
protected function findClosestSelectors() {
|
394 |
+
$env = $this->env;
|
395 |
$selectors = null;
|
396 |
+
while ( $env !== null ) {
|
397 |
+
if ( isset( $env->selectors ) ) {
|
398 |
$selectors = $env->selectors;
|
399 |
break;
|
400 |
}
|
406 |
|
407 |
|
408 |
// multiply $selectors against the nearest selectors in env
|
409 |
+
protected function multiplySelectors( $selectors ) {
|
410 |
// find parent selectors
|
411 |
|
412 |
$parentSelectors = $this->findClosestSelectors();
|
413 |
+
if ( is_null( $parentSelectors ) ) {
|
414 |
// kill parent reference in top level selector
|
415 |
+
foreach ( $selectors as &$s ) {
|
416 |
+
$this->expandParentSelectors( $s, '' );
|
417 |
}
|
418 |
|
419 |
return $selectors;
|
420 |
}
|
421 |
|
422 |
$out = array();
|
423 |
+
foreach ( $parentSelectors as $parent ) {
|
424 |
+
foreach ( $selectors as $child ) {
|
425 |
+
$count = $this->expandParentSelectors( $child, $parent );
|
426 |
|
427 |
// don't prepend the parent tag if & was used
|
428 |
+
if ( $count > 0 ) {
|
429 |
+
$out[] = trim( $child );
|
430 |
} else {
|
431 |
+
$out[] = trim( $parent . ' ' . $child );
|
432 |
}
|
433 |
}
|
434 |
}
|
437 |
}
|
438 |
|
439 |
// reduces selector expressions
|
440 |
+
protected function compileSelectors( $selectors ) {
|
441 |
$out = array();
|
442 |
|
443 |
+
foreach ( $selectors as $s ) {
|
444 |
+
if ( is_array( $s ) ) {
|
445 |
list(, $value) = $s;
|
446 |
+
$out[] = $this->compileValue( $this->reduce( $value ) );
|
447 |
} else {
|
448 |
$out[] = $s;
|
449 |
}
|
452 |
return $out;
|
453 |
}
|
454 |
|
455 |
+
protected function eq( $left, $right ) {
|
456 |
return $left == $right;
|
457 |
}
|
458 |
|
459 |
+
protected function patternMatch( $block, $callingArgs ) {
|
460 |
// match the guards if it has them
|
461 |
// any one of the groups must have all its guards pass for a match
|
462 |
+
if ( ! empty( $block->guards ) ) {
|
463 |
$groupPassed = false;
|
464 |
+
foreach ( $block->guards as $guardGroup ) {
|
465 |
+
foreach ( $guardGroup as $guard ) {
|
466 |
$this->pushEnv();
|
467 |
+
$this->zipSetArgs( $block->args, $callingArgs );
|
468 |
|
469 |
$negate = false;
|
470 |
+
if ( $guard[0] == 'negate' ) {
|
471 |
+
$guard = $guard[1];
|
472 |
$negate = true;
|
473 |
}
|
474 |
|
475 |
+
$passed = $this->reduce( $guard ) == self::$TRUE;
|
476 |
+
if ( $negate ) {
|
477 |
+
$passed = ! $passed;
|
478 |
+
}
|
479 |
|
480 |
$this->popEnv();
|
481 |
|
482 |
+
if ( $passed ) {
|
483 |
$groupPassed = true;
|
484 |
} else {
|
485 |
$groupPassed = false;
|
487 |
}
|
488 |
}
|
489 |
|
490 |
+
if ( $groupPassed ) {
|
491 |
+
break;
|
492 |
+
}
|
493 |
}
|
494 |
|
495 |
+
if ( ! $groupPassed ) {
|
496 |
return false;
|
497 |
}
|
498 |
}
|
499 |
|
500 |
+
$numCalling = count( $callingArgs );
|
501 |
|
502 |
+
if ( empty( $block->args ) ) {
|
503 |
return $block->isVararg || $numCalling == 0;
|
504 |
}
|
505 |
|
506 |
$i = -1; // no args
|
507 |
// try to match by arity or by argument literal
|
508 |
+
foreach ( $block->args as $i => $arg ) {
|
509 |
+
switch ( $arg[0] ) {
|
510 |
+
case 'lit':
|
511 |
+
if ( empty( $callingArgs[ $i ] ) || ! $this->eq( $arg[1], $callingArgs[ $i ] ) ) {
|
512 |
+
return false;
|
513 |
+
}
|
514 |
+
break;
|
515 |
+
case 'arg':
|
516 |
+
// no arg and no default value
|
517 |
+
if ( ! isset( $callingArgs[ $i ] ) && ! isset( $arg[2] ) ) {
|
518 |
+
return false;
|
519 |
+
}
|
520 |
+
break;
|
521 |
+
case 'rest':
|
522 |
+
$i--; // rest can be empty
|
523 |
+
break 2;
|
524 |
}
|
525 |
}
|
526 |
|
527 |
+
if ( $block->isVararg ) {
|
528 |
return true; // not having enough is handled above
|
529 |
} else {
|
530 |
$numMatched = $i + 1;
|
533 |
}
|
534 |
}
|
535 |
|
536 |
+
protected function patternMatchAll( $blocks, $callingArgs ) {
|
537 |
$matches = null;
|
538 |
+
foreach ( $blocks as $block ) {
|
539 |
+
if ( $this->patternMatch( $block, $callingArgs ) ) {
|
540 |
$matches[] = $block;
|
541 |
}
|
542 |
}
|
545 |
}
|
546 |
|
547 |
// attempt to find blocks matched by path and args
|
548 |
+
protected function findBlocks( $searchIn, $path, $args, $seen = array() ) {
|
549 |
+
if ( $searchIn == null ) {
|
550 |
+
return null;
|
551 |
+
}
|
552 |
+
if ( isset( $seen[ $searchIn->id ] ) ) {
|
553 |
+
return null;
|
554 |
+
}
|
555 |
+
$seen[ $searchIn->id ] = true;
|
556 |
|
557 |
$name = $path[0];
|
558 |
|
559 |
+
if ( isset( $searchIn->children[ $name ] ) ) {
|
560 |
+
$blocks = $searchIn->children[ $name ];
|
561 |
+
if ( count( $path ) == 1 ) {
|
562 |
+
$matches = $this->patternMatchAll( $blocks, $args );
|
563 |
+
if ( ! empty( $matches ) ) {
|
564 |
// This will return all blocks that match in the closest
|
565 |
// scope that has any matching block, like lessjs
|
566 |
return $matches;
|
567 |
}
|
568 |
} else {
|
569 |
$matches = array();
|
570 |
+
foreach ( $blocks as $subBlock ) {
|
571 |
+
$subMatches = $this->findBlocks(
|
572 |
+
$subBlock,
|
573 |
+
array_slice( $path, 1 ),
|
574 |
+
$args,
|
575 |
+
$seen
|
576 |
+
);
|
577 |
+
|
578 |
+
if ( ! is_null( $subMatches ) ) {
|
579 |
+
foreach ( $subMatches as $sm ) {
|
580 |
$matches[] = $sm;
|
581 |
}
|
582 |
}
|
583 |
}
|
584 |
|
585 |
+
return count( $matches ) > 0 ? $matches : null;
|
586 |
}
|
587 |
}
|
588 |
|
589 |
+
if ( $searchIn->parent === $searchIn ) {
|
590 |
+
return null;
|
591 |
+
}
|
592 |
+
return $this->findBlocks( $searchIn->parent, $path, $args, $seen );
|
593 |
}
|
594 |
|
595 |
// sets all argument names in $args to either the default value
|
596 |
// or the one passed in through $values
|
597 |
+
protected function zipSetArgs( $args, $values ) {
|
598 |
+
$i = 0;
|
599 |
$assignedValues = array();
|
600 |
+
foreach ( $args as $a ) {
|
601 |
+
if ( $a[0] == 'arg' ) {
|
602 |
+
if ( $i < count( $values ) && ! is_null( $values[ $i ] ) ) {
|
603 |
+
$value = $values[ $i ];
|
604 |
+
} elseif ( isset( $a[2] ) ) {
|
605 |
$value = $a[2];
|
606 |
+
} else {
|
607 |
+
$value = null;
|
608 |
+
}
|
609 |
|
610 |
+
$value = $this->reduce( $value );
|
611 |
+
$this->set( $a[1], $value );
|
612 |
$assignedValues[] = $value;
|
613 |
}
|
614 |
$i++;
|
615 |
}
|
616 |
|
617 |
// check for a rest
|
618 |
+
$last = end( $args );
|
619 |
+
if ( is_array( $last ) && $last[0] == 'rest' ) {
|
620 |
+
$rest = array_slice( $values, count( $args ) - 1 );
|
621 |
+
$this->set( $last[1], $this->reduce( array( 'list', ' ', $rest ) ) );
|
622 |
}
|
623 |
|
624 |
$this->env->arguments = $assignedValues;
|
625 |
}
|
626 |
|
627 |
// compile a prop and update $lines or $blocks appropriately
|
628 |
+
protected function compileProp( $prop, $block, $out ) {
|
629 |
// set error position context
|
630 |
+
$this->sourceLoc = isset( $prop[-1] ) ? $prop[-1] : -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
631 |
|
632 |
+
switch ( $prop[0] ) {
|
633 |
+
case 'assign':
|
634 |
+
list(, $name, $value) = $prop;
|
635 |
+
if ( $name[0] == $this->vPrefix ) {
|
636 |
+
$this->set( $name, $value );
|
637 |
+
} else {
|
638 |
+
$out->lines[] = $this->formatter->property(
|
639 |
+
$name,
|
640 |
+
$this->compileValue( $this->reduce( $value ) )
|
641 |
+
);
|
642 |
+
}
|
643 |
+
break;
|
644 |
+
case 'block':
|
645 |
+
list(, $child) = $prop;
|
646 |
+
$this->compileBlock( $child );
|
647 |
+
break;
|
648 |
+
case 'mixin':
|
649 |
+
list(, $path, $args, $suffix) = $prop;
|
650 |
|
651 |
+
$args = array_map( array( $this, 'reduce' ), (array) $args );
|
652 |
+
$mixins = $this->findBlocks( $block, $path, $args );
|
|
|
|
|
653 |
|
654 |
+
if ( $mixins === null ) {
|
655 |
+
// fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n");
|
656 |
+
break; // throw error here??
|
|
|
|
|
|
|
657 |
}
|
658 |
|
659 |
+
foreach ( $mixins as $mixin ) {
|
660 |
+
$haveScope = false;
|
661 |
+
if ( isset( $mixin->parent->scope ) ) {
|
662 |
+
$haveScope = true;
|
663 |
+
$mixinParentEnv = $this->pushEnv();
|
664 |
+
$mixinParentEnv->storeParent = $mixin->parent->scope;
|
665 |
+
}
|
666 |
|
667 |
+
$haveArgs = false;
|
668 |
+
if ( isset( $mixin->args ) ) {
|
669 |
+
$haveArgs = true;
|
670 |
+
$this->pushEnv();
|
671 |
+
$this->zipSetArgs( $mixin->args, $args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
672 |
}
|
673 |
|
674 |
+
$oldParent = $mixin->parent;
|
675 |
+
if ( $mixin != $block ) {
|
676 |
+
$mixin->parent = $block;
|
677 |
+
}
|
678 |
|
679 |
+
foreach ( $this->sortProps( $mixin->props ) as $subProp ) {
|
680 |
+
if ( $suffix !== null &&
|
681 |
+
$subProp[0] == 'assign' &&
|
682 |
+
is_string( $subProp[1] ) &&
|
683 |
+
$subProp[1][0] != $this->vPrefix ) {
|
684 |
+
$subProp[2] = array(
|
685 |
+
'list',
|
686 |
+
' ',
|
687 |
+
array( $subProp[2], array( 'keyword', $suffix ) ),
|
688 |
+
);
|
689 |
+
}
|
690 |
|
691 |
+
$this->compileProp( $subProp, $mixin, $out );
|
692 |
+
}
|
|
|
693 |
|
694 |
+
$mixin->parent = $oldParent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
|
696 |
+
if ( $haveArgs ) {
|
697 |
+
$this->popEnv();
|
698 |
+
}
|
699 |
+
if ( $haveScope ) {
|
700 |
+
$this->popEnv();
|
701 |
+
}
|
702 |
+
}
|
703 |
|
704 |
+
break;
|
705 |
+
case 'raw':
|
706 |
+
$out->lines[] = $prop[1];
|
707 |
+
break;
|
708 |
+
case 'directive':
|
709 |
+
list(, $name, $value) = $prop;
|
710 |
+
$out->lines[] = "@$name " . $this->compileValue( $this->reduce( $value ) ) . ';';
|
711 |
+
break;
|
712 |
+
case 'comment':
|
713 |
+
$out->lines[] = $prop[1];
|
714 |
+
break;
|
715 |
+
case 'import';
|
716 |
+
list(, $importPath, $importId) = $prop;
|
717 |
+
$importPath = $this->reduce( $importPath );
|
718 |
|
719 |
+
if ( ! isset( $this->env->imports ) ) {
|
720 |
+
$this->env->imports = array();
|
721 |
+
}
|
722 |
+
|
723 |
+
$result = $this->tryImport( $importPath, $block, $out );
|
724 |
+
|
725 |
+
$this->env->imports[ $importId ] = $result === false ?
|
726 |
+
array( false, '@import ' . $this->compileValue( $importPath ) . ';' ) :
|
727 |
$result;
|
728 |
|
729 |
break;
|
730 |
+
case 'import_mixin':
|
731 |
+
list(,$importId) = $prop;
|
732 |
+
$import = $this->env->imports[ $importId ];
|
733 |
+
if ( $import[0] === false ) {
|
734 |
+
$out->lines[] = $import[1];
|
735 |
+
} else {
|
736 |
+
list(, $bottom, $parser, $importDir) = $import;
|
737 |
+
$this->compileImportedProps( $bottom, $block, $out, $parser, $importDir );
|
738 |
+
}
|
739 |
|
740 |
+
break;
|
741 |
+
default:
|
742 |
+
$this->throwError( "unknown op: {$prop[0]}\n" );
|
743 |
}
|
744 |
}
|
745 |
|
755 |
* The input is expected to be reduced. This function will not work on
|
756 |
* things like expressions and variables.
|
757 |
*/
|
758 |
+
protected function compileValue( $value ) {
|
759 |
+
switch ( $value[0] ) {
|
760 |
+
case 'list':
|
761 |
+
// [1] - delimiter
|
762 |
+
// [2] - array of values
|
763 |
+
return implode( $value[1], array_map( array( $this, 'compileValue' ), $value[2] ) );
|
764 |
+
case 'raw_color':
|
765 |
+
if ( ! empty( $this->formatter->compressColors ) ) {
|
766 |
+
return $this->compileValue( $this->coerceColor( $value ) );
|
767 |
+
}
|
768 |
+
return $value[1];
|
769 |
+
case 'keyword':
|
770 |
+
// [1] - the keyword
|
771 |
+
return $value[1];
|
772 |
+
case 'number':
|
773 |
+
list(, $num, $unit) = $value;
|
774 |
+
// [1] - the number
|
775 |
+
// [2] - the unit
|
776 |
+
if ( $this->numberPrecision !== null ) {
|
777 |
+
$num = round( $num, $this->numberPrecision );
|
778 |
+
}
|
779 |
+
return $num . $unit;
|
780 |
+
case 'string':
|
781 |
+
// [1] - contents of string (includes quotes)
|
782 |
+
list(, $delim, $content) = $value;
|
783 |
+
foreach ( $content as &$part ) {
|
784 |
+
if ( is_array( $part ) ) {
|
785 |
+
$part = $this->compileValue( $part );
|
786 |
+
}
|
787 |
+
}
|
788 |
+
return $delim . implode( $content ) . $delim;
|
789 |
+
case 'color':
|
790 |
+
// [1] - red component (either number or a %)
|
791 |
+
// [2] - green component
|
792 |
+
// [3] - blue component
|
793 |
+
// [4] - optional alpha component
|
794 |
+
list(, $r, $g, $b) = $value;
|
795 |
+
$r = round( $r );
|
796 |
+
$g = round( $g );
|
797 |
+
$b = round( $b );
|
798 |
+
|
799 |
+
if ( count( $value ) == 5 && $value[4] != 1 ) { // rgba
|
800 |
+
return 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $value[4] . ')';
|
801 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
|
803 |
+
$h = sprintf( '#%02x%02x%02x', $r, $g, $b );
|
804 |
|
805 |
+
if ( ! empty( $this->formatter->compressColors ) ) {
|
806 |
+
// Converting hex color to short notation (e.g. #003399 to #039)
|
807 |
+
if ( $h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6] ) {
|
808 |
+
$h = '#' . $h[1] . $h[3] . $h[5];
|
809 |
+
}
|
810 |
}
|
|
|
811 |
|
812 |
+
return $h;
|
813 |
|
814 |
+
case 'function':
|
815 |
+
list(, $name, $args) = $value;
|
816 |
+
return $name . '(' . $this->compileValue( $args ) . ')';
|
817 |
+
default: // assumed to be unit
|
818 |
+
$this->throwError( "unknown value type: $value[0]" );
|
819 |
}
|
820 |
}
|
821 |
|
822 |
+
protected function lib_isnumber( $value ) {
|
823 |
+
return $this->toBool( $value[0] == 'number' );
|
824 |
}
|
825 |
|
826 |
+
protected function lib_isstring( $value ) {
|
827 |
+
return $this->toBool( $value[0] == 'string' );
|
828 |
}
|
829 |
|
830 |
+
protected function lib_iscolor( $value ) {
|
831 |
+
return $this->toBool( $this->coerceColor( $value ) );
|
832 |
}
|
833 |
|
834 |
+
protected function lib_iskeyword( $value ) {
|
835 |
+
return $this->toBool( $value[0] == 'keyword' );
|
836 |
}
|
837 |
|
838 |
+
protected function lib_ispixel( $value ) {
|
839 |
+
return $this->toBool( $value[0] == 'number' && $value[2] == 'px' );
|
840 |
}
|
841 |
|
842 |
+
protected function lib_ispercentage( $value ) {
|
843 |
+
return $this->toBool( $value[0] == 'number' && $value[2] == '%' );
|
844 |
}
|
845 |
|
846 |
+
protected function lib_isem( $value ) {
|
847 |
+
return $this->toBool( $value[0] == 'number' && $value[2] == 'em' );
|
848 |
}
|
849 |
|
850 |
+
protected function lib_rgbahex( $color ) {
|
851 |
+
$color = $this->coerceColor( $color );
|
852 |
+
if ( is_null( $color ) ) {
|
853 |
+
$this->throwError( 'color expected for rgbahex' );
|
854 |
+
}
|
855 |
|
856 |
+
return sprintf(
|
857 |
+
'#%02x%02x%02x%02x',
|
858 |
+
isset( $color[4] ) ? $color[4] * 255 : 255,
|
859 |
+
$color[1],
|
860 |
+
$color[2],
|
861 |
+
$color[3]
|
862 |
+
);
|
863 |
}
|
864 |
|
865 |
+
protected function lib_argb( $color ) {
|
866 |
+
return $this->lib_rgbahex( $color );
|
867 |
}
|
868 |
|
869 |
// utility func to unquote a string
|
870 |
+
protected function lib_e( $arg ) {
|
871 |
+
switch ( $arg[0] ) {
|
872 |
+
case 'list':
|
873 |
$items = $arg[2];
|
874 |
+
if ( isset( $items[0] ) ) {
|
875 |
+
return $this->lib_e( $items[0] );
|
876 |
}
|
877 |
return self::$defaultValue;
|
878 |
+
case 'string':
|
879 |
+
$arg[1] = '';
|
880 |
return $arg;
|
881 |
+
case 'keyword':
|
882 |
return $arg;
|
883 |
default:
|
884 |
+
return array( 'keyword', $this->compileValue( $arg ) );
|
885 |
}
|
886 |
}
|
887 |
|
888 |
+
protected function lib__sprintf( $args ) {
|
889 |
+
if ( $args[0] != 'list' ) {
|
890 |
+
return $args;
|
891 |
+
}
|
892 |
+
$values = $args[2];
|
893 |
+
$string = array_shift( $values );
|
894 |
+
$template = $this->compileValue( $this->lib_e( $string ) );
|
895 |
|
896 |
$i = 0;
|
897 |
+
if ( preg_match_all( '/%[dsa]/', $template, $m ) ) {
|
898 |
+
foreach ( $m[0] as $match ) {
|
899 |
+
$val = isset( $values[ $i ] ) ?
|
900 |
+
$this->reduce( $values[ $i ] ) : array( 'keyword', '' );
|
901 |
|
902 |
// lessjs compat, renders fully expanded color, not raw color
|
903 |
+
if ( $color = $this->coerceColor( $val ) ) {
|
904 |
$val = $color;
|
905 |
}
|
906 |
|
907 |
$i++;
|
908 |
+
$rep = $this->compileValue( $this->lib_e( $val ) );
|
909 |
+
$template = preg_replace(
|
910 |
+
'/' . self::preg_quote( $match ) . '/',
|
911 |
+
$rep,
|
912 |
+
$template,
|
913 |
+
1
|
914 |
+
);
|
915 |
}
|
916 |
}
|
917 |
|
918 |
+
$d = $string[0] == 'string' ? $string[1] : '"';
|
919 |
+
return array( 'string', $d, array( $template ) );
|
920 |
}
|
921 |
|
922 |
+
protected function lib_floor( $arg ) {
|
923 |
+
$value = $this->assertNumber( $arg );
|
924 |
+
return array( 'number', floor( $value ), $arg[2] );
|
925 |
}
|
926 |
|
927 |
+
protected function lib_ceil( $arg ) {
|
928 |
+
$value = $this->assertNumber( $arg );
|
929 |
+
return array( 'number', ceil( $value ), $arg[2] );
|
930 |
}
|
931 |
|
932 |
+
protected function lib_round( $arg ) {
|
933 |
+
$value = $this->assertNumber( $arg );
|
934 |
+
return array( 'number', round( $value ), $arg[2] );
|
935 |
}
|
936 |
|
937 |
/**
|
938 |
* Helper function to get arguments for color manipulation functions.
|
939 |
* takes a list that contains a color like thing and a percentage
|
940 |
*/
|
941 |
+
protected function colorArgs( $args ) {
|
942 |
+
if ( $args[0] != 'list' || count( $args[2] ) < 2 ) {
|
943 |
+
return array( array( 'color', 0, 0, 0 ), 0 );
|
944 |
}
|
945 |
list($color, $delta) = $args[2];
|
946 |
+
$color = $this->assertColor( $color );
|
947 |
+
$delta = floatval( $delta[1] );
|
948 |
|
949 |
+
return array( $color, $delta );
|
950 |
}
|
951 |
|
952 |
+
protected function lib_darken( $args ) {
|
953 |
+
list($color, $delta) = $this->colorArgs( $args );
|
954 |
|
955 |
+
$hsl = $this->toHSL( $color );
|
956 |
+
$hsl[3] = $this->clamp( $hsl[3] - $delta, 100 );
|
957 |
+
return $this->toRGB( $hsl );
|
958 |
}
|
959 |
|
960 |
+
protected function lib_lighten( $args ) {
|
961 |
+
list($color, $delta) = $this->colorArgs( $args );
|
962 |
|
963 |
+
$hsl = $this->toHSL( $color );
|
964 |
+
$hsl[3] = $this->clamp( $hsl[3] + $delta, 100 );
|
965 |
+
return $this->toRGB( $hsl );
|
966 |
}
|
967 |
|
968 |
+
protected function lib_saturate( $args ) {
|
969 |
+
list($color, $delta) = $this->colorArgs( $args );
|
970 |
|
971 |
+
$hsl = $this->toHSL( $color );
|
972 |
+
$hsl[2] = $this->clamp( $hsl[2] + $delta, 100 );
|
973 |
+
return $this->toRGB( $hsl );
|
974 |
}
|
975 |
|
976 |
+
protected function lib_desaturate( $args ) {
|
977 |
+
list($color, $delta) = $this->colorArgs( $args );
|
978 |
|
979 |
+
$hsl = $this->toHSL( $color );
|
980 |
+
$hsl[2] = $this->clamp( $hsl[2] - $delta, 100 );
|
981 |
+
return $this->toRGB( $hsl );
|
982 |
}
|
983 |
|
984 |
+
protected function lib_spin( $args ) {
|
985 |
+
list($color, $delta) = $this->colorArgs( $args );
|
986 |
|
987 |
+
$hsl = $this->toHSL( $color );
|
988 |
|
989 |
$hsl[1] = $hsl[1] + $delta % 360;
|
990 |
+
if ( $hsl[1] < 0 ) {
|
991 |
+
$hsl[1] += 360;
|
992 |
+
}
|
993 |
|
994 |
+
return $this->toRGB( $hsl );
|
995 |
}
|
996 |
|
997 |
+
protected function lib_fadeout( $args ) {
|
998 |
+
list($color, $delta) = $this->colorArgs( $args );
|
999 |
+
$color[4] = $this->clamp( ( isset( $color[4] ) ? $color[4] : 1 ) - $delta / 100 );
|
1000 |
return $color;
|
1001 |
}
|
1002 |
|
1003 |
+
protected function lib_fadein( $args ) {
|
1004 |
+
list($color, $delta) = $this->colorArgs( $args );
|
1005 |
+
$color[4] = $this->clamp( ( isset( $color[4] ) ? $color[4] : 1 ) + $delta / 100 );
|
1006 |
return $color;
|
1007 |
}
|
1008 |
|
1009 |
+
protected function lib_hue( $color ) {
|
1010 |
+
$hsl = $this->toHSL( $this->assertColor( $color ) );
|
1011 |
+
return round( $hsl[1] );
|
1012 |
}
|
1013 |
|
1014 |
+
protected function lib_saturation( $color ) {
|
1015 |
+
$hsl = $this->toHSL( $this->assertColor( $color ) );
|
1016 |
+
return round( $hsl[2] );
|
1017 |
}
|
1018 |
|
1019 |
+
protected function lib_lightness( $color ) {
|
1020 |
+
$hsl = $this->toHSL( $this->assertColor( $color ) );
|
1021 |
+
return round( $hsl[3] );
|
1022 |
}
|
1023 |
|
1024 |
// get the alpha of a color
|
1025 |
// defaults to 1 for non-colors or colors without an alpha
|
1026 |
+
protected function lib_alpha( $value ) {
|
1027 |
+
if ( ! is_null( $color = $this->coerceColor( $value ) ) ) {
|
1028 |
+
return isset( $color[4] ) ? $color[4] : 1;
|
1029 |
}
|
1030 |
}
|
1031 |
|
1032 |
// set the alpha of the color
|
1033 |
+
protected function lib_fade( $args ) {
|
1034 |
+
list($color, $alpha) = $this->colorArgs( $args );
|
1035 |
+
$color[4] = $this->clamp( $alpha / 100.0 );
|
1036 |
return $color;
|
1037 |
}
|
1038 |
|
1039 |
+
protected function lib_percentage( $arg ) {
|
1040 |
+
$num = $this->assertNumber( $arg );
|
1041 |
+
return array( 'number', $num * 100, '%' );
|
1042 |
}
|
1043 |
|
1044 |
// mixes two colors by weight
|
1045 |
// mix(@color1, @color2, @weight);
|
1046 |
// http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method
|
1047 |
+
protected function lib_mix( $args ) {
|
1048 |
+
if ( $args[0] != 'list' || count( $args[2] ) < 3 ) {
|
1049 |
+
$this->throwError( 'mix expects (color1, color2, weight)' );
|
1050 |
+
}
|
1051 |
|
1052 |
list($first, $second, $weight) = $args[2];
|
1053 |
+
$first = $this->assertColor( $first );
|
1054 |
+
$second = $this->assertColor( $second );
|
1055 |
|
1056 |
+
$first_a = $this->lib_alpha( $first );
|
1057 |
+
$second_a = $this->lib_alpha( $second );
|
1058 |
+
$weight = $weight[1] / 100.0;
|
1059 |
|
1060 |
$w = $weight * 2 - 1;
|
1061 |
$a = $first_a - $second_a;
|
1062 |
|
1063 |
+
$w1 = ( ( $w * $a == -1 ? $w : ( $w + $a ) / ( 1 + $w * $a ) ) + 1 ) / 2.0;
|
1064 |
$w2 = 1.0 - $w1;
|
1065 |
|
1066 |
+
$new = array(
|
1067 |
+
'color',
|
1068 |
$w1 * $first[1] + $w2 * $second[1],
|
1069 |
$w1 * $first[2] + $w2 * $second[2],
|
1070 |
$w1 * $first[3] + $w2 * $second[3],
|
1071 |
);
|
1072 |
|
1073 |
+
if ( $first_a != 1.0 || $second_a != 1.0 ) {
|
1074 |
+
$new[] = $first_a * $weight + $second_a * ( $weight - 1 );
|
1075 |
}
|
1076 |
|
1077 |
+
return $this->fixColor( $new );
|
1078 |
}
|
1079 |
|
1080 |
+
protected function assertColor( $value, $error = 'expected color value' ) {
|
1081 |
+
$color = $this->coerceColor( $value );
|
1082 |
+
if ( is_null( $color ) ) {
|
1083 |
+
$this->throwError( $error );
|
1084 |
+
}
|
1085 |
return $color;
|
1086 |
}
|
1087 |
|
1088 |
+
protected function assertNumber( $value, $error = 'expecting number' ) {
|
1089 |
+
if ( $value[0] == 'number' ) {
|
1090 |
+
return $value[1];
|
1091 |
+
}
|
1092 |
+
$this->throwError( $error );
|
1093 |
}
|
1094 |
|
1095 |
+
protected function toHSL( $color ) {
|
1096 |
+
if ( $color[0] == 'hsl' ) {
|
1097 |
+
return $color;
|
1098 |
+
}
|
1099 |
|
1100 |
$r = $color[1] / 255;
|
1101 |
$g = $color[2] / 255;
|
1102 |
$b = $color[3] / 255;
|
1103 |
|
1104 |
+
$min = min( $r, $g, $b );
|
1105 |
+
$max = max( $r, $g, $b );
|
1106 |
|
1107 |
+
$L = ( $min + $max ) / 2;
|
1108 |
+
if ( $min == $max ) {
|
1109 |
$S = $H = 0;
|
1110 |
} else {
|
1111 |
+
if ( $L < 0.5 ) {
|
1112 |
+
$S = ( $max - $min ) / ( $max + $min );
|
1113 |
+
} else {
|
1114 |
+
$S = ( $max - $min ) / ( 2.0 - $max - $min );
|
1115 |
+
}
|
|
|
|
|
|
|
1116 |
|
1117 |
+
if ( $r == $max ) {
|
1118 |
+
$H = ( $g - $b ) / ( $max - $min );
|
1119 |
+
} elseif ( $g == $max ) {
|
1120 |
+
$H = 2.0 + ( $b - $r ) / ( $max - $min );
|
1121 |
+
} elseif ( $b == $max ) {
|
1122 |
+
$H = 4.0 + ( $r - $g ) / ( $max - $min );
|
1123 |
+
}
|
1124 |
}
|
1125 |
|
1126 |
+
$out = array(
|
1127 |
+
'hsl',
|
1128 |
+
( $H < 0 ? $H + 6 : $H ) * 60,
|
1129 |
+
$S * 100,
|
1130 |
+
$L * 100,
|
1131 |
);
|
1132 |
|
1133 |
+
if ( count( $color ) > 4 ) {
|
1134 |
+
$out[] = $color[4]; // copy alpha
|
1135 |
+
}
|
1136 |
return $out;
|
1137 |
}
|
1138 |
|
1139 |
+
protected function toRGB_helper( $comp, $temp1, $temp2 ) {
|
1140 |
+
if ( $comp < 0 ) {
|
1141 |
+
$comp += 1.0;
|
1142 |
+
} elseif ( $comp > 1 ) {
|
1143 |
+
$comp -= 1.0;
|
1144 |
+
}
|
1145 |
|
1146 |
+
if ( 6 * $comp < 1 ) {
|
1147 |
+
return $temp1 + ( $temp2 - $temp1 ) * 6 * $comp;
|
1148 |
+
}
|
1149 |
+
if ( 2 * $comp < 1 ) {
|
1150 |
+
return $temp2;
|
1151 |
+
}
|
1152 |
+
if ( 3 * $comp < 2 ) {
|
1153 |
+
return $temp1 + ( $temp2 - $temp1 ) * ( ( 2 / 3 ) - $comp ) * 6;
|
1154 |
+
}
|
1155 |
|
1156 |
return $temp1;
|
1157 |
}
|
1160 |
* Converts a hsl array into a color value in rgb.
|
1161 |
* Expects H to be in range of 0 to 360, S and L in 0 to 100
|
1162 |
*/
|
1163 |
+
protected function toRGB( $color ) {
|
1164 |
+
if ( $color == 'color' ) {
|
1165 |
+
return $color;
|
1166 |
+
}
|
1167 |
|
1168 |
$H = $color[1] / 360;
|
1169 |
$S = $color[2] / 100;
|
1170 |
$L = $color[3] / 100;
|
1171 |
|
1172 |
+
if ( $S == 0 ) {
|
1173 |
$r = $g = $b = $L;
|
1174 |
} else {
|
1175 |
$temp2 = $L < 0.5 ?
|
1176 |
+
$L * ( 1.0 + $S ) :
|
1177 |
$L + $S - $L * $S;
|
1178 |
|
1179 |
$temp1 = 2.0 * $L - $temp2;
|
1180 |
|
1181 |
+
$r = $this->toRGB_helper( $H + 1 / 3, $temp1, $temp2 );
|
1182 |
+
$g = $this->toRGB_helper( $H, $temp1, $temp2 );
|
1183 |
+
$b = $this->toRGB_helper( $H - 1 / 3, $temp1, $temp2 );
|
1184 |
}
|
1185 |
|
1186 |
// $out = array('color', round($r*255), round($g*255), round($b*255));
|
1187 |
+
$out = array( 'color', $r * 255, $g * 255, $b * 255 );
|
1188 |
+
if ( count( $color ) > 4 ) {
|
1189 |
+
$out[] = $color[4]; // copy alpha
|
1190 |
+
}
|
1191 |
return $out;
|
1192 |
}
|
1193 |
|
1194 |
+
protected function clamp( $v, $max = 1, $min = 0 ) {
|
1195 |
+
return min( $max, max( $min, $v ) );
|
1196 |
}
|
1197 |
|
1198 |
/**
|
1199 |
* Convert the rgb, rgba, hsl color literals of function type
|
1200 |
* as returned by the parser into values of color type.
|
1201 |
*/
|
1202 |
+
protected function funcToColor( $func ) {
|
1203 |
$fname = $func[1];
|
1204 |
+
if ( $func[2][0] != 'list' ) {
|
1205 |
+
return false; // need a list of arguments
|
1206 |
+
}
|
1207 |
$rawComponents = $func[2][2];
|
1208 |
|
1209 |
+
if ( $fname == 'hsl' || $fname == 'hsla' ) {
|
1210 |
+
$hsl = array( 'hsl' );
|
1211 |
+
$i = 0;
|
1212 |
+
foreach ( $rawComponents as $c ) {
|
1213 |
+
$val = $this->reduce( $c );
|
1214 |
+
$val = isset( $val[1] ) ? floatval( $val[1] ) : 0;
|
1215 |
+
|
1216 |
+
if ( $i == 0 ) {
|
1217 |
+
$clamp = 360;
|
1218 |
+
} elseif ( $i < 3 ) {
|
1219 |
+
$clamp = 100;
|
1220 |
+
} else {
|
1221 |
+
$clamp = 1;
|
1222 |
+
}
|
1223 |
|
1224 |
+
$hsl[] = $this->clamp( $val, $clamp );
|
1225 |
$i++;
|
1226 |
}
|
1227 |
|
1228 |
+
while ( count( $hsl ) < 4 ) {
|
1229 |
+
$hsl[] = 0;
|
1230 |
+
}
|
1231 |
+
return $this->toRGB( $hsl );
|
1232 |
|
1233 |
+
} elseif ( $fname == 'rgb' || $fname == 'rgba' ) {
|
1234 |
$components = array();
|
1235 |
+
$i = 1;
|
1236 |
+
foreach ( $rawComponents as $c ) {
|
1237 |
+
$c = $this->reduce( $c );
|
1238 |
+
if ( $i < 4 ) {
|
1239 |
+
if ( $c[0] == 'number' && $c[2] == '%' ) {
|
1240 |
+
$components[] = 255 * ( $c[1] / 100 );
|
1241 |
} else {
|
1242 |
+
$components[] = floatval( $c[1] );
|
1243 |
}
|
1244 |
+
} elseif ( $i == 4 ) {
|
1245 |
+
if ( $c[0] == 'number' && $c[2] == '%' ) {
|
1246 |
+
$components[] = 1.0 * ( $c[1] / 100 );
|
1247 |
} else {
|
1248 |
+
$components[] = floatval( $c[1] );
|
1249 |
}
|
1250 |
+
} else {
|
1251 |
+
break;
|
1252 |
+
}
|
1253 |
|
1254 |
$i++;
|
1255 |
}
|
1256 |
+
while ( count( $components ) < 3 ) {
|
1257 |
+
$components[] = 0;
|
1258 |
+
}
|
1259 |
+
array_unshift( $components, 'color' );
|
1260 |
+
return $this->fixColor( $components );
|
1261 |
}
|
1262 |
|
1263 |
return false;
|
1264 |
}
|
1265 |
|
1266 |
+
protected function reduce( $value, $forExpression = false ) {
|
1267 |
+
switch ( $value[0] ) {
|
1268 |
+
case 'variable':
|
1269 |
+
$key = $value[1];
|
1270 |
+
if ( is_array( $key ) ) {
|
1271 |
+
$key = $this->reduce( $key );
|
1272 |
+
$key = $this->vPrefix . $this->compileValue( $this->lib_e( $key ) );
|
1273 |
+
}
|
1274 |
|
1275 |
+
$seen =& $this->env->seenNames;
|
1276 |
|
1277 |
+
if ( ! empty( $seen[ $key ] ) ) {
|
1278 |
+
$this->throwError( "infinite loop detected: $key" );
|
1279 |
+
}
|
1280 |
|
1281 |
+
$seen[ $key ] = true;
|
1282 |
+
$out = $this->reduce( $this->get( $key, self::$defaultValue ) );
|
1283 |
+
$seen[ $key ] = false;
|
1284 |
+
return $out;
|
1285 |
+
case 'list':
|
1286 |
+
foreach ( $value[2] as &$item ) {
|
1287 |
+
$item = $this->reduce( $item, $forExpression );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1288 |
}
|
1289 |
+
return $value;
|
1290 |
+
case 'expression':
|
1291 |
+
return $this->evaluate( $value );
|
1292 |
+
case 'string':
|
1293 |
+
foreach ( $value[2] as &$part ) {
|
1294 |
+
if ( is_array( $part ) ) {
|
1295 |
+
$strip = $part[0] == 'variable';
|
1296 |
+
$part = $this->reduce( $part );
|
1297 |
+
if ( $strip ) {
|
1298 |
+
$part = $this->lib_e( $part );
|
1299 |
+
}
|
1300 |
+
}
|
1301 |
+
}
|
1302 |
+
return $value;
|
1303 |
+
case 'escape':
|
1304 |
+
list(,$inner) = $value;
|
1305 |
+
return $this->lib_e( $this->reduce( $inner ) );
|
1306 |
+
case 'function':
|
1307 |
+
$color = $this->funcToColor( $value );
|
1308 |
+
if ( $color ) {
|
1309 |
+
return $color;
|
|
|
|
|
|
|
1310 |
}
|
1311 |
|
1312 |
+
list(, $name, $args) = $value;
|
1313 |
+
if ( $name == '%' ) {
|
1314 |
+
$name = '_sprintf';
|
1315 |
+
}
|
1316 |
+
$f = isset( $this->libFunctions[ $name ] ) ?
|
1317 |
+
$this->libFunctions[ $name ] : array( $this, 'lib_' . $name );
|
1318 |
|
1319 |
+
if ( is_callable( $f ) ) {
|
1320 |
+
if ( $args[0] == 'list' ) {
|
1321 |
+
$args = self::compressList( $args[2], $args[1] );
|
1322 |
+
}
|
1323 |
|
1324 |
+
$ret = call_user_func( $f, $this->reduce( $args, true ), $this );
|
1325 |
+
|
1326 |
+
if ( is_null( $ret ) ) {
|
1327 |
+
return array(
|
1328 |
+
'string',
|
1329 |
+
'',
|
1330 |
+
array(
|
1331 |
+
$name,
|
1332 |
+
'(',
|
1333 |
+
$args,
|
1334 |
+
')',
|
1335 |
+
),
|
1336 |
+
);
|
1337 |
+
}
|
1338 |
|
1339 |
+
// convert to a typed value if the result is a php primitive
|
1340 |
+
if ( is_numeric( $ret ) ) {
|
1341 |
+
$ret = array( 'number', $ret, '' );
|
1342 |
+
} elseif ( ! is_array( $ret ) ) {
|
1343 |
+
$ret = array( 'keyword', $ret );
|
1344 |
+
}
|
1345 |
+
|
1346 |
+
return $ret;
|
1347 |
}
|
|
|
|
|
|
|
1348 |
|
1349 |
+
// plain function, reduce args
|
1350 |
+
$value[2] = $this->reduce( $value[2] );
|
1351 |
+
return $value;
|
1352 |
+
case 'unary':
|
1353 |
+
list(, $op, $exp) = $value;
|
1354 |
+
$exp = $this->reduce( $exp );
|
1355 |
+
|
1356 |
+
if ( $exp[0] == 'number' ) {
|
1357 |
+
switch ( $op ) {
|
1358 |
+
case '+':
|
1359 |
+
return $exp;
|
1360 |
+
case '-':
|
1361 |
+
$exp[1] *= -1;
|
1362 |
+
return $exp;
|
1363 |
+
}
|
1364 |
}
|
1365 |
+
return array( 'string', '', array( $op, $exp ) );
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
if ( $forExpression ) {
|
1369 |
+
switch ( $value[0] ) {
|
1370 |
+
case 'keyword':
|
1371 |
+
if ( $color = $this->coerceColor( $value ) ) {
|
1372 |
+
return $color;
|
1373 |
+
}
|
1374 |
+
break;
|
1375 |
+
case 'raw_color':
|
1376 |
+
return $this->coerceColor( $value );
|
1377 |
}
|
1378 |
}
|
1379 |
|
1382 |
|
1383 |
|
1384 |
// coerce a value for use in color operation
|
1385 |
+
protected function coerceColor( $value ) {
|
1386 |
+
switch ( $value[0] ) {
|
1387 |
+
case 'color':
|
1388 |
+
return $value;
|
1389 |
case 'raw_color':
|
1390 |
+
$c = array( 'color', 0, 0, 0 );
|
1391 |
+
$colorStr = substr( $value[1], 1 );
|
1392 |
+
$num = hexdec( $colorStr );
|
1393 |
+
$width = strlen( $colorStr ) == 3 ? 16 : 256;
|
1394 |
|
1395 |
+
for ( $i = 3; $i > 0; $i-- ) { // 3 2 1
|
1396 |
+
$t = $num % $width;
|
1397 |
$num /= $width;
|
1398 |
|
1399 |
+
$c[ $i ] = $t * ( 256 / $width ) + $t * floor( 16 / $width );
|
1400 |
}
|
1401 |
|
1402 |
return $c;
|
1403 |
case 'keyword':
|
1404 |
$name = $value[1];
|
1405 |
+
if ( isset( self::$cssColors[ $name ] ) ) {
|
1406 |
+
list($r, $g, $b) = explode( ',', self::$cssColors[ $name ] );
|
1407 |
+
return array( 'color', $r, $g, $b );
|
1408 |
}
|
1409 |
return null;
|
1410 |
}
|
1411 |
}
|
1412 |
|
1413 |
// make something string like into a string
|
1414 |
+
protected function coerceString( $value ) {
|
1415 |
+
switch ( $value[0] ) {
|
1416 |
+
case 'string':
|
1417 |
+
return $value;
|
1418 |
+
case 'keyword':
|
1419 |
+
return array( 'string', '', array( $value[1] ) );
|
1420 |
}
|
1421 |
return null;
|
1422 |
}
|
1423 |
|
1424 |
// turn list of length 1 into value type
|
1425 |
+
protected function flattenList( $value ) {
|
1426 |
+
if ( $value[0] == 'list' && count( $value[2] ) == 1 ) {
|
1427 |
+
return $this->flattenList( $value[2][0] );
|
1428 |
}
|
1429 |
return $value;
|
1430 |
}
|
1431 |
|
1432 |
+
protected function toBool( $a ) {
|
1433 |
+
if ( $a ) {
|
1434 |
+
return self::$TRUE;
|
1435 |
+
} else {
|
1436 |
+
return self::$FALSE;
|
1437 |
+
}
|
1438 |
}
|
1439 |
|
1440 |
// evaluate an expression
|
1441 |
+
protected function evaluate( $exp ) {
|
1442 |
list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp;
|
1443 |
|
1444 |
+
$left = $this->reduce( $left, true );
|
1445 |
+
$right = $this->reduce( $right, true );
|
1446 |
|
1447 |
+
if ( $leftColor = $this->coerceColor( $left ) ) {
|
1448 |
$left = $leftColor;
|
1449 |
}
|
1450 |
|
1451 |
+
if ( $rightColor = $this->coerceColor( $right ) ) {
|
1452 |
$right = $rightColor;
|
1453 |
}
|
1454 |
|
1456 |
$rtype = $right[0];
|
1457 |
|
1458 |
// operators that work on all types
|
1459 |
+
if ( $op == 'and' ) {
|
1460 |
+
return $this->toBool( $left == self::$TRUE && $right == self::$TRUE );
|
1461 |
}
|
1462 |
|
1463 |
+
if ( $op == '=' ) {
|
1464 |
+
return $this->toBool( $this->eq( $left, $right ) );
|
1465 |
}
|
1466 |
|
1467 |
+
if ( $op == '+' && ! is_null( $str = $this->stringConcatenate( $left, $right ) ) ) {
|
1468 |
return $str;
|
1469 |
}
|
1470 |
|
1471 |
// type based operators
|
1472 |
$fname = "op_${ltype}_${rtype}";
|
1473 |
+
if ( is_callable( array( $this, $fname ) ) ) {
|
1474 |
+
$out = $this->$fname( $op, $left, $right );
|
1475 |
+
if ( ! is_null( $out ) ) {
|
1476 |
+
return $out;
|
1477 |
+
}
|
1478 |
}
|
1479 |
|
1480 |
// make the expression look it did before being parsed
|
1481 |
$paddedOp = $op;
|
1482 |
+
if ( $whiteBefore ) {
|
1483 |
+
$paddedOp = ' ' . $paddedOp;
|
1484 |
+
}
|
1485 |
+
if ( $whiteAfter ) {
|
1486 |
+
$paddedOp .= ' ';
|
1487 |
+
}
|
1488 |
|
1489 |
+
return array( 'string', '', array( $left, $paddedOp, $right ) );
|
1490 |
}
|
1491 |
|
1492 |
+
protected function stringConcatenate( $left, $right ) {
|
1493 |
+
if ( $strLeft = $this->coerceString( $left ) ) {
|
1494 |
+
if ( $right[0] == 'string' ) {
|
1495 |
+
$right[1] = '';
|
1496 |
}
|
1497 |
$strLeft[2][] = $right;
|
1498 |
return $strLeft;
|
1499 |
}
|
1500 |
|
1501 |
+
if ( $strRight = $this->coerceString( $right ) ) {
|
1502 |
+
array_unshift( $strRight[2], $left );
|
1503 |
return $strRight;
|
1504 |
}
|
1505 |
}
|
1506 |
|
1507 |
|
1508 |
// make sure a color's components don't go out of bounds
|
1509 |
+
protected function fixColor( $c ) {
|
1510 |
+
foreach ( range( 1, 3 ) as $i ) {
|
1511 |
+
if ( $c[ $i ] < 0 ) {
|
1512 |
+
$c[ $i ] = 0;
|
1513 |
+
}
|
1514 |
+
if ( $c[ $i ] > 255 ) {
|
1515 |
+
$c[ $i ] = 255;
|
1516 |
+
}
|
1517 |
}
|
1518 |
|
1519 |
return $c;
|
1520 |
}
|
1521 |
|
1522 |
+
protected function op_number_color( $op, $lft, $rgt ) {
|
1523 |
+
if ( $op == '+' || $op == '*' ) {
|
1524 |
+
return $this->op_color_number( $op, $rgt, $lft );
|
1525 |
}
|
1526 |
}
|
1527 |
|
1528 |
+
protected function op_color_number( $op, $lft, $rgt ) {
|
1529 |
+
if ( $rgt[0] == '%' ) {
|
1530 |
+
$rgt[1] /= 100;
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
return $this->op_color_color(
|
1534 |
+
$op,
|
1535 |
+
$lft,
|
1536 |
+
array_fill( 1, count( $lft ) - 1, $rgt[1] )
|
1537 |
+
);
|
1538 |
+
}
|
1539 |
|
1540 |
+
protected function op_color_color( $op, $left, $right ) {
|
1541 |
+
$out = array( 'color' );
|
1542 |
+
$max = count( $left ) > count( $right ) ? count( $left ) : count( $right );
|
1543 |
+
foreach ( range( 1, $max - 1 ) as $i ) {
|
1544 |
+
$lval = isset( $left[ $i ] ) ? $left[ $i ] : 0;
|
1545 |
+
$rval = isset( $right[ $i ] ) ? $right[ $i ] : 0;
|
1546 |
+
switch ( $op ) {
|
1547 |
+
case '+':
|
1548 |
+
$out[] = $lval + $rval;
|
1549 |
+
break;
|
1550 |
+
case '-':
|
1551 |
+
$out[] = $lval - $rval;
|
1552 |
+
break;
|
1553 |
+
case '*':
|
1554 |
+
$out[] = $lval * $rval;
|
1555 |
+
break;
|
1556 |
+
case '%':
|
1557 |
+
$out[] = $lval % $rval;
|
1558 |
+
break;
|
1559 |
+
case '/':
|
1560 |
+
if ( $rval == 0 ) {
|
1561 |
+
$this->throwError( "evaluate error: can't divide by zero" );
|
1562 |
+
}
|
1563 |
+
$out[] = $lval / $rval;
|
1564 |
+
break;
|
1565 |
+
default:
|
1566 |
+
$this->throwError( 'evaluate error: color op number failed on op ' . $op );
|
1567 |
+
}
|
1568 |
+
}
|
1569 |
+
return $this->fixColor( $out );
|
1570 |
}
|
1571 |
|
1572 |
+
// operator on two numbers
|
1573 |
+
protected function op_number_number( $op, $left, $right ) {
|
1574 |
+
$unit = empty( $left[2] ) ? $right[2] : $left[2];
|
1575 |
+
|
1576 |
+
$value = 0;
|
1577 |
+
switch ( $op ) {
|
|
|
1578 |
case '+':
|
1579 |
+
$value = $left[1] + $right[1];
|
|
|
|
|
|
|
1580 |
break;
|
1581 |
case '*':
|
1582 |
+
$value = $left[1] * $right[1];
|
1583 |
+
break;
|
1584 |
+
case '-':
|
1585 |
+
$value = $left[1] - $right[1];
|
1586 |
break;
|
1587 |
case '%':
|
1588 |
+
$value = $left[1] % $right[1];
|
1589 |
break;
|
1590 |
case '/':
|
1591 |
+
if ( $right[1] == 0 ) {
|
1592 |
+
$this->throwError( 'parse error: divide by zero' );
|
1593 |
+
}
|
1594 |
+
$value = $left[1] / $right[1];
|
1595 |
break;
|
1596 |
+
case '<':
|
1597 |
+
return $this->toBool( $left[1] < $right[1] );
|
1598 |
+
case '>':
|
1599 |
+
return $this->toBool( $left[1] > $right[1] );
|
1600 |
+
case '>=':
|
1601 |
+
return $this->toBool( $left[1] >= $right[1] );
|
1602 |
+
case '=<':
|
1603 |
+
return $this->toBool( $left[1] <= $right[1] );
|
1604 |
default:
|
1605 |
+
$this->throwError( 'parse error: unknown number operator: ' . $op );
|
|
|
1606 |
}
|
|
|
|
|
1607 |
|
1608 |
+
return array( 'number', $value, $unit );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
}
|
1610 |
|
1611 |
|
1612 |
/* environment functions */
|
1613 |
|
1614 |
+
protected function makeOutputBlock( $type, $selectors = null ) {
|
1615 |
+
$b = new stdclass();
|
1616 |
+
$b->lines = array();
|
1617 |
+
$b->children = array();
|
1618 |
$b->selectors = $selectors;
|
1619 |
+
$b->type = $type;
|
1620 |
+
$b->parent = $this->scope;
|
1621 |
return $b;
|
1622 |
}
|
1623 |
|
1624 |
// the state of execution
|
1625 |
+
protected function pushEnv( $block = null ) {
|
1626 |
+
$e = new stdclass();
|
1627 |
$e->parent = $this->env;
|
1628 |
+
$e->store = array();
|
1629 |
+
$e->block = $block;
|
1630 |
|
1631 |
$this->env = $e;
|
1632 |
return $e;
|
1634 |
|
1635 |
// pop something off the stack
|
1636 |
protected function popEnv() {
|
1637 |
+
$old = $this->env;
|
1638 |
$this->env = $this->env->parent;
|
1639 |
return $old;
|
1640 |
}
|
1641 |
|
1642 |
// set something in the current env
|
1643 |
+
protected function set( $name, $value ) {
|
1644 |
+
$this->env->store[ $name ] = $value;
|
1645 |
}
|
1646 |
|
1647 |
|
1648 |
// get the highest occurrence entry for a name
|
1649 |
+
protected function get( $name, $default = null ) {
|
1650 |
$current = $this->env;
|
1651 |
|
1652 |
$isArguments = $name == $this->vPrefix . 'arguments';
|
1653 |
+
while ( $current ) {
|
1654 |
+
if ( $isArguments && isset( $current->arguments ) ) {
|
1655 |
+
return array( 'list', ' ', $current->arguments );
|
1656 |
}
|
1657 |
|
1658 |
+
if ( isset( $current->store[ $name ] ) ) {
|
1659 |
+
return $current->store[ $name ];
|
1660 |
+
} else {
|
1661 |
+
$current = isset( $current->storeParent ) ?
|
1662 |
$current->storeParent : $current->parent;
|
1663 |
}
|
1664 |
}
|
1667 |
}
|
1668 |
|
1669 |
// inject array of unparsed strings into environment as variables
|
1670 |
+
protected function injectVariables( $args ) {
|
1671 |
$this->pushEnv();
|
1672 |
+
$parser = new seedprod_lessc_parser( $this, __METHOD__ );
|
1673 |
+
foreach ( $args as $name => $strValue ) {
|
1674 |
+
if ( $name[0] != '@' ) {
|
1675 |
+
$name = '@' . $name;
|
1676 |
+
}
|
1677 |
+
$parser->count = 0;
|
1678 |
+
$parser->buffer = (string) $strValue;
|
1679 |
+
if ( ! $parser->propertyValue( $value ) ) {
|
1680 |
+
throw new Exception( "failed to parse passed in variable $name: $strValue" );
|
1681 |
}
|
1682 |
|
1683 |
+
$this->set( $name, $value );
|
1684 |
}
|
1685 |
}
|
1686 |
|
1688 |
* Initialize any static state, can initialize parser for a file
|
1689 |
* $opts isn't used yet
|
1690 |
*/
|
1691 |
+
public function __construct( $fname = null ) {
|
1692 |
+
if ( $fname !== null ) {
|
1693 |
// used for deprecated parse method
|
1694 |
$this->_parseFile = $fname;
|
1695 |
}
|
1696 |
}
|
1697 |
|
1698 |
+
public function compile( $string, $name = null ) {
|
1699 |
+
$locale = setlocale( LC_NUMERIC, 0 );
|
1700 |
+
setlocale( LC_NUMERIC, 'C' );
|
1701 |
|
1702 |
+
$this->parser = $this->makeParser( $name );
|
1703 |
+
$root = $this->parser->parse( $string );
|
1704 |
|
1705 |
+
$this->env = null;
|
1706 |
$this->scope = null;
|
1707 |
|
1708 |
$this->formatter = $this->newFormatter();
|
1709 |
|
1710 |
+
if ( ! empty( $this->registeredVars ) ) {
|
1711 |
+
$this->injectVariables( $this->registeredVars );
|
1712 |
}
|
1713 |
|
1714 |
$this->sourceParser = $this->parser; // used for error messages
|
1715 |
+
$this->compileBlock( $root );
|
1716 |
|
1717 |
ob_start();
|
1718 |
+
$this->formatter->block( $this->scope );
|
1719 |
$out = ob_get_clean();
|
1720 |
+
setlocale( LC_NUMERIC, $locale );
|
1721 |
return $out;
|
1722 |
}
|
1723 |
|
1724 |
+
public function compileFile( $fname, $outFname = null ) {
|
1725 |
+
if ( ! is_readable( $fname ) ) {
|
1726 |
+
throw new Exception( 'load error: failed to find ' . $fname );
|
1727 |
}
|
1728 |
|
1729 |
+
$pi = pathinfo( $fname );
|
1730 |
|
1731 |
$oldImport = $this->importDir;
|
1732 |
|
1733 |
+
$this->importDir = (array) $this->importDir;
|
1734 |
+
$this->importDir[] = $pi['dirname'] . '/';
|
1735 |
|
1736 |
$this->allParsedFiles = array();
|
1737 |
+
$this->addParsedFile( $fname );
|
1738 |
|
1739 |
+
$out = $this->compile( file_get_contents( $fname ), $fname );
|
1740 |
|
1741 |
$this->importDir = $oldImport;
|
1742 |
|
1743 |
+
if ( $outFname !== null ) {
|
1744 |
+
return file_put_contents( $outFname, $out );
|
1745 |
}
|
1746 |
|
1747 |
return $out;
|
1748 |
}
|
1749 |
|
1750 |
// compile only if changed input has changed or output doesn't exist
|
1751 |
+
public function checkedCompile( $in, $out ) {
|
1752 |
+
if ( ! is_file( $out ) || filemtime( $in ) > filemtime( $out ) ) {
|
1753 |
+
$this->compileFile( $in, $out );
|
1754 |
return true;
|
1755 |
}
|
1756 |
return false;
|
1776 |
* @param bool $force Force rebuild?
|
1777 |
* @return array lessphp cache structure
|
1778 |
*/
|
1779 |
+
public function cachedCompile( $in, $force = false ) {
|
1780 |
// assume no root
|
1781 |
$root = null;
|
1782 |
|
1783 |
+
if ( is_string( $in ) ) {
|
1784 |
$root = $in;
|
1785 |
+
} elseif ( is_array( $in ) and isset( $in['root'] ) ) {
|
1786 |
+
if ( $force or ! isset( $in['files'] ) ) {
|
1787 |
// If we are forcing a recompile or if for some reason the
|
1788 |
// structure does not contain any file information we should
|
1789 |
// specify the root to trigger a rebuild.
|
1790 |
$root = $in['root'];
|
1791 |
+
} elseif ( isset( $in['files'] ) and is_array( $in['files'] ) ) {
|
1792 |
+
foreach ( $in['files'] as $fname => $ftime ) {
|
1793 |
+
if ( ! file_exists( $fname ) or filemtime( $fname ) > $ftime ) {
|
1794 |
// One of the files we knew about previously has changed
|
1795 |
// so we should look at our incoming root again.
|
1796 |
$root = $in['root'];
|
1804 |
return null;
|
1805 |
}
|
1806 |
|
1807 |
+
if ( $root !== null ) {
|
1808 |
// If we have a root value which means we should rebuild.
|
1809 |
+
$out = array();
|
1810 |
+
$out['root'] = $root;
|
1811 |
+
$out['compiled'] = $this->compileFile( $root );
|
1812 |
+
$out['files'] = $this->allParsedFiles();
|
1813 |
+
$out['updated'] = time();
|
1814 |
return $out;
|
1815 |
} else {
|
1816 |
// No changes, pass back the structure
|
1822 |
|
1823 |
// parse and compile buffer
|
1824 |
// This is deprecated
|
1825 |
+
public function parse( $str = null, $initialVariables = null ) {
|
1826 |
+
if ( is_array( $str ) ) {
|
1827 |
$initialVariables = $str;
|
1828 |
+
$str = null;
|
1829 |
}
|
1830 |
|
1831 |
$oldVars = $this->registeredVars;
|
1832 |
+
if ( $initialVariables !== null ) {
|
1833 |
+
$this->setVariables( $initialVariables );
|
1834 |
}
|
1835 |
|
1836 |
+
if ( $str == null ) {
|
1837 |
+
if ( empty( $this->_parseFile ) ) {
|
1838 |
+
throw new exception( 'nothing to parse' );
|
1839 |
}
|
1840 |
|
1841 |
+
$out = $this->compileFile( $this->_parseFile );
|
1842 |
} else {
|
1843 |
+
$out = $this->compile( $str );
|
1844 |
}
|
1845 |
|
1846 |
$this->registeredVars = $oldVars;
|
1847 |
return $out;
|
1848 |
}
|
1849 |
|
1850 |
+
protected function makeParser( $name ) {
|
1851 |
+
$parser = new seedprod_lessc_parser( $this, $name );
|
1852 |
$parser->writeComments = $this->preserveComments;
|
1853 |
|
1854 |
return $parser;
|
1855 |
}
|
1856 |
|
1857 |
+
public function setFormatter( $name ) {
|
1858 |
$this->formatterName = $name;
|
1859 |
}
|
1860 |
|
1861 |
protected function newFormatter() {
|
1862 |
+
$className = 'seedprod_lessc_formatter_lessjs';
|
1863 |
+
if ( ! empty( $this->formatterName ) ) {
|
1864 |
+
if ( ! is_string( $this->formatterName ) ) {
|
1865 |
return $this->formatterName;
|
1866 |
+
}
|
1867 |
$className = "seedprod_lessc_formatter_$this->formatterName";
|
1868 |
}
|
1869 |
|
1870 |
+
return new $className();
|
1871 |
}
|
1872 |
|
1873 |
+
public function setPreserveComments( $preserve ) {
|
1874 |
$this->preserveComments = $preserve;
|
1875 |
}
|
1876 |
|
1877 |
+
public function registerFunction( $name, $func ) {
|
1878 |
+
$this->libFunctions[ $name ] = $func;
|
1879 |
}
|
1880 |
|
1881 |
+
public function unregisterFunction( $name ) {
|
1882 |
+
unset( $this->libFunctions[ $name ] );
|
1883 |
}
|
1884 |
|
1885 |
+
public function setVariables( $variables ) {
|
1886 |
+
$this->registeredVars = array_merge( $this->registeredVars, $variables );
|
1887 |
}
|
1888 |
|
1889 |
+
public function unsetVariable( $name ) {
|
1890 |
+
unset( $this->registeredVars[ $name ] );
|
1891 |
}
|
1892 |
|
1893 |
+
public function setImportDir( $dirs ) {
|
1894 |
+
$this->importDir = (array) $dirs;
|
1895 |
}
|
1896 |
|
1897 |
+
public function addImportDir( $dir ) {
|
1898 |
+
$this->importDir = (array) $this->importDir;
|
1899 |
$this->importDir[] = $dir;
|
1900 |
}
|
1901 |
|
1903 |
return $this->allParsedFiles;
|
1904 |
}
|
1905 |
|
1906 |
+
protected function addParsedFile( $file ) {
|
1907 |
+
$this->allParsedFiles[ realpath( $file ) ] = filemtime( $file );
|
1908 |
}
|
1909 |
|
1910 |
/**
|
1911 |
* Uses the current value of $this->count to show line and line number
|
1912 |
*/
|
1913 |
+
protected function throwError( $msg = null ) {
|
1914 |
+
if ( $this->sourceLoc >= 0 ) {
|
1915 |
+
$this->sourceParser->throwError( $msg, $this->sourceLoc );
|
1916 |
}
|
1917 |
+
throw new exception( $msg );
|
1918 |
}
|
1919 |
|
1920 |
// compile file $in to file $out if $in is newer than $out
|
1921 |
// returns true when it compiles, false otherwise
|
1922 |
+
public static function ccompile( $in, $out, $less = null ) {
|
1923 |
+
if ( $less === null ) {
|
1924 |
+
$less = new self();
|
1925 |
+
}
|
1926 |
+
return $less->checkedCompile( $in, $out );
|
1927 |
+
}
|
1928 |
+
|
1929 |
+
public static function cexecute( $in, $force = false, $less = null ) {
|
1930 |
+
if ( $less === null ) {
|
1931 |
+
$less = new self();
|
1932 |
+
}
|
1933 |
+
return $less->cachedCompile( $in, $force );
|
1934 |
+
}
|
1935 |
+
|
1936 |
+
protected static $cssColors = array(
|
1937 |
+
'aliceblue' => '240,248,255',
|
1938 |
+
'antiquewhite' => '250,235,215',
|
1939 |
+
'aqua' => '0,255,255',
|
1940 |
+
'aquamarine' => '127,255,212',
|
1941 |
+
'azure' => '240,255,255',
|
1942 |
+
'beige' => '245,245,220',
|
1943 |
+
'bisque' => '255,228,196',
|
1944 |
+
'black' => '0,0,0',
|
1945 |
+
'blanchedalmond' => '255,235,205',
|
1946 |
+
'blue' => '0,0,255',
|
1947 |
+
'blueviolet' => '138,43,226',
|
1948 |
+
'brown' => '165,42,42',
|
1949 |
+
'burlywood' => '222,184,135',
|
1950 |
+
'cadetblue' => '95,158,160',
|
1951 |
+
'chartreuse' => '127,255,0',
|
1952 |
+
'chocolate' => '210,105,30',
|
1953 |
+
'coral' => '255,127,80',
|
1954 |
+
'cornflowerblue' => '100,149,237',
|
1955 |
+
'cornsilk' => '255,248,220',
|
1956 |
+
'crimson' => '220,20,60',
|
1957 |
+
'cyan' => '0,255,255',
|
1958 |
+
'darkblue' => '0,0,139',
|
1959 |
+
'darkcyan' => '0,139,139',
|
1960 |
+
'darkgoldenrod' => '184,134,11',
|
1961 |
+
'darkgray' => '169,169,169',
|
1962 |
+
'darkgreen' => '0,100,0',
|
1963 |
+
'darkgrey' => '169,169,169',
|
1964 |
+
'darkkhaki' => '189,183,107',
|
1965 |
+
'darkmagenta' => '139,0,139',
|
1966 |
+
'darkolivegreen' => '85,107,47',
|
1967 |
+
'darkorange' => '255,140,0',
|
1968 |
+
'darkorchid' => '153,50,204',
|
1969 |
+
'darkred' => '139,0,0',
|
1970 |
+
'darksalmon' => '233,150,122',
|
1971 |
+
'darkseagreen' => '143,188,143',
|
1972 |
+
'darkslateblue' => '72,61,139',
|
1973 |
+
'darkslategray' => '47,79,79',
|
1974 |
+
'darkslategrey' => '47,79,79',
|
1975 |
+
'darkturquoise' => '0,206,209',
|
1976 |
+
'darkviolet' => '148,0,211',
|
1977 |
+
'deeppink' => '255,20,147',
|
1978 |
+
'deepskyblue' => '0,191,255',
|
1979 |
+
'dimgray' => '105,105,105',
|
1980 |
+
'dimgrey' => '105,105,105',
|
1981 |
+
'dodgerblue' => '30,144,255',
|
1982 |
+
'firebrick' => '178,34,34',
|
1983 |
+
'floralwhite' => '255,250,240',
|
1984 |
+
'forestgreen' => '34,139,34',
|
1985 |
+
'fuchsia' => '255,0,255',
|
1986 |
+
'gainsboro' => '220,220,220',
|
1987 |
+
'ghostwhite' => '248,248,255',
|
1988 |
+
'gold' => '255,215,0',
|
1989 |
+
'goldenrod' => '218,165,32',
|
1990 |
+
'gray' => '128,128,128',
|
1991 |
+
'green' => '0,128,0',
|
1992 |
+
'greenyellow' => '173,255,47',
|
1993 |
+
'grey' => '128,128,128',
|
1994 |
+
'honeydew' => '240,255,240',
|
1995 |
+
'hotpink' => '255,105,180',
|
1996 |
+
'indianred' => '205,92,92',
|
1997 |
+
'indigo' => '75,0,130',
|
1998 |
+
'ivory' => '255,255,240',
|
1999 |
+
'khaki' => '240,230,140',
|
2000 |
+
'lavender' => '230,230,250',
|
2001 |
+
'lavenderblush' => '255,240,245',
|
2002 |
+
'lawngreen' => '124,252,0',
|
2003 |
+
'lemonchiffon' => '255,250,205',
|
2004 |
+
'lightblue' => '173,216,230',
|
2005 |
+
'lightcoral' => '240,128,128',
|
2006 |
+
'lightcyan' => '224,255,255',
|
2007 |
'lightgoldenrodyellow' => '250,250,210',
|
2008 |
+
'lightgray' => '211,211,211',
|
2009 |
+
'lightgreen' => '144,238,144',
|
2010 |
+
'lightgrey' => '211,211,211',
|
2011 |
+
'lightpink' => '255,182,193',
|
2012 |
+
'lightsalmon' => '255,160,122',
|
2013 |
+
'lightseagreen' => '32,178,170',
|
2014 |
+
'lightskyblue' => '135,206,250',
|
2015 |
+
'lightslategray' => '119,136,153',
|
2016 |
+
'lightslategrey' => '119,136,153',
|
2017 |
+
'lightsteelblue' => '176,196,222',
|
2018 |
+
'lightyellow' => '255,255,224',
|
2019 |
+
'lime' => '0,255,0',
|
2020 |
+
'limegreen' => '50,205,50',
|
2021 |
+
'linen' => '250,240,230',
|
2022 |
+
'magenta' => '255,0,255',
|
2023 |
+
'maroon' => '128,0,0',
|
2024 |
+
'mediumaquamarine' => '102,205,170',
|
2025 |
+
'mediumblue' => '0,0,205',
|
2026 |
+
'mediumorchid' => '186,85,211',
|
2027 |
+
'mediumpurple' => '147,112,219',
|
2028 |
+
'mediumseagreen' => '60,179,113',
|
2029 |
+
'mediumslateblue' => '123,104,238',
|
2030 |
+
'mediumspringgreen' => '0,250,154',
|
2031 |
+
'mediumturquoise' => '72,209,204',
|
2032 |
+
'mediumvioletred' => '199,21,133',
|
2033 |
+
'midnightblue' => '25,25,112',
|
2034 |
+
'mintcream' => '245,255,250',
|
2035 |
+
'mistyrose' => '255,228,225',
|
2036 |
+
'moccasin' => '255,228,181',
|
2037 |
+
'navajowhite' => '255,222,173',
|
2038 |
+
'navy' => '0,0,128',
|
2039 |
+
'oldlace' => '253,245,230',
|
2040 |
+
'olive' => '128,128,0',
|
2041 |
+
'olivedrab' => '107,142,35',
|
2042 |
+
'orange' => '255,165,0',
|
2043 |
+
'orangered' => '255,69,0',
|
2044 |
+
'orchid' => '218,112,214',
|
2045 |
+
'palegoldenrod' => '238,232,170',
|
2046 |
+
'palegreen' => '152,251,152',
|
2047 |
+
'paleturquoise' => '175,238,238',
|
2048 |
+
'palevioletred' => '219,112,147',
|
2049 |
+
'papayawhip' => '255,239,213',
|
2050 |
+
'peachpuff' => '255,218,185',
|
2051 |
+
'peru' => '205,133,63',
|
2052 |
+
'pink' => '255,192,203',
|
2053 |
+
'plum' => '221,160,221',
|
2054 |
+
'powderblue' => '176,224,230',
|
2055 |
+
'purple' => '128,0,128',
|
2056 |
+
'red' => '255,0,0',
|
2057 |
+
'rosybrown' => '188,143,143',
|
2058 |
+
'royalblue' => '65,105,225',
|
2059 |
+
'saddlebrown' => '139,69,19',
|
2060 |
+
'salmon' => '250,128,114',
|
2061 |
+
'sandybrown' => '244,164,96',
|
2062 |
+
'seagreen' => '46,139,87',
|
2063 |
+
'seashell' => '255,245,238',
|
2064 |
+
'sienna' => '160,82,45',
|
2065 |
+
'silver' => '192,192,192',
|
2066 |
+
'skyblue' => '135,206,235',
|
2067 |
+
'slateblue' => '106,90,205',
|
2068 |
+
'slategray' => '112,128,144',
|
2069 |
+
'slategrey' => '112,128,144',
|
2070 |
+
'snow' => '255,250,250',
|
2071 |
+
'springgreen' => '0,255,127',
|
2072 |
+
'steelblue' => '70,130,180',
|
2073 |
+
'tan' => '210,180,140',
|
2074 |
+
'teal' => '0,128,128',
|
2075 |
+
'thistle' => '216,191,216',
|
2076 |
+
'tomato' => '255,99,71',
|
2077 |
+
'turquoise' => '64,224,208',
|
2078 |
+
'violet' => '238,130,238',
|
2079 |
+
'wheat' => '245,222,179',
|
2080 |
+
'white' => '255,255,255',
|
2081 |
+
'whitesmoke' => '245,245,245',
|
2082 |
+
'yellow' => '255,255,0',
|
2083 |
+
'yellowgreen' => '154,205,50',
|
2084 |
);
|
2085 |
}
|
2086 |
|
2087 |
// responsible for taking a string of LESS code and converting it into a
|
2088 |
// syntax tree
|
2089 |
class seedprod_lessc_parser {
|
2090 |
+
protected static $nextBlockId = 0; // used to uniquely identify blocks
|
2091 |
|
2092 |
+
protected static $precedence = array(
|
2093 |
'=<' => 0,
|
2094 |
'>=' => 0,
|
2095 |
+
'=' => 0,
|
2096 |
+
'<' => 0,
|
2097 |
+
'>' => 0,
|
2098 |
+
|
2099 |
+
'+' => 1,
|
2100 |
+
'-' => 1,
|
2101 |
+
'*' => 2,
|
2102 |
+
'/' => 2,
|
2103 |
+
'%' => 2,
|
2104 |
);
|
2105 |
|
2106 |
+
protected static $whitePattern;
|
2107 |
+
protected static $commentMulti;
|
2108 |
|
2109 |
+
protected static $commentSingle = '//';
|
2110 |
+
protected static $commentMultiLeft = '/*';
|
2111 |
+
protected static $commentMultiRight = '*/';
|
2112 |
|
2113 |
// regex string to match any of the operators
|
2114 |
+
protected static $operatorString;
|
2115 |
|
2116 |
// these properties will supress division unless it's inside parenthases
|
2117 |
+
protected static $supressDivisionProps =
|
2118 |
+
array( '/border-radius$/i', '/^font$/i' );
|
2119 |
|
2120 |
+
protected $blockDirectives = array( 'font-face', 'keyframes', 'page', '-moz-document' );
|
2121 |
+
protected $lineDirectives = array( 'charset' );
|
2122 |
|
2123 |
/**
|
2124 |
* if we are in parens we can be more liberal with whitespace around
|
2132 |
protected $inParens = false;
|
2133 |
|
2134 |
// caches preg escaped literals
|
2135 |
+
protected static $literalCache = array();
|
2136 |
|
2137 |
+
public function __construct( $seedprod_lessc, $sourceName = null ) {
|
2138 |
$this->eatWhiteDefault = true;
|
2139 |
// reference to less needed for vPrefix, mPrefix, and parentSelector
|
2140 |
$this->seedprod_lessc = $seedprod_lessc;
|
2143 |
|
2144 |
$this->writeComments = false;
|
2145 |
|
2146 |
+
if ( ! self::$operatorString ) {
|
2147 |
self::$operatorString =
|
2148 |
+
'(' . implode(
|
2149 |
+
'|',
|
2150 |
+
array_map(
|
2151 |
+
array( 'seedprod_lessc', 'preg_quote' ),
|
2152 |
+
array_keys( self::$precedence )
|
2153 |
+
)
|
2154 |
+
) . ')';
|
2155 |
|
2156 |
+
$commentSingle = seedprod_lessc::preg_quote( self::$commentSingle );
|
2157 |
+
$commentMultiLeft = seedprod_lessc::preg_quote( self::$commentMultiLeft );
|
2158 |
+
$commentMultiRight = seedprod_lessc::preg_quote( self::$commentMultiRight );
|
2159 |
|
2160 |
+
self::$commentMulti = $commentMultiLeft . '.*?' . $commentMultiRight;
|
2161 |
+
self::$whitePattern = '/' . $commentSingle . '[^\n]*\s*|(' . self::$commentMulti . ')\s*|\s+/Ais';
|
2162 |
}
|
2163 |
}
|
2164 |
|
2165 |
+
public function parse( $buffer ) {
|
2166 |
$this->count = 0;
|
2167 |
+
$this->line = 1;
|
2168 |
|
2169 |
+
$this->env = null; // block stack
|
2170 |
+
$this->buffer = $this->writeComments ? $buffer : $this->removeComments( $buffer );
|
2171 |
+
$this->pushSpecialBlock( 'root' );
|
2172 |
$this->eatWhiteDefault = true;
|
2173 |
+
$this->seenComments = array();
|
2174 |
|
2175 |
// trim whitespace on head
|
2176 |
// if (preg_match('/^\s+/', $this->buffer, $m)) {
|
2181 |
|
2182 |
// parse the entire file
|
2183 |
$lastCount = $this->count;
|
2184 |
+
while ( false !== $this->parseChunk() );
|
2185 |
|
2186 |
+
if ( $this->count != strlen( $this->buffer ) ) {
|
2187 |
$this->throwError();
|
2188 |
+
}
|
2189 |
|
2190 |
// TODO report where the block was opened
|
2191 |
+
if ( ! is_null( $this->env->parent ) ) {
|
2192 |
+
throw new exception( 'parse error: unclosed block' );
|
2193 |
+
}
|
2194 |
|
2195 |
return $this->env;
|
2196 |
}
|
2232 |
* go back where we started.
|
2233 |
*/
|
2234 |
protected function parseChunk() {
|
2235 |
+
if ( empty( $this->buffer ) ) {
|
2236 |
+
return false;
|
2237 |
+
}
|
2238 |
$s = $this->seek();
|
2239 |
|
2240 |
// setting a property
|
2241 |
+
if ( $this->keyword( $key ) && $this->assign() &&
|
2242 |
+
$this->propertyValue( $value, $key ) && $this->end() ) {
|
2243 |
+
$this->append( array( 'assign', $key, $value ), $s );
|
|
|
2244 |
return true;
|
2245 |
} else {
|
2246 |
+
$this->seek( $s );
|
2247 |
}
|
2248 |
|
|
|
2249 |
// look for special css blocks
|
2250 |
+
if ( $this->literal( '@', false ) ) {
|
2251 |
$this->count--;
|
2252 |
|
2253 |
// media
|
2254 |
+
if ( $this->literal( '@media' ) ) {
|
2255 |
+
if ( ( $this->mediaQueryList( $mediaQueries ) || true )
|
2256 |
+
&& $this->literal( '{' ) ) {
|
2257 |
+
$media = $this->pushSpecialBlock( 'media' );
|
2258 |
+
$media->queries = is_null( $mediaQueries ) ? array() : $mediaQueries;
|
|
|
2259 |
return true;
|
2260 |
} else {
|
2261 |
+
$this->seek( $s );
|
2262 |
return false;
|
2263 |
}
|
2264 |
}
|
2265 |
|
2266 |
+
if ( $this->literal( '@', false ) && $this->keyword( $dirName ) ) {
|
2267 |
+
if ( $this->isDirective( $dirName, $this->blockDirectives ) ) {
|
2268 |
+
if ( ( $this->openString( '{', $dirValue, null, array( ';' ) ) || true ) &&
|
2269 |
+
$this->literal( '{' ) ) {
|
2270 |
+
$dir = $this->pushSpecialBlock( 'directive' );
|
|
|
2271 |
$dir->name = $dirName;
|
2272 |
+
if ( isset( $dirValue ) ) {
|
2273 |
+
$dir->value = $dirValue;
|
2274 |
+
}
|
2275 |
return true;
|
2276 |
}
|
2277 |
+
} elseif ( $this->isDirective( $dirName, $this->lineDirectives ) ) {
|
2278 |
+
if ( $this->propertyValue( $dirValue ) && $this->end() ) {
|
2279 |
+
$this->append( array( 'directive', $dirName, $dirValue ) );
|
2280 |
return true;
|
2281 |
}
|
2282 |
}
|
2283 |
}
|
2284 |
|
2285 |
+
$this->seek( $s );
|
2286 |
}
|
2287 |
|
2288 |
// setting a variable
|
2289 |
+
if ( $this->variable( $var ) && $this->assign() &&
|
2290 |
+
$this->propertyValue( $value ) && $this->end() ) {
|
2291 |
+
$this->append( array( 'assign', $var, $value ), $s );
|
|
|
2292 |
return true;
|
2293 |
} else {
|
2294 |
+
$this->seek( $s );
|
2295 |
}
|
2296 |
|
2297 |
+
if ( $this->import( $importValue ) ) {
|
2298 |
+
$this->append( $importValue, $s );
|
2299 |
return true;
|
2300 |
}
|
2301 |
|
2302 |
// opening parametric mixin
|
2303 |
+
if ( $this->tag( $tag, true ) && $this->argumentDef( $args, $isVararg ) &&
|
2304 |
+
( $this->guards( $guards ) || true ) &&
|
2305 |
+
$this->literal( '{' ) ) {
|
2306 |
+
$block = $this->pushBlock( $this->fixTags( array( $tag ) ) );
|
2307 |
+
$block->args = $args;
|
|
|
2308 |
$block->isVararg = $isVararg;
|
2309 |
+
if ( ! empty( $guards ) ) {
|
2310 |
+
$block->guards = $guards;
|
2311 |
+
}
|
2312 |
return true;
|
2313 |
} else {
|
2314 |
+
$this->seek( $s );
|
2315 |
}
|
2316 |
|
2317 |
// opening a simple block
|
2318 |
+
if ( $this->tags( $tags ) && $this->literal( '{' ) ) {
|
2319 |
+
$tags = $this->fixTags( $tags );
|
2320 |
+
$this->pushBlock( $tags );
|
2321 |
return true;
|
2322 |
} else {
|
2323 |
+
$this->seek( $s );
|
2324 |
}
|
2325 |
|
2326 |
// closing a block
|
2327 |
+
if ( $this->literal( '}', false ) ) {
|
2328 |
try {
|
2329 |
$block = $this->pop();
|
2330 |
+
} catch ( exception $e ) {
|
2331 |
+
$this->seek( $s );
|
2332 |
+
$this->throwError( $e->getMessage() );
|
2333 |
}
|
2334 |
|
2335 |
$hidden = false;
|
2336 |
+
if ( is_null( $block->type ) ) {
|
2337 |
$hidden = true;
|
2338 |
+
if ( ! isset( $block->args ) ) {
|
2339 |
+
foreach ( $block->tags as $tag ) {
|
2340 |
+
if ( ! is_string( $tag ) || $tag[0] != $this->seedprod_lessc->mPrefix ) {
|
2341 |
$hidden = false;
|
2342 |
break;
|
2343 |
}
|
2344 |
}
|
2345 |
}
|
2346 |
|
2347 |
+
foreach ( $block->tags as $tag ) {
|
2348 |
+
if ( is_string( $tag ) ) {
|
2349 |
+
$this->env->children[ $tag ][] = $block;
|
2350 |
}
|
2351 |
}
|
2352 |
}
|
2353 |
|
2354 |
+
if ( ! $hidden ) {
|
2355 |
+
$this->append( array( 'block', $block ), $s );
|
2356 |
}
|
2357 |
|
2358 |
// this is done here so comments aren't bundled into he block that
|
2362 |
}
|
2363 |
|
2364 |
// mixin
|
2365 |
+
if ( $this->mixinTags( $tags ) &&
|
2366 |
+
( $this->argumentValues( $argv ) || true ) &&
|
2367 |
+
( $this->keyword( $suffix ) || true ) && $this->end() ) {
|
2368 |
+
$tags = $this->fixTags( $tags );
|
2369 |
+
$this->append( array( 'mixin', $tags, $argv, $suffix ), $s );
|
|
|
2370 |
return true;
|
2371 |
} else {
|
2372 |
+
$this->seek( $s );
|
2373 |
}
|
2374 |
|
2375 |
// spare ;
|
2376 |
+
if ( $this->literal( ';' ) ) {
|
2377 |
+
return true;
|
2378 |
+
}
|
2379 |
|
2380 |
return false; // got nothing, throw error
|
2381 |
}
|
2382 |
|
2383 |
+
protected function isDirective( $dirname, $directives ) {
|
2384 |
// TODO: cache pattern in parser
|
2385 |
+
$pattern = implode(
|
2386 |
+
'|',
|
2387 |
+
array_map( array( 'seedprod_lessc', 'preg_quote' ), $directives )
|
2388 |
+
);
|
2389 |
$pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i';
|
2390 |
|
2391 |
+
return preg_match( $pattern, $dirname );
|
2392 |
}
|
2393 |
|
2394 |
+
protected function fixTags( $tags ) {
|
2395 |
// move @ tags out of variable namespace
|
2396 |
+
foreach ( $tags as &$tag ) {
|
2397 |
+
if ( $tag[0] == $this->seedprod_lessc->vPrefix ) {
|
2398 |
$tag[0] = $this->seedprod_lessc->mPrefix;
|
2399 |
+
}
|
2400 |
}
|
2401 |
return $tags;
|
2402 |
}
|
2403 |
|
2404 |
// a list of expressions
|
2405 |
+
protected function expressionList( &$exps ) {
|
2406 |
$values = array();
|
2407 |
|
2408 |
+
while ( $this->expression( $exp ) ) {
|
2409 |
$values[] = $exp;
|
2410 |
}
|
2411 |
|
2412 |
+
if ( count( $values ) == 0 ) {
|
2413 |
+
return false;
|
2414 |
+
}
|
2415 |
|
2416 |
+
$exps = seedprod_lessc::compressList( $values, ' ' );
|
2417 |
return true;
|
2418 |
}
|
2419 |
|
2421 |
* Attempt to consume an expression.
|
2422 |
* @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code
|
2423 |
*/
|
2424 |
+
protected function expression( &$out ) {
|
2425 |
+
if ( $this->value( $lhs ) ) {
|
2426 |
+
$out = $this->expHelper( $lhs, 0 );
|
2427 |
|
2428 |
// look for / shorthand
|
2429 |
+
if ( ! empty( $this->env->supressedDivision ) ) {
|
2430 |
+
unset( $this->env->supressedDivision );
|
2431 |
$s = $this->seek();
|
2432 |
+
if ( $this->literal( '/' ) && $this->value( $rhs ) ) {
|
2433 |
+
$out = array(
|
2434 |
+
'list',
|
2435 |
+
'',
|
2436 |
+
array( $out, array( 'keyword', '/' ), $rhs ),
|
2437 |
+
);
|
2438 |
} else {
|
2439 |
+
$this->seek( $s );
|
2440 |
}
|
2441 |
}
|
2442 |
|
2448 |
/**
|
2449 |
* recursively parse infix equation with $lhs at precedence $minP
|
2450 |
*/
|
2451 |
+
protected function expHelper( $lhs, $minP ) {
|
2452 |
$this->inExp = true;
|
2453 |
+
$ss = $this->seek();
|
2454 |
|
2455 |
+
while ( true ) {
|
2456 |
+
$whiteBefore = isset( $this->buffer[ $this->count - 1 ] ) &&
|
2457 |
+
ctype_space( $this->buffer[ $this->count - 1 ] );
|
2458 |
|
2459 |
// If there is whitespace before the operator, then we require
|
2460 |
// whitespace after the operator for it to be an expression
|
2461 |
+
$needWhite = $whiteBefore && ! $this->inParens;
|
2462 |
|
2463 |
+
if ( $this->match( self::$operatorString . ( $needWhite ? '\s' : '' ), $m ) && self::$precedence[ $m[1] ] >= $minP ) {
|
2464 |
+
if ( ! $this->inParens && isset( $this->env->currentProperty ) && $m[1] == '/' && empty( $this->env->supressedDivision ) ) {
|
2465 |
+
foreach ( self::$supressDivisionProps as $pattern ) {
|
2466 |
+
if ( preg_match( $pattern, $this->env->currentProperty ) ) {
|
2467 |
$this->env->supressedDivision = true;
|
2468 |
break 2;
|
2469 |
}
|
2470 |
}
|
2471 |
}
|
2472 |
|
2473 |
+
$whiteAfter = isset( $this->buffer[ $this->count - 1 ] ) &&
|
2474 |
+
ctype_space( $this->buffer[ $this->count - 1 ] );
|
2475 |
|
2476 |
+
if ( ! $this->value( $rhs ) ) {
|
2477 |
+
break;
|
2478 |
+
}
|
|
|
2479 |
|
2480 |
// peek for next operator to see what to do with rhs
|
2481 |
+
if ( $this->peek( self::$operatorString, $next ) && self::$precedence[ $next[1] ] > self::$precedence[ $m[1] ] ) {
|
2482 |
+
$rhs = $this->expHelper( $rhs, self::$precedence[ $next[1] ] );
|
2483 |
}
|
2484 |
|
2485 |
+
$lhs = array( 'expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter );
|
2486 |
+
$ss = $this->seek();
|
2487 |
|
2488 |
continue;
|
2489 |
}
|
2491 |
break;
|
2492 |
}
|
2493 |
|
2494 |
+
$this->seek( $ss );
|
2495 |
|
2496 |
return $lhs;
|
2497 |
}
|
2498 |
|
2499 |
// consume a list of values for a property
|
2500 |
+
public function propertyValue( &$value, $keyName = null ) {
|
2501 |
$values = array();
|
2502 |
|
2503 |
+
if ( $keyName !== null ) {
|
2504 |
+
$this->env->currentProperty = $keyName;
|
2505 |
+
}
|
2506 |
|
2507 |
$s = null;
|
2508 |
+
while ( $this->expressionList( $v ) ) {
|
2509 |
$values[] = $v;
|
2510 |
+
$s = $this->seek();
|
2511 |
+
if ( ! $this->literal( ',' ) ) {
|
2512 |
+
break;
|
2513 |
+
}
|
2514 |
}
|
2515 |
|
2516 |
+
if ( $s ) {
|
2517 |
+
$this->seek( $s );
|
2518 |
+
}
|
2519 |
|
2520 |
+
if ( $keyName !== null ) {
|
2521 |
+
unset( $this->env->currentProperty );
|
2522 |
+
}
|
2523 |
|
2524 |
+
if ( count( $values ) == 0 ) {
|
2525 |
+
return false;
|
2526 |
+
}
|
2527 |
|
2528 |
+
$value = seedprod_lessc::compressList( $values, ', ' );
|
2529 |
return true;
|
2530 |
}
|
2531 |
|
2532 |
+
protected function parenValue( &$out ) {
|
2533 |
$s = $this->seek();
|
2534 |
|
2535 |
// speed shortcut
|
2536 |
+
if ( isset( $this->buffer[ $this->count ] ) && $this->buffer[ $this->count ] != '(' ) {
|
2537 |
return false;
|
2538 |
}
|
2539 |
|
2540 |
$inParens = $this->inParens;
|
2541 |
+
if ( $this->literal( '(' ) &&
|
2542 |
+
( $this->inParens = true ) && $this->expression( $exp ) &&
|
2543 |
+
$this->literal( ')' ) ) {
|
2544 |
+
$out = $exp;
|
|
|
2545 |
$this->inParens = $inParens;
|
2546 |
return true;
|
2547 |
} else {
|
2548 |
$this->inParens = $inParens;
|
2549 |
+
$this->seek( $s );
|
2550 |
}
|
2551 |
|
2552 |
return false;
|
2553 |
}
|
2554 |
|
2555 |
// a single value
|
2556 |
+
protected function value( &$value ) {
|
2557 |
$s = $this->seek();
|
2558 |
|
2559 |
// speed shortcut
|
2560 |
+
if ( isset( $this->buffer[ $this->count ] ) && $this->buffer[ $this->count ] == '-' ) {
|
2561 |
// negation
|
2562 |
+
if ( $this->literal( '-', false ) &&
|
2563 |
+
( ( $this->variable( $inner ) && $inner = array( 'variable', $inner ) ) ||
|
2564 |
+
$this->unit( $inner ) ||
|
2565 |
+
$this->parenValue( $inner ) ) ) {
|
2566 |
+
$value = array( 'unary', '-', $inner );
|
|
|
2567 |
return true;
|
2568 |
} else {
|
2569 |
+
$this->seek( $s );
|
2570 |
}
|
2571 |
}
|
2572 |
|
2573 |
+
if ( $this->parenValue( $value ) ) {
|
2574 |
+
return true;
|
2575 |
+
}
|
2576 |
+
if ( $this->unit( $value ) ) {
|
2577 |
+
return true;
|
2578 |
+
}
|
2579 |
+
if ( $this->color( $value ) ) {
|
2580 |
+
return true;
|
2581 |
+
}
|
2582 |
+
if ( $this->func( $value ) ) {
|
2583 |
+
return true;
|
2584 |
+
}
|
2585 |
+
if ( $this->lstring( $value ) ) {
|
2586 |
+
return true;
|
2587 |
+
}
|
2588 |
|
2589 |
+
if ( $this->keyword( $word ) ) {
|
2590 |
+
$value = array( 'keyword', $word );
|
2591 |
return true;
|
2592 |
}
|
2593 |
|
2594 |
// try a variable
|
2595 |
+
if ( $this->variable( $var ) ) {
|
2596 |
+
$value = array( 'variable', $var );
|
2597 |
return true;
|
2598 |
}
|
2599 |
|
2600 |
// unquote string (should this work on any type?
|
2601 |
+
if ( $this->literal( '~' ) && $this->lstring( $str ) ) {
|
2602 |
+
$value = array( 'escape', $str );
|
2603 |
return true;
|
2604 |
} else {
|
2605 |
+
$this->seek( $s );
|
2606 |
}
|
2607 |
|
2608 |
// css hack: \0
|
2609 |
+
if ( $this->literal( '\\' ) && $this->match( '([0-9]+)', $m ) ) {
|
2610 |
+
$value = array( 'keyword', '\\' . $m[1] );
|
2611 |
return true;
|
2612 |
} else {
|
2613 |
+
$this->seek( $s );
|
2614 |
}
|
2615 |
|
2616 |
return false;
|
2617 |
}
|
2618 |
|
2619 |
// an import statement
|
2620 |
+
protected function import( &$out ) {
|
2621 |
$s = $this->seek();
|
2622 |
+
if ( ! $this->literal( '@import' ) ) {
|
2623 |
+
return false;
|
2624 |
+
}
|
2625 |
|
2626 |
// @import "something.css" media;
|
2627 |
// @import url("something.css") media;
|
2628 |
// @import url(something.css) media;
|
2629 |
|
2630 |
+
if ( $this->propertyValue( $value ) ) {
|
2631 |
+
$out = array( 'import', $value );
|
2632 |
return true;
|
2633 |
}
|
2634 |
}
|
2635 |
|
2636 |
+
protected function mediaQueryList( &$out ) {
|
2637 |
+
if ( $this->genericList( $list, 'mediaQuery', ',', false ) ) {
|
2638 |
$out = $list[2];
|
2639 |
return true;
|
2640 |
}
|
2641 |
return false;
|
2642 |
}
|
2643 |
|
2644 |
+
protected function mediaQuery( &$out ) {
|
2645 |
$s = $this->seek();
|
2646 |
|
2647 |
$expressions = null;
|
2648 |
+
$parts = array();
|
2649 |
|
2650 |
+
if ( ( $this->literal( 'only' ) && ( $only = true ) || $this->literal( 'not' ) && ( $not = true ) || true ) && $this->keyword( $mediaType ) ) {
|
2651 |
+
$prop = array( 'mediaType' );
|
2652 |
+
if ( isset( $only ) ) {
|
2653 |
+
$prop[] = 'only';
|
2654 |
+
}
|
2655 |
+
if ( isset( $not ) ) {
|
2656 |
+
$prop[] = 'not';
|
2657 |
+
}
|
2658 |
+
$prop[] = $mediaType;
|
2659 |
$parts[] = $prop;
|
2660 |
} else {
|
2661 |
+
$this->seek( $s );
|
2662 |
}
|
2663 |
|
2664 |
+
if ( ! empty( $mediaType ) && ! $this->literal( 'and' ) ) {
|
|
|
2665 |
// ~
|
2666 |
} else {
|
2667 |
+
$this->genericList( $expressions, 'mediaExpression', 'and', false );
|
2668 |
+
if ( is_array( $expressions ) ) {
|
2669 |
+
$parts = array_merge( $parts, $expressions[2] );
|
2670 |
+
}
|
2671 |
}
|
2672 |
|
2673 |
+
if ( count( $parts ) == 0 ) {
|
2674 |
+
$this->seek( $s );
|
2675 |
return false;
|
2676 |
}
|
2677 |
|
2679 |
return true;
|
2680 |
}
|
2681 |
|
2682 |
+
protected function mediaExpression( &$out ) {
|
2683 |
+
$s = $this->seek();
|
2684 |
$value = null;
|
2685 |
+
if ( $this->literal( '(' ) &&
|
2686 |
+
$this->keyword( $feature ) &&
|
2687 |
+
( $this->literal( ':' ) && $this->expression( $value ) || true ) &&
|
2688 |
+
$this->literal( ')' ) ) {
|
2689 |
+
$out = array( 'mediaExp', $feature );
|
2690 |
+
if ( $value ) {
|
2691 |
+
$out[] = $value;
|
2692 |
+
}
|
2693 |
return true;
|
2694 |
}
|
2695 |
|
2696 |
+
$this->seek( $s );
|
2697 |
return false;
|
2698 |
}
|
2699 |
|
2700 |
// an unbounded string stopped by $end
|
2701 |
+
protected function openString( $end, &$out, $nestingOpen = null, $rejectStrs = null ) {
|
2702 |
+
$oldWhite = $this->eatWhiteDefault;
|
2703 |
$this->eatWhiteDefault = false;
|
2704 |
|
2705 |
+
$stop = array( "'", '"', '@{', $end );
|
2706 |
+
$stop = array_map( array( 'seedprod_lessc', 'preg_quote' ), $stop );
|
2707 |
// $stop[] = self::$commentMulti;
|
2708 |
|
2709 |
+
if ( ! is_null( $rejectStrs ) ) {
|
2710 |
+
$stop = array_merge( $stop, $rejectStrs );
|
2711 |
}
|
2712 |
|
2713 |
+
$patt = '(.*?)(' . implode( '|', $stop ) . ')';
|
2714 |
|
2715 |
$nestingLevel = 0;
|
2716 |
|
2717 |
$content = array();
|
2718 |
+
while ( $this->match( $patt, $m, false ) ) {
|
2719 |
+
if ( ! empty( $m[1] ) ) {
|
2720 |
$content[] = $m[1];
|
2721 |
+
if ( $nestingOpen ) {
|
2722 |
+
$nestingLevel += substr_count( $m[1], $nestingOpen );
|
2723 |
}
|
2724 |
}
|
2725 |
|
2726 |
$tok = $m[2];
|
2727 |
|
2728 |
+
$this->count -= strlen( $tok );
|
2729 |
+
if ( $tok == $end ) {
|
2730 |
+
if ( $nestingLevel == 0 ) {
|
2731 |
break;
|
2732 |
} else {
|
2733 |
$nestingLevel--;
|
2734 |
}
|
2735 |
}
|
2736 |
|
2737 |
+
if ( ( $tok == "'" || $tok == '"' ) && $this->lstring( $str ) ) {
|
2738 |
$content[] = $str;
|
2739 |
continue;
|
2740 |
}
|
2741 |
|
2742 |
+
if ( $tok == '@{' && $this->interpolation( $inter ) ) {
|
2743 |
$content[] = $inter;
|
2744 |
continue;
|
2745 |
}
|
2746 |
|
2747 |
+
if ( in_array( $tok, $rejectStrs ) ) {
|
2748 |
$count = null;
|
2749 |
break;
|
2750 |
}
|
2751 |
|
2752 |
+
$content[] = $tok;
|
2753 |
+
$this->count += strlen( $tok );
|
|
|
2754 |
}
|
2755 |
|
2756 |
$this->eatWhiteDefault = $oldWhite;
|
2757 |
|
2758 |
+
if ( count( $content ) == 0 ) {
|
2759 |
+
return false;
|
2760 |
+
}
|
2761 |
|
2762 |
// trim the end
|
2763 |
+
if ( is_string( end( $content ) ) ) {
|
2764 |
+
$content[ count( $content ) - 1 ] = rtrim( end( $content ) );
|
2765 |
}
|
2766 |
|
2767 |
+
$out = array( 'string', '', $content );
|
2768 |
return true;
|
2769 |
}
|
2770 |
|
2771 |
+
protected function lstring( &$out ) {
|
2772 |
$s = $this->seek();
|
2773 |
+
if ( $this->literal( '"', false ) ) {
|
2774 |
$delim = '"';
|
2775 |
+
} elseif ( $this->literal( "'", false ) ) {
|
2776 |
$delim = "'";
|
2777 |
} else {
|
2778 |
return false;
|
2782 |
|
2783 |
// look for either ending delim , escape, or string interpolation
|
2784 |
$patt = '([^\n]*?)(@\{|\\\\|' .
|
2785 |
+
seedprod_lessc::preg_quote( $delim ) . ')';
|
2786 |
|
2787 |
+
$oldWhite = $this->eatWhiteDefault;
|
2788 |
$this->eatWhiteDefault = false;
|
2789 |
|
2790 |
+
while ( $this->match( $patt, $m, false ) ) {
|
2791 |
$content[] = $m[1];
|
2792 |
+
if ( $m[2] == '@{' ) {
|
2793 |
+
$this->count -= strlen( $m[2] );
|
2794 |
+
if ( $this->interpolation( $inter, false ) ) {
|
2795 |
$content[] = $inter;
|
2796 |
} else {
|
2797 |
+
$this->count += strlen( $m[2] );
|
2798 |
+
$content[] = '@{'; // ignore it
|
2799 |
}
|
2800 |
+
} elseif ( $m[2] == '\\' ) {
|
2801 |
$content[] = $m[2];
|
2802 |
+
if ( $this->literal( $delim, false ) ) {
|
2803 |
$content[] = $delim;
|
2804 |
}
|
2805 |
} else {
|
2806 |
+
$this->count -= strlen( $delim );
|
2807 |
break; // delim
|
2808 |
}
|
2809 |
}
|
2810 |
|
2811 |
$this->eatWhiteDefault = $oldWhite;
|
2812 |
|
2813 |
+
if ( $this->literal( $delim ) ) {
|
2814 |
+
$out = array( 'string', $delim, $content );
|
2815 |
return true;
|
2816 |
}
|
2817 |
|
2818 |
+
$this->seek( $s );
|
2819 |
return false;
|
2820 |
}
|
2821 |
|
2822 |
+
protected function interpolation( &$out ) {
|
2823 |
+
$oldWhite = $this->eatWhiteDefault;
|
2824 |
$this->eatWhiteDefault = true;
|
2825 |
|
2826 |
$s = $this->seek();
|
2827 |
+
if ( $this->literal( '@{' ) &&
|
2828 |
+
$this->keyword( $var ) &&
|
2829 |
+
$this->literal( '}', false ) ) {
|
2830 |
+
$out = array( 'variable', $this->seedprod_lessc->vPrefix . $var );
|
|
|
2831 |
$this->eatWhiteDefault = $oldWhite;
|
2832 |
+
if ( $this->eatWhiteDefault ) {
|
2833 |
+
$this->whitespace();
|
2834 |
+
}
|
2835 |
return true;
|
2836 |
}
|
2837 |
|
2838 |
$this->eatWhiteDefault = $oldWhite;
|
2839 |
+
$this->seek( $s );
|
2840 |
return false;
|
2841 |
}
|
2842 |
|
2843 |
+
protected function unit( &$unit ) {
|
2844 |
// speed shortcut
|
2845 |
+
if ( isset( $this->buffer[ $this->count ] ) ) {
|
2846 |
+
$char = $this->buffer[ $this->count ];
|
2847 |
+
if ( ! ctype_digit( $char ) && $char != '.' ) {
|
2848 |
+
return false;
|
2849 |
+
}
|
2850 |
}
|
2851 |
|
2852 |
+
if ( $this->match( '([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m ) ) {
|
2853 |
+
$unit = array( 'number', $m[1], empty( $m[2] ) ? '' : $m[2] );
|
2854 |
return true;
|
2855 |
}
|
2856 |
return false;
|
2857 |
}
|
2858 |
|
2859 |
// a # color
|
2860 |
+
protected function color( &$out ) {
|
2861 |
+
if ( $this->match( '(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m ) ) {
|
2862 |
+
if ( strlen( $m[1] ) > 7 ) {
|
2863 |
+
$out = array( 'string', '', array( $m[1] ) );
|
2864 |
} else {
|
2865 |
+
$out = array( 'raw_color', $m[1] );
|
2866 |
}
|
2867 |
return true;
|
2868 |
}
|
2871 |
}
|
2872 |
|
2873 |
// consume a list of property values delimited by ; and wrapped in ()
|
2874 |
+
protected function argumentValues( &$args, $delim = ',' ) {
|
2875 |
$s = $this->seek();
|
2876 |
+
if ( ! $this->literal( '(' ) ) {
|
2877 |
+
return false;
|
2878 |
+
}
|
2879 |
|
2880 |
$values = array();
|
2881 |
+
while ( true ) {
|
2882 |
+
if ( $this->expressionList( $value ) ) {
|
2883 |
+
$values[] = $value;
|
2884 |
+
}
|
2885 |
+
if ( ! $this->literal( $delim ) ) {
|
2886 |
+
break;
|
2887 |
+
} else {
|
2888 |
+
if ( $value == null ) {
|
2889 |
+
$values[] = null;
|
2890 |
+
}
|
2891 |
$value = null;
|
2892 |
}
|
2893 |
}
|
2894 |
|
2895 |
+
if ( ! $this->literal( ')' ) ) {
|
2896 |
+
$this->seek( $s );
|
2897 |
return false;
|
2898 |
}
|
2899 |
|
2904 |
// consume an argument definition list surrounded by ()
|
2905 |
// each argument is a variable name with optional value
|
2906 |
// or at the end a ... or a variable named followed by ...
|
2907 |
+
protected function argumentDef( &$args, &$isVararg, $delim = ',' ) {
|
2908 |
$s = $this->seek();
|
2909 |
+
if ( ! $this->literal( '(' ) ) {
|
2910 |
+
return false;
|
2911 |
+
}
|
2912 |
|
2913 |
$values = array();
|
2914 |
|
2915 |
$isVararg = false;
|
2916 |
+
while ( true ) {
|
2917 |
+
if ( $this->literal( '...' ) ) {
|
2918 |
$isVararg = true;
|
2919 |
break;
|
2920 |
}
|
2921 |
|
2922 |
+
if ( $this->variable( $vname ) ) {
|
2923 |
+
$arg = array( 'arg', $vname );
|
2924 |
+
$ss = $this->seek();
|
2925 |
+
if ( $this->assign() && $this->expressionList( $value ) ) {
|
2926 |
$arg[] = $value;
|
2927 |
} else {
|
2928 |
+
$this->seek( $ss );
|
2929 |
+
if ( $this->literal( '...' ) ) {
|
2930 |
+
$arg[0] = 'rest';
|
2931 |
$isVararg = true;
|
2932 |
}
|
2933 |
}
|
2934 |
$values[] = $arg;
|
2935 |
+
if ( $isVararg ) {
|
2936 |
+
break;
|
2937 |
+
}
|
2938 |
continue;
|
2939 |
}
|
2940 |
|
2941 |
+
if ( $this->value( $literal ) ) {
|
2942 |
+
$values[] = array( 'lit', $literal );
|
2943 |
}
|
2944 |
|
2945 |
+
if ( ! $this->literal( $delim ) ) {
|
2946 |
+
break;
|
2947 |
+
}
|
2948 |
}
|
2949 |
|
2950 |
+
if ( ! $this->literal( ')' ) ) {
|
2951 |
+
$this->seek( $s );
|
2952 |
return false;
|
2953 |
}
|
2954 |
|
2959 |
|
2960 |
// consume a list of tags
|
2961 |
// this accepts a hanging delimiter
|
2962 |
+
protected function tags( &$tags, $simple = false, $delim = ',' ) {
|
2963 |
$tags = array();
|
2964 |
+
while ( $this->tag( $tt, $simple ) ) {
|
2965 |
$tags[] = $tt;
|
2966 |
+
if ( ! $this->literal( $delim ) ) {
|
2967 |
+
break;
|
2968 |
+
}
|
2969 |
+
}
|
2970 |
+
if ( count( $tags ) == 0 ) {
|
2971 |
+
return false;
|
2972 |
}
|
|
|
2973 |
|
2974 |
return true;
|
2975 |
}
|
2976 |
|
2977 |
// list of tags of specifying mixin path
|
2978 |
// optionally separated by > (lazy, accepts extra >)
|
2979 |
+
protected function mixinTags( &$tags ) {
|
2980 |
+
$s = $this->seek();
|
2981 |
$tags = array();
|
2982 |
+
while ( $this->tag( $tt, true ) ) {
|
2983 |
$tags[] = $tt;
|
2984 |
+
$this->literal( '>' );
|
2985 |
}
|
2986 |
|
2987 |
+
if ( count( $tags ) == 0 ) {
|
2988 |
+
return false;
|
2989 |
+
}
|
2990 |
|
2991 |
return true;
|
2992 |
}
|
2993 |
|
2994 |
// a bracketed value (contained within in a tag definition)
|
2995 |
+
protected function tagBracket( &$value ) {
|
2996 |
// speed shortcut
|
2997 |
+
if ( isset( $this->buffer[ $this->count ] ) && $this->buffer[ $this->count ] != '[' ) {
|
2998 |
return false;
|
2999 |
}
|
3000 |
|
3001 |
$s = $this->seek();
|
3002 |
+
if ( $this->literal( '[' ) && $this->to( ']', $c, true ) && $this->literal( ']', false ) ) {
|
3003 |
+
$value = '[' . $c . ']';
|
3004 |
// whitespace?
|
3005 |
+
if ( $this->whitespace() ) {
|
3006 |
+
$value .= ' ';
|
3007 |
+
}
|
3008 |
|
3009 |
// escape parent selector, (yuck)
|
3010 |
+
$value = str_replace( $this->seedprod_lessc->parentSelector, '$&$', $value );
|
3011 |
return true;
|
3012 |
}
|
3013 |
|
3014 |
+
$this->seek( $s );
|
3015 |
return false;
|
3016 |
}
|
3017 |
|
3018 |
+
protected function tagExpression( &$value ) {
|
3019 |
$s = $this->seek();
|
3020 |
+
if ( $this->literal( '(' ) && $this->expression( $exp ) && $this->literal( ')' ) ) {
|
3021 |
+
$value = array( 'exp', $exp );
|
3022 |
return true;
|
3023 |
}
|
3024 |
|
3025 |
+
$this->seek( $s );
|
3026 |
return false;
|
3027 |
}
|
3028 |
|
3029 |
// a single tag
|
3030 |
+
protected function tag( &$tag, $simple = false ) {
|
3031 |
+
if ( $simple ) {
|
3032 |
$chars = '^,:;{}\][>\(\) "\'';
|
3033 |
+
} else {
|
3034 |
$chars = '^,;{}["\'';
|
3035 |
+
}
|
3036 |
|
3037 |
+
if ( ! $simple && $this->tagExpression( $tag ) ) {
|
3038 |
return true;
|
3039 |
}
|
3040 |
|
3041 |
$tag = '';
|
3042 |
+
while ( $this->tagBracket( $first ) ) {
|
3043 |
+
$tag .= $first;
|
3044 |
+
}
|
3045 |
|
3046 |
+
while ( true ) {
|
3047 |
+
if ( $this->match( '([' . $chars . '0-9][' . $chars . ']*)', $m ) ) {
|
3048 |
$tag .= $m[1];
|
3049 |
+
if ( $simple ) {
|
3050 |
+
break;
|
3051 |
+
}
|
3052 |
|
3053 |
+
while ( $this->tagBracket( $brack ) ) {
|
3054 |
+
$tag .= $brack;
|
3055 |
+
}
|
3056 |
continue;
|
3057 |
+
} elseif ( $this->unit( $unit ) ) { // for keyframes
|
3058 |
$tag .= $unit[1] . $unit[2];
|
3059 |
continue;
|
3060 |
}
|
3061 |
break;
|
3062 |
}
|
3063 |
|
3064 |
+
$tag = trim( $tag );
|
3065 |
+
if ( $tag == '' ) {
|
3066 |
+
return false;
|
3067 |
+
}
|
3068 |
|
3069 |
return true;
|
3070 |
}
|
3071 |
|
3072 |
// a css function
|
3073 |
+
protected function func( &$func ) {
|
3074 |
$s = $this->seek();
|
3075 |
|
3076 |
+
if ( $this->match( '(%|[\w\-_][\w\-_:\.]+|[\w_])', $m ) && $this->literal( '(' ) ) {
|
3077 |
$fname = $m[1];
|
3078 |
|
3079 |
$sPreArgs = $this->seek();
|
3080 |
|
3081 |
$args = array();
|
3082 |
+
while ( true ) {
|
3083 |
$ss = $this->seek();
|
3084 |
// this ugly nonsense is for ie filter properties
|
3085 |
+
if ( $this->keyword( $name ) && $this->literal( '=' ) && $this->expressionList( $value ) ) {
|
3086 |
+
$args[] = array( 'string', '', array( $name, '=', $value ) );
|
3087 |
} else {
|
3088 |
+
$this->seek( $ss );
|
3089 |
+
if ( $this->expressionList( $value ) ) {
|
3090 |
$args[] = $value;
|
3091 |
}
|
3092 |
}
|
3093 |
|
3094 |
+
if ( ! $this->literal( ',' ) ) {
|
3095 |
+
break;
|
3096 |
+
}
|
3097 |
}
|
3098 |
+
$args = array( 'list', ',', $args );
|
3099 |
|
3100 |
+
if ( $this->literal( ')' ) ) {
|
3101 |
+
$func = array( 'function', $fname, $args );
|
3102 |
return true;
|
3103 |
+
} elseif ( $fname == 'url' ) {
|
3104 |
// couldn't parse and in url? treat as string
|
3105 |
+
$this->seek( $sPreArgs );
|
3106 |
+
if ( $this->openString( ')', $string ) && $this->literal( ')' ) ) {
|
3107 |
+
$func = array( 'function', $fname, $string );
|
3108 |
return true;
|
3109 |
}
|
3110 |
}
|
3111 |
}
|
3112 |
|
3113 |
+
$this->seek( $s );
|
3114 |
return false;
|
3115 |
}
|
3116 |
|
3117 |
// consume a less variable
|
3118 |
+
protected function variable( &$name ) {
|
3119 |
$s = $this->seek();
|
3120 |
+
if ( $this->literal( $this->seedprod_lessc->vPrefix, false ) &&
|
3121 |
+
( $this->variable( $sub ) || $this->keyword( $name ) ) ) {
|
3122 |
+
if ( ! empty( $sub ) ) {
|
3123 |
+
$name = array( 'variable', $sub );
|
|
|
3124 |
} else {
|
3125 |
+
$name = $this->seedprod_lessc->vPrefix . $name;
|
3126 |
}
|
3127 |
return true;
|
3128 |
}
|
3129 |
|
3130 |
$name = null;
|
3131 |
+
$this->seek( $s );
|
3132 |
return false;
|
3133 |
}
|
3134 |
|
3136 |
* Consume an assignment operator
|
3137 |
* Can optionally take a name that will be set to the current property name
|
3138 |
*/
|
3139 |
+
protected function assign( $name = null ) {
|
3140 |
+
if ( $name ) {
|
3141 |
+
$this->currentProperty = $name;
|
3142 |
+
}
|
3143 |
+
return $this->literal( ':' ) || $this->literal( '=' );
|
3144 |
}
|
3145 |
|
3146 |
// consume a keyword
|
3147 |
+
protected function keyword( &$word ) {
|
3148 |
+
if ( $this->match( '([\w_\-\*!"][\w\-_"]*)', $m ) ) {
|
3149 |
$word = $m[1];
|
3150 |
return true;
|
3151 |
}
|
3154 |
|
3155 |
// consume an end of statement delimiter
|
3156 |
protected function end() {
|
3157 |
+
if ( $this->literal( ';' ) ) {
|
3158 |
return true;
|
3159 |
+
} elseif ( $this->count == strlen( $this->buffer ) || $this->buffer[ $this->count ] == '}' ) {
|
3160 |
// if there is end of file or a closing block next then we don't need a ;
|
3161 |
return true;
|
3162 |
}
|
3163 |
return false;
|
3164 |
}
|
3165 |
|
3166 |
+
protected function guards( &$guards ) {
|
3167 |
$s = $this->seek();
|
3168 |
|
3169 |
+
if ( ! $this->literal( 'when' ) ) {
|
3170 |
+
$this->seek( $s );
|
3171 |
return false;
|
3172 |
}
|
3173 |
|
3174 |
$guards = array();
|
3175 |
|
3176 |
+
while ( $this->guardGroup( $g ) ) {
|
3177 |
$guards[] = $g;
|
3178 |
+
if ( ! $this->literal( ',' ) ) {
|
3179 |
+
break;
|
3180 |
+
}
|
3181 |
}
|
3182 |
|
3183 |
+
if ( count( $guards ) == 0 ) {
|
3184 |
$guards = null;
|
3185 |
+
$this->seek( $s );
|
3186 |
return false;
|
3187 |
}
|
3188 |
|
3191 |
|
3192 |
// a bunch of guards that are and'd together
|
3193 |
// TODO rename to guardGroup
|
3194 |
+
protected function guardGroup( &$guardGroup ) {
|
3195 |
+
$s = $this->seek();
|
3196 |
$guardGroup = array();
|
3197 |
+
while ( $this->guard( $guard ) ) {
|
3198 |
$guardGroup[] = $guard;
|
3199 |
+
if ( ! $this->literal( 'and' ) ) {
|
3200 |
+
break;
|
3201 |
+
}
|
3202 |
}
|
3203 |
|
3204 |
+
if ( count( $guardGroup ) == 0 ) {
|
3205 |
$guardGroup = null;
|
3206 |
+
$this->seek( $s );
|
3207 |
return false;
|
3208 |
}
|
3209 |
|
3210 |
return true;
|
3211 |
}
|
3212 |
|
3213 |
+
protected function guard( &$guard ) {
|
3214 |
+
$s = $this->seek();
|
3215 |
+
$negate = $this->literal( 'not' );
|
3216 |
|
3217 |
+
if ( $this->literal( '(' ) && $this->expression( $exp ) && $this->literal( ')' ) ) {
|
3218 |
$guard = $exp;
|
3219 |
+
if ( $negate ) {
|
3220 |
+
$guard = array( 'negate', $guard );
|
3221 |
+
}
|
3222 |
return true;
|
3223 |
}
|
3224 |
|
3225 |
+
$this->seek( $s );
|
3226 |
return false;
|
3227 |
}
|
3228 |
|
3229 |
/* raw parsing functions */
|
3230 |
|
3231 |
+
protected function literal( $what, $eatWhitespace = null ) {
|
3232 |
+
if ( $eatWhitespace === null ) {
|
3233 |
+
$eatWhitespace = $this->eatWhiteDefault;
|
3234 |
+
}
|
3235 |
|
3236 |
// shortcut on single letter
|
3237 |
+
if ( ! isset( $what[1] ) && isset( $this->buffer[ $this->count ] ) ) {
|
3238 |
+
if ( $this->buffer[ $this->count ] == $what ) {
|
3239 |
+
if ( ! $eatWhitespace ) {
|
3240 |
$this->count++;
|
3241 |
return true;
|
3242 |
}
|
3246 |
}
|
3247 |
}
|
3248 |
|
3249 |
+
if ( ! isset( self::$literalCache[ $what ] ) ) {
|
3250 |
+
self::$literalCache[ $what ] = seedprod_lessc::preg_quote( $what );
|
3251 |
}
|
3252 |
|
3253 |
+
return $this->match( self::$literalCache[ $what ], $m, $eatWhitespace );
|
3254 |
}
|
3255 |
|
3256 |
+
protected function genericList( &$out, $parseItem, $delim = '', $flatten = true ) {
|
3257 |
+
$s = $this->seek();
|
3258 |
$items = array();
|
3259 |
+
while ( $this->$parseItem( $value ) ) {
|
3260 |
$items[] = $value;
|
3261 |
+
if ( $delim ) {
|
3262 |
+
if ( ! $this->literal( $delim ) ) {
|
3263 |
+
break;
|
3264 |
+
}
|
3265 |
}
|
3266 |
}
|
3267 |
|
3268 |
+
if ( count( $items ) == 0 ) {
|
3269 |
+
$this->seek( $s );
|
3270 |
return false;
|
3271 |
}
|
3272 |
|
3273 |
+
if ( $flatten && count( $items ) == 1 ) {
|
3274 |
$out = $items[0];
|
3275 |
} else {
|
3276 |
+
$out = array( 'list', $delim, $items );
|
3277 |
}
|
3278 |
|
3279 |
return true;
|
3283 |
// advance counter to next occurrence of $what
|
3284 |
// $until - don't include $what in advance
|
3285 |
// $allowNewline, if string, will be used as valid char set
|
3286 |
+
protected function to( $what, &$out, $until = false, $allowNewline = false ) {
|
3287 |
+
if ( is_string( $allowNewline ) ) {
|
3288 |
$validChars = $allowNewline;
|
3289 |
} else {
|
3290 |
+
$validChars = $allowNewline ? '.' : "[^\n]";
|
3291 |
+
}
|
3292 |
+
if ( ! $this->match( '(' . $validChars . '*?)' . seedprod_lessc::preg_quote( $what ), $m, ! $until ) ) {
|
3293 |
+
return false;
|
3294 |
+
}
|
3295 |
+
if ( $until ) {
|
3296 |
+
$this->count -= strlen( $what ); // give back $what
|
3297 |
}
|
|
|
|
|
3298 |
$out = $m[1];
|
3299 |
return true;
|
3300 |
}
|
3301 |
|
3302 |
// try to match something on head of buffer
|
3303 |
+
protected function match( $regex, &$out, $eatWhitespace = null ) {
|
3304 |
+
if ( $eatWhitespace === null ) {
|
3305 |
+
$eatWhitespace = $this->eatWhiteDefault;
|
3306 |
+
}
|
3307 |
|
3308 |
+
$r = '/' . $regex . ( $eatWhitespace && ! $this->writeComments ? '\s*' : '' ) . '/Ais';
|
3309 |
+
if ( preg_match( $r, $this->buffer, $out, null, $this->count ) ) {
|
3310 |
+
$this->count += strlen( $out[0] );
|
3311 |
+
if ( $eatWhitespace && $this->writeComments ) {
|
3312 |
+
$this->whitespace();
|
3313 |
+
}
|
3314 |
return true;
|
3315 |
}
|
3316 |
return false;
|
3318 |
|
3319 |
// match some whitespace
|
3320 |
protected function whitespace() {
|
3321 |
+
if ( $this->writeComments ) {
|
3322 |
$gotWhite = false;
|
3323 |
+
while ( preg_match( self::$whitePattern, $this->buffer, $m, null, $this->count ) ) {
|
3324 |
+
if ( isset( $m[1] ) && empty( $this->commentsSeen[ $this->count ] ) ) {
|
3325 |
+
$this->append( array( 'comment', $m[1] ) );
|
3326 |
+
$this->commentsSeen[ $this->count ] = true;
|
3327 |
}
|
3328 |
+
$this->count += strlen( $m[0] );
|
3329 |
+
$gotWhite = true;
|
3330 |
}
|
3331 |
return $gotWhite;
|
3332 |
} else {
|
3333 |
+
$this->match( '', $m );
|
3334 |
+
return strlen( $m[0] ) > 0;
|
3335 |
}
|
3336 |
}
|
3337 |
|
3338 |
// match something without consuming it
|
3339 |
+
protected function peek( $regex, &$out = null, $from = null ) {
|
3340 |
+
if ( is_null( $from ) ) {
|
3341 |
+
$from = $this->count;
|
3342 |
+
}
|
3343 |
+
$r = '/' . $regex . '/Ais';
|
3344 |
+
$result = preg_match( $r, $this->buffer, $out, null, $from );
|
3345 |
|
3346 |
return $result;
|
3347 |
}
|
3348 |
|
3349 |
// seek to a spot in the buffer or return where we are on no argument
|
3350 |
+
protected function seek( $where = null ) {
|
3351 |
+
if ( $where === null ) {
|
3352 |
+
return $this->count;
|
3353 |
+
} else {
|
3354 |
+
$this->count = $where;
|
3355 |
+
}
|
3356 |
return true;
|
3357 |
}
|
3358 |
|
3359 |
/* misc functions */
|
3360 |
|
3361 |
+
public function throwError( $msg = 'parse error', $count = null ) {
|
3362 |
+
$count = is_null( $count ) ? $this->count : $count;
|
3363 |
|
3364 |
$line = $this->line +
|
3365 |
+
substr_count( substr( $this->buffer, 0, $count ), "\n" );
|
3366 |
|
3367 |
+
if ( ! empty( $this->sourceName ) ) {
|
3368 |
$loc = "$this->sourceName on line $line";
|
3369 |
} else {
|
3370 |
$loc = "line: $line";
|
3371 |
}
|
3372 |
|
3373 |
// TODO this depends on $this->count
|
3374 |
+
if ( $this->peek( "(.*?)(\n|$)", $m, $count ) ) {
|
3375 |
+
throw new exception( "$msg: failed at `$m[1]` $loc" );
|
3376 |
} else {
|
3377 |
+
throw new exception( "$msg: $loc" );
|
3378 |
}
|
3379 |
}
|
3380 |
|
3381 |
+
protected function pushBlock( $selectors = null, $type = null ) {
|
3382 |
+
$b = new stdclass();
|
3383 |
$b->parent = $this->env;
|
3384 |
|
3385 |
$b->type = $type;
|
3386 |
+
$b->id = self::$nextBlockId++;
|
3387 |
|
3388 |
$b->isVararg = false; // TODO: kill me from here
|
3389 |
+
$b->tags = $selectors;
|
3390 |
|
3391 |
+
$b->props = array();
|
3392 |
$b->children = array();
|
3393 |
|
3394 |
$this->env = $b;
|
3396 |
}
|
3397 |
|
3398 |
// push a block that doesn't multiply tags
|
3399 |
+
protected function pushSpecialBlock( $type ) {
|
3400 |
+
return $this->pushBlock( null, $type );
|
3401 |
}
|
3402 |
|
3403 |
// append a property to the current block
|
3404 |
+
protected function append( $prop, $pos = null ) {
|
3405 |
+
if ( $pos !== null ) {
|
3406 |
+
$prop[-1] = $pos;
|
3407 |
+
}
|
3408 |
$this->env->props[] = $prop;
|
3409 |
}
|
3410 |
|
3411 |
// pop something off the stack
|
3412 |
protected function pop() {
|
3413 |
+
$old = $this->env;
|
3414 |
$this->env = $this->env->parent;
|
3415 |
return $old;
|
3416 |
}
|
3417 |
|
3418 |
// remove comments from $text
|
3419 |
// todo: make it work for all functions, not just url
|
3420 |
+
protected function removeComments( $text ) {
|
3421 |
$look = array(
|
3422 |
+
'url(',
|
3423 |
+
'//',
|
3424 |
+
'/*',
|
3425 |
+
'"',
|
3426 |
+
"'",
|
3427 |
);
|
3428 |
|
3429 |
$out = '';
|
3430 |
$min = null;
|
3431 |
+
while ( true ) {
|
3432 |
// find the next item
|
3433 |
+
foreach ( $look as $token ) {
|
3434 |
+
$pos = strpos( $text, $token );
|
3435 |
+
if ( $pos !== false ) {
|
3436 |
+
if ( ! isset( $min ) || $pos < $min[1] ) {
|
3437 |
+
$min = array( $token, $pos );
|
3438 |
+
}
|
3439 |
}
|
3440 |
}
|
3441 |
|
3442 |
+
if ( is_null( $min ) ) {
|
3443 |
+
break;
|
3444 |
+
}
|
3445 |
|
3446 |
+
$count = $min[1];
|
3447 |
+
$skip = 0;
|
3448 |
$newlines = 0;
|
3449 |
+
switch ( $min[0] ) {
|
3450 |
+
case 'url(':
|
3451 |
+
if ( preg_match( '/url\(.*?\)/', $text, $m, 0, $count ) ) {
|
3452 |
+
$count += strlen( $m[0] ) - strlen( $min[0] );
|
3453 |
+
}
|
3454 |
+
break;
|
3455 |
+
case '"':
|
3456 |
+
case "'":
|
3457 |
+
if ( preg_match( '/' . $min[0] . '.*?' . $min[0] . '/', $text, $m, 0, $count ) ) {
|
3458 |
+
$count += strlen( $m[0] ) - 1;
|
3459 |
+
}
|
3460 |
+
break;
|
3461 |
+
case '//':
|
3462 |
+
$skip = strpos( $text, "\n", $count );
|
3463 |
+
if ( $skip === false ) {
|
3464 |
+
$skip = strlen( $text ) - $count;
|
3465 |
+
} else {
|
3466 |
+
$skip -= $count;
|
3467 |
+
}
|
3468 |
+
break;
|
3469 |
+
case '/*':
|
3470 |
+
if ( preg_match( '/\/\*.*?\*\//s', $text, $m, 0, $count ) ) {
|
3471 |
+
$skip = strlen( $m[0] );
|
3472 |
+
$newlines = substr_count( $m[0], "\n" );
|
3473 |
+
}
|
3474 |
+
break;
|
3475 |
}
|
3476 |
|
3477 |
+
if ( $skip == 0 ) {
|
3478 |
+
$count += strlen( $min[0] );
|
3479 |
+
}
|
3480 |
|
3481 |
+
$out .= substr( $text, 0, $count ) . str_repeat( "\n", $newlines );
|
3482 |
+
$text = substr( $text, $count + $skip );
|
3483 |
|
3484 |
$min = null;
|
3485 |
}
|
3486 |
|
3487 |
+
return $out . $text;
|
3488 |
}
|
3489 |
|
3490 |
}
|
3491 |
|
3492 |
class seedprod_lessc_formatter_classic {
|
3493 |
+
public $indentChar = ' ';
|
3494 |
|
3495 |
+
public $break = "\n";
|
3496 |
+
public $open = ' {';
|
3497 |
+
public $close = '}';
|
3498 |
+
public $selectorSeparator = ', ';
|
3499 |
+
public $assignSeparator = ':';
|
3500 |
|
3501 |
+
public $openSingle = ' { ';
|
3502 |
+
public $closeSingle = ' }';
|
3503 |
|
3504 |
+
public $disableSingle = false;
|
3505 |
public $breakSelectors = false;
|
3506 |
|
3507 |
public $compressColors = false;
|
3510 |
$this->indentLevel = 0;
|
3511 |
}
|
3512 |
|
3513 |
+
public function indentStr( $n = 0 ) {
|
3514 |
+
return str_repeat( $this->indentChar, max( $this->indentLevel + $n, 0 ) );
|
3515 |
}
|
3516 |
|
3517 |
+
public function property( $name, $value ) {
|
3518 |
+
return $name . $this->assignSeparator . $value . ';';
|
3519 |
}
|
3520 |
|
3521 |
+
protected function isEmpty( $block ) {
|
3522 |
+
if ( empty( $block->lines ) ) {
|
3523 |
+
foreach ( $block->children as $child ) {
|
3524 |
+
if ( ! $this->isEmpty( $child ) ) {
|
3525 |
+
return false;
|
3526 |
+
}
|
3527 |
}
|
3528 |
|
3529 |
return true;
|
3531 |
return false;
|
3532 |
}
|
3533 |
|
3534 |
+
public function block( $block ) {
|
3535 |
+
if ( $this->isEmpty( $block ) ) {
|
3536 |
+
return;
|
3537 |
+
}
|
3538 |
|
3539 |
$inner = $pre = $this->indentStr();
|
3540 |
|
3541 |
+
$isSingle = ! $this->disableSingle &&
|
3542 |
+
is_null( $block->type ) && count( $block->lines ) == 1;
|
3543 |
|
3544 |
+
if ( ! empty( $block->selectors ) ) {
|
3545 |
$this->indentLevel++;
|
3546 |
|
3547 |
+
if ( $this->breakSelectors ) {
|
3548 |
$selectorSeparator = $this->selectorSeparator . $this->break . $pre;
|
3549 |
} else {
|
3550 |
$selectorSeparator = $this->selectorSeparator;
|
3551 |
}
|
3552 |
|
3553 |
echo $pre .
|
3554 |
+
implode( $selectorSeparator, $block->selectors );
|
3555 |
+
if ( $isSingle ) {
|
3556 |
echo $this->openSingle;
|
3557 |
+
$inner = '';
|
3558 |
} else {
|
3559 |
echo $this->open . $this->break;
|
3560 |
$inner = $this->indentStr();
|
3561 |
}
|
|
|
3562 |
}
|
3563 |
|
3564 |
+
if ( ! empty( $block->lines ) ) {
|
3565 |
+
$glue = $this->break . $inner;
|
3566 |
+
echo $inner . implode( $glue, $block->lines );
|
3567 |
+
if ( ! $isSingle && ! empty( $block->children ) ) {
|
3568 |
echo $this->break;
|
3569 |
}
|
3570 |
}
|
3571 |
|
3572 |
+
foreach ( $block->children as $child ) {
|
3573 |
+
$this->block( $child );
|
3574 |
}
|
3575 |
|
3576 |
+
if ( ! empty( $block->selectors ) ) {
|
3577 |
+
if ( ! $isSingle && empty( $block->children ) ) {
|
3578 |
+
echo $this->break;
|
3579 |
+
}
|
3580 |
|
3581 |
+
if ( $isSingle ) {
|
3582 |
echo $this->closeSingle . $this->break;
|
3583 |
} else {
|
3584 |
echo $pre . $this->close . $this->break;
|
3590 |
}
|
3591 |
|
3592 |
class seedprod_lessc_formatter_compressed extends seedprod_lessc_formatter_classic {
|
3593 |
+
public $disableSingle = true;
|
3594 |
+
public $open = '{';
|
3595 |
+
public $selectorSeparator = ',';
|
3596 |
+
public $assignSeparator = ':';
|
3597 |
+
public $break = '';
|
3598 |
+
public $compressColors = true;
|
3599 |
|
3600 |
+
public function indentStr( $n = 0 ) {
|
3601 |
+
return '';
|
3602 |
}
|
3603 |
}
|
3604 |
|
3605 |
class seedprod_lessc_formatter_lessjs extends seedprod_lessc_formatter_classic {
|
3606 |
+
public $disableSingle = true;
|
3607 |
+
public $breakSelectors = true;
|
3608 |
+
public $assignSeparator = ': ';
|
3609 |
+
public $selectorSeparator = ',';
|
3610 |
}
|
3611 |
|
3612 |
|
app/includes/skin.php
CHANGED
@@ -10,95 +10,88 @@
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
13 |
-
if (! defined('ABSPATH')) {
|
14 |
-
|
15 |
}
|
16 |
|
17 |
-
class SeedProd_Skin extends WP_Upgrader_Skin
|
18 |
-
{
|
19 |
|
20 |
-
/**
|
21 |
-
* Primary class constructor.
|
22 |
-
*
|
23 |
-
* @since 6.0.0
|
24 |
-
*
|
25 |
-
* @param array $args Empty array of args (we will use defaults).
|
26 |
-
*/
|
27 |
-
public function __construct($args = array())
|
28 |
-
{
|
29 |
-
parent::__construct();
|
30 |
-
}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
$this->upgrader =& $upgrader;
|
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 |
-
public function error($errors)
|
86 |
-
{
|
87 |
-
if (! empty($errors)) {
|
88 |
-
echo json_encode(array( 'error' => esc_html__('There was an error installing the addon. Please try again.', 'coming-soon') ));
|
89 |
-
die;
|
90 |
-
}
|
91 |
-
}
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
}
|
16 |
|
17 |
+
class SeedProd_Skin extends WP_Upgrader_Skin {
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
/**
|
21 |
+
* Primary class constructor.
|
22 |
+
*
|
23 |
+
* @since 6.0.0
|
24 |
+
*
|
25 |
+
* @param array $args Empty array of args (we will use defaults).
|
26 |
+
*/
|
27 |
+
public function __construct( $args = array() ) {
|
28 |
+
parent::__construct();
|
29 |
+
}
|
|
|
|
|
|
|
30 |
|
31 |
+
/**
|
32 |
+
* Set the upgrader object and store it as a property in the parent class.
|
33 |
+
*
|
34 |
+
* @since 6.0.0
|
35 |
+
*
|
36 |
+
* @param object $upgrader The upgrader object (passed by reference).
|
37 |
+
*/
|
38 |
+
public function set_upgrader( &$upgrader ) {
|
39 |
+
if ( is_object( $upgrader ) ) {
|
40 |
+
$this->upgrader =& $upgrader;
|
41 |
+
}
|
42 |
+
}
|
43 |
|
44 |
+
/**
|
45 |
+
* Set the upgrader result and store it as a property in the parent class.
|
46 |
+
*
|
47 |
+
* @since 6.0.0
|
48 |
+
*
|
49 |
+
* @param object $result The result of the install process.
|
50 |
+
*/
|
51 |
+
public function set_result( $result ) {
|
52 |
+
$this->result = $result;
|
53 |
+
}
|
54 |
|
55 |
+
/**
|
56 |
+
* Empty out the header of its HTML content and only check to see if it has
|
57 |
+
* been performed or not.
|
58 |
+
*
|
59 |
+
* @since 6.0.0
|
60 |
+
*/
|
61 |
+
public function header() {
|
62 |
+
}
|
63 |
|
64 |
+
/**
|
65 |
+
* Empty out the footer of its HTML contents.
|
66 |
+
*
|
67 |
+
* @since 6.0.0
|
68 |
+
*/
|
69 |
+
public function footer() {
|
70 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
/**
|
73 |
+
* Instead of outputting HTML for errors, json_encode the errors and send them
|
74 |
+
* back to the Ajax script for processing.
|
75 |
+
*
|
76 |
+
* @since 6.0.0
|
77 |
+
*
|
78 |
+
* @param array $errors Array of errors with the install process.
|
79 |
+
*/
|
80 |
+
public function error( $errors ) {
|
81 |
+
if ( ! empty( $errors ) ) {
|
82 |
+
echo json_encode( array( 'error' => esc_html__( 'There was an error installing the addon. Please try again.', 'coming-soon' ) ) );
|
83 |
+
die;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Empty out the feedback method to prevent outputting HTML strings as the install
|
89 |
+
* is progressing.
|
90 |
+
*
|
91 |
+
* @since 6.0.0
|
92 |
+
*
|
93 |
+
* @param string $string The feedback string.
|
94 |
+
*/
|
95 |
+
public function feedback( $string ) {
|
96 |
+
}
|
97 |
+
}
|
app/includes/skin53.php
CHANGED
@@ -10,95 +10,88 @@
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
13 |
-
if (! defined('ABSPATH')) {
|
14 |
-
|
15 |
}
|
16 |
|
17 |
-
class SeedProd_Skin extends WP_Upgrader_Skin
|
18 |
-
{
|
19 |
|
20 |
-
/**
|
21 |
-
* Primary class constructor.
|
22 |
-
*
|
23 |
-
* @since 6.0.0
|
24 |
-
*
|
25 |
-
* @param array $args Empty array of args (we will use defaults).
|
26 |
-
*/
|
27 |
-
public function __construct($args = array())
|
28 |
-
{
|
29 |
-
parent::__construct();
|
30 |
-
}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
$this->upgrader =& $upgrader;
|
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 |
-
public function error($errors)
|
86 |
-
{
|
87 |
-
if (! empty($errors)) {
|
88 |
-
echo json_encode(array( 'error' => esc_html__('There was an error installing the addon. Please try again.', 'coming-soon') ));
|
89 |
-
die;
|
90 |
-
}
|
91 |
-
}
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
}
|
16 |
|
17 |
+
class SeedProd_Skin extends WP_Upgrader_Skin {
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
/**
|
21 |
+
* Primary class constructor.
|
22 |
+
*
|
23 |
+
* @since 6.0.0
|
24 |
+
*
|
25 |
+
* @param array $args Empty array of args (we will use defaults).
|
26 |
+
*/
|
27 |
+
public function __construct( $args = array() ) {
|
28 |
+
parent::__construct();
|
29 |
+
}
|
|
|
|
|
|
|
30 |
|
31 |
+
/**
|
32 |
+
* Set the upgrader object and store it as a property in the parent class.
|
33 |
+
*
|
34 |
+
* @since 6.0.0
|
35 |
+
*
|
36 |
+
* @param object $upgrader The upgrader object (passed by reference).
|
37 |
+
*/
|
38 |
+
public function set_upgrader( &$upgrader ) {
|
39 |
+
if ( is_object( $upgrader ) ) {
|
40 |
+
$this->upgrader =& $upgrader;
|
41 |
+
}
|
42 |
+
}
|
43 |
|
44 |
+
/**
|
45 |
+
* Set the upgrader result and store it as a property in the parent class.
|
46 |
+
*
|
47 |
+
* @since 6.0.0
|
48 |
+
*
|
49 |
+
* @param object $result The result of the install process.
|
50 |
+
*/
|
51 |
+
public function set_result( $result ) {
|
52 |
+
$this->result = $result;
|
53 |
+
}
|
54 |
|
55 |
+
/**
|
56 |
+
* Empty out the header of its HTML content and only check to see if it has
|
57 |
+
* been performed or not.
|
58 |
+
*
|
59 |
+
* @since 6.0.0
|
60 |
+
*/
|
61 |
+
public function header() {
|
62 |
+
}
|
63 |
|
64 |
+
/**
|
65 |
+
* Empty out the footer of its HTML contents.
|
66 |
+
*
|
67 |
+
* @since 6.0.0
|
68 |
+
*/
|
69 |
+
public function footer() {
|
70 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
/**
|
73 |
+
* Instead of outputting HTML for errors, json_encode the errors and send them
|
74 |
+
* back to the Ajax script for processing.
|
75 |
+
*
|
76 |
+
* @since 6.0.0
|
77 |
+
*
|
78 |
+
* @param array $errors Array of errors with the install process.
|
79 |
+
*/
|
80 |
+
public function error( $errors ) {
|
81 |
+
if ( ! empty( $errors ) ) {
|
82 |
+
echo json_encode( array( 'error' => esc_html__( 'There was an error installing the addon. Please try again.', 'coming-soon' ) ) );
|
83 |
+
die;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Empty out the feedback method to prevent outputting HTML strings as the install
|
89 |
+
* is progressing.
|
90 |
+
*
|
91 |
+
* @since 6.0.0
|
92 |
+
*
|
93 |
+
* @param string $string The feedback string.
|
94 |
+
*/
|
95 |
+
public function feedback( $string, ...$args ) {
|
96 |
+
}
|
97 |
+
}
|
app/includes/upgrade.php
CHANGED
@@ -3,178 +3,183 @@
|
|
3 |
/**
|
4 |
* Ajax handler for grabbing the upgrade url.
|
5 |
*/
|
6 |
-
function seedprod_lite_upgrade_license()
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
add_action('wp_ajax_seedprod_upgrade_license', 'seedprod_upgrade_license');
|
77 |
|
78 |
/**
|
79 |
* Endpoint for one-click upgrade.
|
80 |
*/
|
81 |
-
function seedprod_lite_run_one_click_upgrade()
|
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 |
$installer->install($license['body']->download_link); // phpcs:ignore
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
}
|
3 |
/**
|
4 |
* Ajax handler for grabbing the upgrade url.
|
5 |
*/
|
6 |
+
function seedprod_lite_upgrade_license() {
|
7 |
+
check_ajax_referer( 'seedprod_lite_upgrade_license' );
|
8 |
+
|
9 |
+
// Check for permissions.
|
10 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
11 |
+
wp_send_json_error( array( 'message' => esc_html__( 'You are not allowed to install plugins.', 'coming-soon' ) ) );
|
12 |
+
}
|
13 |
+
|
14 |
+
// Check for local dev sites
|
15 |
+
// if (seedprod_lite_is_dev_url(home_url())) {
|
16 |
+
// wp_send_json_success(array(
|
17 |
+
// 'url' => 'https://www.seedprod.com/docs/go-lite-pro/#manual-upgrade',
|
18 |
+
// ));
|
19 |
+
// }
|
20 |
+
|
21 |
+
// Check for a license key.
|
22 |
+
$license_key = seedprod_lite_get_api_key();
|
23 |
+
if ( empty( $license_key ) ) {
|
24 |
+
wp_send_json_error( array( 'message' => esc_html__( 'You are not licensed.', 'coming-soon' ) ) );
|
25 |
+
}
|
26 |
+
|
27 |
+
$url = esc_url_raw(
|
28 |
+
add_query_arg(
|
29 |
+
array(
|
30 |
+
'page' => 'seedprod_lite',
|
31 |
+
),
|
32 |
+
admin_url( 'admin.php' )
|
33 |
+
)
|
34 |
+
);
|
35 |
+
|
36 |
+
// Verify pro version is not installed.
|
37 |
+
$active = activate_plugin( 'seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php', false, false, true );
|
38 |
+
if ( ! is_wp_error( $active ) ) {
|
39 |
+
// Deactivate plugin.
|
40 |
+
//deactivate_plugins(plugin_basename('seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php'));
|
41 |
+
wp_send_json_error(
|
42 |
+
array(
|
43 |
+
'message' => esc_html__( 'Pro version is already installed.', 'coming-soon' ),
|
44 |
+
'reload' => true,
|
45 |
+
)
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
// Verifiy licnese key
|
50 |
+
$license = seedprod_lite_save_api_key( $license_key );
|
51 |
+
|
52 |
+
// Redirect.
|
53 |
+
$oth = hash( 'sha512', wp_rand() );
|
54 |
+
update_option( 'seedprod_one_click_upgrade', $oth );
|
55 |
+
$version = SEEDPROD_VERSION;
|
56 |
+
$file = $license['body']->download_link;
|
57 |
+
$siteurl = admin_url();
|
58 |
+
$endpoint = admin_url( 'admin-ajax.php' );
|
59 |
+
$redirect = admin_url( 'admin.php?page=seedprod_lite#/settings' );
|
60 |
+
|
61 |
+
$url = add_query_arg(
|
62 |
+
array(
|
63 |
+
'api_token' => get_option( 'seedprod_api_token' ),
|
64 |
+
'license_key' => $license_key,
|
65 |
+
'oth' => $oth,
|
66 |
+
'endpoint' => $endpoint,
|
67 |
+
'version' => $version,
|
68 |
+
'siteurl' => $siteurl,
|
69 |
+
'redirect' => rawurldecode( base64_encode( $redirect ) ),
|
70 |
+
'file' => rawurldecode( base64_encode( $file ) ),
|
71 |
+
),
|
72 |
+
SEEDPROD_WEB_API_URL . 'upgrade-free-to-pro'
|
73 |
+
);
|
74 |
+
|
75 |
+
wp_send_json_success(
|
76 |
+
array(
|
77 |
+
'url' => $url,
|
78 |
+
)
|
79 |
+
);
|
80 |
}
|
81 |
|
82 |
+
add_action( 'wp_ajax_seedprod_upgrade_license', 'seedprod_upgrade_license' );
|
83 |
|
84 |
/**
|
85 |
* Endpoint for one-click upgrade.
|
86 |
*/
|
87 |
+
function seedprod_lite_run_one_click_upgrade() {
|
88 |
+
$error = esc_html__( 'Could not install upgrade. Please download from seedprod.com and install manually.', 'coming-soon' );
|
89 |
+
|
90 |
+
// verify params present (oth & download link).
|
91 |
+
$post_oth = ! empty( $_REQUEST['oth'] ) ? sanitize_text_field( $_REQUEST['oth'] ) : '';
|
92 |
+
$post_url = ! empty( $_REQUEST['file'] ) ? $_REQUEST['file'] : '';
|
93 |
+
if ( empty( $post_oth ) || empty( $post_url ) ) {
|
94 |
+
wp_send_json_error( $error );
|
95 |
+
}
|
96 |
+
// Verify oth.
|
97 |
+
$oth = get_option( 'seedprod_one_click_upgrade' );
|
98 |
+
if ( empty( $oth ) ) {
|
99 |
+
wp_send_json_error( $error );
|
100 |
+
}
|
101 |
+
if ( ! hash_equals( $oth, $post_oth ) ) {
|
102 |
+
wp_send_json_error( $error );
|
103 |
+
}
|
104 |
+
// Delete so cannot replay.
|
105 |
+
delete_option( 'seedprod_one_click_upgrade' );
|
106 |
+
// Set the current screen to avoid undefined notices.
|
107 |
+
set_current_screen( 'insights_page_seedprod_settings' );
|
108 |
+
// Prepare variables.
|
109 |
+
$url = esc_url_raw(
|
110 |
+
add_query_arg(
|
111 |
+
array(
|
112 |
+
'page' => 'seedprod-settings',
|
113 |
+
),
|
114 |
+
admin_url( 'admin.php' )
|
115 |
+
)
|
116 |
+
);
|
117 |
+
// Verify pro not activated.
|
118 |
+
if ( is_plugin_active( 'seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php' ) ) {
|
119 |
+
deactivate_plugins( plugin_basename( 'coming-soon/coming-soon.php' ) );
|
120 |
+
wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'coming-soon' ) );
|
121 |
+
}
|
122 |
+
// Verify pro not installed.
|
123 |
+
$active = activate_plugin( 'seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php', $url, false, true );
|
124 |
+
if ( ! is_wp_error( $active ) ) {
|
125 |
+
deactivate_plugins( plugin_basename( 'coming-soon/coming-soon.php' ) );
|
126 |
+
wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'coming-soon' ) );
|
127 |
+
}
|
128 |
+
|
129 |
+
$creds = request_filesystem_credentials( $url, '', false, false, null );
|
130 |
+
// Check for file system permissions.
|
131 |
+
if ( false === $creds ) {
|
132 |
+
wp_send_json_error( $error );
|
133 |
+
}
|
134 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
135 |
+
wp_send_json_error( $error );
|
136 |
+
}
|
137 |
+
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
|
138 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
139 |
+
|
140 |
+
if ( version_compare( $wp_version, '5.3.0' ) >= 0 ) {
|
141 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/skin53.php';
|
142 |
+
} else {
|
143 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/skin.php';
|
144 |
+
}
|
145 |
+
// Do not allow WordPress to search/download translations, as this will break JS output.
|
146 |
+
remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
|
147 |
+
// Create the plugin upgrader with our custom skin.
|
148 |
+
$installer = new Plugin_Upgrader( $skin = new SeedProd_Skin() );
|
149 |
+
// Error check.
|
150 |
+
if ( ! method_exists( $installer, 'install' ) ) {
|
151 |
+
wp_send_json_error( $error );
|
152 |
+
}
|
153 |
+
|
154 |
+
// Check license key.
|
155 |
+
$license_key = seedprod_lite_get_api_key();
|
156 |
+
if ( empty( $license_key ) ) {
|
157 |
+
wp_send_json_error( new WP_Error( '403', esc_html__( 'You are not licensed.', 'coming-soon' ) ) );
|
158 |
+
}
|
159 |
+
|
160 |
+
$license = seedprod_lite_save_api_key( $license_key );
|
161 |
+
if ( empty( $license['body']->download_link ) ) {
|
162 |
+
wp_send_json_error();
|
163 |
+
}
|
|
|
164 |
|
165 |
$installer->install($license['body']->download_link); // phpcs:ignore
|
166 |
+
// Flush the cache and return the newly installed plugin basename.
|
167 |
+
wp_cache_flush();
|
168 |
+
if ( $installer->plugin_info() ) {
|
169 |
+
$plugin_basename = $installer->plugin_info();
|
170 |
+
|
171 |
+
// Deactivate the lite version first.
|
172 |
+
deactivate_plugins( plugin_basename( 'coming-soon/coming-soon.php' ) );
|
173 |
+
|
174 |
+
// Activate the plugin silently.
|
175 |
+
$activated = activate_plugin( $plugin_basename, '', false, true );
|
176 |
+
if ( ! is_wp_error( $activated ) ) {
|
177 |
+
wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'coming-soon' ) );
|
178 |
+
} else {
|
179 |
+
// Reactivate the lite plugin if pro activation failed.
|
180 |
+
activate_plugin( plugin_basename( 'coming-soon/coming-soon.php' ), '', false, true );
|
181 |
+
wp_send_json_error( esc_html__( 'Pro version installed but needs to be activated from the Plugins page inside your WordPress admin.', 'coming-soon' ) );
|
182 |
+
}
|
183 |
+
}
|
184 |
+
wp_send_json_error( $error );
|
185 |
+
}
|
app/license.php
CHANGED
@@ -4,30 +4,29 @@
|
|
4 |
/**
|
5 |
* Welcome Page On Activation
|
6 |
*/
|
7 |
-
add_action('admin_init', 'seedprod_lite_welcome_screen_do_activation_redirect');
|
8 |
-
|
9 |
-
function seedprod_lite_welcome_screen_do_activation_redirect()
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
wp_safe_redirect(add_query_arg(array( 'page' => 'seedprod_lite' ), admin_url('admin.php')).'#/welcome');
|
31 |
}
|
32 |
|
33 |
|
@@ -35,126 +34,129 @@ function seedprod_lite_welcome_screen_do_activation_redirect()
|
|
35 |
/**
|
36 |
* Save API Key
|
37 |
*/
|
38 |
-
function seedprod_lite_save_api_key($api_key = null)
|
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 |
|
4 |
/**
|
5 |
* Welcome Page On Activation
|
6 |
*/
|
7 |
+
add_action( 'admin_init', 'seedprod_lite_welcome_screen_do_activation_redirect' );
|
8 |
+
|
9 |
+
function seedprod_lite_welcome_screen_do_activation_redirect() {
|
10 |
+
// Check PHP Version
|
11 |
+
if ( version_compare( phpversion(), '5.3.3', '<=' ) ) {
|
12 |
+
wp_die( __( "The minimum required version of PHP to run this plugin is PHP Version 5.3.3<br>Please contact your hosting company and ask them to upgrade this site's php verison.", 'coming-soon' ), __( 'Upgrade PHP', 'coming-soon' ), 200 );
|
13 |
+
}
|
14 |
+
|
15 |
+
// Bail if no activation redirect
|
16 |
+
if ( ! get_transient( '_seedprod_welcome_screen_activation_redirect' ) ) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
// Delete the redirect transient
|
21 |
+
delete_transient( '_seedprod_welcome_screen_activation_redirect' );
|
22 |
+
|
23 |
+
// Bail if activating from network, or bulk
|
24 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Redirect to our page
|
29 |
+
wp_safe_redirect( add_query_arg( array( 'page' => 'seedprod_lite' ), admin_url( 'admin.php' ) ) . '#/welcome' );
|
|
|
30 |
}
|
31 |
|
32 |
|
34 |
/**
|
35 |
* Save API Key
|
36 |
*/
|
37 |
+
function seedprod_lite_save_api_key( $api_key = null ) {
|
38 |
+
if ( check_ajax_referer( 'seedprod_nonce', '_wpnonce', false ) || ! empty( $api_key ) ) {
|
39 |
+
if ( empty( $api_key ) ) {
|
40 |
+
$api_key = $_POST['api_key'];
|
41 |
+
}
|
42 |
+
|
43 |
+
if ( defined( 'SEEDPROD_LOCAL_JS' ) ) {
|
44 |
+
$slug = 'seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php';
|
45 |
+
} else {
|
46 |
+
$slug = SEEDPROD_SLUG;
|
47 |
+
}
|
48 |
+
|
49 |
+
$token = get_option( 'seedprod_token' );
|
50 |
+
if ( empty( $token ) ) {
|
51 |
+
add_option( 'seedprod_token', wp_generate_uuid4() );
|
52 |
+
}
|
53 |
+
|
54 |
+
// Validate the api key
|
55 |
+
$data = array(
|
56 |
+
'action' => 'info',
|
57 |
+
'license_key' => $api_key,
|
58 |
+
'token' => get_option( 'seedprod_token' ),
|
59 |
+
'wp_version' => get_bloginfo( 'version' ),
|
60 |
+
'domain' => home_url(),
|
61 |
+
'installed_version' => SEEDPROD_VERSION,
|
62 |
+
'slug' => $slug,
|
63 |
+
);
|
64 |
+
|
65 |
+
if ( empty( $data['license_key'] ) ) {
|
66 |
+
$response = array(
|
67 |
+
'status' => 'false',
|
68 |
+
'msg' => __( 'License Key is Required.', '' ),
|
69 |
+
);
|
70 |
+
wp_send_json( $response );
|
71 |
+
exit;
|
72 |
+
}
|
73 |
+
|
74 |
+
$headers = array();
|
75 |
+
|
76 |
+
// Build the headers of the request.
|
77 |
+
$headers = wp_parse_args(
|
78 |
+
$headers,
|
79 |
+
array(
|
80 |
+
'Accept' => 'application/json',
|
81 |
+
)
|
82 |
+
);
|
83 |
+
|
84 |
+
$url = SEEDPROD_API_URL . 'update';
|
85 |
+
$response = wp_remote_post(
|
86 |
+
$url,
|
87 |
+
array(
|
88 |
+
'body' => $data,
|
89 |
+
'headers' => $headers,
|
90 |
+
)
|
91 |
+
);
|
92 |
+
|
93 |
+
$status_code = wp_remote_retrieve_response_code( $response );
|
94 |
+
|
95 |
+
if ( is_wp_error( $response ) ) {
|
96 |
+
$response = array(
|
97 |
+
'status' => 'false',
|
98 |
+
'ip' => seedprod_lite_get_ip(),
|
99 |
+
'msg' => $response->get_error_message(),
|
100 |
+
);
|
101 |
+
wp_send_json( $response );
|
102 |
+
}
|
103 |
+
|
104 |
+
if ( $status_code != 200 ) {
|
105 |
+
$response = array(
|
106 |
+
'status' => 'false',
|
107 |
+
'ip' => seedprod_lite_get_ip(),
|
108 |
+
'msg' => $response['response']['message'],
|
109 |
+
);
|
110 |
+
wp_send_json( $response );
|
111 |
+
}
|
112 |
+
|
113 |
+
$body = wp_remote_retrieve_body( $response );
|
114 |
+
|
115 |
+
if ( ! empty( $body ) ) {
|
116 |
+
$body = json_decode( $body );
|
117 |
+
}
|
118 |
+
|
119 |
+
if ( ! empty( $body->valid ) && $body->valid === true ) {
|
120 |
+
// Store API key
|
121 |
+
update_option( 'seedprod_user_id', $body->user_id );
|
122 |
+
update_option( 'seedprod_api_token', $body->api_token );
|
123 |
+
update_option( 'seedprod_api_key', $data['license_key'] );
|
124 |
+
update_option( 'seedprod_api_message', $body->message );
|
125 |
+
update_option( 'seedprod_license_name', $body->license_name );
|
126 |
+
update_option( 'seedprod_a', true );
|
127 |
+
update_option( 'seedprod_per', $body->per );
|
128 |
+
$response = array(
|
129 |
+
'status' => 'true',
|
130 |
+
'license_name' => sprintf( __( 'You currently have the <strong>%s</strong> license.', 'coming-soon' ), $body->license_name ),
|
131 |
+
'msg' => $body->message,
|
132 |
+
'body' => $body,
|
133 |
+
);
|
134 |
+
} elseif ( isset( $body->valid ) && $body->valid === false ) {
|
135 |
+
$api_msg = __( 'Invalid License Key.', 'coming-soon' );
|
136 |
+
if ( $body->message != 'Unauthenticated.' ) {
|
137 |
+
$api_msg = $body->message;
|
138 |
+
}
|
139 |
+
update_option( 'seedprod_license_name', '' );
|
140 |
+
update_option( 'seedprod_api_token', '' );
|
141 |
+
update_option( 'seedprod_api_key', '' );
|
142 |
+
update_option( 'seedprod_api_message', $api_msg );
|
143 |
+
update_option( 'seedprod_a', false );
|
144 |
+
update_option( 'seedprod_per', '' );
|
145 |
+
$response = array(
|
146 |
+
'status' => 'false',
|
147 |
+
'license_name' => '',
|
148 |
+
'msg' => $api_msg,
|
149 |
+
'body' => $body,
|
150 |
+
);
|
151 |
+
}
|
152 |
+
|
153 |
+
// Send Response
|
154 |
+
if ( ! empty( $_POST['api_key'] ) ) {
|
155 |
+
wp_send_json( $response );
|
156 |
+
exit;
|
157 |
+
} else {
|
158 |
+
return $response;
|
159 |
+
}
|
160 |
+
}
|
161 |
}
|
162 |
|
app/load_controller.php
CHANGED
@@ -1,78 +1,88 @@
|
|
1 |
<?php
|
2 |
// must load first
|
3 |
-
require_once
|
4 |
|
5 |
-
require_once
|
6 |
-
require_once
|
7 |
-
require_once
|
8 |
-
require_once
|
9 |
-
require_once
|
10 |
-
require_once
|
11 |
-
require_once
|
12 |
add_action( 'plugins_loaded', array( 'seedprod_lite_Render', 'get_instance' ) );
|
13 |
add_action( 'plugins_loaded', array( 'SeedProd_Notifications', 'get_instance' ) );
|
14 |
|
15 |
-
if (is_admin()) {
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
} else {
|
25 |
-
|
26 |
}
|
27 |
|
28 |
|
29 |
// Load on Public and Admin
|
30 |
-
require_once
|
31 |
-
require_once
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
-
function seedprod_lite_admin_js
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<script>
|
41 |
jQuery( document ).ready(function($) {
|
42 |
$('#sp-lite-admin-menu__upgrade').parent().attr('target','_blank');
|
|
|
43 |
});
|
44 |
</script>
|
45 |
";
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
<script>
|
64 |
jQuery( document ).ready(function($) {
|
65 |
var checkExist = setInterval(function() {
|
66 |
if ($('.edit-post-header-toolbar').length) {
|
67 |
-
if(1 === "
|
68 |
-
$('.block-editor-block-list__layout').hide().after('<div style=\"text-align:center; \">This page is managed by SeedProd<br><a href=\""
|
69 |
|
70 |
}
|
71 |
clearInterval(checkExist);
|
72 |
}
|
73 |
if ($('#postdivrich').length) {
|
74 |
-
if(1 === "
|
75 |
-
$('#postdivrich').
|
76 |
clearInterval(checkExist);
|
77 |
}
|
78 |
}
|
@@ -81,7 +91,7 @@ function seedprod_lite_admin_js (){
|
|
81 |
});
|
82 |
</script>
|
83 |
";
|
84 |
-
|
85 |
-
|
86 |
}
|
87 |
add_action( 'admin_footer', 'seedprod_lite_admin_js' );
|
1 |
<?php
|
2 |
// must load first
|
3 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/functions-utils.php';
|
4 |
|
5 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/cpt.php';
|
6 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/admin-bar-menu.php';
|
7 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/notifications.php';
|
8 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/render-lp.php';
|
9 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/render-csp-mm.php';
|
10 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/backwards/backwards_compatibility.php';
|
11 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/subscriber.php';
|
12 |
add_action( 'plugins_loaded', array( 'seedprod_lite_Render', 'get_instance' ) );
|
13 |
add_action( 'plugins_loaded', array( 'SeedProd_Notifications', 'get_instance' ) );
|
14 |
|
15 |
+
if ( is_admin() ) {
|
16 |
+
// Admin Only
|
17 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/settings.php';
|
18 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/lpage.php';
|
19 |
+
//require_once(SEEDPROD_PLUGIN_PATH.'app/subscriber.php');
|
20 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/functions-addons.php';
|
21 |
+
if ( SEEDPROD_BUILD == 'lite' ) {
|
22 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/review.php';
|
23 |
+
}
|
24 |
} else {
|
25 |
+
// Public only
|
26 |
}
|
27 |
|
28 |
|
29 |
// Load on Public and Admin
|
30 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/license.php';
|
31 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/upgrade.php';
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
+
function seedprod_lite_admin_js() {
|
38 |
+
// Make Admin upgrade submenu link target _blank
|
39 |
+
if ( defined( 'SEEDPROD_TEMPLATE_DEV_MODE' ) && SEEDPROD_TEMPLATE_DEV_MODE === true ) {
|
40 |
+
echo "
|
41 |
+
<script>
|
42 |
+
jQuery( document ).ready(function($) {
|
43 |
+
$('.toplevel_page_seedprod_lite .wp-first-item').hide();
|
44 |
+
});
|
45 |
+
</script>
|
46 |
+
";
|
47 |
+
}
|
48 |
+
echo "
|
49 |
<script>
|
50 |
jQuery( document ).ready(function($) {
|
51 |
$('#sp-lite-admin-menu__upgrade').parent().attr('target','_blank');
|
52 |
+
$('#sp-feature-request').parent().attr('target','_blank');
|
53 |
});
|
54 |
</script>
|
55 |
";
|
56 |
|
57 |
+
if ( ! empty( $_GET['post'] ) ) {
|
58 |
+
$id = $_GET['post'];
|
59 |
+
$is_seedprod = 0;
|
60 |
+
if ( ! empty( get_post_meta( $id, '_seedprod_page', true ) ) ) {
|
61 |
+
$is_seedprod = get_post_meta( $id, '_seedprod_page', true );
|
62 |
+
}
|
63 |
+
$post_type = get_post_type( $id );
|
64 |
+
// $edit_link = sprintf(
|
65 |
+
// '<a href="%1$s">%2$s</a>',
|
66 |
+
// admin_url().'admin.php?page=seedprod_lite_builder&id='.$id.'#/setup/'.$id,
|
67 |
+
// __( 'Edit with SeedProd', 'seedprod' );
|
68 |
|
69 |
+
$setup_url = admin_url() . 'admin.php?page=seedprod_lite_builder&id=' . $id . '#/template/' . $id;
|
70 |
+
$edit_url = admin_url() . 'admin.php?page=seedprod_lite_builder&id=' . $id . '#/setup/' . $id;
|
71 |
+
if ( $post_type == 'page' ) {
|
72 |
+
echo "
|
73 |
<script>
|
74 |
jQuery( document ).ready(function($) {
|
75 |
var checkExist = setInterval(function() {
|
76 |
if ($('.edit-post-header-toolbar').length) {
|
77 |
+
if(1 === " . $is_seedprod . "){
|
78 |
+
$('.block-editor-block-list__layout').hide().after('<div style=\"text-align:center; \" class=\"managed_by_seedprod\">This page is managed by SeedProd<br><a href=\"" . $edit_url . '" class="button button-primary" style="display:flex; align-items:center; justify-content:center; margin:auto; width:200px; font-size: 18px; margin-top:10px"><img src="' . SEEDPROD_PLUGIN_URL . "public/svg/admin-bar-icon.svg\" style=\"margin-right:7px; margin-top:5px\"> Edit with SeedProd</a></div>');
|
79 |
|
80 |
}
|
81 |
clearInterval(checkExist);
|
82 |
}
|
83 |
if ($('#postdivrich').length) {
|
84 |
+
if(1 === " . $is_seedprod . "){
|
85 |
+
$('#postdivrich').hide().after('<div style=\"text-align:center; \" class=\"managed_by_seedprod\">This page is managed by SeedProd<br><a href=\"" . $edit_url . '" class="button button-primary" style="display:flex; align-items:center; justify-content:center; margin:auto; width:220px; font-size: 16px; margin-top:10px"><img src="' . SEEDPROD_PLUGIN_URL . "public/svg/admin-bar-icon.svg\" style=\"margin-right:7px; margin-top:5px\"> Edit with SeedProd</a></div>');
|
86 |
clearInterval(checkExist);
|
87 |
}
|
88 |
}
|
91 |
});
|
92 |
</script>
|
93 |
";
|
94 |
+
}
|
95 |
+
}
|
96 |
}
|
97 |
add_action( 'admin_footer', 'seedprod_lite_admin_js' );
|
app/lpage.php
CHANGED
@@ -2,827 +2,800 @@
|
|
2 |
/*
|
3 |
* Get lpage Lists
|
4 |
*/
|
5 |
-
function seedprod_lite_get_lpage_list()
|
6 |
-
{
|
7 |
-
|
8 |
-
global $wpdb;
|
9 |
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
}
|
21 |
|
22 |
/* Check Slug */
|
23 |
|
24 |
-
function seedprod_lite_slug_exists()
|
25 |
-
{
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
}
|
40 |
}
|
41 |
|
42 |
/*
|
43 |
* New lpage
|
44 |
*/
|
45 |
-
function seedprod_lite_new_lpage()
|
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 |
-
wp_redirect('admin.php?page=seedprod_lite_template&id='.$id. $from.'#/template/'.$id);
|
149 |
-
exit();
|
150 |
-
}
|
151 |
}
|
152 |
|
153 |
/*
|
154 |
* lpage Datatable
|
155 |
*/
|
156 |
-
function seedprod_lite_lpage_datatable()
|
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 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
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 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
}
|
290 |
|
291 |
|
292 |
-
function seedprod_lite_lpage_get_data_total($filter = null)
|
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 |
-
|
323 |
-
|
324 |
-
|
325 |
-
return $results;
|
326 |
}
|
327 |
|
328 |
|
329 |
|
330 |
-
function seedprod_lite_lpage_get_views($filter = null)
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
$current = sanitize_text_field($current);
|
335 |
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
|
340 |
-
|
341 |
-
|
342 |
|
343 |
-
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
|
350 |
-
|
351 |
-
|
352 |
|
353 |
-
|
354 |
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
|
360 |
-
|
361 |
-
|
362 |
|
363 |
-
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
|
370 |
-
|
371 |
-
|
372 |
|
373 |
-
|
374 |
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
|
380 |
-
|
381 |
-
|
382 |
|
383 |
-
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
|
390 |
-
|
391 |
}
|
392 |
|
393 |
/*
|
394 |
* Duplicate lpage
|
395 |
*/
|
396 |
|
397 |
-
function seedprod_lite_duplicate_lpage()
|
398 |
-
{
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
wp_send_json(array('status'=> true));
|
442 |
-
}
|
443 |
}
|
444 |
|
445 |
|
446 |
/*
|
447 |
* Archive Selected lpage
|
448 |
*/
|
449 |
-
function seedprod_lite_archive_selected_lpages()
|
450 |
-
{
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
}
|
463 |
}
|
464 |
|
465 |
/*
|
466 |
* Unarchive Selected lpage
|
467 |
*/
|
468 |
-
function seedprod_lite_unarchive_selected_lpages($ids)
|
469 |
-
{
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
}
|
482 |
}
|
483 |
|
484 |
/*
|
485 |
* Delete Archived lpage
|
486 |
*/
|
487 |
-
function seedprod_lite_delete_archived_lpages()
|
488 |
-
{
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
}
|
501 |
}
|
502 |
|
503 |
/*
|
504 |
* Save/Update lpage
|
505 |
*/
|
506 |
|
507 |
-
function seedprod_lite_save_lpage()
|
508 |
-
{
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
$
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
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 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
}
|
627 |
|
628 |
-
function seedprod_lite_get_revisisons()
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
wp_send_json($response);
|
652 |
}
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
-
function seedprod_lite_get_utc_offset()
|
658 |
-
{
|
659 |
-
|
660 |
-
$_POST = stripslashes_deep($_POST);
|
661 |
-
|
662 |
-
$timezone = sanitize_text_field($_POST['timezone']);
|
663 |
-
$ends = sanitize_text_field($_POST['ends']);
|
664 |
-
$ends_time = sanitize_text_field($_POST['ends_time']);
|
665 |
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
$ends_utc = date('Y-m-d H:i:s', $ends_timestamp);
|
670 |
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
} elseif (!empty($ends_utc) && time() > strtotime($ends_utc." UTC")) {
|
676 |
-
$countdown_status = __('Ended', 'coming-soon').' '.human_time_diff(time(), $ends_timestamp).' ago';
|
677 |
-
}
|
678 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
679 |
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
|
685 |
-
|
686 |
-
|
687 |
}
|
688 |
|
689 |
-
function seedprod_lite_template_subscribe()
|
690 |
-
|
691 |
-
|
692 |
-
exit();
|
693 |
}
|
694 |
|
695 |
/*
|
696 |
* Save/Update lpages Template
|
697 |
*/
|
698 |
|
699 |
-
function seedprod_lite_save_template()
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
wp_send_json($response);
|
781 |
-
}
|
782 |
}
|
783 |
|
784 |
-
function seedprod_lite_get_template_code($id)
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
return $code;
|
813 |
}
|
814 |
|
815 |
-
function seedprod_lite_get_namespaced_custom_css()
|
816 |
-
{
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
}
|
827 |
}
|
828 |
|
2 |
/*
|
3 |
* Get lpage Lists
|
4 |
*/
|
5 |
+
function seedprod_lite_get_lpage_list() {
|
6 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
7 |
+
global $wpdb;
|
|
|
8 |
|
9 |
+
$tablename = $wpdb->prefix . 'posts';
|
10 |
+
$meta_tablename = $wpdb->prefix . 'postmeta';
|
11 |
|
12 |
+
$sql = "SELECT id,post_title as name,meta_value as uuid FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
13 |
|
14 |
+
$sql .= ' WHERE post_status != "trash" AND post_type = "page" AND meta_key = "_seedprod_page_uuid"';
|
15 |
+
$response = $wpdb->get_results( $sql );
|
16 |
|
17 |
+
wp_send_json( $response );
|
18 |
+
}
|
19 |
}
|
20 |
|
21 |
/* Check Slug */
|
22 |
|
23 |
+
function seedprod_lite_slug_exists() {
|
24 |
+
if ( check_ajax_referer( 'seedprod_lite_slug_exists' ) ) {
|
25 |
+
$post_name = $_POST['post_name'];
|
26 |
+
global $wpdb;
|
27 |
+
$tablename = $wpdb->prefix . 'posts';
|
28 |
+
$sql = "SELECT post_name FROM $tablename";
|
29 |
+
$sql .= ' WHERE post_name = %s';
|
30 |
+
$safe_sql = $wpdb->prepare( $sql, $post_name );
|
31 |
+
$result = $wpdb->get_var( $safe_sql );
|
32 |
+
if ( empty( $result ) ) {
|
33 |
+
wp_send_json_success();
|
34 |
+
} else {
|
35 |
+
wp_send_json_error();
|
36 |
+
}
|
37 |
+
}
|
|
|
38 |
}
|
39 |
|
40 |
/*
|
41 |
* New lpage
|
42 |
*/
|
43 |
+
function seedprod_lite_new_lpage() {
|
44 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_template' && isset( $_GET['id'] ) && $_GET['id'] == '0' ) {
|
45 |
+
// get theme code
|
46 |
+
|
47 |
+
$id = absint( $_GET['id'] );
|
48 |
+
|
49 |
+
$from = '&from=';
|
50 |
+
if ( ! empty( $_GET['from'] ) ) {
|
51 |
+
$from = '&from=sidebar';
|
52 |
+
}
|
53 |
+
|
54 |
+
$type = 'lp';
|
55 |
+
if ( ! empty( $_GET['type'] ) ) {
|
56 |
+
$type = sanitize_text_field( $_GET['type'] );
|
57 |
+
}
|
58 |
+
|
59 |
+
// base page settings
|
60 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/data-templates/basic-page.php';
|
61 |
+
$settings = json_decode( $seedprod_basic_lpage );
|
62 |
+
$settings->is_new = true;
|
63 |
+
$settings->page_type = $type;
|
64 |
+
|
65 |
+
$cpt = 'page';
|
66 |
+
if ( $type == 'cs' || $type == 'mm' || $type == 'p404' ) {
|
67 |
+
$cpt = 'seedprod';
|
68 |
+
}
|
69 |
+
|
70 |
+
$slug = '';
|
71 |
+
if ( $type == 'cs' ) {
|
72 |
+
$slug = 'sp-cs';
|
73 |
+
$lpage_name = $slug;
|
74 |
+
$settings->no_conflict_mode = true;
|
75 |
+
}
|
76 |
+
if ( $type == 'mm' ) {
|
77 |
+
$slug = 'sp-mm';
|
78 |
+
$lpage_name = $slug;
|
79 |
+
$settings->no_conflict_mode = true;
|
80 |
+
}
|
81 |
+
if ( $type == 'p404' ) {
|
82 |
+
$slug = 'sp-p404';
|
83 |
+
$lpage_name = $slug;
|
84 |
+
$settings->no_conflict_mode = true;
|
85 |
+
}
|
86 |
+
if ( $type == 'loginp' ) {
|
87 |
+
$slug = 'sp-login';
|
88 |
+
$lpage_name = $slug;
|
89 |
+
$settings->no_conflict_mode = true;
|
90 |
+
}
|
91 |
+
$settings = wp_json_encode( $settings );
|
92 |
+
|
93 |
+
// Insert
|
94 |
+
$id = wp_insert_post(
|
95 |
+
array(
|
96 |
+
'comment_status' => 'closed',
|
97 |
+
'ping_status' => 'closed',
|
98 |
+
'post_content' => '',
|
99 |
+
'post_status' => 'draft',
|
100 |
+
'post_title' => 'seedprod',
|
101 |
+
'post_type' => $cpt,
|
102 |
+
'post_name' => $slug,
|
103 |
+
'post_content_filtered' => $settings,
|
104 |
+
'meta_input' => array(
|
105 |
+
'_seedprod_page' => true,
|
106 |
+
'_seedprod_page_uuid' => wp_generate_uuid4(),
|
107 |
+
),
|
108 |
+
),
|
109 |
+
true
|
110 |
+
);
|
111 |
+
|
112 |
+
// record coming soon page_id
|
113 |
+
if ( $type == 'cs' ) {
|
114 |
+
update_option( 'seedprod_coming_soon_page_id', $id );
|
115 |
+
}
|
116 |
+
if ( $type == 'mm' ) {
|
117 |
+
update_option( 'seedprod_maintenance_mode_page_id', $id );
|
118 |
+
}
|
119 |
+
if ( $type == 'p404' ) {
|
120 |
+
update_option( 'seedprod_404_page_id', $id );
|
121 |
+
}
|
122 |
+
if ( $type == 'loginp' ) {
|
123 |
+
update_option( 'seedprod_login_page_id', $id );
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( $type == 'lp' ) {
|
127 |
+
if ( is_numeric( $id ) ) {
|
128 |
+
$lpage_name = esc_html__( 'New Page', 'coming-soon' ) . " (ID #$id)";
|
129 |
+
} else {
|
130 |
+
$lpage_name = esc_html__( 'New Page', 'coming-soon' );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
wp_update_post(
|
135 |
+
array(
|
136 |
+
'ID' => $id,
|
137 |
+
'post_title' => $lpage_name,
|
138 |
+
)
|
139 |
+
);
|
140 |
+
|
141 |
+
wp_redirect( 'admin.php?page=seedprod_lite_template&id=' . $id . $from . '#/template/' . $id );
|
142 |
+
exit();
|
143 |
+
}
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
|
146 |
/*
|
147 |
* lpage Datatable
|
148 |
*/
|
149 |
+
function seedprod_lite_lpage_datatable() {
|
150 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
151 |
+
$data = array( '' );
|
152 |
+
$current_page = 1;
|
153 |
+
if ( ! empty( absint( $_GET['current_page'] ) ) ) {
|
154 |
+
$current_page = absint( $_GET['current_page'] );
|
155 |
+
}
|
156 |
+
$per_page = 10;
|
157 |
+
|
158 |
+
$filter = null;
|
159 |
+
if ( ! empty( $_GET['filter'] ) ) {
|
160 |
+
$filter = sanitize_text_field( $_GET['filter'] );
|
161 |
+
if ( $filter == 'all' ) {
|
162 |
+
$filter = null;
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
if ( ! empty( $_GET['s'] ) ) {
|
167 |
+
$filter = null;
|
168 |
+
}
|
169 |
+
|
170 |
+
// Get records
|
171 |
+
global $wpdb;
|
172 |
+
$tablename = $wpdb->prefix . 'posts';
|
173 |
+
$meta_tablename = $wpdb->prefix . 'postmeta';
|
174 |
+
|
175 |
+
$sql = "SELECT * FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
176 |
+
|
177 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page"';
|
178 |
+
|
179 |
+
if ( ! empty( $filter ) ) {
|
180 |
+
if ( esc_sql( $filter ) == 'published' ) {
|
181 |
+
$sql .= ' AND post_status = "publish" ';
|
182 |
+
}
|
183 |
+
if ( esc_sql( $filter ) == 'drafts' ) {
|
184 |
+
$sql .= ' AND post_status = "draft" ';
|
185 |
+
}
|
186 |
+
if ( esc_sql( $filter ) == 'scheduled' ) {
|
187 |
+
$sql .= ' AND post_status = "future" ';
|
188 |
+
}
|
189 |
+
if ( esc_sql( $filter ) == 'archived' ) {
|
190 |
+
$sql .= ' AND post_status = "trash" ';
|
191 |
+
}
|
192 |
+
} else {
|
193 |
+
$sql .= 'AND post_status != "trash"';
|
194 |
+
}
|
195 |
+
|
196 |
+
if ( ! empty( $_GET['s'] ) ) {
|
197 |
+
$sql .= ' AND post_title LIKE "%' . esc_sql( trim( sanitize_text_field( $_GET['s'] ) ) ) . '%"';
|
198 |
+
}
|
199 |
+
|
200 |
+
if ( ! empty( $_GET['orderby'] ) ) {
|
201 |
+
$orderby = $_GET['orderby'];
|
202 |
+
if ( $orderby == 'date' ) {
|
203 |
+
$orderby = 'post_modified';
|
204 |
+
}
|
205 |
+
if ( $orderby == 'name' ) {
|
206 |
+
$orderby = 'post_title';
|
207 |
+
}
|
208 |
+
$sql .= ' ORDER BY ' . esc_sql( $orderby );
|
209 |
+
|
210 |
+
if ( sanitize_text_field( $_GET['order'] ) === 'desc' ) {
|
211 |
+
$order = 'DESC';
|
212 |
+
} else {
|
213 |
+
$order = 'ASC';
|
214 |
+
}
|
215 |
+
$sql .= ' ' . $order;
|
216 |
+
} else {
|
217 |
+
$sql .= ' ORDER BY id DESC';
|
218 |
+
}
|
219 |
+
|
220 |
+
$sql .= " LIMIT $per_page";
|
221 |
+
if ( empty( $_POST['s'] ) ) {
|
222 |
+
$sql .= ' OFFSET ' . ( $current_page - 1 ) * $per_page;
|
223 |
+
}
|
224 |
+
|
225 |
+
$results = $wpdb->get_results( $sql );
|
226 |
+
|
227 |
+
$login_page_id = get_option( 'seedprod_login_page_id' );
|
228 |
+
$data = array();
|
229 |
+
foreach ( $results as $v ) {
|
230 |
+
// Skip row to prevent current Login Page post from displaying here
|
231 |
+
if ( $v->ID === $login_page_id ) {
|
232 |
+
continue; }
|
233 |
+
|
234 |
+
// Format Date
|
235 |
+
//$modified_at = date(get_option('date_format').' '.get_option('time_format'), strtotime($v->post_modified));
|
236 |
+
|
237 |
+
$modified_at = date( 'Y/m/d', strtotime( $v->post_modified ) );
|
238 |
+
|
239 |
+
$posted_at = date( 'Y/m/d', strtotime( $v->post_date ) );
|
240 |
+
|
241 |
+
$url = get_permalink( $v->ID );
|
242 |
+
|
243 |
+
if ( $v->post_status == 'publish' ) {
|
244 |
+
$status = 'Published';
|
245 |
+
}
|
246 |
+
if ( $v->post_status == 'draft' ) {
|
247 |
+
$status = 'Draft';
|
248 |
+
}
|
249 |
+
if ( $v->post_status == 'future' ) {
|
250 |
+
$status = 'Scheduled';
|
251 |
+
}
|
252 |
+
if ( $v->post_status == 'trash' ) {
|
253 |
+
$status = 'Trash';
|
254 |
+
}
|
255 |
+
|
256 |
+
// Load Data
|
257 |
+
|
258 |
+
$data[] = array(
|
259 |
+
'id' => $v->ID,
|
260 |
+
'name' => $v->post_title,
|
261 |
+
'status' => $status,
|
262 |
+
'post_status' => $v->post_status,
|
263 |
+
'url' => $url,
|
264 |
+
'modified_at' => $modified_at,
|
265 |
+
'posted_at' => $posted_at,
|
266 |
+
);
|
267 |
+
}
|
268 |
+
|
269 |
+
$totalitems = seedprod_lite_lpage_get_data_total( $filter );
|
270 |
+
$views = seedprod_lite_lpage_get_views( $filter );
|
271 |
+
|
272 |
+
$response = array(
|
273 |
+
'rows' => $data,
|
274 |
+
'totalitems' => $totalitems,
|
275 |
+
'totalpages' => ceil( $totalitems / 10 ),
|
276 |
+
'currentpage' => $current_page,
|
277 |
+
'views' => $views,
|
278 |
+
);
|
279 |
+
|
280 |
+
wp_send_json( $response );
|
281 |
+
}
|
282 |
}
|
283 |
|
284 |
|
285 |
+
function seedprod_lite_lpage_get_data_total( $filter = null ) {
|
286 |
+
global $wpdb;
|
287 |
+
|
288 |
+
$tablename = $wpdb->prefix . 'posts';
|
289 |
+
$meta_tablename = $wpdb->prefix . 'postmeta';
|
290 |
+
|
291 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
292 |
+
|
293 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page"';
|
294 |
+
|
295 |
+
if ( ! empty( $filter ) ) {
|
296 |
+
if ( esc_sql( $filter ) == 'published' ) {
|
297 |
+
$sql .= ' AND post_status = "publish" ';
|
298 |
+
}
|
299 |
+
if ( esc_sql( $filter ) == 'drafts' ) {
|
300 |
+
$sql .= ' AND post_status = "draft" ';
|
301 |
+
}
|
302 |
+
if ( esc_sql( $filter ) == 'scheduled' ) {
|
303 |
+
$sql .= ' AND post_status = "future" ';
|
304 |
+
}
|
305 |
+
if ( esc_sql( $filter ) == 'archived' ) {
|
306 |
+
$sql .= ' AND post_status = "trash" ';
|
307 |
+
}
|
308 |
+
} else {
|
309 |
+
$sql .= ' AND post_status != "trash"';
|
310 |
+
}
|
311 |
+
|
312 |
+
if ( ! empty( $_GET['s'] ) ) {
|
313 |
+
$sql .= ' AND post_name LIKE "%' . esc_sql( sanitize_text_field( $_GET['s'] ) ) . '%"';
|
314 |
+
}
|
315 |
+
|
316 |
+
$results = $wpdb->get_var( $sql );
|
317 |
+
return $results;
|
|
|
318 |
}
|
319 |
|
320 |
|
321 |
|
322 |
+
function seedprod_lite_lpage_get_views( $filter = null ) {
|
323 |
+
$views = array();
|
324 |
+
$current = ( ! empty( $filter ) ? $filter : 'all' );
|
325 |
+
$current = sanitize_text_field( $current );
|
|
|
326 |
|
327 |
+
global $wpdb;
|
328 |
+
$tablename = $wpdb->prefix . 'posts';
|
329 |
+
$meta_tablename = $wpdb->prefix . 'postmeta';
|
330 |
|
331 |
+
//All link
|
332 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
333 |
|
334 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND post_status != "trash" AND meta_key = "_seedprod_page"';
|
335 |
|
336 |
+
$results = $wpdb->get_var( $sql );
|
337 |
+
$class = ( $current == 'all' ? ' class="current"' : '' );
|
338 |
+
$all_url = remove_query_arg( 'filter' );
|
339 |
+
$views['all'] = $results;
|
340 |
|
341 |
+
//Published link
|
342 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
343 |
|
344 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page" AND post_status = "publish" ';
|
345 |
|
346 |
+
$results = $wpdb->get_var( $sql );
|
347 |
+
$running_url = add_query_arg( 'filter', 'publish' );
|
348 |
+
$class = ( $current == 'publish' ? ' class="current"' : '' );
|
349 |
+
$views['published'] = $results;
|
350 |
|
351 |
+
//Drafts link
|
352 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
353 |
|
354 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page" AND post_status = "draft" ';
|
355 |
|
356 |
+
$results = $wpdb->get_var( $sql );
|
357 |
+
$upcoming_url = add_query_arg( 'filter', 'drafts' );
|
358 |
+
$class = ( $current == 'drafts' ? ' class="current"' : '' );
|
359 |
+
$views['drafts'] = $results;
|
360 |
|
361 |
+
//Scheduled link
|
362 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
363 |
|
364 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page" AND post_status = "future" ';
|
365 |
|
366 |
+
$results = $wpdb->get_var( $sql );
|
367 |
+
$ended_url = add_query_arg( 'filter', 'scheduled' );
|
368 |
+
$class = ( $current == 'scheduled' ? ' class="current"' : '' );
|
369 |
+
$views['scheduled'] = $results;
|
370 |
|
371 |
+
//Trash link
|
372 |
+
$sql = "SELECT count(*) FROM $tablename p LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID)";
|
373 |
|
374 |
+
$sql .= ' WHERE 1 = 1 AND post_type = "page" AND meta_key = "_seedprod_page" AND post_status = "trash" ';
|
375 |
|
376 |
+
$results = $wpdb->get_var( $sql );
|
377 |
+
$archived_url = add_query_arg( 'filter', 'archived' );
|
378 |
+
$class = ( $current == 'archived' ? ' class="current"' : '' );
|
379 |
+
$views['archived'] = $results;
|
380 |
|
381 |
+
return $views;
|
382 |
}
|
383 |
|
384 |
/*
|
385 |
* Duplicate lpage
|
386 |
*/
|
387 |
|
388 |
+
function seedprod_lite_duplicate_lpage() {
|
389 |
+
if ( check_ajax_referer( 'seedprod_lite_duplicate_lpage' ) ) {
|
390 |
+
$id = '';
|
391 |
+
if ( ! empty( $_GET['id'] ) ) {
|
392 |
+
$id = absint( $_GET['id'] );
|
393 |
+
}
|
394 |
+
|
395 |
+
$post = get_post( $id );
|
396 |
+
$json = $post->post_content_filtered;
|
397 |
+
|
398 |
+
$args = array(
|
399 |
+
'comment_status' => 'closed',
|
400 |
+
'ping_status' => 'closed',
|
401 |
+
'post_content' => $post->post_content,
|
402 |
+
//'post_content_filtered' => $post->post_content_filtered,
|
403 |
+
'post_status' => 'draft',
|
404 |
+
'post_title' => $post->post_title . '- Copy',
|
405 |
+
'post_type' => 'page',
|
406 |
+
'post_name' => '',
|
407 |
+
'meta_input' => array(
|
408 |
+
'_seedprod_page' => true,
|
409 |
+
'_seedprod_page_uuid' => wp_generate_uuid4(),
|
410 |
+
),
|
411 |
+
);
|
412 |
+
|
413 |
+
$new_post_id = wp_insert_post( $args, true );
|
414 |
+
// reinsert json due to slash bug
|
415 |
+
global $wpdb;
|
416 |
+
$tablename = $wpdb->prefix . 'posts';
|
417 |
+
$wpdb->update(
|
418 |
+
$tablename,
|
419 |
+
array(
|
420 |
+
'post_content_filtered' => $json, // string
|
421 |
+
),
|
422 |
+
array( 'ID' => $new_post_id ),
|
423 |
+
array(
|
424 |
+
'%s', // value1
|
425 |
+
),
|
426 |
+
array( '%d' )
|
427 |
+
);
|
428 |
+
|
429 |
+
wp_send_json( array( 'status' => true ) );
|
430 |
+
}
|
|
|
|
|
|
|
431 |
}
|
432 |
|
433 |
|
434 |
/*
|
435 |
* Archive Selected lpage
|
436 |
*/
|
437 |
+
function seedprod_lite_archive_selected_lpages() {
|
438 |
+
if ( check_ajax_referer( 'seedprod_lite_archive_selected_lpages' ) ) {
|
439 |
+
if ( current_user_can( apply_filters( 'seedprod_trash_pages_capability', 'list_users' ) ) ) {
|
440 |
+
if ( ! empty( $_GET['ids'] ) ) {
|
441 |
+
$ids = array_map( 'intval', explode( ',', $_GET['ids'] ) );
|
442 |
+
foreach ( $ids as $v ) {
|
443 |
+
wp_trash_post( $v );
|
444 |
+
}
|
445 |
+
|
446 |
+
wp_send_json( array( 'status' => true ) );
|
447 |
+
}
|
448 |
+
}
|
449 |
+
}
|
|
|
450 |
}
|
451 |
|
452 |
/*
|
453 |
* Unarchive Selected lpage
|
454 |
*/
|
455 |
+
function seedprod_lite_unarchive_selected_lpages( $ids ) {
|
456 |
+
if ( check_ajax_referer( 'seedprod_lite_unarchive_selected_lpages' ) ) {
|
457 |
+
if ( current_user_can( apply_filters( 'seedprod_unarchive_pages_capability', 'list_users' ) ) ) {
|
458 |
+
if ( ! empty( $_GET['ids'] ) ) {
|
459 |
+
$ids = array_map( 'intval', explode( ',', $_GET['ids'] ) );
|
460 |
+
foreach ( $ids as $v ) {
|
461 |
+
wp_untrash_post( $v );
|
462 |
+
}
|
463 |
+
|
464 |
+
wp_send_json( array( 'status' => true ) );
|
465 |
+
}
|
466 |
+
}
|
467 |
+
}
|
|
|
468 |
}
|
469 |
|
470 |
/*
|
471 |
* Delete Archived lpage
|
472 |
*/
|
473 |
+
function seedprod_lite_delete_archived_lpages() {
|
474 |
+
if ( check_ajax_referer( 'seedprod_lite_delete_archived_lpages' ) ) {
|
475 |
+
if ( current_user_can( apply_filters( 'seedprod_archive_pages_capability', 'list_users' ) ) ) {
|
476 |
+
if ( ! empty( $_GET['ids'] ) ) {
|
477 |
+
$ids = array_map( 'intval', explode( ',', $_GET['ids'] ) );
|
478 |
+
foreach ( $ids as $v ) {
|
479 |
+
wp_delete_post( $v );
|
480 |
+
}
|
481 |
+
|
482 |
+
wp_send_json( array( 'status' => true ) );
|
483 |
+
}
|
484 |
+
}
|
485 |
+
}
|
|
|
486 |
}
|
487 |
|
488 |
/*
|
489 |
* Save/Update lpage
|
490 |
*/
|
491 |
|
492 |
+
function seedprod_lite_save_lpage() {
|
493 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
494 |
+
|
495 |
+
// Validate
|
496 |
+
$errors = array();
|
497 |
+
// if(!is_email($_POST['product']['email'])){
|
498 |
+
// $errors['email'] = 'Please enter a valid email.';
|
499 |
+
// }
|
500 |
+
|
501 |
+
if ( ! empty( $errors ) ) {
|
502 |
+
header( 'Content-Type: application/json' );
|
503 |
+
header( 'Status: 400 Bad Request' );
|
504 |
+
echo json_encode( $errors );
|
505 |
+
exit();
|
506 |
+
}
|
507 |
+
|
508 |
+
// clean slashes post
|
509 |
+
$sp_post = $_POST;
|
510 |
+
$sp_post['lpage_html'] = stripslashes_deep( $sp_post['lpage_html'] );
|
511 |
+
|
512 |
+
// remove uneeded code
|
513 |
+
$html = $sp_post['lpage_html'];
|
514 |
+
if ( ! empty( $html ) ) {
|
515 |
+
$html = preg_replace( "'<span class=\"sp-hidden\">START-REMOVE</span>[\s\S]+?<span class=\"sp-hidden\">END-REMOVE</span>'", '', $html );
|
516 |
+
$html = preg_replace( "'<span class=\"sp-hidden\">START-COUNTDOWN-REMOVE</span>[\s\S]+?<span class=\"sp-hidden\">END-COUNTDOWN-REMOVE</span>'", '', $html );
|
517 |
+
$html = preg_replace( "'seedprod-jscode'", 'script', $html );
|
518 |
+
$html = preg_replace( "'<!---->'", '', $html );
|
519 |
+
$html = preg_replace( "'<!--'", '', $html );
|
520 |
+
$html = preg_replace( "'-->'", '', $html );
|
521 |
+
$html = preg_replace( "'contenteditable=\"true\"'", '', $html );
|
522 |
+
$html = preg_replace( "'spellcheck=\"false\"'", '', $html );
|
523 |
+
$html = str_replace( 'function(e,n,r,i){return fn(t,e,n,r,i,!0)}', '', $html );
|
524 |
+
}
|
525 |
+
|
526 |
+
// sanitize post
|
527 |
+
$lpage_id = absint( $sp_post['lpage_id'] );
|
528 |
+
$lpage_name = sanitize_text_field( $sp_post['lpage_name'] );
|
529 |
+
$lpage_slug = sanitize_title( $sp_post['lpage_slug'] );
|
530 |
+
$lpage_post_status = sanitize_title( $sp_post['lpage_post_status'] );
|
531 |
+
$settings = $sp_post['settings'];
|
532 |
+
//$settings = wp_json_encode(json_decode( stripslashes($sp_post['settings'])));
|
533 |
+
|
534 |
+
// set update array
|
535 |
+
$update = array();
|
536 |
+
$update['ID'] = $lpage_id;
|
537 |
+
if ( ! empty( $lpage_name ) ) {
|
538 |
+
$update['post_title'] = $lpage_name;
|
539 |
+
}
|
540 |
+
if ( ! empty( $lpage_slug ) ) {
|
541 |
+
$update['post_name'] = $lpage_slug;
|
542 |
+
}
|
543 |
+
if ( ! empty( $lpage_post_status ) ) {
|
544 |
+
$update['post_status'] = $lpage_post_status;
|
545 |
+
}
|
546 |
+
if ( ! empty( $html ) ) {
|
547 |
+
$update['post_content'] = $html;
|
548 |
+
}
|
549 |
+
if ( ! empty( $settings ) ) {
|
550 |
+
$update['post_content_filtered'] = $settings;
|
551 |
+
}
|
552 |
+
|
553 |
+
$status = '';
|
554 |
+
if ( empty( $lpage_id ) ) {
|
555 |
+
wp_die();
|
556 |
+
} else {
|
557 |
+
update_post_meta( $lpage_id, '_seedprod_page', '1' );
|
558 |
+
if ( ! empty( $sp_post['save_type'] ) && $sp_post['save_type'] == 'autosave' ) {
|
559 |
+
$update['post_ID'] = $lpage_id;
|
560 |
+
$id = @wp_create_post_autosave( $update );
|
561 |
+
$status = 'autosave';
|
562 |
+
} else {
|
563 |
+
wp_update_post( $update );
|
564 |
+
$status = 'updated';
|
565 |
+
}
|
566 |
+
}
|
567 |
+
|
568 |
+
$response = array(
|
569 |
+
'status' => $status,
|
570 |
+
'id' => $lpage_id,
|
571 |
+
//'revisions' => $revisions,
|
572 |
+
);
|
573 |
+
|
574 |
+
// clear any migration flags
|
575 |
+
$i = get_option( 'seedprod_csp4_imported' );
|
576 |
+
if ( $i == 1 ) {
|
577 |
+
delete_option( 'seedprod_csp4_imported' );
|
578 |
+
delete_option( 'seedprod_show_csp4' );
|
579 |
+
update_option( 'seedprod_csp4_migrated', true );
|
580 |
+
}
|
581 |
+
|
582 |
+
$i = get_option( 'seedprod_cspv5_imported' );
|
583 |
+
if ( $i == 1 ) {
|
584 |
+
delete_option( 'seedprod_cspv5_imported' );
|
585 |
+
delete_option( 'seedprod_show_cspv5' );
|
586 |
+
update_option( 'seedprod_cspv5_migrated', true );
|
587 |
+
}
|
588 |
+
|
589 |
+
// migrate landing page if id exists
|
590 |
+
$settings = json_decode( stripslashes_deep( $sp_post['settings'] ) );
|
591 |
+
if ( ! empty( $settings->cspv5_id ) ) {
|
592 |
+
$cspv5_id = $settings->cspv5_id;
|
593 |
+
global $wpdb;
|
594 |
+
$tablename = $wpdb->prefix . 'cspv5_pages';
|
595 |
+
$r = $wpdb->update(
|
596 |
+
$tablename,
|
597 |
+
array(
|
598 |
+
'meta' => 'migrated',
|
599 |
+
),
|
600 |
+
array( 'id' => $cspv5_id ),
|
601 |
+
array(
|
602 |
+
'%s',
|
603 |
+
),
|
604 |
+
array( '%d' )
|
605 |
+
);
|
606 |
+
}
|
607 |
+
|
608 |
+
|
609 |
+
wp_send_json( $response );
|
610 |
+
}
|
611 |
}
|
612 |
|
613 |
+
function seedprod_lite_get_revisisons() {
|
614 |
+
$lpage_id = absint( $_POST['lpage_id'] );
|
615 |
+
$revisions = wp_get_post_revisions( $lpage_id, array( 'numberposts' => 50 ) );
|
616 |
+
foreach ( $revisions as $v ) {
|
617 |
+
$v->time_ago = human_time_diff( strtotime( $v->post_date_gmt ) );
|
618 |
+
$v->post_date_formated = date( 'M j \a\t ' . get_option( 'time_format' ), strtotime( $v->post_date ) );
|
619 |
+
$authordata = get_userdata( $v->post_author );
|
620 |
+
$v->author_name = $authordata->data->user_nicename;
|
621 |
+
$v->author_email = md5( $authordata->data->user_email );
|
622 |
+
unset( $v->post_content );
|
623 |
+
|
624 |
+
// $created_at = date(get_option('date_format').' '.get_option('time_format'), strtotime($v->post_date));
|
625 |
+
}
|
626 |
+
$revisions = array_values( $revisions );
|
627 |
+
|
628 |
+
$response = array(
|
629 |
+
'id' => $lpage_id,
|
630 |
+
'revisions' => $revisions,
|
631 |
+
);
|
632 |
+
|
633 |
+
wp_send_json( $response );
|
|
|
|
|
|
|
634 |
}
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
+
function seedprod_lite_get_utc_offset() {
|
640 |
+
if ( check_ajax_referer( 'seedprod_lite_get_utc_offset' ) ) {
|
641 |
+
$_POST = stripslashes_deep( $_POST );
|
|
|
|
|
|
|
|
|
|
|
642 |
|
643 |
+
$timezone = sanitize_text_field( $_POST['timezone'] );
|
644 |
+
$ends = sanitize_text_field( $_POST['ends'] );
|
645 |
+
$ends_time = sanitize_text_field( $_POST['ends_time'] );
|
|
|
646 |
|
647 |
+
//$ends = substr($ends, 0, strpos($ends, 'T'));
|
648 |
+
$ends = $ends . ' ' . $ends_time;
|
649 |
+
$ends_timestamp = strtotime( $ends . ' ' . $timezone );
|
650 |
+
$ends_utc = date( 'Y-m-d H:i:s', $ends_timestamp );
|
|
|
|
|
|
|
651 |
|
652 |
+
// countdown status
|
653 |
+
$countdown_status = '';
|
654 |
+
if ( ! empty( $starts_utc ) && time() < strtotime( $starts_utc . ' UTC' ) ) {
|
655 |
+
$countdown_status = __( 'Starts in', 'coming-soon' ) . ' ' . human_time_diff( time(), $starts_timestamp );
|
656 |
+
} elseif ( ! empty( $ends_utc ) && time() > strtotime( $ends_utc . ' UTC' ) ) {
|
657 |
+
$countdown_status = __( 'Ended', 'coming-soon' ) . ' ' . human_time_diff( time(), $ends_timestamp ) . ' ago';
|
658 |
+
}
|
659 |
|
660 |
+
$response = array(
|
661 |
+
'ends_timestamp' => $ends_timestamp,
|
662 |
+
'countdown_status' => $countdown_status,
|
663 |
+
);
|
664 |
|
665 |
+
wp_send_json( $response );
|
666 |
+
}
|
667 |
}
|
668 |
|
669 |
+
function seedprod_lite_template_subscribe() {
|
670 |
+
update_option( 'seedprod_free_templates_subscribed', true );
|
671 |
+
exit();
|
|
|
672 |
}
|
673 |
|
674 |
/*
|
675 |
* Save/Update lpages Template
|
676 |
*/
|
677 |
|
678 |
+
function seedprod_lite_save_template() {
|
679 |
+
// get template code and set name and slug
|
680 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
681 |
+
$_POST = stripslashes_deep( $_POST );
|
682 |
+
|
683 |
+
$status = false;
|
684 |
+
$lpage_id = null;
|
685 |
+
|
686 |
+
if ( empty( absint( $_POST['lpage_id'] ) ) ) {
|
687 |
+
// shouldn't get here
|
688 |
+
$response = array(
|
689 |
+
'status' => $status,
|
690 |
+
'id' => $lpage_id,
|
691 |
+
'code' => '',
|
692 |
+
);
|
693 |
+
|
694 |
+
wp_send_json( $response, 403 );
|
695 |
+
} else {
|
696 |
+
$lpage_id = absint( $_POST['lpage_id'] );
|
697 |
+
$template_id = absint( $_POST['lpage_template_id'] );
|
698 |
+
|
699 |
+
if ( $template_id != 99999 ) {
|
700 |
+
$template_code = seedprod_lite_get_template_code( $template_id );
|
701 |
+
}
|
702 |
+
|
703 |
+
// merge in template code to settings
|
704 |
+
global $wpdb;
|
705 |
+
$tablename = $wpdb->prefix . 'posts';
|
706 |
+
$sql = "SELECT * FROM $tablename WHERE id = %d";
|
707 |
+
$safe_sql = $wpdb->prepare( $sql, $lpage_id );
|
708 |
+
$lpage = $wpdb->get_row( $safe_sql );
|
709 |
+
$settings = json_decode( $lpage->post_content_filtered, true );
|
710 |
+
$settings['template_id'] = $template_id;
|
711 |
+
if ( $template_id != 99999 ) {
|
712 |
+
unset( $settings['document'] );
|
713 |
+
$template_code_merge = json_decode( $template_code, true );
|
714 |
+
$settings = $settings + $template_code_merge;
|
715 |
+
}
|
716 |
+
|
717 |
+
$settings['page_type'] = sanitize_text_field( $_POST['lpage_type'] );
|
718 |
+
|
719 |
+
// save settings
|
720 |
+
// $r = wp_update_post(
|
721 |
+
// array(
|
722 |
+
// 'ID' => $lpage_id,
|
723 |
+
// 'post_title'=>sanitize_text_field($_POST['lpage_name']),
|
724 |
+
// 'post_content_filtered'=> json_encode($settings),
|
725 |
+
// 'post_name' => sanitize_title($_POST['lpage_slug']),
|
726 |
+
// )
|
727 |
+
// );
|
728 |
+
|
729 |
+
global $wpdb;
|
730 |
+
$tablename = $wpdb->prefix . 'posts';
|
731 |
+
$r = $wpdb->update(
|
732 |
+
$tablename,
|
733 |
+
array(
|
734 |
+
'post_title' => sanitize_text_field( $_POST['lpage_name'] ),
|
735 |
+
'post_content_filtered' => json_encode( $settings ),
|
736 |
+
'post_name' => sanitize_title( $_POST['lpage_slug'] ),
|
737 |
+
),
|
738 |
+
array( 'ID' => $lpage_id ),
|
739 |
+
array(
|
740 |
+
'%s',
|
741 |
+
'%s',
|
742 |
+
'%s',
|
743 |
+
),
|
744 |
+
array( '%d' )
|
745 |
+
);
|
746 |
+
|
747 |
+
$status = 'updated';
|
748 |
+
}
|
749 |
+
|
750 |
+
$response = array(
|
751 |
+
'status' => $status,
|
752 |
+
'id' => $lpage_id,
|
753 |
+
'code' => $template_code,
|
754 |
+
);
|
755 |
+
|
756 |
+
wp_send_json( $response );
|
757 |
+
}
|
|
|
|
|
|
|
758 |
}
|
759 |
|
760 |
+
function seedprod_lite_get_template_code( $id ) {
|
761 |
+
// Get themes
|
762 |
+
$code = '';
|
763 |
+
|
764 |
+
$apikey = get_option( 'seedprod_api_token' );
|
765 |
+
if ( empty( $apikey ) ) {
|
766 |
+
$url = SEEDPROD_API_URL . 'templates-preview?id=' . $id . '&filter=template_code' . '&api_token=' . $apikey;
|
767 |
+
} else {
|
768 |
+
$url = SEEDPROD_API_URL . 'templates?id=' . $id . '&filter=template_code' . '&api_token=' . $apikey;
|
769 |
+
}
|
770 |
+
|
771 |
+
$response = wp_remote_get( $url );
|
772 |
+
|
773 |
+
if ( is_wp_error( $response ) ) {
|
774 |
+
$code = $response->get_error_message();
|
775 |
+
} else {
|
776 |
+
$response_code = wp_remote_retrieve_response_code( $response );
|
777 |
+
if ( $response_code == '200' ) {
|
778 |
+
//set_transient('seedprod_template_code_'.$id,$response['body'],86400);
|
779 |
+
$code = $response['body'];
|
780 |
+
//error_log($code);
|
781 |
+
} else {
|
782 |
+
$code = __( "<br><br>Please enter a valid license key to access the themes. You can still proceed to create a page with the default theme.<br> <a class='seedprod_no_themes' href='?theme=0'>Click to continue →</a>", 'coming-soon' );
|
783 |
+
}
|
784 |
+
}
|
785 |
+
|
786 |
+
return $code;
|
|
|
|
|
787 |
}
|
788 |
|
789 |
+
function seedprod_lite_get_namespaced_custom_css() {
|
790 |
+
if ( check_ajax_referer( 'seedprod_lite_get_namespaced_custom_css' ) ) {
|
791 |
+
if ( ! empty( $_POST['css'] ) ) {
|
792 |
+
$css = $_POST['css'];
|
793 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/includes/seedprod_lessc.inc.php';
|
794 |
+
$less = new seedprod_lessc();
|
795 |
+
$style = $less->parse( '.sp-html {' . $css . '}' );
|
796 |
+
echo $style;
|
797 |
+
exit();
|
798 |
+
}
|
799 |
+
}
|
|
|
800 |
}
|
801 |
|
app/notifications.php
CHANGED
@@ -5,432 +5,414 @@
|
|
5 |
*
|
6 |
* @since 7.10.5
|
7 |
*/
|
8 |
-
if (!class_exists('SeedProd_Notifications')) {
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
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 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
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 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
* Get the URL for the page where users can see/read notifications.
|
408 |
-
*
|
409 |
-
* @return string
|
410 |
-
*/
|
411 |
-
public function get_view_url()
|
412 |
-
{
|
413 |
-
$disabled = get_option('dashboards_disabled', false);
|
414 |
-
|
415 |
-
$url = add_query_arg('page', 'seedprod_reports', admin_url('admin.php'));
|
416 |
-
|
417 |
-
if (false !== $disabled) {
|
418 |
-
$url = is_multisite() ? network_admin_url('admin.php?page=seedprod_network') : admin_url('admin.php?page=seedprod_settings');
|
419 |
-
}
|
420 |
-
|
421 |
-
return $url;
|
422 |
-
}
|
423 |
-
}
|
424 |
}
|
425 |
|
426 |
//add_action( 'seedprod_notification', array( 'SeedProd_Notifications', 'update' ) );
|
427 |
-
if (!function_exists('seedprod_lite_do_notifications')) {
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
}
|
436 |
}
|
5 |
*
|
6 |
* @since 7.10.5
|
7 |
*/
|
8 |
+
if ( ! class_exists( 'SeedProd_Notifications' ) ) {
|
9 |
+
class SeedProd_Notifications {
|
10 |
+
|
11 |
+
protected static $instance = null;
|
12 |
+
/**
|
13 |
+
* Source of notifications content.
|
14 |
+
*
|
15 |
+
* @since {VERSION}
|
16 |
+
*
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
const SOURCE_URL = 'https://seedprod-notifications.s3.amazonaws.com/sp-notifications.json';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Option value.
|
23 |
+
*
|
24 |
+
* @since {VERSION}
|
25 |
+
*
|
26 |
+
* @var bool|array
|
27 |
+
*/
|
28 |
+
public $option = false;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* The name of the option used to store the data.
|
32 |
+
*
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
public $option_name = 'seedprod_notifications';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Return an instance of this class.
|
39 |
+
*/
|
40 |
+
public static function get_instance() {
|
41 |
+
|
42 |
+
// If the single instance hasn't been set, set it now.
|
43 |
+
if ( null == self::$instance ) {
|
44 |
+
self::$instance = new self();
|
45 |
+
}
|
46 |
+
|
47 |
+
return self::$instance;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* SeedProd_Notifications constructor.
|
52 |
+
*/
|
53 |
+
public function __construct() {
|
54 |
+
$this->init();
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Initialize class.
|
59 |
+
*
|
60 |
+
* @since {VERSION}
|
61 |
+
*/
|
62 |
+
public function init() {
|
63 |
+
$this->hooks();
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Register hooks.
|
68 |
+
*
|
69 |
+
* @since {VERSION}
|
70 |
+
*/
|
71 |
+
public function hooks() {
|
72 |
+
add_action( 'wp_ajax_seedprod_lite_notification_dismiss', array( $this, 'dismiss' ) );
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Check if user has access and is enabled.
|
77 |
+
*
|
78 |
+
* @return bool
|
79 |
+
* @since {VERSION}
|
80 |
+
*
|
81 |
+
*/
|
82 |
+
public function has_access() {
|
83 |
+
$access = true;
|
84 |
+
|
85 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
86 |
+
$access = true;
|
87 |
+
}
|
88 |
+
|
89 |
+
return apply_filters( 'seedprod_admin_notifications_has_access', $access );
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get option value.
|
94 |
+
*
|
95 |
+
* @param bool $cache Reference property cache if available.
|
96 |
+
*
|
97 |
+
* @return array
|
98 |
+
* @since {VERSION}
|
99 |
+
*
|
100 |
+
*/
|
101 |
+
public function get_option( $cache = true ) {
|
102 |
+
if ( $this->option && $cache ) {
|
103 |
+
return $this->option;
|
104 |
+
}
|
105 |
+
|
106 |
+
$option = get_option( $this->option_name, array() );
|
107 |
+
|
108 |
+
$this->option = array(
|
109 |
+
'update' => ! empty( $option['update'] ) ? $option['update'] : 0,
|
110 |
+
'events' => ! empty( $option['events'] ) ? $option['events'] : array(),
|
111 |
+
'feed' => ! empty( $option['feed'] ) ? $option['feed'] : array(),
|
112 |
+
'dismissed' => ! empty( $option['dismissed'] ) ? $option['dismissed'] : array(),
|
113 |
+
);
|
114 |
+
|
115 |
+
return $this->option;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Fetch notifications from feed.
|
120 |
+
*
|
121 |
+
* @return array
|
122 |
+
* @since {VERSION}
|
123 |
+
*
|
124 |
+
*/
|
125 |
+
public function fetch_feed() {
|
126 |
+
$res = wp_remote_get( self::SOURCE_URL );
|
127 |
+
|
128 |
+
if ( is_wp_error( $res ) ) {
|
129 |
+
return array();
|
130 |
+
}
|
131 |
+
|
132 |
+
$body = wp_remote_retrieve_body( $res );
|
133 |
+
|
134 |
+
if ( empty( $body ) ) {
|
135 |
+
return array();
|
136 |
+
}
|
137 |
+
|
138 |
+
return $this->verify( json_decode( $body, true ) );
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Verify notification data before it is saved.
|
143 |
+
*
|
144 |
+
* @param array $notifications Array of notifications items to verify.
|
145 |
+
*
|
146 |
+
* @return array
|
147 |
+
* @since {VERSION}
|
148 |
+
*
|
149 |
+
*/
|
150 |
+
public function verify( $notifications ) { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
|
151 |
+
|
152 |
+
$data = array();
|
153 |
+
|
154 |
+
if ( ! is_array( $notifications ) || empty( $notifications ) ) {
|
155 |
+
return $data;
|
156 |
+
}
|
157 |
+
|
158 |
+
$option = $this->get_option();
|
159 |
+
|
160 |
+
foreach ( $notifications as $notification ) {
|
161 |
+
|
162 |
+
// The message and license should never be empty, if they are, ignore.
|
163 |
+
if ( empty( $notification['content'] ) || empty( $notification['type'] ) ) {
|
164 |
+
continue;
|
165 |
+
}
|
166 |
+
|
167 |
+
// Ignore if license type does not match.
|
168 |
+
$license_name = get_option( 'seedprod_license_name' );
|
169 |
+
if ( empty( $license_name ) ) {
|
170 |
+
$license_name = 'unlicensed';
|
171 |
+
}
|
172 |
+
if ( ! in_array( 'any', $notification['type'] ) ) {
|
173 |
+
if ( ! in_array( $license_name, $notification['type'] ) ) {
|
174 |
+
continue;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
// Ignore if expired.
|
179 |
+
if ( ! empty( $notification['end'] ) && time() > strtotime( $notification['end'] ) ) {
|
180 |
+
continue;
|
181 |
+
}
|
182 |
+
|
183 |
+
// Ignore if notification has already been dismissed.
|
184 |
+
if ( ! empty( $option['dismissed'] ) && in_array( $notification['id'], $option['dismissed'] ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
185 |
+
continue;
|
186 |
+
}
|
187 |
+
|
188 |
+
// Ignore if notification existed before installing SeedProd.
|
189 |
+
// Prevents bombarding the user with notifications after activation.
|
190 |
+
$over_time = get_option( 'seedprod_over_time', array() );
|
191 |
+
|
192 |
+
if (
|
193 |
+
! empty( $over_time['installed_date'] ) &&
|
194 |
+
! empty( $notification['start'] ) &&
|
195 |
+
$over_time['installed_date'] > strtotime( $notification['start'] )
|
196 |
+
) {
|
197 |
+
//continue;
|
198 |
+
}
|
199 |
+
|
200 |
+
$data[] = $notification;
|
201 |
+
}
|
202 |
+
|
203 |
+
return $data;
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Verify saved notification data for active notifications.
|
208 |
+
*
|
209 |
+
* @param array $notifications Array of notifications items to verify.
|
210 |
+
*
|
211 |
+
* @return array
|
212 |
+
* @since {VERSION}
|
213 |
+
*
|
214 |
+
*/
|
215 |
+
public function verify_active( $notifications ) {
|
216 |
+
if ( ! is_array( $notifications ) || empty( $notifications ) ) {
|
217 |
+
return array();
|
218 |
+
}
|
219 |
+
|
220 |
+
// Remove notifications that are not active.
|
221 |
+
foreach ( $notifications as $key => $notification ) {
|
222 |
+
if (
|
223 |
+
( ! empty( $notification['start'] ) && time() < strtotime( $notification['start'] ) ) ||
|
224 |
+
( ! empty( $notification['end'] ) && time() > strtotime( $notification['end'] ) )
|
225 |
+
) {
|
226 |
+
unset( $notifications[ $key ] );
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
return $notifications;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Get notification data.
|
235 |
+
*
|
236 |
+
* @return array
|
237 |
+
* @since {VERSION}
|
238 |
+
*
|
239 |
+
*/
|
240 |
+
public function get() {
|
241 |
+
if ( ! $this->has_access() ) {
|
242 |
+
return array();
|
243 |
+
}
|
244 |
+
|
245 |
+
$option = $this->get_option();
|
246 |
+
|
247 |
+
$events = ! empty( $option['events'] ) ? $this->verify_active( $option['events'] ) : array();
|
248 |
+
$feed = ! empty( $option['feed'] ) ? $this->verify_active( $option['feed'] ) : array();
|
249 |
+
|
250 |
+
return array_merge( $events, $feed );
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Get notification count.
|
255 |
+
*
|
256 |
+
* @return int
|
257 |
+
* @since {VERSION}
|
258 |
+
*
|
259 |
+
*/
|
260 |
+
public function get_count() {
|
261 |
+
$count = count( $this->get() );
|
262 |
+
|
263 |
+
return $count;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Add a manual notification event.
|
268 |
+
*
|
269 |
+
* @param array $notification Notification data.
|
270 |
+
*
|
271 |
+
* @since {VERSION}
|
272 |
+
*
|
273 |
+
*/
|
274 |
+
public function add( $notification ) {
|
275 |
+
if ( empty( $notification['id'] ) ) {
|
276 |
+
return;
|
277 |
+
}
|
278 |
+
|
279 |
+
$option = $this->get_option();
|
280 |
+
|
281 |
+
if ( in_array( $notification['id'], $option['dismissed'] ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
282 |
+
return;
|
283 |
+
}
|
284 |
+
|
285 |
+
foreach ( $option['events'] as $item ) {
|
286 |
+
if ( $item['id'] === $notification['id'] ) {
|
287 |
+
return;
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
$notification = $this->verify( array( $notification ) );
|
292 |
+
|
293 |
+
update_option(
|
294 |
+
$this->option_name,
|
295 |
+
array(
|
296 |
+
'update' => $option['update'],
|
297 |
+
'feed' => $option['feed'],
|
298 |
+
'events' => array_merge( $notification, $option['events'] ),
|
299 |
+
'dismissed' => $option['dismissed'],
|
300 |
+
)
|
301 |
+
);
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Update notification data from feed.
|
306 |
+
*
|
307 |
+
* @since {VERSION}
|
308 |
+
*/
|
309 |
+
public function update() {
|
310 |
+
$feed = $this->fetch_feed();
|
311 |
+
$option = $this->get_option();
|
312 |
+
|
313 |
+
update_option(
|
314 |
+
$this->option_name,
|
315 |
+
array(
|
316 |
+
'update' => time(),
|
317 |
+
'feed' => $feed,
|
318 |
+
'events' => $option['events'],
|
319 |
+
'dismissed' => $option['dismissed'],
|
320 |
+
)
|
321 |
+
);
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Dismiss notification via AJAX.
|
326 |
+
*
|
327 |
+
* @since {VERSION}
|
328 |
+
*/
|
329 |
+
public function dismiss() {
|
330 |
+
|
331 |
+
// Run a security check.
|
332 |
+
check_ajax_referer( 'seedprod_lite_notification_dismiss', '_wpnonce' );
|
333 |
+
|
334 |
+
// Check for access and required param.
|
335 |
+
if ( ! $this->has_access() || empty( $_POST['id'] ) ) {
|
336 |
+
wp_send_json_error();
|
337 |
+
}
|
338 |
+
|
339 |
+
$id = sanitize_text_field( wp_unslash( $_POST['id'] ) );
|
340 |
+
$option = $this->get_option();
|
341 |
+
$type = is_numeric( $id ) ? 'feed' : 'events';
|
342 |
+
|
343 |
+
$option['dismissed'][] = $id;
|
344 |
+
$option['dismissed'] = array_unique( $option['dismissed'] );
|
345 |
+
|
346 |
+
// Remove notification.
|
347 |
+
if ( is_array( $option[ $type ] ) && ! empty( $option[ $type ] ) ) {
|
348 |
+
foreach ( $option[ $type ] as $key => $notification ) {
|
349 |
+
if ( $notification['id'] == $id ) { // phpcs:ignore WordPress.PHP.StrictComparisons
|
350 |
+
unset( $option[ $type ][ $key ] );
|
351 |
+
break;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
}
|
355 |
+
|
356 |
+
update_option( $this->option_name, $option );
|
357 |
+
|
358 |
+
wp_send_json_success();
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* This generates the markup for the notifications indicator if needed.
|
363 |
+
*
|
364 |
+
* @return string
|
365 |
+
*/
|
366 |
+
public function get_menu_count() {
|
367 |
+
if ( $this->get_count() > 0 ) {
|
368 |
+
return '<span class="seedprod-menu-notification-indicator"></span>';
|
369 |
+
}
|
370 |
+
|
371 |
+
return '';
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Retrieve the notifications via an ajax call.
|
376 |
+
*/
|
377 |
+
public function ajax_get_notifications() {
|
378 |
+
|
379 |
+
// Run a security check.
|
380 |
+
check_ajax_referer( 'sp-admin-nonce', 'nonce' );
|
381 |
+
|
382 |
+
$notifications_data = array(
|
383 |
+
'notifications' => $this->get(),
|
384 |
+
'view_url' => $this->get_view_url(),
|
385 |
+
);
|
386 |
+
|
387 |
+
wp_send_json_success( $notifications_data );
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Get the URL for the page where users can see/read notifications.
|
392 |
+
*
|
393 |
+
* @return string
|
394 |
+
*/
|
395 |
+
public function get_view_url() {
|
396 |
+
$disabled = get_option( 'dashboards_disabled', false );
|
397 |
+
|
398 |
+
$url = add_query_arg( 'page', 'seedprod_reports', admin_url( 'admin.php' ) );
|
399 |
+
|
400 |
+
if ( false !== $disabled ) {
|
401 |
+
$url = is_multisite() ? network_admin_url( 'admin.php?page=seedprod_network' ) : admin_url( 'admin.php?page=seedprod_settings' );
|
402 |
+
}
|
403 |
+
|
404 |
+
return $url;
|
405 |
+
}
|
406 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
}
|
408 |
|
409 |
//add_action( 'seedprod_notification', array( 'SeedProd_Notifications', 'update' ) );
|
410 |
+
if ( ! function_exists( 'seedprod_lite_do_notifications' ) ) {
|
411 |
+
|
412 |
+
add_action( 'seedprod_notifications', 'seedprod_lite_do_notifications' );
|
413 |
+
function seedprod_lite_do_notifications() {
|
414 |
+
$notifications = new SeedProd_Notifications();
|
415 |
+
$notifications->update();
|
416 |
+
|
417 |
+
}
|
|
|
418 |
}
|
app/render-csp-mm.php
CHANGED
@@ -4,320 +4,304 @@
|
|
4 |
*/
|
5 |
|
6 |
|
7 |
-
class seedprod_lite_Render
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
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 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
} else {
|
308 |
-
$path = $upload_dir['basedir'].'/seedprod/template-'.$page_id.'/index.php';
|
309 |
-
}
|
310 |
-
|
311 |
-
if (!empty($page->html) && 1 == 0) {
|
312 |
-
echo $page->html;
|
313 |
-
} else {
|
314 |
-
if (file_exists($path)) {
|
315 |
-
require_once($path);
|
316 |
-
} else {
|
317 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/seedprod-preview.php');
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
exit();
|
322 |
-
}
|
323 |
}
|
4 |
*/
|
5 |
|
6 |
|
7 |
+
class seedprod_lite_Render {
|
8 |
+
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Instance of this class.
|
12 |
+
*
|
13 |
+
* @since 1.0.0
|
14 |
+
*
|
15 |
+
* @var object
|
16 |
+
*/
|
17 |
+
protected static $instance = null;
|
18 |
+
private $path = null;
|
19 |
+
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
// exit if preview
|
23 |
+
if ( ! empty( $_GET['post_type'] ) && ! empty( $_GET['preview'] ) && $_GET['post_type'] == 'seedprod' && $_GET['preview'] == 'true' ) {
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( ! seedprod_lite_cu( 'none' ) ) {
|
28 |
+
$ts = get_option( 'seedprod_settings' );
|
29 |
+
if ( ! empty( $ts ) ) {
|
30 |
+
$seedprod_settings = json_decode( $ts, true );
|
31 |
+
if ( ! empty( $seedprod_settings ) ) {
|
32 |
+
extract( $seedprod_settings );
|
33 |
+
}
|
34 |
+
} else {
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
// Actions & Filters if the landing page is active or being previewed
|
39 |
+
if ( ! empty( $seedprod_settings['enable_coming_soon_mode'] ) || ! empty( $seedprod_settings['enable_maintenance_mode'] ) ) {
|
40 |
+
if ( function_exists( 'bp_is_active' ) ) {
|
41 |
+
add_action( 'template_redirect', array( &$this, 'render_comingsoon_page' ), 9 );
|
42 |
+
} else {
|
43 |
+
$priority = 10;
|
44 |
+
if ( function_exists( 'tve_frontend_enqueue_scripts' ) ) {
|
45 |
+
$priority = 8;
|
46 |
+
}
|
47 |
+
// FreshFramework
|
48 |
+
if ( class_exists( 'ffFrameworkVersionManager' ) ) {
|
49 |
+
$priority = 1;
|
50 |
+
}
|
51 |
+
// Seoframwork
|
52 |
+
if ( function_exists( 'the_seo_framework_pre_load' ) ) {
|
53 |
+
$priority = 1;
|
54 |
+
}
|
55 |
+
// jetpack subscribe
|
56 |
+
if ( isset( $_REQUEST['jetpack_subscriptions_widget'] ) ) {
|
57 |
+
$priority = 11;
|
58 |
+
}
|
59 |
+
|
60 |
+
// show legacy versions if we need to
|
61 |
+
#TODO Check if coming soon mode or mm mode and import settings
|
62 |
+
$seedprod_show_csp4 = get_option( 'seedprod_show_csp4' );
|
63 |
+
$seedprod_show_cspv5 = get_option( 'seedprod_show_cspv5' );
|
64 |
+
if ( $seedprod_show_cspv5 ) {
|
65 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/backwards/cspv5-functions.php';
|
66 |
+
add_action( 'template_redirect', 'seedprod_lite_cspv5_render_comingsoon_page', $priority );
|
67 |
+
} elseif ( $seedprod_show_csp4 ) {
|
68 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/backwards/csp4-functions.php';
|
69 |
+
add_action( 'template_redirect', 'seedprod_lite_csp4_render_comingsoon_page', $priority );
|
70 |
+
} else {
|
71 |
+
add_action( 'template_redirect', array( &$this, 'render_comingsoon_page' ), $priority );
|
72 |
+
}
|
73 |
+
|
74 |
+
add_action( 'admin_bar_menu', 'seedprod_lite_admin_bar_menu', 999 );
|
75 |
+
}
|
76 |
+
add_action( 'init', array( &$this, 'remove_ngg_print_scripts' ) );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
// enable /disable coming soon/maintenanace mode
|
81 |
+
add_action( 'init', array( &$this, 'csp_mm_api' ) );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Return an instance of this class.
|
86 |
+
*/
|
87 |
+
public static function get_instance() {
|
88 |
+
|
89 |
+
// If the single instance hasn't been set, set it now.
|
90 |
+
if ( null == self::$instance ) {
|
91 |
+
self::$instance = new self();
|
92 |
+
}
|
93 |
+
|
94 |
+
return self::$instance;
|
95 |
+
}
|
96 |
+
|
97 |
+
public function remove_ngg_print_scripts() {
|
98 |
+
if ( class_exists( 'C_Photocrati_Resource_Manager' ) ) {
|
99 |
+
remove_all_actions( 'wp_print_footer_scripts', 1 );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* coming soon mode/maintence mode api
|
108 |
+
* mode 0 /disable 1/ coming soon mode 2/maintenance mode
|
109 |
+
* curl http://wordpress.dev/?seed_cspv5_token=4b51fd72-69b7-4796-8d24-f3499c2ec44b&seed_cspv5_mode=1
|
110 |
+
*/
|
111 |
+
public function csp_mm_api() {
|
112 |
+
$seedprod_api_key = '';
|
113 |
+
if ( defined( 'SEEDPROD_API_KEY' ) ) {
|
114 |
+
$seedprod_api_key = SEEDPROD_API_KEY;
|
115 |
+
}
|
116 |
+
if ( empty( $seedprod_api_key ) ) {
|
117 |
+
$seedprod_api_key = get_option( 'seedprod_api_key' );
|
118 |
+
}
|
119 |
+
if ( ! empty( $seedprod_api_key ) ) {
|
120 |
+
if ( isset( $_REQUEST['seedprod_token'] ) && $_REQUEST['seedprod_token'] == $seedprod_api_key ) {
|
121 |
+
if ( isset( $_REQUEST['seedprod_mode'] ) ) {
|
122 |
+
$mode = $_REQUEST['seedprod_mode'];
|
123 |
+
$ts = get_option( 'seedprod_settings' );
|
124 |
+
$seedprod_settings = json_decode( $ts, true );
|
125 |
+
|
126 |
+
if ( ! empty( $seedprod_settings ) ) {
|
127 |
+
if ( $mode == 0 ) {
|
128 |
+
|
129 |
+
echo '0';
|
130 |
+
$seedprod_settings['enable_coming_soon_mode'] = false;
|
131 |
+
$seedprod_settings['enable_maintenance_mode'] = false;
|
132 |
+
|
133 |
+
} elseif ( $mode == 1 ) {
|
134 |
+
|
135 |
+
echo '1';
|
136 |
+
$seedprod_settings['enable_coming_soon_mode'] = true;
|
137 |
+
$seedprod_settings['enable_maintenance_mode'] = false;
|
138 |
+
|
139 |
+
} elseif ( $mode == 2 ) {
|
140 |
+
|
141 |
+
echo '2';
|
142 |
+
$seedprod_settings['enable_coming_soon_mode'] = false;
|
143 |
+
$seedprod_settings['enable_maintenance_mode'] = true;
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
update_option( 'seedprod_settings', json_encode( $seedprod_settings ) );
|
148 |
+
exit();
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Display the coming soon/ maintenance mode page
|
162 |
+
*/
|
163 |
+
public function render_comingsoon_page() {
|
164 |
+
|
165 |
+
// Top Level Settings
|
166 |
+
$ts = get_option( 'seedprod_settings' );
|
167 |
+
$seedprod_settings = json_decode( $ts );
|
168 |
+
|
169 |
+
// Page Info
|
170 |
+
$page_id = 0;
|
171 |
+
|
172 |
+
//Get Coming Soon Page Id
|
173 |
+
if ( ! empty( $seedprod_settings->enable_coming_soon_mode ) ) {
|
174 |
+
$page_id = get_option( 'seedprod_coming_soon_page_id' );
|
175 |
+
} elseif ( ! empty( $seedprod_settings->enable_maintenance_mode ) ) {
|
176 |
+
$page_id = get_option( 'seedprod_maintenance_mode_page_id' );
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( empty( $page_id ) ) {
|
180 |
+
wp_die( 'Your Coming Soon or Maintenance page needs to be setup.' );
|
181 |
+
}
|
182 |
+
|
183 |
+
// Get Page
|
184 |
+
global $wpdb;
|
185 |
+
$tablename = $wpdb->prefix . 'posts';
|
186 |
+
$sql = "SELECT * FROM $tablename WHERE id= %d";
|
187 |
+
$safe_sql = $wpdb->prepare( $sql, absint( $page_id ) );
|
188 |
+
$page = $wpdb->get_row( $safe_sql );
|
189 |
+
|
190 |
+
$settings = json_decode( $page->post_content_filtered );
|
191 |
+
|
192 |
+
// redirect mode
|
193 |
+
$enable_redirect_mode = false;
|
194 |
+
$redirect_url = $settings->redirect_url;
|
195 |
+
if ( ! empty( $settings->redirect_mode ) ) {
|
196 |
+
$enable_redirect_mode = true;
|
197 |
+
}
|
198 |
+
if ( empty( $redirect_url ) ) {
|
199 |
+
$enable_redirect_mode = false;
|
200 |
+
}
|
201 |
+
|
202 |
+
|
203 |
+
// Exit if a custom login page
|
204 |
+
if ( ! empty( $settings->disable_default_excluded_urls ) ) {
|
205 |
+
if ( preg_match( '/privacy|imprint|login|admin|dashboard|account/i', $_SERVER['REQUEST_URI'] ) > 0 ) {
|
206 |
+
return false;
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
//Exit if wysija double opt-in
|
211 |
+
if ( isset( $emaillist ) && $emaillist == 'wysija' && preg_match( '/wysija/i', $_SERVER['REQUEST_URI'] ) > 0 ) {
|
212 |
+
return false;
|
213 |
+
}
|
214 |
+
|
215 |
+
if ( isset( $emaillist ) && $emaillist == 'mailpoet' && preg_match( '/mailpoet/i', $_SERVER['REQUEST_URI'] ) > 0 ) {
|
216 |
+
return false;
|
217 |
+
}
|
218 |
+
|
219 |
+
if ( isset( $emaillist ) && $emaillist == 'mymail' && preg_match( '/confirm/i', $_SERVER['REQUEST_URI'] ) > 0 ) {
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
|
223 |
+
//Limit access by role
|
224 |
+
if ( ! empty( $settings->access_by_role ) && ! isset( $_COOKIE['wp-seedprod-bypass'] ) ) {
|
225 |
+
foreach ( $settings->access_by_role as $v ) {
|
226 |
+
$v = str_replace( ' ', '', strtolower( $v ) );
|
227 |
+
if ( $v == 'anyoneloggedin' && is_user_logged_in() ) {
|
228 |
+
return false;
|
229 |
+
}
|
230 |
+
if ( current_user_can( $v ) ) {
|
231 |
+
return false;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
} elseif ( is_user_logged_in() ) {
|
235 |
+
return false;
|
236 |
+
}
|
237 |
+
|
238 |
+
// Finally check if we should show the coming soon page.
|
239 |
+
// do not cache this page
|
240 |
+
if ( ! defined( 'DONOTCACHEPAGE' ) ) {
|
241 |
+
define( 'DONOTCACHEPAGE', true );
|
242 |
+
}
|
243 |
+
if ( ! defined( 'DONOTCDN' ) ) {
|
244 |
+
define( 'DONOTCDN', true );
|
245 |
+
}
|
246 |
+
if ( ! defined( 'DONOTCACHEDB' ) ) {
|
247 |
+
define( 'DONOTCACHEDB', true );
|
248 |
+
}
|
249 |
+
if ( ! defined( 'DONOTMINIFY' ) ) {
|
250 |
+
define( 'DONOTMINIFY', true );
|
251 |
+
}
|
252 |
+
if ( ! defined( 'DONOTCACHEOBJECT' ) ) {
|
253 |
+
define( 'DONOTCACHEOBJECT', true );
|
254 |
+
}
|
255 |
+
nocache_headers();
|
256 |
+
|
257 |
+
// set headers
|
258 |
+
if ( ! empty( $seedprod_settings->enable_maintenance_mode ) ) {
|
259 |
+
if ( empty( $settings ) ) {
|
260 |
+
echo __( 'Please create your Maintenance Page in the plugin settings.', 'seedprod-coming-soon-pro' );
|
261 |
+
exit();
|
262 |
+
}
|
263 |
+
header( 'HTTP/1.1 503 Service Temporarily Unavailable' );
|
264 |
+
header( 'Status: 503 Service Temporarily Unavailable' );
|
265 |
+
header( 'Retry-After: 86400' ); // retry in a day
|
266 |
+
} elseif ( ! empty( $enable_redirect_mode ) ) {
|
267 |
+
if ( ! empty( $redirect_url ) ) {
|
268 |
+
wp_redirect( $redirect_url );
|
269 |
+
exit;
|
270 |
+
} else {
|
271 |
+
echo __( 'Please create enter your redirect url in the plugin settings.', 'seedprod-coming-soon-pro' );
|
272 |
+
exit();
|
273 |
+
}
|
274 |
+
} else {
|
275 |
+
if ( empty( $settings ) ) {
|
276 |
+
echo __( 'Please create your Coming Soon Page in the plugin settings.', 'seedprod-coming-soon-pro' );
|
277 |
+
exit();
|
278 |
+
}
|
279 |
+
header( 'HTTP/1.1 200 OK' );
|
280 |
+
|
281 |
+
}
|
282 |
+
|
283 |
+
if ( is_feed() ) {
|
284 |
+
header( 'Content-Type: text/html; charset=UTF-8' );
|
285 |
+
}
|
286 |
+
|
287 |
+
// keep for backwards compatability
|
288 |
+
$upload_dir = wp_upload_dir();
|
289 |
+
if ( is_multisite() ) {
|
290 |
+
$path = $upload_dir['baseurl'] . '/seedprod/' . get_current_blog_id() . '/template-' . $page_id . '/index.php';
|
291 |
+
} else {
|
292 |
+
$path = $upload_dir['basedir'] . '/seedprod/template-' . $page_id . '/index.php';
|
293 |
+
}
|
294 |
+
|
295 |
+
if ( ! empty( $page->html ) && 1 == 0 ) {
|
296 |
+
echo $page->html;
|
297 |
+
} else {
|
298 |
+
if ( file_exists( $path ) ) {
|
299 |
+
require_once $path;
|
300 |
+
} else {
|
301 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/seedprod-preview.php';
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
exit();
|
306 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
app/render-lp.php
CHANGED
@@ -4,35 +4,35 @@
|
|
4 |
*/
|
5 |
|
6 |
//add_action('template_include', 'seedprod_lppage_render');
|
7 |
-
add_filter( 'template_include','seedprod_lite_lppage_render');
|
8 |
|
9 |
-
function seedprod_lite_lppage_render($template){
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
}
|
22 |
|
23 |
// clean theme styles on our custom landing pages
|
24 |
|
25 |
-
function seedprod_lite_deregister_styles(){
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
};
|
37 |
|
38 |
|
4 |
*/
|
5 |
|
6 |
//add_action('template_include', 'seedprod_lppage_render');
|
7 |
+
add_filter( 'template_include', 'seedprod_lite_lppage_render' );
|
8 |
|
9 |
+
function seedprod_lite_lppage_render( $template ) {
|
10 |
+
global $post;
|
11 |
+
if ( ! empty( $post ) ) {
|
12 |
+
$has_settings = get_post_meta( $post->ID, '_seedprod_page', true );
|
13 |
|
14 |
+
if ( ! empty( $has_settings ) && $post->post_type = 'page' ) {
|
15 |
|
16 |
+
$template = SEEDPROD_PLUGIN_PATH . 'resources/views/seedprod-preview.php';
|
17 |
+
add_action( 'wp_enqueue_scripts', 'seedprod_lite_deregister_styles', PHP_INT_MAX );
|
18 |
+
}
|
19 |
+
}
|
20 |
+
return $template;
|
21 |
}
|
22 |
|
23 |
// clean theme styles on our custom landing pages
|
24 |
|
25 |
+
function seedprod_lite_deregister_styles() {
|
26 |
+
global $wp_styles;
|
27 |
+
//var_dump($wp_styles->registered);
|
28 |
+
foreach ( $wp_styles->queue as $handle ) {
|
29 |
+
//echo '<br> '.$handle;
|
30 |
+
if ( strpos( $wp_styles->registered[ $handle ]->src, 'wp-content/themes' ) !== false ) {
|
31 |
+
//var_dump($wp_styles->registered[$handle]->src);
|
32 |
+
wp_dequeue_style( $handle );
|
33 |
+
wp_deregister_style( $handle );
|
34 |
+
}
|
35 |
+
}
|
36 |
};
|
37 |
|
38 |
|
app/review.php
CHANGED
@@ -32,7 +32,7 @@ class seedprod_lite_Review {
|
|
32 |
|
33 |
// If the user has opted out of product annoucement notifications, don't
|
34 |
// display the review request.
|
35 |
-
if ( get_option( 'seedprod_hide_review') ) {
|
36 |
return;
|
37 |
}
|
38 |
// Verify that we can do a check for reviews.
|
@@ -69,13 +69,13 @@ class seedprod_lite_Review {
|
|
69 |
public function review() {
|
70 |
// Fetch when plugin was initially installed.
|
71 |
$activated = get_option( 'seedprod_over_time', array() );
|
72 |
-
if ( ! empty( $activated['installed_date'] )) {
|
73 |
//Only continue if plugin has been installed for at least 7 days.
|
74 |
if ( ( $activated['installed_date'] + ( DAY_IN_SECONDS * 7 ) ) > time() ) {
|
75 |
return;
|
76 |
}
|
77 |
// only if version great than or = to 6.0.8.5
|
78 |
-
if(!empty($activated['installed_version']) && version_compare
|
79 |
return;
|
80 |
}
|
81 |
} else {
|
@@ -86,10 +86,9 @@ class seedprod_lite_Review {
|
|
86 |
|
87 |
update_option( 'seedprod_over_time', $data );
|
88 |
return;
|
89 |
-
|
90 |
-
|
91 |
|
92 |
-
|
93 |
// We have a candidate! Output a review message.
|
94 |
?>
|
95 |
<div class="notice notice-info is-dismissible seedprod-review-notice">
|
@@ -159,4 +158,4 @@ class seedprod_lite_Review {
|
|
159 |
die;
|
160 |
}
|
161 |
}
|
162 |
-
new seedprod_lite_Review;
|
32 |
|
33 |
// If the user has opted out of product annoucement notifications, don't
|
34 |
// display the review request.
|
35 |
+
if ( get_option( 'seedprod_hide_review' ) ) {
|
36 |
return;
|
37 |
}
|
38 |
// Verify that we can do a check for reviews.
|
69 |
public function review() {
|
70 |
// Fetch when plugin was initially installed.
|
71 |
$activated = get_option( 'seedprod_over_time', array() );
|
72 |
+
if ( ! empty( $activated['installed_date'] ) ) {
|
73 |
//Only continue if plugin has been installed for at least 7 days.
|
74 |
if ( ( $activated['installed_date'] + ( DAY_IN_SECONDS * 7 ) ) > time() ) {
|
75 |
return;
|
76 |
}
|
77 |
// only if version great than or = to 6.0.8.5
|
78 |
+
if ( ! empty( $activated['installed_version'] ) && version_compare( $activated['installed_version'], '6.0.8.5' ) < 0 ) {
|
79 |
return;
|
80 |
}
|
81 |
} else {
|
86 |
|
87 |
update_option( 'seedprod_over_time', $data );
|
88 |
return;
|
89 |
+
}
|
|
|
90 |
|
91 |
+
$feedback_url = 'https://www.seedprod.com/plugin-feedback/?utm_source=liteplugin&utm_medium=review-notice&utm_campaign=feedback&utm_content=' . SEEDPROD_VERSION;
|
92 |
// We have a candidate! Output a review message.
|
93 |
?>
|
94 |
<div class="notice notice-info is-dismissible seedprod-review-notice">
|
158 |
die;
|
159 |
}
|
160 |
}
|
161 |
+
new seedprod_lite_Review();
|
app/routes.php
CHANGED
@@ -12,282 +12,295 @@
|
|
12 |
*/
|
13 |
|
14 |
|
15 |
-
add_action('admin_menu', 'seedprod_lite_create_menus');
|
16 |
-
|
17 |
-
function seedprod_lite_create_menus()
|
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 |
-
add_action('admin_head', 'seedprod_lite_remove_menus');
|
143 |
|
144 |
-
function seedprod_lite_remove_menus()
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
remove_submenu_page('seedprod_lite', 'sp_pro_debug');
|
150 |
}
|
151 |
|
152 |
-
function seedprod_lite_importexport_page()
|
153 |
-
|
154 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/importexport.php');
|
155 |
}
|
156 |
|
157 |
-
function seedprod_lite_debug_page()
|
158 |
-
|
159 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/debug.php');
|
160 |
}
|
161 |
|
162 |
-
function seedprod_lite_dashboard_page()
|
163 |
-
|
164 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/dashboard.php');
|
165 |
}
|
166 |
|
167 |
|
168 |
-
function seedprod_lite_builder_page()
|
169 |
-
|
170 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/builder.php');
|
171 |
}
|
172 |
|
173 |
-
function seedprod_lite_template_page()
|
174 |
-
|
175 |
-
require_once(SEEDPROD_PLUGIN_PATH.'resources/views/builder.php');
|
176 |
}
|
177 |
|
178 |
|
179 |
/* Short circuit new request */
|
180 |
|
181 |
-
add_action('admin_init', 'seedprod_lite_new_lpage', 1);
|
182 |
|
183 |
|
184 |
/* Redirect to SPA */
|
185 |
|
186 |
-
add_action('admin_init', 'seedprod_lite_redirect_to_site', 1);
|
187 |
-
|
188 |
-
function seedprod_lite_redirect_to_site()
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
225 |
}
|
226 |
|
227 |
/**
|
228 |
* Ajax Request Routes
|
229 |
*/
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
240 |
|
241 |
-
|
242 |
|
243 |
-
|
244 |
|
245 |
-
|
|
|
246 |
|
247 |
-
|
248 |
-
add_action('wp_ajax_seedprod_lite_save_api_key', 'seedprod_lite_save_api_key');
|
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 |
-
|
275 |
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
|
281 |
-
|
282 |
-
|
283 |
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
|
289 |
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
|
293 |
|
@@ -299,76 +312,215 @@ if (defined('DOING_AJAX')) {
|
|
299 |
|
300 |
|
301 |
|
302 |
-
function seedprod_lite_get_wpforms()
|
303 |
-
{
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
}
|
317 |
|
318 |
-
|
319 |
-
|
320 |
}
|
321 |
|
322 |
function seedprod_lite_get_wpform() {
|
323 |
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
function seedprod_lite_get_rafflepress()
|
338 |
-
{
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
}
|
354 |
}
|
355 |
|
356 |
function seedprod_lite_get_rafflepress_code() {
|
357 |
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
</div>
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
|
12 |
*/
|
13 |
|
14 |
|
15 |
+
add_action( 'admin_menu', 'seedprod_lite_create_menus' );
|
16 |
+
|
17 |
+
function seedprod_lite_create_menus() {
|
18 |
+
// get notifications count
|
19 |
+
$notification = '';
|
20 |
+
$n = new SeedProd_Notifications();
|
21 |
+
$notifications_count = $n->get_count();
|
22 |
+
if ( ! empty( $notifications_count ) ) {
|
23 |
+
$notification = '<div class="seedprod-menu-notification-counter"><span>' . $notifications_count . '</span></div>';
|
24 |
+
}
|
25 |
+
|
26 |
+
add_menu_page(
|
27 |
+
'SeedProd',
|
28 |
+
'SeedProd' . $notification,
|
29 |
+
apply_filters( 'seedprod_main_menu_capability', 'edit_others_posts' ),
|
30 |
+
'seedprod_lite',
|
31 |
+
'seedprod_lite_dashboard_page',
|
32 |
+
'data:image/svg+xml;base64,' . 'PHN2ZyB3aWR0aD0iMTI1IiBoZWlnaHQ9IjEzMiIgdmlld0JveD0iMCAwIDEyNSAxMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wIDBDMCAwIDIuOTE2NjQgMC4xOTc4OTQgNjIuODIxMiA4LjAyNjgzQzEyMi43MjYgMTUuODU1OCAxNDMuNDU5IDc2LjYwNjQgMTA2Ljc4MSAxMjkuNjI4QzExMi40NTQgODIuMjUyNyAxMDIuMDcgMzMuMTA2MiA2MC4zNjA1IDI3LjM2MDZDMTguNjUwNSAyMS42MTUxIDIyLjI4MzQgMjIuNDk1NCAyMi4yODM0IDIyLjQ5NTRDMjIuMjgzNCAyMi40OTU0IDIyLjk3NDUgMzIuOTI5OSAyNi44ODgzIDYwLjk3OTlDMzAuODAyMSA4OS4wMjk5IDUyLjcwMzUgMTAyLjc4NiA3MS44NzA0IDEwOS44NjhDNzEuODcwNCAxMDkuODY4IDcyLjk5NDUgNzcuMDQwMSA2Mi4zMDA3IDYyLjU5MDlDNTEuNjA2OSA0OC4xNDE4IDM4LjMwMjYgMzguNTQ2IDM4LjMwMjYgMzguNTQ2QzM4LjMwMjYgMzguNTQ2IDY5LjU2OCA0Mi4yOTYgODEuMzcyMiA2NC4xMDE5QzkzLjE3NjQgODUuOTA3OCA5Mi4wMjY1IDEzMiA5Mi4wMjY1IDEzMkw3OS4yOTI1IDEzMS4zNDFDNDUuMDI4NCAxMjcuMjI1IDEzLjAxNzIgMTA2LjU5MSA3LjU3NDIzIDYzLjNDMi4xMzEzIDIwLjAwODggMCAwIDAgMFoiIGZpbGw9ImJsYWNrIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wIDBDMCAwIDIuOTE2NjQgMC4xOTc4OTQgNjIuODIxMiA4LjAyNjgzQzEyMi43MjYgMTUuODU1OCAxNDMuNDU5IDc2LjYwNjQgMTA2Ljc4MSAxMjkuNjI4QzExMi40NTQgODIuMjUyNyAxMDIuMDcgMzMuMTA2MiA2MC4zNjA1IDI3LjM2MDZDMTguNjUwNSAyMS42MTUxIDIyLjI4MzQgMjIuNDk1NCAyMi4yODM0IDIyLjQ5NTRDMjIuMjgzNCAyMi40OTU0IDIyLjk3NDUgMzIuOTI5OSAyNi44ODgzIDYwLjk3OTlDMzAuODAyMSA4OS4wMjk5IDUyLjcwMzUgMTAyLjc4NiA3MS44NzA0IDEwOS44NjhDNzEuODcwNCAxMDkuODY4IDcyLjk5NDUgNzcuMDQwMSA2Mi4zMDA3IDYyLjU5MDlDNTEuNjA2OSA0OC4xNDE4IDM4LjMwMjYgMzguNTQ2IDM4LjMwMjYgMzguNTQ2QzM4LjMwMjYgMzguNTQ2IDY5LjU2OCA0Mi4yOTYgODEuMzcyMiA2NC4xMDE5QzkzLjE3NjQgODUuOTA3OCA5Mi4wMjY1IDEzMiA5Mi4wMjY1IDEzMkw3OS4yOTI1IDEzMS4zNDFDNDUuMDI4NCAxMjcuMjI1IDEzLjAxNzIgMTA2LjU5MSA3LjU3NDIzIDYzLjNDMi4xMzEzIDIwLjAwODggMCAwIDAgMFoiIGZpbGw9IndoaXRlIi8+PC9zdmc+',
|
33 |
+
apply_filters( 'seedprod_top_level_menu_postion', 58 )
|
34 |
+
);
|
35 |
+
|
36 |
+
add_submenu_page(
|
37 |
+
'seedprod_lite',
|
38 |
+
__( 'Pages', 'coming-soon' ),
|
39 |
+
__( 'Pages', 'coming-soon' ),
|
40 |
+
apply_filters( 'seedprod_dashboard_menu_capability', 'edit_others_posts' ),
|
41 |
+
'seedprod_lite',
|
42 |
+
'seedprod_lite_dashboard_page'
|
43 |
+
);
|
44 |
+
|
45 |
+
add_submenu_page(
|
46 |
+
'seedprod_lite',
|
47 |
+
__( 'Templates', 'coming-soon' ),
|
48 |
+
__( 'Templates', 'coming-soon' ),
|
49 |
+
apply_filters( 'seedprod_templates_menu_capability', 'edit_others_posts' ),
|
50 |
+
'seedprod_lite_templates',
|
51 |
+
'seedprod_lite_templates_page'
|
52 |
+
);
|
53 |
+
|
54 |
+
add_submenu_page(
|
55 |
+
'seedprod_lite',
|
56 |
+
__( 'Subscribers', 'coming-soon' ),
|
57 |
+
__( 'Subscribers', 'coming-soon' ),
|
58 |
+
apply_filters( 'seedprod_subscribers_menu_capability', 'edit_others_posts' ),
|
59 |
+
'seedprod_lite_subscribers',
|
60 |
+
'seedprod_lite_subscribers_page'
|
61 |
+
);
|
62 |
+
|
63 |
+
add_submenu_page(
|
64 |
+
'seedprod_lite',
|
65 |
+
__( 'Settings', 'coming-soon' ),
|
66 |
+
__( 'Settings', 'coming-soon' ),
|
67 |
+
apply_filters( 'seedprod_settings_menu_capability', 'edit_others_posts' ),
|
68 |
+
'seedprod_lite_settings',
|
69 |
+
'seedprod_lite_settings_page'
|
70 |
+
);
|
71 |
+
|
72 |
+
add_submenu_page(
|
73 |
+
'seedprod_lite',
|
74 |
+
__( 'Growth Tools', 'coming-soon' ),
|
75 |
+
__( 'Growth Tools', 'coming-soon' ),
|
76 |
+
apply_filters( 'seedprod_growthtools_menu_capability', 'edit_others_posts' ),
|
77 |
+
'seedprod_lite_growth_tools',
|
78 |
+
'seedprod_lite_growth_tools_page'
|
79 |
+
);
|
80 |
+
|
81 |
+
add_submenu_page(
|
82 |
+
'seedprod_lite',
|
83 |
+
__( 'About Us', 'coming-soon' ),
|
84 |
+
__( 'About Us', 'coming-soon' ),
|
85 |
+
apply_filters( 'seedprod_aboutus_menu_capability', 'edit_others_posts' ),
|
86 |
+
'seedprod_lite_about_us',
|
87 |
+
'seedprod_lite_about_us_page'
|
88 |
+
);
|
89 |
+
|
90 |
+
add_submenu_page(
|
91 |
+
'seedprod_lite',
|
92 |
+
__( 'Request a Feature', 'coming-soon' ),
|
93 |
+
'<span id="sp-feature-request">' . __( 'Request a Feature', 'coming-soon' ) . '</span>',
|
94 |
+
apply_filters( 'seedprod_featurerequest_menu_capability', 'edit_others_posts' ),
|
95 |
+
'seedprod_lite_featurerequest',
|
96 |
+
'seedprod_lite_featurerequest_page'
|
97 |
+
);
|
98 |
+
|
99 |
+
if ( SEEDPROD_BUILD == 'lite' ) {
|
100 |
+
add_submenu_page(
|
101 |
+
'seedprod_lite',
|
102 |
+
__( 'Get Pro', 'coming-soon' ),
|
103 |
+
'<span id="sp-lite-admin-menu__upgrade" style="color:#ff845b">' . __( 'Get Pro', 'coming-soon' ) . '</span>',
|
104 |
+
apply_filters( 'seedprod_gopro_menu_capability', 'edit_others_posts' ),
|
105 |
+
'seedprod_lite_get_pro',
|
106 |
+
'seedprod_lite_get_pro_page'
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
add_submenu_page(
|
111 |
+
'seedprod_lite',
|
112 |
+
__( 'Templates', 'coming-soon' ),
|
113 |
+
__( 'Templates', 'coming-soon' ),
|
114 |
+
apply_filters( 'seedprod_templates_menu_capability', 'edit_others_posts' ),
|
115 |
+
'seedprod_lite_template',
|
116 |
+
'seedprod_lite_template_page'
|
117 |
+
);
|
118 |
+
|
119 |
+
add_submenu_page(
|
120 |
+
'seedprod_lite',
|
121 |
+
__( 'Builder', 'coming-soon' ),
|
122 |
+
__( 'Builder', 'coming-soon' ),
|
123 |
+
apply_filters( 'seedprod_builder_menu_capability', 'edit_others_posts' ),
|
124 |
+
'seedprod_lite_builder',
|
125 |
+
'seedprod_lite_builder_page'
|
126 |
+
);
|
127 |
+
|
128 |
+
add_submenu_page(
|
129 |
+
'seedprod_lite',
|
130 |
+
__( 'Import/Export', 'coming-soon' ),
|
131 |
+
__( 'Import/Export', 'coming-soon' ),
|
132 |
+
apply_filters( 'seedprod_exportimport_menu_capability', 'edit_others_posts' ),
|
133 |
+
'sp_pro_importexport',
|
134 |
+
'seedprod_lite_importexport_page'
|
135 |
+
);
|
136 |
+
|
137 |
+
add_submenu_page(
|
138 |
+
'seedprod_lite',
|
139 |
+
__( 'Debug', 'coming-soon' ),
|
140 |
+
__( 'Debug', 'coming-soon' ),
|
141 |
+
apply_filters( 'seedprod_debug_menu_capability', 'edit_others_posts' ),
|
142 |
+
'sp_pro_debug',
|
143 |
+
'seedprod_lite_debug_page'
|
144 |
+
);
|
145 |
}
|
146 |
|
147 |
+
add_action( 'admin_head', 'seedprod_lite_remove_menus' );
|
148 |
|
149 |
+
function seedprod_lite_remove_menus() {
|
150 |
+
remove_submenu_page( 'seedprod_lite', 'seedprod_lite_builder' );
|
151 |
+
remove_submenu_page( 'seedprod_lite', 'seedprod_lite_template' );
|
152 |
+
remove_submenu_page( 'seedprod_lite', 'sp_pro_importexport' );
|
153 |
+
remove_submenu_page( 'seedprod_lite', 'sp_pro_debug' );
|
|
|
154 |
}
|
155 |
|
156 |
+
function seedprod_lite_importexport_page() {
|
157 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/importexport.php';
|
|
|
158 |
}
|
159 |
|
160 |
+
function seedprod_lite_debug_page() {
|
161 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/debug.php';
|
|
|
162 |
}
|
163 |
|
164 |
+
function seedprod_lite_dashboard_page() {
|
165 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/dashboard.php';
|
|
|
166 |
}
|
167 |
|
168 |
|
169 |
+
function seedprod_lite_builder_page() {
|
170 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/builder.php';
|
|
|
171 |
}
|
172 |
|
173 |
+
function seedprod_lite_template_page() {
|
174 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/views/builder.php';
|
|
|
175 |
}
|
176 |
|
177 |
|
178 |
/* Short circuit new request */
|
179 |
|
180 |
+
add_action( 'admin_init', 'seedprod_lite_new_lpage', 1 );
|
181 |
|
182 |
|
183 |
/* Redirect to SPA */
|
184 |
|
185 |
+
add_action( 'admin_init', 'seedprod_lite_redirect_to_site', 1 );
|
186 |
+
|
187 |
+
function seedprod_lite_redirect_to_site() {
|
188 |
+
// settings page
|
189 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_settings' ) {
|
190 |
+
wp_redirect( 'admin.php?page=seedprod_lite#/settings' );
|
191 |
+
exit();
|
192 |
+
}
|
193 |
+
|
194 |
+
// subscribers
|
195 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_templates' ) {
|
196 |
+
wp_redirect( 'admin.php?page=seedprod_lite_template&id=0&from=sidebar#/template' );
|
197 |
+
exit();
|
198 |
+
}
|
199 |
+
|
200 |
+
// subscribers
|
201 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_subscribers' ) {
|
202 |
+
wp_redirect( 'admin.php?page=seedprod_lite#/subscribers/0' );
|
203 |
+
exit();
|
204 |
+
}
|
205 |
+
|
206 |
+
// growth tools page
|
207 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_growth_tools' ) {
|
208 |
+
wp_redirect( 'admin.php?page=seedprod_lite#/growth-tools' );
|
209 |
+
exit();
|
210 |
+
}
|
211 |
+
|
212 |
+
// about us page
|
213 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_about_us' ) {
|
214 |
+
wp_redirect( 'admin.php?page=seedprod_lite#/aboutus' );
|
215 |
+
exit();
|
216 |
+
}
|
217 |
+
|
218 |
+
// feature request page
|
219 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_featurerequest' ) {
|
220 |
+
wp_redirect( 'https://www.seedprod.com/suggest-a-feature/?utm_source=wordpress&utm_medium=plugin-sidebar&utm_campaign=suggest-a-feature' );
|
221 |
+
exit();
|
222 |
+
}
|
223 |
+
|
224 |
+
// getpro page
|
225 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == 'seedprod_lite_get_pro' ) {
|
226 |
+
wp_redirect( seedprod_lite_upgrade_link( 'wp-sidebar-menu' ) );
|
227 |
+
exit();
|
228 |
+
}
|
229 |
}
|
230 |
|
231 |
/**
|
232 |
* Ajax Request Routes
|
233 |
*/
|
234 |
|
235 |
+
function seedprod_lite_render_shortcode() {
|
236 |
+
//ob_start();
|
237 |
+
echo do_shortcode( '[wpforms id="67" title="false" description="false"]' );
|
238 |
+
//echo do_shortcode('[rafflepress id="23"]');
|
239 |
+
//echo 'html';
|
240 |
+
//return ob_get_clean();
|
241 |
+
exit;
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
if ( defined( 'DOING_AJAX' ) ) {
|
246 |
+
|
247 |
|
248 |
+
add_action( 'wp_ajax_seedprod_lite_render_shortcode', 'seedprod_lite_render_shortcode' );
|
249 |
|
250 |
+
add_action( 'wp_ajax_seedprod_lite_dismiss_settings_lite_cta', 'seedprod_lite_dismiss_settings_lite_cta' );
|
251 |
|
252 |
+
add_action( 'wp_ajax_seedprod_lite_save_settings', 'seedprod_lite_save_settings' );
|
253 |
+
add_action( 'wp_ajax_seedprod_lite_save_api_key', 'seedprod_lite_save_api_key' );
|
254 |
|
255 |
+
add_action( 'wp_ajax_seedprod_lite_save_app_settings', 'seedprod_lite_save_app_settings' );
|
|
|
256 |
|
257 |
|
258 |
+
add_action( 'wp_ajax_seedprod_lite_template_subscribe', 'seedprod_lite_template_subscribe' );
|
259 |
+
add_action( 'wp_ajax_seedprod_lite_save_template', 'seedprod_lite_save_template' );
|
260 |
+
add_action( 'wp_ajax_seedprod_lite_save_lpage', 'seedprod_lite_save_lpage' );
|
261 |
+
add_action( 'wp_ajax_seedprod_lite_get_revisions', 'seedprod_lite_get_revisisons' );
|
262 |
+
add_action( 'wp_ajax_seedprod_lite_get_utc_offset', 'seedprod_lite_get_utc_offset' );
|
263 |
+
add_action( 'wp_ajax_seedprod_lite_get_namespaced_custom_css', 'seedprod_lite_get_namespaced_custom_css' );
|
264 |
+
add_action( 'wp_ajax_seedprod_lite_get_stockimages', 'seedprod_lite_get_stockimages' );
|
265 |
|
266 |
+
add_action( 'wp_ajax_seedprod_lite_slug_exists', 'seedprod_lite_slug_exists' );
|
267 |
+
add_action( 'wp_ajax_seedprod_lite_lpage_datatable', 'seedprod_lite_lpage_datatable' );
|
268 |
+
add_action( 'wp_ajax_seedprod_lite_duplicate_lpage', 'seedprod_lite_duplicate_lpage' );
|
269 |
+
add_action( 'wp_ajax_seedprod_lite_get_lpage_list', 'seedprod_lite_get_lpage_list' );
|
270 |
+
add_action( 'wp_ajax_seedprod_lite_archive_selected_lpages', 'seedprod_lite_archive_selected_lpages' );
|
271 |
+
add_action( 'wp_ajax_seedprod_lite_unarchive_selected_lpages', 'seedprod_lite_unarchive_selected_lpages' );
|
272 |
+
add_action( 'wp_ajax_seedprod_lite_delete_archived_lpages', 'seedprod_lite_delete_archived_lpages' );
|
273 |
|
274 |
+
add_action( 'wp_ajax_seedprod_lite_update_subscriber_count', 'seedprod_lite_update_subscriber_count' );
|
275 |
+
add_action( 'wp_ajax_seedprod_lite_subscribers_datatable', 'seedprod_lite_subscribers_datatable' );
|
276 |
|
277 |
+
add_action( 'wp_ajax_seedprod_lite_get_plugins_list', 'seedprod_lite_get_plugins_list' );
|
278 |
|
279 |
+
add_action( 'wp_ajax_seedprod_lite_install_addon', 'seedprod_lite_install_addon' );
|
280 |
+
add_action( 'wp_ajax_seedprod_lite_activate_addon', 'seedprod_lite_activate_addon' );
|
281 |
+
add_action( 'wp_ajax_seedprod_lite_deactivate_addon', 'seedprod_lite_deactivate_addon' );
|
282 |
|
283 |
+
add_action( 'wp_ajax_seedprod_lite_install_addon', 'seedprod_lite_install_addon' );
|
284 |
+
add_action( 'wp_ajax_seedprod_lite_deactivate_addon', 'seedprod_lite_deactivate_addon' );
|
285 |
+
add_action( 'wp_ajax_seedprod_lite_activate_addon', 'seedprod_lite_activate_addon' );
|
286 |
+
add_action( 'wp_ajax_seedprod_lite_plugin_nonce', 'seedprod_lite_plugin_nonce' );
|
287 |
|
288 |
+
add_action( 'wp_ajax_nopriv_seedprod_lite_run_one_click_upgrade', 'seedprod_lite_run_one_click_upgrade' );
|
289 |
+
add_action( 'wp_ajax_seedprod_lite_upgrade_license', 'seedprod_lite_upgrade_license' );
|
290 |
|
291 |
+
add_action( 'wp_ajax_seedprod_lite_get_wpforms', 'seedprod_lite_get_wpforms' );
|
292 |
+
add_action( 'wp_ajax_seedprod_lite_get_wpform', 'seedprod_lite_get_wpform' );
|
293 |
+
add_action( 'wp_ajax_seedprod_lite_get_rafflepress', 'seedprod_lite_get_rafflepress' );
|
294 |
+
add_action( 'wp_ajax_seedprod_lite_get_rafflepress_code', 'seedprod_lite_get_rafflepress_code' );
|
295 |
|
296 |
|
297 |
+
add_action( 'wp_ajax_seedprod_lite_dismiss_upsell', 'seedprod_lite_dismiss_upsell' );
|
298 |
+
|
299 |
+
// WooCommerce.
|
300 |
+
add_action( 'wp_ajax_seedprod_lite_get_woocommerce_products', 'seedprod_lite_get_woocommerce_products' );
|
301 |
+
add_action( 'wp_ajax_seedprod_lite_get_woocommerce_product_taxonomy', 'seedprod_lite_get_woocommerce_product_taxonomy' );
|
302 |
+
add_action( 'wp_ajax_seedprod_lite_get_woocommerce_product_attributes', 'seedprod_lite_get_woocommerce_product_attributes' );
|
303 |
+
add_action( 'wp_ajax_seedprod_lite_get_woocommerce_product_attribute_terms', 'seedprod_lite_get_woocommerce_product_attribute_terms' );
|
304 |
|
305 |
|
306 |
|
312 |
|
313 |
|
314 |
|
315 |
+
function seedprod_lite_get_wpforms() {
|
316 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
317 |
+
$forms = array();
|
318 |
+
if ( function_exists( 'wpforms' ) ) {
|
319 |
+
$forms = \wpforms()->form->get( '', array( 'order' => 'DESC' ) );
|
320 |
+
$forms = ! empty( $forms ) ? $forms : array();
|
321 |
+
$forms = array_map(
|
322 |
+
function ( $form ) {
|
323 |
+
$form->post_title = wp_html_excerpt( htmlspecialchars_decode( $form->post_title, ENT_QUOTES ), 100 );
|
324 |
+
return $form;
|
325 |
+
},
|
326 |
+
$forms
|
327 |
+
);
|
328 |
+
}
|
|
|
329 |
|
330 |
+
wp_send_json( $forms );
|
331 |
+
}
|
332 |
}
|
333 |
|
334 |
function seedprod_lite_get_wpform() {
|
335 |
|
336 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) && function_exists( 'wpforms_display' ) ) {
|
337 |
+
$form_id = filter_input( INPUT_GET, 'form_id', FILTER_SANITIZE_NUMBER_INT );
|
338 |
+
$form_title = filter_input( INPUT_GET, 'form_title', FILTER_VALIDATE_BOOLEAN );
|
339 |
+
$form_description = filter_input( INPUT_GET, 'form_description', FILTER_VALIDATE_BOOLEAN );
|
340 |
+
ob_start();
|
341 |
+
?>
|
342 |
+
<link rel='stylesheet' id='wpforms-full-css' href='<?php echo content_url(); ?>/plugins/wpforms-lite/assets/css/wpforms-full.css' media='all' />
|
343 |
+
<?php
|
344 |
+
wpforms_display( $form_id, $form_title, $form_description );
|
345 |
+
return wp_send_json( ob_get_clean() );
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
function seedprod_lite_get_rafflepress() {
|
350 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
351 |
+
$giveaways = array();
|
352 |
+
$rp_version = 'lite';
|
353 |
+
if ( function_exists( 'rafflepress_pro_load_textdomain' ) ) {
|
354 |
+
$rp_version = 'pro';
|
355 |
+
}
|
356 |
+
if ( function_exists( 'rafflepress_' . $rp_version . '_activation' ) || function_exists( 'rafflepress_' . $rp_version . '' ) ) {
|
357 |
+
global $wpdb;
|
358 |
+
$tablename = $wpdb->prefix . 'rafflepress_giveaways';
|
359 |
+
$sql = "SELECT id,name FROM $tablename WHERE deleted_at IS NULL";
|
360 |
+
$giveaways = $wpdb->get_results( $sql );
|
361 |
+
}
|
362 |
+
|
363 |
+
wp_send_json( $giveaways );
|
364 |
+
}
|
|
|
365 |
}
|
366 |
|
367 |
function seedprod_lite_get_rafflepress_code() {
|
368 |
|
369 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
370 |
+
$id = filter_input( INPUT_GET, 'form_id', FILTER_SANITIZE_NUMBER_INT );
|
371 |
+
ob_start();
|
372 |
+
?>
|
373 |
+
<div class="sp-relative">
|
374 |
+
<div class="rafflepress-giveaway-iframe-wrapper rpoverlay">
|
375 |
+
<iframe id="rafflepress-<?php echo $id; ?>"
|
376 |
+
src="<?php echo home_url() . '?rpid=' . $id . '?iframe=1&giframe=' . $a['giframe'] . '&rpr=' . $ref . '&parent_url=' . urlencode( $parent_url ); ?>&<?php echo mt_rand( 1, 99999 ); ?>"
|
377 |
+
frameborder="0" scrolling="no" allowtransparency="true" style="width:100%; height:400px" ></iframe>
|
378 |
</div>
|
379 |
+
</div>
|
380 |
+
<?php
|
381 |
+
$code = ob_get_clean();
|
382 |
+
return wp_send_json( $code );
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Get WooCommerce Products.
|
389 |
+
*
|
390 |
+
* @return JSON object.
|
391 |
+
*/
|
392 |
+
function seedprod_lite_get_woocommerce_products() {
|
393 |
+
$products = array();
|
394 |
+
|
395 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
396 |
+
// Check if Woocommmerce is installed and active.
|
397 |
+
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
398 |
+
// Fetch Products.
|
399 |
+
$args = array(
|
400 |
+
'status' => 'publish',
|
401 |
+
);
|
402 |
+
|
403 |
+
$p = wc_get_products( $args );
|
404 |
+
|
405 |
+
foreach ( $p as $product ) {
|
406 |
+
$products[] = $product->get_data();
|
407 |
+
}
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
wp_send_json( $products );
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Get product taxonomy.
|
416 |
+
*
|
417 |
+
* @return JSON object.
|
418 |
+
*/
|
419 |
+
function seedprod_lite_get_woocommerce_product_taxonomy() {
|
420 |
+
$taxonomy = array();
|
421 |
+
|
422 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
423 |
+
// Check if Woocommmerce is installed and active.
|
424 |
+
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
425 |
+
// Fetch taxonomy.
|
426 |
+
$args = array(
|
427 |
+
'taxonomy' => $_GET['taxonomy'],
|
428 |
+
'hide_empty' => false,
|
429 |
+
);
|
430 |
+
|
431 |
+
$taxonomy = get_terms( $args );
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
wp_send_json( $taxonomy );
|
436 |
+
}
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Get list of product attributes
|
440 |
+
*
|
441 |
+
* @return JSON object.
|
442 |
+
*/
|
443 |
+
function seedprod_lite_get_woocommerce_product_attributes() {
|
444 |
+
$attributes = array();
|
445 |
+
|
446 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
447 |
+
// Check if Woocommmerce is installed and active.
|
448 |
+
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
449 |
+
$attributes = wc_get_attribute_taxonomies();
|
450 |
+
}
|
451 |
+
}
|
452 |
+
|
453 |
+
wp_send_json( $attributes );
|
454 |
+
}
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Get list of product attribute terms.
|
458 |
+
*
|
459 |
+
* @return JSON object.
|
460 |
+
*/
|
461 |
+
function seedprod_lite_get_woocommerce_product_attribute_terms() {
|
462 |
+
$attribute_terms = array();
|
463 |
+
|
464 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
465 |
+
// Check if Woocommmerce is installed and active.
|
466 |
+
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
467 |
+
$attribute = $_GET['attribute'];
|
468 |
+
|
469 |
+
// Get attribute terms
|
470 |
+
if ( $attribute ) {
|
471 |
+
$attribute_terms = get_terms(
|
472 |
+
array(
|
473 |
+
'taxonomy' => 'pa_' . $attribute,
|
474 |
+
'hide_empty' => false,
|
475 |
+
)
|
476 |
+
);
|
477 |
+
}
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
wp_send_json( $attribute_terms );
|
482 |
+
}
|
483 |
+
|
484 |
+
// login redirect
|
485 |
+
function seedprod_lite_redirect_login_page() {
|
486 |
+
$post = $_POST;
|
487 |
+
if ( empty( $post ) ) {
|
488 |
+
$query = $_GET;
|
489 |
+
|
490 |
+
if ( empty( $query ) || strpos( http_build_query( $query ), 'redirect_to' ) !== false || strpos( http_build_query( $query ), 'loggedout' ) !== false ) {
|
491 |
+
// Top Level Settings
|
492 |
+
$ts = get_option( 'seedprod_settings' );
|
493 |
+
$seedprod_settings = json_decode( $ts );
|
494 |
+
|
495 |
+
// Page Info
|
496 |
+
$page_id = 0;
|
497 |
+
|
498 |
+
//Get 404 Page Id
|
499 |
+
if ( ! empty( $seedprod_settings->enable_login_mode ) ) {
|
500 |
+
$page_id = get_option( 'seedprod_login_page_id' );
|
501 |
+
} else {
|
502 |
+
return false;
|
503 |
+
}
|
504 |
+
|
505 |
+
// Get Page
|
506 |
+
global $wpdb;
|
507 |
+
$tablename = $wpdb->prefix . 'posts';
|
508 |
+
$sql = "SELECT * FROM $tablename WHERE id= %d";
|
509 |
+
$safe_sql = $wpdb->prepare( $sql, absint( $page_id ) );
|
510 |
+
$page = $wpdb->get_row( $safe_sql );
|
511 |
+
|
512 |
+
$settings = json_decode( $page->post_content_filtered );
|
513 |
+
|
514 |
+
if ( empty( $page ) ) {
|
515 |
+
return false;
|
516 |
+
}
|
517 |
+
|
518 |
+
if ( ! empty( $settings->redirect_login_page ) && ! empty( $seedprod_settings->enable_login_mode ) ) {
|
519 |
+
wp_redirect( '/?page_id=' . $page_id );
|
520 |
+
}
|
521 |
+
}
|
522 |
+
}
|
523 |
+
}
|
524 |
+
add_action( 'login_head', 'seedprod_lite_redirect_login_page' );
|
525 |
+
/* end-remove-for-free */
|
526 |
|
app/settings.php
CHANGED
@@ -3,69 +3,102 @@
|
|
3 |
/**
|
4 |
* Save Settings
|
5 |
*/
|
6 |
-
function seedprod_lite_save_settings()
|
7 |
-
{
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
}
|
3 |
/**
|
4 |
* Save Settings
|
5 |
*/
|
6 |
+
function seedprod_lite_save_settings() {
|
7 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
8 |
+
if ( ! empty( $_POST['settings'] ) ) {
|
9 |
+
$settings = stripslashes_deep( $_POST['settings'] );
|
10 |
+
|
11 |
+
$s = json_decode( $settings );
|
12 |
+
|
13 |
+
// Get old settings to check if there has been a change
|
14 |
+
$settings_old = get_option( 'seedprod_settings' );
|
15 |
+
$s_old = json_decode( $settings_old );
|
16 |
+
|
17 |
+
// Key is for $settings, Value is for get_option()
|
18 |
+
$settings_to_update = array(
|
19 |
+
'enable_coming_soon_mode' => 'seedprod_coming_soon_page_id',
|
20 |
+
'enable_maintenance_mode' => 'seedprod_maintenance_mode_page_id',
|
21 |
+
'enable_login_mode' => 'seedprod_login_page_id',
|
22 |
+
'enable_404_mode' => 'seedprod_404_page_id',
|
23 |
+
);
|
24 |
+
|
25 |
+
foreach ( $settings_to_update as $setting => $option ) {
|
26 |
+
$has_changed = ( $s->$setting !== $s_old->$setting ? true : false );
|
27 |
+
if ( ! $has_changed ) {
|
28 |
+
continue; } // Do nothing if no change
|
29 |
+
|
30 |
+
$id = get_option( $option );
|
31 |
+
|
32 |
+
$post_exists = ! is_null( get_post( $id ) );
|
33 |
+
if ( ! $post_exists ) {
|
34 |
+
update_option( $option, null );
|
35 |
+
continue;
|
36 |
+
}
|
37 |
+
|
38 |
+
$update = array();
|
39 |
+
$update['ID'] = $id;
|
40 |
+
|
41 |
+
// Publish page when active
|
42 |
+
if ( $s->$setting === true ) {
|
43 |
+
$update['post_status'] = 'publish';
|
44 |
+
wp_update_post( $update );
|
45 |
+
}
|
46 |
+
|
47 |
+
// Unpublish page when inactive
|
48 |
+
if ( $s->$setting === false ) {
|
49 |
+
$update['post_status'] = 'draft';
|
50 |
+
wp_update_post( $update );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
update_option( 'seedprod_settings', $settings );
|
55 |
+
|
56 |
+
$response = array(
|
57 |
+
'status' => 'true',
|
58 |
+
'msg' => __( 'Settings Updated', 'coming-soon' ),
|
59 |
+
);
|
60 |
+
} else {
|
61 |
+
$response = array(
|
62 |
+
'status' => 'false',
|
63 |
+
'msg' => __( 'Error Updating Settings', 'coming-soon' ),
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
// Send Response
|
68 |
+
wp_send_json( $response );
|
69 |
+
exit;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
function seedprod_lite_save_app_settings() {
|
75 |
+
if ( check_ajax_referer( 'seedprod_lite_save_app_settings' ) ) {
|
76 |
+
|
77 |
+
if ( ! empty( $_POST['app_settings'] ) ) {
|
78 |
+
|
79 |
+
$app_settings = stripslashes_deep( $_POST['app_settings'] );
|
80 |
+
if(isset($app_settings["disable_seedprod_button"]) && $app_settings["disable_seedprod_button"] == "true"){
|
81 |
+
$app_settings["disable_seedprod_button"] = true;
|
82 |
+
}else{
|
83 |
+
$app_settings["disable_seedprod_button"] = false;
|
84 |
+
}
|
85 |
+
$app_settings_encode = json_encode( $app_settings );
|
86 |
+
|
87 |
+
update_option( 'seedprod_app_settings', $app_settings_encode );
|
88 |
+
$response = array(
|
89 |
+
'status' => 'true',
|
90 |
+
'msg' => __( 'App Settings Updated', 'coming-soon' ),
|
91 |
+
);
|
92 |
+
|
93 |
+
} else {
|
94 |
+
$response = array(
|
95 |
+
'status' => 'false',
|
96 |
+
'msg' => __( 'Error Updating App Settings', 'coming-soon' ),
|
97 |
+
);
|
98 |
+
}
|
99 |
+
// Send Response
|
100 |
+
wp_send_json( $response );
|
101 |
+
exit;
|
102 |
+
|
103 |
+
}
|
104 |
}
|
app/subscriber.php
CHANGED
@@ -3,151 +3,145 @@
|
|
3 |
/*
|
4 |
* subscribers Datatable
|
5 |
*/
|
6 |
-
function seedprod_lite_subscribers_datatable()
|
7 |
-
{
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
-
wp_send_json($response);
|
92 |
-
}
|
93 |
}
|
94 |
|
95 |
-
function seedprod_lite_subscribers_get_data_total($filter = null)
|
96 |
-
|
97 |
-
global $wpdb;
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
}
|
116 |
|
117 |
-
function seedprod_lite_subscribers_get_views($filter = null)
|
118 |
-
|
119 |
-
|
120 |
-
$current = (!empty($filter) ? $filter : 'all');
|
121 |
|
122 |
-
|
123 |
-
|
124 |
|
125 |
-
|
126 |
-
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
|
139 |
-
|
140 |
}
|
141 |
|
142 |
|
143 |
/*
|
144 |
* Update Subscriber
|
145 |
*/
|
146 |
-
function seedprod_lite_update_subscriber_count()
|
147 |
-
{
|
148 |
-
|
149 |
-
|
150 |
-
}
|
151 |
|
152 |
}
|
153 |
|
3 |
/*
|
4 |
* subscribers Datatable
|
5 |
*/
|
6 |
+
function seedprod_lite_subscribers_datatable() {
|
7 |
+
if ( check_ajax_referer( 'seedprod_nonce' ) ) {
|
8 |
+
$data = array( '' );
|
9 |
+
$current_page = 1;
|
10 |
+
if ( ! empty( absint( $_GET['current_page'] ) ) ) {
|
11 |
+
$current_page = absint( $_GET['current_page'] );
|
12 |
+
}
|
13 |
+
$per_page = 100;
|
14 |
+
|
15 |
+
$filter = null;
|
16 |
+
if ( ! empty( $_GET['filter'] ) ) {
|
17 |
+
$filter = sanitize_text_field( $_GET['filter'] );
|
18 |
+
if ( $filter == 'all' ) {
|
19 |
+
$filter = null;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
if ( ! empty( $_GET['s'] ) ) {
|
24 |
+
$filter = null;
|
25 |
+
}
|
26 |
+
|
27 |
+
$results = array();
|
28 |
+
//var_dump($results);
|
29 |
+
$data = array();
|
30 |
+
foreach ( $results as $v ) {
|
31 |
+
|
32 |
+
// Format Date
|
33 |
+
$created_at = date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( $v->created ) );
|
34 |
+
|
35 |
+
// Load Data
|
36 |
+
$data[] = array(
|
37 |
+
'id' => $v->id,
|
38 |
+
'email' => $v->email,
|
39 |
+
'name' => $v->fname . ' ' . $v->lname,
|
40 |
+
'created_at' => $created_at,
|
41 |
+
'page_uuid' => $v->page_uuid,
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
$totalitems = 0;
|
46 |
+
$views = array();
|
47 |
+
|
48 |
+
// Get recent subscriber data
|
49 |
+
$chart_timeframe = 7;
|
50 |
+
if ( ! empty( $_GET['interval'] ) ) {
|
51 |
+
$chart_timeframe = absint( $_GET['interval'] );
|
52 |
+
}
|
53 |
+
|
54 |
+
$recent_subscribers = array();
|
55 |
+
|
56 |
+
$now = new \DateTime( "$chart_timeframe days ago", new \DateTimeZone( 'America/New_York' ) );
|
57 |
+
$interval = new \DateInterval( 'P1D' ); // 1 Day interval
|
58 |
+
$period = new \DatePeriod( $now, $interval, $chart_timeframe ); // 7 Days
|
59 |
+
|
60 |
+
$recent_subscribers_data = array(
|
61 |
+
array( 'Year', 'Subscribers' ),
|
62 |
+
);
|
63 |
+
foreach ( $period as $day ) {
|
64 |
+
$key = $day->format( 'Y-m-d' );
|
65 |
+
$display_key = $day->format( 'M j' );
|
66 |
+
$no_val = true;
|
67 |
+
foreach ( $recent_subscribers as $v ) {
|
68 |
+
if ( $key == $v->created ) {
|
69 |
+
$recent_subscribers_data[] = array( $display_key, absint( $v->count ) );
|
70 |
+
$no_val = false;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
if ( $no_val ) {
|
74 |
+
$recent_subscribers_data[] = array( $display_key, 0 );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
$response = array(
|
79 |
+
'recent_subscribers' => $recent_subscribers_data,
|
80 |
+
'rows' => $data,
|
81 |
+
'lpage_name' => '',
|
82 |
+
'totalitems' => $totalitems,
|
83 |
+
'totalpages' => ceil( $totalitems / $per_page ),
|
84 |
+
'currentpage' => $current_page,
|
85 |
+
'views' => $views,
|
86 |
+
);
|
87 |
+
|
88 |
+
wp_send_json( $response );
|
89 |
+
}
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
+
function seedprod_lite_subscribers_get_data_total( $filter = null ) {
|
93 |
+
global $wpdb;
|
|
|
94 |
|
95 |
+
$tablename = $wpdb->prefix . 'csp3_subscribers';
|
96 |
|
97 |
+
$sql = "SELECT count(id) FROM $tablename";
|
98 |
|
99 |
+
if ( ! empty( $_GET['id'] ) ) {
|
100 |
+
$sql .= ' WHERE page_uuid = ' . esc_sql( $_GET['id'] );
|
101 |
+
} else {
|
102 |
+
$sql .= ' WHERE 1 =1 ';
|
103 |
+
}
|
104 |
|
105 |
+
if ( ! empty( $_GET['s'] ) ) {
|
106 |
+
$sql .= ' AND email LIKE "%' . esc_sql( trim( sanitize_text_field( $_GET['s'] ) ) ) . '%"';
|
107 |
+
}
|
108 |
|
109 |
+
$results = $wpdb->get_var( $sql );
|
110 |
+
return $results;
|
111 |
}
|
112 |
|
113 |
+
function seedprod_lite_subscribers_get_views( $filter = null ) {
|
114 |
+
$views = array();
|
115 |
+
$current = ( ! empty( $filter ) ? $filter : 'all' );
|
|
|
116 |
|
117 |
+
global $wpdb;
|
118 |
+
$tablename = $wpdb->prefix . 'csp3_subscribers';
|
119 |
|
120 |
+
//All link
|
121 |
+
$sql = "SELECT count(id) FROM $tablename";
|
122 |
|
123 |
+
if ( ! empty( $_GET['id'] ) ) {
|
124 |
+
$sql .= ' WHERE lpage_id = ' . esc_sql( $_GET['id'] );
|
125 |
+
} else {
|
126 |
+
$sql .= ' WHERE 1 =1 ';
|
127 |
+
}
|
128 |
|
129 |
+
$results = $wpdb->get_var( $sql );
|
130 |
+
$class = ( $current == 'all' ? ' class="current"' : '' );
|
131 |
+
$all_url = remove_query_arg( 'filter' );
|
132 |
+
$views['all'] = $results;
|
133 |
|
134 |
+
return $views;
|
135 |
}
|
136 |
|
137 |
|
138 |
/*
|
139 |
* Update Subscriber
|
140 |
*/
|
141 |
+
function seedprod_lite_update_subscriber_count() {
|
142 |
+
if ( check_ajax_referer( 'seedprod_lite_update_subscriber_count' ) ) {
|
143 |
+
update_option( 'seedprod_subscriber_count', 1 );
|
144 |
+
}
|
|
|
145 |
|
146 |
}
|
147 |
|
coming-soon.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Coming Soon Page, Maintenance Mode & Landing Pages by SeedProd
|
4 |
Plugin URI: https://www.seedprod.com
|
5 |
Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
|
6 |
-
Version: 6.0
|
7 |
Author: SeedProd
|
8 |
Author URI: https://www.seedprod.com
|
9 |
TextDomain: coming-soon
|
@@ -14,22 +14,23 @@ License: GPLv2 or later
|
|
14 |
/**
|
15 |
* Default Constants
|
16 |
*/
|
17 |
-
define('SEEDPROD_BUILD', 'lite');
|
18 |
-
define('SEEDPROD_SLUG', 'coming-soon/coming-soon.php');
|
19 |
-
define('SEEDPROD_VERSION', '6.0
|
20 |
-
define('SEEDPROD_PLUGIN_PATH', plugin_dir_path(__FILE__));
|
21 |
// Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seedprod/
|
22 |
-
define('SEEDPROD_PLUGIN_URL', plugin_dir_url(__FILE__));
|
23 |
// Example output: http://localhost:8888/wordpress/wp-content/plugins/seedprod/
|
24 |
|
25 |
-
if (defined('SEEDPROD_LOCAL_JS')) {
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
} else {
|
31 |
-
|
32 |
-
|
|
|
33 |
}
|
34 |
|
35 |
|
@@ -39,79 +40,76 @@ if (defined('SEEDPROD_LOCAL_JS')) {
|
|
39 |
* Load Translation
|
40 |
*/
|
41 |
function seedprod_lite_load_textdomain() {
|
42 |
-
|
43 |
}
|
44 |
-
add_action('plugins_loaded', 'seedprod_lite_load_textdomain');
|
45 |
|
46 |
|
47 |
/**
|
48 |
* Upon activation of the plugin check php version, load defaults and show welcome screen.
|
49 |
*/
|
50 |
|
51 |
-
function seedprod_lite_activation()
|
52 |
-
|
53 |
-
seedprod_lite_check_for_free_version();
|
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 |
-
register_activation_hook(__FILE__, 'seedprod_lite_activation');
|
88 |
|
89 |
|
90 |
/**
|
91 |
* Deactivate Flush Rules
|
92 |
*/
|
93 |
|
94 |
-
function seedprod_lite_deactivate()
|
95 |
-
|
96 |
-
wp_clear_scheduled_hook( 'seedprod_notifications');
|
97 |
}
|
98 |
|
99 |
-
register_deactivation_hook(__FILE__, 'seedprod_lite_deactivate');
|
100 |
|
101 |
|
102 |
|
103 |
/**
|
104 |
* Load Plugin
|
105 |
*/
|
106 |
-
require_once
|
107 |
-
require_once
|
108 |
-
require_once
|
109 |
|
110 |
/**
|
111 |
* Maybe Migrate
|
112 |
*/
|
113 |
-
add_action('upgrader_process_complete', 'seedprod_lite_check_for_free_version');
|
114 |
-
add_action('init', 'seedprod_lite_check_for_free_version');
|
115 |
|
116 |
|
117 |
|
3 |
Plugin Name: Coming Soon Page, Maintenance Mode & Landing Pages by SeedProd
|
4 |
Plugin URI: https://www.seedprod.com
|
5 |
Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
|
6 |
+
Version: 6.2.0
|
7 |
Author: SeedProd
|
8 |
Author URI: https://www.seedprod.com
|
9 |
TextDomain: coming-soon
|
14 |
/**
|
15 |
* Default Constants
|
16 |
*/
|
17 |
+
define( 'SEEDPROD_BUILD', 'lite' );
|
18 |
+
define( 'SEEDPROD_SLUG', 'coming-soon/coming-soon.php' );
|
19 |
+
define( 'SEEDPROD_VERSION', '6.2.0' );
|
20 |
+
define( 'SEEDPROD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
21 |
// Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seedprod/
|
22 |
+
define( 'SEEDPROD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
23 |
// Example output: http://localhost:8888/wordpress/wp-content/plugins/seedprod/
|
24 |
|
25 |
+
if ( defined( 'SEEDPROD_LOCAL_JS' ) ) {
|
26 |
+
define( 'SEEDPROD_API_URL', 'http://v4app.seedprod.test/v4/' );
|
27 |
+
define( 'SEEDPROD_WEB_API_URL', 'http://v4app.seedprod.test/' );
|
28 |
+
define( 'SEEDPROD_BACKGROUND_DOWNLOAD_API_URL', 'https://api.seedprod.com/v3/background_download' );
|
29 |
+
|
30 |
} else {
|
31 |
+
define( 'SEEDPROD_API_URL', 'https://api.seedprod.com/v4/' );
|
32 |
+
define( 'SEEDPROD_WEB_API_URL', 'https://app.seedprod.com/' );
|
33 |
+
define( 'SEEDPROD_BACKGROUND_DOWNLOAD_API_URL', 'https://api.seedprod.com/v3/background_download' );
|
34 |
}
|
35 |
|
36 |
|
40 |
* Load Translation
|
41 |
*/
|
42 |
function seedprod_lite_load_textdomain() {
|
43 |
+
load_plugin_textdomain( 'coming-soon', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
44 |
}
|
45 |
+
add_action( 'plugins_loaded', 'seedprod_lite_load_textdomain' );
|
46 |
|
47 |
|
48 |
/**
|
49 |
* Upon activation of the plugin check php version, load defaults and show welcome screen.
|
50 |
*/
|
51 |
|
52 |
+
function seedprod_lite_activation() {
|
53 |
+
seedprod_lite_check_for_free_version();
|
|
|
|
|
54 |
|
55 |
+
update_option( 'seedprod_run_activation', true, '', false );
|
56 |
|
57 |
+
// Load and Set Default Settings
|
58 |
+
require_once SEEDPROD_PLUGIN_PATH . 'resources/data-templates/default-settings.php';
|
59 |
+
add_option( 'seedprod_settings', $seedprod_default_settings );
|
60 |
|
61 |
+
// Set inital version
|
62 |
+
$data = array(
|
63 |
+
'installed_version' => SEEDPROD_VERSION,
|
64 |
+
'installed_date' => time(),
|
65 |
+
'installed_pro' => SEEDPROD_BUILD,
|
66 |
+
);
|
67 |
|
68 |
+
add_option( 'seedprod_over_time', $data );
|
69 |
|
70 |
+
// Set a token
|
71 |
+
add_option( 'seedprod_token', wp_generate_uuid4() );
|
72 |
|
73 |
+
// Welcome Page Flag
|
74 |
+
set_transient( '_seedprod_welcome_screen_activation_redirect', true, 30 );
|
75 |
|
76 |
+
// set cron to fetch feed
|
77 |
+
if ( ! wp_next_scheduled( 'seedprod_notifications' ) ) {
|
78 |
+
wp_schedule_event( time(), 'daily', 'seedprod_notifications' );
|
79 |
+
}
|
80 |
|
81 |
+
// flush rewrite rules
|
82 |
+
flush_rewrite_rules();
|
83 |
|
84 |
}
|
85 |
|
86 |
+
register_activation_hook( __FILE__, 'seedprod_lite_activation' );
|
87 |
|
88 |
|
89 |
/**
|
90 |
* Deactivate Flush Rules
|
91 |
*/
|
92 |
|
93 |
+
function seedprod_lite_deactivate() {
|
94 |
+
wp_clear_scheduled_hook( 'seedprod_notifications' );
|
|
|
95 |
}
|
96 |
|
97 |
+
register_deactivation_hook( __FILE__, 'seedprod_lite_deactivate' );
|
98 |
|
99 |
|
100 |
|
101 |
/**
|
102 |
* Load Plugin
|
103 |
*/
|
104 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/bootstrap.php';
|
105 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/routes.php';
|
106 |
+
require_once SEEDPROD_PLUGIN_PATH . 'app/load_controller.php';
|
107 |
|
108 |
/**
|
109 |
* Maybe Migrate
|
110 |
*/
|
111 |
+
add_action( 'upgrader_process_complete', 'seedprod_lite_check_for_free_version' );
|
112 |
+
add_action( 'init', 'seedprod_lite_check_for_free_version' );
|
113 |
|
114 |
|
115 |
|
public/css/global-admin.css
CHANGED
@@ -48,4 +48,19 @@ background-color: #f15d32 !important;
|
|
48 |
font-size: 11px !important;
|
49 |
line-height: 0 !important;
|
50 |
text-align: center !important;
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
font-size: 11px !important;
|
49 |
line-height: 0 !important;
|
50 |
text-align: center !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
.seedprod_hidden_data{ display: none; }
|
55 |
+
|
56 |
+
.edit_seedprod_custom_link{ height: 30px; margin: 1px 15px; display:flex !important; align-items: center; }
|
57 |
+
|
58 |
+
.active-seed-prod-buttons{ display: none; }
|
59 |
+
#post-body-content .active-seed-prod-buttons{ display: block; }
|
60 |
+
|
61 |
+
.active-seed-prod-buttons{ display: none; }
|
62 |
+
.seed_editor_true .seedprod-off{ display:none; }
|
63 |
+
.seed_editor_true .seedprod-on{ display:inline-block; }
|
64 |
+
|
65 |
+
.seed_editor_false .seedprod-on{ display:none; }
|
66 |
+
.seed_editor_false .seedprod-off{ display:inline-block; }
|
public/css/tailwind-admin.min.css
CHANGED
@@ -2130,7 +2130,18 @@ a:focus{outline:0;box-shadow:none}
|
|
2130 |
.seedprod-tooltip[x-placement^="left"] .tooltip-arrow{border-width:5px 0 5px 5px;border-top-color:transparent !important;border-right-color:transparent !important;border-bottom-color:transparent !important;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}
|
2131 |
.seedprod-tooltip[aria-hidden='true']{visibility:hidden;opacity:0;transition:opacity .15s,visibility .15s}
|
2132 |
.seedprod-tooltip[aria-hidden='false']{visibility:visible;opacity:1;transition:opacity .15s}
|
2133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2134 |
.sm\:sp-not-sr-only{position:static !important;width:auto !important;height:auto !important;padding:0 !important;margin:0 !important;overflow:visible !important;clip:auto !important;white-space:normal !important}
|
2135 |
.sm\:focus\:sp-sr-only:focus{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;white-space:nowrap !important;border-width:0 !important}
|
2136 |
.sm\:focus\:sp-not-sr-only:focus{position:static !important;width:auto !important;height:auto !important;padding:0 !important;margin:0 !important;overflow:visible !important;clip:auto !important;white-space:normal !important}
|
2130 |
.seedprod-tooltip[x-placement^="left"] .tooltip-arrow{border-width:5px 0 5px 5px;border-top-color:transparent !important;border-right-color:transparent !important;border-bottom-color:transparent !important;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}
|
2131 |
.seedprod-tooltip[aria-hidden='true']{visibility:hidden;opacity:0;transition:opacity .15s,visibility .15s}
|
2132 |
.seedprod-tooltip[aria-hidden='false']{visibility:visible;opacity:1;transition:opacity .15s}
|
2133 |
+
#nprogress{pointer-events:none}
|
2134 |
+
#nprogress .bar{background:#f3510a;position:fixed;z-index:999999;top:0;left:0;width:100%;height:2px}
|
2135 |
+
#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #f3510a,0 0 5px #f3510a;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}
|
2136 |
+
#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}
|
2137 |
+
#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;z-index:1031;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite}
|
2138 |
+
.nprogress-custom-parent{overflow:hidden;position:relative}
|
2139 |
+
.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}
|
2140 |
+
@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0)}
|
2141 |
+
100%{-webkit-transform:rotate(360deg)}
|
2142 |
+
}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}
|
2143 |
+
100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}
|
2144 |
+
}@media(min-width:640px){.sm\:sp-sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;white-space:nowrap !important;border-width:0 !important}
|
2145 |
.sm\:sp-not-sr-only{position:static !important;width:auto !important;height:auto !important;padding:0 !important;margin:0 !important;overflow:visible !important;clip:auto !important;white-space:normal !important}
|
2146 |
.sm\:focus\:sp-sr-only:focus{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;white-space:nowrap !important;border-width:0 !important}
|
2147 |
.sm\:focus\:sp-not-sr-only:focus{position:static !important;width:auto !important;height:auto !important;padding:0 !important;margin:0 !important;overflow:visible !important;clip:auto !important;white-space:normal !important}
|
public/css/tailwind-builder.min.css
CHANGED
@@ -2404,7 +2404,7 @@ html{scroll-behavior:smooth}
|
|
2404 |
.sp-header-tag-h1,h1,.sp-header-tag-h2,h2,.sp-header-tag-h3,h3,.sp-header-tag-h4,h4,.sp-header-tag-h5,h5,.sp-header-tag-h6,h6{line-height:1.1}
|
2405 |
img{display:inline-block}
|
2406 |
.fab{font-weight:normal}
|
2407 |
-
.spBgcover{background-size:cover;background-repeat:no-repeat;background-position:center top;background-attachment:
|
2408 |
.spBgfull{background-size:100% auto;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
2409 |
.spBgfullbottom{background-size:100% auto;background-repeat:no-repeat;background-position:center bottom;background-attachment:scroll;min-height:100%}
|
2410 |
.spBgrepeat{background-repeat:repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
@@ -2422,6 +2422,19 @@ img{display:inline-block}
|
|
2422 |
.sp-ss-md{padding:4px 10px;font-size:16px}
|
2423 |
.sp-ss-lg{padding:8px 14px;font-size:20px}
|
2424 |
.sp-starrating i:last-of-type{padding-right:0 !important}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2425 |
.sp-img-block-template-1{border:1px solid #dedede}
|
2426 |
.sp-img-block-template-2{border:1px solid #dedede;padding:5px;background:#fff}
|
2427 |
.sp-img-block-template-6{border:1px solid #dedede;padding:1px;background:#fff}
|
@@ -2444,8 +2457,11 @@ to{background-position:0 0}
|
|
2444 |
.sp-optin-templates .sp-optin-block-template-5,.sp-optin-block-template-5 input{background-color:#414141;border-width:1px;border-color:#333 !important}
|
2445 |
.sp-optin-templates .sp-optin-block-template-6,.sp-optin-block-template-6 input{border-width:0;border-bottom-width:2px}
|
2446 |
.sp-optin-templates .sp-optin-block-template-7,.sp-optin-block-template-7 input{background-color:rgba(255,255,255,0.65);border-width:1px;border-color:rgba(255,255,255,0.65) !important}
|
|
|
|
|
2447 |
.sp-socialprofiles-style-1 .sp-sp-twitter{color:#1b95e0 !important}
|
2448 |
.sp-socialprofiles-style-1 .sp-sp-facebook{color:#1877f2 !important}
|
|
|
2449 |
.sp-socialprofiles-style-1 .sp-sp-linkedin{color:#0073b1 !important}
|
2450 |
.sp-socialprofiles-style-1 .sp-sp-pinterest{color:#e60023 !important}
|
2451 |
.sp-socialprofiles-style-1 .sp-sp-youtube{color:#f00 !important}
|
@@ -2627,13 +2643,17 @@ div.wp-link-input input::placeholder{color:rgba(255,255,255,0.5)}
|
|
2627 |
.sp-giveaway-wrapper:not(.sp-has-form){background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
2628 |
.sp-form-wrapper:not(.sp-has-form){background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
2629 |
.sp-shortcode-wrapper{background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
|
|
|
|
|
|
|
|
2630 |
.rpoverlay::after{background-image:linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background-image:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);content:'RafflePress Giveaway Preview';height:100%;position:absolute;top:0;left:0;width:100%;font-size:14px;text-align:center}
|
2631 |
.sp-mobile-view .sp-spacer{height:1vh}
|
2632 |
.sp-mobile-view .sp-countdown-group{flex-wrap:wrap}
|
2633 |
.sp-mobile-view .sp-socialsharing-wrapper,.sp-mobile-view .sp-nav,.sp-mobile-view .sp-button-wrapper,.sp-mobile-view .sp-image-wrapper,.sp-mobile-view .sp-text-wrapper{text-align:center !important;justify-content:center !important}
|
2634 |
.sp-mobile-view .sp-cd-group{margin-bottom:1vh !important}
|
2635 |
-
.sp-mobile-view .sp-el-section,.sp-mobile-view .sp-el-row,.sp-mobile-view .sp-el-col,.sp-mobile-view .sp-el-block,.sp-mobile-view .sp-optin-wrapper{padding:5px !important}
|
2636 |
-
.sp-mobile-view img{height:auto !important}
|
2637 |
.sp-mobile-view .sp-w-full{width:100% !important}
|
2638 |
.sp-mobile-view .sp-optinform-field,.sp-mobile-view .sp-optinform-btn{display:block !important;width:100% !important}
|
2639 |
.seedprod-builder .theme-browser .themes{clear:both}
|
2404 |
.sp-header-tag-h1,h1,.sp-header-tag-h2,h2,.sp-header-tag-h3,h3,.sp-header-tag-h4,h4,.sp-header-tag-h5,h5,.sp-header-tag-h6,h6{line-height:1.1}
|
2405 |
img{display:inline-block}
|
2406 |
.fab{font-weight:normal}
|
2407 |
+
.spBgcover{background-size:cover;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
2408 |
.spBgfull{background-size:100% auto;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
2409 |
.spBgfullbottom{background-size:100% auto;background-repeat:no-repeat;background-position:center bottom;background-attachment:scroll;min-height:100%}
|
2410 |
.spBgrepeat{background-repeat:repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
2422 |
.sp-ss-md{padding:4px 10px;font-size:16px}
|
2423 |
.sp-ss-lg{padding:8px 14px;font-size:20px}
|
2424 |
.sp-starrating i:last-of-type{padding-right:0 !important}
|
2425 |
+
summary::-webkit-details-marker{display:none}
|
2426 |
+
details>summary:first-of-type{list-style-type:none}
|
2427 |
+
details{display:block;width:100%}
|
2428 |
+
details .sp-acc-open{display:none}
|
2429 |
+
details[open] .sp-acc-closed{display:none}
|
2430 |
+
details[open] .sp-acc-open{display:block}
|
2431 |
+
summary{outline:0;cursor:pointer}
|
2432 |
+
.woocommerce input,.woocommerce select,.woocommerce textarea{border-color:#ddd;border-style:solid;border-width:1px;background-color:#fff;padding:8px;border-radius:3px}
|
2433 |
+
.woocommerce #place_order{width:100%;margin-top:10px}
|
2434 |
+
.woocommerce #order_review{margin-top:10px}
|
2435 |
+
.woocommerce-additional-fields h3{margin-top:10px}
|
2436 |
+
.wc-proceed-to-checkout .checkout-button{width:100%;text-align:center}
|
2437 |
+
.woocommerce .onsale{min-width:50px !important;min-height:50px !important;font-size:13px}
|
2438 |
.sp-img-block-template-1{border:1px solid #dedede}
|
2439 |
.sp-img-block-template-2{border:1px solid #dedede;padding:5px;background:#fff}
|
2440 |
.sp-img-block-template-6{border:1px solid #dedede;padding:1px;background:#fff}
|
2457 |
.sp-optin-templates .sp-optin-block-template-5,.sp-optin-block-template-5 input{background-color:#414141;border-width:1px;border-color:#333 !important}
|
2458 |
.sp-optin-templates .sp-optin-block-template-6,.sp-optin-block-template-6 input{border-width:0;border-bottom-width:2px}
|
2459 |
.sp-optin-templates .sp-optin-block-template-7,.sp-optin-block-template-7 input{background-color:rgba(255,255,255,0.65);border-width:1px;border-color:rgba(255,255,255,0.65) !important}
|
2460 |
+
.sp-testimonial-img{width:60px;height:60px}
|
2461 |
+
.sp-testimonial-nav button:first-child,.sp-testimonial-nav button:last-child{background:transparent}
|
2462 |
.sp-socialprofiles-style-1 .sp-sp-twitter{color:#1b95e0 !important}
|
2463 |
.sp-socialprofiles-style-1 .sp-sp-facebook{color:#1877f2 !important}
|
2464 |
+
.sp-socialprofiles-style-1 .sp-sp-imdb{color:#f5c517 !important}
|
2465 |
.sp-socialprofiles-style-1 .sp-sp-linkedin{color:#0073b1 !important}
|
2466 |
.sp-socialprofiles-style-1 .sp-sp-pinterest{color:#e60023 !important}
|
2467 |
.sp-socialprofiles-style-1 .sp-sp-youtube{color:#f00 !important}
|
2643 |
.sp-giveaway-wrapper:not(.sp-has-form){background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
2644 |
.sp-form-wrapper:not(.sp-has-form){background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
2645 |
.sp-shortcode-wrapper{background-color:#fcede9;color:#dd4a1f;text-align:center !important;padding:1rem;border-width:1px;border-color:#dd4a1f}
|
2646 |
+
.sp-wccheckout-wrapper .sp-wccheckout-shortcode{display:none}
|
2647 |
+
.sp-wccart-wrapper .sp-wccart-shortcode{display:none}
|
2648 |
+
.sp-wccustomproductsgrid-wrapper .sp-wccustomproductsgrid-shortcode{display:none}
|
2649 |
+
.sp-wccustomproductsgrid-wrapper{pointer-events:none}
|
2650 |
.rpoverlay::after{background-image:linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background-image:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);content:'RafflePress Giveaway Preview';height:100%;position:absolute;top:0;left:0;width:100%;font-size:14px;text-align:center}
|
2651 |
.sp-mobile-view .sp-spacer{height:1vh}
|
2652 |
.sp-mobile-view .sp-countdown-group{flex-wrap:wrap}
|
2653 |
.sp-mobile-view .sp-socialsharing-wrapper,.sp-mobile-view .sp-nav,.sp-mobile-view .sp-button-wrapper,.sp-mobile-view .sp-image-wrapper,.sp-mobile-view .sp-text-wrapper{text-align:center !important;justify-content:center !important}
|
2654 |
.sp-mobile-view .sp-cd-group{margin-bottom:1vh !important}
|
2655 |
+
.sp-mobile-view .sp-el-section,.sp-mobile-view .sp-el-row,.sp-mobile-view .sp-el-col,.sp-mobile-view .sp-el-block,.sp-mobile-view .sp-optin-wrapper,.sp-mobile-view .sp-testimonials-wrapper,.sp-mobile-view .sp-testimonial-wrapper{padding:5px !important}
|
2656 |
+
.sp-mobile-view img:not('.sp-testimonial-img'){height:auto !important}
|
2657 |
.sp-mobile-view .sp-w-full{width:100% !important}
|
2658 |
.sp-mobile-view .sp-optinform-field,.sp-mobile-view .sp-optinform-btn{display:block !important;width:100% !important}
|
2659 |
.seedprod-builder .theme-browser .themes{clear:both}
|
public/css/tailwind.min.css
CHANGED
@@ -6,6 +6,7 @@ pre{font-family:monospace,monospace;font-size:1em}
|
|
6 |
a{background-color:transparent}
|
7 |
b,strong{font-weight:bolder}
|
8 |
code{font-family:monospace,monospace;font-size:1em}
|
|
|
9 |
img{border-style:none}
|
10 |
button,input,select{font-family:inherit;font-size:100%;line-height:1.15;margin:0}
|
11 |
button,input{overflow:visible}
|
@@ -56,10 +57,12 @@ img,video{max-width:100%;height:auto}
|
|
56 |
.sp-form-checkbox:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}
|
57 |
@media not print{.sp-form-checkbox::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}
|
58 |
}.sp-form-checkbox:focus{outline:0;box-shadow:0 0 0 3px rgba(66,153,225,0.5);border-color:#63b3ed}
|
|
|
59 |
.sp-bg-white{background-color:#fff}
|
60 |
.sp-bg-blue-500{background-color:#4299e1}
|
61 |
.hover\:sp-bg-blue-700:hover{background-color:#2b6cb0}
|
62 |
.sp-rounded{border-radius:.25rem}
|
|
|
63 |
.sp-rounded-full{border-radius:9999px}
|
64 |
.sp-rounded-bl{border-bottom-left-radius:.25rem}
|
65 |
.sp-border-dotted{border-style:dotted}
|
@@ -87,6 +90,7 @@ img,video{max-width:100%;height:auto}
|
|
87 |
.sp-font-sans{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
|
88 |
.sp-font-semibold{font-weight:600}
|
89 |
.sp-font-bold{font-weight:700}
|
|
|
90 |
.sp-h-4{height:1rem}
|
91 |
.sp-h-6{height:1.5rem}
|
92 |
.sp-h-8{height:2rem}
|
@@ -94,6 +98,8 @@ img,video{max-width:100%;height:auto}
|
|
94 |
.sp-leading-none{line-height:1}
|
95 |
.sp-m-2{margin:.5rem}
|
96 |
.sp-m-auto{margin:auto}
|
|
|
|
|
97 |
.sp-my-8{margin-top:2rem;margin-bottom:2rem}
|
98 |
.sp-mt-1{margin-top:.25rem}
|
99 |
.sp-mr-1{margin-right:.25rem}
|
@@ -111,7 +117,12 @@ img,video{max-width:100%;height:auto}
|
|
111 |
.sp-mb-6{margin-bottom:1.5rem}
|
112 |
.sp-ml-6{margin-left:1.5rem}
|
113 |
.sp-mt-8{margin-top:2rem}
|
|
|
|
|
|
|
114 |
.sp-opacity-75{opacity:.75}
|
|
|
|
|
115 |
.sp-p-1{padding:.25rem}
|
116 |
.sp-p-3{padding:.75rem}
|
117 |
.sp-p-4{padding:1rem}
|
@@ -141,7 +152,10 @@ img,video{max-width:100%;height:auto}
|
|
141 |
.sp-left-0{left:0}
|
142 |
.sp-shadow-inner{box-shadow:inset 0 2px 4px 0 rgba(0,0,0,0.06)}
|
143 |
.sp-fill-current{fill:currentColor}
|
|
|
144 |
.sp-text-center{text-align:center}
|
|
|
|
|
145 |
.sp-text-white{color:#fff}
|
146 |
.sp-text-xs{font-size:.8125rem}
|
147 |
.sp-text-sm{font-size:.875rem}
|
@@ -152,12 +166,14 @@ img,video{max-width:100%;height:auto}
|
|
152 |
.sp-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
153 |
.sp-whitespace-no-wrap{white-space:nowrap}
|
154 |
.sp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
|
155 |
.sp-w-4{width:1rem}
|
156 |
.sp-w-5{width:1.25rem}
|
157 |
.sp-w-6{width:1.5rem}
|
158 |
.sp-w-8{width:2rem}
|
159 |
.sp-w-24{width:6rem}
|
160 |
.sp-w-full{width:100%}
|
|
|
161 |
.sp-z-40{z-index:40}
|
162 |
.sp-z-50{z-index:50}
|
163 |
html{scroll-behavior:smooth}
|
@@ -184,7 +200,7 @@ html{scroll-behavior:smooth}
|
|
184 |
.sp-header-tag-h1,h1,.sp-header-tag-h2,h2,.sp-header-tag-h3,h3,.sp-header-tag-h4,h4,.sp-header-tag-h5,h5,.sp-header-tag-h6,h6{line-height:1.1}
|
185 |
img{display:inline-block}
|
186 |
.fab{font-weight:normal}
|
187 |
-
.spBgcover{background-size:cover;background-repeat:no-repeat;background-position:center top;background-attachment:
|
188 |
.spBgfull{background-size:100% auto;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
189 |
.spBgfullbottom{background-size:100% auto;background-repeat:no-repeat;background-position:center bottom;background-attachment:scroll;min-height:100%}
|
190 |
.spBgrepeat{background-repeat:repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
@@ -204,8 +220,23 @@ img{display:inline-block}
|
|
204 |
.sp-ss-md{padding:4px 10px;font-size:16px}
|
205 |
.sp-ss-lg{padding:8px 14px;font-size:20px}
|
206 |
.sp-starrating i:last-of-type{padding-right:0 !important}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
#cspio-bypass{border:1px solid #ccc !important}
|
208 |
#cspio-bypass-btn{color:#fff}
|
|
|
209 |
.sp-progressbar-block-template-2>div{border-bottom:3px solid rgba(0,0,0,0.25)}
|
210 |
.sp-progressbar-block-template-3>div{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:16px 16px}
|
211 |
.sp-progressbar-block-template-4>div{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:16px 16px;-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}
|
@@ -213,8 +244,11 @@ img{display:inline-block}
|
|
213 |
to{background-position:0 0}
|
214 |
}@keyframes progress-bar-stripes{from{background-position:0 16px}
|
215 |
to{background-position:0 0}
|
216 |
-
}.sp-
|
|
|
|
|
217 |
.sp-socialprofiles-style-1 .sp-sp-facebook{color:#1877f2 !important}
|
|
|
218 |
.sp-socialprofiles-style-1 .sp-sp-linkedin{color:#0073b1 !important}
|
219 |
.sp-socialprofiles-style-1 .sp-sp-pinterest{color:#e60023 !important}
|
220 |
.sp-socialprofiles-style-1 .sp-sp-youtube{color:#f00 !important}
|
@@ -268,10 +302,10 @@ to{background-position:0 0}
|
|
268 |
.sp-countdown-group{flex-wrap:wrap}
|
269 |
.sp-cd-group{margin-bottom:1vh !important}
|
270 |
.sp-socialsharing-wrapper,.sp-nav,.sp-button-wrapper,.sp-image-wrapper,.sp-text-wrapper{text-align:center !important;justify-content:center !important}
|
271 |
-
.sp-el-section,.sp-el-row,.sp-el-col,.sp-el-block,.sp-optin-wrapper{padding:5px !important}
|
272 |
.sp-w-full{width:100% !important}
|
273 |
.sp-optinform-field,.sp-optinform-btn{display:block !important;width:100% !important}
|
274 |
-
img{height:auto !important}
|
275 |
}#cspio-bypass-btn{font-size:15px;height:27px;padding:0 14px;border-radius:4px}
|
276 |
input[type="password"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem;padding-top:.25rem;padding-right:.5rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.8125rem;line-height:1.5}
|
277 |
.sp-credit{background-color:rgba(0,0,0,0.8);position:fixed;bottom:0;right:20px;font-size:10px;padding:7px;border-radius:2px;line-height:1;color:#fff;z-index:10;font-family:sans-serif;border-top-right-radius:4px;border-top-left-radius:4px}
|
6 |
a{background-color:transparent}
|
7 |
b,strong{font-weight:bolder}
|
8 |
code{font-family:monospace,monospace;font-size:1em}
|
9 |
+
small{font-size:80%}
|
10 |
img{border-style:none}
|
11 |
button,input,select{font-family:inherit;font-size:100%;line-height:1.15;margin:0}
|
12 |
button,input{overflow:visible}
|
57 |
.sp-form-checkbox:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}
|
58 |
@media not print{.sp-form-checkbox::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}
|
59 |
}.sp-form-checkbox:focus{outline:0;box-shadow:0 0 0 3px rgba(66,153,225,0.5);border-color:#63b3ed}
|
60 |
+
.sp-bg-black{background-color:#000}
|
61 |
.sp-bg-white{background-color:#fff}
|
62 |
.sp-bg-blue-500{background-color:#4299e1}
|
63 |
.hover\:sp-bg-blue-700:hover{background-color:#2b6cb0}
|
64 |
.sp-rounded{border-radius:.25rem}
|
65 |
+
.sp-rounded-md{border-radius:.375rem}
|
66 |
.sp-rounded-full{border-radius:9999px}
|
67 |
.sp-rounded-bl{border-bottom-left-radius:.25rem}
|
68 |
.sp-border-dotted{border-style:dotted}
|
90 |
.sp-font-sans{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}
|
91 |
.sp-font-semibold{font-weight:600}
|
92 |
.sp-font-bold{font-weight:700}
|
93 |
+
.sp-h-3{height:.75rem}
|
94 |
.sp-h-4{height:1rem}
|
95 |
.sp-h-6{height:1.5rem}
|
96 |
.sp-h-8{height:2rem}
|
98 |
.sp-leading-none{line-height:1}
|
99 |
.sp-m-2{margin:.5rem}
|
100 |
.sp-m-auto{margin:auto}
|
101 |
+
.sp-mx-1{margin-left:.25rem;margin-right:.25rem}
|
102 |
+
.sp-mx-4{margin-left:1rem;margin-right:1rem}
|
103 |
.sp-my-8{margin-top:2rem;margin-bottom:2rem}
|
104 |
.sp-mt-1{margin-top:.25rem}
|
105 |
.sp-mr-1{margin-right:.25rem}
|
117 |
.sp-mb-6{margin-bottom:1.5rem}
|
118 |
.sp-ml-6{margin-left:1.5rem}
|
119 |
.sp-mt-8{margin-top:2rem}
|
120 |
+
.sp-object-cover{-o-object-fit:cover;object-fit:cover}
|
121 |
+
.sp-opacity-25{opacity:.25}
|
122 |
+
.sp-opacity-50{opacity:.5}
|
123 |
.sp-opacity-75{opacity:.75}
|
124 |
+
.sp-outline-none{outline:0}
|
125 |
+
.focus\:sp-outline-none:focus{outline:0}
|
126 |
.sp-p-1{padding:.25rem}
|
127 |
.sp-p-3{padding:.75rem}
|
128 |
.sp-p-4{padding:1rem}
|
152 |
.sp-left-0{left:0}
|
153 |
.sp-shadow-inner{box-shadow:inset 0 2px 4px 0 rgba(0,0,0,0.06)}
|
154 |
.sp-fill-current{fill:currentColor}
|
155 |
+
.sp-text-left{text-align:left}
|
156 |
.sp-text-center{text-align:center}
|
157 |
+
.sp-text-right{text-align:right}
|
158 |
+
.sp-text-black{color:#000}
|
159 |
.sp-text-white{color:#fff}
|
160 |
.sp-text-xs{font-size:.8125rem}
|
161 |
.sp-text-sm{font-size:.875rem}
|
166 |
.sp-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
167 |
.sp-whitespace-no-wrap{white-space:nowrap}
|
168 |
.sp-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
169 |
+
.sp-w-3{width:.75rem}
|
170 |
.sp-w-4{width:1rem}
|
171 |
.sp-w-5{width:1.25rem}
|
172 |
.sp-w-6{width:1.5rem}
|
173 |
.sp-w-8{width:2rem}
|
174 |
.sp-w-24{width:6rem}
|
175 |
.sp-w-full{width:100%}
|
176 |
+
.sp-z-0{z-index:0}
|
177 |
.sp-z-40{z-index:40}
|
178 |
.sp-z-50{z-index:50}
|
179 |
html{scroll-behavior:smooth}
|
200 |
.sp-header-tag-h1,h1,.sp-header-tag-h2,h2,.sp-header-tag-h3,h3,.sp-header-tag-h4,h4,.sp-header-tag-h5,h5,.sp-header-tag-h6,h6{line-height:1.1}
|
201 |
img{display:inline-block}
|
202 |
.fab{font-weight:normal}
|
203 |
+
.spBgcover{background-size:cover;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
204 |
.spBgfull{background-size:100% auto;background-repeat:no-repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
205 |
.spBgfullbottom{background-size:100% auto;background-repeat:no-repeat;background-position:center bottom;background-attachment:scroll;min-height:100%}
|
206 |
.spBgrepeat{background-repeat:repeat;background-position:center top;background-attachment:scroll;min-height:100%}
|
220 |
.sp-ss-md{padding:4px 10px;font-size:16px}
|
221 |
.sp-ss-lg{padding:8px 14px;font-size:20px}
|
222 |
.sp-starrating i:last-of-type{padding-right:0 !important}
|
223 |
+
summary::-webkit-details-marker{display:none}
|
224 |
+
details>summary:first-of-type{list-style-type:none}
|
225 |
+
details{display:block;width:100%}
|
226 |
+
details .sp-acc-open{display:none}
|
227 |
+
details[open] .sp-acc-closed{display:none}
|
228 |
+
details[open] .sp-acc-open{display:block}
|
229 |
+
summary{outline:0;cursor:pointer}
|
230 |
+
.woocommerce input,.woocommerce select,.woocommerce textarea{border-color:#ddd;border-style:solid;border-width:1px;background-color:#fff;padding:8px;border-radius:3px}
|
231 |
+
.select2-container--default .select2-selection--single{border-color:#ddd !important;padding-top:2px;height:36px !important}
|
232 |
+
.select2-selection__rendered{border-color:transparent !important}
|
233 |
+
.woocommerce #place_order{width:100%;margin-top:10px}
|
234 |
+
.woocommerce-additional-fields h3{margin-top:10px}
|
235 |
+
.wc-proceed-to-checkout .checkout-button{width:100%;text-align:center}
|
236 |
+
.woocommerce .onsale{min-width:50px !important;min-height:50px !important;font-size:13px}
|
237 |
#cspio-bypass{border:1px solid #ccc !important}
|
238 |
#cspio-bypass-btn{color:#fff}
|
239 |
+
.sp-testimonials-wrapper{position:relative}
|
240 |
.sp-progressbar-block-template-2>div{border-bottom:3px solid rgba(0,0,0,0.25)}
|
241 |
.sp-progressbar-block-template-3>div{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:16px 16px}
|
242 |
.sp-progressbar-block-template-4>div{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:16px 16px;-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}
|
244 |
to{background-position:0 0}
|
245 |
}@keyframes progress-bar-stripes{from{background-position:0 16px}
|
246 |
to{background-position:0 0}
|
247 |
+
}.sp-testimonial-img{width:60px;height:60px}
|
248 |
+
.sp-testimonial-nav button:first-child,.sp-testimonial-nav button:last-child{background:transparent}
|
249 |
+
.sp-socialprofiles-style-1 .sp-sp-twitter{color:#1b95e0 !important}
|
250 |
.sp-socialprofiles-style-1 .sp-sp-facebook{color:#1877f2 !important}
|
251 |
+
.sp-socialprofiles-style-1 .sp-sp-imdb{color:#f5c517 !important}
|
252 |
.sp-socialprofiles-style-1 .sp-sp-linkedin{color:#0073b1 !important}
|
253 |
.sp-socialprofiles-style-1 .sp-sp-pinterest{color:#e60023 !important}
|
254 |
.sp-socialprofiles-style-1 .sp-sp-youtube{color:#f00 !important}
|
302 |
.sp-countdown-group{flex-wrap:wrap}
|
303 |
.sp-cd-group{margin-bottom:1vh !important}
|
304 |
.sp-socialsharing-wrapper,.sp-nav,.sp-button-wrapper,.sp-image-wrapper,.sp-text-wrapper{text-align:center !important;justify-content:center !important}
|
305 |
+
.sp-el-section,.sp-el-row,.sp-el-col,.sp-el-block,.sp-optin-wrapper,.sp-testimonials-wrapper,.sp-testimonial-wrapper{padding:5px !important}
|
306 |
.sp-w-full{width:100% !important}
|
307 |
.sp-optinform-field,.sp-optinform-btn{display:block !important;width:100% !important}
|
308 |
+
img:not('.sp-testimonial-img'){height:auto !important}
|
309 |
}#cspio-bypass-btn{font-size:15px;height:27px;padding:0 14px;border-radius:4px}
|
310 |
input[type="password"]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#e2e8f0;border-width:1px;border-radius:.25rem;padding-top:.25rem;padding-right:.5rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.8125rem;line-height:1.5}
|
311 |
.sp-credit{background-color:rgba(0,0,0,0.8);position:fixed;bottom:0;right:20px;font-size:10px;padding:7px;border-radius:2px;line-height:1;color:#fff;z-index:10;font-family:sans-serif;border-top-right-radius:4px;border-top-left-radius:4px}
|
public/js/sp-scripts.js
CHANGED
@@ -163,10 +163,9 @@ function sp_send_request(token, id) {
|
|
163 |
// errorString += value ;
|
164 |
// });
|
165 |
// alert(errorString);
|
|
|
|
|
166 |
|
167 |
-
|
168 |
-
console.log(j1);
|
169 |
-
console.log(j2);
|
170 |
});
|
171 |
return;
|
172 |
} // countdown
|
@@ -220,7 +219,8 @@ function countdown(type, ts, id, action, redirect) {
|
|
220 |
} // redirect
|
221 |
|
222 |
|
223 |
-
if (action
|
|
|
224 |
window.location.href = redirect;
|
225 |
}
|
226 |
}
|
@@ -297,4 +297,107 @@ function seedprod_bg_slideshow(selector, slides) {
|
|
297 |
preloadImages[i] = new Image();
|
298 |
preloadImages[i].src = val;
|
299 |
});
|
300 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
// errorString += value ;
|
164 |
// });
|
165 |
// alert(errorString);
|
166 |
+
// console.log(j1);
|
167 |
+
// console.log(j2);
|
168 |
|
|
|
|
|
|
|
169 |
});
|
170 |
return;
|
171 |
} // countdown
|
219 |
} // redirect
|
220 |
|
221 |
|
222 |
+
if (action == "2") {
|
223 |
+
jQuery("#sp-countdown-" + id + " .sp-countdown-group").hide();
|
224 |
window.location.href = redirect;
|
225 |
}
|
226 |
}
|
297 |
preloadImages[i] = new Image();
|
298 |
preloadImages[i].src = val;
|
299 |
});
|
300 |
+
}
|
301 |
+
|
302 |
+
jQuery('.sp-testimonial-nav button').click(function () {
|
303 |
+
var currentId = '#' + jQuery(this).parents('.sp-testimonials-wrapper').attr('id');
|
304 |
+
var currentButtonIndex = jQuery(currentId + ' .sp-testimonial-nav button').index(this);
|
305 |
+
var currentIndex = 0;
|
306 |
+
var testimonials = jQuery('.sp-testimonial-wrapper', jQuery(this).parents(currentId));
|
307 |
+
jQuery(testimonials).each(function (index) {
|
308 |
+
var o = jQuery(this).css('opacity');
|
309 |
+
|
310 |
+
if (o == 1) {
|
311 |
+
currentIndex = index;
|
312 |
+
}
|
313 |
+
});
|
314 |
+
var buttonsLength = jQuery(currentId + ' .sp-testimonial-nav button').length - 1;
|
315 |
+
var currentButtonIndexData = jQuery(currentId + ' .sp-testimonial-nav button').eq(currentButtonIndex).attr('data-index'); // check for previous button click
|
316 |
+
|
317 |
+
if (currentButtonIndex == 0) {
|
318 |
+
if (0 == currentIndex) {
|
319 |
+
currentIndex = testimonials.length - 1;
|
320 |
+
} else {
|
321 |
+
currentIndex--;
|
322 |
+
}
|
323 |
+
} // check for next button click
|
324 |
+
|
325 |
+
|
326 |
+
if (currentButtonIndex == buttonsLength) {
|
327 |
+
if (testimonials.length - 1 == currentIndex) {
|
328 |
+
currentIndex = 0;
|
329 |
+
} else {
|
330 |
+
currentIndex++;
|
331 |
+
}
|
332 |
+
} // reset states
|
333 |
+
|
334 |
+
|
335 |
+
testimonials.css({
|
336 |
+
'opacity': 0,
|
337 |
+
'height': '0',
|
338 |
+
'position': 'absolute'
|
339 |
+
});
|
340 |
+
jQuery(currentId + ' .sp-testimonial-nav button[data-index]').css({
|
341 |
+
'opacity': 0.25
|
342 |
+
}); // select testimonial and button
|
343 |
+
|
344 |
+
if (currentButtonIndexData !== undefined) {
|
345 |
+
currentIndex = currentButtonIndexData;
|
346 |
+
jQuery(testimonials).eq(currentIndex).css({
|
347 |
+
'opacity': 1,
|
348 |
+
'height': 'auto',
|
349 |
+
'position': 'initial'
|
350 |
+
});
|
351 |
+
jQuery(currentId + ' .sp-testimonial-nav button').eq(currentButtonIndex).css({
|
352 |
+
'opacity': 1
|
353 |
+
});
|
354 |
+
} else {
|
355 |
+
jQuery(testimonials).eq(currentIndex).css({
|
356 |
+
'opacity': 1,
|
357 |
+
'height': 'auto',
|
358 |
+
'position': 'initial'
|
359 |
+
});
|
360 |
+
jQuery(currentId + ' .sp-testimonial-nav button').eq(currentIndex + 1).css({
|
361 |
+
'opacity': 1
|
362 |
+
});
|
363 |
+
}
|
364 |
+
});
|
365 |
+
var testimonial_timers = {};
|
366 |
+
jQuery(".sp-testimonials-wrapper").each(function (index) {
|
367 |
+
var currentId = '#' + jQuery(this).attr('id');
|
368 |
+
var autoPlay = jQuery(this).attr('data-autoplay');
|
369 |
+
var speed = jQuery(this).attr('data-speed');
|
370 |
+
|
371 |
+
if (speed === '') {
|
372 |
+
speed = 5000;
|
373 |
+
} else {
|
374 |
+
speed = parseInt(speed) * 1000;
|
375 |
+
}
|
376 |
+
|
377 |
+
if (autoPlay !== undefined) {
|
378 |
+
testimonial_timers[currentId] = setInterval(function () {
|
379 |
+
jQuery(currentId + ' .sp-testimonial-nav button:last-child').trigger('click');
|
380 |
+
}, speed);
|
381 |
+
}
|
382 |
+
});
|
383 |
+
jQuery(".sp-testimonials-wrapper").hover(function () {
|
384 |
+
var id = '#' + jQuery(this).attr('id');
|
385 |
+
clearInterval(testimonial_timers[id]);
|
386 |
+
});
|
387 |
+
jQuery(".sp-testimonials-wrapper").mouseleave(function () {
|
388 |
+
var currentId = '#' + jQuery(this).attr('id');
|
389 |
+
var autoPlay = jQuery(this).attr('data-autoplay');
|
390 |
+
var speed = jQuery(this).attr('data-speed');
|
391 |
+
|
392 |
+
if (speed === '') {
|
393 |
+
speed = 5000;
|
394 |
+
} else {
|
395 |
+
speed = parseInt(speed) * 1000;
|
396 |
+
}
|
397 |
+
|
398 |
+
if (autoPlay !== undefined) {
|
399 |
+
testimonial_timers[currentId] = setInterval(function () {
|
400 |
+
jQuery(currentId + ' .sp-testimonial-nav button:last-child').trigger('click');
|
401 |
+
}, speed);
|
402 |
+
}
|
403 |
+
});
|
public/js/sp-scripts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){var
|
1 |
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){var r,n;"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,r=e.Cookies,(n=e.Cookies=t()).noConflict=function(){return e.Cookies=r,n})}(void 0,function(){function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var u={read:function(e){return e.replace(/%3B/g,";")},write:function(e){return e.replace(/;/g,"%3B")}};return function t(s,i){function r(e,t,r){if("undefined"!=typeof document){"number"==typeof(r=a({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=u.write(e).replace(/=/g,"%3D"),t=s.write(String(t),e);var n="";for(var o in r)r[o]&&(n+="; "+o,!0!==r[o]&&(n+="="+r[o].split(";")[0]));return document.cookie=e+"="+t+n}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},n=0;n<t.length;n++){var o=t[n].split("="),i=o.slice(1).join("="),a=u.read(o[0]).replace(/%3D/g,"=");if(r[a]=s.read(i,a),e===a)break}return e?r[e]:r}},remove:function(e,t){r(e,"",a({},t,{expires:-1}))},withAttributes:function(e){return t(this.converter,a({},this.attributes,e))},withConverter:function(e){return t(a({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(s)}})}(u,{path:"/"})});var seedprodCookies=Cookies.noConflict(),sp_emplacementRecaptcha=[],sp_option_id="";jQuery("form[id^=sp-optin-form]").submit(function(e){e.preventDefault();var t=jQuery(this).attr("id").replace("sp-optin-form-","");if(1===seeprod_enable_recaptcha)grecaptcha.execute(sp_emplacementRecaptcha[t]);else{sp_send_request("",t)}});var sp_CaptchaCallback=function(){jQuery("div[id^=recaptcha-]").each(function(e,t){sp_option_id=t.id.replace("recaptcha-",""),sp_emplacementRecaptcha[sp_option_id]=grecaptcha.render(t,{sitekey:"6LdfOukUAAAAAMCOEFEZ9WOSKyoYrxJcgXsf66Xr",badge:"bottomright",type:"image",size:"invisible",callback:function(e){sp_send_request(e,sp_option_id)}})})};function sp_send_request(e,o){var t=jQuery("#sp-optin-form-"+o).serialize(),r=jQuery.ajax({url:seedprod_api_url+"subscribers",type:"post",dataType:"json",timeout:5e3,data:t});jQuery("#sp-optin-form-"+o+" .sp-optin-submit").addClass("sp-ajax-striped sp-ajax-animated");var n=jQuery.ajax({url:sp_subscriber_callback_url,type:"post",timeout:3e4,data:t});jQuery.when(r,n).done(function(e,t){var r=jQuery("#sp-optin-form-"+o+" input[name^='seedprod_action']").val();if("1"==r&&(jQuery("#sp-optin-form-"+o).hide(),jQuery("#sp-optin-success-"+o).show()),"2"===r){var n=jQuery("#sp-optin-form-"+o+" input[name^='redirect_url']").val();window.location.href=n}jQuery("#sp-optin-form-"+o+" .sp-optin-submit").removeClass("sp-ajax-striped sp-ajax-animated")}).fail(function(e,t,r){jQuery("#sp-optin-form-"+o+" .sp-optin-submit").removeClass("sp-ajax-striped sp-ajax-animated"),1===seeprod_enable_recaptcha&&grecaptcha.reset(sp_emplacementRecaptcha[o])})}var x=[];function countdown(e,a,s,u,p){var t=(new Date).getTime();if("vt"==e){a+=t;var r=seedprodCookies.get("seedprod_enddate_"+s);null!=r&&(a=r,seedprodCookies.set("seedprod_enddate_"+s,a,{expires:360}))}x[s]=setInterval(function(){var e=(new Date).getTime(),t=a-e,r=Math.floor(t/864e5),n=Math.floor(t%864e5/36e5),o=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);0==r?jQuery("#sp-cd-days-"+s).hide():jQuery("#sp-cd-days-"+s+" .sp-cd-amount").html(pad(r,2)),jQuery("#sp-cd-hours-"+s+" .sp-cd-amount").html(pad(n,2)),jQuery("#sp-cd-minutes-"+s+" .sp-cd-amount").html(pad(o,2)),jQuery("#sp-cd-seconds-"+s+" .sp-cd-amount").html(pad(i,2)),t<0&&(clearInterval(x[s]),"1"==u&&(jQuery("#sp-countdown-"+s+" .sp-countdown-group").hide(),jQuery("#sp-countdown-expired-"+s).show()),"2"==u&&(jQuery("#sp-countdown-"+s+" .sp-countdown-group").hide(),window.location.href=p))},1e3)}function pad(e,t,r){return r=r||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(r)+e}function seedprod_bg_slideshow(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:5e3,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"ease-in",o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:500;document.querySelector(e).style.backgroundSize="cover",document.querySelector(e).style.backgroundRepeat="no-repeat",document.querySelector(e).style.backgroundPosition="center center";var i="all "+o+"ms "+n;document.querySelector(e).style.WebkitTransition=i,document.querySelector(e).style.MozTransition=i,document.querySelector(e).style.MsTransition=i,document.querySelector(e).style.OTransition=i,document.querySelector(e).style.transition=i;var a=0;document.querySelector(e).style.backgroundImage="url('"+t[a]+"')",a++,setInterval(function(){document.querySelector(e).style.backgroundImage="url('"+t[a]+"')",++a>=t.length&&(a=0)},r);var s=new Array;t.forEach(function(e,t){s[t]=new Image,s[t].src=e})}jQuery(document).ready(function(e){e('link[href*="/wp-content/themes/"]').remove()}),jQuery(".sp-testimonial-nav button").click(function(){var e="#"+jQuery(this).parents(".sp-testimonials-wrapper").attr("id"),t=jQuery(e+" .sp-testimonial-nav button").index(this),r=0,n=jQuery(".sp-testimonial-wrapper",jQuery(this).parents(e));jQuery(n).each(function(e){1==jQuery(this).css("opacity")&&(r=e)});var o=jQuery(e+" .sp-testimonial-nav button").length-1,i=jQuery(e+" .sp-testimonial-nav button").eq(t).attr("data-index");0==t&&(0==r?r=n.length-1:r--),t==o&&(n.length-1==r?r=0:r++),n.css({opacity:0,height:"0",position:"absolute"}),jQuery(e+" .sp-testimonial-nav button[data-index]").css({opacity:.25}),void 0!==i?(r=i,jQuery(n).eq(r).css({opacity:1,height:"auto",position:"initial"}),jQuery(e+" .sp-testimonial-nav button").eq(t).css({opacity:1})):(jQuery(n).eq(r).css({opacity:1,height:"auto",position:"initial"}),jQuery(e+" .sp-testimonial-nav button").eq(r+1).css({opacity:1}))});var testimonial_timers={};jQuery(".sp-testimonials-wrapper").each(function(e){var t="#"+jQuery(this).attr("id"),r=jQuery(this).attr("data-autoplay"),n=jQuery(this).attr("data-speed");n=""===n?5e3:1e3*parseInt(n),void 0!==r&&(testimonial_timers[t]=setInterval(function(){jQuery(t+" .sp-testimonial-nav button:last-child").trigger("click")},n))}),jQuery(".sp-testimonials-wrapper").hover(function(){var e="#"+jQuery(this).attr("id");clearInterval(testimonial_timers[e])}),jQuery(".sp-testimonials-wrapper").mouseleave(function(){var e="#"+jQuery(this).attr("id"),t=jQuery(this).attr("data-autoplay"),r=jQuery(this).attr("data-speed");r=""===r?5e3:1e3*parseInt(r),void 0!==t&&(testimonial_timers[e]=setInterval(function(){jQuery(e+" .sp-testimonial-nav button:last-child").trigger("click")},r))});
|
public/js/toolbar.js
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function( window, wp ){
|
2 |
+
|
3 |
+
var link_id = 'edit_seedprod_custom_link';
|
4 |
+
|
5 |
+
var url_string = window.location;
|
6 |
+
var url = new URL(url_string);
|
7 |
+
var post_id = url.searchParams.get("post");
|
8 |
+
|
9 |
+
var active_seedprod_btn = jQuery(".active-seed-prod-buttons").html();
|
10 |
+
jQuery(".active-seed-prod-buttons").remove();
|
11 |
+
|
12 |
+
var link_html = active_seedprod_btn;
|
13 |
+
|
14 |
+
var post_ID = jQuery("#post_ID").val();
|
15 |
+
var seedprod_template_type = jQuery("._seedprod_template_type").val();
|
16 |
+
var seedprod_label = jQuery("._seedprod_label").val();
|
17 |
+
var seedprod_template_edit_url = jQuery("._seedprod_template_edit_url").val();
|
18 |
+
var seedprod_true = jQuery("._seedprod_true").val();
|
19 |
+
|
20 |
+
var seedprod_template_edit_url_ = '';
|
21 |
+
var admin_url = localizedVars.admin_url;
|
22 |
+
var seedprod_plugin_url = localizedVars.plugin_url;
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
if(seedprod_template_type=="template"){
|
29 |
+
seedprod_template_edit_url_ = `${admin_url}?page=${seedprod_label}_${seedprod_template_type}&id=${post_ID}#/template/${post_ID}`;
|
30 |
+
}else{
|
31 |
+
seedprod_template_edit_url_ = `${admin_url}?page=${seedprod_label}_${seedprod_template_type}&id=${post_ID}#/setup/${post_ID}`;
|
32 |
+
}
|
33 |
+
|
34 |
+
//${seedprod_template_edit_url_}
|
35 |
+
|
36 |
+
var seedprod_html = `
|
37 |
+
<div class="${seedprod_true}">
|
38 |
+
<span class="seedprod-off">
|
39 |
+
<a href="#edit" id="edit_seedprod_custom_link" class="edit_seedprod_custom_link button button-primary button-large">
|
40 |
+
<img src="${seedprod_plugin_url}public/svg/admin-bar-icon.svg" style="margin-right:7px; margin-top:5px"> Edit with SeedProd
|
41 |
+
</a>
|
42 |
+
</span>
|
43 |
+
<span class="seedprod-on">
|
44 |
+
<a href="#back" class="back_to_wp_editor button">Back to WordPress Editor</a>
|
45 |
+
</span>
|
46 |
+
</div>`;
|
47 |
+
|
48 |
+
// check if gutenberg's editor root element is present.
|
49 |
+
var editorEl = document.getElementById( 'editor' );
|
50 |
+
if( !editorEl ){ // do nothing if there's no gutenberg root element on page.
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
|
54 |
+
var unsubscribe = wp.data.subscribe( function () {
|
55 |
+
setTimeout( function () {
|
56 |
+
if ( !document.getElementById( link_id ) ) {
|
57 |
+
var toolbalEl = editorEl.querySelector( '.edit-post-header-toolbar__left' );
|
58 |
+
if( toolbalEl instanceof HTMLElement ){
|
59 |
+
toolbalEl.insertAdjacentHTML( 'beforeend', seedprod_html );
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}, 1 )
|
63 |
+
} );
|
64 |
+
// unsubscribe is a function - it's not used right now
|
65 |
+
// but in case you'll need to stop this link from being reappeared at any point you can just call unsubscribe();
|
66 |
+
|
67 |
+
|
68 |
+
/*
|
69 |
+
jQuery(document).ready(function(){
|
70 |
+
jQuery(document).on("click", '.back_to_wp_editor', function(event) {
|
71 |
+
|
72 |
+
wp.data.dispatch( 'core/block-editor' ).resetBlocks([]);
|
73 |
+
jQuery('.block-editor-block-list__layout').show();
|
74 |
+
jQuery(".managed_by_seedprod").hide();
|
75 |
+
|
76 |
+
var ajax_url = localizedVars.ajax_url;
|
77 |
+
var post_id = jQuery("#post_ID").val();
|
78 |
+
|
79 |
+
var formData = new FormData();
|
80 |
+
formData.append('action', 'seedprod_pro_remove_post');
|
81 |
+
formData.append('post_id', post_id);
|
82 |
+
|
83 |
+
jQuery.ajax({ // JQuery Ajax
|
84 |
+
type: 'POST',
|
85 |
+
url: ajax_url,
|
86 |
+
data: formData,
|
87 |
+
cache: false,
|
88 |
+
processData : false,
|
89 |
+
contentType: false,
|
90 |
+
success: function(data) {
|
91 |
+
console.log("removed seedprod settings");
|
92 |
+
},
|
93 |
+
});
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
});
|
98 |
+
});
|
99 |
+
*/
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
} )( window, wp )
|
public/lite/vue-backend/js/admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(t){function s(s){for(var a,i,r=s[0],p=s[1],l=s[2],d=0,u=[];d<r.length;d++)i=r[d],n[i]&&u.push(n[i][0]),n[i]=0;for(a in p)Object.prototype.hasOwnProperty.call(p,a)&&(t[a]=p[a]);c&&c(s);while(u.length)u.shift()();return o.push.apply(o,l||[]),e()}function e(){for(var t,s=0;s<o.length;s++){for(var e=o[s],a=!0,r=1;r<e.length;r++){var p=e[r];0!==n[p]&&(a=!1)}a&&(o.splice(s--,1),t=i(i.s=e[0]))}return t}var a={},n={admin:0},o=[];function i(s){if(a[s])return a[s].exports;var e=a[s]={i:s,l:!1,exports:{}};return t[s].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=t,i.c=a,i.d=function(t,s,e){i.o(t,s)||Object.defineProperty(t,s,{enumerable:!0,get:e})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,s){if(1&s&&(t=i(t)),8&s)return t;if(4&s&&"object"===typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(i.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&s&&"string"!=typeof t)for(var a in t)i.d(e,a,function(s){return t[s]}.bind(null,a));return e},i.n=function(t){var s=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(s,"a",s),s},i.o=function(t,s){return Object.prototype.hasOwnProperty.call(t,s)},i.p="/wp-content/plugins/seedprod-pro/public/lite/vue-backend/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],p=r.push.bind(r);r.push=s,r=r.slice();for(var l=0;l<r.length;l++)s(r[l]);var c=p;o.push([1,"chunk-vendors","chunk-common"]),e()})({1:function(t,s,e){t.exports=e("9150")},9150:function(t,s,e){"use strict";e.r(s);e("7f7f"),e("cadf"),e("551c"),e("f751"),e("097d");var a,n=e("2b0e"),o=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"seedprod-app seedprod sp-antialiased sp-font-display"},["seedprod_lite"==t.shared.page_path&&t.shared.show_topbar_cta?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-2 sp-px-8 sp-text-sm sp-flex sp-justify-center sp-leading-normal sp-relative"},[t._v("\n You’re using SeedProd Lite. To unlock more features consider\n "),e("a",{staticClass:"sp-ml-1 sp-text-white hover:sp-text-white sp-no-underline sp-border-0 sp-border-b sp-border-white sp-border-dotted",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=plugintopbar",target:"_blank"}},[t._v("upgrading to Pro")]),e("span",{staticClass:"sp-text-white sp-absolute sp-cursor-pointer sp-right-0 sp-top-0 sp-opacity-75 sp-mt-2 sp-mr-1",on:{click:t.dismiss_upsell}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])])]):t._e(),!1===t.shared.seedprod_csp4_migrated&&1==t.shared.seedprod_csp4_imported?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-4 sp-px-8 sp-text-lg sp-flex sp-justify-center sp-leading-normal"},[e("svg",{staticClass:"sp-fill-current sp-w-20 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12zM11 5h2v6h-2zm0 8h2v2h-2z"}})]),t._m(0)]):t._e(),!1===t.shared.seedprod_cspv5_migrated&&1==t.shared.seedprod_cspv5_imported?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-4 sp-px-8 sp-text-lg sp-flex sp-justify-center sp-leading-normal"},[e("svg",{staticClass:"sp-fill-current sp-w-20 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12zM11 5h2v6h-2zm0 8h2v2h-2z"}})]),e("div",[t._v("\n We have migrated your page settings from the old version to our new builder. Don't worry nothing has changed with your pages. However, a lot has changed in the plugin.\n "),e("a",{staticClass:"sp-text-white sp-font-bold",attrs:{href:"https://www.seedprod.com/docs/migrating-from-the-previous-pro-version/?dep="+t.shared.seedprod_unsupported_feature,target:"_blank"}},[t._v("Learn more about the all new SeedProd plugin and how to complete the migration process.")])])]):t._e(),"welcome"!=t.$router.currentRoute.name?e("div",{staticClass:"sp-bg-white sp--ml-5 sp-pt-6 sp-pb-8 sp-px-8 sp-text-neutral sp-flex sp-items-end sp-justify-between"},[e("div",{staticClass:"sp-flex sp-items-end sp-flex-1"},[e("img",{attrs:{id:"seedprod-logo",src:t.shared.plugin_path+"public/svg/seedprod-logo.svg",alt:t.txt_6}}),e("span",{staticClass:"sp-inline-block sp-px-6 sp-flex sp-items-end"},[e("svg",{attrs:{width:"12",height:"29",viewBox:"0 0 12 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 28L11 0.999998",stroke:"#D3CED2"}})])]),"pages"==this.$route.name||"dashboard"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_1))]):t._e(),"growthtools"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_2))]):t._e(),"aboutus_aboutus"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_3))]):t._e(),"subscribers"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_4))]):t._e(),"settings_general"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_5))]):t._e()]),e("div",[e("a",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-15 sp-rounded-full sp-flex sp-items-center sp-justify-center sp-p-c63 sp-text-neutral-60",attrs:{href:"https://www.seedprod.com/docs/",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"}})])])])]):t._e(),t.shared.notifications.length>0?e("div",{staticClass:"sp-ml-3 sp-bg-white sp-rounded sp-p-4 sp-mt-4 sp-mr-4 sp-flex sp-shadow"},[t.shared.notifications[t.notification_index].img?e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.notifications[t.notification_index].img}}):e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/bell.svg"}}),e("div",{staticClass:"sp-flex-1"},[e("div",{staticClass:"sp-text-lg sp-font-semibold sp-mb-2 sp-flex sp-justify-between"},[t._v("\n "+t._s(t.shared.notifications[t.notification_index].title)+"\n "),e("span",{staticClass:"sp-cursor-pointer sp-text-neutral-40 hover:sp-text-red",on:{click:function(s){return t.dismiss_notifications(t.shared.notifications[t.notification_index].id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])])]),e("div",{staticClass:"sp-mb-3 sp-text-base",domProps:{innerHTML:t._s(t.shared.notifications[t.notification_index].content)}}),e("div",{staticClass:"sp-flex sp-justify-between sp-items-center"},[e("div",[t.shared.notifications[t.notification_index].btns.main?e("a",{staticClass:"button button-primary sp-mr-2",attrs:{href:t.shared.notifications[t.notification_index].btns.main.url,target:"_blank"}},[t._v(t._s(t.shared.notifications[t.notification_index].btns.main.text))]):t._e(),t.shared.notifications[t.notification_index].btns.alt?e("a",{staticClass:"button button-secondary",attrs:{href:t.shared.notifications[t.notification_index].btns.alt.url,target:"_blank"}},[t._v(t._s(t.shared.notifications[t.notification_index].btns.alt.text))]):t._e()]),e("div",[e("a",{staticClass:"sp-cursor-pointer sp-border sp-border-neutral-20 sp-border-solid sp-rounded sp-p-2 sp-text-10px sp-text-neutral-40 hover:sp-border-neutral-40 hover:sp-text-40 sp-mr-1",class:{"sp-invisible":0==t.notification_index},attrs:{title:t.txt_7},on:{click:function(s){return s.preventDefault(),t.scroll_notifications("prev")}}},[e("i",{staticClass:"fa fa-chevron-left",attrs:{"aria-hidden":"true"}})]),e("a",{staticClass:"sp-cursor-pointer sp-border sp-border-neutral-20 sp-border-solid sp-rounded sp-p-2 sp-text-10px sp-text-neutral-40 hover:sp-border-neutral-40 hover:sp-text-40",class:{"sp-invisible":t.notification_index==t.shared.notifications.length-1},attrs:{title:t.txt_8},on:{click:function(s){return s.preventDefault(),t.scroll_notifications("next")}}},[e("i",{staticClass:"fa fa-chevron-right",attrs:{"aria-hidden":"true"}})])])])])]):t._e(),e("div",{staticClass:"sp-pl-3 sp-pr-8"},[e("keep-alive",[e("router-view")],1)],1)])},i=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[t._v('\n We have migrated your page settings from the old version to our new builder. Don\'t worry nothing has changed with your page. Your old version will continue to display until you click "Edit" on the Coming Soon or Maintenance Page and then "Save". After Saving the new version will be displayed.\n '),e("br"),e("a",{staticClass:"sp-text-white sp-font-bold",attrs:{href:"https://www.seedprod.com/docs/migrating-from-the-previous-free-version/",target:"_blank"}},[t._v("Learn more about the all new SeedProd plugin and how to complete the migration process.")])])}],r=e("4328"),p=e.n(r),l=(e("2ef0"),e("561c")),c={data:function(){return{txt_1:Object(l["a"])("Pages","coming-soon"),txt_2:Object(l["a"])("Growth Tools","coming-soon"),txt_3:Object(l["a"])("About Us","coming-soon"),txt_4:Object(l["a"])("Subscribers","coming-soon"),txt_5:Object(l["a"])("Settings","coming-soon"),txt_6:Object(l["a"])("SeedProd Logo","coming-soon"),txt_7:Object(l["a"])("Previous message ","coming-soon"),txt_8:Object(l["a"])("Next message","coming-soon"),notification_index:0,shared:seedprod_store_admin}},mounted:function(){},watch:{$route:function(t,s){jQuery("html").scrollTop(0)}},methods:{dismiss_upsell:function(){var t=p.a.stringify({id:1});this.axios.post(seedprod_dismiss_upsell,t,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.status&&location.reload()})},dismiss_notifications:function(t){var s=this,e=p.a.stringify({id:t});s.$delete(s.shared.notifications,s.notification_index),s.notification_index>0?s.notification_index=s.notification_index-1:s.notification_index.length>1&&0==s.notification_index?s.notification_index=s.notification_index+1:s.notification_index=0,this.axios.post(seedprod_notification_dismiss,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.success&&location.reload()})},scroll_notifications:function(t){"prev"==t&&this.notification_index--,"next"==t&&this.notification_index++},goto_settings:function(){this.$router.push({name:"settings"}).catch(function(t){})},show_upgrade_notice:function(t,s){var e=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"link",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n?(t="Upgrade to PRO",s="Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features."):(t+=" is a PRO Feature",s="We're sorry, the "+s+" feature is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features."),this.$swal({title:t,text:s,type:"success",showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:"UPGRADE TO PRO"}).then(function(t){t.value&&(window.open(e.shared.upgrade_link+a,"_blank"),e.$swal.fire("","Thanks for your interest in SeedProd Pro!<br>If you have any questions or issues just <a href='https://www.seedprod.com/?contact=1' target='_blank'>let us know</a>.<br><br>After purchasing SeedProd Pro, you'll need to download and install the Pro version of the plugin, and then remove the free plugin. <br><br>(Don't worry, all your settings will be preserved.)","info"))})}}},d=c,u=e("2877"),g=Object(u["a"])(d,o,i,!1,null,null,null),m=g.exports,h=e("8c4f"),b=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{attrs:{id:"poststuff"}},[e("div",{staticClass:"metabox-holder columns-1",attrs:{id:"post-body"}},[e("div",{staticClass:"clearfix",attrs:{id:"post-body-content"}},[e("div",{staticClass:"sp-flex sp-mt-8 sp-overflow-x-scroll sp-pb-2"},[e("div",{staticClass:"sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/cs-page.svg",alt:t.txt_29}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_1)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_3)+"\n ")]),""==t.shared.csp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("cs")}}},[t._v(t._s(t.txt_4))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("cs")}}},[t._v(t._s(t.txt_5))]),1!=t.shared.seedprod_csp4_imported?e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:t.shared.csp_preview_url,target:"_blank"}},[t._v(t._s(t.txt_6))]):t._e()]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0},on:{change:function(s){return t.enable_mode(1)}},model:{value:t.shared.settings.enable_coming_soon_mode,callback:function(s){t.$set(t.shared.settings,"enable_coming_soon_mode",s)},expression:"shared.settings.enable_coming_soon_mode"}}),t._v(" \n "),t.shared.settings.enable_coming_soon_mode?e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-green sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_7))]):e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/mm-page.svg",alt:t.txt_30}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_9)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_10)+"\n ")]),""==t.shared.mmp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("mm")}}},[t._v(t._s(t.txt_11))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("mm")}}},[t._v(t._s(t.txt_5))]),1!=t.shared.seedprod_csp4_imported?e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:t.shared.mmp_preview_url,target:"_blank"}},[t._v(t._s(t.txt_6))]):t._e()]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0},on:{change:function(s){return t.enable_mode(2)}},model:{value:t.shared.settings.enable_maintenance_mode,callback:function(s){t.$set(t.shared.settings,"enable_maintenance_mode",s)},expression:"shared.settings.enable_maintenance_mode"}}),t._v(" \n "),t.shared.settings.enable_maintenance_mode?e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-green sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_7))]):e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0 sp-relative",on:{mouseenter:function(s){t.show_loginp_upgrade=!0},mouseleave:function(s){t.show_loginp_upgrade=!1}}},[e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-text-green sp-rounded sp-z-20 sp-px-1 sp-text-10px sp-font-semibold sp-mt-2 sp-mr-1"},[e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("g",{attrs:{fill:"none"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",opacity:".87"}})]),e("path",{attrs:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}})])]),e("div",{staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center sp-z-20 ",class:{"sp-hidden":!t.show_loginp_upgrade}},[e("a",{staticClass:"mt-20 sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginloginpage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n Upgrade to PRO\n ")])]),e("div",{staticClass:"sp-pro-only"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/login-page.svg",alt:t.txt_31}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_33)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_34)+"\n ")]),""==t.shared.loginp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_35))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_5))]),e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_6))])]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0}}),t._v(" \n\n "),e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)])]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0 sp-relative",on:{mouseenter:function(s){t.show_404_upgrade=!0},mouseleave:function(s){t.show_404_upgrade=!1}}},[e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-text-green sp-rounded sp-z-20 sp-px-1 sp-text-10px sp-font-semibold sp-mt-2 sp-mr-1"},[e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("g",{attrs:{fill:"none"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",opacity:".87"}})]),e("path",{attrs:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}})])]),e("div",{staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center sp-z-20 ",class:{"sp-hidden":!t.show_404_upgrade}},[e("a",{staticClass:"mt-20 sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=plugin404page",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n Upgrade to PRO\n ")])]),e("div",{staticClass:"sp-pro-only"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/404-page.svg",alt:t.txt_31}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_14)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_15)+"\n ")]),""==t.shared.p404_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_16))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_5))]),e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_6))])]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0}}),t._v(" \n\n "),e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)])])]),e("div",{staticClass:"sp-mt-8 sp-font-semibold"},[e("hr",{staticClass:"sp-border-b-0 sp-border-neutral-15 sp-mb-10"}),e("div",{staticClass:"sp-flex sp-items-center sp-mb-6"},[e("h3",{staticClass:"sp-text-2xl sp-text-neutral sp-m-0 sp-font-bold"},[t._v("\n "+t._s(t.txt_17)+"\n ")]),e("i",{directives:[{name:"tooltip",rawName:"v-tooltip.top-left",value:{content:t.txt_32},expression:"{\n content: txt_32,\n }",modifiers:{"top-left":!0}}],staticClass:"fas fa-question-circle sp-ml-2 sp-mr-6 sp-text-xs"}),0!=t.shared.page_count?e("a",{staticClass:"sp-font-semibold sp-text-xs sp-flex sp-items-center sp-inline-block sp-bg-primary sp-px-3 sp-py-2 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path+"_template&id=0#/template"}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}})]),t._v("\n "+t._s(t.txt_18)+"\n ")]):t._e()]),0!=t.shared.page_count?e("div",[e("ul",{staticClass:"subsubsub"},t._l(t.filters,function(s,a){return e("li",{key:a},[e("a",{class:{current:t.filter==a},attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.filter_table(a)}}},[t._v(t._s(s.label))]),t._v("\n ("+t._s(s.count)+")\n "),"archived"!=a?e("span",[t._v("|")]):t._e()])}),0),e("p",{staticClass:"search-box"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"order-search-input"}},[t._v(t._s(t.txt_2))]),e("span",{staticClass:"sp-relative sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"sp-rounded sp-border-solid sp-border sp-border-neutral-15 sp-outline-none",staticStyle:{padding:"6px 10px"},attrs:{id:"order-search-input"},domProps:{value:t.search},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.loadItems("search")},input:function(s){s.target.composing||(t.search=s.target.value)}}}),t._v(" \n "),t.search.length>0?e("i",{staticClass:"fas fa-times-circle sp-absolute sp-text-neutral-20 sp-right-0 sp-mr-2",attrs:{id:"seedprod-search-close"},on:{click:function(s){return s.preventDefault(),t.clear_search(s)}}}):t._e()]),e("input",{staticClass:"button",attrs:{type:"submit",id:"search-submit"},domProps:{value:t.txt_2},on:{click:function(s){return s.preventDefault(),t.loadItems("search")}}})]),e("list-table",{ref:"lpagedt",attrs:{columns:t.columns,loading:t.loading,rows:t.rows,actions:t.actions,"show-cb":t.showcb,"total-items":t.totalitems,"bulk-actions":t.filter_bulk(t.bulkactions),"total-pages":t.totalpages,"per-page":t.perpage,"current-page":t.currentpage,"action-column":t.actioncol,"sort-by":t.orderby,"sort-order":t.order,filter:t.filter},on:{pagination:t.goToPage,rowOver:t.rowOver,rowOut:t.rowOut,"action:click":t.onActionClick,"bulk:click":t.onBulkAction,sort:t.sortCallback},scopedSlots:t._u([{key:"subscribers",fn:function(s){return[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goto_subscribers(s.row.id)}}},[t._v(t._s(s.row.subscribers))])]}},{key:"url",fn:function(s){return["trash"!=s.row.post_status?e("a",{attrs:{href:s.row.url,target:"_blank"}},[t._v(t._s(s.row.url))]):e("span")]}},{key:"name",fn:function(s){return[e("span",{staticClass:"sp-text-sm"},[e("a",{staticClass:"sp-font-bold",attrs:{href:"?page="+t.shared.page_path+"_builder&id="+s.row.id+"#/setup/"+s.row.id+"/block-options"}},[t._v(t._s(s.row.name))]),"publish"!=s.row.post_status?e("span",{staticClass:"post-state sp-font-bold"},[t._v(" – "+t._s(s.row.status))]):t._e()]),"trash"!=s.row.post_status?e("div",{staticClass:"row-actions",class:{"sp-invisible":t.show_row!=s.row.id}},[e("span",{staticClass:"setup"},[e("a",{attrs:{href:"?page="+t.shared.page_path+"_builder&id="+s.row.id+"#/setup/"+s.row.id+"/block-options"}},[t._v(t._s(t.txt_19))]),t._v("\n |\n ")]),e("span",{staticClass:"subscribers"},[e("a",{attrs:{href:"?page="+t.shared.page_path+"#/subscribers/"+s.row.id}},[t._v(t._s(t.txt_20))]),t._v("\n |\n ")]),e("span",{staticClass:"publish2"},[e("a",{attrs:{href:t.shared.home_url+"?page_id="+s.row.id,target:"_blank"}},[t._v(t._s(t.txt_6))]),t._v("\n |\n ")]),e("span",{staticClass:"duplicate"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.duplicate(s.row)}}},[t._v(t._s(t.txt_21))]),t._v("\n |\n ")]),e("span",{staticClass:"delete"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.archive(s.row.id)}}},[t._v(t._s(t.txt_22))])])]):e("div",{staticClass:"row-actions",class:{"sp-invisible":t.show_row!=s.row.id}},[e("span",{},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.unarchive(s.row.id)}}},[t._v(t._s(t.txt_27))]),t._v("\n |\n ")]),e("span",{staticClass:"delete"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.trash(s.row.id)}}},[t._v(t._s(t.txt_28))])])])]}},{key:"date",fn:function(s){return["publish"==s.row.post_status?e("div",{staticClass:"sp-font-semibold date column-date sp-w-full"},[t._v("\n "+t._s(t.txt_23)+"\n "),e("br"),e("span",{attrs:{title:s.row.posted_at}},[t._v(t._s(s.row.posted_at))])]):t._e(),"draft"==s.row.post_status||"trash"==s.row.post_status?e("div",{staticClass:"sp-font-semibold column-date sp-w-full"},[t._v("\n "+t._s(t.txt_24)+"\n "),e("br"),e("span",{attrs:{title:s.row.modified_at}},[t._v(t._s(s.row.modified_at))])]):t._e()]}}],null,!1,3456503522)})],1):e("div",{staticClass:"sp-bg-neutral-10 sp-flex sp-justify-center sp-flex-col sp-items-center sp-h-64"},[e("div",{staticClass:"sp-font-bold sp-text-xl sp-mb-4"},[t._v(t._s(t.txt_25))]),e("a",{staticClass:"sp-font-semibold sp-text-sm sp-inline-flex sp-items-center sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path+"_template&id=0#/template"}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}})]),t._v("\n "+t._s(t.txt_26)+"\n ")])])])])])])])},v=[],x=e("bd86"),f=e("e814"),w=e.n(f),C=(e("6b54"),e("386d"),e("f499")),y=e.n(C),k=e("323e"),j=e.n(k),O=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{class:{"table-loading":t.loading}},[t.loading?e("div",{staticClass:"table-loader-wrap"},[e("div",{staticClass:"table-loader-center"},[e("div",{staticClass:"table-loader"}),e("div",{staticClass:"table-loader-txt"},[t._v(t._s(t.txt_1)+"...")])])]):t._e(),e("div",{staticClass:"tablenav top"},[t.hasBulkActions?e("div",{staticClass:"alignleft actions bulkactions"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"bulk-action-selector-top"}},[t._v(t._s(t.txt_2))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.bulkLocal,expression:"bulkLocal"}],attrs:{name:"action",id:"bulk-action-selector-top"},on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.bulkLocal=s.target.multiple?e:e[0]}}},[e("option",{attrs:{value:"-1"}},[t._v(t._s(t.txt_3))]),t._l(t.bulkActions,function(s){return e("option",{domProps:{value:s.key}},[t._v(t._s(s.label))])})],2),e("button",{staticClass:"button action",staticStyle:{"margin-bottom":"1px"},attrs:{disabled:!t.checkedItems.length&&-1===this.bulkLocal.indexOf("all")},on:{click:function(s){return s.preventDefault(),t.handleBulkAction(s)}}},[t._v("\n\t\t\t\t"+t._s(t.txt_4)+"\n\t\t\t")])]):t._e(),e("div",{staticClass:"alignleft actions"},[t._t("filters")],2),e("div",{staticClass:"tablenav-pages"},[e("span",{staticClass:"displaying-num"},[t._v(t._s(t.itemsTotal)+" "+t._s(t.txt_5))]),t.hasPagination?e("span",{staticClass:"pagination-links"},[t.disableFirst?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("«")]):e("a",{staticClass:"first-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("«")])]),t.disablePrev?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("‹")]):e("a",{staticClass:"prev-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage-1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("‹")])]),e("span",{staticClass:"paging-input"},[e("span",{staticClass:"tablenav-paging-text"},[e("input",{staticClass:"current-page",attrs:{type:"text",name:"paged","aria-describedby":"table-paging",size:"1"},domProps:{value:t.currentPage},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.goToCustomPage(s)}}}),t._v("\n\t\t\t\t\t\tof\n\t\t\t\t\t\t"),e("span",{staticClass:"total-pages"},[t._v(t._s(t.totalPages))])])]),t.disableNext?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("›")]):e("a",{staticClass:"next-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage+1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("›")])]),t.disableLast?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("»")]):e("a",{staticClass:"last-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.totalPages)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()])]),e("table",{class:t.tableClass},[e("thead",[e("tr",[t.showCb?e("td",{staticClass:"manage-column column-cb check-column"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.selectAll,expression:"selectAll"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.selectAll)?t._i(t.selectAll,null)>-1:t.selectAll},on:{change:function(s){var e=t.selectAll,a=s.target,n=!!a.checked;if(Array.isArray(e)){var o=null,i=t._i(e,o);a.checked?i<0&&(t.selectAll=e.concat([o])):i>-1&&(t.selectAll=e.slice(0,i).concat(e.slice(i+1)))}else t.selectAll=n}}})]):t._e(),t._l(t.columns,function(s,a){return e("th",{key:a,class:["column",a,{sortable:t.isSortable(s)},{sorted:t.isSorted(a)},{asc:t.isSorted(a)&&"asc"===t.sortOrder},{desc:t.isSorted(a)&&"desc"===t.sortOrder}]},[t.isSortable(s)?e("a",{attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.handleSortBy(a)}}},[e("span",[t._v(t._s(s.label))]),e("span",{staticClass:"sorting-indicator"})]):[t._v("\n\t\t\t\t\t\t"+t._s(s.label)+"\n\t\t\t\t\t")]],2)})],2)]),e("tfoot",[e("tr",[t.showCb?e("td",{staticClass:"manage-column column-cb check-column"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.selectAll,expression:"selectAll"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.selectAll)?t._i(t.selectAll,null)>-1:t.selectAll},on:{change:function(s){var e=t.selectAll,a=s.target,n=!!a.checked;if(Array.isArray(e)){var o=null,i=t._i(e,o);a.checked?i<0&&(t.selectAll=e.concat([o])):i>-1&&(t.selectAll=e.slice(0,i).concat(e.slice(i+1)))}else t.selectAll=n}}})]):t._e(),t._l(t.columns,function(s,a){return e("th",{key:a,class:["column",a]},[t._v("\n\t\t\t\t\t"+t._s(s.label)+"\n\t\t\t\t")])})],2)]),e("tbody",[t.rows.length?t._l(t.rows,function(s){return e("tr",{key:s[t.index],class:s["class"],on:{mouseover:function(e){return t.rowOver(s)},mouseleave:function(e){return t.rowOut(s)}}},[t.showCb?e("th",{staticClass:"check-column",attrs:{scope:"row"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.checkedItems,expression:"checkedItems"}],attrs:{type:"checkbox",name:"item[]"},domProps:{value:s[t.index],checked:Array.isArray(t.checkedItems)?t._i(t.checkedItems,s[t.index])>-1:t.checkedItems},on:{change:function(e){var a=t.checkedItems,n=e.target,o=!!n.checked;if(Array.isArray(a)){var i=s[t.index],r=t._i(a,i);n.checked?r<0&&(t.checkedItems=a.concat([i])):r>-1&&(t.checkedItems=a.slice(0,r).concat(a.slice(r+1)))}else t.checkedItems=o}}})]):t._e(),t._l(t.columns,function(a,n){return e("td",{key:n,class:["column",n]},[t._t(n,[t._v(t._s(s[n]))],{row:s}),t.actionColumn===n&&t.hasActions?e("div",{staticClass:"row-actions"},[t._t("row-actions",t._l(t.actions,function(a,n){return"archived"!=t.filter?e("span",{key:n,class:a.key},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.actionClicked(a.key,s)}}},[t._v(t._s(a.label))]),t.hideActionSeparator(a.key)?t._e():[t._v("\n\t\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t\t")]],2):t._e()}),{row:s})],2):t._e()],2)})],2)}):e("tr",[e("td",{attrs:{colspan:t.colspan}},[t._v(t._s(t.txt_6))])])],2)]),e("div",{staticClass:"tablenav bottom"},[t.hasBulkActions?e("div",{staticClass:"alignleft actions bulkactions"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"bulk-action-selector-bottom"}},[t._v(t._s(t.txt_7))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.bulkLocal,expression:"bulkLocal"}],attrs:{name:"action",id:"bulk-action-selector-bottom"},on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.bulkLocal=s.target.multiple?e:e[0]}}},[e("option",{attrs:{value:"-1"}},[t._v(t._s(t.txt_3))]),t._l(t.bulkActions,function(s,a){return e("option",{key:a,domProps:{value:s.key}},[t._v(t._s(s.label))])})],2),e("button",{staticClass:"button action",staticStyle:{"margin-bottom":"1px"},attrs:{disabled:!t.checkedItems.length},on:{click:function(s){return s.preventDefault(),t.handleBulkAction(s)}}},[t._v("\n\t\t\t\t"+t._s(t.txt_4)+"\n\t\t\t")])]):t._e(),e("div",{staticClass:"tablenav-pages"},[e("span",{staticClass:"displaying-num"},[t._v(t._s(t.itemsTotal)+" "+t._s(t.txt_5))]),t.hasPagination?e("span",{staticClass:"pagination-links"},[t.disableFirst?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("«")]):e("a",{staticClass:"first-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("«")])]),t.disablePrev?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("‹")]):e("a",{staticClass:"prev-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage-1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("‹")])]),e("span",{staticClass:"paging-input"},[e("span",{staticClass:"tablenav-paging-text"},[e("input",{staticClass:"current-page",attrs:{type:"text",name:"paged","aria-describedby":"table-paging",size:"1"},domProps:{value:t.currentPage},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.goToCustomPage(s)}}}),t._v("\n\t\t\t\t\t\tof\n\t\t\t\t\t\t"),e("span",{staticClass:"total-pages"},[t._v(t._s(t.totalPages))])])]),t.disableNext?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("›")]):e("a",{staticClass:"next-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage+1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("›")])]),t.disableLast?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("»")]):e("a",{staticClass:"last-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.totalPages)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()])])])},P=[],L=(e("ac6a"),e("a4bb")),S=e.n(L),M=(e("c5f6"),{name:"ListTable",props:{filter:{type:String,default:""},columns:{type:Object,required:!0,default:function(){return{}}},rows:{type:Array,required:!0,default:function(){return[]}},index:{type:String,default:"id"},showCb:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},actionColumn:{type:String,default:""},actions:{type:Array,required:!1,default:function(){return[]}},bulkActions:{type:Array,required:!1,default:function(){return[]}},tableClass:{type:String,default:"wp-list-table widefat fixed striped"},notFound:{type:String,default:"No items found."},totalItems:{type:Number,default:0},totalPages:{type:Number,default:1},perPage:{type:Number,default:20},currentPage:{type:Number,default:1},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc"}},data:function(){return{txt_1:Object(l["a"])("Loading","coming-soon"),txt_2:Object(l["a"])("Select bulk action","coming-soon"),txt_3:Object(l["a"])("Bulk Actions","coming-soon"),txt_4:Object(l["a"])("Apply","coming-soon"),txt_5:Object(l["a"])("items","coming-soon"),txt_6:Object(l["a"])("No items found.","coming-soon"),txt_7:Object(l["a"])("Select bulk action","coming-soon"),txt_8:Object(l["a"])("Select bulk action","coming-soon"),bulkLocal:"-1",checkedItems:[],shared:seedprod_store_admin}},computed:{hasActions:function(){return this.actions.length>0},hasBulkActions:function(){return this.bulkLocal="-1",this.bulkActions.length>0},itemsTotal:function(){return this.totalItems||this.rows.length},hasPagination:function(){return this.itemsTotal>this.perPage},disableFirst:function(){return 1===this.currentPage||2===this.currentPage},disablePrev:function(){return 1===this.currentPage},disableNext:function(){return this.currentPage===this.totalPages},disableLast:function(){return this.currentPage===this.totalPages||this.currentPage==this.totalPages-1},colspan:function(){var t=S()(this.columns).length;return this.showCb&&(t+=1),t},selectAll:{get:function(){return!!this.rows.length&&(!!this.rows&&this.checkedItems.length==this.rows.length)},set:function(t){var s=[],e=this;t&&this.rows.forEach(function(t){void 0!==t[e.index]?s.push(t[e.index]):s.push(t.id)}),this.checkedItems=s}}},methods:{hideActionSeparator:function(t){return t===this.actions[this.actions.length-1].key},rowOver:function(t){this.$emit("rowOver",t)},rowOut:function(t){this.$emit("rowOut",t)},actionClicked:function(t,s){this.$emit("action:click",t,s)},goToPage:function(t){this.$emit("pagination",t)},goToCustomPage:function(t){var s=w()(t.target.value);!isNaN(s)&&s>0&&s<=this.totalPages&&this.$emit("pagination",s)},handleBulkAction:function(){"-1"!==this.bulkLocal&&this.$emit("bulk:click",this.bulkLocal,this.checkedItems)},clear_checked:function(){this.checkedItems=[]},isSortable:function(t){return!(!t.hasOwnProperty("sortable")||!0!==t.sortable)},isSorted:function(t){return t===this.sortBy},handleSortBy:function(t){var s="asc"===this.sortOrder?"desc":"asc";this.$emit("sort",t,s)}}}),T=M,z=Object(u["a"])(T,O,P,!1,null,null,null),B=z.exports,A={name:"Dashboard",components:{ListTable:B},data:function(){return{txt_1:Object(l["a"])("Coming Soon Mode","coming-soon"),txt_2:Object(l["a"])("Search Landing Pages","coming-soon"),txt_3:Object(l["a"])("The Coming Soon Page will be available to search engines if your site is not private.","coming-soon"),txt_4:Object(l["a"])("Set up a Coming Soon Page","coming-soon"),txt_5:Object(l["a"])("Edit Page","coming-soon"),txt_6:Object(l["a"])("Preview","coming-soon"),txt_7:Object(l["a"])("Active","coming-soon"),txt_8:Object(l["a"])("Inactive","coming-soon"),txt_9:Object(l["a"])("Maintenance Mode","coming-soon"),txt_10:Object(l["a"])("The Maintenance Mode Page will notify search engines that the site is unavailable.","coming-soon"),txt_11:Object(l["a"])("Set up a Maintenance Mode Page","coming-soon"),txt_14:Object(l["a"])("404 Page","coming-soon"),txt_15:Object(l["a"])("Replace your default theme 404 page with a custom high converting 404 page.","coming-soon"),txt_16:Object(l["a"])("Set up a 404 Page","coming-soon"),txt_17:Object(l["a"])("Landing Pages","coming-soon"),txt_18:Object(l["a"])("Add New Landing Page","coming-soon"),txt_19:Object(l["a"])("Edit","coming-soon"),txt_20:Object(l["a"])("Subscribers","coming-soon"),txt_21:Object(l["a"])("Duplicate","coming-soon"),txt_22:Object(l["a"])("Trash","coming-soon"),txt_23:Object(l["a"])("Published","coming-soon"),txt_24:Object(l["a"])("Last Modified","coming-soon"),txt_25:Object(l["a"])("You do not have any landing pages yet.","coming-soon"),txt_26:Object(l["a"])("Create New Landing Page","coming-soon"),txt_27:Object(l["a"])("Restore","coming-soon"),txt_28:Object(l["a"])("Delete Permanently","coming-soon"),txt_29:Object(l["a"])("SeedProd Coming Soon Page","coming-soon"),txt_30:Object(l["a"])("SeedProd Maintenance Page","coming-soon"),txt_31:Object(l["a"])("SeedProd 404 Page","coming-soon"),txt_32:Object(l["a"])("Create Optin, Sales, Webinar, Thank You or any type of Landing Page you need.","coming-soon"),txt_33:Object(l["a"])("Login Page","coming-soon"),txt_34:Object(l["a"])("Create a Custom Login Page for your website. Optionally replace the default login page.","coming-soon"),txt_35:Object(l["a"])("Set up a Login Page","coming-soon"),txt_36:Object(l["a"])("SeedProd Login Page","coming-soon"),shared:seedprod_store_admin,show_404_upgrade:!1,show_loginp_upgrade:!1,show_row:!1,show_action:!1,loading:!0,search:"",showcb:!0,totalitems:0,totalpages:0,perpage:10,actioncol:"name",currentpage:1,orderby:"",order:"",filter:"all",filters:{all:{label:Object(l["a"])("All","coming-soon"),count:0},published:{label:Object(l["a"])("Published","coming-soon"),count:0},drafts:{label:Object(l["a"])("Drafts","coming-soon"),count:0},archived:{label:Object(l["a"])("Trash","coming-soon"),count:0}},bulkactions:[{key:"archive_selected_lpages",label:Object(l["a"])("Move To Trash","coming-soon")},{key:"unarchive_selected_lpages",label:Object(l["a"])("Restore","coming-soon")},{key:"delete_all_archived_lpages",label:Object(l["a"])("Delete Permanently","coming-soon")}],columns:{name:{label:Object(l["a"])("Name","coming-soon"),sortable:!0},url:{label:Object(l["a"])("URL","coming-soon"),sortable:!1},date:{label:Object(l["a"])("Date","coming-soon"),sortable:!0}},actions:[],rows:[{name:Object(l["a"])("Loading","coming-soon")+" ...",status:"",type:"",subscribers:"",entries:"",active:""}]}},methods:(a={show_actions:function(t){this.show_action=t},create_edit_page:function(t){var s=!1;"cs"==t&&(s=this.shared.csp_id),"mm"==t&&(s=this.shared.mmp_id),"p404"==t&&(s=this.shared.p404_id),"loginp"==t&&(s=this.shared.loginp_id),s?location.href="?page="+this.shared.page_path+"_builder&id="+s+"#/setup/"+s+"/block-options":("cs"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=cs#/template"),"mm"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=mm#/template"),"p404"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=p404#/template"),"loginp"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=loginp#/template"))},enable_mode:function(t){var s=t;j.a.start(),1==t&&!0===this.shared.settings.enable_maintenance_mode&&(this.shared.settings.enable_maintenance_mode=!1),2==t&&!0===this.shared.settings.enable_coming_soon_mode&&(this.shared.settings.enable_coming_soon_mode=!1);var e=p.a.stringify({settings:y()(this.shared.settings)}),a="admin-ajax.php?action="+this.shared.page_path+"_save_settings&_wpnonce="+seedprod_nonce;this.axios.post(a,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){j.a.done(),1!=s&&2!=s||location.reload()})},filter_bulk:function(t){var s=[];return s="archived"==this.filter?t.slice(1):t.slice(0,1),s},hideActionSeparator:function(t){return t===this.actions[this.actions.length-1].key},rowOver:function(t){this.show_row=t.id},rowOut:function(t){this.show_row=!1},enable_disable:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_enable_disable_lpage_ajax_url+"&id="+t.id+"¤t_state="+t.active).then(function(e){s.loading=!1,"enabled"==e.data.status&&(t.active=!0,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Page Enabled",toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3})),"disabled"==e.data.status&&(t.active=!1,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Page Disabled",toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}))})},status_action:function(t,s){"needs_setup"==s&&(location.href="?page="+this.shared.page_path+"_builder&id="+t+"#/setup/"+t)},goto_dashboard:function(){this.$router.push({name:"dashboard"})},clear_search:function(){this.search,this.loadItems()},archive:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_archive_selected_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){s.loading=!1,s.$refs.lpagedt.clear_checked(),t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Moved to Trash.","coming-soon"),toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.loadItems())})},unarchive:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_unarchive_selected_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){s.loading=!1,s.$refs.lpagedt.clear_checked(),t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Restored.","coming-soon"),customClass:"sp-toast-success",toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),s.loadItems())})},trash:function(t){var s=this,e=this;this.$swal({imageUrl:e.shared.plugin_path+"public/img/delete.png",title:Object(l["a"])("Are you sure?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Object(l["a"])("Yes, empty trash!","coming-soon")}).then(function(a){a.value&&(e.loading=!0,s.axios.get(seedprod_delete_archived_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){e.loading=!1,e.$refs.lpagedt.clear_checked(),t.data.status&&(e.$swal({imageUrl:e.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Deleted!","coming-soon"),toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),e.loadItems())}))})},duplicate:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_duplicate_lpage_url+"&id="+t.id).then(function(t){s.loading=!1,t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Page Duplicated","coming-soon"),toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),s.orderby="",s.loadItems())})},loadItems:function(t){"search"==t?(this.currentpage=1,this.orderby="",this.order="",this.filter=""):this.search="";var s=this;s.loading=!0,j.a.start(),this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_lpage_datatable&_wpnonce="+seedprod_nonce+"¤t_page="+this.currentpage+"&orderby="+this.orderby+"&order="+this.order+"&filter="+this.filter+"&s="+this.search).then(function(t){s.loading=!1,j.a.done(),s.rows=t.data.rows,s.totalitems=w()(t.data.totalitems),s.totalpages=w()(t.data.totalpages),s.currentpage=w()(t.data.currentpage),null!=t.data.views&&(s.filters.all.count=w()(t.data.views.all),s.filters.archived.count=w()(t.data.views.archived),s.filters.published.count=w()(t.data.views.published),s.filters.drafts.count=w()(t.data.views.drafts))})},filter_table:function(t){this.filter=t,0==this.filters[t].count?this.rows=[]:this.loadItems()}},Object(x["a"])(a,"show_actions",function(t){this.show_action=t}),Object(x["a"])(a,"goto_subscribers",function(t){this.$router.push({name:"subscribers",params:{id:t}})}),Object(x["a"])(a,"goToPage",function(t){this.currentpage=t,this.loadItems()}),Object(x["a"])(a,"actionClicked",function(t,s){this.onActionClick(t,s)}),Object(x["a"])(a,"onActionClick",function(t,s){"duplicate"==t&&this.duplicate(s),"delete"==t&&this.archive(s.id),"setup"==t&&(location.href="?page="+this.shared.page_path+"_builder&id="+s.id+"#/setup/"+s.id+"/block-options"),"publish2"==t&&window.open(this.shared.home_url+"?p="+s.id+"&preview=true","_blank"),"subscribers"==t&&this.$router.push({name:"subscribers",params:{id:s.id}})}),Object(x["a"])(a,"onBulkAction",function(t,s){"archive_selected_lpages"==t&&this.archive(s),"unarchive_selected_lpages"==t&&this.unarchive(s),"delete_all_archived_lpages"==t&&this.trash(s)}),Object(x["a"])(a,"sortCallback",function(t,s){this.orderby=t,this.order=s,this.loadItems()}),Object(x["a"])(a,"setWithExpiry",function(t,s,e){var a=new Date,n={value:s,expiry:a.getTime()+e};localStorage.setItem(t,y()(n))}),Object(x["a"])(a,"getWithExpiry",function(t){var s=localStorage.getItem(t);if(!s)return null;var e=JSON.parse(s),a=new Date;return a.getTime()>e.expiry?(localStorage.removeItem(t),null):e.value}),a),created:function(){this.loadItems()}},$=A,D=Object(u["a"])($,b,v,!1,null,null,null),U=D.exports,H=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-grid sp-grid-cols-1 lg:sp-grid-cols-2 xl:sp-grid-cols-3 sp-gap-6 sp-mt-10 "},t._l(t.plugins,function(s,a){return e("div",{key:a,staticClass:"sp-w-full sp-bg-white sp-border-neutral-15 sp-border sp-border-solid sp-py-10 sp-px-8 sp-flex sp-justify-between sp-flex-col"},[e("div",{staticClass:"seedprod-plugin-recommendations-block sp-flex sp-flex-col"},[e("div",{staticClass:"sp-flex sp-items-center sp-flex-col"},[e("div",[e("img",{staticClass:"sp-w-16",attrs:{src:s.icon}})]),e("div",{staticClass:"sp-text-center sp-text-neutral-80"},[e("h3",{staticClass:"sp-text-neutral-80 sp-text-xl"},[t._v(t._s(s.name))]),e("p",{staticClass:"sp-text-sm",domProps:{innerHTML:t._s(s.desc)}})])])]),e("div",[t.shared.doing_ajax==a||"all"==t.shared.doing_ajax?e("div",[t._m(0,!0)]):e("div",{staticClass:"sp-flex sp-flex-col sp-items-center"},[!0===s.is_pro?e("div",[t._v("\n "+t._s(t.plugins["wpforms-pro"])+"\n "),e("strong",[t._v(t._s(t.txt_1)+":")]),t._v(" "+t._s(t.txt_2)+"\n ")]):e("div",{staticClass:"sp-flex sp-flex-col sp-items-center"},[e("div",[e("strong",[t._v(t._s(t.txt_1)+":")]),t._v("\n "+t._s(s.status)+"\n ")]),e("button",{staticClass:"sp-mt-1 sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-base hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold",on:{click:function(s){return t.plugin_action(a)}}},[t._v(t._s(t.plugin_btn_txt(s)))])])])])])}),0)])},I=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticStyle:{"text-align":"center",flex:"1"}},[e("i",{staticClass:"fas fa-spinner fa-spin"})])}],E={name:"GrowthTools",components:{},data:function(){return{txt_1:Object(l["a"])("Status","coming-soon"),txt_2:Object(l["a"])("PRO Version installed","coming-soon"),all_plugins:{},plugins:{rafflepress:{slug_base:"rafflepress",slug:"rafflepress/rafflepress.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-rp.png",name:"RafflePress",desc:"Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.",url:"https://downloads.wordpress.org/plugin/rafflepress.zip",status:"",status_code:"",is_pro:!1},wpforms:{slug_base:"wpforms-lite",slug:"wpforms-lite/wpforms.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-wpforms.png",name:"WPForms",desc:"The most beginner friendly drag & drop WordPress forms plugin allowing you to create beautifdivcontact forms, subscription forms, payment forms, and more in minutes, not hours!",url:"https://downloads.wordpress.org/plugin/wpforms-lite.zip",status:"",status_code:"",is_pro:!1},optinmonster:{slug_base:"optinmonster",slug:"optinmonster/optin-monster-wp-api.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-om.png",name:"OptinMonster",desc:"Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.",url:"https://downloads.wordpress.org/plugin/optinmonster.zip",status:"",status_code:"",is_pro:!1},wpmailsmtp:{slug_base:"wp-mail-smtp",slug:"wp-mail-smtp/wp_mail_smtp.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-smtp.png",name:"WP Mail SMTP",desc:"SMTP (Simple Mail Transfer Protocol) is an industry standard for sending emails. SMTP helps increase email deliverability by using proper authentication.",url:"https://downloads.wordpress.org/plugin/wp-mail-smtp.zip",status:"",status_code:"",is_pro:!1},monsterinsights:{slug_base:"google-analytics-for-wordpress",slug:"google-analytics-for-wordpress/googleanalytics.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-mi.png",name:"MonsterInsights",desc:"MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.",url:"https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.zip",status:"",status_code:"",is_pro:!1},trustpulse:{slug_base:"trustpulse-api",slug:"trustpulse-api/trustpulse.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-trustpulse.png",name:"TrustPulse",desc:"TrustPulse uses FOMO (Fear of Missing Out) to boost your sales and conversions with social proof notifications. Use it to boost sales on your Woocommerce store, increase signups on your membership site, get more email subscribers, and more.",url:"https://downloads.wordpress.org/plugin/coming-soon.zip",status:"",status_code:"",is_pro:!1}},shared:seedprod_store_admin}},methods:{plugin_action:function(t){var s=this;this.doing_ajax=!0;var e="",a="",n=t;if(s.shared.doing_ajax=t,0===this.plugins[t].status_code){e=seedprod_get_install_addon_url;var o=p.a.stringify({plugin:this.plugins[t].url,type:"plugin"});a="install"}if(1===this.plugins[t].status_code){e=seedprod_deactivate_addon_url;o=p.a.stringify({plugin:this.plugins[t].slug,type:"plugin"});a="deactivate"}if(2===this.plugins[t].status_code){e=seedprod_activate_addon_url;o=p.a.stringify({plugin:this.plugins[t].slug,type:"plugin"});a="activate"}this.axios.post(e,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(e){if(s.shared.doing_ajax=!1,"install"==a)if(e.data.error){s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.error,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3});var o=p.a.stringify({plugin:s.plugins[n].slug_base});s.axios.post(seedprod_plugin_nonce_url,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data&&window.open("update.php?action=install-plugin&plugin="+s.plugins[n].slug_base+"&_wpnonce="+t.data,"_blank")})}else s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Plugin Installed, click Activate",toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Inactive",s.plugins[t].status_code=2,s.$forceUpdate();"activate"==a&&(e.data.success?(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:e.data.data,toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Active",s.plugins[t].status_code=1,s.$forceUpdate()):s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.data,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})),"deactivate"==a&&(e.data.success?(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:e.data.data,toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Inactive",s.plugins[t].status_code=2,s.$forceUpdate()):s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.data,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3}))}).catch(function(t){s.shared.doing_ajax=!1,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:t,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})},plugin_btn_txt:function(t){var s="";return"Not Installed"==t.status&&(s=Object(l["a"])("Install","coming-soon")),"Active"==t.status&&(s=Object(l["a"])("Deactivate","coming-soon")),"Inactive"==t.status&&(s=Object(l["a"])("Activate","coming-soon")),s}},mounted:function(){var t=this;t.shared.doing_ajax="all",this.axios.get(seedprod_get_plugins_list_url).then(function(s){if(t.shared.doing_ajax=!1,s.data)for(var e in s.data)void 0!==t.plugins[e]&&("wpforms"==e&&0!==s.data["wpforms-pro"].status&&(t.plugins[e].is_pro=!0),"rafflepress"==e&&0!==s.data["rafflepress-pro"].status&&(t.plugins[e].is_pro=!0),"monsterinsights"==e&&0!==s.data["monsterinsights-pro"].status&&(t.plugins[e].is_pro=!0),"wpmailsmtp"==e&&0!==s.data["wpmailsmtp-pro"].status&&(t.plugins[e].is_pro=!0),t.plugins[e].status=s.data[e].label,t.plugins[e].status_code=s.data[e].status)}).catch(function(s){t.shared.doing_ajax=!1,t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})})},created:function(){var t=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(2)'),s=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(6)');t.classList.remove("current"),s.classList.add("current")}},N=E,F=Object(u["a"])(N,H,I,!1,null,null,null),W=F.exports,R=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-absolute sp-z-10 sp-w-full sp-flex sp-justify-center"},[e("LiteCTASubscribers")],1),e("div",{staticStyle:{filter:"blur(3px)"},attrs:{id:"seedprod-users"}},[e("div",{staticClass:"md:sp-flex sp-mt-10"},[e("div",{staticClass:"sp-w-full md:sp-w-1/2 sp-flex sp-items-center"},[e("h1",{staticClass:"sp-text-neutral sp-font-bold sp-text-2xl sp-m-0"},[t._v(t._s(t.txt_1))])]),0!=t.shared.subscriber_count?e("div",{staticClass:"sp-w-full md:sp-w-1/2 sp-flex sp-items-center sp-justify-end"},[e("a",{staticClass:"sp-inline-block sp-bg-neutral-15 hover:sp-bg-neutral-20 sp-h-40px sp-px-4 sp-rounded sp-leading-none sp-text-neutral-80 sp-no-underline sp-text-sm sp-cursor-pointer sp-font-semibold sp-flex sp-items-center sp-mr-2",attrs:{href:"#",target:"_blank"},on:{click:function(s){return s.preventDefault(),t.export_subscribers(s)}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n "+t._s(t.txt_2)+"\n ")]),e("div",{staticClass:"sp-relative"},[e("div",{staticClass:"sp-bg-white sp-border sp-border-neutral-20 sp-border-solid sp-rounded-sm sp-h-40px sp-w-275 sp-cursor-pointer"},[e("span",{staticClass:"sp-flex sp-items-center sp-h-40px sp-justify-between sp-text-neutral-80 sp-px-3 sp-text-base sp-truncate",on:{click:function(s){return s.preventDefault(),t.toggle_lpage_list(s)}}},[t._v("\n "+t._s(t.lpage_name)+"\n "),e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7 10l5 5 5-5z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])])]),t.show_lpage_list?e("div",{staticClass:"sp-absolute sp-bg-white sp-border sp-border-neutral-20 sp-border-solid sp-rounded-sm sp-z-20 sp-w-275 sp-h-275 sp-overflow-y-auto sp-shadow-lg sp-px-1 sp-py-1"},[e("ul",{staticClass:"sp-m-0"},[0==t.lpage_list.length&&0!=t.shared.page_count?e("li",{staticClass:"sp-m-0 sp-py-1"},[e("span",{staticClass:"sp-px-2 sp-text-neutral-80 sp-text-sm sp-font-bold"},[t._v("\n "+t._s(t.txt_3)+"\n "),e("i",{staticClass:"fas fa-spinner fa-spin"})])]):t._e(),e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(0,0,"All Pages")}}},[t._v(t._s(t.txt_4))])]),""!=t.shared.csp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.csp_id,t.shared.csp_uuid,"Coming Soon Page")}}},[t._v(t._s(t.txt_5))])]):t._e(),""!=t.shared.mmp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.mmp_id,t.shared.mmp_uuid,"Maintenance Mode Page")}}},[t._v(t._s(t.txt_6))])]):t._e(),""!=t.shared.loginp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.loginp_id,t.shared.loginp_uuid,"Login Page")}}},[t._v(t._s(t.txt_13))])]):t._e(),""!=t.shared.p404_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.p404_id,t.shared.p404_uuid,"404 Page")}}},[t._v(t._s(t.txt_7))])]):t._e(),0!=t.lpage_list.length?e("hr",{staticClass:"sp-border sp-border-neutral-20 sp-border-b-0"}):t._e(),0!=t.lpage_list.length?e("li",{staticClass:"sp-m-0 sp-py-1"},[e("span",{staticClass:"sp-px-2 sp-text-neutral-40 sp-font-bold sp-uppercase sp-tracking-wide sp-text-12px"},[t._v(t._s(t.txt_8))])]):t._e(),t._l(t.lpage_list,function(s,a){return e("li",{key:a,staticClass:"sp-m-0"},[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-1 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.load_lpage_users(s.id,s.uuid,s.name)}}},[t._v(t._s(s.name))])])})],2)]):t._e()]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.chart_timeframe,expression:"chart_timeframe"}],staticClass:"sp-form-select sp-h-40px sp-border sp-border-neutral-20 sp-border-solid sp-ml-2",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.chart_timeframe=s.target.multiple?e:e[0]},t.loadItems]}},[e("option",{attrs:{value:"7"}},[t._v("7 "+t._s(t.txt_9))]),e("option",{attrs:{value:"30"}},[t._v("30 "+t._s(t.txt_9))])])]):t._e()]),0!=t.shared.subscriber_count?e("div",[e("div",{staticClass:"sp-border sp-border-neutral-20 sp-border-solid sp-mt-5 sp-mb-3"},[e("GChart",{attrs:{type:"AreaChart",data:t.chartData,options:t.chartOptions}})],1),e("div",{attrs:{id:"poststuff"}},[e("div",{staticClass:"metabox-holder columns-1",attrs:{id:"post-body"}},[e("div",{staticClass:"clearfix",attrs:{id:"post-body-content"}},[e("ul",{staticClass:"subsubsub"},t._l(t.filters,function(s,a){return e("li",{key:a},[e("a",{class:{current:t.filter==a},attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.filter_table(a)}}},[t._v(t._s(s.label))]),t._v("\n ("+t._s(s.count)+")\n "),"invalid"!=a?e("span",[t._v("|")]):t._e()])}),0),e("p",{staticClass:"search-box sp-hidden"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"order-search-input"}},[t._v(t._s(t.txt_12))]),e("span",{staticClass:"sp-relative sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"sp-rounded sp-border-solid sp-border sp-border-neutral-15 sp-outline-none",staticStyle:{padding:"6px 10px"},attrs:{id:"order-search-input"},domProps:{value:t.search},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.loadItems("search")},input:function(s){s.target.composing||(t.search=s.target.value)}}}),t._v(" \n "),t.search.length>0?e("i",{staticClass:"fas fa-times-circle sp-absolute sp-text-neutral-20 sp-right-0 sp-mr-2",attrs:{id:"seedprod-search-close"},on:{click:function(s){return s.preventDefault(),t.clear_search(s)}}}):t._e()]),e("input",{staticClass:"button",attrs:{type:"submit",id:"search-submit"},domProps:{value:t.txt_12},on:{click:function(s){return s.preventDefault(),t.loadItems("search")}}})]),e("list-table",{ref:"subscribersdt",attrs:{columns:t.columns,loading:t.loading,rows:t.rows,actions:t.actions,"show-cb":t.showcb,"total-items":t.totalitems,"bulk-actions":t.bulkactions,"total-pages":t.totalpages,"per-page":t.perpage,"current-page":t.currentpage,"action-column":t.actioncol,"sort-by":t.orderby,"sort-order":t.order},on:{pagination:t.goToPage,"action:click":t.onActionClick,"bulk:click":t.onBulkAction,sort:t.sortCallback}})],1)]),e("br",{staticClass:"clear"})])]):e("div",{staticClass:"sp-mt-6 sp-bg-neutral-10 sp-flex sp-justify-center sp-flex-col sp-items-center sp-h-64"},[e("div",{staticClass:"sp-font-bold sp-text-xl sp-mb-4"},[t._v(t._s(t.txt_10))]),e("a",{staticClass:"sp-font-semibold sp-text-sm sp-inline-flex sp-items-center sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path}},[t._v(t._s(t.txt_11))])])])])},V=[],G=e("a745"),q=e.n(G),Y=e("b132"),K=e("cb43"),J=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-px-10 sp-py-10 sp-text-center",staticStyle:{width:"650px"}},[e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v("Special Upgrade Offer - Save 50% Off")]),e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral"},[t._v("\n \n Start Collecting Emails with SeedProd Pro\n ")]),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))])])])]),e("a",{staticClass:"sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginsubscriberpage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" Upgrade to SeedProd PRO Now\n ")])])])])},Q=[],X={name:"LiteCTASubscribers",data:function(){return{txt_1:Object(l["a"])("Dismiss this message","coming-soon"),txt_2:Object(l["a"])("Get SeedProd Pro and Unlock all the Powerful Features","coming-soon"),txt_3:Object(l["a"])("Thanks for being a loyal SeedProd Lite user. Upgrade to\nSeedProd Pro to unlock all the awesome features and\nexperience why SeedProd is the best WordPress landing\npage plugin.","coming-soon"),txt_4:Object(l["a"])("Pro Features:","coming-soon"),txt_995:Object(l["a"])("Filter by Page","coming-soon"),txt_996:Object(l["a"])("Export to a CSV File","coming-soon"),txt_997:Object(l["a"])("Premium Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Page Access Controls","coming-soon"),txt_9910:Object(l["a"])("Subscribers Over Time","coming-soon"),txt_9911:Object(l["a"])("See Name and Emails","coming-soon"),txt_9912:Object(l["a"])("Email Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),txt_15:Object(l["a"])("Bonus:","coming-soon"),txt_16:Object(l["a"])("SeedProd Lite users get","coming-soon"),txt_17:Object(l["a"])("a discount off the regular price","coming-soon"),txt_18:Object(l["a"])("automatically applied at checkout.","coming-soon"),txt_19:Object(l["a"])("Get SeedProd Pro Today and Unlock all the Powerful Features »","coming-soon"),shared:seedprod_store_admin}},methods:{dismiss:function(){var t=this,s=p.a.stringify({dismiss:!0});this.shared.settings_page_meta.dismiss_settings_lite_cta=!0,t.axios.post(seedprod_dismiss_settings_lite_cta_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}}},Z=X,tt=Object(u["a"])(Z,J,Q,!1,null,null,null),st=tt.exports;window.lodash=_.noConflict();var et={name:"Subscribers",mixins:[Y["a"]],components:{ListTable:B,GChart:K["GChart"],LiteCTASubscribers:st},data:function(){var t;return t={txt_1:Object(l["a"])("Subscribers Overview","coming-soon"),txt_2:Object(l["a"])("Export to CSV","coming-soon"),txt_3:Object(l["a"])("Loading","coming-soon"),txt_4:Object(l["a"])("All Pages","coming-soon"),txt_5:Object(l["a"])("Coming Soon Page","coming-soon"),txt_6:Object(l["a"])("Maintenance Mode Page","coming-soon"),txt_7:Object(l["a"])("404 Page","coming-soon"),txt_8:Object(l["a"])("Landing Pages","coming-soon"),txt_9:Object(l["a"])("Days","coming-soon"),chart_timeframe:7,txt_10:Object(l["a"])("You do not have any subscribers yet.","coming-soon"),txt_11:Object(l["a"])("Go to Pages","coming-soon"),txt_12:Object(l["a"])("Search Emails","coming-soon"),txt_13:Object(l["a"])("Login Page","coming-soon")},Object(x["a"])(t,"chart_timeframe",7),Object(x["a"])(t,"chartData",[]),Object(x["a"])(t,"chartOptions",{chart:{title:"Subsribers Overview",subtitle:"Subscribers"},colors:["#DD4A1F"]}),Object(x["a"])(t,"enable_confirmation_email",!1),Object(x["a"])(t,"show_lpage_list",!1),Object(x["a"])(t,"shared",seedprod_store_admin),Object(x["a"])(t,"lpage_name","All Pages"),Object(x["a"])(t,"show_action",!1),Object(x["a"])(t,"lpage_uuid",""),Object(x["a"])(t,"lpage_id",this.$route.params.id),Object(x["a"])(t,"loading",!0),Object(x["a"])(t,"search",""),Object(x["a"])(t,"showcb",!0),Object(x["a"])(t,"totalitems",0),Object(x["a"])(t,"totalpages",0),Object(x["a"])(t,"perpage",100),Object(x["a"])(t,"actioncol","email"),Object(x["a"])(t,"currentpage",1),Object(x["a"])(t,"orderby",""),Object(x["a"])(t,"order",""),Object(x["a"])(t,"filter","all"),Object(x["a"])(t,"seedprod_remote_api",seedprod_remote_api),Object(x["a"])(t,"filters",{}),Object(x["a"])(t,"bulkactions",[{key:"delete_subscribers",label:"Delete Subscribers"}]),Object(x["a"])(t,"columns",{email:{label:Object(l["a"])("Email","coming-soon"),sortable:!1},full_name:{label:Object(l["a"])("Name","coming-soon"),sortable:!1},created_at:{label:Object(l["a"])("Created","coming-soon"),sortable:!1}}),Object(x["a"])(t,"actions",[{key:"delete",label:Object(l["a"])("Delete","coming-soon")}]),Object(x["a"])(t,"lpage_list",[]),Object(x["a"])(t,"rows",[{name:Object(l["a"])("Loading","coming-soon")+" ...",status:"",type:"",subscribers:"",entries:"",active:""}]),t},methods:{load_lpages:function(){var t=this;this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_get_lpage_list&_wpnonce="+seedprod_nonce).then(function(s){s.data&&(t.lpage_list=s.data,lodash.each(t.lpage_list,function(s,e){s.id==t.$route.params.id&&""==t.lpage_uuid&&(t.lpage_uuid=s.uuid,t.lpage_name=s.name,t.load_lpage_users(s.id,s.uuid,s.name,!1))}))})},load_lpage_users:function(t,s,e){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.show_lpage_list=!1,this.lpage_id=t,this.lpage_uuid=s,this.lpage_name=e,a?this.$router.push({name:"subscribers",params:{id:t}}):this.loadItems()},clear_search:function(){this.search,this.loadItems()},toggle_lpage_list:function(){!1===this.show_lpage_list&&this.load_lpages(),this.show_lpage_list=!this.show_lpage_list},trash:function(t){var s=this,e=this,a="";q()(t)&&(a="s"),this.$swal({imageUrl:e.shared.plugin_path+"public/img/delete.png",title:Object(l["a"])("Are you sure?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:"Yes, delete user"+a+"!"}).then(function(a){if(a.value){e.loading=!0;var n=seedprod_delete_subscribers_url,o=p.a.stringify({items:t,api_token:e.shared.api_token});s.axios.post(n,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){e.loading=!1,e.$refs.subscribersdt.clear_checked(),(t.data>0||1==t.data.success)&&(e.$swal({imageUrl:e.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(l["a"])("Subscribers Deleted","coming-soon"),toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),e.loadItems())}).catch(function(t){j.a.done(),console.log(t),e.shared.doing_ajax=!1,e.$swal({imageUrl:e.shared.plugin_path+"public/svg/error-24px-white.svg",text:t.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})}})},export_subscribers:function(){location.href="admin.php?page="+this.shared.page_path+"&action="+this.shared.page_path+"_export_subscribers&id="+this.lpage_id+"&page_uuid="+this.lpage_uuid+"&_wpnonce="+seedprod_nonce,this.$swal({imageUrl:this.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Exported Started","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})},loadItems:function(t,s){"search"==t?(this.currentpage=1,this.orderby="",this.order="",this.filter=""):this.search="";seedprod_remote_api;var e=this;e.loading=!0,j.a.start(),this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_subscribers_datatable&_wpnonce="+seedprod_nonce+"¤t_page="+this.currentpage+"&orderby="+this.orderby+"&order="+this.order+"&filter="+this.filter+"&s="+this.search+"&id="+this.lpage_uuid+"&interval="+this.chart_timeframe).then(function(t){e.loading=!1,j.a.done(),t.data.lpage_name&&(e.lpage_name=t.data.lpage_name),"all"==e.filter&&0==e.shared.subscriber_count?(e.shared.subscriber_count=t.data.subscribers.total,e.axios.get(seedprod_update_subscriber_count)):e.shared.subscriber_count=1,e.rows=t.data.rows,e.totalitems=w()(t.data.totalitems),e.totalpages=w()(t.data.totalpages),e.currentpage=w()(t.data.currentpage),e.chartData=t.data.recent_subscribers})},goToPage:function(t){this.currentpage=t,this.loadItems()},onActionClick:function(t,s){"delete"==t&&this.trash(s.id)},onBulkAction:function(t,s){"delete_subscribers"==t&&this.trash(s)},sortCallback:function(t,s){this.orderby=t,this.order=s,this.loadItems()}},created:function(){0==this.$route.params.id&&this.loadItems(),this.load_lpages();var t=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(2)'),s=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(4)');t.classList.remove("current"),s.classList.add("current")},watch:{$route:function(t,s){this.filter="all",this.loadItems("",t.params.id)}}},at=et,nt=Object(u["a"])(at,R,V,!1,null,null,null),ot=nt.exports,it=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{attrs:{id:"seedprod-settings"}},[e("router-view",{attrs:{name:"main"}})],1)])},rt=[],pt={name:"Settings",data:function(){return{txt_1:Object(l["a"])("General","coming-soon"),txt_2:Object(l["a"])("Emails","coming-soon"),txt_3:Object(l["a"])("Integrations","coming-soon"),shared:seedprod_store_admin}},created:function(){var t=document.querySelector(".wp-first-item a[href='admin.php?page="+this.shared.page_path+"']"),s="current";t.classList.remove(s),t.parentNode.classList.remove(s);t=document.querySelector("a[href='admin.php?page="+this.shared.page_path+"_settings']"),s="current";t.classList?t.classList.add(s):t.className+=" "+s,t.parentNode.classList?t.parentNode.classList.add(s):t.parentNode.className+=" "+s},methods:{}},lt=pt,ct=Object(u["a"])(lt,it,rt,!1,null,null,null),dt=ct.exports,ut=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("table",{staticClass:"form-table sp-text-neutral-80"},[e("tbody",[e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("td",{staticClass:"sp-p-0 sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid sp-pb-5",attrs:{colspan:"2"}},[e("h4",{staticClass:"sp-text-xl sp-mt-4 sp-mb-1"},[t._v(t._s(t.txt_1))]),"seedprod_pro"==t.shared.page_path?e("p",[t._v("\n\t\t\t\t\t\t"+t._s(t.txt_2)+"\n\t\t\t\t\t")]):t._e(),"seedprod_lite"==t.shared.page_path?e("p",[e("span",{domProps:{innerHTML:t._s(t.txt_3)}}),e("img",{staticClass:"emoji",attrs:{draggable:"false",alt:"🙂",src:"https://s.w.org/images/core/emoji/11.2.0/svg/1f642.svg"}})]):t._e(),"seedprod_lite"==t.shared.page_path?e("p",{staticClass:"sp-mt-2",domProps:{innerHTML:t._s(t.txt_4)}}):t._e(),"seedprod_lite"==t.shared.page_path?e("p",{staticStyle:{"margin-top":"12px"},domProps:{innerHTML:t._s(t.txt_5)}}):t._e()])]),e("tr",{staticClass:"seedprod-settings-form sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid",attrs:{valign:"top"}},[e("th",{attrs:{scope:"row"}},[e("strong",{staticClass:"sp-text-neutral-80"},[t._v(t._s(t.txt_6))])]),e("td",[e("form",{staticClass:"form-inline"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.shared.settings_page_meta.api_key,expression:"shared.settings_page_meta.api_key"}],staticClass:"sp-form-input sp-w-64 sp-m-0",staticStyle:{"margin-bottom":"5px"},attrs:{type:"password",autocomplete:"off",placeholder:t.txt_7},domProps:{value:t.shared.settings_page_meta.api_key},on:{input:function(s){s.target.composing||t.$set(t.shared.settings_page_meta,"api_key",s.target.value)}}}),e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-primary sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-white sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"api_key"==t.shared.settings_page_meta.button},on:{click:function(s){return s.preventDefault(),t.save_api_key(s)}}},[t.shared.doing_ajax&&"api_key"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "),t.shared.license_name?e("span",[t._v(t._s(t.txt_8))]):e("span",[t._v(t._s(t.txt_9))])]),t.shared.license_name&&"seedprod_pro"==t.shared.page_path?e("span",[e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-neutral-80 sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-neutral-15 sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"deactivate_api_key"==t.shared.settings_page_meta.button},on:{click:function(s){return s.preventDefault(),t.deactivate_api_key(s)}}},[t.shared.doing_ajax&&"deactivate_api_key"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "),e("span",[t._v(t._s(t.txt_10))])])]):t._e(),t._v("\n\t\t\t\t\t\t \n\t\t\t\t\t\t"),"seedprod_lite"==t.shared.page_path&&t.show_unlock?e("span",[e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-neutral-80 sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-neutral-15 sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"unlock"==t.shared.settings_page_meta.button},on:{click:t.start_free_to_pro_upgrade}},[t.shared.doing_ajax&&"unlock"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "+t._s(t.txt_11)+"\n\t\t\t\t\t\t\t")])]):t._e()]),t.shared.license_name?e("div",{staticClass:"sp-text-neutral-80",staticStyle:{"margin-top":"2px"},domProps:{innerHTML:t._s(t.txt_12)}}):t._e()])]),e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("td",{staticClass:"sp-p-0 sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid sp-pb-5",attrs:{colspan:"2"}},[e("h4",{staticClass:"sp-text-xl sp-mt-4 sp-mb-1"},[t._v(t._s(t.txt_13))]),e("a",{attrs:{href:"admin.php?page=sp_pro_debug"}},[t._v("View Debug Information")])])])])]),"seedprod_lite"==t.shared.page_path&&t.shared.show_inline_cta?e("div",[e("SettingsLiteCTA")],1):t._e()])},gt=[],_t=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-px-10 sp-py-10 sp-text-center sp-relative"},[e("span",{staticClass:"sp-neutral-60 sp-absolute sp-cursor-pointer sp-right-0 sp-top-0 sp-opacity-75 sp-mt-2 sp-mr-1",on:{click:t.dismiss_upsell}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])]),e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v("Special Upgrade Offer - Save 50% Off")]),t._m(0),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_997))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_998))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_999))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9912))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9913))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9914))])])])]),e("a",{staticClass:"sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginsettingsabout",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" Upgrade to SeedProd PRO Now\n ")])])])])},mt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral"},[t._v("\n Upgrade to SeedProd Pro\n "),e("br"),t._v("Today and Save\n ")])}],ht={name:"SettingsLiteCTA",data:function(){return{txt_1:Object(l["a"])("Dismiss this message","coming-soon"),txt_2:Object(l["a"])("Get SeedProd Pro and Unlock all the Powerful Features","coming-soon"),txt_3:Object(l["a"])("Thanks for being a loyal SeedProd Lite user. Upgrade to\nSeedProd Pro to unlock all the awesome features and\nexperience why SeedProd is the best WordPress landing\npage plugin.","coming-soon"),txt_4:Object(l["a"])("Pro Features:","coming-soon"),txt_995:Object(l["a"])("Powerful Page Editor","coming-soon"),txt_996:Object(l["a"])("20+ PRO Page Blocks","coming-soon"),txt_997:Object(l["a"])("Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Access Controls","coming-soon"),txt_9910:Object(l["a"])("100+ PRO Page Templates","coming-soon"),txt_9911:Object(l["a"])("PRO Smart Sections","coming-soon"),txt_9912:Object(l["a"])("Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),txt_15:Object(l["a"])("Bonus:","coming-soon"),txt_16:Object(l["a"])("SeedProd Lite users get","coming-soon"),txt_17:Object(l["a"])("a discount off the regular price","coming-soon"),txt_18:Object(l["a"])("automatically applied at checkout.","coming-soon"),txt_19:Object(l["a"])("Get SeedProd Pro Today and Unlock all the Powerful Features »","coming-soon"),shared:seedprod_store_admin}},methods:{dismiss_upsell:function(){var t=p.a.stringify({id:3});this.axios.post(seedprod_dismiss_upsell,t,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.status&&location.reload()})},dismiss:function(){var t=this,s=p.a.stringify({dismiss:!0});this.shared.settings_page_meta.dismiss_settings_lite_cta=!0,t.axios.post(seedprod_dismiss_settings_lite_cta_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}}},bt=ht,vt=Object(u["a"])(bt,_t,mt,!1,null,null,null),xt=vt.exports,ft={name:"SettingsGeneral",mixins:[Y["a"]],data:function(){return{txt_1:Object(l["a"])("License","coming-soon"),txt_2:Object(l["a"])("Your license key provides access to updates and addons.","coming-soon"),txt_3:Object(l["a"])("You're using <strong>SeedProd Lite</strong> - No License needed. Enjoy!","coming-soon"),txt_4:Object(l["b"])(Object(l["a"])("To unlock more features consider <a href='%s' target='_blank'>upgrading to PRO</a> . As a valued SeedProd Lite user you'll receive <strong>a discount off the regular price</strong>, automatically applied at checkout!","coming-soon"),"https://www.seedprod.com/lite-upgrade/?discount=LITEUPGRADE&utm_source=WordPress&utm_medium=seedprod-license-page&utm_campaign=liteplugin"),txt_5:Object(l["b"])(Object(l["a"])("If you already have a license key for <a href='%s' target='_blank'>SeedProd Pro</a>, please enter it to Upgrade to the Pro Features.","coming-soon"),seedprod_store_admin.upgrade_link+"welcome"),txt_6:Object(l["a"])("License Key","coming-soon"),txt_7:Object(l["a"])("Enter Your License Key Here","coming-soon"),txt_8:Object(l["a"])("Recheck Key","coming-soon"),txt_9:Object(l["a"])("Verify Key","coming-soon"),txt_10:Object(l["a"])("Deactivate Key","coming-soon"),txt_11:Object(l["a"])("Connect to SeedProd","coming-soon"),txt_12:Object(l["b"])(Object(l["a"])("You currently have the <strong>%s</strong> license.","coming-soon"),seedprod_store_admin.license_name),txt_13:Object(l["a"])("Debug Information","coming-soon"),show_unlock:!1,shared:seedprod_store_admin}},computed:{slug:function(){var t=this.slugify(this.page_meta.upgrade_feature);return t}},methods:{goto_dashboard:function(){this.$router.push({name:"dashboard"})},start_free_to_pro_upgrade:function(){var t=this;j.a.start();var s=p.a.stringify({});t.shared.doing_ajax=!0,t.shared.settings_page_meta.button="unlock",t.$swal({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Preparing to Unlock... Please wait...",toast:!0,customClass:"sp-toast-success",type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),this.axios.post(seedprod_upgrade_license_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,s.data.success?location.href=s.data.data.url:t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.data.data.message,toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s,toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})},save_settings:function(){var t=this;j.a.start(),this.$validator.validateAll().then(function(s){if(s){var e=p.a.stringify({settings:t.shared.settings});return t.shared.doing_ajax=!0,t.shared.settings_page_meta.button="settings",void t.axios.post(seedprod_save_settings_ajax_url,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){j.a.done(),t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Saved!","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(l["a"])("Could not be saved. Please contact Support if you continue to experience this issue.","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})}var a="";t.errors.all().forEach(function(t){a=a+t+"\n"}),a+="",t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:a,toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})},deactivate_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="deactivate_api_key",t.axios.post(seedprod_api_key_deactivate_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,"true"==s.data.status){var e="success";t.shared.license_name="",t.shared.settings_page_meta.api_key=""}else e="error";t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})},save_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="api_key";var e="admin-ajax.php?action="+this.shared.page_path+"_save_api_key&_wpnonce="+seedprod_nonce;t.axios.post(e,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.shared.license_name=1,t.txt_12=s.data.license_name,console.log(s.data.license_name),"true"==s.data.status){t.show_unlock=!0;var e="success";s.data.body.plugin_name&&(t.shared.license_name=s.data.body.plugin_name)}else{e="error";t.shared.license_name=""}t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){console.log(s),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})})}},components:{SettingsLiteCTA:xt}},wt=ft,Ct=Object(u["a"])(wt,ut,gt,!1,null,null,null),yt=Ct.exports,kt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",[e("div",{staticClass:"sp-bg-white sp--ml-5 sp-flex sp-flex-col sp-items-center",attrs:{id:"sp-welcome-top"}},[e("div",{staticClass:"robbie"},[e("img",{staticClass:"sp-mt-16",attrs:{id:"seedprod-welcome-logo",src:t.shared.plugin_path+"public/svg/seedprod-logo.svg",alt:t.txt_14}})]),e("div",{staticClass:"sp-mx-auto sp-text-center sp-text-15px sp-w-460 sp-font-semibold sp-text-neutral-80 sp-mb-6 sp-mt-5 sp-leading-relaxed"},[t._v(t._s(t.txt_1))]),e("div",{staticClass:"sp-mb-32 sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-p-10 sp-w-580 sp-z-20 sp-bg-white sp-shadow-2xl"},["seedprod_lite"==t.shared.page_path?e("div",{staticClass:"sp-font-bold sp-text-base sp-text-neutral"},[e("span",{domProps:{innerHTML:t._s(t.txt_2)}}),e("img",{staticClass:"emoji",attrs:{draggable:"false",alt:"🙂",src:"https://s.w.org/images/core/emoji/11.2.0/svg/1f642.svg"}})]):t._e(),"seedprod_pro"==t.shared.page_path?e("div",{staticClass:"sp-font-bold sp-text-base sp-text-neutral sp-text-center ",attrs:{id:"license-sub"}},[t._v("\n "+t._s(t.txt_3)+"\n ")]):t._e(),"seedprod_pro"==t.shared.page_path?e("form",{staticClass:"sp-flex sp-mt-6"},[e("div",{staticClass:"sp-flex sp-mx-auto"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.shared.settings_page_meta.api_key,expression:"\n\t\t\t\t\t\t\t\t\t\t\tshared.settings_page_meta.api_key\n\t\t\t\t\t\t\t\t\t\t"}],staticClass:"sp-form-input sp-h-48px",staticStyle:{"min-width":"300px"},attrs:{type:"password",name:"name",placeholder:t.txt_5,autocomplete:"off"},domProps:{value:t.shared.settings_page_meta.api_key},on:{input:function(s){s.target.composing||t.$set(t.shared.settings_page_meta,"api_key",s.target.value)}}}),e("button",{staticClass:"sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-4 sp-py-4 sp-rounded-sm sp-leading-none sp-text-white sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer sp-border-none",attrs:{disabled:!!t.shared.doing_ajax},on:{click:function(s){return s.preventDefault(),t.save_api_key(s)}}},[t.shared.doing_ajax?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v("\n "+t._s(t.txt_6)+"\n ")])])]):t._e(),e("div",{staticClass:"sp-text-15px sp-text-neutral-80 sp-text-center sp-mt-2",domProps:{innerHTML:t._s(t.txt_7)}})])]),e("div",[e("a",{staticClass:"play-video sp-mx-auto sp-block sp-text-center sp--mt-40",attrs:{href:"#",title:t.txt_15},on:{click:function(s){return s.preventDefault(),t.watch_video(s)}}},[e("img",{staticClass:"video-thumbnail",attrs:{src:t.shared.plugin_path+"public/img/welcome-video.png",alt:t.txt_13}})]),e("div",[e("div",{staticClass:"sp-text-lg sp-text-neutral-80 sp-w-full sp-leading-relaxed sp-mt-8 sp-mx-auto sp-text-center",domProps:{innerHTML:t._s(t.txt_8)}}),e("div",{staticClass:"sp-flex sp-justify-center sp-pb-3 sp-pt-6"},[e("div",{staticClass:"sp-mr-1"},[e("a",{staticClass:"sp-mb-4 sp-inline-block sp-bg-primary sp-px-5 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold",attrs:{id:"first-step",href:"admin.php?page="+t.shared.page_path}},[t._v(t._s(t.txt_9))])]),e("div",{staticClass:"sp-ml-1"},[e("a",{staticClass:"sp-mb-4 sp-inline-block sp-bg-neutral-10 hover:sp-bg-neutral-20 sp-px-5 sp-py-4 sp-rounded sp-leading-none sp-text-neutral-80 sp-no-underline sp-text-17px sp-ml-1 sp-cursor-pointer sp-font-semibold",attrs:{href:"https://seedprod.com/docs/creating-your-first-lpage/?utm_source=WordPress&utm_medium=link&utm_campaign=liteplugin",target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.txt_10))])])])]),e("div",[e("hr",{staticClass:"sp-border sp-border-neutral-20 sp-border-b-0 sp-w-24 sp-mb-8"}),e("h1",{staticClass:"sp-text-center sp-font-bold sp-text-34px sp-text-neutral sp-mt-2 sp-leading-normal sp-tracking-tight",domProps:{innerHTML:t._s(t.txt_11)}}),e("div",{staticClass:"sp-text-17px sp-text-neutral-80 sp-mx-auto sp-w-580 sp-leading-relaxed sp-mt-8 sp-text-center sp-w-full sp-mb-12",domProps:{innerHTML:t._s(t.txt_12)}}),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold",domProps:{innerHTML:t._s(t.txt_16)}}),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_22)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_27))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n\t\t\t\t "+t._s(t.txt_28)+"\n ")])])])]),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_29))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_30)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_31))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_32)+"\n ")])])])]),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_33))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_34)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_35))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_36)+"\n ")])])])]),"seedprod_lite"==t.shared.page_path?e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-w-720 sp-mx-auto sp-px-10 sp-py-10 sp-text-center"},[e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v(t._s(t.txt_17))]),e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral",domProps:{innerHTML:t._s(t.txt_23)}},[e("span",{staticClass:"sp-text-primary"},[t._v(t._s(t.txt_18))])]),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_997))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_998))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_999))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9912))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9913))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9914))])])])]),e("a",{staticClass:"sp-inline-block sp-bg-green sp-px-6 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-flex sp-items-center sp-justify-center",attrs:{href:this.shared.upgrade_link+"pluginwelcomepage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" "+t._s(t.txt_24)+"\n ")])])]):t._e(),e("div",{staticClass:"sm:sp-flex sp-w-720 sp-mx-auto sp-mt-2 sp-mb-20"},[e("div",{staticClass:"sp-testimonial sm:sp-mr-3 sp-w-1/2"},[e("p",{staticClass:"sp-bg-white sp-rounded-md sp-py-5 sp-px-6 sp-text-neutral-80 sp-text-15px sp-mb-0 sp-relative sp-leading-relaxed "},[t._v(t._s(t.txt_21))]),e("div",{staticClass:"sp-flex sp-items-center sp-mt-6 sp-pl-5"},[e("img",{staticClass:"sp-w-10 sp-rounded-full sp-mr-5",attrs:{src:t.shared.plugin_path+"public/img/chris-ducker.jpg"}}),t._m(0)])]),e("div",{staticClass:"sp-testimonial sm:sp-ml-3 sp-w-1/2"},[e("p",{staticClass:"sp-bg-white sp-rounded-md sp-py-5 sp-px-6 sp-text-neutral-80 sp-text-15px sp-mb-0 sp-relative sp-leading-relaxed "},[t._v(t._s(t.txt_26))]),e("div",{staticClass:"sp-flex sp-items-center sp-mt-6 sp-pl-5"},[e("img",{staticClass:"sp-w-10 sp-rounded-full sp-mr-5",attrs:{src:t.shared.plugin_path+"public/img/ruthie-unaegbu.jpg"}}),t._m(1)])])])])])])])},jt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"sp-text-neutral-80 sp-text-xs"},[e("strong",{staticClass:"sp-font-bold"},[t._v("Chris Ducker")]),e("p",{staticClass:"sp-m-0 sp-text-neutral-60 sp-mt-1"},[t._v("Author of #1 Bestselling Book 'Virtual Freedom'")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"sp-text-neutral-80 sp-text-xs"},[e("strong",{staticClass:"sp-font-bold"},[t._v("Ruthie Unaegbu")]),e("p",{staticClass:"sp-m-0 sp-text-neutral-60 sp-mt-1"},[t._v("WordPress Freelancer")])])}],Ot={name:"Welcome",mixins:[Y["a"]],data:function(){return{txt_1:Object(l["a"])("Thank you for choosing SeedProd - The #1 Coming Soon Page and Maintenance Mode Plugin for WordPress.","coming-soon"),txt_2:Object(l["a"])("You're using <strong>SeedProd Lite</strong> - No License needed. Enjoy!","coming-soon"),txt_3:Object(l["a"])("Enter your license key to enable all the features of the plugin.","coming-soon"),txt_4:Object(l["b"])(Object(l["a"])("If you already have a license key for <a href='%s' target='_blank'>SeedProd Pro</a>, please enter it to Upgrade to the Pro Features.","coming-soon"),seedprod_store_admin.upgrade_link+"welcome"),txt_5:Object(l["a"])("Enter Your License Key Here","coming-soon"),txt_6:Object(l["a"])("Verify key","coming-soon"),txt_7:Object(l["b"])(Object(l["a"])("Don't have a license key or need to renew? Visit <a href='%s' target='_blank' class='sp-text-primary'>seedprod.com</a>","coming-soon"),"https://www.seedprod.com?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginwelcomelicense"),txt_8:Object(l["a"])("SeedProd makes it easy to create landing pages in WordPress.<br>You can watch the video tutorial or read our guide on how create your first page.","coming-soon"),txt_9:Object(l["a"])("Create Your First Page","coming-soon"),txt_10:Object(l["a"])("Read the Full Guide","coming-soon"),txt_11:Object(l["a"])("SeedProd Features & Solutions","coming-soon"),txt_12:Object(l["a"])("SeedProd is both easy to use and extremely powerful. We have tons of<br />helpful features to help you create a successful landing page.","coming-soon"),txt_13:Object(l["a"])("Watch how to create your first landing page","coming-soon"),txt_14:Object(l["a"])("Robbie the Rabbit the SeedProd mascot","coming-soon"),txt_15:Object(l["a"])("Watch how to create your first page","coming-soon"),txt_16:Object(l["a"])("Drag & Drop Page Builder","coming-soon"),txt_17:Object(l["a"])("Special Upgrade Offer - Save 50% Off","coming-soon"),txt_18:Object(l["a"])("Save 20%","coming-soon"),txt_19:Object(l["a"])("Pro","coming-soon"),txt_20:Object(l["a"])("per year","coming-soon"),txt_21:Object(l["a"])("\"Want to create a great looking 'coming soon' landing page and grab emails easily? Check out SeedProd\"","coming-soon"),txt_22:Object(l["a"])("Our Drag & Drop Page Builder lets you create great looking pages and layouts fast so you can get your landing page up in minutes. No coding required!","coming-soon"),txt_23:Object(l["a"])("Upgrade to SeedProd Pro<br />Today and Save","coming-soon"),txt_24:Object(l["a"])("Upgrade to PRO Now","coming-soon"),txt_25:Object(l["a"])("List","coming-soon"),txt_26:Object(l["a"])('"Just gotta say how awesome SeedProd really is! WordPress freelancers really need this in their repertoire!"',"coming-soon"),txt_27:Object(l["a"])("Landing Page Templates","coming-soon"),txt_28:Object(l["a"])("Create a variety of landing pages including sales, optin, coming soon, maintenance mode, webinar, and thank you pages. New templates added regularly.","coming-soon"),txt_29:Object(l["a"])("Smart Sections","coming-soon"),txt_30:Object(l["a"])("We created professionally designed pre-built sections like headers, calls to action, so you don't need to be a designer to create beautiful layouts.","coming-soon"),txt_31:Object(l["a"])("Premium Integrations","coming-soon"),txt_32:Object(l["a"])("Collect emails with your favorite 3rd party email marketing service providers including MailChimp, ActiveCampaign, ConvertKit, Constant Contact and more...","coming-soon"),txt_33:Object(l["a"])("No Coding Skills Needed","coming-soon"),txt_34:Object(l["a"])("We've eliminated all the technical barries that keep you from building the perfect landing page.","coming-soon"),txt_35:Object(l["a"])("Super Fast Loading Pages","coming-soon"),txt_36:Object(l["a"])("Bloat free code results in faster loading pages which means your page converts higher.","coming-soon"),txt_995:Object(l["a"])("Drag & Drop Page Builder","coming-soon"),txt_996:Object(l["a"])("20+ PRO Page Blocks","coming-soon"),txt_997:Object(l["a"])("Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Page Access Controls","coming-soon"),txt_9910:Object(l["a"])("100+ PRO Page Templates","coming-soon"),txt_9911:Object(l["a"])("PRO Smart Sections","coming-soon"),txt_9912:Object(l["a"])("Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),shared:seedprod_store_admin}},methods:{watch_video:function(){this.$swal({width:600,html:'<iframe width="100%" height="315" src="https://www.youtube.com/embed/MUXoqm3VpRo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',toast:!1,customContainerClass:"seedprod-welcome-video"})},save_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="api_key";var e="admin-ajax.php?action="+this.shared.page_path+"_save_api_key&_wpnonce="+seedprod_nonce;t.axios.post(e,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,"true"==s.data.status)var e="success";else e="error";t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e4});var a=document.getElementById("first-step");a.scrollIntoView(!1)}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})}}},Pt=Ot,Lt=Object(u["a"])(Pt,kt,jt,!1,null,null,null),St=Lt.exports,Mt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{attrs:{id:"seedprod-aboutus"}},[e("nav",{staticClass:"sp-hidden"},[e("ul",{},[e("router-link",{attrs:{tag:"li",to:{name:"aboutus_aboutus"}}},[e("a",[e("span",[t._v(t._s(t.txt_1))])])]),e("router-link",{attrs:{tag:"li",to:{name:"aboutus_gettingstarted"}}},[e("a",[e("span",[t._v(t._s(t.txt_2))])])]),"seedprod_lite"==t.shared.page_path?e("router-link",{attrs:{tag:"li",to:{name:"aboutus_litevspro"}}},[e("a",[e("span",[t._v(t._s(t.txt_3))])])]):t._e()],1)]),e("div",[e("router-view",{attrs:{name:"main"}})],1)])},Tt=[],zt={name:"Aboutus",data:function(){return{txt_1:Object(l["a"])("About Us","coming-soon"),txt_2:Object(l["a"])("Getting Started","coming-soon"),txt_3:Object(l["a"])("Lite vs Pro","coming-soon"),shared:seedprod_store_admin}},computed:{},created:function(){var t=document.querySelector(".wp-first-item a[href='admin.php?page="+this.shared.page_path+"']"),s="current";t.classList.remove(s),t.parentNode.classList.remove(s);t=document.querySelector("a[href='admin.php?page="+this.shared.page_path+"_about_us']"),s="current";t.classList?t.classList.add(s):t.className+=" "+s,t.parentNode.classList?t.parentNode.classList.add(s):t.parentNode.className+=" "+s},methods:{}},Bt=zt,At=Object(u["a"])(Bt,Mt,Tt,!1,null,null,null),$t=At.exports,Dt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"lg:sp-flex sp-mt-10 sp-a"},[e("div",{staticClass:"sp-mr-20"},[e("h3",{staticClass:"sp-mt-0 sp-text-neutral sp-text-xl sp-leading-normal"},[t._v("\n "+t._s(t.txt_1)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_2)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_3)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_4)+"\n "),e("a",{attrs:{href:"https://www.wpbeginner.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("WPBeginner")]),t._v(", "+t._s(t.txt_6)+",\n "),e("a",{attrs:{href:"https://optinmonster.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("OptinMonster")]),t._v(", "+t._s(t.txt_7)+",\n "),e("a",{attrs:{href:"https://www.monsterinsights.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("MonsterInsights")]),t._v(", "+t._s(t.txt_8)+",\n "),e("a",{attrs:{href:"https://www.wpforms.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("WPForms")]),t._v(", "+t._s(t.txt_9)+",\n "),e("a",{attrs:{href:"https://rafflepress.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("RafflePress")]),t._v(", "+t._s(t.txt_10)+",\n "),e("a",{attrs:{href:"https://trustpulse.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("TrustPulse")]),t._v(".\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_5)+"\n ")])]),e("div",{},[e("img",{staticClass:"sp-rounded",attrs:{src:t.shared.plugin_path+"public/img/team.jpg",alt:t.txt_11}}),e("figcaption",{staticClass:"sp-text-neutral-80 sp-text-15px sp-text-center sp-mt-6"},[t._v("\n "+t._s(t.txt_12)+": Syed, John & Thomas"),e("br")])])]),"seedprod_lite"==t.shared.page_path&&t.shared.show_inline_cta?e("div",[e("SettingsLiteCTA")],1):t._e()])},Ut=[],Ht={name:"AboutusAbout",data:function(){return{txt_1:Object(l["a"])("Hello and welcome to SeedProd, the most beginner friendly drag & drop WordPress landing page plugin. At SeedProd, we build software that helps you create beautiful responsive landing pages for your website in minutes.","coming-soon"),txt_2:Object(l["a"])("Over the years, we found that most WordPress landing page plugins were bloated, buggy, slow, and very hard to use. So we started with a simple goal: build a WordPress landing page plugin that’s both easy and powerful.","coming-soon"),txt_3:Object(l["a"])("Our goal is to take the pain out of creating landing pages and make it easy.","coming-soon"),txt_4:Object(l["a"])("SeedProd is brought to you by the same team that’s behind the largest WordPress resource site,","coming-soon"),txt_5:Object(l["a"])("Yup, we know a thing or two about building awesome products that customers love.","coming-soon"),txt_6:Object(l["a"])("the most popular lead-generation software","coming-soon"),txt_7:Object(l["a"])("the best WordPress analytics plugin","coming-soon"),txt_8:Object(l["a"])("the best WordPress forms plugin","coming-soon"),txt_9:Object(l["a"])("the best WordPress giveaway plugin","coming-soon"),txt_10:Object(l["a"])("and finally the best WordPress FOMO plugin","coming-soon"),txt_11:Object(l["a"])("SeedProd Team photo","coming-soon"),txt_12:Object(l["a"])("The SeedProd Team","coming-soon"),shared:seedprod_store_admin}},methods:{},components:{SettingsLiteCTA:xt}},It=Ht,Et=Object(u["a"])(It,Dt,Ut,!1,null,null,null),Nt=Et.exports;n["default"].use(h["a"]);var Ft=new h["a"]({routes:[{name:"dashboard",path:"/",component:U},{name:"growthtools",path:"/growth-tools",component:W},{name:"subscribers",path:"/subscribers/:id",component:ot},{path:"/settings",component:dt,children:[{name:"settings_general",path:"",components:{main:yt}}]},{path:"/aboutus",component:$t,children:[{name:"aboutus_aboutus",path:"",components:{main:Nt}}]},{name:"welcome",path:"/welcome",component:St}],linkActiveClass:"active"}),Wt=Ft,Rt=e("619c"),Vt=e("e37d"),Gt=e("bc3a"),qt=e.n(Gt),Yt=e("a7fe"),Kt=e.n(Yt),Jt=e("7bb1"),Qt=e("f206");n["default"].config.devtools=!0,n["default"].component("ToggleButton",Qt["ToggleButton"]),n["default"].use(Rt["a"]),n["default"].use(Jt["a"]),n["default"].use(Vt["a"],{defaultClass:"seedprod-tooltip"}),n["default"].use(Kt.a,qt.a),n["default"].config.productionTip=!1;var Xt={show_topbar_cta:seedprod_data_admin.show_topbar_cta,show_inline_cta:seedprod_data_admin.show_inline_cta,seedprod_unsupported_feature:seedprod_data_admin.seedprod_unsupported_feature,seedprod_csp4_migrated:seedprod_data_admin.seedprod_csp4_migrated,seedprod_csp4_imported:seedprod_data_admin.seedprod_csp4_imported,seedprod_cspv5_migrated:seedprod_data_admin.seedprod_cspv5_migrated,seedprod_cspv5_imported:seedprod_data_admin.seedprod_cspv5_imported,page_count:seedprod_data_admin.page_count,subscriber_count:seedprod_data_admin.subscriber_count,notifications:seedprod_data_admin.notifications,csp_id:seedprod_data_admin.csp_id,mmp_id:seedprod_data_admin.mmp_id,p404_id:seedprod_data_admin.p404_id,loginp_id:seedprod_data_admin.loginp_id,csp_uuid:seedprod_data_admin.csp_uuid,mmp_uuid:seedprod_data_admin.mmp_uuid,p404_uuid:seedprod_data_admin.p404_uuid,loginp_uuid:seedprod_data_admin.loginp_uuid,csp_preview_url:seedprod_data_admin.csp_preview_url,mmp_preview_url:seedprod_data_admin.mmp_preview_url,p404_preview_url:seedprod_data_admin.p404_preview_url,loginp_preview_url:seedprod_data_admin.loginp_preview_url,api_token:seedprod_data_admin.api_token,license_key:seedprod_data_admin.license_key,license_name:seedprod_data_admin.license_name,per:seedprod_data_admin.per,page_path:seedprod_data_admin.page_path,name:seedprod_data_admin.name,email:seedprod_data_admin.email,upgrade_link:seedprod_data_admin.upgrade_link,doing_ajax:!1,plugin_path:seedprod_data_admin.plugin_path,home_url:seedprod_data_admin.home_url,settings:seedprod_data_admin.settings,settings_page_meta:{lclass:seedprod_data_admin.lclass,lmsg:seedprod_data_admin.lmsg,button:"",api_key:seedprod_data_admin.api_key,timezones:seedprod_data_admin.timezones,dismiss_settings_lite_cta:seedprod_data_admin.dismiss_settings_lite_cta}};window.seedprod_store_admin=Xt;new n["default"]({router:Wt,mounted:function(){},render:function(t){return t(m)}}).$mount("#seedprod-vue-app");var Zt=function(){iFrameResize({log:!1,checkOrigin:!1},"#inline-help")};window.help_iframe=Zt}});
|
1 |
+
(function(t){function s(s){for(var a,i,r=s[0],p=s[1],l=s[2],d=0,u=[];d<r.length;d++)i=r[d],n[i]&&u.push(n[i][0]),n[i]=0;for(a in p)Object.prototype.hasOwnProperty.call(p,a)&&(t[a]=p[a]);c&&c(s);while(u.length)u.shift()();return o.push.apply(o,l||[]),e()}function e(){for(var t,s=0;s<o.length;s++){for(var e=o[s],a=!0,r=1;r<e.length;r++){var p=e[r];0!==n[p]&&(a=!1)}a&&(o.splice(s--,1),t=i(i.s=e[0]))}return t}var a={},n={admin:0},o=[];function i(s){if(a[s])return a[s].exports;var e=a[s]={i:s,l:!1,exports:{}};return t[s].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=t,i.c=a,i.d=function(t,s,e){i.o(t,s)||Object.defineProperty(t,s,{enumerable:!0,get:e})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,s){if(1&s&&(t=i(t)),8&s)return t;if(4&s&&"object"===typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(i.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&s&&"string"!=typeof t)for(var a in t)i.d(e,a,function(s){return t[s]}.bind(null,a));return e},i.n=function(t){var s=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(s,"a",s),s},i.o=function(t,s){return Object.prototype.hasOwnProperty.call(t,s)},i.p="/wp-content/plugins/seedprod-pro/public/lite/vue-backend/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],p=r.push.bind(r);r.push=s,r=r.slice();for(var l=0;l<r.length;l++)s(r[l]);var c=p;o.push([1,"chunk-vendors","chunk-common"]),e()})({1:function(t,s,e){t.exports=e("9150")},9150:function(t,s,e){"use strict";e.r(s);e("7f7f"),e("cadf"),e("551c"),e("f751"),e("097d");var a,n=e("2b0e"),o=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"seedprod-app seedprod sp-antialiased sp-font-display"},["seedprod_lite"==t.shared.page_path&&t.shared.show_topbar_cta?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-2 sp-px-8 sp-text-sm sp-flex sp-justify-center sp-leading-normal sp-relative"},[t._v("\n You’re using SeedProd Lite. To unlock more features consider\n "),e("a",{staticClass:"sp-ml-1 sp-text-white hover:sp-text-white sp-no-underline sp-border-0 sp-border-b sp-border-white sp-border-dotted",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=plugintopbar",target:"_blank"}},[t._v("upgrading to Pro")]),e("span",{staticClass:"sp-text-white sp-absolute sp-cursor-pointer sp-right-0 sp-top-0 sp-opacity-75 sp-mt-2 sp-mr-1",on:{click:t.dismiss_upsell}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])])]):t._e(),!1===t.shared.seedprod_csp4_migrated&&1==t.shared.seedprod_csp4_imported?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-4 sp-px-8 sp-text-lg sp-flex sp-justify-center sp-leading-normal"},[e("svg",{staticClass:"sp-fill-current sp-w-20 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12zM11 5h2v6h-2zm0 8h2v2h-2z"}})]),t._m(0)]):t._e(),!1===t.shared.seedprod_cspv5_migrated&&1==t.shared.seedprod_cspv5_imported?e("div",{staticClass:"sp--ml-5 sp-bg-green sp-text-white sp-py-4 sp-px-8 sp-text-lg sp-flex sp-justify-center sp-leading-normal"},[e("svg",{staticClass:"sp-fill-current sp-w-20 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12zM11 5h2v6h-2zm0 8h2v2h-2z"}})]),e("div",[t._v("\n We have migrated your page settings from the old version to our new builder. Don't worry nothing has changed with your pages. However, a lot has changed in the plugin.\n "),e("a",{staticClass:"sp-text-white sp-font-bold",attrs:{href:"https://www.seedprod.com/docs/migrating-from-the-previous-pro-version/?dep="+t.shared.seedprod_unsupported_feature,target:"_blank"}},[t._v("Learn more about the all new SeedProd plugin and how to complete the migration process.")])])]):t._e(),"welcome"!=t.$router.currentRoute.name?e("div",{staticClass:"sp-bg-white sp--ml-5 sp-pt-6 sp-pb-8 sp-px-8 sp-text-neutral sp-flex sp-items-end sp-justify-between"},[e("div",{staticClass:"sp-flex sp-items-end sp-flex-1"},[e("img",{attrs:{id:"seedprod-logo",src:t.shared.plugin_path+"public/svg/seedprod-logo.svg",alt:t.txt_6}}),e("span",{staticClass:"sp-inline-block sp-px-6 sp-flex sp-items-end"},[e("svg",{attrs:{width:"12",height:"29",viewBox:"0 0 12 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 28L11 0.999998",stroke:"#D3CED2"}})])]),"pages"==this.$route.name||"dashboard"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_1))]):t._e(),"growthtools"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_2))]):t._e(),"aboutus_aboutus"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_3))]):t._e(),"subscribers"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_4))]):t._e(),"settings_general"==this.$route.name?e("div",{staticClass:"sp-text-2xl sp-font-semibold"},[t._v(t._s(t.txt_5))]):t._e()]),e("div",[e("a",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-15 sp-rounded-full sp-flex sp-items-center sp-justify-center sp-p-c63 sp-text-neutral-60",attrs:{href:"https://www.seedprod.com/docs/",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"}})])])])]):t._e(),t.shared.notifications.length>0?e("div",{staticClass:"sp-ml-3 sp-bg-white sp-rounded sp-p-4 sp-mt-4 sp-mr-4 sp-flex sp-shadow"},[t.shared.notifications[t.notification_index].img?e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.notifications[t.notification_index].img}}):e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/bell.svg"}}),e("div",{staticClass:"sp-flex-1"},[e("div",{staticClass:"sp-text-lg sp-font-semibold sp-mb-2 sp-flex sp-justify-between"},[t._v("\n "+t._s(t.shared.notifications[t.notification_index].title)+"\n "),e("span",{staticClass:"sp-cursor-pointer sp-text-neutral-40 hover:sp-text-red",on:{click:function(s){return t.dismiss_notifications(t.shared.notifications[t.notification_index].id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])])]),e("div",{staticClass:"sp-mb-3 sp-text-base",domProps:{innerHTML:t._s(t.shared.notifications[t.notification_index].content)}}),e("div",{staticClass:"sp-flex sp-justify-between sp-items-center"},[e("div",[t.shared.notifications[t.notification_index].btns.main?e("a",{staticClass:"button button-primary sp-mr-2",attrs:{href:t.shared.notifications[t.notification_index].btns.main.url,target:"_blank"}},[t._v(t._s(t.shared.notifications[t.notification_index].btns.main.text))]):t._e(),t.shared.notifications[t.notification_index].btns.alt?e("a",{staticClass:"button button-secondary",attrs:{href:t.shared.notifications[t.notification_index].btns.alt.url,target:"_blank"}},[t._v(t._s(t.shared.notifications[t.notification_index].btns.alt.text))]):t._e()]),e("div",[e("a",{staticClass:"sp-cursor-pointer sp-border sp-border-neutral-20 sp-border-solid sp-rounded sp-p-2 sp-text-10px sp-text-neutral-40 hover:sp-border-neutral-40 hover:sp-text-40 sp-mr-1",class:{"sp-invisible":0==t.notification_index},attrs:{title:t.txt_7},on:{click:function(s){return s.preventDefault(),t.scroll_notifications("prev")}}},[e("i",{staticClass:"fa fa-chevron-left",attrs:{"aria-hidden":"true"}})]),e("a",{staticClass:"sp-cursor-pointer sp-border sp-border-neutral-20 sp-border-solid sp-rounded sp-p-2 sp-text-10px sp-text-neutral-40 hover:sp-border-neutral-40 hover:sp-text-40",class:{"sp-invisible":t.notification_index==t.shared.notifications.length-1},attrs:{title:t.txt_8},on:{click:function(s){return s.preventDefault(),t.scroll_notifications("next")}}},[e("i",{staticClass:"fa fa-chevron-right",attrs:{"aria-hidden":"true"}})])])])])]):t._e(),e("div",{staticClass:"sp-pl-3 sp-pr-8"},[e("keep-alive",[e("router-view")],1)],1)])},i=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[t._v('\n We have migrated your page settings from the old version to our new builder. Don\'t worry nothing has changed with your page. Your old version will continue to display until you click "Edit" on the Coming Soon or Maintenance Page and then "Save". After Saving the new version will be displayed.\n '),e("br"),e("a",{staticClass:"sp-text-white sp-font-bold",attrs:{href:"https://www.seedprod.com/docs/migrating-from-the-previous-free-version/",target:"_blank"}},[t._v("Learn more about the all new SeedProd plugin and how to complete the migration process.")])])}],r=e("4328"),p=e.n(r),l=(e("2ef0"),e("561c")),c={data:function(){return{txt_1:Object(l["a"])("Pages","coming-soon"),txt_2:Object(l["a"])("Growth Tools","coming-soon"),txt_3:Object(l["a"])("About Us","coming-soon"),txt_4:Object(l["a"])("Subscribers","coming-soon"),txt_5:Object(l["a"])("Settings","coming-soon"),txt_6:Object(l["a"])("SeedProd Logo","coming-soon"),txt_7:Object(l["a"])("Previous message ","coming-soon"),txt_8:Object(l["a"])("Next message","coming-soon"),notification_index:0,shared:seedprod_store_admin}},mounted:function(){},watch:{$route:function(t,s){jQuery("html").scrollTop(0)}},methods:{dismiss_upsell:function(){var t=p.a.stringify({id:1});this.axios.post(seedprod_dismiss_upsell,t,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.status&&location.reload()})},dismiss_notifications:function(t){var s=this,e=p.a.stringify({id:t});s.$delete(s.shared.notifications,s.notification_index),0<s.notification_index?s.notification_index=s.notification_index-1:1<s.notification_index.length&&0==s.notification_index?s.notification_index=s.notification_index+1:s.notification_index=0,this.axios.post(seedprod_notification_dismiss,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.success&&location.reload()})},scroll_notifications:function(t){"prev"==t&&this.notification_index--,"next"==t&&this.notification_index++},goto_settings:function(){this.$router.push({name:"settings"}).catch(function(t){})},show_upgrade_notice:function(t,s){var e=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"link",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n?(t="Upgrade to PRO",s="Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features."):(t+=" is a PRO Feature",s="We're sorry, the "+s+" feature is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features."),this.$swal({title:t,text:s,type:"success",showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:"UPGRADE TO PRO"}).then(function(t){t.value&&(window.open(e.shared.upgrade_link+a,"_blank"),e.$swal.fire("","Thanks for your interest in SeedProd Pro!<br>If you have any questions or issues just <a href='https://www.seedprod.com/?contact=1' target='_blank'>let us know</a>.<br><br>After purchasing SeedProd Pro, you'll need to download and install the Pro version of the plugin, and then remove the free plugin. <br><br>(Don't worry, all your settings will be preserved.)","info"))})}}},d=c,u=e("2877"),g=Object(u["a"])(d,o,i,!1,null,null,null),m=g.exports,h=e("8c4f"),b=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{attrs:{id:"poststuff"}},[e("div",{staticClass:"metabox-holder columns-1",attrs:{id:"post-body"}},[e("div",{staticClass:"clearfix",attrs:{id:"post-body-content"}},[e("div",{staticClass:"sp-flex sp-mt-8 sp-overflow-x-scroll sp-pb-2"},[e("div",{staticClass:"sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/cs-page.svg",alt:t.txt_29}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_1)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_3)+"\n ")]),""==t.shared.csp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("cs")}}},[t._v(t._s(t.txt_4))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("cs")}}},[t._v(t._s(t.txt_5))]),1!=t.shared.seedprod_csp4_imported?e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:t.shared.csp_preview_url,target:"_blank"}},[t._v(t._s(t.txt_6))]):t._e()]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0},on:{change:function(s){return t.enable_mode(1)}},model:{value:t.shared.settings.enable_coming_soon_mode,callback:function(s){t.$set(t.shared.settings,"enable_coming_soon_mode",s)},expression:"shared.settings.enable_coming_soon_mode"}}),t._v(" \n "),t.shared.settings.enable_coming_soon_mode?e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-green sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_7))]):e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/mm-page.svg",alt:t.txt_30}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_9)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_10)+"\n ")]),""==t.shared.mmp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("mm")}}},[t._v(t._s(t.txt_11))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.create_edit_page("mm")}}},[t._v(t._s(t.txt_5))]),1!=t.shared.seedprod_csp4_imported?e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:t.shared.mmp_preview_url,target:"_blank"}},[t._v(t._s(t.txt_6))]):t._e()]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0},on:{change:function(s){return t.enable_mode(2)}},model:{value:t.shared.settings.enable_maintenance_mode,callback:function(s){t.$set(t.shared.settings,"enable_maintenance_mode",s)},expression:"shared.settings.enable_maintenance_mode"}}),t._v(" \n "),t.shared.settings.enable_maintenance_mode?e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-green sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_7))]):e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0 sp-relative",on:{mouseenter:function(s){t.show_loginp_upgrade=!0},mouseleave:function(s){t.show_loginp_upgrade=!1}}},[e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-text-green sp-rounded sp-z-20 sp-px-1 sp-text-10px sp-font-semibold sp-mt-2 sp-mr-1"},[e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("g",{attrs:{fill:"none"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",opacity:".87"}})]),e("path",{attrs:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}})])]),e("div",{staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center sp-z-20 ",class:{"sp-hidden":!t.show_loginp_upgrade}},[e("a",{staticClass:"mt-20 sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginloginpage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n Upgrade to PRO\n ")])]),e("div",{staticClass:"sp-pro-only"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/login-page.svg",alt:t.txt_31}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_33)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_34)+"\n ")]),""==t.shared.loginp_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_35))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_5))]),e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_6))])]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0}}),t._v(" \n\n "),e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)])]),e("div",{staticClass:"sp-ml-4 sp-border sp-border-neutral-15 sp-border-solid sp-bg-white sp-w-275 sp-text-center sp-flex-shrink-0 sp-relative",on:{mouseenter:function(s){t.show_404_upgrade=!0},mouseleave:function(s){t.show_404_upgrade=!1}}},[e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-text-green sp-rounded sp-z-20 sp-px-1 sp-text-10px sp-font-semibold sp-mt-2 sp-mr-1"},[e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("g",{attrs:{fill:"none"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",opacity:".87"}})]),e("path",{attrs:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}})])]),e("div",{staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center sp-z-20 ",class:{"sp-hidden":!t.show_404_upgrade}},[e("a",{staticClass:"mt-20 sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=plugin404page",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n Upgrade to PRO\n ")])]),e("div",{staticClass:"sp-pro-only"},[e("img",{staticClass:"sp-mx-auto sp-block sp-mt-8 sp-mb-5",attrs:{src:t.shared.plugin_path+"public/svg/404-page.svg",alt:t.txt_31}}),e("div",{staticClass:"sp-text-xl sp-text-center sp-font-bold sp-mb-6 sp-text-neutral"},[t._v("\n "+t._s(t.txt_14)+"\n ")]),e("p",{staticClass:"sp-px-5 sp-text-15px sp-text-center sp-my-4 sp-text-neutral"},[t._v("\n "+t._s(t.txt_15)+"\n ")]),""==t.shared.p404_id?e("div",[e("a",{staticClass:"sp-font-semibold sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_16))])]):e("div",[e("a",{staticClass:"sp-font-semibold sp-mr-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_5))]),e("a",{staticClass:"sp-font-semibold sp-ml-1 sp-mb-4 sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-3 sp-py-3 sp-rounded-md sp-leading-none sp-text-neutral-80 sp-no-underline hover:sp-bg-neutral-15",attrs:{href:"javascript:void(0);"}},[t._v(t._s(t.txt_6))])]),e("div",{staticClass:"sp-bg-neutral-5 sp-h-8 sp-flex sp-items-center sp-justify-center"},[e("toggle-button",{attrs:{width:40,sync:!0}}),t._v(" \n\n "),e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt_8))])],1)])])]),e("div",{staticClass:"sp-mt-8 sp-font-semibold"},[e("hr",{staticClass:"sp-border-b-0 sp-border-neutral-15 sp-mb-10"}),e("div",{staticClass:"sp-flex sp-items-center sp-mb-6"},[e("h3",{staticClass:"sp-text-2xl sp-text-neutral sp-m-0 sp-font-bold"},[t._v("\n "+t._s(t.txt_17)+"\n ")]),e("i",{directives:[{name:"tooltip",rawName:"v-tooltip.top-left",value:{content:t.txt_32},expression:"{\n content: txt_32\n }",modifiers:{"top-left":!0}}],staticClass:"fas fa-question-circle sp-ml-2 sp-mr-6 sp-text-xs"}),0!=t.shared.page_count?e("a",{staticClass:"sp-font-semibold sp-text-xs sp-flex sp-items-center sp-inline-block sp-bg-primary sp-px-3 sp-py-2 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path+"_template&id=0#/template"}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}})]),t._v("\n "+t._s(t.txt_18)+"\n ")]):t._e()]),0!=t.shared.page_count?e("div",[e("ul",{staticClass:"subsubsub"},t._l(t.filters,function(s,a){return e("li",{key:a},[e("a",{class:{current:t.filter==a},attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.filter_table(a)}}},[t._v(t._s(s.label))]),t._v("\n ("+t._s(s.count)+")\n "),"archived"!=a?e("span",[t._v("|")]):t._e()])}),0),e("p",{staticClass:"search-box"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"order-search-input"}},[t._v(t._s(t.txt_2))]),e("span",{staticClass:"sp-relative sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"sp-rounded sp-border-solid sp-border sp-border-neutral-15 sp-outline-none",staticStyle:{padding:"6px 10px"},attrs:{id:"order-search-input"},domProps:{value:t.search},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.loadItems("search")},input:function(s){s.target.composing||(t.search=s.target.value)}}}),t._v(" \n "),t.search.length>0?e("i",{staticClass:"fas fa-times-circle sp-absolute sp-text-neutral-20 sp-right-0 sp-mr-2",attrs:{id:"seedprod-search-close"},on:{click:function(s){return s.preventDefault(),t.clear_search(s)}}}):t._e()]),e("input",{staticClass:"button",attrs:{type:"submit",id:"search-submit"},domProps:{value:t.txt_2},on:{click:function(s){return s.preventDefault(),t.loadItems("search")}}})]),e("list-table",{ref:"lpagedt",attrs:{columns:t.columns,loading:t.loading,rows:t.rows,actions:t.actions,"show-cb":t.showcb,"total-items":t.totalitems,"bulk-actions":t.filter_bulk(t.bulkactions),"total-pages":t.totalpages,"per-page":t.perpage,"current-page":t.currentpage,"action-column":t.actioncol,"sort-by":t.orderby,"sort-order":t.order,filter:t.filter},on:{pagination:t.goToPage,rowOver:t.rowOver,rowOut:t.rowOut,"action:click":t.onActionClick,"bulk:click":t.onBulkAction,sort:t.sortCallback},scopedSlots:t._u([{key:"subscribers",fn:function(s){return[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.goto_subscribers(s.row.id)}}},[t._v(t._s(s.row.subscribers))])]}},{key:"url",fn:function(s){return["trash"!=s.row.post_status?e("a",{attrs:{href:s.row.url,target:"_blank"}},[t._v(t._s(s.row.url))]):e("span")]}},{key:"name",fn:function(s){return[e("span",{staticClass:"sp-text-sm"},[e("a",{staticClass:"sp-font-bold",attrs:{href:"?page="+t.shared.page_path+"_builder&id="+s.row.id+"#/setup/"+s.row.id+"/block-options"}},[t._v(t._s(s.row.name))]),"publish"!=s.row.post_status?e("span",{staticClass:"post-state sp-font-bold"},[t._v(" – "+t._s(s.row.status))]):t._e()]),"trash"!=s.row.post_status?e("div",{staticClass:"row-actions",class:{"sp-invisible":t.show_row!=s.row.id}},[e("span",{staticClass:"setup"},[e("a",{attrs:{href:"?page="+t.shared.page_path+"_builder&id="+s.row.id+"#/setup/"+s.row.id+"/block-options"}},[t._v(t._s(t.txt_19))]),t._v("\n |\n ")]),e("span",{staticClass:"subscribers"},[e("a",{attrs:{href:"?page="+t.shared.page_path+"#/subscribers/"+s.row.id}},[t._v(t._s(t.txt_20))]),t._v("\n |\n ")]),e("span",{staticClass:"publish2"},[e("a",{attrs:{href:t.shared.home_url+"?page_id="+s.row.id,target:"_blank"}},[t._v(t._s(t.txt_6))]),t._v("\n |\n ")]),e("span",{staticClass:"duplicate"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.duplicate(s.row)}}},[t._v(t._s(t.txt_21))]),t._v("\n |\n ")]),e("span",{staticClass:"delete"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.archive(s.row.id)}}},[t._v(t._s(t.txt_22))])])]):e("div",{staticClass:"row-actions",class:{"sp-invisible":t.show_row!=s.row.id}},[e("span",{},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.unarchive(s.row.id)}}},[t._v(t._s(t.txt_27))]),t._v("\n |\n ")]),e("span",{staticClass:"delete"},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.trash(s.row.id)}}},[t._v(t._s(t.txt_28))])])])]}},{key:"date",fn:function(s){return["publish"==s.row.post_status?e("div",{staticClass:"sp-font-semibold date column-date sp-w-full"},[t._v("\n "+t._s(t.txt_23)+"\n "),e("br"),e("span",{attrs:{title:s.row.posted_at}},[t._v(t._s(s.row.posted_at))])]):t._e(),"draft"==s.row.post_status||"trash"==s.row.post_status?e("div",{staticClass:"sp-font-semibold column-date sp-w-full"},[t._v("\n "+t._s(t.txt_24)+"\n "),e("br"),e("span",{attrs:{title:s.row.modified_at}},[t._v(t._s(s.row.modified_at))])]):t._e()]}}],null,!1,3456503522)})],1):e("div",{staticClass:"sp-bg-neutral-10 sp-flex sp-justify-center sp-flex-col sp-items-center sp-h-64"},[e("div",{staticClass:"sp-font-bold sp-text-xl sp-mb-4"},[t._v(t._s(t.txt_25))]),e("a",{staticClass:"sp-font-semibold sp-text-sm sp-inline-flex sp-items-center sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path+"_template&id=0#/template"}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}})]),t._v("\n "+t._s(t.txt_26)+"\n ")])])])])])])])},v=[],x=e("bd86"),f=e("e814"),w=e.n(f),C=(e("6b54"),e("386d"),e("f499")),y=e.n(C),k=e("323e"),j=e.n(k),O=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{class:{"table-loading":t.loading}},[t.loading?e("div",{staticClass:"table-loader-wrap"},[e("div",{staticClass:"table-loader-center"},[e("div",{staticClass:"table-loader"}),e("div",{staticClass:"table-loader-txt"},[t._v(t._s(t.txt_1)+"...")])])]):t._e(),e("div",{staticClass:"tablenav top"},[t.hasBulkActions?e("div",{staticClass:"alignleft actions bulkactions"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"bulk-action-selector-top"}},[t._v(t._s(t.txt_2))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.bulkLocal,expression:"bulkLocal"}],attrs:{name:"action",id:"bulk-action-selector-top"},on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.bulkLocal=s.target.multiple?e:e[0]}}},[e("option",{attrs:{value:"-1"}},[t._v(t._s(t.txt_3))]),t._l(t.bulkActions,function(s){return e("option",{domProps:{value:s.key}},[t._v(t._s(s.label))])})],2),e("button",{staticClass:"button action",staticStyle:{"margin-bottom":"1px"},attrs:{disabled:!t.checkedItems.length&&-1===this.bulkLocal.indexOf("all")},on:{click:function(s){return s.preventDefault(),t.handleBulkAction(s)}}},[t._v("\n\t\t\t\t"+t._s(t.txt_4)+"\n\t\t\t")])]):t._e(),e("div",{staticClass:"alignleft actions"},[t._t("filters")],2),e("div",{staticClass:"tablenav-pages"},[e("span",{staticClass:"displaying-num"},[t._v(t._s(t.itemsTotal)+" "+t._s(t.txt_5))]),t.hasPagination?e("span",{staticClass:"pagination-links"},[t.disableFirst?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("«")]):e("a",{staticClass:"first-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("«")])]),t.disablePrev?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("‹")]):e("a",{staticClass:"prev-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage-1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("‹")])]),e("span",{staticClass:"paging-input"},[e("span",{staticClass:"tablenav-paging-text"},[e("input",{staticClass:"current-page",attrs:{type:"text",name:"paged","aria-describedby":"table-paging",size:"1"},domProps:{value:t.currentPage},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.goToCustomPage(s)}}}),t._v("\n\t\t\t\t\t\tof\n\t\t\t\t\t\t"),e("span",{staticClass:"total-pages"},[t._v(t._s(t.totalPages))])])]),t.disableNext?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("›")]):e("a",{staticClass:"next-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage+1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("›")])]),t.disableLast?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("»")]):e("a",{staticClass:"last-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.totalPages)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()])]),e("table",{class:t.tableClass},[e("thead",[e("tr",[t.showCb?e("td",{staticClass:"manage-column column-cb check-column"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.selectAll,expression:"selectAll"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.selectAll)?t._i(t.selectAll,null)>-1:t.selectAll},on:{change:function(s){var e=t.selectAll,a=s.target,n=!!a.checked;if(Array.isArray(e)){var o=null,i=t._i(e,o);a.checked?i<0&&(t.selectAll=e.concat([o])):i>-1&&(t.selectAll=e.slice(0,i).concat(e.slice(i+1)))}else t.selectAll=n}}})]):t._e(),t._l(t.columns,function(s,a){return e("th",{key:a,class:["column",a,{sortable:t.isSortable(s)},{sorted:t.isSorted(a)},{asc:t.isSorted(a)&&"asc"===t.sortOrder},{desc:t.isSorted(a)&&"desc"===t.sortOrder}]},[t.isSortable(s)?e("a",{attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.handleSortBy(a)}}},[e("span",[t._v(t._s(s.label))]),e("span",{staticClass:"sorting-indicator"})]):[t._v("\n\t\t\t\t\t\t"+t._s(s.label)+"\n\t\t\t\t\t")]],2)})],2)]),e("tfoot",[e("tr",[t.showCb?e("td",{staticClass:"manage-column column-cb check-column"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.selectAll,expression:"selectAll"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.selectAll)?t._i(t.selectAll,null)>-1:t.selectAll},on:{change:function(s){var e=t.selectAll,a=s.target,n=!!a.checked;if(Array.isArray(e)){var o=null,i=t._i(e,o);a.checked?i<0&&(t.selectAll=e.concat([o])):i>-1&&(t.selectAll=e.slice(0,i).concat(e.slice(i+1)))}else t.selectAll=n}}})]):t._e(),t._l(t.columns,function(s,a){return e("th",{key:a,class:["column",a]},[t._v("\n\t\t\t\t\t"+t._s(s.label)+"\n\t\t\t\t")])})],2)]),e("tbody",[t.rows.length?t._l(t.rows,function(s){return e("tr",{key:s[t.index],class:s["class"],on:{mouseover:function(e){return t.rowOver(s)},mouseleave:function(e){return t.rowOut(s)}}},[t.showCb?e("th",{staticClass:"check-column",attrs:{scope:"row"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.checkedItems,expression:"checkedItems"}],attrs:{type:"checkbox",name:"item[]"},domProps:{value:s[t.index],checked:Array.isArray(t.checkedItems)?t._i(t.checkedItems,s[t.index])>-1:t.checkedItems},on:{change:function(e){var a=t.checkedItems,n=e.target,o=!!n.checked;if(Array.isArray(a)){var i=s[t.index],r=t._i(a,i);n.checked?r<0&&(t.checkedItems=a.concat([i])):r>-1&&(t.checkedItems=a.slice(0,r).concat(a.slice(r+1)))}else t.checkedItems=o}}})]):t._e(),t._l(t.columns,function(a,n){return e("td",{key:n,class:["column",n]},[t._t(n,[t._v(t._s(s[n]))],{row:s}),t.actionColumn===n&&t.hasActions?e("div",{staticClass:"row-actions"},[t._t("row-actions",t._l(t.actions,function(a,n){return"archived"!=t.filter?e("span",{key:n,class:a.key},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.actionClicked(a.key,s)}}},[t._v(t._s(a.label))]),t.hideActionSeparator(a.key)?t._e():[t._v("\n\t\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t\t")]],2):t._e()}),{row:s})],2):t._e()],2)})],2)}):e("tr",[e("td",{attrs:{colspan:t.colspan}},[t._v(t._s(t.txt_6))])])],2)]),e("div",{staticClass:"tablenav bottom"},[t.hasBulkActions?e("div",{staticClass:"alignleft actions bulkactions"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"bulk-action-selector-bottom"}},[t._v(t._s(t.txt_7))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.bulkLocal,expression:"bulkLocal"}],attrs:{name:"action",id:"bulk-action-selector-bottom"},on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.bulkLocal=s.target.multiple?e:e[0]}}},[e("option",{attrs:{value:"-1"}},[t._v(t._s(t.txt_3))]),t._l(t.bulkActions,function(s,a){return e("option",{key:a,domProps:{value:s.key}},[t._v(t._s(s.label))])})],2),e("button",{staticClass:"button action",staticStyle:{"margin-bottom":"1px"},attrs:{disabled:!t.checkedItems.length},on:{click:function(s){return s.preventDefault(),t.handleBulkAction(s)}}},[t._v("\n\t\t\t\t"+t._s(t.txt_4)+"\n\t\t\t")])]):t._e(),e("div",{staticClass:"tablenav-pages"},[e("span",{staticClass:"displaying-num"},[t._v(t._s(t.itemsTotal)+" "+t._s(t.txt_5))]),t.hasPagination?e("span",{staticClass:"pagination-links"},[t.disableFirst?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("«")]):e("a",{staticClass:"first-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("«")])]),t.disablePrev?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("‹")]):e("a",{staticClass:"prev-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage-1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("‹")])]),e("span",{staticClass:"paging-input"},[e("span",{staticClass:"tablenav-paging-text"},[e("input",{staticClass:"current-page",attrs:{type:"text",name:"paged","aria-describedby":"table-paging",size:"1"},domProps:{value:t.currentPage},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.goToCustomPage(s)}}}),t._v("\n\t\t\t\t\t\tof\n\t\t\t\t\t\t"),e("span",{staticClass:"total-pages"},[t._v(t._s(t.totalPages))])])]),t.disableNext?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("›")]):e("a",{staticClass:"next-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.currentPage+1)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("›")])]),t.disableLast?e("span",{staticClass:"tablenav-pages-navspan button disabled",attrs:{"aria-hidden":"true"}},[t._v("»")]):e("a",{staticClass:"last-page",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.goToPage(t.totalPages)}}},[e("span",{staticClass:"tablenav-pages-navspan button",attrs:{"aria-hidden":"true"}},[t._v("»")])])]):t._e()])])])},P=[],L=(e("ac6a"),e("a4bb")),S=e.n(L),M=(e("c5f6"),{name:"ListTable",props:{filter:{type:String,default:""},columns:{type:Object,required:!0,default:function(){return{}}},rows:{type:Array,required:!0,default:function(){return[]}},index:{type:String,default:"id"},showCb:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},actionColumn:{type:String,default:""},actions:{type:Array,required:!1,default:function(){return[]}},bulkActions:{type:Array,required:!1,default:function(){return[]}},tableClass:{type:String,default:"wp-list-table widefat fixed striped"},notFound:{type:String,default:"No items found."},totalItems:{type:Number,default:0},totalPages:{type:Number,default:1},perPage:{type:Number,default:20},currentPage:{type:Number,default:1},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc"}},data:function(){return{txt_1:Object(l["a"])("Loading","coming-soon"),txt_2:Object(l["a"])("Select bulk action","coming-soon"),txt_3:Object(l["a"])("Bulk Actions","coming-soon"),txt_4:Object(l["a"])("Apply","coming-soon"),txt_5:Object(l["a"])("items","coming-soon"),txt_6:Object(l["a"])("No items found.","coming-soon"),txt_7:Object(l["a"])("Select bulk action","coming-soon"),txt_8:Object(l["a"])("Select bulk action","coming-soon"),bulkLocal:"-1",checkedItems:[],shared:seedprod_store_admin}},computed:{hasActions:function(){return 0<this.actions.length},hasBulkActions:function(){return this.bulkLocal="-1",0<this.bulkActions.length},itemsTotal:function(){return this.totalItems||this.rows.length},hasPagination:function(){return this.itemsTotal>this.perPage},disableFirst:function(){return 1===this.currentPage||2===this.currentPage},disablePrev:function(){return 1===this.currentPage},disableNext:function(){return this.currentPage===this.totalPages},disableLast:function(){return this.currentPage===this.totalPages||this.currentPage==this.totalPages-1},colspan:function(){var t=S()(this.columns).length;return this.showCb&&(t+=1),t},selectAll:{get:function(){return!!this.rows.length&&(!!this.rows&&this.checkedItems.length==this.rows.length)},set:function(t){var s=[],e=this;t&&this.rows.forEach(function(t){void 0!==t[e.index]?s.push(t[e.index]):s.push(t.id)}),this.checkedItems=s}}},methods:{hideActionSeparator:function(t){return t===this.actions[this.actions.length-1].key},rowOver:function(t){this.$emit("rowOver",t)},rowOut:function(t){this.$emit("rowOut",t)},actionClicked:function(t,s){this.$emit("action:click",t,s)},goToPage:function(t){this.$emit("pagination",t)},goToCustomPage:function(t){var s=w()(t.target.value);!isNaN(s)&&0<s&&s<=this.totalPages&&this.$emit("pagination",s)},handleBulkAction:function(){"-1"!==this.bulkLocal&&this.$emit("bulk:click",this.bulkLocal,this.checkedItems)},clear_checked:function(){this.checkedItems=[]},isSortable:function(t){return!(!t.hasOwnProperty("sortable")||!0!==t.sortable)},isSorted:function(t){return t===this.sortBy},handleSortBy:function(t){var s="asc"===this.sortOrder?"desc":"asc";this.$emit("sort",t,s)}}}),T=M,z=Object(u["a"])(T,O,P,!1,null,null,null),B=z.exports,A={name:"Dashboard",components:{ListTable:B},data:function(){return{txt_1:Object(l["a"])("Coming Soon Mode","coming-soon"),txt_2:Object(l["a"])("Search Landing Pages","coming-soon"),txt_3:Object(l["a"])("The Coming Soon Page will be available to search engines if your site is not private.","coming-soon"),txt_4:Object(l["a"])("Set up a Coming Soon Page","coming-soon"),txt_5:Object(l["a"])("Edit Page","coming-soon"),txt_6:Object(l["a"])("Preview","coming-soon"),txt_7:Object(l["a"])("Active","coming-soon"),txt_8:Object(l["a"])("Inactive","coming-soon"),txt_9:Object(l["a"])("Maintenance Mode","coming-soon"),txt_10:Object(l["a"])("The Maintenance Mode Page will notify search engines that the site is unavailable.","coming-soon"),txt_11:Object(l["a"])("Set up a Maintenance Mode Page","coming-soon"),txt_14:Object(l["a"])("404 Page","coming-soon"),txt_15:Object(l["a"])("Replace your default theme 404 page with a custom high converting 404 page.","coming-soon"),txt_16:Object(l["a"])("Set up a 404 Page","coming-soon"),txt_17:Object(l["a"])("Landing Pages","coming-soon"),txt_18:Object(l["a"])("Add New Landing Page","coming-soon"),txt_19:Object(l["a"])("Edit","coming-soon"),txt_20:Object(l["a"])("Subscribers","coming-soon"),txt_21:Object(l["a"])("Duplicate","coming-soon"),txt_22:Object(l["a"])("Trash","coming-soon"),txt_23:Object(l["a"])("Published","coming-soon"),txt_24:Object(l["a"])("Last Modified","coming-soon"),txt_25:Object(l["a"])("You do not have any landing pages yet.","coming-soon"),txt_26:Object(l["a"])("Create New Landing Page","coming-soon"),txt_27:Object(l["a"])("Restore","coming-soon"),txt_28:Object(l["a"])("Delete Permanently","coming-soon"),txt_29:Object(l["a"])("SeedProd Coming Soon Page","coming-soon"),txt_30:Object(l["a"])("SeedProd Maintenance Page","coming-soon"),txt_31:Object(l["a"])("SeedProd 404 Page","coming-soon"),txt_32:Object(l["a"])("Create Optin, Sales, Webinar, Thank You or any type of Landing Page you need.","coming-soon"),txt_33:Object(l["a"])("Login Page","coming-soon"),txt_34:Object(l["a"])("Create a Custom Login Page for your website. Optionally replace the default login page.","coming-soon"),txt_35:Object(l["a"])("Set up a Login Page","coming-soon"),txt_36:Object(l["a"])("SeedProd Login Page","coming-soon"),shared:seedprod_store_admin,show_404_upgrade:!1,show_loginp_upgrade:!1,show_row:!1,show_action:!1,loading:!0,search:"",showcb:!0,totalitems:0,totalpages:0,perpage:10,actioncol:"name",currentpage:1,orderby:"",order:"",filter:"all",filters:{all:{label:Object(l["a"])("All","coming-soon"),count:0},published:{label:Object(l["a"])("Published","coming-soon"),count:0},drafts:{label:Object(l["a"])("Drafts","coming-soon"),count:0},archived:{label:Object(l["a"])("Trash","coming-soon"),count:0}},bulkactions:[{key:"archive_selected_lpages",label:Object(l["a"])("Move To Trash","coming-soon")},{key:"unarchive_selected_lpages",label:Object(l["a"])("Restore","coming-soon")},{key:"delete_all_archived_lpages",label:Object(l["a"])("Delete Permanently","coming-soon")}],columns:{name:{label:Object(l["a"])("Name","coming-soon"),sortable:!0},url:{label:Object(l["a"])("URL","coming-soon"),sortable:!1},date:{label:Object(l["a"])("Date","coming-soon"),sortable:!0}},actions:[],rows:[{name:Object(l["a"])("Loading","coming-soon")+" ...",status:"",type:"",subscribers:"",entries:"",active:""}]}},methods:(a={show_actions:function(t){this.show_action=t},create_edit_page:function(t){var s=!1;"cs"==t&&(s=this.shared.csp_id),"mm"==t&&(s=this.shared.mmp_id),"p404"==t&&(s=this.shared.p404_id),"loginp"==t&&(s=this.shared.loginp_id),s?location.href="?page="+this.shared.page_path+"_builder&id="+s+"#/setup/"+s+"/block-options":("cs"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=cs#/template"),"mm"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=mm#/template"),"p404"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=p404#/template"),"loginp"==t&&(location.href="?page="+this.shared.page_path+"_template&id=0&type=loginp#/template"))},enable_mode:function(t){var s=t;j.a.start(),1==t&&!0===this.shared.settings.enable_maintenance_mode&&(this.shared.settings.enable_maintenance_mode=!1),2==t&&!0===this.shared.settings.enable_coming_soon_mode&&(this.shared.settings.enable_coming_soon_mode=!1);var e=p.a.stringify({settings:y()(this.shared.settings)}),a="admin-ajax.php?action="+this.shared.page_path+"_save_settings&_wpnonce="+seedprod_nonce;this.axios.post(a,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){j.a.done(),1!=s&&2!=s||location.reload()})},filter_bulk:function(t){var s=[];return s="archived"==this.filter?t.slice(1):t.slice(0,1),s},hideActionSeparator:function(t){return t===this.actions[this.actions.length-1].key},rowOver:function(t){this.show_row=t.id},rowOut:function(t){this.show_row=!1},enable_disable:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_enable_disable_lpage_ajax_url+"&id="+t.id+"¤t_state="+t.active).then(function(e){s.loading=!1,"enabled"==e.data.status&&(t.active=!0,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Page Enabled",toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3})),"disabled"==e.data.status&&(t.active=!1,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Page Disabled",toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}))})},status_action:function(t,s){"needs_setup"==s&&(location.href="?page="+this.shared.page_path+"_builder&id="+t+"#/setup/"+t)},goto_dashboard:function(){this.$router.push({name:"dashboard"})},clear_search:function(){this.search,this.loadItems()},archive:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_archive_selected_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){s.loading=!1,s.$refs.lpagedt.clear_checked(),t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Moved to Trash.","coming-soon"),toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.loadItems())})},unarchive:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_unarchive_selected_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){s.loading=!1,s.$refs.lpagedt.clear_checked(),t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Restored.","coming-soon"),customClass:"sp-toast-success",toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),s.loadItems())})},trash:function(t){var s=this,e=this;this.$swal({title:Object(l["a"])("Are you sure?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Object(l["a"])("Yes, empty trash!","coming-soon")}).then(function(a){a.value&&(e.loading=!0,s.axios.get(seedprod_delete_archived_lpages+"&ids="+encodeURIComponent(t.toString())).then(function(t){e.loading=!1,e.$refs.lpagedt.clear_checked(),t.data.status&&(e.$swal({imageUrl:e.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Pages Deleted!","coming-soon"),toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),e.loadItems())}))})},duplicate:function(t){var s=this;s.loading=!0,this.axios.get(seedprod_duplicate_lpage_url+"&id="+t.id).then(function(t){s.loading=!1,t.data.status&&(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Page Duplicated","coming-soon"),toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),s.orderby="",s.loadItems())})},loadItems:function(t){"search"==t?(this.currentpage=1,this.orderby="",this.order="",this.filter=""):this.search="";var s=this;s.loading=!0,j.a.start(),this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_lpage_datatable&_wpnonce="+seedprod_nonce+"¤t_page="+this.currentpage+"&orderby="+this.orderby+"&order="+this.order+"&filter="+this.filter+"&s="+this.search).then(function(t){s.loading=!1,j.a.done(),s.rows=t.data.rows,s.totalitems=w()(t.data.totalitems),s.totalpages=w()(t.data.totalpages),s.currentpage=w()(t.data.currentpage),null!=t.data.views&&(s.filters.all.count=w()(t.data.views.all),s.filters.archived.count=w()(t.data.views.archived),s.filters.published.count=w()(t.data.views.published),s.filters.drafts.count=w()(t.data.views.drafts))})},filter_table:function(t){this.filter=t,0==this.filters[t].count?this.rows=[]:this.loadItems()}},Object(x["a"])(a,"show_actions",function(t){this.show_action=t}),Object(x["a"])(a,"goto_subscribers",function(t){this.$router.push({name:"subscribers",params:{id:t}})}),Object(x["a"])(a,"goToPage",function(t){this.currentpage=t,this.loadItems()}),Object(x["a"])(a,"actionClicked",function(t,s){this.onActionClick(t,s)}),Object(x["a"])(a,"onActionClick",function(t,s){"duplicate"==t&&this.duplicate(s),"delete"==t&&this.archive(s.id),"setup"==t&&(location.href="?page="+this.shared.page_path+"_builder&id="+s.id+"#/setup/"+s.id+"/block-options"),"publish2"==t&&window.open(this.shared.home_url+"?p="+s.id+"&preview=true","_blank"),"subscribers"==t&&this.$router.push({name:"subscribers",params:{id:s.id}})}),Object(x["a"])(a,"onBulkAction",function(t,s){"archive_selected_lpages"==t&&this.archive(s),"unarchive_selected_lpages"==t&&this.unarchive(s),"delete_all_archived_lpages"==t&&this.trash(s)}),Object(x["a"])(a,"sortCallback",function(t,s){this.orderby=t,this.order=s,this.loadItems()}),Object(x["a"])(a,"setWithExpiry",function(t,s,e){var a=new Date,n={value:s,expiry:a.getTime()+e};localStorage.setItem(t,y()(n))}),Object(x["a"])(a,"getWithExpiry",function(t){var s=localStorage.getItem(t);if(!s)return null;var e=JSON.parse(s),a=new Date;return a.getTime()>e.expiry?(localStorage.removeItem(t),null):e.value}),a),created:function(){this.loadItems()}},$=A,D=Object(u["a"])($,b,v,!1,null,null,null),U=D.exports,H=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-grid sp-grid-cols-1 lg:sp-grid-cols-2 xl:sp-grid-cols-3 sp-gap-6 sp-mt-10 "},t._l(t.plugins,function(s,a){return e("div",{key:a,staticClass:"sp-w-full sp-bg-white sp-border-neutral-15 sp-border sp-border-solid sp-py-10 sp-px-8 sp-flex sp-justify-between sp-flex-col"},[e("div",{staticClass:"seedprod-plugin-recommendations-block sp-flex sp-flex-col"},[e("div",{staticClass:"sp-flex sp-items-center sp-flex-col"},[e("div",[e("img",{staticClass:"sp-w-16",attrs:{src:s.icon}})]),e("div",{staticClass:"sp-text-center sp-text-neutral-80"},[e("h3",{staticClass:"sp-text-neutral-80 sp-text-xl"},[t._v(t._s(s.name))]),e("p",{staticClass:"sp-text-sm",domProps:{innerHTML:t._s(s.desc)}})])])]),e("div",[t.shared.doing_ajax==a||"all"==t.shared.doing_ajax?e("div",[t._m(0,!0)]):e("div",{staticClass:"sp-flex sp-flex-col sp-items-center"},[!0===s.is_pro?e("div",[t._v("\n "+t._s(t.plugins["wpforms-pro"])+"\n "),e("strong",[t._v(t._s(t.txt_1)+":")]),t._v(" "+t._s(t.txt_2)+"\n ")]):e("div",{staticClass:"sp-flex sp-flex-col sp-items-center"},[e("div",[e("strong",[t._v(t._s(t.txt_1)+":")]),t._v("\n "+t._s(s.status)+"\n ")]),e("button",{staticClass:"sp-mt-1 sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-base hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold",on:{click:function(s){return t.plugin_action(a)}}},[t._v(t._s(t.plugin_btn_txt(s)))])])])])])}),0)])},I=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticStyle:{"text-align":"center",flex:"1"}},[e("i",{staticClass:"fas fa-spinner fa-spin"})])}],E={name:"GrowthTools",components:{},data:function(){return{txt_1:Object(l["a"])("Status","coming-soon"),txt_2:Object(l["a"])("PRO Version installed","coming-soon"),all_plugins:{},plugins:{rafflepress:{slug_base:"rafflepress",slug:"rafflepress/rafflepress.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-rp.png",name:"RafflePress",desc:"Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.",url:"https://downloads.wordpress.org/plugin/rafflepress.zip",status:"",status_code:"",is_pro:!1},wpforms:{slug_base:"wpforms-lite",slug:"wpforms-lite/wpforms.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-wpforms.png",name:"WPForms",desc:"The most beginner friendly drag & drop WordPress forms plugin allowing you to create beautifdivcontact forms, subscription forms, payment forms, and more in minutes, not hours!",url:"https://downloads.wordpress.org/plugin/wpforms-lite.zip",status:"",status_code:"",is_pro:!1},optinmonster:{slug_base:"optinmonster",slug:"optinmonster/optin-monster-wp-api.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-om.png",name:"OptinMonster",desc:"Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.",url:"https://downloads.wordpress.org/plugin/optinmonster.zip",status:"",status_code:"",is_pro:!1},wpmailsmtp:{slug_base:"wp-mail-smtp",slug:"wp-mail-smtp/wp_mail_smtp.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-smtp.png",name:"WP Mail SMTP",desc:"SMTP (Simple Mail Transfer Protocol) is an industry standard for sending emails. SMTP helps increase email deliverability by using proper authentication.",url:"https://downloads.wordpress.org/plugin/wp-mail-smtp.zip",status:"",status_code:"",is_pro:!1},monsterinsights:{slug_base:"google-analytics-for-wordpress",slug:"google-analytics-for-wordpress/googleanalytics.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-mi.png",name:"MonsterInsights",desc:"MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.",url:"https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.zip",status:"",status_code:"",is_pro:!1},trustpulse:{slug_base:"trustpulse-api",slug:"trustpulse-api/trustpulse.php",icon:seedprod_store_admin.plugin_path+"public/img/plugin-trustpulse.png",name:"TrustPulse",desc:"TrustPulse uses FOMO (Fear of Missing Out) to boost your sales and conversions with social proof notifications. Use it to boost sales on your Woocommerce store, increase signups on your membership site, get more email subscribers, and more.",url:"https://downloads.wordpress.org/plugin/coming-soon.zip",status:"",status_code:"",is_pro:!1}},shared:seedprod_store_admin}},methods:{plugin_action:function(t){var s=this;this.doing_ajax=!0;var e="",a="",n=t;if(s.shared.doing_ajax=t,0===this.plugins[t].status_code){e=seedprod_get_install_addon_url;var o=p.a.stringify({plugin:this.plugins[t].url,type:"plugin"});a="install"}if(1===this.plugins[t].status_code){e=seedprod_deactivate_addon_url;o=p.a.stringify({plugin:this.plugins[t].slug,type:"plugin"});a="deactivate"}if(2===this.plugins[t].status_code){e=seedprod_activate_addon_url;o=p.a.stringify({plugin:this.plugins[t].slug,type:"plugin"});a="activate"}this.axios.post(e,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(e){if(s.shared.doing_ajax=!1,"install"==a)if(e.data.error){s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.error,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3});var o=p.a.stringify({plugin:s.plugins[n].slug_base});s.axios.post(seedprod_plugin_nonce_url,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data&&window.open("update.php?action=install-plugin&plugin="+s.plugins[n].slug_base+"&_wpnonce="+t.data,"_blank")})}else s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Plugin Installed, click Activate",toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Inactive",s.plugins[t].status_code=2,s.$forceUpdate();"activate"==a&&(e.data.success?(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:e.data.data,toast:!0,type:null,position:"top-end",customClass:"sp-toast-success",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Active",s.plugins[t].status_code=1,s.$forceUpdate()):s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.data,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})),"deactivate"==a&&(e.data.success?(s.$swal({imageUrl:s.shared.plugin_path+"public/svg/success-24px-white.svg",text:e.data.data,toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:3e3}),s.plugins[t].status="Inactive",s.plugins[t].status_code=2,s.$forceUpdate()):s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:e.data.data,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3}))}).catch(function(t){s.shared.doing_ajax=!1,s.$swal({imageUrl:s.shared.plugin_path+"public/svg/error-24px-white.svg",text:t,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})},plugin_btn_txt:function(t){var s="";return"Not Installed"==t.status&&(s=Object(l["a"])("Install","coming-soon")),"Active"==t.status&&(s=Object(l["a"])("Deactivate","coming-soon")),"Inactive"==t.status&&(s=Object(l["a"])("Activate","coming-soon")),s}},mounted:function(){var t=this;t.shared.doing_ajax="all",this.axios.get(seedprod_get_plugins_list_url).then(function(s){if(t.shared.doing_ajax=!1,s.data)for(var e in s.data)void 0!==t.plugins[e]&&("wpforms"==e&&0!==s.data["wpforms-pro"].status&&(t.plugins[e].is_pro=!0),"rafflepress"==e&&0!==s.data["rafflepress-pro"].status&&(t.plugins[e].is_pro=!0),"monsterinsights"==e&&0!==s.data["monsterinsights-pro"].status&&(t.plugins[e].is_pro=!0),"wpmailsmtp"==e&&0!==s.data["wpmailsmtp-pro"].status&&(t.plugins[e].is_pro=!0),t.plugins[e].status=s.data[e].label,t.plugins[e].status_code=s.data[e].status)}).catch(function(s){t.shared.doing_ajax=!1,t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})})},created:function(){var t=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(2)'),s=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(6)');t.classList.remove("current"),s.classList.add("current")}},N=E,F=Object(u["a"])(N,H,I,!1,null,null,null),W=F.exports,R=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-absolute sp-z-10 sp-w-full sp-flex sp-justify-center"},[e("LiteCTASubscribers")],1),e("div",{staticStyle:{filter:"blur(3px)"},attrs:{id:"seedprod-users"}},[e("div",{staticClass:"md:sp-flex sp-mt-10"},[e("div",{staticClass:"sp-w-full md:sp-w-1/2 sp-flex sp-items-center"},[e("h1",{staticClass:"sp-text-neutral sp-font-bold sp-text-2xl sp-m-0"},[t._v(t._s(t.txt_1))])]),0!=t.shared.subscriber_count?e("div",{staticClass:"sp-w-full md:sp-w-1/2 sp-flex sp-items-center sp-justify-end"},[e("a",{staticClass:"sp-inline-block sp-bg-neutral-15 hover:sp-bg-neutral-20 sp-h-40px sp-px-4 sp-rounded sp-leading-none sp-text-neutral-80 sp-no-underline sp-text-sm sp-cursor-pointer sp-font-semibold sp-flex sp-items-center sp-mr-2",attrs:{href:"#",target:"_blank"},on:{click:function(s){return s.preventDefault(),t.export_subscribers(s)}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4 sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n "+t._s(t.txt_2)+"\n ")]),e("div",{staticClass:"sp-relative"},[e("div",{staticClass:"sp-bg-white sp-border sp-border-neutral-20 sp-border-solid sp-rounded-sm sp-h-40px sp-w-275 sp-cursor-pointer"},[e("span",{staticClass:"sp-flex sp-items-center sp-h-40px sp-justify-between sp-text-neutral-80 sp-px-3 sp-text-base sp-truncate",on:{click:function(s){return s.preventDefault(),t.toggle_lpage_list(s)}}},[t._v("\n "+t._s(t.lpage_name)+"\n "),e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7 10l5 5 5-5z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])])]),t.show_lpage_list?e("div",{staticClass:"sp-absolute sp-bg-white sp-border sp-border-neutral-20 sp-border-solid sp-rounded-sm sp-z-20 sp-w-275 sp-h-275 sp-overflow-y-auto sp-shadow-lg sp-px-1 sp-py-1"},[e("ul",{staticClass:"sp-m-0"},[0==t.lpage_list.length&&0!=t.shared.page_count?e("li",{staticClass:"sp-m-0 sp-py-1"},[e("span",{staticClass:"sp-px-2 sp-text-neutral-80 sp-text-sm sp-font-bold"},[t._v("\n "+t._s(t.txt_3)+"\n "),e("i",{staticClass:"fas fa-spinner fa-spin"})])]):t._e(),e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(0,0,"All Pages")}}},[t._v(t._s(t.txt_4))])]),""!=t.shared.csp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.csp_id,t.shared.csp_uuid,"Coming Soon Page")}}},[t._v(t._s(t.txt_5))])]):t._e(),""!=t.shared.mmp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.mmp_id,t.shared.mmp_uuid,"Maintenance Mode Page")}}},[t._v(t._s(t.txt_6))])]):t._e(),""!=t.shared.loginp_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.loginp_id,t.shared.loginp_uuid,"Login Page")}}},[t._v(t._s(t.txt_13))])]):t._e(),""!=t.shared.p404_id?e("li",[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-0 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.load_lpage_users(t.shared.p404_id,t.shared.p404_uuid,"404 Page")}}},[t._v(t._s(t.txt_7))])]):t._e(),0!=t.lpage_list.length?e("hr",{staticClass:"sp-border sp-border-neutral-20 sp-border-b-0"}):t._e(),0!=t.lpage_list.length?e("li",{staticClass:"sp-m-0 sp-py-1"},[e("span",{staticClass:"sp-px-2 sp-text-neutral-40 sp-font-bold sp-uppercase sp-tracking-wide sp-text-12px"},[t._v(t._s(t.txt_8))])]):t._e(),t._l(t.lpage_list,function(s,a){return e("li",{key:a,staticClass:"sp-m-0"},[e("a",{staticClass:"sp-rounded-sm sp-block sp-py-1 sp-text-neutral-80 sp-text-sm sp-no-underline sp-font-semibold sp-cursor-pointer hover:sp-bg-neutral-10 sp-px-2",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.load_lpage_users(s.id,s.uuid,s.name)}}},[t._v(t._s(s.name))])])})],2)]):t._e()]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.chart_timeframe,expression:"chart_timeframe"}],staticClass:"sp-form-select sp-h-40px sp-border sp-border-neutral-20 sp-border-solid sp-ml-2",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.chart_timeframe=s.target.multiple?e:e[0]},t.loadItems]}},[e("option",{attrs:{value:"7"}},[t._v("7 "+t._s(t.txt_9))]),e("option",{attrs:{value:"30"}},[t._v("30 "+t._s(t.txt_9))])])]):t._e()]),0!=t.shared.subscriber_count?e("div",[e("div",{staticClass:"sp-border sp-border-neutral-20 sp-border-solid sp-mt-5 sp-mb-3"},[e("GChart",{attrs:{type:"AreaChart",data:t.chartData,options:t.chartOptions}})],1),e("div",{attrs:{id:"poststuff"}},[e("div",{staticClass:"metabox-holder columns-1",attrs:{id:"post-body"}},[e("div",{staticClass:"clearfix",attrs:{id:"post-body-content"}},[e("ul",{staticClass:"subsubsub"},t._l(t.filters,function(s,a){return e("li",{key:a},[e("a",{class:{current:t.filter==a},attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.filter_table(a)}}},[t._v(t._s(s.label))]),t._v("\n ("+t._s(s.count)+")\n "),"invalid"!=a?e("span",[t._v("|")]):t._e()])}),0),e("p",{staticClass:"search-box sp-hidden"},[e("label",{staticClass:"screen-reader-text",attrs:{for:"order-search-input"}},[t._v(t._s(t.txt_12))]),e("span",{staticClass:"sp-relative sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"sp-rounded sp-border-solid sp-border sp-border-neutral-15 sp-outline-none",staticStyle:{padding:"6px 10px"},attrs:{id:"order-search-input"},domProps:{value:t.search},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.loadItems("search")},input:function(s){s.target.composing||(t.search=s.target.value)}}}),t._v(" \n "),t.search.length>0?e("i",{staticClass:"fas fa-times-circle sp-absolute sp-text-neutral-20 sp-right-0 sp-mr-2",attrs:{id:"seedprod-search-close"},on:{click:function(s){return s.preventDefault(),t.clear_search(s)}}}):t._e()]),e("input",{staticClass:"button",attrs:{type:"submit",id:"search-submit"},domProps:{value:t.txt_12},on:{click:function(s){return s.preventDefault(),t.loadItems("search")}}})]),e("list-table",{ref:"subscribersdt",attrs:{columns:t.columns,loading:t.loading,rows:t.rows,actions:t.actions,"show-cb":t.showcb,"total-items":t.totalitems,"bulk-actions":t.bulkactions,"total-pages":t.totalpages,"per-page":t.perpage,"current-page":t.currentpage,"action-column":t.actioncol,"sort-by":t.orderby,"sort-order":t.order},on:{pagination:t.goToPage,"action:click":t.onActionClick,"bulk:click":t.onBulkAction,sort:t.sortCallback}})],1)]),e("br",{staticClass:"clear"})])]):e("div",{staticClass:"sp-mt-6 sp-bg-neutral-10 sp-flex sp-justify-center sp-flex-col sp-items-center sp-h-64"},[e("div",{staticClass:"sp-font-bold sp-text-xl sp-mb-4"},[t._v(t._s(t.txt_10))]),e("a",{staticClass:"sp-font-semibold sp-text-sm sp-inline-flex sp-items-center sp-inline-block sp-bg-primary sp-px-5 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline hover:sp-bg-primary-lighter",attrs:{href:"admin.php?page="+t.shared.page_path}},[t._v(t._s(t.txt_11))])])])])},V=[],G=e("a745"),Y=e.n(G),q=e("b132"),K=e("cb43"),J=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-px-10 sp-py-10 sp-text-center",staticStyle:{width:"650px"}},[e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v("Special Upgrade Offer - Save 50% Off")]),e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral"},[t._v("\n\n Start Collecting Emails with SeedProd Pro\n ")]),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))])])])]),e("a",{staticClass:"sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginsubscriberpage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" Upgrade to SeedProd PRO Now\n ")])])])])},Q=[],X={name:"LiteCTASubscribers",data:function(){return{txt_1:Object(l["a"])("Dismiss this message","coming-soon"),txt_2:Object(l["a"])("Get SeedProd Pro and Unlock all the Powerful Features","coming-soon"),txt_3:Object(l["a"])("Thanks for being a loyal SeedProd Lite user. Upgrade to\nSeedProd Pro to unlock all the awesome features and\nexperience why SeedProd is the best WordPress landing\npage plugin.","coming-soon"),txt_4:Object(l["a"])("Pro Features:","coming-soon"),txt_995:Object(l["a"])("Filter by Page","coming-soon"),txt_996:Object(l["a"])("Export to a CSV File","coming-soon"),txt_997:Object(l["a"])("Premium Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Page Access Controls","coming-soon"),txt_9910:Object(l["a"])("Subscribers Over Time","coming-soon"),txt_9911:Object(l["a"])("See Name and Emails","coming-soon"),txt_9912:Object(l["a"])("Email Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),txt_15:Object(l["a"])("Bonus:","coming-soon"),txt_16:Object(l["a"])("SeedProd Lite users get","coming-soon"),txt_17:Object(l["a"])("a discount off the regular price","coming-soon"),txt_18:Object(l["a"])("automatically applied at checkout.","coming-soon"),txt_19:Object(l["a"])("Get SeedProd Pro Today and Unlock all the Powerful Features »","coming-soon"),shared:seedprod_store_admin}},methods:{dismiss:function(){var t=this,s=p.a.stringify({dismiss:!0});this.shared.settings_page_meta.dismiss_settings_lite_cta=!0,t.axios.post(seedprod_dismiss_settings_lite_cta_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}}},Z=X,tt=Object(u["a"])(Z,J,Q,!1,null,null,null),st=tt.exports;window.lodash=_.noConflict();var et={name:"Subscribers",mixins:[q["a"]],components:{ListTable:B,GChart:K["GChart"],LiteCTASubscribers:st},data:function(){var t;return t={txt_1:Object(l["a"])("Subscribers Overview","coming-soon"),txt_2:Object(l["a"])("Export to CSV","coming-soon"),txt_3:Object(l["a"])("Loading","coming-soon"),txt_4:Object(l["a"])("All Pages","coming-soon"),txt_5:Object(l["a"])("Coming Soon Page","coming-soon"),txt_6:Object(l["a"])("Maintenance Mode Page","coming-soon"),txt_7:Object(l["a"])("404 Page","coming-soon"),txt_8:Object(l["a"])("Landing Pages","coming-soon"),txt_9:Object(l["a"])("Days","coming-soon"),chart_timeframe:7,txt_10:Object(l["a"])("You do not have any subscribers yet.","coming-soon"),txt_11:Object(l["a"])("Go to Pages","coming-soon"),txt_12:Object(l["a"])("Search Emails","coming-soon"),txt_13:Object(l["a"])("Login Page","coming-soon")},Object(x["a"])(t,"chart_timeframe",7),Object(x["a"])(t,"chartData",[]),Object(x["a"])(t,"chartOptions",{chart:{title:"Subsribers Overview",subtitle:"Subscribers"},colors:["#DD4A1F"]}),Object(x["a"])(t,"enable_confirmation_email",!1),Object(x["a"])(t,"show_lpage_list",!1),Object(x["a"])(t,"shared",seedprod_store_admin),Object(x["a"])(t,"lpage_name","All Pages"),Object(x["a"])(t,"show_action",!1),Object(x["a"])(t,"lpage_uuid",""),Object(x["a"])(t,"lpage_id",this.$route.params.id),Object(x["a"])(t,"loading",!0),Object(x["a"])(t,"search",""),Object(x["a"])(t,"showcb",!0),Object(x["a"])(t,"totalitems",0),Object(x["a"])(t,"totalpages",0),Object(x["a"])(t,"perpage",100),Object(x["a"])(t,"actioncol","email"),Object(x["a"])(t,"currentpage",1),Object(x["a"])(t,"orderby",""),Object(x["a"])(t,"order",""),Object(x["a"])(t,"filter","all"),Object(x["a"])(t,"seedprod_remote_api",seedprod_remote_api),Object(x["a"])(t,"filters",{}),Object(x["a"])(t,"bulkactions",[{key:"delete_subscribers",label:"Delete Subscribers"}]),Object(x["a"])(t,"columns",{email:{label:Object(l["a"])("Email","coming-soon"),sortable:!1},full_name:{label:Object(l["a"])("Name","coming-soon"),sortable:!1},created_at:{label:Object(l["a"])("Created","coming-soon"),sortable:!1}}),Object(x["a"])(t,"actions",[{key:"delete",label:Object(l["a"])("Delete","coming-soon")}]),Object(x["a"])(t,"lpage_list",[]),Object(x["a"])(t,"rows",[{name:Object(l["a"])("Loading","coming-soon")+" ...",status:"",type:"",subscribers:"",entries:"",active:""}]),t},methods:{load_lpages:function(){var t=this;this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_get_lpage_list&_wpnonce="+seedprod_nonce).then(function(s){s.data&&(t.lpage_list=s.data,lodash.each(t.lpage_list,function(s,e){s.id==t.$route.params.id&&""==t.lpage_uuid&&(t.lpage_uuid=s.uuid,t.lpage_name=s.name,t.load_lpage_users(s.id,s.uuid,s.name,!1))}))})},load_lpage_users:function(t,s,e){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.show_lpage_list=!1,this.lpage_id=t,this.lpage_uuid=s,this.lpage_name=e,a?this.$router.push({name:"subscribers",params:{id:t}}):this.loadItems()},clear_search:function(){this.search,this.loadItems()},toggle_lpage_list:function(){!1===this.show_lpage_list&&this.load_lpages(),this.show_lpage_list=!this.show_lpage_list},trash:function(t){var s=this,e=this,a="";Y()(t)&&(a="s"),this.$swal({title:Object(l["a"])("Are you sure?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:"Yes, delete user"+a+"!"}).then(function(a){if(a.value){e.loading=!0;var n=seedprod_delete_subscribers_url,o=p.a.stringify({items:t,api_token:e.shared.api_token});s.axios.post(n,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){e.loading=!1,e.$refs.subscribersdt.clear_checked(),(0<t.data||1==t.data.success)&&(e.$swal({imageUrl:e.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(l["a"])("Subscribers Deleted","coming-soon"),toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),e.loadItems())}).catch(function(t){j.a.done(),console.log(t),e.shared.doing_ajax=!1,e.$swal({imageUrl:e.shared.plugin_path+"public/svg/error-24px-white.svg",text:t.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})}})},export_subscribers:function(){location.href="admin.php?page="+this.shared.page_path+"&action="+this.shared.page_path+"_export_subscribers&id="+this.lpage_id+"&page_uuid="+this.lpage_uuid+"&_wpnonce="+seedprod_nonce,this.$swal({imageUrl:this.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Exported Started","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})},loadItems:function(t,s){"search"==t?(this.currentpage=1,this.orderby="",this.order="",this.filter=""):this.search="";seedprod_remote_api;var e=this;e.loading=!0,j.a.start(),this.axios.get("admin-ajax.php?action="+this.shared.page_path+"_subscribers_datatable&_wpnonce="+seedprod_nonce+"¤t_page="+this.currentpage+"&orderby="+this.orderby+"&order="+this.order+"&filter="+this.filter+"&s="+this.search+"&id="+this.lpage_uuid+"&interval="+this.chart_timeframe).then(function(t){e.loading=!1,j.a.done(),t.data.lpage_name&&(e.lpage_name=t.data.lpage_name),"all"==e.filter&&0==e.shared.subscriber_count?(e.shared.subscriber_count=t.data.subscribers.total,e.axios.get(seedprod_update_subscriber_count)):e.shared.subscriber_count=1,e.rows=t.data.rows,e.totalitems=w()(t.data.totalitems),e.totalpages=w()(t.data.totalpages),e.currentpage=w()(t.data.currentpage),e.chartData=t.data.recent_subscribers})},goToPage:function(t){this.currentpage=t,this.loadItems()},onActionClick:function(t,s){"delete"==t&&this.trash(s.id)},onBulkAction:function(t,s){"delete_subscribers"==t&&this.trash(s)},sortCallback:function(t,s){this.orderby=t,this.order=s,this.loadItems()}},created:function(){0==this.$route.params.id&&this.loadItems(),this.load_lpages();var t=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(2)'),s=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(4)');t.classList.remove("current"),s.classList.add("current")},watch:{$route:function(t,s){this.filter="all",this.loadItems("",t.params.id)}}},at=et,nt=Object(u["a"])(at,R,V,!1,null,null,null),ot=nt.exports,it=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{attrs:{id:"seedprod-settings"}},[e("router-view",{attrs:{name:"main"}})],1)])},rt=[],pt={name:"Settings",data:function(){return{txt_1:Object(l["a"])("General","coming-soon"),txt_2:Object(l["a"])("Emails","coming-soon"),txt_3:Object(l["a"])("Integrations","coming-soon"),shared:seedprod_store_admin}},created:function(){var t=document.querySelector(".wp-first-item a[href='admin.php?page="+this.shared.page_path+"']"),s="current";t.classList.remove(s),t.parentNode.classList.remove(s);t=document.querySelector("a[href='admin.php?page="+this.shared.page_path+"_settings']"),s="current";t.classList?t.classList.add(s):t.className+=" "+s,t.parentNode.classList?t.parentNode.classList.add(s):t.parentNode.className+=" "+s},methods:{}},lt=pt,ct=Object(u["a"])(lt,it,rt,!1,null,null,null),dt=ct.exports,ut=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("table",{staticClass:"form-table sp-text-neutral-80"},[e("tbody",[e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("td",{staticClass:"sp-p-0 sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid sp-pb-5",attrs:{colspan:"2"}},[e("h4",{staticClass:"sp-text-xl sp-mt-4 sp-mb-1"},[t._v(t._s(t.txt_1))]),"seedprod_pro"==t.shared.page_path?e("p",[t._v("\n\t\t\t\t\t\t"+t._s(t.txt_2)+"\n\t\t\t\t\t")]):t._e(),"seedprod_lite"==t.shared.page_path?e("p",[e("span",{domProps:{innerHTML:t._s(t.txt_3)}}),e("img",{staticClass:"emoji",attrs:{draggable:"false",alt:"🙂",src:"https://s.w.org/images/core/emoji/11.2.0/svg/1f642.svg"}})]):t._e(),"seedprod_lite"==t.shared.page_path?e("p",{staticClass:"sp-mt-2",domProps:{innerHTML:t._s(t.txt_4)}}):t._e(),"seedprod_lite"==t.shared.page_path?e("p",{staticStyle:{"margin-top":"12px"},domProps:{innerHTML:t._s(t.txt_5)}}):t._e()])]),e("tr",{staticClass:"seedprod-settings-form sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid",attrs:{valign:"top"}},[e("th",{attrs:{scope:"row"}},[e("strong",{staticClass:"sp-text-neutral-80"},[t._v(t._s(t.txt_6))])]),e("td",[e("form",{staticClass:"form-inline"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.shared.settings_page_meta.api_key,expression:"shared.settings_page_meta.api_key"}],staticClass:"sp-form-input sp-w-64 sp-m-0",staticStyle:{"margin-bottom":"5px"},attrs:{type:"password",autocomplete:"off",placeholder:t.txt_7},domProps:{value:t.shared.settings_page_meta.api_key},on:{input:function(s){s.target.composing||t.$set(t.shared.settings_page_meta,"api_key",s.target.value)}}}),e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-primary sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-white sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"api_key"==t.shared.settings_page_meta.button},on:{click:function(s){return s.preventDefault(),t.save_api_key(s)}}},[t.shared.doing_ajax&&"api_key"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "),t.shared.license_name?e("span",[t._v(t._s(t.txt_8))]):e("span",[t._v(t._s(t.txt_9))])]),t.shared.license_name&&"seedprod_pro"==t.shared.page_path?e("span",[e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-neutral-80 sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-neutral-15 sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"deactivate_api_key"==t.shared.settings_page_meta.button},on:{click:function(s){return s.preventDefault(),t.deactivate_api_key(s)}}},[t.shared.doing_ajax&&"deactivate_api_key"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "),e("span",[t._v(t._s(t.txt_10))])])]):t._e(),t._v("\n\t\t\t\t\t\t \n\t\t\t\t\t\t"),"seedprod_lite"==t.shared.page_path&&t.show_unlock?e("span",[e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-neutral-10 sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-neutral-80 sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-neutral-15 sp-cursor-pointer",attrs:{disabled:t.shared.doing_ajax&&"unlock"==t.shared.settings_page_meta.button},on:{click:t.start_free_to_pro_upgrade}},[t.shared.doing_ajax&&"unlock"==t.shared.settings_page_meta.button?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v(" "+t._s(t.txt_11)+"\n\t\t\t\t\t\t\t")])]):t._e()]),t.shared.license_name?e("div",{staticClass:"sp-text-neutral-80",staticStyle:{"margin-top":"2px"},domProps:{innerHTML:t._s(t.txt_12)}}):t._e()])]),e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("td",{staticClass:"sp-p-0 sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid sp-pb-5",attrs:{colspan:"2"}},[e("h4",{staticClass:"sp-text-xl sp-mt-4 sp-mb-1"},[t._v(t._s(t.txt_15))])])]),e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("th",{attrs:{scope:"row"}},[e("strong",{staticClass:"sp-text-neutral-80"},[t._v(t._s(t.txt_18))])]),e("td",[e("toggle-button",{staticStyle:{"margin-bottom":"0"},attrs:{width:40,sync:!0},model:{value:t.shared.app_settings.disable_seedprod_button,callback:function(s){t.$set(t.shared.app_settings,"disable_seedprod_button",s)},expression:"shared.app_settings.disable_seedprod_button"}}),t._v(" \n\t\t\t\t\t\t\t"),t.shared.app_settings.disable_seedprod_button?e("span",{staticClass:"sp-text-11px sp-uppercase sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt__2))]):e("span",{staticClass:"sp-text-11px sp-uppercase sp-text-neutral-40 sp-pl-1 sp-font-bold"},[t._v(t._s(t.txt__3))])],1)]),e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[t._m(0),e("td",[e("button",{staticClass:"sp-inline-block sp-text-sm sp-bg-primary sp-px-4 sp-py-3 sp-rounded-sm sp-leading-none sp-text-white sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer",on:{click:function(s){return s.preventDefault(),t.save_app_settings(s)}}},[e("span",[t._v(t._s(t.txt_17))])])])]),e("tr",{staticClass:"seedprod-settings-title",attrs:{valign:"top"}},[e("td",{staticClass:"sp-p-0 sp-border-b sp-border-t-0 sp-border-l-0 sp-border-r-0 sp-border-neutral-10 sp-border-solid sp-pb-5",attrs:{colspan:"2"}},[e("h4",{staticClass:"sp-text-xl sp-mt-4 sp-mb-1"},[t._v(t._s(t.txt_13))]),e("a",{attrs:{href:"admin.php?page=sp_pro_debug"}},[t._v("View Debug Information")])])])])]),"seedprod_lite"==t.shared.page_path&&t.shared.show_inline_cta?e("div",[e("SettingsLiteCTA")],1):t._e()])},gt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("th",{attrs:{scope:"row"}},[e("strong",{staticClass:"sp-text-neutral-80"})])}],_t=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-px-10 sp-py-10 sp-text-center sp-relative"},[e("span",{staticClass:"sp-neutral-60 sp-absolute sp-cursor-pointer sp-right-0 sp-top-0 sp-opacity-75 sp-mt-2 sp-mr-1",on:{click:t.dismiss_upsell}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])]),e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v("Special Upgrade Offer - Save 50% Off")]),t._m(0),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_997))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_998))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_999))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9912))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9913))]),e("li",{staticClass:"sp-font-normal"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9914))])])])]),e("a",{staticClass:"sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center",attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginsettingsabout",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" Upgrade to SeedProd PRO Now\n ")])])])])},mt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral"},[t._v("\n Upgrade to SeedProd Pro\n "),e("br"),t._v("Today and Save\n ")])}],ht={name:"SettingsLiteCTA",data:function(){return{txt_1:Object(l["a"])("Dismiss this message","coming-soon"),txt_2:Object(l["a"])("Get SeedProd Pro and Unlock all the Powerful Features","coming-soon"),txt_3:Object(l["a"])("Thanks for being a loyal SeedProd Lite user. Upgrade to\nSeedProd Pro to unlock all the awesome features and\nexperience why SeedProd is the best WordPress landing\npage plugin.","coming-soon"),txt_4:Object(l["a"])("Pro Features:","coming-soon"),txt_995:Object(l["a"])("Powerful Page Editor","coming-soon"),txt_996:Object(l["a"])("20+ PRO Page Blocks","coming-soon"),txt_997:Object(l["a"])("Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Access Controls","coming-soon"),txt_9910:Object(l["a"])("100+ PRO Page Templates","coming-soon"),txt_9911:Object(l["a"])("PRO Smart Sections","coming-soon"),txt_9912:Object(l["a"])("Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),txt_15:Object(l["a"])("Bonus:","coming-soon"),txt_16:Object(l["a"])("SeedProd Lite users get","coming-soon"),txt_17:Object(l["a"])("a discount off the regular price","coming-soon"),txt_18:Object(l["a"])("automatically applied at checkout.","coming-soon"),txt_19:Object(l["a"])("Get SeedProd Pro Today and Unlock all the Powerful Features »","coming-soon"),shared:seedprod_store_admin}},methods:{dismiss_upsell:function(){var t=p.a.stringify({id:3});this.axios.post(seedprod_dismiss_upsell,t,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){t.data.status&&location.reload()})},dismiss:function(){var t=this,s=p.a.stringify({dismiss:!0});this.shared.settings_page_meta.dismiss_settings_lite_cta=!0,t.axios.post(seedprod_dismiss_settings_lite_cta_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}}},bt=ht,vt=Object(u["a"])(bt,_t,mt,!1,null,null,null),xt=vt.exports,ft={name:"SettingsGeneral",mixins:[q["a"]],data:function(){return{txt_1:Object(l["a"])("License","coming-soon"),txt_2:Object(l["a"])("Your license key provides access to updates and addons.","coming-soon"),txt_3:Object(l["a"])("You're using <strong>SeedProd Lite</strong> - No License needed. Enjoy!","coming-soon"),txt_4:Object(l["b"])(Object(l["a"])("To unlock more features consider <a href='%s' target='_blank'>upgrading to PRO</a> . As a valued SeedProd Lite user you'll receive <strong>a discount off the regular price</strong>, automatically applied at checkout!","coming-soon"),"https://www.seedprod.com/lite-upgrade/?discount=LITEUPGRADE&utm_source=WordPress&utm_medium=seedprod-license-page&utm_campaign=liteplugin"),txt_5:Object(l["b"])(Object(l["a"])("If you already have a license key for <a href='%s' target='_blank'>SeedProd Pro</a>, please enter it to Upgrade to the Pro Features.","coming-soon"),seedprod_store_admin.upgrade_link+"welcome"),txt_6:Object(l["a"])("License Key","coming-soon"),txt_7:Object(l["a"])("Enter Your License Key Here","coming-soon"),txt_8:Object(l["a"])("Recheck Key","coming-soon"),txt_9:Object(l["a"])("Verify Key","coming-soon"),txt_10:Object(l["a"])("Deactivate Key","coming-soon"),txt_11:Object(l["a"])("Connect to SeedProd","coming-soon"),txt_12:Object(l["b"])(Object(l["a"])("You currently have the <strong>%s</strong> license.","coming-soon"),seedprod_store_admin.license_name),txt_13:Object(l["a"])("Debug Information","coming-soon"),txt_14:Object(l["a"])("Facebook APP ID","coming-soon"),txt_15:Object(l["a"])("Global Settings","coming-soon"),txt_16:Object(l["a"])("","coming-soon"),txt_17:Object(l["a"])("Save Settings","coming-soon"),txt_18:Object(l["a"])("Disable Edit SeedProd Button","coming-soon"),txt__2:Object(l["a"])("Yes","coming-soon"),txt__3:Object(l["a"])("No","coming-soon"),show_unlock:!1,shared:seedprod_store_admin}},computed:{slug:function(){var t=this.slugify(this.page_meta.upgrade_feature);return t}},mounted:function(){},methods:{goto_dashboard:function(){this.$router.push({name:"dashboard"})},start_free_to_pro_upgrade:function(){var t=this;j.a.start();var s=p.a.stringify({});t.shared.doing_ajax=!0,t.shared.settings_page_meta.button="unlock",t.$swal({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Preparing to Unlock... Please wait...",toast:!0,customClass:"sp-toast-success",type:null,position:"top-end",showConfirmButton:!1,timer:3e3}),this.axios.post(seedprod_upgrade_license_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,s.data.success?location.href=s.data.data.url:t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.data.data.message,toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s,toast:!0,customClass:"sp-toast-error",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})},save_settings:function(){var t=this;j.a.start(),this.$validator.validateAll().then(function(s){if(s){var e=p.a.stringify({settings:t.shared.settings});return t.shared.doing_ajax=!0,t.shared.settings_page_meta.button="settings",void t.axios.post(seedprod_save_settings_ajax_url,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){j.a.done(),t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Saved!","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(l["a"])("Could not be saved. Please contact Support if you continue to experience this issue.","coming-soon"),toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})}var a="";t.errors.all().forEach(function(t){a=a+t+"\n"}),a+="",t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:a,toast:!0,type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})},save_app_settings:function(){var t=this;j.a.start(),this.$validator.validateAll().then(function(s){if(s){var e=p.a.stringify({app_settings:t.shared.app_settings});return t.shared.doing_ajax=!0,void t.axios.post(seedprod_save_app_settings_ajax_url,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){j.a.done(),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:Object(l["a"])("Saved!","coming-soon"),toast:!0,customClass:"sp-toast-success",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(l["a"])("Could not be saved. Please contact Support if you continue to experience this issue.","coming-soon"),toast:!0,customClass:"sp-toast-failure",type:null,position:"top-end",showConfirmButton:!1,timer:3e3})})}alert("else save app settings")})},deactivate_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="deactivate_api_key",t.axios.post(seedprod_api_key_deactivate_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,"true"==s.data.status){var e="success";t.shared.license_name="",t.shared.settings_page_meta.api_key=""}else e="error";t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})},save_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="api_key";var e="admin-ajax.php?action="+this.shared.page_path+"_save_api_key&_wpnonce="+seedprod_nonce;t.axios.post(e,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.shared.license_name=1,t.txt_12=s.data.license_name,console.log(s.data.license_name),"true"==s.data.status){t.show_unlock=!0;var e="success";s.data.body.plugin_name&&(t.shared.license_name=s.data.body.plugin_name)}else{e="error";t.shared.license_name=""}t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e3})}).catch(function(s){console.log(s),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})})}},components:{SettingsLiteCTA:xt}},wt=ft,Ct=Object(u["a"])(wt,ut,gt,!1,null,null,null),yt=Ct.exports,kt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",[e("div",{staticClass:"sp-bg-white sp--ml-5 sp-flex sp-flex-col sp-items-center",attrs:{id:"sp-welcome-top"}},[e("div",{staticClass:"robbie"},[e("img",{staticClass:"sp-mt-16",attrs:{id:"seedprod-welcome-logo",src:t.shared.plugin_path+"public/svg/seedprod-logo.svg",alt:t.txt_14}})]),e("div",{staticClass:"sp-mx-auto sp-text-center sp-text-15px sp-w-460 sp-font-semibold sp-text-neutral-80 sp-mb-6 sp-mt-5 sp-leading-relaxed"},[t._v(t._s(t.txt_1))]),e("div",{staticClass:"sp-mb-32 sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-p-10 sp-w-580 sp-z-20 sp-bg-white sp-shadow-2xl"},["seedprod_lite"==t.shared.page_path?e("div",{staticClass:"sp-font-bold sp-text-base sp-text-neutral"},[e("span",{domProps:{innerHTML:t._s(t.txt_2)}}),e("img",{staticClass:"emoji",attrs:{draggable:"false",alt:"🙂",src:"https://s.w.org/images/core/emoji/11.2.0/svg/1f642.svg"}})]):t._e(),"seedprod_pro"==t.shared.page_path?e("div",{staticClass:"sp-font-bold sp-text-base sp-text-neutral sp-text-center ",attrs:{id:"license-sub"}},[t._v("\n "+t._s(t.txt_3)+"\n ")]):t._e(),"seedprod_pro"==t.shared.page_path?e("form",{staticClass:"sp-flex sp-mt-6"},[e("div",{staticClass:"sp-flex sp-mx-auto"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.shared.settings_page_meta.api_key,expression:"\n\t\t\t\t\t\t\t\t\t\t\tshared.settings_page_meta.api_key\n\t\t\t\t\t\t\t\t\t\t"}],staticClass:"sp-form-input sp-h-48px",staticStyle:{"min-width":"300px"},attrs:{type:"password",name:"name",placeholder:t.txt_5,autocomplete:"off"},domProps:{value:t.shared.settings_page_meta.api_key},on:{input:function(s){s.target.composing||t.$set(t.shared.settings_page_meta,"api_key",s.target.value)}}}),e("button",{staticClass:"sp-mb-4 sp-inline-block sp-text-sm sp-bg-primary sp-px-4 sp-py-4 sp-rounded-sm sp-leading-none sp-text-white sp-no-underline sp-rounded-md sp-text-base sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer sp-border-none",attrs:{disabled:!!t.shared.doing_ajax},on:{click:function(s){return s.preventDefault(),t.save_api_key(s)}}},[t.shared.doing_ajax?e("i",{staticClass:"fas fa-spinner fa-spin"}):t._e(),t._v("\n "+t._s(t.txt_6)+"\n ")])])]):t._e(),e("div",{staticClass:"sp-text-15px sp-text-neutral-80 sp-text-center sp-mt-2",domProps:{innerHTML:t._s(t.txt_7)}})])]),e("div",[e("a",{staticClass:"play-video sp-mx-auto sp-block sp-text-center sp--mt-40",attrs:{href:"#",title:t.txt_15},on:{click:function(s){return s.preventDefault(),t.watch_video(s)}}},[e("img",{staticClass:"video-thumbnail",attrs:{src:t.shared.plugin_path+"public/img/welcome-video.png",alt:t.txt_13}})]),e("div",[e("div",{staticClass:"sp-text-lg sp-text-neutral-80 sp-w-full sp-leading-relaxed sp-mt-8 sp-mx-auto sp-text-center",domProps:{innerHTML:t._s(t.txt_8)}}),e("div",{staticClass:"sp-flex sp-justify-center sp-pb-3 sp-pt-6"},[e("div",{staticClass:"sp-mr-1"},[e("a",{staticClass:"sp-mb-4 sp-inline-block sp-bg-primary sp-px-5 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px sp-ml-1 hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold",attrs:{id:"first-step",href:"admin.php?page="+t.shared.page_path}},[t._v(t._s(t.txt_9))])]),e("div",{staticClass:"sp-ml-1"},[e("a",{staticClass:"sp-mb-4 sp-inline-block sp-bg-neutral-10 hover:sp-bg-neutral-20 sp-px-5 sp-py-4 sp-rounded sp-leading-none sp-text-neutral-80 sp-no-underline sp-text-17px sp-ml-1 sp-cursor-pointer sp-font-semibold",attrs:{href:"https://seedprod.com/docs/creating-your-first-lpage/?utm_source=WordPress&utm_medium=link&utm_campaign=liteplugin",target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.txt_10))])])])]),e("div",[e("hr",{staticClass:"sp-border sp-border-neutral-20 sp-border-b-0 sp-w-24 sp-mb-8"}),e("h1",{staticClass:"sp-text-center sp-font-bold sp-text-34px sp-text-neutral sp-mt-2 sp-leading-normal sp-tracking-tight",domProps:{innerHTML:t._s(t.txt_11)}}),e("div",{staticClass:"sp-text-17px sp-text-neutral-80 sp-mx-auto sp-w-580 sp-leading-relaxed sp-mt-8 sp-text-center sp-w-full sp-mb-12",domProps:{innerHTML:t._s(t.txt_12)}}),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold",domProps:{innerHTML:t._s(t.txt_16)}}),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_22)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_27))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n\t\t\t\t "+t._s(t.txt_28)+"\n ")])])])]),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_29))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_30)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_31))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_32)+"\n ")])])])]),e("div",{staticClass:"sm:sp-flex sp-w-690 sp-mx-auto sp-text-neutral-80 sp-mb-6"},[e("div",{staticClass:"sp-flex sp-items-start sm:sp-mr-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_33))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_34)+"\n ")])])]),e("div",{staticClass:"sp-flex sp-items-start sm:sp-ml-8 sp-w-1/2"},[e("img",{staticClass:"sp-mr-4",attrs:{src:t.shared.plugin_path+"public/svg/green-check.svg"}}),e("div",[e("h5",{staticClass:"sp-m-0 sp-text-15px sp-font-bold"},[t._v(t._s(t.txt_35))]),e("p",{staticClass:"sp-text-15px"},[t._v("\n "+t._s(t.txt_36)+"\n ")])])])]),"seedprod_lite"==t.shared.page_path?e("div",{staticClass:"sp-mt-6 sp-bg-white sp-border-neutral-15 sp-border sp-rounded sp-border-solid sp-w-720 sp-mx-auto sp-px-10 sp-py-10 sp-text-center"},[e("div",[e("span",{staticClass:"sp-text-primary sp-text-lg sp-font-bold"},[t._v(t._s(t.txt_17))]),e("h1",{staticClass:"sp-mt-4 sp-mb-8 sp-leading-tight sp-text-34px sp-font-bold sp-text-neutral",domProps:{innerHTML:t._s(t.txt_23)}},[e("span",{staticClass:"sp-text-primary"},[t._v(t._s(t.txt_18))])]),e("div",{staticClass:"sp-text-center sp-mb-4 sp-text-base"},[e("div",{staticClass:"sp-inline-flex sp-text-left"},[e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v("\n "+t._s(t.txt_995)+"\n ")]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_996))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_997))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_998))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_999))])]),e("ul",{staticClass:"sp-px-4"},[e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9910))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9911))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9912))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9913))]),e("li",{staticClass:"sp-font-bold"},[e("span",{staticClass:"sp-text-green sp-mr-2"},[e("svg",{staticClass:"sp-fill-current sp-w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),t._v(t._s(t.txt_9914))])])])]),e("a",{staticClass:"sp-inline-block sp-bg-green sp-px-6 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-17px hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-flex sp-items-center sp-justify-center",attrs:{href:this.shared.upgrade_link+"pluginwelcomepage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" "+t._s(t.txt_24)+"\n ")])])]):t._e(),e("div",{staticClass:"sm:sp-flex sp-w-720 sp-mx-auto sp-mt-2 sp-mb-20"},[e("div",{staticClass:"sp-testimonial sm:sp-mr-3 sp-w-1/2"},[e("p",{staticClass:"sp-bg-white sp-rounded-md sp-py-5 sp-px-6 sp-text-neutral-80 sp-text-15px sp-mb-0 sp-relative sp-leading-relaxed "},[t._v(t._s(t.txt_21))]),e("div",{staticClass:"sp-flex sp-items-center sp-mt-6 sp-pl-5"},[e("img",{staticClass:"sp-w-10 sp-rounded-full sp-mr-5",attrs:{src:t.shared.plugin_path+"public/img/chris-ducker.jpg"}}),t._m(0)])]),e("div",{staticClass:"sp-testimonial sm:sp-ml-3 sp-w-1/2"},[e("p",{staticClass:"sp-bg-white sp-rounded-md sp-py-5 sp-px-6 sp-text-neutral-80 sp-text-15px sp-mb-0 sp-relative sp-leading-relaxed "},[t._v(t._s(t.txt_26))]),e("div",{staticClass:"sp-flex sp-items-center sp-mt-6 sp-pl-5"},[e("img",{staticClass:"sp-w-10 sp-rounded-full sp-mr-5",attrs:{src:t.shared.plugin_path+"public/img/ruthie-unaegbu.jpg"}}),t._m(1)])])])])])])])},jt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"sp-text-neutral-80 sp-text-xs"},[e("strong",{staticClass:"sp-font-bold"},[t._v("Chris Ducker")]),e("p",{staticClass:"sp-m-0 sp-text-neutral-60 sp-mt-1"},[t._v("Author of #1 Bestselling Book 'Virtual Freedom'")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"sp-text-neutral-80 sp-text-xs"},[e("strong",{staticClass:"sp-font-bold"},[t._v("Ruthie Unaegbu")]),e("p",{staticClass:"sp-m-0 sp-text-neutral-60 sp-mt-1"},[t._v("WordPress Freelancer")])])}],Ot={name:"Welcome",mixins:[q["a"]],data:function(){return{txt_1:Object(l["a"])("Thank you for choosing SeedProd - The #1 Coming Soon Page and Maintenance Mode Plugin for WordPress.","coming-soon"),txt_2:Object(l["a"])("You're using <strong>SeedProd Lite</strong> - No License needed. Enjoy!","coming-soon"),txt_3:Object(l["a"])("Enter your license key to enable all the features of the plugin.","coming-soon"),txt_4:Object(l["b"])(Object(l["a"])("If you already have a license key for <a href='%s' target='_blank'>SeedProd Pro</a>, please enter it to Upgrade to the Pro Features.","coming-soon"),seedprod_store_admin.upgrade_link+"welcome"),txt_5:Object(l["a"])("Enter Your License Key Here","coming-soon"),txt_6:Object(l["a"])("Verify key","coming-soon"),txt_7:Object(l["b"])(Object(l["a"])("Don't have a license key or need to renew? Visit <a href='%s' target='_blank' class='sp-text-primary'>seedprod.com</a>","coming-soon"),"https://www.seedprod.com?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=pluginwelcomelicense"),txt_8:Object(l["a"])("SeedProd makes it easy to create landing pages in WordPress.<br>You can watch the video tutorial or read our guide on how create your first page.","coming-soon"),txt_9:Object(l["a"])("Create Your First Page","coming-soon"),txt_10:Object(l["a"])("Read the Full Guide","coming-soon"),txt_11:Object(l["a"])("SeedProd Features & Solutions","coming-soon"),txt_12:Object(l["a"])("SeedProd is both easy to use and extremely powerful. We have tons of<br />helpful features to help you create a successful landing page.","coming-soon"),txt_13:Object(l["a"])("Watch how to create your first landing page","coming-soon"),txt_14:Object(l["a"])("Robbie the Rabbit the SeedProd mascot","coming-soon"),txt_15:Object(l["a"])("Watch how to create your first page","coming-soon"),txt_16:Object(l["a"])("Drag & Drop Page Builder","coming-soon"),txt_17:Object(l["a"])("Special Upgrade Offer - Save 50% Off","coming-soon"),txt_18:Object(l["a"])("Save 20%","coming-soon"),txt_19:Object(l["a"])("Pro","coming-soon"),txt_20:Object(l["a"])("per year","coming-soon"),txt_21:Object(l["a"])("\"Want to create a great looking 'coming soon' landing page and grab emails easily? Check out SeedProd\"","coming-soon"),txt_22:Object(l["a"])("Our Drag & Drop Page Builder lets you create great looking pages and layouts fast so you can get your landing page up in minutes. No coding required!","coming-soon"),txt_23:Object(l["a"])("Upgrade to SeedProd Pro<br />Today and Save","coming-soon"),txt_24:Object(l["a"])("Upgrade to PRO Now","coming-soon"),txt_25:Object(l["a"])("List","coming-soon"),txt_26:Object(l["a"])('"Just gotta say how awesome SeedProd really is! WordPress freelancers really need this in their repertoire!"',"coming-soon"),txt_27:Object(l["a"])("Landing Page Templates","coming-soon"),txt_28:Object(l["a"])("Create a variety of landing pages including sales, optin, coming soon, maintenance mode, webinar, and thank you pages. New templates added regularly.","coming-soon"),txt_29:Object(l["a"])("Smart Sections","coming-soon"),txt_30:Object(l["a"])("We created professionally designed pre-built sections like headers, calls to action, so you don't need to be a designer to create beautiful layouts.","coming-soon"),txt_31:Object(l["a"])("Premium Integrations","coming-soon"),txt_32:Object(l["a"])("Collect emails with your favorite 3rd party email marketing service providers including MailChimp, ActiveCampaign, ConvertKit, Constant Contact and more...","coming-soon"),txt_33:Object(l["a"])("No Coding Skills Needed","coming-soon"),txt_34:Object(l["a"])("We've eliminated all the technical barries that keep you from building the perfect landing page.","coming-soon"),txt_35:Object(l["a"])("Super Fast Loading Pages","coming-soon"),txt_36:Object(l["a"])("Bloat free code results in faster loading pages which means your page converts higher.","coming-soon"),txt_995:Object(l["a"])("Drag & Drop Page Builder","coming-soon"),txt_996:Object(l["a"])("20+ PRO Page Blocks","coming-soon"),txt_997:Object(l["a"])("Email Marketing Integrations","coming-soon"),txt_998:Object(l["a"])("Custom 404 Pages","coming-soon"),txt_999:Object(l["a"])("Page Access Controls","coming-soon"),txt_9910:Object(l["a"])("100+ PRO Page Templates","coming-soon"),txt_9911:Object(l["a"])("PRO Smart Sections","coming-soon"),txt_9912:Object(l["a"])("Subscriber Management","coming-soon"),txt_9913:Object(l["a"])("Saved Templates","coming-soon"),txt_9914:Object(l["a"])("Plus much more...","coming-soon"),shared:seedprod_store_admin}},methods:{watch_video:function(){this.$swal({width:600,html:'<iframe width="100%" height="315" src="https://www.youtube.com/embed/MUXoqm3VpRo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',toast:!1,customContainerClass:"seedprod-welcome-video"})},save_api_key:function(){var t=this,s=p.a.stringify({api_key:t.shared.settings_page_meta.api_key});t.shared.doing_ajax=!0,j.a.start(),t.shared.settings_page_meta.button="api_key";var e="admin-ajax.php?action="+this.shared.page_path+"_save_api_key&_wpnonce="+seedprod_nonce;t.axios.post(e,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){if(j.a.done(),t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,"true"==s.data.status)var e="success";else e="error";t.$swal({imageUrl:t.shared.plugin_path+"public/svg/"+e+"-24px-white.svg",text:s.data.msg,toast:!0,type:null,customClass:"sp-toast-"+e,position:"top-end",showConfirmButton:!1,timer:3e4});var a=document.getElementById("first-step");a.scrollIntoView(!1)}).catch(function(s){t.shared.doing_ajax=!1,t.shared.settings_page_meta.button=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})})}}},Pt=Ot,Lt=Object(u["a"])(Pt,kt,jt,!1,null,null,null),St=Lt.exports,Mt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{attrs:{id:"seedprod-aboutus"}},[e("nav",{staticClass:"sp-hidden"},[e("ul",{},[e("router-link",{attrs:{tag:"li",to:{name:"aboutus_aboutus"}}},[e("a",[e("span",[t._v(t._s(t.txt_1))])])]),e("router-link",{attrs:{tag:"li",to:{name:"aboutus_gettingstarted"}}},[e("a",[e("span",[t._v(t._s(t.txt_2))])])]),"seedprod_lite"==t.shared.page_path?e("router-link",{attrs:{tag:"li",to:{name:"aboutus_litevspro"}}},[e("a",[e("span",[t._v(t._s(t.txt_3))])])]):t._e()],1)]),e("div",[e("router-view",{attrs:{name:"main"}})],1)])},Tt=[],zt={name:"Aboutus",data:function(){return{txt_1:Object(l["a"])("About Us","coming-soon"),txt_2:Object(l["a"])("Getting Started","coming-soon"),txt_3:Object(l["a"])("Lite vs Pro","coming-soon"),shared:seedprod_store_admin}},computed:{},created:function(){var t=document.querySelector(".wp-first-item a[href='admin.php?page="+this.shared.page_path+"']"),s="current";t.classList.remove(s),t.parentNode.classList.remove(s);t=document.querySelector("a[href='admin.php?page="+this.shared.page_path+"_about_us']"),s="current";t.classList?t.classList.add(s):t.className+=" "+s,t.parentNode.classList?t.parentNode.classList.add(s):t.parentNode.className+=" "+s},methods:{}},Bt=zt,At=Object(u["a"])(Bt,Mt,Tt,!1,null,null,null),$t=At.exports,Dt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"lg:sp-flex sp-mt-10 sp-a"},[e("div",{staticClass:"sp-mr-20"},[e("h3",{staticClass:"sp-mt-0 sp-text-neutral sp-text-xl sp-leading-normal"},[t._v("\n "+t._s(t.txt_1)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_2)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_3)+"\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_4)+"\n "),e("a",{attrs:{href:"https://www.wpbeginner.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("WPBeginner")]),t._v(", "+t._s(t.txt_6)+",\n "),e("a",{attrs:{href:"https://optinmonster.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("OptinMonster")]),t._v(", "+t._s(t.txt_7)+",\n "),e("a",{attrs:{href:"https://www.monsterinsights.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("MonsterInsights")]),t._v(", "+t._s(t.txt_8)+",\n "),e("a",{attrs:{href:"https://www.wpforms.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("WPForms")]),t._v(", "+t._s(t.txt_9)+",\n "),e("a",{attrs:{href:"https://rafflepress.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("RafflePress")]),t._v(", "+t._s(t.txt_10)+",\n "),e("a",{attrs:{href:"https://trustpulse.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod",target:"_blank",rel:"noopener noreferrer"}},[t._v("TrustPulse")]),t._v(".\n ")]),e("p",{staticClass:"sp-text-neutral-80 sp-text-17px"},[t._v("\n "+t._s(t.txt_5)+"\n ")])]),e("div",{},[e("img",{staticClass:"sp-rounded",attrs:{src:t.shared.plugin_path+"public/img/team.jpg",alt:t.txt_11}}),e("figcaption",{staticClass:"sp-text-neutral-80 sp-text-15px sp-text-center sp-mt-6"},[t._v("\n "+t._s(t.txt_12)+": Syed, John & Thomas"),e("br")])])]),"seedprod_lite"==t.shared.page_path&&t.shared.show_inline_cta?e("div",[e("SettingsLiteCTA")],1):t._e()])},Ut=[],Ht={name:"AboutusAbout",data:function(){return{txt_1:Object(l["a"])("Hello and welcome to SeedProd, the most beginner friendly drag & drop WordPress landing page plugin. At SeedProd, we build software that helps you create beautiful responsive landing pages for your website in minutes.","coming-soon"),txt_2:Object(l["a"])("Over the years, we found that most WordPress landing page plugins were bloated, buggy, slow, and very hard to use. So we started with a simple goal: build a WordPress landing page plugin that’s both easy and powerful.","coming-soon"),txt_3:Object(l["a"])("Our goal is to take the pain out of creating landing pages and make it easy.","coming-soon"),txt_4:Object(l["a"])("SeedProd is brought to you by the same team that’s behind the largest WordPress resource site,","coming-soon"),txt_5:Object(l["a"])("Yup, we know a thing or two about building awesome products that customers love.","coming-soon"),txt_6:Object(l["a"])("the most popular lead-generation software","coming-soon"),txt_7:Object(l["a"])("the best WordPress analytics plugin","coming-soon"),txt_8:Object(l["a"])("the best WordPress forms plugin","coming-soon"),txt_9:Object(l["a"])("the best WordPress giveaway plugin","coming-soon"),txt_10:Object(l["a"])("and finally the best WordPress FOMO plugin","coming-soon"),txt_11:Object(l["a"])("SeedProd Team photo","coming-soon"),txt_12:Object(l["a"])("The SeedProd Team","coming-soon"),shared:seedprod_store_admin}},methods:{},components:{SettingsLiteCTA:xt}},It=Ht,Et=Object(u["a"])(It,Dt,Ut,!1,null,null,null),Nt=Et.exports;n["default"].use(h["a"]);var Ft=new h["a"]({routes:[{name:"dashboard",path:"/",component:U},{name:"growthtools",path:"/growth-tools",component:W},{name:"subscribers",path:"/subscribers/:id",component:ot},{path:"/settings",component:dt,children:[{name:"settings_general",path:"",components:{main:yt}}]},{path:"/aboutus",component:$t,children:[{name:"aboutus_aboutus",path:"",components:{main:Nt}}]},{name:"welcome",path:"/welcome",component:St}],linkActiveClass:"active"}),Wt=Ft,Rt=e("619c"),Vt=e("e37d"),Gt=e("bc3a"),Yt=e.n(Gt),qt=e("a7fe"),Kt=e.n(qt),Jt=e("7bb1"),Qt=e("f206");n["default"].config.devtools=!0,n["default"].component("ToggleButton",Qt["ToggleButton"]),n["default"].use(Rt["a"]),n["default"].use(Jt["a"]),n["default"].use(Vt["a"],{defaultClass:"seedprod-tooltip"}),n["default"].use(Kt.a,Yt.a),n["default"].config.productionTip=!1;var Xt={show_topbar_cta:seedprod_data_admin.show_topbar_cta,show_inline_cta:seedprod_data_admin.show_inline_cta,seedprod_unsupported_feature:seedprod_data_admin.seedprod_unsupported_feature,seedprod_csp4_migrated:seedprod_data_admin.seedprod_csp4_migrated,seedprod_csp4_imported:seedprod_data_admin.seedprod_csp4_imported,seedprod_cspv5_migrated:seedprod_data_admin.seedprod_cspv5_migrated,seedprod_cspv5_imported:seedprod_data_admin.seedprod_cspv5_imported,page_count:seedprod_data_admin.page_count,subscriber_count:seedprod_data_admin.subscriber_count,notifications:seedprod_data_admin.notifications,csp_id:seedprod_data_admin.csp_id,mmp_id:seedprod_data_admin.mmp_id,p404_id:seedprod_data_admin.p404_id,loginp_id:seedprod_data_admin.loginp_id,csp_uuid:seedprod_data_admin.csp_uuid,mmp_uuid:seedprod_data_admin.mmp_uuid,p404_uuid:seedprod_data_admin.p404_uuid,loginp_uuid:seedprod_data_admin.loginp_uuid,csp_preview_url:seedprod_data_admin.csp_preview_url,mmp_preview_url:seedprod_data_admin.mmp_preview_url,p404_preview_url:seedprod_data_admin.p404_preview_url,loginp_preview_url:seedprod_data_admin.loginp_preview_url,api_token:seedprod_data_admin.api_token,license_key:seedprod_data_admin.license_key,license_name:seedprod_data_admin.license_name,per:seedprod_data_admin.per,page_path:seedprod_data_admin.page_path,name:seedprod_data_admin.name,email:seedprod_data_admin.email,upgrade_link:seedprod_data_admin.upgrade_link,doing_ajax:!1,plugin_path:seedprod_data_admin.plugin_path,home_url:seedprod_data_admin.home_url,settings:seedprod_data_admin.settings,app_settings:seedprod_data_admin.app_settings,template_dev_mode:seedprod_data_admin.template_dev_mode,settings_page_meta:{lclass:seedprod_data_admin.lclass,lmsg:seedprod_data_admin.lmsg,button:"",api_key:seedprod_data_admin.api_key,timezones:seedprod_data_admin.timezones,dismiss_settings_lite_cta:seedprod_data_admin.dismiss_settings_lite_cta}};window.seedprod_store_admin=Xt;new n["default"]({router:Wt,mounted:function(){},render:function(t){return t(m)}}).$mount("#seedprod-vue-app");var Zt=function(){iFrameResize({log:!1,checkOrigin:!1},"#inline-help")};window.help_iframe=Zt}});
|
public/lite/vue-backend/js/chunk-common.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-common"],{b132:function(e,t,s){"use strict";s.d(t,"a",function(){return f});var o,n=s("bd86"),i=s("7618"),r=(s("7f7f"),s("f499")),a=s.n(r),l=(s("28a5"),s("ac6a"),s("6762"),s("2fdb"),s("a481"),s("e814")),c=s.n(l),d=(s("6b54"),s("66cb")),h=s.n(d),u=s("2ef0"),g=s.n(u),p=s("4328"),m=s.n(p),b=s("561c"),f={methods:(o={set_default_val:function(e,t,s){void 0==e[t]&&this.$set(e,t,s)},update_head_css:g.a.debounce(function(e){var t=h()(this.shared.settings.document.settings.linkColor).darken().toString();this.shared.settings.document.settings.linkDarkerColor=t;var s="";""!=this.shared.settings.document.settings.bgImage&&(s="url('"+this.shared.settings.document.settings.bgImage+"')"),""!=this.shared.settings.document.settings.bgImage&&""!=this.shared.settings.document.settings.bgDimming&&(s="linear-gradient(0deg, rgba(0,0,0,0."+this.shared.settings.document.settings.bgDimming+"), rgba(0,0,0,0."+this.shared.settings.document.settings.bgDimming+")),url('"+this.shared.settings.document.settings.bgImage+"')"),""==s&&"g"==this.shared.settings.document.settings.bgStyle&&(s="linear"==this.shared.settings.document.settings.bgGradient.type?"linear-gradient("+this.shared.settings.document.settings.bgGradient.angle+"deg, "+this.shared.settings.document.settings.bgGradient.color1+" "+this.shared.settings.document.settings.bgGradient.color1location+"%, "+this.shared.settings.document.settings.bgGradient.color2+" "+this.shared.settings.document.settings.bgGradient.color2location+"%)":"radial-gradient(circle at "+this.shared.settings.document.settings.bgGradient.position+", "+this.shared.settings.document.settings.bgGradient.color1+" "+this.shared.settings.document.settings.bgGradient.color1location+"%, "+this.shared.settings.document.settings.bgGradient.color2+" "+this.shared.settings.document.settings.bgGradient.color2location+"%)");var o="#sp-page{color:"+this.shared.settings.document.settings.textColor+"} #sp-page .sp-header-tag-h1,#sp-page .sp-header-tag-h2,#sp-page .sp-header-tag-h3,#sp-page .sp-header-tag-h4,#sp-page .sp-header-tag-h5,#sp-page .sp-header-tag-h6{color:"+this.shared.settings.document.settings.headerColor+"}#sp-page h1,#sp-page h2,#sp-page h3,#sp-page h4,#sp-page h5,#sp-page h6{color:"+this.shared.settings.document.settings.headerColor+"; font-family:"+this.font_render(this.shared.settings.document.settings.headerFont)+";font-weight:"+this.font_variant_render(this.shared.settings.document.settings.headerFontVariant,"weight")+";font-style:"+this.font_variant_render(this.shared.settings.document.settings.headerFontVariant,"style")+"} #sp-page a{color:"+this.shared.settings.document.settings.linkColor+"} #sp-page a:hover{color:"+t+"}#sp-page .btn{background-color:"+this.shared.settings.document.settings.buttonColor+"}body{background-color:"+this.shared.settings.document.settings.bgColor+"; background-image:"+s+";}",n=this,i="",r=m.a.stringify({css:this.shared.settings.document.settings.customCss});n.axios.post(seedprod_get_namespaced_custom_css_url,r,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(e){i=e.data,jQuery("#tmp-custom-css-style").remove(),jQuery("head").append("<style id='tmp-custom-css-style' type='text/css'></style>"),jQuery("#tmp-custom-css-style").html(o+i)}),this.shared.settings.document.settings.headCss=o},100),highlight_option_target:function(e){this.shared.highlight_option_target=e},moving:function(e,t){},scroll:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){var t=jQuery("#seedprod-builder-view").scrollTop();jQuery("#seedprod-builder-view").scrollTop(t+e),this.shared.stop||setTimeout(function(){scroll(e)},20)}),start_move:function(){this.shared.is_moving=!0},end_move:function(e){this.shared.is_moving=!1,this.shared.stop=!1},mousePosition:function(e){console.log("event",e)},width_height_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^\d+$/.test(e)&&(e+="px"),e},text_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000",s="",o="0,0,0",n=h()(t);return n.getLuminance(),1==e&&(s="1px 1px 0px rgba("+o+",0.5)"),2==e&&(s="1px 1px 3px rgba("+o+",0.5)"),3==e&&(s="2px 2px 4px rgba("+o+",0.4)"),4==e&&(s="3px 3px 6px rgba("+o+",0.3)"),5==e&&(s="3px 4px 12px rgba("+o+",0.3)"),6==e&&(s="5px 5px 20px rgba("+o+",0.3)"),s},divider_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="";return 1==e&&(t="0 1px 1px rgba(0,0,0,0.2)"),2==e&&(t="0 2px 2px rgba(0,0,0,0.4)"),3==e&&(t="0 4px 4px rgba(0,0,0,0.4)"),4==e&&(t="0 6px 6px rgba(0,0,0,0.4)"),t},box_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="";return 1==e&&(t="0 1px 2px 0 rgba(0, 0, 0, 0.5)"),2==e&&(t="0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.6)"),3==e&&(t="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.6)"),4==e&&(t="0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.5)"),5==e&&(t="0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.4)"),6==e&&(t="0 25px 50px -12px rgba(0, 0, 0, 0.25)"),7==e&&(t="0 10px 6px -6px #777"),t},border_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return""==e&&(e="1px"),""==t&&(t="solid"),"#666666"==s&&(s="#666666"),e+"px "+t+" "+s},font_variant_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"weight",s="",o="";return""!=e&&("weight"==t&&(s=c()(e)),"style"==t&&(o=e.replace(/[0-9]/g,""),""==o&&(o="normal"))),"weight"==t?s:o},font_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""!=e&&!1===e.includes(",")&&(e="'"+e+"'"),e}},Object(n["a"])(o,"border_render",function(e,t,s){return""==e||0==e||""==s?"":e+"px "+t+" "+s}),Object(n["a"])(o,"padding_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return""==e&&""==t&&""==s&&""==o?(e=10,s=10,o=10,t=10,e+"px "+t+"px "+s+"px "+o+"px "):(""==e&&(e=0),""==t&&(t=0),""==s&&(s=0),""==o&&(o=0),e+"px "+t+"px "+s+"px "+o+"px ")}),Object(n["a"])(o,"border_radius_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return""==e&&""==t&&""==s&&""==o?(e=0,s=0,o=0,t=0,e+"px "+t+"px "+s+"px "+o+"px "):(""==e&&(e=0),""==t&&(t=0),""==s&&(s=0),""==o&&(o=0),e+"px "+t+"px "+s+"px "+o+"px ")}),Object(n["a"])(o,"align_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"align",s="";return"align"==t&&("left"==e&&(s="left"),"right"==e&&(s="right"),"center"==e&&(s="center")),"width"==t&&(s="full"==this.block.settings.align?"100%":"auto"),s}),Object(n["a"])(o,"load_font",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(""!=e&&this.shared.setup_page_meta.googlefonts["Google Fonts"][e]){if(""!=t){var s={},o=!1;try{this.shared.setup_page_meta.googlefonts["Google Fonts"][e].variants.forEach(function(e){if(e.id==t)throw s})}catch(r){o=!0}!1===o&&(t="")}var n="https://fonts.googleapis.com/css?family="+e.split(" ").join("+")+":"+t+"&display=swap",i=document.createElement("link");i.rel="stylesheet",i.href=n,document.head.appendChild(i)}}),Object(n["a"])(o,"add_section",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s={id:this.uid(),type:"section",rows:[],settings:JSON.parse(a()(this.shared.block_templates.section))};this.shared.settings.document.sections.splice(t+1,0,s),this.focus_block(s.id,"bottom"),this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"focus_block",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",s=!0;"bottom"===t&&(s=!1),this.$nextTick(function(){var t=this.shared.code_container;if(void 0!==e&&null!==e)try{t.querySelector("#sp-"+e).scrollIntoView(s)}catch(o){}})}),Object(n["a"])(o,"add_row",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o={id:this.uid(),type:"row",colType:"1-col",cols:[],settings:JSON.parse(a()(this.shared.block_templates.row))};this.shared.settings.document.sections[t].rows.splice(s+1,0,o),this.focus_block(o.id,"bottom"),this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"generate_cols",function(e){var t,s;"1-col"==e&&(t=1),"2-col"!=e&&"left-sidebar"!=e&&"right-sidebar"!=e||(t=2),"3-col"==e&&(t=3),"4-col"==e&&(t=4),"5-col"==e&&(t=5),"6-col"==e&&(t=6);var o=[];for(s=0;s<t;s++){var n={id:this.uid(),type:"col",blocks:[],settings:JSON.parse(a()(this.shared.block_templates.col))};("left-sidebar"==e&&0==s||"right-sidebar"==e&&1==s)&&(n.settings.colWidth=35),("left-sidebar"==e&&1==s||"right-sidebar"==e&&0==s)&&(n.settings.colWidth=65),o.push(n)}return o}),Object(n["a"])(o,"add_cols",function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this.generate_cols(e);this.shared.settings.document.sections[s].rows[o].cols=n}),Object(n["a"])(o,"goto",function(e){this.$route.name!==e&&this.$router.push({name:e})}),Object(n["a"])(o,"add_block",function(){this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"duplicate_element",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=JSON.parse(a()(e));if(null!==t&&null!==s&&null!==o&&null!==n)i.id=this.uid(),this.shared.settings.document.sections[t].rows[s].cols[o].blocks.splice(n+1,0,i);else if(null!==t&&null!==s){var r=this;i.id=this.uid(),i.cols.forEach(function(e){e.id=r.uid(),e.blocks.forEach(function(e){e.id=r.uid()})}),this.shared.settings.document.sections[t].rows.splice(s+1,0,i)}else if(null!==t){var l=this;i.id=this.uid(),i.rows.forEach(function(e){e.id=l.uid(),e.cols.forEach(function(e){e.id=l.uid(),e.blocks.forEach(function(e){e.id=l.uid()})})}),this.shared.settings.document.sections.splice(t+1,0,i)}this.focus_block(i.id),this.edit_block(i.id,null,!0)}),Object(n["a"])(o,"delete_blank_element",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3];null!==e&&null!==t?this.$delete(this.shared.settings.document.sections[e].rows,t):null!==e&&this.$delete(this.shared.settings.document.sections,e)}),Object(n["a"])(o,"delete_element",function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.$swal({imageUrl:this.shared.plugin_path+"public/img/delete.png",title:Object(b["a"])("Are you sure you want to delete?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Object(b["a"])("Yes, delete it!","coming-soon")}).then(function(i){i.value&&(null!==t&&null!==s&&null!==o&&null!==n?e.$delete(e.shared.settings.document.sections[t].rows[s].cols[o].blocks,n):null!==t&&null!==s?1==e.shared.settings.document.sections[t].rows.length?e.shared.settings.document.sections[t].rows[0].cols=[]:e.$delete(e.shared.settings.document.sections[t].rows,s):null!==t&&e.$delete(e.shared.settings.document.sections,t),e.$router.push({name:"setup_block_options"}),e.$swal({imageUrl:e.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Deleted",toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3}))})}),Object(n["a"])(o,"edit_block",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(this.shared.highlight_option_target==e||!1!==s)&&(0!==t&&void(this.$route.params.blockid!=e&&this.$router.push({name:"setup_block_options",params:{id:this.shared.lpage.id,blockid:e}})))}),Object(n["a"])(o,"uid",function(){var e=String.fromCharCode(97+Math.floor(26*Math.random()))+Math.random().toString(36).substring(2,7).toLowerCase();return e}),Object(n["a"])(o,"help_iframe",function(e){var t=e.split("#"),s="";t[1]&&(e=t[0],s=t[1]),this.$swal({width:600,html:"<iframe class='iframe_loading' id='inline-help' src='https://staging.seedprod.com/docs/"+e+"?iframe=1&hash="+s+"' style='width:100%;' onload='help_iframe()'></iframe>",toast:!1,showCancelButton:!0,cancelButtonText:"Close",confirmButtonText:Object(b["a"])('Visit Docs <i class="fas fa-external-link-alt"></i>',"coming-soon")}).then(function(t){if(t.value){var o="https://staging.seedprod.com/docs/"+e+"#"+s;window.open(o,"_blank")}})}),Object(n["a"])(o,"show_upgrade_notice",function(e,t){var s=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"link",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this;n?(e=Object(b["a"])("Upgrade to PRO","coming-soon"),t=Object(b["a"])("Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features.","coming-soon")):(e+=Object(b["a"])(" is a PRO Feature","coming-soon"),t=Object(b["a"])("We're sorry, the ","coming-soon")+t+Object(b["a"])(" feature is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features.","coming-soon")),this.$swal({customContainerClass:"seedprod-upgrade-popup",imageUrl:i.shared.plugin_path+"public/img/lock.svg",title:e,text:t,type:null,showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:Object(b["a"])("UPGRADE TO PRO","coming-soon"),showCloseButton:!0,footer:'<i class="fas fa-check-circle"></i><div style="text-align:center;margin-left:40px;margin-right:40px;">'+Object(b["a"])("<strong>Bonus:</strong> SeedProd Lite users get a discount off the regular price, automatically applied at checkout.","coming-soon")+"</div>"}).then(function(e){e.value&&(window.open(s.shared.upgrade_link+o,"_blank"),s.$swal.fire({customContainerClass:"seedprod-moreinfo-popup",imageUrl:i.shared.plugin_path+"public/img/info-with-circle.svg",type:null,html:Object(b["a"])("Thanks for your interest in SeedProd Pro!<br>If you have any questions or issues just <a href='https://www.seedprod.com/?contact=1' target='_blank'>let us know</a>.<br><br>After purchasing SeedProd Pro, you'll need to download and install the Pro version of the plugin, and then remove the free plugin. <br><br>(Don't worry, all your settings will be preserved.)","coming-soon")}))})}),Object(n["a"])(o,"show_uplock_notice",function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this;s?(e=Object(b["a"])("Upgrade to PRO","coming-soon"),t=Object(b["a"])("Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features.","coming-soon")):(e=Object(b["a"])("Upgrade to Unlock ","coming-soon")+e,t=Object(b["a"])("We're sorry, the ","coming-soon")+t+Object(b["a"])(" feature is not available on your plan. Please upgrade your plan to unlock this feature and more!","coming-soon")),this.$swal({customContainerClass:"seedprod-upgrade-popup",imageUrl:o.shared.plugin_path+"public/img/lock.svg",title:e,text:t,type:null,showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:"UPGRADE",showCloseButton:!0,footer:Object(b["a"])("Upgrade with just a click of a button!","coming-soon")}).then(function(e){e.value&&window.open("https://app.seedprod.com/upgrade-license?license_key="+o.shared.license_key+"&api_token="+o.shared.api_token,"_blank")})}),Object(n["a"])(o,"debounce_update_mobile_css",g.a.debounce(function(e){jQuery("#tmp-custom-mobile-css-style").remove(),jQuery("head").append("<style id='tmp-custom-mobile-css-style' type='text/css'></style>"),jQuery("#tmp-custom-mobile-css-style").html(this.generate_mobile_css())},100)),Object(n["a"])(o,"update_mobile_css",function(){jQuery("#tmp-custom-mobile-css-style").remove(),jQuery("head").append("<style id='tmp-custom-mobile-css-style' type='text/css'></style>"),jQuery("#tmp-custom-mobile-css-style").html(this.generate_mobile_css())}),Object(n["a"])(o,"generate_mobile_css",function(){var e="",t=this.traverse(seedprod_store.settings.document,this.process);return t.forEach(function(t){var s=t.split(",");if(!1===lodash.isEmpty(s[2])){o=="sp-"+s[0]&&!1;var o="sp-"+s[0],n=lodash.kebabCase(s[1].replace("_mobile","")),i=s[2];e=e+".sp-mobile-view #"+o+".sp-css-target{",e="line-height"==n?e+n+":"+i+" !important;":e+n+":"+i+"px !important;",e+=" }",e=e+".sp-mobile-view #"+o+" .sp-css-target{",e="line-height"==n?e+n+":"+i+" !important;":e+n+":"+i+"px !important;",e+=" }"}}),this.shared.settings.document.settings.mobileCss=e,e}),Object(n["a"])(o,"process",function(e,t,s,o){-1!==e.indexOf("_mobile")&&!1===!!~o.indexOf(t)&&o.push(s+","+e+","+t)}),Object(n["a"])(o,"traverse",function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];for(var n in e)0===n.indexOf("id")&&(s=e[n]),t.apply(this,[n,e[n],s,o]),null!==e[n]&&"object"==Object(i["a"])(e[n])&&this.traverse(e[n],t,s,o);return o}),Object(n["a"])(o,"debounce_update_placeholder_css",g.a.debounce(function(e){jQuery("#tmp-custom-placeholder-css-style").remove(),jQuery("head").append("<style id='tmp-custom-placeholder-css-style' type='text/css'></style>"),jQuery("#tmp-custom-placeholder-css-style").html(this.generate_placeholder_css())},100)),Object(n["a"])(o,"update_placeholder_css",function(){jQuery("#tmp-custom-placeholder-css-style").remove(),jQuery("head").append("<style id='tmp-custom-placeholder-css-style' type='text/css'></style>"),jQuery("#tmp-custom-placeholder-css-style").html(this.generate_placeholder_css())}),Object(n["a"])(o,"generate_placeholder_css",function(){var e="",t=this.traverse(seedprod_store.settings.document,this.process_placeholder);return t.forEach(function(t){var s=t.split(",");if(!1===lodash.isEmpty(s[2])){o=="sp-"+s[0]&&!1;var o="sp-"+s[0],n=s[2],i=h()(n).setAlpha(.7);e=e+"input::placeholder, #"+o+" input::placeholder {",e=e+"color:"+i,e+=" }"}}),this.shared.settings.document.settings.placeholderCss=e,e}),Object(n["a"])(o,"process_placeholder",function(e,t,s,o){-1!==e.indexOf("fieldTextColor")&&!1===!!~o.indexOf(t)&&o.push(s+","+e+","+t)}),o)}}}]);
|
1 |
+
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-common"],{b132:function(e,t,s){"use strict";s.d(t,"a",function(){return f});var o,n=s("bd86"),i=s("7618"),r=(s("7f7f"),s("f499")),a=s.n(r),l=(s("28a5"),s("ac6a"),s("6762"),s("2fdb"),s("a481"),s("e814")),c=s.n(l),d=(s("6b54"),s("66cb")),h=s.n(d),u=s("2ef0"),g=s.n(u),p=s("4328"),m=s.n(p),b=s("561c"),f={methods:(o={set_default_val:function(e,t,s){void 0==e[t]&&this.$set(e,t,s)},update_head_css:g.a.debounce(function(e){var t=h()(this.shared.settings.document.settings.linkColor).darken().toString();this.shared.settings.document.settings.linkDarkerColor=t;var s="";""!=this.shared.settings.document.settings.bgImage&&(s="url('"+this.shared.settings.document.settings.bgImage+"')"),""!=this.shared.settings.document.settings.bgImage&&""!=this.shared.settings.document.settings.bgDimming&&(s="linear-gradient(0deg, rgba(0,0,0,0."+this.shared.settings.document.settings.bgDimming+"), rgba(0,0,0,0."+this.shared.settings.document.settings.bgDimming+")),url('"+this.shared.settings.document.settings.bgImage+"')"),""==s&&"g"==this.shared.settings.document.settings.bgStyle&&(s="linear"==this.shared.settings.document.settings.bgGradient.type?"linear-gradient("+this.shared.settings.document.settings.bgGradient.angle+"deg, "+this.shared.settings.document.settings.bgGradient.color1+" "+this.shared.settings.document.settings.bgGradient.color1location+"%, "+this.shared.settings.document.settings.bgGradient.color2+" "+this.shared.settings.document.settings.bgGradient.color2location+"%)":"radial-gradient(circle at "+this.shared.settings.document.settings.bgGradient.position+", "+this.shared.settings.document.settings.bgGradient.color1+" "+this.shared.settings.document.settings.bgGradient.color1location+"%, "+this.shared.settings.document.settings.bgGradient.color2+" "+this.shared.settings.document.settings.bgGradient.color2location+"%)");var o="#sp-page{color:"+this.shared.settings.document.settings.textColor+"} #sp-page .sp-header-tag-h1,#sp-page .sp-header-tag-h2,#sp-page .sp-header-tag-h3,#sp-page .sp-header-tag-h4,#sp-page .sp-header-tag-h5,#sp-page .sp-header-tag-h6{color:"+this.shared.settings.document.settings.headerColor+"}#sp-page h1,#sp-page h2,#sp-page h3,#sp-page h4,#sp-page h5,#sp-page h6{color:"+this.shared.settings.document.settings.headerColor+"; font-family:"+this.font_render(this.shared.settings.document.settings.headerFont)+";font-weight:"+this.font_variant_render(this.shared.settings.document.settings.headerFontVariant,"weight")+";font-style:"+this.font_variant_render(this.shared.settings.document.settings.headerFontVariant,"style")+"} #sp-page a{color:"+this.shared.settings.document.settings.linkColor+"} #sp-page a:hover{color:"+t+"}#sp-page .btn{background-color:"+this.shared.settings.document.settings.buttonColor+"}body{background-color:"+this.shared.settings.document.settings.bgColor+"; background-image:"+s+";}",n=this,i="",r=m.a.stringify({css:this.shared.settings.document.settings.customCss});n.axios.post(seedprod_get_namespaced_custom_css_url,r,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(e){i=e.data,jQuery("#tmp-custom-css-style").remove(),jQuery("head").append("<style id='tmp-custom-css-style' type='text/css'></style>"),jQuery("#tmp-custom-css-style").html(o+i)}),this.shared.settings.document.settings.headCss=o},100),highlight_option_target:function(e){this.shared.highlight_option_target=e},moving:function(e,t){},scroll:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){var t=jQuery("#seedprod-builder-view").scrollTop();jQuery("#seedprod-builder-view").scrollTop(t+e),this.shared.stop||setTimeout(function(){scroll(e)},20)}),start_move:function(){this.shared.is_moving=!0},end_move:function(e){this.shared.is_moving=!1,this.shared.stop=!1},mousePosition:function(e){console.log("event",e)},width_height_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^\d+$/.test(e)&&(e+="px"),e},text_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000",s="",o="0,0,0",n=h()(t);return n.getLuminance(),1==e&&(s="1px 1px 0px rgba("+o+",0.5)"),2==e&&(s="1px 1px 3px rgba("+o+",0.5)"),3==e&&(s="2px 2px 4px rgba("+o+",0.4)"),4==e&&(s="3px 3px 6px rgba("+o+",0.3)"),5==e&&(s="3px 4px 12px rgba("+o+",0.3)"),6==e&&(s="5px 5px 20px rgba("+o+",0.3)"),s},divider_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="";return 1==e&&(t="0 1px 1px rgba(0,0,0,0.2)"),2==e&&(t="0 2px 2px rgba(0,0,0,0.4)"),3==e&&(t="0 4px 4px rgba(0,0,0,0.4)"),4==e&&(t="0 6px 6px rgba(0,0,0,0.4)"),t},box_shadow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="";return 1==e&&(t="0 1px 2px 0 rgba(0, 0, 0, 0.5)"),2==e&&(t="0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.6)"),3==e&&(t="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.6)"),4==e&&(t="0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.5)"),5==e&&(t="0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.4)"),6==e&&(t="0 25px 50px -12px rgba(0, 0, 0, 0.25)"),7==e&&(t="0 10px 6px -6px #777"),t},border_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return""==e&&(e="1px"),""==t&&(t="solid"),"#666666"==s&&(s="#666666"),e+"px "+t+" "+s},font_variant_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"weight",s="",o="";return""!=e&&("weight"==t&&(s=c()(e)),"style"==t&&(o=e.replace(/[0-9]/g,""),""==o&&(o="normal"))),"weight"==t?s:o},font_render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""!=e&&!1===e.includes(",")&&(e="'"+e+"'"),e}},Object(n["a"])(o,"border_render",function(e,t,s){return""==e||0==e||""==s?"":e+"px "+t+" "+s}),Object(n["a"])(o,"padding_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return""==e&&""==t&&""==s&&""==o?(e=10,s=10,o=10,t=10,e+"px "+t+"px "+s+"px "+o+"px "):(""==e&&(e=0),""==t&&(t=0),""==s&&(s=0),""==o&&(o=0),e+"px "+t+"px "+s+"px "+o+"px ")}),Object(n["a"])(o,"border_radius_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return""==e&&""==t&&""==s&&""==o?(e=0,s=0,o=0,t=0,e+"px "+t+"px "+s+"px "+o+"px "):(""==e&&(e=0),""==t&&(t=0),""==s&&(s=0),""==o&&(o=0),e+"px "+t+"px "+s+"px "+o+"px ")}),Object(n["a"])(o,"align_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"align",s="";return"align"==t&&("left"==e&&(s="left"),"right"==e&&(s="right"),"center"==e&&(s="center")),"width"==t&&(s="full"==this.block.settings.align?"100%":"auto"),s}),Object(n["a"])(o,"align_flex_render",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"align",s="";return"align"==t&&("left"==e&&(s="flex-start"),"right"==e&&(s="flex-end"),"center"==e&&(s="center")),"width"==t&&(s="full"==this.block.settings.align?"100%":"auto"),s}),Object(n["a"])(o,"load_font",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(""!=e&&this.shared.setup_page_meta.googlefonts["Google Fonts"][e]){if(""!=t){var s={},o=!1;try{this.shared.setup_page_meta.googlefonts["Google Fonts"][e].variants.forEach(function(e){if(e.id==t)throw s})}catch(r){o=!0}!1===o&&(t="")}var n="https://fonts.googleapis.com/css?family="+e.split(" ").join("+")+":"+t+"&display=swap",i=document.createElement("link");i.rel="stylesheet",i.href=n,document.head.appendChild(i)}}),Object(n["a"])(o,"add_section",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s={id:this.uid(),type:"section",rows:[],settings:JSON.parse(a()(this.shared.block_templates.section))};this.shared.settings.document.sections.splice(t+1,0,s),this.focus_block(s.id,"bottom"),this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"focus_block",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",s=!0;"bottom"===t&&(s=!1),this.$nextTick(function(){var t=this.shared.code_container;if(void 0!==e&&null!==e)try{t.querySelector("#sp-"+e).scrollIntoView(s)}catch(o){}})}),Object(n["a"])(o,"add_row",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o={id:this.uid(),type:"row",colType:"1-col",cols:[],settings:JSON.parse(a()(this.shared.block_templates.row))};this.shared.settings.document.sections[t].rows.splice(s+1,0,o),this.focus_block(o.id,"bottom"),this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"generate_cols",function(e){var t,s;"1-col"==e&&(t=1),"2-col"!=e&&"left-sidebar"!=e&&"right-sidebar"!=e||(t=2),"3-col"==e&&(t=3),"4-col"==e&&(t=4),"5-col"==e&&(t=5),"6-col"==e&&(t=6);var o=[];for(s=0;s<t;s++){var n={id:this.uid(),type:"col",blocks:[],settings:JSON.parse(a()(this.shared.block_templates.col))};("left-sidebar"==e&&0==s||"right-sidebar"==e&&1==s)&&(n.settings.colWidth=35),("left-sidebar"==e&&1==s||"right-sidebar"==e&&0==s)&&(n.settings.colWidth=65),o.push(n)}return o}),Object(n["a"])(o,"add_cols",function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this.generate_cols(e);this.shared.settings.document.sections[s].rows[o].cols=n}),Object(n["a"])(o,"goto",function(e){this.$route.name!==e&&this.$router.push({name:e})}),Object(n["a"])(o,"add_block",function(){this.$router.push({name:"setup_block_options"})}),Object(n["a"])(o,"duplicate_element",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=JSON.parse(a()(e));if(null!==t&&null!==s&&null!==o&&null!==n)i.id=this.uid(),this.shared.settings.document.sections[t].rows[s].cols[o].blocks.splice(n+1,0,i);else if(null!==t&&null!==s){var r=this;i.id=this.uid(),i.cols.forEach(function(e){e.id=r.uid(),e.blocks.forEach(function(e){e.id=r.uid()})}),this.shared.settings.document.sections[t].rows.splice(s+1,0,i)}else if(null!==t){var l=this;i.id=this.uid(),i.rows.forEach(function(e){e.id=l.uid(),e.cols.forEach(function(e){e.id=l.uid(),e.blocks.forEach(function(e){e.id=l.uid()})})}),this.shared.settings.document.sections.splice(t+1,0,i)}this.focus_block(i.id),this.edit_block(i.id,null,!0)}),Object(n["a"])(o,"delete_blank_element",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3];null!==e&&null!==t?this.$delete(this.shared.settings.document.sections[e].rows,t):null!==e&&this.$delete(this.shared.settings.document.sections,e)}),Object(n["a"])(o,"delete_element",function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.$swal({title:Object(b["a"])("Are you sure you want to delete?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Object(b["a"])("Yes, delete it!","coming-soon")}).then(function(i){i.value&&(null!==t&&null!==s&&null!==o&&null!==n?e.$delete(e.shared.settings.document.sections[t].rows[s].cols[o].blocks,n):null!==t&&null!==s?1==e.shared.settings.document.sections[t].rows.length?e.shared.settings.document.sections[t].rows[0].cols=[]:e.$delete(e.shared.settings.document.sections[t].rows,s):null!==t&&e.$delete(e.shared.settings.document.sections,t),e.$router.push({name:"setup_block_options"}),e.$swal({imageUrl:e.shared.plugin_path+"public/svg/success-24px-white.svg",text:"Deleted",toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3}))})}),Object(n["a"])(o,"edit_block",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(this.shared.highlight_option_target==e||!1!==s)&&(0!==t&&void(this.$route.params.blockid!=e&&this.$router.push({name:"setup_block_options",params:{id:this.shared.lpage.id,blockid:e}})))}),Object(n["a"])(o,"uid",function(){var e=String.fromCharCode(97+Math.floor(26*Math.random()))+Math.random().toString(36).substring(2,7).toLowerCase();return e}),Object(n["a"])(o,"help_iframe",function(e){var t=e.split("#"),s="";t[1]&&(e=t[0],s=t[1]),this.$swal({width:600,html:"<iframe class='iframe_loading' id='inline-help' src='https://staging.seedprod.com/docs/"+e+"?iframe=1&hash="+s+"' style='width:100%;' onload='help_iframe()'></iframe>",toast:!1,showCancelButton:!0,cancelButtonText:"Close",confirmButtonText:Object(b["a"])('Visit Docs <i class="fas fa-external-link-alt"></i>',"coming-soon")}).then(function(t){if(t.value){var o="https://staging.seedprod.com/docs/"+e+"#"+s;window.open(o,"_blank")}})}),Object(n["a"])(o,"show_upgrade_notice",function(e,t){var s=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"link",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this;n?(e=Object(b["a"])("Upgrade to PRO","coming-soon"),t=Object(b["a"])("Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features.","coming-soon")):(e+=Object(b["a"])(" is a PRO Feature","coming-soon"),t=Object(b["a"])("We're sorry, the ","coming-soon")+t+Object(b["a"])(" feature is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features.","coming-soon")),this.$swal({customContainerClass:"seedprod-upgrade-popup",imageUrl:i.shared.plugin_path+"public/img/lock.svg",title:e,text:t,type:null,showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:Object(b["a"])("UPGRADE TO PRO","coming-soon"),showCloseButton:!0,footer:'<i class="fas fa-check-circle"></i><div style="text-align:center;margin-left:40px;margin-right:40px;">'+Object(b["a"])("<strong>Bonus:</strong> SeedProd Lite users get a discount off the regular price, automatically applied at checkout.","coming-soon")+"</div>"}).then(function(e){e.value&&(window.open(s.shared.upgrade_link+o,"_blank"),s.$swal.fire({customContainerClass:"seedprod-moreinfo-popup",imageUrl:i.shared.plugin_path+"public/img/info-with-circle.svg",type:null,html:Object(b["a"])("Thanks for your interest in SeedProd Pro!<br>If you have any questions or issues just <a href='https://www.seedprod.com/?contact=1' target='_blank'>let us know</a>.<br><br>After purchasing SeedProd Pro, you'll need to download and install the Pro version of the plugin, and then remove the free plugin. <br><br>(Don't worry, all your settings will be preserved.)","coming-soon")}))})}),Object(n["a"])(o,"show_uplock_notice",function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this;s?(e=Object(b["a"])("Upgrade to PRO","coming-soon"),t=Object(b["a"])("Increase traffic, engagement, and get more email subscribers. Click below to learn more about all our awesome features.","coming-soon")):(e=Object(b["a"])("Upgrade to Unlock ","coming-soon")+e,t=Object(b["a"])("We're sorry, the ","coming-soon")+t+Object(b["a"])(" feature is not available on your plan. Please upgrade your plan to unlock this feature and more!","coming-soon")),this.$swal({customContainerClass:"seedprod-upgrade-popup",imageUrl:o.shared.plugin_path+"public/img/lock.svg",title:e,text:t,type:null,showCancelButton:!1,confirmButtonColor:"#4CAF50",cancelButtonColor:"#d33",confirmButtonText:"UPGRADE",showCloseButton:!0,footer:Object(b["a"])("Upgrade with just a click of a button!","coming-soon")}).then(function(e){e.value&&window.open("https://app.seedprod.com/upgrade-license?license_key="+o.shared.license_key+"&api_token="+o.shared.api_token,"_blank")})}),Object(n["a"])(o,"debounce_update_mobile_css",g.a.debounce(function(e){jQuery("#tmp-custom-mobile-css-style").remove(),jQuery("head").append("<style id='tmp-custom-mobile-css-style' type='text/css'></style>"),jQuery("#tmp-custom-mobile-css-style").html(this.generate_mobile_css())},100)),Object(n["a"])(o,"update_mobile_css",function(){jQuery("#tmp-custom-mobile-css-style").remove(),jQuery("head").append("<style id='tmp-custom-mobile-css-style' type='text/css'></style>"),jQuery("#tmp-custom-mobile-css-style").html(this.generate_mobile_css())}),Object(n["a"])(o,"generate_mobile_css",function(){var e="",t=this.traverse(seedprod_store.settings.document,this.process);return t.forEach(function(t){var s=t.split(",");if(!1===lodash.isEmpty(s[2])){o=="sp-"+s[0]&&!1;var o="sp-"+s[0],n=lodash.kebabCase(s[1].replace("_mobile","")),i=s[2];e=e+".sp-mobile-view #"+o+".sp-css-target{",e="line-height"==n?e+n+":"+i+" !important;":e+n+":"+i+"px !important;",e+=" }",e=e+".sp-mobile-view #"+o+" .sp-css-target{",e="line-height"==n?e+n+":"+i+" !important;":e+n+":"+i+"px !important;",e+=" }"}}),this.shared.settings.document.settings.mobileCss=e,e}),Object(n["a"])(o,"process",function(e,t,s,o){-1!==e.indexOf("_mobile")&&!1===!!~o.indexOf(t)&&o.push(s+","+e+","+t)}),Object(n["a"])(o,"traverse",function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];for(var n in e)0===n.indexOf("id")&&(s=e[n]),t.apply(this,[n,e[n],s,o]),null!==e[n]&&"object"==Object(i["a"])(e[n])&&this.traverse(e[n],t,s,o);return o}),Object(n["a"])(o,"debounce_update_placeholder_css",g.a.debounce(function(e){jQuery("#tmp-custom-placeholder-css-style").remove(),jQuery("head").append("<style id='tmp-custom-placeholder-css-style' type='text/css'></style>"),jQuery("#tmp-custom-placeholder-css-style").html(this.generate_placeholder_css())},100)),Object(n["a"])(o,"update_placeholder_css",function(){jQuery("#tmp-custom-placeholder-css-style").remove(),jQuery("head").append("<style id='tmp-custom-placeholder-css-style' type='text/css'></style>"),jQuery("#tmp-custom-placeholder-css-style").html(this.generate_placeholder_css())}),Object(n["a"])(o,"generate_placeholder_css",function(){var e="",t=this.traverse(seedprod_store.settings.document,this.process_placeholder);return t.forEach(function(t){var s=t.split(",");if(!1===lodash.isEmpty(s[2])){o=="sp-"+s[0]&&!1;var o="sp-"+s[0],n=s[2],i=h()(n).setAlpha(.7);e=e+"input::placeholder, #"+o+" input::placeholder {",e=e+"color:"+i,e+=" }"}}),this.shared.settings.document.settings.placeholderCss=e,e}),Object(n["a"])(o,"process_placeholder",function(e,t,s,o){-1!==e.indexOf("fieldTextColor")&&!1===!!~o.indexOf(t)&&o.push(s+","+e+","+t)}),o)}}}]);
|
public/lite/vue-backend/js/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
(function(t){function s(s){for(var o,n,l=s[0],r=s[1],c=s[2],d=0,g=[];d<l.length;d++)n=l[d],i[n]&&g.push(i[n][0]),i[n]=0;for(o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);p&&p(s);while(g.length)g.shift()();return a.push.apply(a,c||[]),e()}function e(){for(var t,s=0;s<a.length;s++){for(var e=a[s],o=!0,l=1;l<e.length;l++){var r=e[l];0!==i[r]&&(o=!1)}o&&(a.splice(s--,1),t=n(n.s=e[0]))}return t}var o={},i={index:0},a=[];function n(s){if(o[s])return o[s].exports;var e=o[s]={i:s,l:!1,exports:{}};return t[s].call(e.exports,e,e.exports,n),e.l=!0,e.exports}n.m=t,n.c=o,n.d=function(t,s,e){n.o(t,s)||Object.defineProperty(t,s,{enumerable:!0,get:e})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,s){if(1&s&&(t=n(t)),8&s)return t;if(4&s&&"object"===typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&s&&"string"!=typeof t)for(var o in t)n.d(e,o,function(s){return t[s]}.bind(null,o));return e},n.n=function(t){var s=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(s,"a",s),s},n.o=function(t,s){return Object.prototype.hasOwnProperty.call(t,s)},n.p="/wp-content/plugins/seedprod-pro/public/lite/vue-backend/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],r=l.push.bind(l);l.push=s,l=l.slice();for(var c=0;c<l.length;c++)s(l[c]);var p=r;a.push([0,"chunk-vendors","chunk-common"]),e()})({0:function(t,s,e){t.exports=e("56d7")},"56d7":function(t,s,e){"use strict";e.r(s);var o=e("f499"),i=e.n(o),a=(e("7f7f"),e("cadf"),e("551c"),e("f751"),e("097d"),e("2b0e")),n=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",["template"==t.$router.currentRoute.name?e("div",{key:t.componentKey,ref:"spbuilder",staticClass:"sp--ml-5 sp-antialiased sp-font-sans",attrs:{id:"seedprod-customizer"}},[e("keep-alive",[e("router-view")],1),t.shared.doing_ajax?e("div",{attrs:{id:"seedprod-ajax-status"}},[e("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e()],1):e("div",{key:t.componentKey,ref:"spbuilder",staticClass:"seedprod sp-fixed sp-bg-neutral-5 sp-top-0 sp-left-0 sp-bottom-0 sp-right-0 sp-h-full sp-z-10 sp-antialiased sp-font-sans",class:{"sp-overflow-y-scroll":"publish"==t.$router.currentRoute.name||"template"==t.$router.currentRoute.name},attrs:{id:"seedprod-customizer"}},[e("router-view",{on:{undo:t.undoMe,redo:t.redoMe}}),t.shared.doing_ajax?e("div",{attrs:{id:"seedprod-ajax-status"}},[e("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e()],1)])},l=[],r=(e("6762"),e("2fdb"),e("2ef0")),c=e.n(r),p=e("4328"),d=e.n(p),g=e("323e"),u=e.n(g),h=e("66cb"),m=e.n(h),v=e("b132"),b=e("561c"),f={mixins:[v["a"]],data:function(){return{shared:seedprod_store,componentKey:0,renderComponent:!0,historyIndex:0,undoing:!1,redoing:!1}},components:{},created:function(){},mounted:function(){this.history_init(),this.update_head_css()},watch:{$route:function(t,s){("template"==s.name&&"setup_details"==t.name||"template"==s.name&&"publish"==t.name)&&this.save_lpage(!0)},"shared.settings.document":{handler:function(t){this.update_storage()},deep:!0}},methods:{kb_shortcuts:function(t){t.expectedEvent.keyCode&&this.$router.push({name:"setup_block_options"})},history_init:function(){localStorage.removeItem("sp_history");var t=this.shared.settings.document,s=[];s.push(t),localStorage.setItem("sp_history",i()(s)),this.historyIndex=0},update_storage:c.a.debounce(function(){var t=this.shared.settings.document;if(null===localStorage.getItem("sp_history")){var s=[];return s.push(t),localStorage.setItem("sp_history",i()(s)),void(this.historyIndex=0)}s=JSON.parse(localStorage.getItem("sp_history"));if(!this.undoing&&!this.redoing){s.length>20&&(s.shift(),this.historyIndex=this.historyIndex>0?this.historyIndex-1:0);var e=s.slice(0,this.historyIndex+1);return e.push(t),localStorage.setItem("sp_history",i()(e)),void this.historyIndex++}this.undoing=!1,this.redoing=!1},500),undoMe:function(){var t=JSON.parse(localStorage.getItem("sp_history"));null!==t&&(this.undoing=!0,this.historyIndex=this.historyIndex>0?this.historyIndex-1:0,this.shared.settings.document=t[this.historyIndex],this.forceRerender())},redoMe:function(){var t=JSON.parse(localStorage.getItem("sp_history"));null!==t&&(this.redoing=!0,this.historyIndex=this.historyIndex<t.length-1?this.historyIndex+1:t.length-1,this.shared.settings.document=t[this.historyIndex],this.forceRerender())},forceRerender:function(){var t=this;this.renderComponent=!1,this.$nextTick().then(function(){t.renderComponent=!0})}}};window.onbeforeunload=function(){if(!seedprod_page.includes("_template")&&i()(seedprod_store.settings)!==seedprod_store.settings_org)return Object(b["a"])("Changes not saved, are you sure you want to leave?","coming-soon")};var x=f,w=e("2877"),k=Object(w["a"])(x,n,l,!1,null,null,null),C=k.exports,y=e("8c4f"),z=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{},[!1===t.shared.free_templates_subscribed?e("div",{staticClass:"sp--ml-5 sp-bg-primary sp-text-white sp-py-2 sp-px-8 sp-text-sm sp-flex sp-justify-center sp-leading-normal sp-items-center"},[e("strong",[t._v("Send Us Your Email and Get 10 Free Templates")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.shared.current_user_email,expression:"shared.current_user_email"}],staticClass:"sp-ml-2 sp-form-input sp-pl-8 sp-rounded sp-mr-1 sp-text-neutral",staticStyle:{padding:"4px"},domProps:{value:t.shared.current_user_email},on:{input:function(s){s.target.composing||t.$set(t.shared,"current_user_email",s.target.value)}}}),e("button",{staticClass:"sp-rounded sp-bg-neutral hover:sp-bg-neutral-80",staticStyle:{padding:"6px 10px"},on:{click:t.subscribe_to_free_templates}},[t._v("\n Get "),e("strong",[t._v("FREE")]),t._v(" Templates\n ")])]):t._e(),e("div",{staticClass:"sp-bg-white"},["welcome"!=t.$router.currentRoute.name?e("div",{staticClass:"sp-bg-white sp-pt-6 sp-pb-10 sp-px-8 sp-text-neutral sp-flex sp-justify-between"},[e("div",{staticClass:"sp-flex sp-justify-center sp-flex-1 sp-flex-col"},[e("a",{staticClass:"sp-text-neutral-60 sp-text-12px sp-font-semibold sp-uppercase sp-mb-2",attrs:{href:"admin.php?page="+t.shared.page_path+"#/"},domProps:{innerHTML:t._s(t.go_back_txt)}}),e("h1",{staticClass:"sp-text-neutral sp-text-xl sp-font-bold"},[t._v(t._s(t.txt_2))])]),e("div",[e("a",{staticClass:"sp-bg-neutral-10 sp-rounded-full sp-flex sp-items-center sp-justify-center sp-p-c63 sp-text-neutral-60",attrs:{href:"https://www.seedprod.com/docs/",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"}})])])])]):t._e(),e("div",{staticClass:"sp-flex sp-px-8 sp-bg-white"},[e("div",{staticClass:"sp-text-base sp-cursor-pointer sp-font-semibold sp-text-neutral-60 sp-pb-5 sp-mr-8 hover:sp-text-neutral",class:{"sp-border-b-2 sp-border-primary sp-text-neutral sp-font-bold":1==t.tab},on:{click:function(s){return t.set_tab(1)}}},[t._v("\n "+t._s(t.txt_3)+"\n ")]),e("div",{staticClass:"sp-text-base sp-cursor-pointer sp-font-semibold sp-text-neutral-60 sp-mr-8 hover:sp-text-neutral",class:{"sp-border-b-2 sp-border-primary sp-text-neutral sp-font-bold":2==t.tab},on:{click:function(s){t.showUpsellModal=!0}}},[t._v("\n "+t._s(t.txt_4)+"\n ")]),e("div",{staticClass:"sp-text-base sp-cursor-pointer sp-font-semibold sp-text-neutral-60 hover:sp-text-neutral",class:{"sp-border-b-2 sp-border-primary sp-text-neutral sp-font-bold":3==t.tab},on:{click:function(s){t.showUpsellModal=!0}}},[t._v("\n "+t._s(t.txt_5)+"\n ")])])]),2==t.tab?e("div",[e("div",{staticClass:"sp-p-8 theme-browser"},[!1===t.favs||t.favs.data.length>0?e("div",{staticClass:"themes clearfix"},t._l(t.favs.data,function(s){return e("div",{key:s.id,staticClass:"theme",staticStyle:{border:"none","margin-bottom":"2%"}},[e("div",{staticClass:"sp-bg-white sp-p-1 sp-border sp-border-neutral-15 sp-relative",on:{mouseenter:function(e){return t.set_template_hover(s.id)},mouseleave:function(s){return t.set_template_hover(!1)}}},[e("img",{staticClass:"sp-border-none",attrs:{src:"https://assets.seedprod.com/preview-"+s.id+".png"}}),e("div",{directives:[{name:"show",rawName:"v-show",value:t.template_hover==s.id,expression:"template_hover == theme.id"}],staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center"},[e("div",{staticClass:"sp-bg-neutral sp-opacity-75 sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-m-1"}),e("button",{staticClass:"sp-mr-1 sp-bg-primary sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",attrs:{disabled:!!t.shared.doing_ajax},on:{click:function(e){return t.save_template(s.id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),e("button",{staticClass:"sp-ml-1 sp-bg-neutral sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",on:{click:function(e){return t.preview_template(s.id,s.name)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2z"}})])])])]),e("div",{staticClass:"sp-mt-2 sp-text-neutral-80 sp-text-xs sp-font-bold sp-flex sp-items-center sp-justify-between"},[t._v("\n "+t._s(s.name)+"\n "),s.favorited?e("span",{staticClass:"sp-text-red sp-cursor-pointer",on:{click:function(e){return t.updateFavs(s.id,"detach")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"}})])]):e("span",{staticClass:"sp-text-neutral-40 sp-cursor-pointer",on:{click:function(e){return t.updateFavs(s.id,"attach")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"}})])])])])}),0):e("div",{staticClass:"sp-text-center sp-text-base sp-m-20 sp-text-neutral"},[t._v("\n "+t._s(t.txt_6)+"\n "),e("i",{directives:[{name:"tooltip",rawName:"v-tooltip.top-left",value:{content:t.txt_24},expression:"{\n content: txt_24,\n }",modifiers:{"top-left":!0}}],staticClass:"fas fa-question-circle sp-ml-2"})])])]):t._e(),3==t.tab?e("div",[e("div",{staticClass:"sp-p-8 theme-browser"},[!1===t.saved||t.saved.data.length>0?e("div",{staticClass:"themes clearfix"},t._l(t.saved.data,function(s){return e("div",{key:s.id,staticClass:"theme",staticStyle:{border:"none","margin-bottom":"2%"}},[e("div",{staticClass:"sp-bg-white sp-p-1 sp-border sp-border-neutral-15 sp-relative",on:{mouseenter:function(e){return t.set_template_hover(s.id)},mouseleave:function(s){return t.set_template_hover(!1)}}},[e("img",{staticClass:"sp-border-none",attrs:{src:"https://assets.seedprod.com/preview-saved.png"}}),e("div",{directives:[{name:"show",rawName:"v-show",value:t.template_hover==s.id,expression:"template_hover == theme.id"}],staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center"},[e("div",{staticClass:"sp-bg-neutral sp-opacity-75 sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-m-1"}),e("button",{staticClass:"sp-mr-1 sp-bg-primary sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",attrs:{disabled:!!t.shared.doing_ajax},on:{click:function(e){return t.save_template(s.id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),e("button",{staticClass:"sp-ml-1 sp-bg-neutral sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",on:{click:function(e){return t.preview_template(s.id,s.name)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2z"}})])])])]),e("div",{staticClass:"sp-mt-2 sp-text-neutral-80 sp-text-xs sp-font-bold sp-flex sp-items-center sp-justify-between"},[t._v("\n "+t._s(s.name)+"\n "),e("span",{staticClass:"sp-text-neutral-40 sp-cursor-pointer",on:{click:function(e){return t.remove_saved(s.id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])])])}),0):e("div",{staticClass:"sp-text-center sp-text-base sp-m-20 sp-text-neutral"},[t._v("\n "+t._s(t.txt_7)+"\n "),e("i",{directives:[{name:"tooltip",rawName:"v-tooltip.top-left",value:{content:t.txt_25},expression:"{\n content: txt_25,\n }",modifiers:{"top-left":!0}}],staticClass:"fas fa-question-circle sp-ml-2"})])])]):t._e(),1==t.tab?e("div",[e("div",{staticClass:"sp-px-8 sp-flex sp-items-center sp-pt-12"},[e("div",{staticClass:"sp-flex-1"},[e("span",{staticClass:"sp-text-neutral-60 sp-uppercase sp-text-12px sp-tracking-wider sp-mr-4 sp-font-semibold"},[t._v(t._s(t.txt_8))]),e("button",{staticClass:"sp-inline-block sp-px-4 sp-py-2 sp-rounded-sm sp-leading-none sp-no-underline sp-text-xs hover:sp-bg-neutral-20 sp-cursor-pointer sp-font-semibold sp-mr-2 sp-bg-neutral-15 sp-text-neutral-80",class:{"sp-cat-active":0==t.templatecat},on:{click:function(s){return t.filter_cat(0)}}},[t._v("\n "+t._s(t.txt_9)+"\n ")]),t._l(t.cats,function(s,o){return e("button",{key:o,staticClass:"sp-inline-block sp-px-4 sp-py-2 sp-rounded-sm sp-leading-none sp-no-underline sp-text-xs hover:sp-bg-neutral-20 sp-cursor-pointer sp-font-semibold sp-bg-neutral-15 sp-text-neutral-80 sp-mr-2 sp-mb-2",class:{"sp-cat-active":t.templatecat==s.id},on:{click:function(e){return t.filter_cat(s.id)}}},[t._v("\n "+t._s(s.name)+"\n ")])})],2),e("div",{staticClass:"sp-pl-5 sp-flex sp-justify-center sp-items-center sp-relative sp-w-280"},[e("span",{staticClass:"sp-text-neutral-40 sp-absolute sp-left-26"},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}})])]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.templatesearch,expression:"templatesearch"}],staticClass:"sp-form-input sp-w-full sp-pl-8 sp-rounded sp-mr-1",attrs:{placeholder:t.txt_22},domProps:{value:t.templatesearch},on:{keyup:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.search(s)},input:function(s){s.target.composing||(t.templatesearch=s.target.value)}}})]),""!=t.templatesearch?e("span",{staticClass:"sp-text-neutral-40 sp--ml-6 sp-relative sp-z-10 sp-cursor-pointer",on:{click:t.clear_search}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])]):t._e()]),e("div",{staticClass:"sp-p-8 theme-browser"},[!1===t.themes||t.themes.data.length>0?e("div",{staticClass:"themes clearfix"},t._l(t.themes.data,function(s){return e("div",{key:s.id,staticClass:"theme",staticStyle:{border:"none","margin-bottom":"2%"}},[e("div",{staticClass:"sp-bg-white sp-p-1 sp-border sp-border-neutral-15 sp-relative",on:{mouseenter:function(e){return t.set_template_hover(s.id)},mouseleave:function(s){return t.set_template_hover(!1)}}},[e("img",{staticClass:"sp-border-none",attrs:{src:"https://assets.seedprod.com/preview-"+s.id+".png"}}),0==s.free?e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-bg-green sp-rounded sp-text-white sp-z-20 sp-py-1 sp-px-2 sp-text-12px sp-font-semibold sp-mt-2 sp-mr-2"},[t._v("\n PRO\n ")]):t._e(),1==s.free_w_email?e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-bg-primary sp-rounded sp-text-white sp-z-20 sp-py-1 sp-px-2 sp-text-12px sp-font-semibold sp-mt-2 sp-mr-2"},[t._v("\n SUBSCRIBE ABOVE TO UNLOCK\n ")]):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:t.template_hover==s.id,expression:"template_hover == theme.id"}],staticClass:"sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-flex sp-items-center sp-justify-center"},[e("div",{staticClass:"sp-bg-neutral sp-opacity-75 sp-absolute sp-top-0 sp-left-0 sp-right-0 sp-bottom-0 sp-m-1"}),e("button",{staticClass:"sp-mr-1 sp-bg-primary sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",attrs:{disabled:!!t.shared.doing_ajax},on:{click:function(e){return t.save_template(s.id)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}})])]),e("button",{staticClass:"sp-ml-1 sp-bg-neutral sp-w-10 sp-h-10 sp-rounded-full sp-z-10 sp-text-white sp-flex sp-items-center sp-justify-center",on:{click:function(e){return t.preview_template(s.id,s.name)}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2z"}})])])])]),e("div",{staticClass:"sp-mt-2 sp-text-neutral-80 sp-text-xs sp-font-bold sp-flex sp-items-center sp-justify-between"},[t._v("\n "+t._s(s.name)+"\n "),s.favorited?e("span",{staticClass:"sp-text-red sp-cursor-pointer",on:{click:function(e){return t.updateFavs(s.id,"detach")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"}})])]):e("span",{staticClass:"sp-text-neutral-40 sp-cursor-pointer",on:{click:function(e){return t.updateFavs(s.id,"attach")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"}})])])])])}),0):e("div",{staticClass:"sp-text-center sp-m-20 sp-text-neutral"},[t._v("\n "+t._s(t.txt_10)+"\n ")])]),1!=t.themes.last_page?e("div",{staticClass:"sp-flex sp-items-center sp-justify-center sp-text-xs sp-text-neutral-40"},[e("a",{staticClass:"sp-mx-2 sp-flex sp-items-center",attrs:{href:"#",disabled:!t.themes.first_page_url},on:{click:function(s){return s.preventDefault(),t.pagination("first")}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}}),e("path",{attrs:{d:"M24 24H0V0h24v24z",fill:"none"}})]),t._v(t._s(t.txt_18)+"\n ")]),e("a",{staticClass:"sp-mx-2 sp-flex sp-items-center",attrs:{href:"#",disabled:!t.themes.prev_page_url},on:{click:function(s){return s.preventDefault(),t.pagination("prev")}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(t._s(t.txt_19)+"\n ")]),e("a",{staticClass:"sp-mx-2 sp-flex sp-items-center",attrs:{href:"#",disabled:!t.themes.next_page_url},on:{click:function(s){return s.preventDefault(),t.pagination("next")}}},[t._v("\n "+t._s(t.txt_20)+"\n "),e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])]),e("a",{staticClass:"sp-mx-2 sp-flex sp-items-center",attrs:{href:"#",disabled:!t.themes.last_page_url},on:{click:function(s){return s.preventDefault(),t.pagination("last")}}},[t._v("\n "+t._s(t.txt_21)+"\n "),e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]):t._e()]):t._e(),t.showPreview?e("div",{staticClass:"sp-fixed sp-top-0 sp-left-0 sp-bottom-0 sp-right-0",staticStyle:{"z-index":"99999"}},[e("div",{staticClass:"sp-absolute sp-bg-neutral-60 sp-top-0 sp-left-0 sp-bottom-0 sp-right-0 sp-opacity-75"}),e("div",{staticClass:"sp-relative sp-z-40 sp-bg-neutral sp-text-white sp-h-72px sp-flex sp-items-center sp-px-5 sp-justify-between"},[e("div",{staticClass:"sp-flex sp-items-center sp-w-1/3"},[e("svg",{attrs:{width:"32",height:"34",viewBox:"0 0 32 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0C0 0 0.74666 0.0506396 16.0822 2.054C31.4178 4.05737 36.7255 19.603 27.3358 33.1707C28.7883 21.0478 26.13 8.47161 15.4523 7.00138C4.77453 5.53114 5.70455 5.75641 5.70455 5.75641C5.70455 5.75641 5.88147 8.42652 6.8834 15.6043C7.88534 22.7821 13.4921 26.3022 18.3988 28.1143C18.3988 28.1143 18.6866 19.714 15.949 16.0165C13.2114 12.3191 9.80548 9.86362 9.80548 9.86362C9.80548 9.86362 17.8094 10.8232 20.8313 16.4032C23.8532 21.9832 23.5588 33.7778 23.5588 33.7778L20.2989 33.6092C11.5273 32.556 3.33239 27.2759 1.939 16.198C0.545613 5.1201 0 0 0 0Z",fill:"#7B6B7A"}})]),e("span",{staticClass:"sp-pl-8 sp-text-base sp-text-neutral-40 sp-text-semibold"},[t._v(t._s(t.preview_page_name))])]),e("div",{staticClass:"sp-flex sp-items-center sp-w-1/3 sp-justify-center"},[e("button",{staticClass:"sp-w-8 sp-h-8 sp-rounded-full sp-flex sp-items-center sp-justify-center sp-mr-1 sp-cursor-pointer",class:{"sp-bg-white sp-text-neutral-80":"desktop"==t.preview_mode,"sp-bg-neutral-40":"mobile"==t.preview_mode},on:{click:function(s){return t.set_preview_mode("desktop")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7l-2 3v1h8v-1l-2-3h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 12H3V4h18v10z"}})])]),e("button",{staticClass:"sp-w-8 sp-h-8 sp-rounded-full sp-flex sp-items-center sp-justify-center sp-ml-2 sp-cursor-pointer",class:{"sp-bg-white sp-text-neutral-80":"mobile"==t.preview_mode,"sp-bg-neutral-40":"desktop"==t.preview_mode},on:{click:function(s){return t.set_preview_mode("mobile")}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1zm-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5-4H7V4h9v14z"}})])])]),e("div",{staticClass:"sp-flex sp-items-center sp-w-1/3 sp-justify-end"},[e("button",{staticClass:"sp-inline-block sp-bg-primary sp-px-4 sp-py-3 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-sm hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold sp-mr-5",on:{click:function(s){return t.save_template(t.previewId)}}},[t._v("\n "+t._s(t.txt_12)+"\n ")]),e("button",{staticClass:"sp-text-neutral-40",on:{click:t.close_preview_template}},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])])])]),e("div",{staticClass:"sp-overflow-y-scroll sp-h-full"},[e("iframe",{class:{"sp-transition-width sp-duration-500 sp-ease-out sp-h-full sp-h-600px sp-relative sp-w-350px sp-mx-auto sp-my-10 sp-rounded-lg sp-p-3 sp-bg-white":"mobile"==t.preview_mode,"sp-h-full sp-relative sp-w-full ":"desktop"==t.preview_mode},attrs:{src:t.shared.template_preview_path+t.previewId+".html"}})])]):t._e(),t.showModal?e("modal",{staticClass:"sp-w-720px",on:{close:function(s){t.showModal=!1}}},[e("div",{staticClass:"sp-px-10 sp-py-12 sp-text-neutral sp-relative",attrs:{slot:"body"},slot:"body"},[e("button",{staticClass:"sp-text-neutral-40 hover:sp-text-neutral-60 sp-absolute sp-top-0 sp-right-0 sp-m-2",on:{click:function(s){t.showModal=!1}}},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])]),e("h1",{staticClass:"sp-leading-none sp-text-2xl sp-font-bold sp-mb-3"},[t._v("\n "+t._s(t.txt_13)+"\n ")]),e("p",{staticClass:"sp-text-base sp-mb-10"},[t._v(t._s(t.txt_14))]),e("div",[e("div",[e("label",{staticClass:"sp-text-lg sp-font-bold sp-mb-3 sp-inline-block"},[t._v(t._s(t.txt_15))])]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.page_name,expression:"page_name"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],staticClass:"sp-form-input sp-w-full sp-px-5 sp-rounded sp-border sp-border-neutral-20 sp-p-4 sp-rounded-sm",staticStyle:{padding:"7px 18px",color:"#230820"},attrs:{type:"text","data-vv-as":"Page Name",name:"page_name",placeholder:t.txt_23},domProps:{value:t.page_name},on:{input:function(s){s.target.composing||(t.page_name=s.target.value)}}}),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errors.has("page_name"),expression:"errors.has('page_name')"}],staticClass:"sp-text-red sp-mt-1"},[t._v("\n "+t._s(t.errors.first("page_name"))+"\n ")])]),e("div",{staticClass:"sp-mt-8"},[e("div",[e("label",{staticClass:"sp-text-lg sp-font-bold sp-mb-3 sp-inline-block"},[t._v(t._s(t.txt_16))])]),e("div",{staticClass:"sp-flex sp-items-center sp-border sp-border-neutral-20 sp-rounded"},[e("span",{staticClass:"sp-rounded-tl sp-rounded-bl sp-h-42px sp-flex sp-items-center sp-justify-center sp-px-5 sp-bg-neutral-5 sp-text-neutral-60 sp-text-lg",staticStyle:{padding:"23px 18px"}},[t._v(t._s(t.shared.home_url)+"/")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.page_slug,expression:"page_slug"},{name:"validate",rawName:"v-validate",value:"alpha_dash|required",expression:"'alpha_dash|required'"}],staticClass:"sp-form-input sp-border-none sp-flex-1",staticStyle:{display:"inline-block",width:"300px",border:"none",color:"#230820"},attrs:{type:"text",name:"slug","data-vv-as":"Page URL"},domProps:{value:t.page_slug},on:{input:function(s){s.target.composing||(t.page_slug=s.target.value)}}})]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errors.has("slug"),expression:"errors.has('slug')"}],staticClass:"sp-text-red sp-mt-1"},[t._v("\n "+t._s(t.errors.first("slug"))+"\n ")])]),e("button",{staticClass:"sp-mt-8 sp-inline-block sp-bg-primary sp-px-6 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-lg hover:sp-bg-primary-lighter sp-cursor-pointer sp-font-semibold",attrs:{disabled:t.going_to_next_step},on:{click:t.close_modal}},[t._v("\n "+t._s(t.txt_17)+"\n "),t.going_to_next_step?e("span",{staticClass:"sp-ml-2"},[e("i",{staticClass:"fas fa-spinner fa-spin"})]):e("span",{staticClass:"sp-ml-2"},[t._v("→")])])]),e("h3",{attrs:{slot:"header"},slot:"header"})]):t._e(),t.showUpsellModal?e("modal",{staticClass:"sp-w-550px",on:{close:function(s){t.showUpsellModal=!1}}},[e("div",{staticClass:"sp-px-10 sp-py-12 sp-text-neutral sp-relative",attrs:{slot:"body"},slot:"body"},[e("button",{staticClass:"sp-text-neutral-40 hover:sp-text-neutral-60 sp-absolute sp-top-0 sp-right-0 sp-m-2",on:{click:function(s){t.showUpsellModal=!1}}},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])]),e("LiteCTATemplates")],1),e("h3",{attrs:{slot:"header"},slot:"header"})]):t._e()],1)},O=[],j=(e("ac6a"),e("6b54"),e("a481"),e("714b")),M=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-text-center sp-w-full"},[e("div",[e("h1",{staticClass:" sp-mb-4 sp-leading-tight sp-text-2xl sp-font-bold sp-text-neutral"},[t._v("\n Templates are a PRO Feature\n ")]),e("p",{staticClass:"sp-mb-8 sp-text-base"},[t._v("\nWe're sorry, not all Templates are not available on your plan. Please upgrade to the PRO version to unlock all these awesome features.\n ")]),e("a",{staticClass:"sp-bg-green sp-px-8 sp-py-4 sp-rounded sp-leading-none sp-text-white sp-no-underline sp-text-base hover:sp-bg-green-lighter sp-cursor-pointer sp-font-semibold sp-inline-flex sp-items-center sp-justify-center hover:sp-text-white",staticStyle:{color:"#fff !important"},attrs:{href:"https://seedprod.com/lite-upgrade/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=plugintemplatepage",target:"_blank"}},[e("svg",{staticClass:"sp-fill-current sp-mr-2 sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(" Upgrade to SeedProd PRO Now\n ")]),e("div",{staticClass:"sp-mt-3 sp-text-primary sp-text-lg sp-font-bold"},[t._v("Special Upgrade Offer - Save 50% Off")])])])])},S=[],H={name:"LiteCTASubscribers",data:function(){return{txt_1:Object(b["a"])("Dismiss this message","coming-soon"),txt_2:Object(b["a"])("Get SeedProd Pro and Unlock all the Powerful Features","coming-soon"),txt_3:Object(b["a"])("Thanks for being a loyal SeedProd Lite user. Upgrade to\nSeedProd Pro to unlock all the awesome features and\nexperience why SeedProd is the best WordPress landing\npage plugin.","coming-soon"),txt_4:Object(b["a"])("Pro Features:","coming-soon"),txt_5:Object(b["a"])("Drag & Drop Page Builder","coming-soon"),txt_6:Object(b["a"])("More Premium Blocks","coming-soon"),txt_7:Object(b["a"])("Capture Emails and Leads","coming-soon"),txt_8:Object(b["a"])("Marketing & CRM Integrations","coming-soon"),txt_9:Object(b["a"])("Maintenance Access Controls","coming-soon"),txt_10:Object(b["a"])("Growing Library of Templates","coming-soon"),txt_11:Object(b["a"])("Smart Sections","coming-soon"),txt_12:Object(b["a"])("More Design Controls","coming-soon"),txt_13:Object(b["a"])("Coming Soon Access Controls","coming-soon"),txt_14:Object(b["a"])("Plus much more...","coming-soon"),txt_15:Object(b["a"])("Bonus:","coming-soon"),txt_16:Object(b["a"])("SeedProd Lite users get","coming-soon"),txt_17:Object(b["a"])("a discount off the regular price","coming-soon"),txt_18:Object(b["a"])("automatically applied at checkout.","coming-soon"),txt_19:Object(b["a"])("Get SeedProd Pro Today and Unlock all the Powerful Features »","coming-soon")}},methods:{dismiss:function(){var t=this,s=d.a.stringify({dismiss:!0});this.shared.settings_page_meta.dismiss_settings_lite_cta=!0,t.axios.post(seedprod_dismiss_settings_lite_cta_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}}},V=H,B=Object(w["a"])(V,M,S,!1,null,null,null),L=B.exports,T={name:"templatechooser",mixins:[v["a"]],data:function(){return{txt_1:Object(b["a"])("← Go Back","coming-soon"),txt_111:Object(b["a"])("← Go to Dashboard","coming-soon"),txt_2:Object(b["a"])("Choose a New Page Template","coming-soon"),txt_3:Object(b["a"])("All Templates","coming-soon"),txt_4:Object(b["a"])("Favorite Templates","coming-soon"),txt_5:Object(b["a"])("Saved Templates","coming-soon"),txt_6:Object(b["a"])("No Favorited Templates Found","coming-soon"),txt_7:Object(b["a"])("No Saved Templates Found","coming-soon"),txt_8:Object(b["a"])("Filter:","coming-soon"),txt_9:Object(b["a"])("All","coming-soon"),txt_10:Object(b["a"])("No Templates Found","coming-soon"),txt_11:Object(b["a"])("Choose This Template","coming-soon"),txt_12:Object(b["a"])("Choose This Template","coming-soon"),txt_13:Object(b["a"])("Enter your new page details","coming-soon"),txt_14:Object(b["a"])("You can always change it later in Page Settings.","coming-soon"),txt_15:Object(b["a"])("Page Name:","coming-soon"),txt_16:Object(b["a"])("Page URL:","coming-soon"),txt_17:Object(b["a"])("Save and Start Editing the Page","coming-soon"),txt_18:Object(b["a"])("First Page","coming-soon"),txt_19:Object(b["a"])("Prev","coming-soon"),txt_20:Object(b["a"])("Next","coming-soon"),txt_21:Object(b["a"])("Last Page","coming-soon"),txt_22:Object(b["a"])("Search templates...","coming-soon"),txt_23:Object(b["a"])("My Landing Page name goes here","coming-soon"),txt_24:Object(b["a"])("You can favorite any template by clicking the heart icon under the page template.","coming-soon"),txt_25:Object(b["a"])("You can save pages as templates in the builder. Any saved pages will be shown here.","coming-soon"),preview_mode:"desktop",preview_page_name:!1,previewId:!1,showPreview:!1,going_to_next_step:!1,selected_template_id:!1,page_name:"",page_slug:"",templatesearch:"",templatecat:"",tab:1,showModal:!1,showUpsellModal:!1,themes:!1,saved:!1,favs:!1,cats:!1,template_hover:!1,shared:seedprod_store,subscribe_to_free_templates_url:seedprod_remote_api+"templates-subscribe",template_api_url:seedprod_remote_api+"templates?page=1",template_api_url_preview:seedprod_remote_api+"templates-preview?page=1",template_update_api_url:seedprod_remote_api+"template-update"}},computed:{go_back_txt:function(){var t=this.txt_1;if("sidebar"==seedprod_from)t=this.txt_111;return t}},created:function(){"cs"==this.shared.settings.page_type&&(this.templatecat=1),"mm"==this.shared.settings.page_type&&(this.templatecat=2),"p404"==this.shared.settings.page_type&&(this.templatecat=3),"loginp"==this.shared.settings.page_type&&(this.templatecat=4),this.loadCats(),this.loadThemes();var t=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(2)'),s=document.querySelector('[id^="toplevel_page_seedprod_"] > .wp-submenu > li:nth-of-type(3)');t.classList.remove("current"),s.classList.add("current")},watch:{page_name:{handler:function(t,s){this.page_slug=this.slugify(t)}}},methods:{subscribe_to_free_templates:function(){var t=this,s=d.a.stringify({email:this.shared.current_user_email,site_token:this.shared.site_token});this.axios.post(this.subscribe_to_free_templates_url,s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){u.a.done(),t.shared.free_templates_subscribed="1",t.loadThemes(),t.$swal({imageUrl:t.shared.plugin_path+"public/svg/success-24px-white.svg",text:"You now have access to 10 FREE templates.",toast:!0,type:null,customClass:"sp-toast-success",position:"top-end",showConfirmButton:!1,timer:5e3}),t.axios.get(seedprod_template_subscribe_url),window.open("https://www.seedprod.com/free-templates")}).catch(function(s){console.log(s.response),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},slugify:function(t){return t.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},set_preview_mode:function(t){this.preview_mode=t},preview_template:function(t,s){this.previewId=t,this.showPreview=!0,this.preview_page_name=s,this.set_template_hover(!1)},close_preview_template:function(){this.previewId=!1,this.showPreview=!1,this.preview_page_name=!1},remove_saved:function(t){var s=this,e=t,o=this;u.a.start(),this.$swal({imageUrl:"",title:Object(b["a"])("Are you sure you want to delete?","coming-soon"),type:null,showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Object(b["a"])("Yes, delete it!","coming-soon")}).then(function(t){if(t.value){var i=d.a.stringify({template_id:e,method:"remove-saved",api_token:s.shared.api_token,site_token:s.shared.site_token});s.axios.post(s.template_update_api_url,i,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){for(var s in u.a.done(),o.saved.data)o.saved.data[s].id==e&&o.saved.data.splice(s,1)}).catch(function(t){console.log(t),u.a.done(),o.$swal({imageUrl:o.shared.plugin_path+"public/svg/error-24px-white.svg",text:t.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})}),s.$swal({imageUrl:o.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(b["a"])("Deleted!","coming-soon"),toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})}else u.a.done()})},set_tab:function(t){this.tab=t,1==t&&this.loadThemes(),2==t&&this.loadFavs(),3==t&&this.loadSaved()},pagination:function(t){"first"==t&&this.themes.first_page_url&&(this.template_api_url=this.themes.first_page_url,this.loadThemes()),"prev"==t&&this.themes.prev_page_url&&(this.template_api_url=this.themes.prev_page_url,this.loadThemes()),"next"==t&&this.themes.next_page_url&&(this.template_api_url=this.themes.next_page_url,this.loadThemes()),"last"==t&&this.themes.last_page_url&&(this.template_api_url=this.themes.last_page_url,this.loadThemes())},search:function(){this.templatecat="",this.loadThemes()},clear_search:function(){this.templatesearch="",this.loadThemes()},filter_cat:function(t){this.templatesearch="",this.templatecat=t,this.loadThemes()},updateFavs:function(t,s){var e=d.a.stringify({template_id:t,method:s,api_token:this.shared.api_token,site_token:this.shared.site_token}),o=this.themes.data;o.forEach(function(s){s.id==t&&(s.favorited=!s.favorited)});o=this.favs.data;for(var i in this.favs.data)this.favs.data[i].id==t&&this.favs.data.splice(i,1);this.axios.post(this.template_update_api_url,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){u.a.done()}).catch(function(t){console.log(t.response),self.shared.doing_ajax=!1,self.$swal({imageUrl:self.shared.plugin_path+"public/svg/error-24px-white.svg",text:t.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},recordPage:function(){var t=this;t.loading=!0,u.a.start();var s=d.a.stringify({page_uuid:this.shared.page_uuid,site_token:this.shared.site_token,api_token:this.shared.api_token,page_type:this.shared.page_type});t.axios.post(seedprod_remote_api+"record-page",s,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})},loadCats:function(){var t=this;t.loading=!0,u.a.start();var s=this.template_api_url;0==this.shared.api_token&&(s=this.template_api_url_preview),this.axios.get(s+"&filter=cats&api_token="+t.shared.api_token+"&site_token="+t.shared.site_token).then(function(s){t.cats=s.data}).catch(function(s){console.log(s.response),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},blankTemplate:function(){var t={id:99999,favorited:!1,name:"Blank Template"};return t},loadThemes:function(){var t=this;t.loading=!0,u.a.start();var s=this.template_api_url;0==this.shared.api_token&&(s=this.template_api_url_preview),this.axios.get(s+"&filter=templates&s="+this.templatesearch+"&cat="+this.templatecat+"&api_token="+t.shared.api_token+"&site_token="+t.shared.site_token+"&free_subscribed="+t.shared.free_templates_subscribed).then(function(s){t.loading=!1,u.a.done();var e=s.data.templates.data;0!=t.shared.api_token&&e.forEach(function(t){t.favorited=s.data.favs.includes(t.id)}),t.themes=s.data.templates}).catch(function(s){u.a.done(),console.log(s),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},loadFavs:function(){var t=this;t.loading=!0,u.a.start(),this.axios.get(this.template_api_url+"&filter=favorites&api_token="+t.shared.api_token+"&site_token="+t.shared.site_token).then(function(s){t.loading=!1,u.a.done();var e=s.data.data;e.forEach(function(t){t.favorited=!0}),t.favs=s.data}).catch(function(s){u.a.done(),console.log(s.response),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},loadSaved:function(){var t=this;t.loading=!0,u.a.start(),this.axios.get(this.template_api_url+"&filter=saved&api_token="+t.shared.api_token+"&site_token="+t.shared.site_token).then(function(s){t.loading=!1,u.a.done(),t.saved=s.data}).catch(function(s){u.a.done(),console.log(s.response),t.shared.doing_ajax=!1,t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:s.response.data.message,toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:5e3})})},set_template_hover:function(t){this.template_hover=t},close_modal:function(){var t=this;this.$validator.validateAll().then(function(s){if(s){t.going_to_next_step=!0;var e=d.a.stringify({post_name:t.page_slug});t.axios.post(seedprod_slug_exists_url,e,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(s){s.data.success?(t.going_to_next_step=!0,t.save_template(t.selected_template_id)):(t.going_to_next_step=!1,t.page_slug="",alert("This page url already exisits. Please choose a unique page url."))})}else{var o="";t.errors.all().forEach(function(t){o=o+t+"\n"}),o+="",t.$swal({imageUrl:t.shared.plugin_path+"public/svg/error-24px-white.svg",text:o,toast:!0,type:null,position:"top-end",customClass:"sp-toast-error",showConfirmButton:!1,timer:3e3})}})},save_template:function(t){for(var s=0;s<this.themes.data.length;s++)if(t==this.themes.data[s].id){if(1==this.themes.data[s].free_w_email)return void window.scrollTo(0,0);if(0==this.themes.data[s].free)return void(this.showUpsellModal=!0)}var e=this;if(this.selected_template_id=t,"lp"==this.shared.settings.page_type&&""==this.page_name&&""==this.page_slug)return this.showModal=!0,!1;this.shared.lpage.post_title=this.page_name,this.shared.lpage.post_name=this.page_slug,this.shared.settings.template_id=t,this.shared.settings.is_new=!1;var o=d.a.stringify({lpage_id:this.shared.lpage.id,lpage_template_id:t,lpage_name:this.page_name,lpage_slug:this.page_slug,lpage_type:this.shared.settings.page_type});return u.a.start(),this.axios.post("admin-ajax.php?action="+this.shared.page_path+"_save_template&_wpnonce="+seedprod_nonce,o,{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then(function(t){if(u.a.done(),e.going_to_next_step=!1,"updated"==t.data.status)JSON.parse(t.data.code);var s="admin.php?page="+e.shared.page_path+"_builder&id="+e.shared.lpage.id+"#/setup/"+e.shared.lpage.id+"/block-options";location.replace(s)}).catch(function(t){u.a.done(),e.going_to_next_step=!1,e.$swal({imageUrl:e.shared.plugin_path+"public/svg/error-24px-white.svg",text:Object(b["a"])("Could not be saved. Please contact Support if you continue to experience this issue.","coming-soon"),toast:!0,type:null,customClass:"sp-toast-error",position:"top-end",showConfirmButton:!1,timer:3e3})}),!1}},components:{modal:j["a"],LiteCTATemplates:L}},$=T,P=Object(w["a"])($,z,O,!1,null,null,null),F=P.exports,N=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticStyle:{width:"inherit"},attrs:{id:"sp-blocks-sections-wrapper"}},[t.$route.params.blockid?t._e():e("div",{staticClass:"sp-flex",attrs:{id:"sp-blocks-sections"}},[e("div",{staticClass:"sp-w-1/2"},[e("svg",{staticClass:"sp-w-4 sp-fill-current sp-inline-block sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zm-7-2h2v-3h3V9h-3V6h-2v3h-3v2h3z"}})]),t._v(t._s(t.txt_1)+"\n ")]),e("div",{staticClass:"sp-w-1/2 sp-cursor-pointer sp-secondary",on:{click:t.goto_sectiontemplates}},[e("svg",{staticClass:"sp-w-4 sp-fill-current sp-inline-block sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M21 18H2v2h19v-2zm-2-8v4H4v-4h15m1-2H3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h17c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zm1-4H2v2h19V4z"}})]),t._v(t._s(t.txt_2)+"\n ")])]),e("div",{staticClass:"sp-fixed sp-z-50",staticStyle:{width:"inherit"}},[t.$route.params.blockid?e("div",{staticClass:"sp-flex sp-items-center sp-px-4",class:{"sp-block-type-row":"row"==t.shared.setup_page_meta.current_block.type||"col"==t.shared.setup_page_meta.current_block.type,"sp-block-type-section":"section"==t.shared.setup_page_meta.current_block.type},attrs:{id:"sp-blocks-editing"}},[e("div",{staticClass:"sp-flex-grow"},[e("span",{staticClass:"sp-pb-1"},[t._v(t._s(t.txt_6))]),t._v("\n "+t._s(t.get_display_name)+"\n ")]),e("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Blocks",delay:{show:400,hide:0}},expression:"{content:'Blocks',delay:{ show: 400, hide: 0 }}"}],staticClass:"sp-cursor-pointer",on:{click:t.goto_blocks}},[e("svg",{staticClass:"sp-w-5 sp-fill-current",attrs:{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[e("circle",{attrs:{cx:"1.68164",cy:"2.33057",r:"1.5"}}),e("circle",{attrs:{cx:"1.68164",cy:"10.3306",r:"1.5"}}),e("circle",{attrs:{cx:"1.68164",cy:"18.3306",r:"1.5"}}),e("circle",{attrs:{cx:"9.68164",cy:"2.33057",r:"1.5"}}),e("circle",{attrs:{cx:"9.68164",cy:"10.3306",r:"1.5"}}),e("circle",{attrs:{cx:"9.68164",cy:"18.3306",r:"1.5"}}),e("circle",{attrs:{cx:"17.6816",cy:"2.33057",r:"1.5"}}),e("circle",{attrs:{cx:"17.6816",cy:"10.3306",r:"1.5"}}),e("circle",{attrs:{cx:"17.6816",cy:"18.3306",r:"1.5"}})])])]):t._e()]),t.$route.params.blockid&&t.shared.setup_page_meta.current_block?e("div",{ref:"spoptionsbody",staticClass:"sp-options-body"},[e("div",{staticClass:"seedprod-sidebar-form-body seedprod-action-single"},["row"==t.shared.setup_page_meta.current_block.type?e("RowOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"section"==t.shared.setup_page_meta.current_block.type?e("SectionOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"col"==t.shared.setup_page_meta.current_block.type?e("ColOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"button"==t.shared.setup_page_meta.current_block.type?e("ButtonOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"icon"==t.shared.setup_page_meta.current_block.type?e("IconOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"feature"==t.shared.setup_page_meta.current_block.type?e("FeatureOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"iconfeature"==t.shared.setup_page_meta.current_block.type?e("IconFeatureOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"header"==t.shared.setup_page_meta.current_block.type?e("HeaderOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"text"==t.shared.setup_page_meta.current_block.type?e("TextOptions",{key:t.componentKey,attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"image"==t.shared.setup_page_meta.current_block.type?e("ImageOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"divider"==t.shared.setup_page_meta.current_block.type?e("DividerOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"spacer"==t.shared.setup_page_meta.current_block.type?e("SpacerOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"custom-html"==t.shared.setup_page_meta.current_block.type?e("CustomHTMLOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"shortcode"==t.shared.setup_page_meta.current_block.type?e("ShortcodeOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"login"==t.shared.setup_page_meta.current_block.type?e("LoginOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"bullet-list"==t.shared.setup_page_meta.current_block.type?e("BulletListOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"optin-form"==t.shared.setup_page_meta.current_block.type?e("OptinFormOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"form"==t.shared.setup_page_meta.current_block.type?e("MyFormOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"progress-bar"==t.shared.setup_page_meta.current_block.type?e("ProgressBarOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"social-profiles"==t.shared.setup_page_meta.current_block.type?e("SocialProfilesOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"social-sharing"==t.shared.setup_page_meta.current_block.type?e("SocialSharingOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"contact-form"==t.shared.setup_page_meta.current_block.type?e("ContactFormOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"giveaway"==t.shared.setup_page_meta.current_block.type?e("GiveawayOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"video"==t.shared.setup_page_meta.current_block.type?e("VideoOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"starrating"==t.shared.setup_page_meta.current_block.type?e("StarRatingOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"countdown"==t.shared.setup_page_meta.current_block.type?e("CountdownOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"nav"==t.shared.setup_page_meta.current_block.type?e("NavOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e(),"anchor"==t.shared.setup_page_meta.current_block.type?e("AnchorOptions",{attrs:{block:t.shared.setup_page_meta.current_block}}):t._e()],1)]):e("div",{attrs:{id:"seedprod-add-actions"}},[e("div",{staticClass:"sp-pt-5 sp-px-5 sp-pb-2 sp-flex sp-justify-center sp-items-center sp-relative"},[e("span",{staticClass:"sp-text-neutral-40 sp-absolute sp-left-26"},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}})])]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.blocksearch,expression:"blocksearch"}],staticClass:"sp-form-input sp-w-full sp-pl-8",attrs:{placeholder:t.txt_7},domProps:{value:t.blocksearch},on:{input:function(s){s.target.composing||(t.blocksearch=s.target.value)}}})]),e("h3",{staticClass:"sp-flex sp-items-center sp-justify-between",class:{seedprod_collaspe:!t.shared.expand_collapse_state.show_entry_settings},on:{click:function(s){t.shared.expand_collapse_state.show_entry_settings=!t.shared.expand_collapse_state.show_entry_settings}}},[t._v("\n "+t._s(t.txt_3)+"\n "),e("span",{staticClass:"sp-cursor-pointer sp-text-neutral-40"},[e("svg",{staticClass:"sp-w-6 sp-fill-current",class:{"sp-hidden":!t.shared.expand_collapse_state.show_entry_settings},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.shared.expand_collapse_state.show_entry_settings},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),e("transition",{attrs:{name:"seedprod"}},[t.shared.expand_collapse_state.show_entry_settings?e("div",{staticClass:"seedprod-sidebar-form-body "},[e("draggable",{staticClass:"seedprod-drag-source sp-flex sp-flex-wrap",attrs:{sort:!1,clone:t.add_block_option,list:t.standardBlocks,group:{name:"blocks",pull:"clone",put:!1}},on:{start:t.start_move,end:t.end_move}},[t._l(t.standardBlocks,function(s,o){return e("div",{key:o,staticClass:"seedprod-block-option"},[e("button",{on:{mouseover:function(s){t.page_meta.show_icon=o},mouseleave:function(s){t.page_meta.show_icon=!1}}},[e("div",{staticClass:"sp-inline-block sp-mt-6",domProps:{innerHTML:t._s(s.icon)}}),e("span",{staticClass:"sp-font-semibold"},[t._v(t._s(s.name))])])])}),e("draggable",{staticClass:"seedprod-drag-source sp-flex sp-flex-wrap",attrs:{sort:!1,clone:t.add_block_option,list:t.shared.setup_page_meta.block_options,group:{name:"rows",pull:"clone",put:!1}},on:{start:t.start_move,end:t.end_move}},t._l(t.layoutBlocks,function(s,o){return e("div",{key:o,staticClass:"seedprod-block-option"},[e("button",{on:{mouseover:function(s){t.page_meta.show_icon=o},mouseleave:function(s){t.page_meta.show_icon=!1}}},[e("div",{staticClass:"sp-inline-block sp-mt-6",domProps:{innerHTML:t._s(s.icon)}}),e("span",{staticClass:"sp-font-semibold"},[t._v(t._s(s.name))])])])}),0)],2)],1):t._e()]),e("h3",{staticClass:"sp-flex sp-items-center sp-justify-between",class:{seedprod_collaspe:!t.shared.expand_collapse_state.show_entry_settings_2},on:{click:function(s){t.shared.expand_collapse_state.show_entry_settings_2=!t.shared.expand_collapse_state.show_entry_settings_2}}},[t._v("\n "+t._s(t.txt_4)+"\n "),e("span",{staticClass:"sp-cursor-pointer sp-text-neutral-40"},[e("svg",{staticClass:"sp-w-6 sp-fill-current",class:{"sp-hidden":!t.shared.expand_collapse_state.show_entry_settings_2},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.shared.expand_collapse_state.show_entry_settings_2},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),e("transition",{attrs:{name:"seedprod"}},[t.shared.expand_collapse_state.show_entry_settings_2?e("div",{staticClass:"seedprod-sidebar-form-body "},[e("draggable",{staticClass:"seedprod-drag-source sp-flex sp-flex-wrap",attrs:{sort:!1,clone:t.add_block_option,handle:".sp-blockdrag-handle",list:t.advancedBlocks,group:{name:"blocks",pull:"clone",put:!1}},on:{start:t.start_move,end:t.end_move}},t._l(t.advancedBlocks,function(s,o){return e("div",{key:o,staticClass:"seedprod-block-option sp-relative",class:{"sp-pro-only":s.is_pro}},[s.is_pro?e("div",{staticClass:"sp-absolute sp-top-0 sp-right-0 sp-text-green sp-rounded sp-z-20 sp-px-1 sp-text-10px sp-font-semibold sp-mt-2 sp-mr-1"},[e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("g",{attrs:{fill:"none"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",opacity:".87"}})]),e("path",{attrs:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}})])]):t._e(),e("button",{class:{"sp-blockdrag-handle":!s.is_pro},on:{mouseover:function(s){t.page_meta.show_icon=o+100},mouseleave:function(s){t.page_meta.show_icon=!1},click:function(e){return t.maybe_show_upsell(s)}}},[e("div",{staticClass:"sp-inline-block sp-mt-6",domProps:{innerHTML:t._s(s.icon)}}),e("span",{staticClass:"sp-font-semibold"},[t._v(t._s(s.name))])])])}),0)],1):t._e()]),e("h3",{staticClass:"sp-border-t-0 sp-flex sp-items-center sp-justify-between",class:{seedprod_collaspe:!t.shared.expand_collapse_state.show_entry_settings_3},on:{click:function(s){t.feature="Saved Blocks",t.feature_source="saved-blocks",t.showUpsellModal=!0}}},[e("span",[t._v(t._s(t.txt_5)+" "),e("div",{staticClass:"sp-inline-block sp-bg-green sp-rounded sp-text-white sp-z-20 sp-py-1 sp-px-2 sp-text-12px sp-font-semibold sp-ml-2"},[t._v("PRO")])]),e("span",{staticClass:"sp-cursor-pointer sp-text-neutral-40"},[e("svg",{staticClass:"sp-w-6 sp-fill-current",class:{"sp-hidden":!t.shared.expand_collapse_state.show_entry_settings_3},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.shared.expand_collapse_state.show_entry_settings_3},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),e("transition",{attrs:{name:"seedprod"}},[t.shared.expand_collapse_state.show_entry_settings_3?e("div",{staticClass:"seedprod-sidebar-form-body "}):t._e()])],1),e("br"),t.showUpsellModal?e("modal",{staticClass:"sp-w-550px",on:{close:function(s){t.showUpsellModal=!1}}},[e("div",{staticClass:"sp-px-10 sp-py-12 sp-text-neutral sp-relative",attrs:{slot:"body"},slot:"body"},[e("button",{staticClass:"sp-text-neutral-40 hover:sp-text-neutral-60 sp-absolute sp-top-0 sp-right-0 sp-m-2",on:{click:function(s){t.showUpsellModal=!1}}},[e("svg",{staticClass:"sp-fill-current sp-w-6 sp-h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}})])]),e("LiteCTABuilder",{attrs:{feature_source:"blocks-"+t.feature_source,feature:t.feature}})],1),e("h3",{attrs:{slot:"header"},slot:"header"})]):t._e()],1)},R=[],A=(e("8449"),e("310e")),E=e.n(A),I=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"sp-flex",attrs:{id:"sp-blocks-edit-sections"}},[e("div",{staticClass:"sp-w-1/2 sp-cursor-pointer",class:{"sp-secondary":1!=t.view},on:{click:function(s){t.view=1}}},[e("svg",{staticClass:"sp-w-4 sp-fill-current sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v("\n "+t._s(t.txt_1)+"\n ")]),e("div",{staticClass:"sp-w-1/2 sp-cursor-pointer",class:{"sp-secondary":2!=t.view},on:{click:function(s){t.view=2}}},[e("svg",{staticClass:"sp-w-4 sp-fill-current sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M18 4V3c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6h1v4H9v11c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-9h8V4h-3zm-2 2H6V4h10v2z"}})]),t._v(t._s(t.txt_22)+"\n ")]),e("div",{staticClass:"sp-w-1/2 sp-cursor-pointer",class:{"sp-secondary":3!=t.view},on:{click:function(s){t.view=3}}},[e("svg",{staticClass:"sp-w-4 sp-fill-current sp-mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}})]),t._v("\n "+t._s(t.txt_2)+"\n ")])]),1==t.view?e("div",[e("h3",{staticClass:"sp-sidebar-headers",class:{seedprod_collaspe:!t.section_1},on:{click:function(s){t.section_1=!t.section_1}}},[t._v("\n "+t._s(t.txt_3)+"\n "),e("span",[e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":!t.section_1},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.section_1},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),t.section_1?e("div",{staticClass:"seedprod-sidebar-action-body"},[e("div",{staticClass:"sp-form-group",class:{input:!0,"has-error":t.errors.has("btnTxt")}},[e("div",[e("label",[t._v(t._s(t.txt_4))])]),e("editor",{attrs:{init:{height:100,branding:!1,menubar:!1,paste_as_text:!0,force_br_newlines:!0,force_p_newlines:!1,forced_root_block:"",plugins:["charmap,colorpicker,hr,lists,paste,tabfocus,textcolor,fullscreen,wordpress,wpautoresize,wpeditimage,wpemoji,wpgallery,wplink,wptextpattern"],toolbar1:"bold,italic,underline,strikethrough,link,wp_adv",toolbar2:"forecolor,backcolor"}},model:{value:t.block.settings.btnTxt,callback:function(s){t.$set(t.block.settings,"btnTxt",s)},expression:"block.settings.btnTxt"}}),e("span",{directives:[{name:"show",rawName:"v-show",value:t.errors.has("btnTxt"),expression:"errors.has('btnTxt')"}],staticClass:"help-block has-error"},[t._v(t._s(t.errors.first("btnTxt")))])],1),e("div",{staticClass:"sp-form-group"},[e("div",[e("label",[t._v(t._s(t.txt_9))])]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.btnSubTxt,expression:"block.settings.btnSubTxt"}],staticClass:"sp-form-input",attrs:{type:"text"},domProps:{value:t.block.settings.btnSubTxt},on:{input:function(s){s.target.composing||t.$set(t.block.settings,"btnSubTxt",s.target.value)}}})]),e("div",{staticClass:"sp-form-group",class:{"sp-mb-1":t.show_adv_link}},[e("label",[t._v(t._s(t.txt_10))]),e("span",{staticClass:"sp-flex sp-items-center sp-border sp-border-neutral-20 sp-rounded-md focus-within:sp-border-neutral-80 sp-rounded"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.link,expression:"block.settings.link"}],staticClass:"sp-form-input sp-border-none sp-rounded-tr-none sp-rounded-br-none",attrs:{type:"text"},domProps:{value:t.block.settings.link},on:{input:function(s){s.target.composing||t.$set(t.block.settings,"link",s.target.value)}}}),e("button",{staticClass:"sp-form-input sp-rounded-tl-none sp-rounded-bl-none sp-h-40px sp-text-neutral-40 hover:sp-text-neutral-80 sp-outline-none sp-border-t-0 sp-border-r-0 sp-border-b-0",class:{"sp-text-neutral-80":t.show_adv_link},on:{click:function(s){t.show_adv_link=!t.show_adv_link}}},[e("svg",{staticClass:"sp-fill-current sp-w-5 sp-h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}})])])])]),t.show_adv_link?e("div",{staticClass:"sp-bg-neutral-10 sp-rounded-6px sp-p-2 sp-mb-4"},[e("div",[e("label",{staticClass:"sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.openNewWindow,expression:"block.settings.openNewWindow"}],staticClass:"sp-form-checkbox sp-h-4 sp-w-4 sp-text-primary",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.block.settings.openNewWindow)?t._i(t.block.settings.openNewWindow,null)>-1:t.block.settings.openNewWindow},on:{change:function(s){var e=t.block.settings.openNewWindow,o=s.target,i=!!o.checked;if(Array.isArray(e)){var a=null,n=t._i(e,a);o.checked?n<0&&t.$set(t.block.settings,"openNewWindow",e.concat([a])):n>-1&&t.$set(t.block.settings,"openNewWindow",e.slice(0,n).concat(e.slice(n+1)))}else t.$set(t.block.settings,"openNewWindow",i)}}}),e("span",{staticClass:"sp-ml-2 sp-text-sm"},[t._v(t._s(t.txt_11))])])]),e("div",[e("label",{staticClass:"sp-inline-flex sp-items-center"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.noFollow,expression:"block.settings.noFollow"}],staticClass:"sp-form-checkbox sp-h-4 sp-w-4 sp-text-primary",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.block.settings.noFollow)?t._i(t.block.settings.noFollow,null)>-1:t.block.settings.noFollow},on:{change:function(s){var e=t.block.settings.noFollow,o=s.target,i=!!o.checked;if(Array.isArray(e)){var a=null,n=t._i(e,a);o.checked?n<0&&t.$set(t.block.settings,"noFollow",e.concat([a])):n>-1&&t.$set(t.block.settings,"noFollow",e.slice(0,n).concat(e.slice(n+1)))}else t.$set(t.block.settings,"noFollow",i)}}}),e("span",{staticClass:"sp-ml-2 sp-text-sm"},[t._v(t._s(t.txt_6))])])])]):t._e(),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_7))]),e("AlignControl",{attrs:{justify:!0,icons:"alt"},model:{value:t.block.settings.align,callback:function(s){t.$set(t.block.settings,"align",s)},expression:"block.settings.align"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_15))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.btnSize,expression:"block.settings.btnSize"}],staticClass:"sp-form-select",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.$set(t.block.settings,"btnSize",s.target.multiple?e:e[0])},t.update_btn_size]}},[e("option",{attrs:{value:"2"}},[t._v(t._s(t.txt_102))]),e("option",{attrs:{value:"3"}},[t._v(t._s(t.txt_103))]),e("option",{attrs:{value:"4"}},[t._v(t._s(t.txt_104))]),e("option",{attrs:{value:"5"}},[t._v(t._s(t.txt_105))]),e("option",{attrs:{value:"6"}},[t._v(t._s(t.txt_106))])])])]):t._e(),e("h3",{staticClass:"sp-sidebar-headers",class:{seedprod_collaspe:!t.section_2},on:{click:function(s){t.section_2=!t.section_2}}},[t._v("\n "+t._s(t.txt_19)+"\n "),e("span",[e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":!t.section_2},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.section_2},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),t.section_2?e("div",{staticClass:"seedprod-sidebar-action-body"},[e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_20))]),e("IconPicker",{model:{value:t.block.settings.beforeIcon,callback:function(s){t.$set(t.block.settings,"beforeIcon",s)},expression:"block.settings.beforeIcon"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_21))]),e("IconPicker",{model:{value:t.block.settings.afterIcon,callback:function(s){t.$set(t.block.settings,"afterIcon",s)},expression:"block.settings.afterIcon"}})],1)]):t._e()]):t._e(),2==t.view?e("div",{staticClass:"sp-flex sp-items-center sp-flex-col sp-pb-4"},[e("div",{staticClass:"sp-uppercase sp-text-12px sp-font-semibold sp-text-neutral-60 sp-mt-2"},[t._v(t._s(t.txt_24))]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(1)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"rgb(30, 136, 229)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"100px"}},[t._v(t._s(t.txt_25))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(2)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"rgb(30, 136, 229)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"4px"}},[t._v(t._s(t.txt_26))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(3)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(30, 136, 229), rgb(23, 117, 200) 90%)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(22, 109, 186)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_27))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(4)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(124, 179, 66), rgb(106, 153, 56) 90%)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(98, 142, 52)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_28))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(5)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(67, 160, 71), rgb(56, 135, 60) 90%)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(52, 124, 55)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_29))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(6)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(251, 140, 0), rgb(215, 120, 0) 90%)",color:"rgb(255, 255, 255)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(200, 112, 0)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_30))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(7)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(229, 57, 53), rgb(218, 32, 28) 90%)",padding:"8px 12px",color:"rgb(255, 255, 255)","border-radius":"4px",border:"1px solid rgb(205, 30, 26)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_31))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(8)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(253, 216, 53), rgb(253, 209, 18) 90%)",color:"rgb(0, 0, 0)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(252, 206, 3)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_32))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(9)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(255, 255, 255), rgb(237, 237, 237) 90%)",color:"rgb(0, 0, 0)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(230, 230, 230)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_33))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(10)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(158, 158, 158), rgb(140, 140, 140) 90%)",color:"rgb(255,255,255,0.80)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(132, 132, 132)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_34))])]),e("div",{staticClass:"sp-template-preview",on:{click:function(s){return t.apply_template(11)}}},[e("button",{staticStyle:{width:"80%","font-size":"15px",background:"linear-gradient(-180deg, rgb(51, 51, 51), rgb(33, 33, 33) 90%)",color:"rgb(255,255,255, 0.80)",padding:"8px 12px","border-radius":"4px",border:"1px solid rgb(26, 26, 26)","box-shadow":"rgba(255, 255, 255, 0.2) 0px 1px 0px inset"}},[t._v(t._s(t.txt_35))])])]):t._e(),3==t.view?e("div",[e("h3",{staticClass:"sp-sidebar-headers",class:{seedprod_collaspe:!t.section_4},on:{click:function(s){t.section_4=!t.section_4}}},[t._v("\n "+t._s(t.txt_8)+"\n "),e("span",[e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":!t.section_4},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]),e("svg",{staticClass:"sp-w-5 sp-fill-current",class:{"sp-hidden":t.section_4},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])])]),t.section_4?e("div",{staticClass:"seedprod-sidebar-action-body"},[e("div",{staticClass:"sp-form-group"},[e("TypographyControl",{attrs:{block:t.block}})],1),e("div",{staticClass:"sp-form-group"},[e("ColorPicker",{attrs:{label:t.txt_43,color:t.block.settings.bgColor},model:{value:t.block.settings.bgColor,callback:function(s){t.$set(t.block.settings,"bgColor",s)},expression:"block.settings.bgColor"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_16))]),e("SliderControl",{attrs:{min:10,max:100,step:1},model:{value:t.block.settings.btnPaddingTop,callback:function(s){t.$set(t.block.settings,"btnPaddingTop",s)},expression:"block.settings.btnPaddingTop"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_17))]),e("SliderControl",{attrs:{min:10,max:100,step:1},model:{value:t.block.settings.btnPaddingLeft,callback:function(s){t.$set(t.block.settings,"btnPaddingLeft",s)},expression:"block.settings.btnPaddingLeft"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_18))]),e("SliderControl",{attrs:{min:0,max:100,step:1},model:{value:t.block.settings.borderRadius,callback:function(s){t.$set(t.block.settings,"borderRadius",s)},expression:"block.settings.borderRadius"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_36))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.btnStyle,expression:"block.settings.btnStyle"}],staticClass:"sp-form-select",on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.$set(t.block.settings,"btnStyle",s.target.multiple?e:e[0])}}},[e("option",{attrs:{value:""}},[t._v(t._s(t.txt_37))]),e("option",{attrs:{value:"2d"}},[t._v(t._s(t.txt_38))]),e("option",{attrs:{value:"3d"}},[t._v(t._s(t.txt_39))]),e("option",{attrs:{value:"ghost"}},[t._v(t._s(t.txt_40))]),e("option",{attrs:{value:"link"}},[t._v(t._s(t.txt_107))])])]),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_41))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.textShadow,expression:"block.settings.textShadow"}],staticClass:"sp-form-select",on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.$set(t.block.settings,"textShadow",s.target.multiple?e:e[0])}}},[e("option",{attrs:{value:""}},[t._v(t._s(t.txt_100))]),e("option",{attrs:{value:"1"}},[t._v(t._s(t.txt_101))]),e("option",{attrs:{value:"2"}},[t._v(t._s(t.txt_102))]),e("option",{attrs:{value:"3"}},[t._v(t._s(t.txt_103))]),e("option",{attrs:{value:"4"}},[t._v(t._s(t.txt_104))]),e("option",{attrs:{value:"5"}},[t._v(t._s(t.txt_105))]),e("option",{attrs:{value:"6"}},[t._v(t._s(t.txt_106))])])]),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_42))]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.block.settings.shadow,expression:"block.settings.shadow"}],staticClass:"sp-form-select",on:{change:function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.$set(t.block.settings,"shadow",s.target.multiple?e:e[0])}}},[e("option",{attrs:{value:""}},[t._v(t._s(t.txt_100))]),e("option",{attrs:{value:"1"}},[t._v(t._s(t.txt_101))]),e("option",{attrs:{value:"2"}},[t._v(t._s(t.txt_102))]),e("option",{attrs:{value:"3"}},[t._v(t._s(t.txt_103))]),e("option",{attrs:{value:"4"}},[t._v(t._s(t.txt_104))]),e("option",{attrs:{value:"5"}},[t._v(t._s(t.txt_105))]),e("option",{attrs:{value:"6"}},[t._v(t._s(t.txt_106))])])])]):t._e(),e("SpacingSectionControl",{attrs:{block:t.block}})],1):t._e()])},U=[],D=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("v-popover",{attrs:{offset:"10"}},[e("div",{ref:"colorpicker",staticClass:"sp-flex sp-items-center sp-justify-between sp-relative sp-cursor-pointer",on:{click:function(s){return t.togglePicker()}}},[e("span",{staticClass:"sp-text-sm"},[t._v(t._s(t.label))]),e("div",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-60 sp-text-neutral-60 hover:sp-text-white sp-flex sp-p-2px sp-rounded-full",class:{"sp-active":t.displayPicker}},[e("span",{staticClass:"color-picker-container sp-bg-white sp-flex sp-items-center sp-border-white sp-border-2 sp-rounded-full"},[e("span",{staticClass:"sp-bg-cv-transparent sp-h-6 sp-w-16"},[e("span",{staticClass:"current-color sp-h-6 sp-w-16 sp-rounded-full sp-cursor-pointer",style:"background-color: "+t.colorValue})])]),e("div",{staticClass:"sp-flex sp-align-center sp-pl-2 sp-pr-2"},[t.displayPicker?t._e():e("span",{staticClass:"sp-flex sp-items-center sp-justify-center sp-cursor-pointer"},[e("svg",{staticClass:"sp-fill-current sp-w-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5zm0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7z"}}),e("circle",{attrs:{cx:"6.5",cy:"11.5",r:"1.5"}}),e("circle",{attrs:{cx:"9.5",cy:"7.5",r:"1.5"}}),e("circle",{attrs:{cx:"14.5",cy:"7.5",r:"1.5"}}),e("circle",{attrs:{cx:"17.5",cy:"11.5",r:"1.5"}})])]),t.displayPicker?e("span",{staticClass:"sp-flex sp-items-center sp-justify-center sp-cursor-pointer"},[e("svg",{staticClass:"sp-fill-current sp-w-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})])]):t._e()])])]),e("template",{slot:"popover"},[e("div",{ref:"cpfloat",staticClass:"color-picker-float-overflow"},[e("div",{staticClass:"sp-flex"},[e("div",{staticClass:"sp-flex-grow sp-flex sp-flex-col"},[e("div",{staticClass:"sp-bg-neutral-5 sp-rounded-6px sp-px-2 sp-py-2 sp-mb-2 sp-mr-2"},[e("div",{staticClass:"sp-uppercase sp-text-10px sp-mb-2"},[t._v(t._s(t.txt_1)+":")]),e("div",{staticClass:"sp-grid sp-grid-cols-5 sp-gap-1"},[e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:t.shared.settings.document.settings.headerColor},on:{click:function(s){return t.setColor(t.shared.settings.document.settings.headerColor)}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:t.shared.settings.document.settings.textColor},on:{click:function(s){return t.setColor(t.shared.settings.document.settings.textColor)}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:t.shared.settings.document.settings.buttonColor},on:{click:function(s){return t.setColor(t.shared.settings.document.settings.buttonColor)}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:t.shared.settings.document.settings.linkColor},on:{click:function(s){return t.setColor(t.shared.settings.document.settings.linkColor)}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:t.shared.settings.document.settings.bgColor},on:{click:function(s){return t.setColor(t.shared.settings.document.settings.bgColor)}}})])]),e("div",{staticClass:"sp-bg-neutral-5 sp-rounded-6px sp-px-2 sp-py-2 sp-mb-2 sp-mr-2"},[e("div",{staticClass:"sp-uppercase sp-text-10px sp-mb-2"},[t._v(t._s(t.txt_2)+":")]),e("div",{staticClass:"sp-grid sp-grid-cols-5 sp-gap-1"},[e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#e53935"},on:{click:function(s){return t.setColor("#e53935")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#fb8c00"},on:{click:function(s){return t.setColor("#fb8c00")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#fdd835"},on:{click:function(s){return t.setColor("#fdd835")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#43a047"},on:{click:function(s){return t.setColor("#43a047")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#7cb342"},on:{click:function(s){return t.setColor("#7cb342")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#1e88e5"},on:{click:function(s){return t.setColor("#1e88e5")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#ffffff"},on:{click:function(s){return t.setColor("#ffffff")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#cccccc"},on:{click:function(s){return t.setColor("#cccccc")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#9e9e9e"},on:{click:function(s){return t.setColor("#9e9e9e")}}}),e("button",{staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-border sp-border-white",style:{background:"#000000"},on:{click:function(s){return t.setColor("#000000")}}})])]),e("div",{staticClass:"sp-bg-neutral-5 sp-rounded-6px sp-px-2 sp-py-2 sp-mr-2 sp-flex-grow"},[e("div",{staticClass:"sp-uppercase sp-text-10px sp-mb-2"},[t._v(t._s(t.txt_3)+":")]),e("div",{staticClass:"sp-grid sp-grid-cols-5 sp-gap-1"},t._l(t.shared.recent_colors,function(s,o){return e("button",{key:o,staticClass:"sp-rounded-full sp-w-6 sp-h-6 sp-bg-secondary sp-inline-block sp-border sp-border-white",style:{background:s},on:{click:function(e){return t.setColor(s)}}})}),0)])]),e("div",{},[e("chrome-picker",{attrs:{value:t.colors},on:{input:t.updateFromPicker}}),e("div",{staticClass:"sp-flex sp-justify-end"},[e("button",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-15 sp-text-neutral-80 sp-py-2 sp-px-3 sp-rounded sp-flex sp-items-center sp-mt-6 sp-text-xs sp-font-semibold sp-leading-none sp-mr-2",on:{click:t.clear_color}},[t._v(t._s(t.txt_4))]),e("button",{directives:[{name:"close-popover",rawName:"v-close-popover",value:!0,expression:"true"}],staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-15 sp-text-neutral-80 sp-py-2 sp-px-3 sp-rounded sp-flex sp-items-center sp-mt-6 sp-text-xs sp-font-semibold sp-leading-none",on:{click:t.close}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-mr-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(t._s(t.txt_5)+"\n ")])])],1)])])])],2)],1)},W=[],G=e("e814"),Z=e.n(G),J=(e("28a5"),e("c345")),q={name:"ColorPicker",data:function(){return{txt_1:Object(b["a"])("Global Colors","coming-soon"),txt_2:Object(b["a"])("Common Colors","coming-soon"),txt_3:Object(b["a"])("Recently Used","coming-soon"),txt_4:Object(b["a"])("Clear","coming-soon"),txt_5:Object(b["a"])("Close","coming-soon"),colors:{hex:"#000000"},colorValue:"",displayPicker:!1,shared:seedprod_store}},mounted:function(){this.setColor(this.color||"")},beforeDestroy:function(){this.update_recent_color()},methods:{clear_color:function(){this.colorValue="",this.$emit("input","")},update_recent_color:function(){0==this.shared.recent_colors.includes(this.colorValue)&&(this.shared.recent_colors.length>10&&this.shared.recent_colors.pop(),this.shared.recent_colors.unshift(this.colorValue))},setColor:function(t){this.updateColors(t),this.colorValue=t,this.$emit("input",t)},updateColors:function(t){if("#"==t.slice(0,1))this.colors={hex:t};else if("rgba"==t.slice(0,4)){var s=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),e="#"+((1<<24)+(Z()(s[0])<<16)+(Z()(s[1])<<8)+Z()(s[2])).toString(16).slice(1);this.colors={hex:e,a:s[3]}}},showPicker:function(){this.displayPicker=!0},close:function(){document.removeEventListener("click",this.documentClick),this.displayPicker=!1},hidePicker:function(){this.displayPicker=!1},togglePicker:function(){this.displayPicker?this.hidePicker():this.showPicker()},updateFromInput:function(){this.updateColors(this.colorValue),this.$emit("input",this.colorValue)},updateFromPicker:function(t){this.colors=t,1==t.rgba.a?this.colorValue=t.hex:this.colorValue="rgba("+t.rgba.r+", "+t.rgba.g+", "+t.rgba.b+", "+t.rgba.a+")",this.$emit("input",this.colorValue)},documentClick:function(t){var s=this.$refs.colorpicker,e="";lodash.isEmpty(t.target)||(e=t.target),s===e||s.contains(e)||!1!==e.classList.toString().includes("vc-")||"vc-chrome-toggle-icon"===e.parentElement.classList.toString()||this.hidePicker()}},watch:{displayPicker:function(t,s){0==t&&1==s&&this.update_recent_color()},colorValue:function(t){this.updateColors(t)},color:function(t,s){this.setColor(t)}},props:["color","label"],components:{"chrome-picker":J["Chrome"]}},Y=q,X=Object(w["a"])(Y,D,W,!1,null,null,null),K=X.exports,Q=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"sp-typography-control"},[e("div",{staticClass:"sp-flex sp-items-center sp-justify-between sp-relative sp-cursor-pointer sp-relative"},[e("label",[t._v(t._s(t.label_prefix)+" "+t._s(t.txt_1))]),e("div",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-60 hover:sp-text-white sp-flex sp-p-2px sp-rounded-full sp-text-14px sp-font-semibold sp-pl-2 sp-pr-4 sp-py-1",class:{"sp-active":t.display_typography},on:{click:function(s){return t.toggle_typography()}}},[e("span",{staticClass:"sp-flex sp-items-center sp-justify-center sp-items-center sp-w-5"},[t.display_typography?e("svg",{staticClass:"sp-fill-current sp-w-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}}),e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}})]):t._e(),t.display_typography?t._e():e("svg",{staticClass:"sp-fill-current sp-w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])]),t._v(" "+t._s(t.txt_2)+"\n ")]),t.display_typography?e("div",{staticClass:"sp-absolute sp-bg-white sp-top-0 sp-right-0 sp-p-4 sp-z-10 sp-rounded-md sp-shadow-xl sp-mt-8 sp-mb-8"},[e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_4))]),e("FontControl",{on:{change:function(s){return t.load_font(t.block.settings[t.pre+"font"],t.block.settings[t.pre+"fontVariant"])}},model:{value:t.block.settings[t.pre+"font"],callback:function(s){t.$set(t.block.settings,t.pre+"font",s)},expression:"block.settings[pre+'font']"}}),e("FontVariantControl",{attrs:{myfont:t.block.settings[t.pre+"font"]},on:{change:function(s){return t.load_font(t.block.settings[t.pre+"font"],t.block.settings[t.pre+"fontVarient"])}},model:{value:t.block.settings[t.pre+"fontVariant"],callback:function(s){t.$set(t.block.settings,t.pre+"fontVariant",s)},expression:"block.settings[pre+'fontVariant']"}})],1),e("div",{staticClass:"sp-flex sp-justify-between sp-items-center sp-my-2 sp-mt-4"},[e("div",{staticClass:"sp-flex"},[e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"desktop"==t.currently_editing_device},on:{click:function(s){return t.set_device("desktop")}}},[e("svg",{staticClass:"sp-w-4 sp-h-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7l-2 3v1h8v-1l-2-3h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 12H3V4h18v10z"}})])]),e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"mobile"==t.currently_editing_device},on:{click:function(s){return t.set_device("mobile")}}},[e("svg",{staticClass:"sp-w-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1zm-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5-4H7V4h9v14z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])])]),e("div")]),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_5))]),"desktop"==t.currently_editing_device?e("SliderControl",{attrs:{min:10,max:72,step:1},model:{value:t.block.settings[t.pre+"fontSize"],callback:function(s){t.$set(t.block.settings,t.pre+"fontSize",s)},expression:"block.settings[pre+'fontSize']"}}):e("SliderControl",{attrs:{min:10,max:72,step:1},model:{value:t.block.settings[t.pre+"fontSize_mobile"],callback:function(s){t.$set(t.block.settings,t.pre+"fontSize_mobile",s)},expression:"block.settings[pre+'fontSize_mobile']"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_6))]),"desktop"==t.currently_editing_device?e("SliderControl",{attrs:{min:.5,max:10,step:.1},model:{value:t.block.settings[t.pre+"lineHeight"],callback:function(s){t.$set(t.block.settings,t.pre+"lineHeight",s)},expression:"block.settings[pre+'lineHeight']"}}):e("SliderControl",{attrs:{min:.5,max:10,step:.1},model:{value:t.block.settings[t.pre+"lineHeight_mobile"],callback:function(s){t.$set(t.block.settings,t.pre+"lineHeight_mobile",s)},expression:"block.settings[pre+'lineHeight_mobile']"}})],1),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_7))]),"desktop"==t.currently_editing_device?e("SliderControl",{attrs:{min:0,max:50,step:1},model:{value:t.block.settings[t.pre+"letterSpacing"],callback:function(s){t.$set(t.block.settings,t.pre+"letterSpacing",s)},expression:"block.settings[pre+'letterSpacing']"}}):e("SliderControl",{attrs:{min:0,max:50,step:1},model:{value:t.block.settings[t.pre+"letterSpacing_mobile"],callback:function(s){t.$set(t.block.settings,t.pre+"letterSpacing_mobile",s)},expression:"block.settings[pre+'letterSpacing_mobile']"}})],1),e("div",{staticClass:"sp-flex"},[e("div",{staticClass:"sp-form-group sp-w-full"},[e("label",[t._v(t._s(t.txt_8))]),e("div",{staticClass:"sp-flex "},[e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":1==t.block.settings[t.pre+"typographyBold"]},on:{click:function(s){return t.update_style("bold")}}},[e("svg",{staticClass:"sp-w-5 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])]),e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":1==t.block.settings[t.pre+"typographyItalic"]},on:{click:function(s){return t.update_style("italic")}}},[e("svg",{staticClass:"sp-w-5 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}})])]),e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":1==t.block.settings[t.pre+"typographyUnderline"]},on:{click:function(s){return t.update_style("underline")}}},[e("svg",{staticClass:"sp-w-5 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e("path",{attrs:{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}})])])])]),e("div",{staticClass:"sp-form-group sp-w-full"},[e("label",[t._v(t._s(t.txt_9))]),e("AlignControl",{model:{value:t.block.settings[t.pre+"align"],callback:function(s){t.$set(t.block.settings,t.pre+"align",s)},expression:"block.settings[pre+'align']"}})],1)]),e("div",{staticClass:"sp-form-group"},[e("label",[t._v(t._s(t.txt_10))]),e("div",{staticClass:"sp-flex ",attrs:{id:"sp-letter-case-control"}},[e("button",{staticClass:"sp-w-20",class:{"sp-active":""==t.block.settings[t.pre+"typographyLetterCase"]},on:{click:function(s){t.block.settings[t.pre+"typographyLetterCase"]=""}}},[t._v(t._s(t.txt_11))]),e("button",{class:{"sp-active":"uppercase"==t.block.settings[t.pre+"typographyLetterCase"]},on:{click:function(s){t.block.settings[t.pre+"typographyLetterCase"]="uppercase"}}},[t._v("AG")]),e("button",{class:{"sp-active":"capitalize"==t.block.settings[t.pre+"typographyLetterCase"]},on:{click:function(s){t.block.settings[t.pre+"typographyLetterCase"]="capitalize"}}},[t._v("Ag")]),e("button",{class:{"sp-active":"lowercase"==t.block.settings[t.pre+"typographyLetterCase"]},on:{click:function(s){t.block.settings[t.pre+"typographyLetterCase"]="lowercase"}}},[t._v("ag")])])]),e("div",{staticClass:"sp-flex sp-justify-end sp-border-t sp-border-neutral-20 sp-mt-6"},[e("button",{staticClass:"sp-bg-neutral-10 hover:sp-bg-neutral-15 sp-text-neutral-80 sp-py-2 sp-px-3 sp-rounded sp-flex sp-items-center sp-mt-4 sp-text-xs sp-font-semibold sp-leading-none",on:{click:function(s){t.display_typography=!1}}},[e("svg",{staticClass:"sp-fill-current sp-w-4 sp-mr-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),t._v(t._s(t.txt_3)+"\n ")])])]):t._e()])])},tt=[],st=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{ref:"font",staticClass:"sp-mb-1"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.font,expression:"font"}],staticClass:"sp-form-select sp-max-w-full",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.font=s.target.multiple?e:e[0]},t.update_font]}},[e("option",{attrs:{value:""}},[t._v(t._s(t.txt_1))]),t._l(t.shared.setup_page_meta.googlefonts,function(s,o){return e("optgroup",{key:o,attrs:{label:o}},t._l(s,function(s,i){return e("option",{key:i,domProps:{value:i}},[e("span","Standard Fonts"==o?[t._v(t._s(s))]:[t._v(t._s(i))])])}),0)})],2)])},et=[],ot={name:"FontControl",data:function(){return{txt_1:Object(b["a"])("Default","coming-soon"),font:this.value,shared:seedprod_store}},mounted:function(){},methods:{update_font:function(){this.$emit("input",this.font),this.$emit("change",this.font)}},watch:{value:function(t,s){this.font=t,this.update_font()}},props:["value"]},it=ot,at=Object(w["a"])(it,st,et,!1,null,null,null),nt=at.exports,lt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{ref:"variant"},[t.shared.setup_page_meta.googlefonts["Standard Fonts"][t.myfont]?e("select",{directives:[{name:"model",rawName:"v-model",value:t.variant,expression:"variant"}],staticClass:"sp-form-select",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.variant=s.target.multiple?e:e[0]},t.update_variant]}},[e("option",{attrs:{value:""}},[t._v(t._s(t.txt_1))]),e("option",{attrs:{value:"400"}},[t._v(t._s(t.txt_2))]),e("option",{attrs:{value:"700"}},[t._v(t._s(t.txt_3))])]):t._e(),t.shared.setup_page_meta.googlefonts["Google Fonts"][t.myfont]?e("select",{directives:[{name:"model",rawName:"v-model",value:t.variant,expression:"variant"}],staticClass:"sp-form-select",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});t.variant=s.target.multiple?e:e[0]},t.update_variant]}},t._l(t.shared.setup_page_meta.googlefonts["Google Fonts"][t.myfont].variants,function(s,o){return e("option",{key:o,domProps:{value:s.id}},[t._v(t._s(s.name))])}),0):t._e()])},rt=[],ct={name:"FontVariantControl",data:function(){return{txt_1:Object(b["a"])("Select a Font Weight","coming-soon"),txt_2:Object(b["a"])("Normal 400","coming-soon"),txt_3:Object(b["a"])("Bold 700","coming-soon"),variant:this.value,shared:seedprod_store}},mounted:function(){},methods:{update_variant:function(){this.$emit("input",this.variant),this.$emit("change",this.variant)}},watch:{value:function(t,s){this.variant=t,this.update_variant()}},props:["value","myfont"]},pt=ct,dt=Object(w["a"])(pt,lt,rt,!1,null,null,null),gt=dt.exports,ut=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{ref:"align",staticClass:"sp-align-control"},[e("div",{staticClass:"sp-flex sp-align-center"},[e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"left"==t.caligned},on:{click:function(s){return t.update_align("left")}}},["alt"==t.icons?e("svg",{staticClass:"sp-w-4 sp-fill-current sp-transform sp-rotate-90",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]):e("svg",{staticClass:"sp-w-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}})])]),e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"center"==t.caligned},on:{click:function(s){return t.update_align("center")}}},["alt"==t.icons?e("svg",{staticClass:"sp-w-4 sp-fill-current sp-transform sp-rotate-90",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M8 19h3v4h2v-4h3l-4-4-4 4zm8-14h-3V1h-2v4H8l4 4 4-4zM4 11v2h16v-2H4z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]):e("svg",{staticClass:"sp-w-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}})])]),e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"right"==t.caligned},on:{click:function(s){return t.update_align("right")}}},["alt"==t.icons?e("svg",{staticClass:"sp-w-4 sp-fill-current sp-transform sp--rotate-90",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"}}),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]):e("svg",{staticClass:"sp-w-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}})])]),t.justify?e("button",{staticClass:"sp-w-32px sp-h-32px sp-bg-neutral-10 sp-rounded-full sp-flex sp-justify-center sp-items-center sp-mr-1 hover:sp-bg-neutral-15",class:{"sp-active":"full"==t.caligned},on:{click:function(s){return t.update_align("full")}}},["alt"==t.icons?e("svg",{staticClass:"sp-w-4 sp-fill-current sp-transform sp--rotate-90",attrs:{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",viewBox:"0 0 24 24"}},[e("g",[e("rect",{attrs:{fill:"none",height:"24",width:"24"}})]),e("g",[e("g"),e("polygon",{attrs:{points:"13,6.99 16,6.99 12,3 8,6.99 11,6.99 11,17.01 8,17.01 12,21 16,17.01 13,17.01"}})])]):e("svg",{staticClass:"sp-w-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z"}})])]):t._e()])])},ht=[],mt={name:"AlignControl",data:function(){return{align:this.value}},mounted:function(){},methods:{update_align:function(t){this.align=t,this.$emit("input",this.align)}},computed:{caligned:function(){return this.value}},props:["value","justify","icons"]},_t=mt,vt=Object(w["a"])(_t,ut,ht,!1,null,null,null),bt=vt.exports,ft=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{ref:"slider",staticClass:"sp-slider-control"},[e("div",{staticClass:"sp-flex"},[e("div",{staticClass:"sp-flex-1 sp-flex sp-items-center w-full sp-mr-3"},[e("vue-slider",{staticStyle:{width:"100%"},attrs:{value:t.value,silent:!0,tooltip:"none",min:t.min,max:t.max,interval:t.step},on:{change:t.update_v,error:t.error}})],1),e("div",{staticClass:"sp-w-16"},[e("input",{staticClass:"sp-form-input sp-w-16",attrs:{step:t.step,type:"number"},domProps:{value:t.value},on:{input:function(s){return t.$emit("input",s.target.value)},wheel:t.scroll}})])])])},xt=[],wt={VALUE:1,INTERVAL:2,MIN:3,MAX:4,ORDER:5},kt={name:"SliderControl",data:function(){return{errorMsg:""}},mounted:function(){},methods:{scroll:function(t,s){},update_v:function(t){this.clearErrorMsg(),this.$emit("input",t)},error:function(t,s){switch(t){case wt.MIN:break;case wt.MAX:break;case wt.VALUE:break}this.errorMsg=s},clearErrorMsg:function(){this.errorMsg=""}},watch:{},props:["value","min","max","step"]},Ct=kt,yt=Object(w["a"])(Ct,ft,xt,!1,null,null,null),zt=yt.exports,Ot={name:"TypographyControl",mixins:[v["a"]],data:function(){return{txt_1:Object(b["a"])("Typography","coming-soon"),txt_2:Object(b["a"])("Edit","coming-soon"),txt_3:Object(b["a"])("Close","coming-soon"),txt_4:Object(b["a"])("Font Family","coming-soon"),txt_5:Object(b["a"])("Font Size","coming-soon"),txt_6:Object(b["a"])("Line Height","coming-soon"),txt_7:Object(b["a"])("Letter Spacing","coming-soon"),txt_8:Object(b["a"])("Style","coming-soon"),txt_9:Object(b["a"])("Alignment","coming-soon"),txt_10:Object(b["a"])("Letter Case","coming-soon"),txt_11:Object(b["a"])("Normal","coming-soon"),currently_editing_device:"desktop",display_typography:!1,shared:seedprod_store}},mounted:function(){},methods:{toggle_typography:function(){this.display_typography=!this.display_typography},update_style:function(t){"bold"==t&&(this.block.settings[this.pre+"typographyBold"]=!this.block.settings[this.pre+"typographyBold"]),"underline"==t&&(this.block.settings[this.pre+"typographyUnderline"]=!this.block.settings[this.pre+"typographyUnderline"]),"italic"==t&&(this.block.settings[this.pre+"typographyItalic"]=!this.block.settings[this.pre+"typographyItalic"])},set_device:function(t){this.currently_editing_device=t}},watch:{"block.settings.fontSize_mobile":function(t,s){this.debounce_update_mobile_css()},"block.settings.lineHeight_mobile":function(t,s){this.debounce_update_mobile_css()},"block.settings.letterSpacing_mobile":function(t,s){this.debounce_update_mobile_css()}},computed:{label_prefix:function(){var t="";return void 0!==this.prefix&&(t=this.prefix.charAt(0).toUpperCase()+this.prefix.slice(1)),t},pre:function(){return void 0===this.prefix?"":this.prefix}},components:{FontControl:nt,FontVariantControl:gt,AlignControl:bt,SliderControl:zt},props:{block:Object,prefix:String}},jt=Ot,Mt=Object(w["a"])(jt,Q,tt,!1,null,null,null),St=Mt.exports,Ht=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{ref:"fapicker sp-relative"},["min"==t.type?e("div",[this.value?e("button",{staticClass:"sp-border-r sp-border-neutral-20 sp-rounded-tl-md sp-rounded-bl-md sp-w-42px sp-h-42px sp-inline-block sp-border-r-0 sp-text-lg sp-flex sp-items-center sp-justify-center sp-bg-white sp-text-neutral-80",on:{click:function(s){return t.togglePicker()}}},[e("i",{class:this.value})]):e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:"Add Icon",delay:{show:1500,hide:0}},expression:"{content:'Add Icon',delay:{ show: 1500, hide: 0 }}"}],staticClass:"sp-border-r sp-border-neutral-20 sp-rounded-tl-md sp-rounded-bl-md sp-w-42px sp-h-42px sp-inline-block sp-border-r-0 sp-text-lg sp-flex sp-items-center sp-justify-center sp-bg-neutral-10 sp-text-neutral-40 hover:sp-bg-white hover:sp-text-neutral-80",on:{click:function(s){return t.togglePicker()}}},[e("i",{staticClass:"far fa-image"})])]):e("div",[this.value?t._e():e("div",[e("div",{staticClass:"sp-border sp-border-neutral-20 sp-rounded-md"},[e("div",{staticClass:"sp-border-2 sp-border-white sp-bg-neutral-10 sp-text-neutral-60 sp-font-semibold sp-flex sp-items-center sp-justify-center sp-flex-col sp-p-4 sp-rounded-md"},[e("svg",{staticClass:"sp-fill-current sp-w-12 sp-h-12",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}})]),e("div",{staticClass:"sp-flex sp-items-center sp-justify-between sp-mt-2"},[e("button",{staticClass:"sp-bg-neutral-15 hover:sp-bg-neutral-20 sp-text-neutral-80 sp-py-1 sp-px-2 sp-rounded sp-flex sp-items-center sp-mt-1 sp-text-11px sp-font-semibold",on:{click:function(s){return t.togglePicker()}}},[t._v(t._s(t.txt_4))])])])])]),this.value?e("div",[e("div",{staticClass:"sp-form-input sp-py-12 sp-flex sp-items-center sp-justify-center sp-cursor-pointer sp-relative",on:{mouseover:function(s){t.show_hover=!0},mouseleave:function(s){t.show_hover=!1}}},[e("i",{staticClass:"fa-fw fa-lg",class:this.value,staticStyle:{"font-size":"72px"}}),e("div",{directives:[{name:"show",rawName:"v-show",value:t.show_hover,expression:"show_hover"}],staticClass:"sp-form-input sp-absolute sp-top-0 sp-left-0 sp-hover-dim sp-w-full sp-h-full"},[e("div",{staticClass:"sp-flex sp-items-center sp-justify-center sp-h-full"},[e("button",{staticClass:"sp-mr-1 sp-bg-primary hover:sp-bg-primary-lighter sp-text-white sp-w-10 sp-h-10 sp-rounded-full sp-flex sp-items-center sp-justify-center",on:{click:function(s){return s.stopPropagation(),t.togglePicker()}}},[e("svg",{staticClass:"sp-w-4 sp-h-4 sp-fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M0 0h24v24H0V0z",fill:"none"}}),e("path",{attrs:{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67l1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}})])]),e("button",{staticClass:"p-ml-1 sp-bg-neutral hover:sp-b
|
|