Blocksy Companion - Version 1.7.62

Version Description

Download this release

Release Info

Developer creativethemeshq
Plugin Icon wp plugin Blocksy Companion
Version 1.7.62
Comparing to
See all releases

Code changes from version 1.7.61 to 1.7.62

Files changed (178) hide show
  1. blocksy-companion.php +1 -1
  2. framework/extensions/cookies-consent/static/bundle/main.css +1 -1
  3. framework/extensions/mailchimp/static/bundle/main.css +1 -1
  4. framework/extensions/product-reviews/static/bundle/main-admin.css +1 -1
  5. framework/extensions/product-reviews/static/bundle/main.css +1 -1
  6. framework/extensions/widgets/static/bundle/main.css +1 -1
  7. readme.txt +4 -1
  8. static/bundle/dashboard.css +1 -1
  9. static/bundle/options.css +1 -1
  10. trunk/LICENSE.txt +339 -0
  11. trunk/blocksy-companion.php +131 -0
  12. trunk/framework/autoload.php +135 -0
  13. trunk/framework/cache-reset-manager.php +175 -0
  14. trunk/framework/cli.php +82 -0
  15. trunk/framework/dashboard.php +149 -0
  16. trunk/framework/extensions-manager-api.php +101 -0
  17. trunk/framework/extensions-manager.php +338 -0
  18. trunk/framework/extensions/cookies-consent/config.php +6 -0
  19. trunk/framework/extensions/cookies-consent/customizer.php +224 -0
  20. trunk/framework/extensions/cookies-consent/extension.php +93 -0
  21. trunk/framework/extensions/cookies-consent/global.php +66 -0
  22. trunk/framework/extensions/cookies-consent/helpers.php +93 -0
  23. trunk/framework/extensions/cookies-consent/readme.php +38 -0
  24. trunk/framework/extensions/cookies-consent/static/bundle/main.css +8 -0
  25. trunk/framework/extensions/cookies-consent/static/bundle/main.js +8 -0
  26. trunk/framework/extensions/cookies-consent/static/bundle/sync.js +1 -0
  27. trunk/framework/extensions/cookies-consent/static/images/type-1.svg +37 -0
  28. trunk/framework/extensions/cookies-consent/static/images/type-2.svg +34 -0
  29. trunk/framework/extensions/cookies-consent/static/js/ct-events.js +270 -0
  30. trunk/framework/extensions/cookies-consent/static/js/lazy-load-helpers.js +20 -0
  31. trunk/framework/extensions/cookies-consent/static/js/main.js +87 -0
  32. trunk/framework/extensions/cookies-consent/static/js/sync.js +65 -0
  33. trunk/framework/extensions/cookies-consent/static/js/sync/helpers.js +145 -0
  34. trunk/framework/extensions/cookies-consent/static/js/variables.js +43 -0
  35. trunk/framework/extensions/cookies-consent/static/sass/main.scss +173 -0
  36. trunk/framework/extensions/mailchimp/admin-static/bundle/1.2c9ebf0a36c6c732fee6.js +14 -0
  37. trunk/framework/extensions/mailchimp/admin-static/bundle/2.976c8f43abfe584b1a9d.js +1 -0
  38. trunk/framework/extensions/mailchimp/admin-static/bundle/main.js +1 -0
  39. trunk/framework/extensions/mailchimp/admin-static/bundle/sync.js +1 -0
  40. trunk/framework/extensions/mailchimp/admin-static/js/ListPicker.js +22 -0
  41. trunk/framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js +124 -0
  42. trunk/framework/extensions/mailchimp/admin-static/js/main.js +10 -0
  43. trunk/framework/extensions/mailchimp/admin-static/js/public-path.js +1 -0
  44. trunk/framework/extensions/mailchimp/admin-static/js/sync.js +78 -0
  45. trunk/framework/extensions/mailchimp/admin-static/js/variables.js +52 -0
  46. trunk/framework/extensions/mailchimp/config.php +7 -0
  47. trunk/framework/extensions/mailchimp/ct-mailchimp/options.php +125 -0
  48. trunk/framework/extensions/mailchimp/ct-mailchimp/view.php +109 -0
  49. trunk/framework/extensions/mailchimp/ct-mailchimp/widget.php +22 -0
  50. trunk/framework/extensions/mailchimp/customizer.php +270 -0
  51. trunk/framework/extensions/mailchimp/dashboard-static/bundle/main.js +14 -0
  52. trunk/framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js +157 -0
  53. trunk/framework/extensions/mailchimp/dashboard-static/js/ListPicker.js +149 -0
  54. trunk/framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js +95 -0
  55. trunk/framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js +80 -0
  56. trunk/framework/extensions/mailchimp/dashboard-static/js/main.js +15 -0
  57. trunk/framework/extensions/mailchimp/extension.php +144 -0
  58. trunk/framework/extensions/mailchimp/global.php +103 -0
  59. trunk/framework/extensions/mailchimp/helpers.php +140 -0
  60. trunk/framework/extensions/mailchimp/mailchimp-manager.php +147 -0
  61. trunk/framework/extensions/mailchimp/pre-boot.php +111 -0
  62. trunk/framework/extensions/mailchimp/readme.php +37 -0
  63. trunk/framework/extensions/mailchimp/static/bundle/main.css +8 -0
  64. trunk/framework/extensions/mailchimp/static/bundle/main.js +1 -0
  65. trunk/framework/extensions/mailchimp/static/js/main.js +82 -0
  66. trunk/framework/extensions/mailchimp/static/sass/main.scss +40 -0
  67. trunk/framework/extensions/mailchimp/static/sass/single-block.scss +70 -0
  68. trunk/framework/extensions/mailchimp/static/sass/widget.scss +39 -0
  69. trunk/framework/extensions/product-reviews/config.php +12 -0
  70. trunk/framework/extensions/product-reviews/extension.php +316 -0
  71. trunk/framework/extensions/product-reviews/helpers.php +39 -0
  72. trunk/framework/extensions/product-reviews/metabox.php +198 -0
  73. trunk/framework/extensions/product-reviews/pre-boot.php +65 -0
  74. trunk/framework/extensions/product-reviews/static/bundle/dashboard.js +6 -0
  75. trunk/framework/extensions/product-reviews/static/bundle/main-admin.css +8 -0
  76. trunk/framework/extensions/product-reviews/static/bundle/main.css +8 -0
  77. trunk/framework/extensions/product-reviews/static/js/EditSettings.js +141 -0
  78. trunk/framework/extensions/product-reviews/static/js/ProductReviews.js +100 -0
  79. trunk/framework/extensions/product-reviews/static/js/dashboard.js +10 -0
  80. trunk/framework/extensions/product-reviews/static/sass/actions.scss +18 -0
  81. trunk/framework/extensions/product-reviews/static/sass/description.scss +5 -0
  82. trunk/framework/extensions/product-reviews/static/sass/main-admin.scss +8 -0
  83. trunk/framework/extensions/product-reviews/static/sass/main.scss +23 -0
  84. trunk/framework/extensions/product-reviews/static/sass/quick-info.scss +32 -0
  85. trunk/framework/extensions/product-reviews/static/sass/scores.scss +83 -0
  86. trunk/framework/extensions/product-reviews/static/sass/slider.scss +36 -0
  87. trunk/framework/extensions/product-reviews/static/sass/title.scss +6 -0
  88. trunk/framework/extensions/product-reviews/views/single-top.php +243 -0
  89. trunk/framework/extensions/trending/config.php +6 -0
  90. trunk/framework/extensions/trending/customizer.php +193 -0
  91. trunk/framework/extensions/trending/extension.php +76 -0
  92. trunk/framework/extensions/trending/global.php +53 -0
  93. trunk/framework/extensions/trending/helpers.php +195 -0
  94. trunk/framework/extensions/trending/static/bundle/main.js +1 -0
  95. trunk/framework/extensions/trending/static/bundle/sync.js +1 -0
  96. trunk/framework/extensions/trending/static/js/main.js +17 -0
  97. trunk/framework/extensions/trending/static/js/sync.js +42 -0
  98. trunk/framework/extensions/trending/static/js/trending-block.js +139 -0
  99. trunk/framework/extensions/widgets/config.php +5 -0
  100. trunk/framework/extensions/widgets/extension.php +36 -0
  101. trunk/framework/extensions/widgets/static/bundle/main.css +8 -0
  102. trunk/framework/extensions/widgets/static/sass/about-me.scss +67 -0
  103. trunk/framework/extensions/widgets/static/sass/facebook.scss +37 -0
  104. trunk/framework/extensions/widgets/static/sass/main.scss +7 -0
  105. trunk/framework/extensions/widgets/static/sass/posts.scss +132 -0
  106. trunk/framework/extensions/widgets/static/sass/quote.scss +39 -0
  107. trunk/framework/extensions/widgets/static/sass/social-icons.scss +23 -0
  108. trunk/framework/extensions/widgets/widgets/ct-about-me/helpers.php +18 -0
  109. trunk/framework/extensions/widgets/widgets/ct-about-me/options.php +235 -0
  110. trunk/framework/extensions/widgets/widgets/ct-about-me/view.php +139 -0
  111. trunk/framework/extensions/widgets/widgets/ct-about-me/widget.php +22 -0
  112. trunk/framework/extensions/widgets/widgets/ct-advertisement/options.php +84 -0
  113. trunk/framework/extensions/widgets/widgets/ct-advertisement/view.php +61 -0
  114. trunk/framework/extensions/widgets/widgets/ct-advertisement/widget.php +22 -0
  115. trunk/framework/extensions/widgets/widgets/ct-contact-info/options.php +312 -0
  116. trunk/framework/extensions/widgets/widgets/ct-contact-info/view.php +70 -0
  117. trunk/framework/extensions/widgets/widgets/ct-contact-info/widget.php +22 -0
  118. trunk/framework/extensions/widgets/widgets/ct-facebook/options.php +52 -0
  119. trunk/framework/extensions/widgets/widgets/ct-facebook/view.php +61 -0
  120. trunk/framework/extensions/widgets/widgets/ct-facebook/widget.php +22 -0
  121. trunk/framework/extensions/widgets/widgets/ct-posts/options.php +329 -0
  122. trunk/framework/extensions/widgets/widgets/ct-posts/view.php +224 -0
  123. trunk/framework/extensions/widgets/widgets/ct-posts/widget.php +23 -0
  124. trunk/framework/extensions/widgets/widgets/ct-quote/options.php +55 -0
  125. trunk/framework/extensions/widgets/widgets/ct-quote/view.php +57 -0
  126. trunk/framework/extensions/widgets/widgets/ct-quote/widget.php +22 -0
  127. trunk/framework/extensions/widgets/widgets/ct-socials/options.php +106 -0
  128. trunk/framework/extensions/widgets/widgets/ct-socials/view.php +53 -0
  129. trunk/framework/extensions/widgets/widgets/ct-socials/widget.php +23 -0
  130. trunk/framework/features/conditions-manager.php +487 -0
  131. trunk/framework/features/customizer-options-manager.php +206 -0
  132. trunk/framework/features/demo-install.php +340 -0
  133. trunk/framework/features/demo-install/child-theme.php +121 -0
  134. trunk/framework/features/demo-install/content-eraser.php +179 -0
  135. trunk/framework/features/demo-install/content-export.php +663 -0
  136. trunk/framework/features/demo-install/content-installer.php +416 -0
  137. trunk/framework/features/demo-install/fake-content-eraser.php +273 -0
  138. trunk/framework/features/demo-install/install-finish.php +194 -0
  139. trunk/framework/features/demo-install/options-export.php +123 -0
  140. trunk/framework/features/demo-install/options-import.php +400 -0
  141. trunk/framework/features/demo-install/parsers.php +701 -0
  142. trunk/framework/features/demo-install/plugins-uninstaller.php +44 -0
  143. trunk/framework/features/demo-install/required-plugins.php +85 -0
  144. trunk/framework/features/demo-install/widgets-export.php +67 -0
  145. trunk/framework/features/demo-install/widgets-import.php +277 -0
  146. trunk/framework/features/demo-install/wp-importer.php +1348 -0
  147. trunk/framework/features/dynamic-css.php +270 -0
  148. trunk/framework/features/google-analytics.php +110 -0
  149. trunk/framework/features/header.php +542 -0
  150. trunk/framework/features/header/account-modal.php +139 -0
  151. trunk/framework/features/header/header-options.php +178 -0
  152. trunk/framework/features/header/items/account/config.php +25 -0
  153. trunk/framework/features/header/items/account/dynamic-styles.php +460 -0
  154. trunk/framework/features/header/items/account/options.php +946 -0
  155. trunk/framework/features/header/items/account/sync.js +336 -0
  156. trunk/framework/features/header/items/account/view.php +56 -0
  157. trunk/framework/features/header/items/account/views/login.php +97 -0
  158. trunk/framework/features/header/items/account/views/logout.php +53 -0
  159. trunk/framework/features/opengraph-meta-data.php +224 -0
  160. trunk/framework/helpers/blocksy-integration.php +177 -0
  161. trunk/framework/helpers/helpers.php +102 -0
  162. trunk/framework/theme-integration.php +356 -0
  163. trunk/framework/views/blocksy-posts.php +156 -0
  164. trunk/framework/views/optin.php +6 -0
  165. trunk/framework/widgets-manager.php +201 -0
  166. trunk/freemius-pricing/178afa6030e76635dbe835e111d2c507.png +0 -0
  167. trunk/freemius-pricing/27b5a722a5553d9de0170325267fccec.png +0 -0
  168. trunk/freemius-pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png +0 -0
  169. trunk/freemius-pricing/5480ed23b199531a8cbc05924f26952b.png +0 -0
  170. trunk/freemius-pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg +402 -0
  171. trunk/freemius-pricing/c03f665db27af43971565560adfba594.png +0 -0
  172. trunk/freemius-pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png +0 -0
  173. trunk/freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png +0 -0
  174. trunk/freemius-pricing/e366d70661d8ad2493bd6afbd779f125.png +0 -0
  175. trunk/freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png +0 -0
  176. trunk/freemius-pricing/f928f1be99776af83e8e6be4baf8ffe7.svg +227 -0
  177. trunk/freemius-pricing/fde48e4609a6ddc11d639fc2421f2afd.png +0 -0
  178. trunk/freemius-pricing/freemius-pricing.js +8914 -0
blocksy-companion.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
- Version: 1.7.61
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
+ Version: 1.7.62
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
framework/extensions/cookies-consent/static/bundle/main.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/mailchimp/static/bundle/main.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main-admin.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/widgets/static/bundle/main.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires PHP: 7.0
5
  Tested up to: 5.6
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- Stable tag: 1.7.61
9
 
10
  == Description ==
11
 
@@ -23,6 +23,9 @@ It runs and adds its enhancements only if the Blocksy theme is installed and act
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
 
 
 
26
  1.7.61: 2021-02-23
27
  - Fix: Dashboard JavaScript fixes
28
 
5
  Tested up to: 5.6
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ Stable tag: 1.7.62
9
 
10
  == Description ==
11
 
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
26
+ 1.7.62: 2021-02-23
27
+ - Fix: Dashboard JavaScript fixes
28
+
29
  1.7.61: 2021-02-23
30
  - Fix: Dashboard JavaScript fixes
31
 
static/bundle/dashboard.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
static/bundle/options.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.7.61
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.7.62
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
trunk/LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the origina
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ {signature of Ty Coon}, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License
trunk/blocksy-companion.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Blocksy Companion
5
+ Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
+ Version: 1.7.62
7
+ Author: CreativeThemes
8
+ Author URI: https://creativethemes.com
9
+ Text Domain: blc
10
+ Domain Path: /languages/
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+ */
14
+
15
+ if ( !defined( 'ABSPATH' ) ) {
16
+ exit;
17
+ // Exit if accessed directly.
18
+ }
19
+
20
+
21
+ if ( function_exists( 'blc_fs' ) ) {
22
+ blc_fs()->set_basename( false, __FILE__ );
23
+ } else {
24
+
25
+ if ( !function_exists( 'blc_fs' ) ) {
26
+ global $blc_fs ;
27
+
28
+ if ( !isset( $blc_fs ) ) {
29
+ if ( !defined( 'WP_FS__PRODUCT_5115_MULTISITE' ) ) {
30
+ define( 'WP_FS__PRODUCT_5115_MULTISITE', true );
31
+ }
32
+ require_once dirname( __FILE__ ) . '/freemius/start.php';
33
+ $has_account = true;
34
+ $instance = \Freemius::instance( 5115, 'blocksy-companion', true );
35
+
36
+ if ( in_array( 'white-label', get_option( 'blocksy_active_extensions', [] ) ) && $instance->is_plan( 'agency' ) ) {
37
+ $settings = get_option( 'blocksy_ext_white_label_settings', [] );
38
+ if ( $settings && isset( $settings['hide_billing_account'] ) && $settings['hide_billing_account'] ) {
39
+ $has_account = false;
40
+ }
41
+ }
42
+
43
+ $blc_fs = fs_dynamic_init( array(
44
+ 'id' => '5115',
45
+ 'slug' => 'blocksy-companion',
46
+ 'premium_slug' => 'blocksy-companion-pro',
47
+ 'type' => 'plugin',
48
+ 'public_key' => 'pk_b00a5cbae90b2e948015a7d0710f5',
49
+ 'premium_suffix' => 'PRO',
50
+ 'is_premium' => false,
51
+ 'has_addons' => false,
52
+ 'has_paid_plans' => true,
53
+ 'menu' => ( true ? [
54
+ 'slug' => 'ct-dashboard',
55
+ 'support' => false,
56
+ 'contact' => false,
57
+ 'pricing' => true,
58
+ 'account' => $has_account,
59
+ ] : [
60
+ 'support' => false,
61
+ 'contact' => false,
62
+ 'pricing' => false,
63
+ 'account' => false,
64
+ ] ),
65
+ 'is_live' => true,
66
+ ) );
67
+ function blc_fs()
68
+ {
69
+ global $blc_fs ;
70
+ return $blc_fs;
71
+ }
72
+
73
+ blc_fs();
74
+ do_action( 'blc_fs_loaded' );
75
+ blc_fs()->add_filter( 'freemius_pricing_js_path', function ( $d ) {
76
+ // return BLOCKSY_PATH . 'freemius-pricing/freemius-pricing.js';
77
+ // Only in DEV!!
78
+ return WP_CONTENT_DIR . '/plugins/blocksy-companion/freemius-pricing/freemius-pricing.js';
79
+ } );
80
+ }
81
+
82
+ }
83
+
84
+ define( 'BLOCKSY__FILE__', __FILE__ );
85
+ define( 'BLOCKSY_PLUGIN_BASE', plugin_basename( BLOCKSY__FILE__ ) );
86
+ define( 'BLOCKSY_PATH', plugin_dir_path( BLOCKSY__FILE__ ) );
87
+ define( 'BLOCKSY_URL', plugin_dir_url( BLOCKSY__FILE__ ) );
88
+ add_action( 'init', function () {
89
+ /**
90
+ * Load Blocksy textdomain.
91
+ *
92
+ * Load gettext translate for Blocksy text domain.
93
+ */
94
+ load_plugin_textdomain( 'blc', false, dirname( BLOCKSY_PLUGIN_BASE ) . '/languages' );
95
+ } );
96
+
97
+ if ( !version_compare( PHP_VERSION, '7.0', '>=' ) ) {
98
+ add_action( 'admin_notices', 'blc_fail_php_version' );
99
+ } elseif ( !version_compare( get_bloginfo( 'version' ), '5.0', '>=' ) ) {
100
+ add_action( 'admin_notices', 'blc_fail_wp_version' );
101
+ } else {
102
+ require BLOCKSY_PATH . 'plugin.php';
103
+ }
104
+
105
+ /**
106
+ * Blocksy admin notice for minimum PHP version.
107
+ *
108
+ * Warning when the site doesn't have the minimum required PHP version.
109
+ */
110
+ function blc_fail_php_version()
111
+ {
112
+ /* translators: %s: PHP version */
113
+ $message = sprintf( esc_html__( 'Blocksy requires PHP version %s+, plugin is currently NOT RUNNING.', 'blc' ), '7.0' );
114
+ $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
115
+ echo wp_kses_post( $html_message ) ;
116
+ }
117
+
118
+ /**
119
+ * Blocksy admin notice for minimum WordPress version.
120
+ *
121
+ * Warning when the site doesn't have the minimum required WordPress version.
122
+ */
123
+ function blc_fail_wp_version()
124
+ {
125
+ /* translators: %s: WordPress version */
126
+ $message = sprintf( esc_html__( 'Blocksy requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'blc' ), '5.0' );
127
+ $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
128
+ echo wp_kses_post( $html_message ) ;
129
+ }
130
+
131
+ }
trunk/framework/autoload.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ if (! defined('ABSPATH')) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ /**
10
+ * Blocksy autoloader.
11
+ */
12
+ class Autoloader {
13
+
14
+ /**
15
+ * Classes map.
16
+ *
17
+ * Maps Blocksy classes to file names.
18
+ *
19
+ * @static
20
+ *
21
+ * @var array Classes used by blocksy.
22
+ */
23
+ private static function get_classes_map() {
24
+ return apply_filters('blocksy_autoloader_classes_map', [
25
+ 'ExtensionsManager' => 'framework/extensions-manager.php',
26
+ 'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
27
+ 'Dashboard' => 'framework/dashboard.php',
28
+ 'ThemeIntegration' => 'framework/theme-integration.php',
29
+ 'CacheResetManager' => 'framework/cache-reset-manager.php',
30
+
31
+ 'GoogleAnalytics' => 'framework/features/google-analytics.php',
32
+ 'OpenGraphMetaData' => 'framework/features/opengraph-meta-data.php',
33
+ 'HeaderAdditions' => 'framework/features/header.php',
34
+ 'ConditionsManager' => 'framework/features/conditions-manager.php',
35
+
36
+ 'Cli' => 'framework/cli.php',
37
+
38
+ 'DynamicCss' => 'framework/features/dynamic-css.php',
39
+ 'CustomizerOptionsManager' => 'framework/features/customizer-options-manager.php',
40
+ 'DemoInstall' => 'framework/features/demo-install.php',
41
+ 'DemoInstallContentExport' => 'framework/features/demo-install/content-export.php',
42
+ 'DemoInstallWidgetsExport' => 'framework/features/demo-install/widgets-export.php',
43
+ 'DemoInstallOptionsExport' => 'framework/features/demo-install/options-export.php',
44
+
45
+ 'DemoInstallChildThemeInstaller' => 'framework/features/demo-install/child-theme.php',
46
+ 'DemoInstallPluginsInstaller' => 'framework/features/demo-install/required-plugins.php',
47
+ 'DemoInstallPluginsUninstaller' => 'framework/features/demo-install/plugins-uninstaller.php',
48
+ 'DemoInstallContentInstaller' => 'framework/features/demo-install/content-installer.php',
49
+ 'DemoInstallOptionsInstaller' => 'framework/features/demo-install/options-import.php',
50
+ 'DemoInstallWidgetsInstaller' => 'framework/features/demo-install/widgets-import.php',
51
+ 'DemoInstallContentEraser' => 'framework/features/demo-install/content-eraser.php',
52
+ 'DemoInstallFakeContentEraser' => 'framework/features/demo-install/fake-content-eraser.php',
53
+ 'DemoInstallFinalActions' => 'framework/features/demo-install/install-finish.php',
54
+ 'Premium' => 'framework/premium/pro.php',
55
+
56
+ /**
57
+ * No namespace
58
+ */
59
+ '_BlocksyWidgetFactory' => 'framework/widgets-manager.php',
60
+ '_Blocksy_WP_Import' => 'framework/features/demo-install/wp-importer.php',
61
+ ]);
62
+ }
63
+
64
+ /**
65
+ * Run autoloader.
66
+ *
67
+ * Register a function as `__autoload()` implementation.
68
+ *
69
+ * @static
70
+ */
71
+ public static function run() {
72
+ spl_autoload_register([__CLASS__, 'autoload']);
73
+ }
74
+
75
+ /**
76
+ * Load class.
77
+ *
78
+ * For a given class name, require the class file.
79
+ *
80
+ * @static
81
+ *
82
+ * @param string $relative_class_name Class name.
83
+ */
84
+ private static function load_class($relative_class_name) {
85
+ if (isset( self::get_classes_map()[$relative_class_name])) {
86
+ $filename = BLOCKSY_PATH . '/' . self::get_classes_map()[$relative_class_name];
87
+ } else {
88
+ $filename = strtolower(
89
+ preg_replace(
90
+ ['/([a-z])([A-Z])/', '/_/', '/\\\/'],
91
+ ['$1-$2', '-', DIRECTORY_SEPARATOR],
92
+ $relative_class_name
93
+ )
94
+ );
95
+
96
+ $filename = BLOCKSY_PATH . $filename . '.php';
97
+ }
98
+
99
+ if (is_readable($filename)) {
100
+ require $filename;
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Autoload.
106
+ *
107
+ * For a given class, check if it exist and load it.
108
+ *
109
+ * @static
110
+ *
111
+ * @param string $class Class name.
112
+ */
113
+ private static function autoload($class) {
114
+ if (
115
+ 0 !== strpos($class, __NAMESPACE__ . '\\')
116
+ &&
117
+ ! isset(self::get_classes_map()['_' . $class])
118
+ ) {
119
+ return;
120
+ }
121
+
122
+ $relative_class_name = preg_replace('/^' . __NAMESPACE__ . '\\\/', '', $class);
123
+
124
+ $final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
125
+
126
+ if (isset(self::get_classes_map()['_' . $relative_class_name])) {
127
+ $final_class_name = $relative_class_name;
128
+ $relative_class_name = '_' . $relative_class_name;
129
+ }
130
+
131
+ if (! class_exists($final_class_name)) {
132
+ self::load_class($relative_class_name);
133
+ }
134
+ }
135
+ }
trunk/framework/cache-reset-manager.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class CacheResetManager {
6
+ public function __construct() {
7
+ add_action(
8
+ 'blocksy:cache-manager:purge-all',
9
+ function () {
10
+ $this->run_cache_purge();
11
+ }
12
+ );
13
+
14
+ add_action(
15
+ 'upgrader_process_complete',
16
+ [$this, 'handle_update'],
17
+ 10, 2
18
+ );
19
+ }
20
+
21
+ public function handle_update($upgrader, $options) {
22
+ if ($options['action'] !== 'update') {
23
+ return;
24
+ }
25
+
26
+ if ($options['type'] === 'theme') {
27
+ if (in_array('blocksy', $options['themes'])) {
28
+ $this->run_cache_purge();
29
+ do_action('blocksy:dynamic-css:regenere_css_files');
30
+ }
31
+ }
32
+
33
+ if ($options['type'] === 'plugin') {
34
+ $plugins = [];
35
+
36
+ if (isset($options['plugins']) && is_array($options['plugins'])) {
37
+ $plugins = $options['plugins'];
38
+ }
39
+
40
+ if (in_array(BLOCKSY_PLUGIN_BASE, $plugins)) {
41
+ $this->run_cache_purge();
42
+ do_action('blocksy:dynamic-css:regenere_css_files');
43
+ }
44
+ }
45
+ }
46
+
47
+ public function run_cache_purge() {
48
+ # Purge all W3 Total Cache
49
+ if (function_exists('w3tc_pgcache_flush')) {
50
+ w3tc_pgcache_flush();
51
+ }
52
+
53
+ if (function_exists('w3tc_flush_all')) {
54
+ w3tc_flush_all();
55
+ }
56
+
57
+ # Purge WP Super Cache
58
+ if (function_exists('wp_cache_clear_cache')) {
59
+ wp_cache_clear_cache();
60
+ }
61
+
62
+ if (isset($GLOBALS['wp_fastest_cache'])) {
63
+ if (method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')) {
64
+ $GLOBALS['wp_fastest_cache']->deleteCache();
65
+ $GLOBALS['wp_fastest_cache']->deleteCache(true);
66
+ }
67
+ }
68
+
69
+ if (function_exists('cachify_flush_cache')) {
70
+ cachify_flush_cache();
71
+ }
72
+
73
+ if (class_exists("comet_cache")) {
74
+ \comet_cache::clear();
75
+ }
76
+
77
+ if (class_exists("zencache")) {
78
+ \zencache::clear();
79
+ }
80
+
81
+ if (class_exists('LiteSpeed_Cache_Tags')) {
82
+ \LiteSpeed_Cache_Tags::add_purge_tag('*');
83
+ }
84
+
85
+ if (function_exists('sg_cachepress_purge_cache')) {
86
+ sg_cachepress_purge_cache();
87
+ }
88
+
89
+ if (class_exists('LiteSpeed_Cache_Purge')) {
90
+ \LiteSpeed_Cache_Purge::purge_all('Clear Cache For Me');
91
+ }
92
+
93
+ if (class_exists('WP_Optimize') && defined('WPO_PLUGIN_MAIN_PATH')) {
94
+ if (! class_exists('WP_Optimize_Cache_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'cache/class-cache-commands.php');
95
+ if (! class_exists('WP_Optimize_Minify_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-commands.php');
96
+ if (! class_exists('WP_Optimize_Minify_Cache_Functions')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-cache-functions.php');
97
+
98
+ if (class_exists('WP_Optimize_Cache_Commands')) {
99
+ $wpoptimize_cache_commands = new \WP_Optimize_Cache_Commands();
100
+ $wpoptimize_cache_commands->purge_page_cache();
101
+ }
102
+
103
+ if (class_exists('WP_Optimize_Minify_Commands')) {
104
+ $wpoptimize_minify_commands = new \WP_Optimize_Minify_Commands();
105
+ $wpoptimize_minify_commands->purge_minify_cache();
106
+ }
107
+ }
108
+
109
+ if (
110
+ class_exists('WPaaS\Plugin')
111
+ &&
112
+ function_exists('fastvelocity_godaddy_request')
113
+ ) {
114
+ fastvelocity_godaddy_request('BAN');
115
+ }
116
+
117
+ # Purge WP Engine
118
+ if (class_exists("WpeCommon")) {
119
+ if (method_exists('WpeCommon', 'purge_memcached')) {
120
+ \WpeCommon::purge_memcached();
121
+ }
122
+
123
+ if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
124
+ \WpeCommon::clear_maxcdn_cache();
125
+ }
126
+
127
+ if (method_exists('WpeCommon', 'purge_varnish_cache')) {
128
+ \WpeCommon::purge_varnish_cache();
129
+ }
130
+ }
131
+
132
+ if (function_exists('rocket_clean_domain')) {
133
+ rocket_clean_domain();
134
+ }
135
+
136
+ if (function_exists('wp_cache_clean_cache')) {
137
+ global $file_prefix;
138
+ wp_cache_clean_cache( $file_prefix, true );
139
+ }
140
+
141
+ if (class_exists('autoptimizeCache')) {
142
+ \autoptimizeCache::clearall();
143
+ }
144
+
145
+ if (function_exists('fvm_purge_all')) {
146
+ fvm_purge_all();
147
+ }
148
+
149
+ if (function_exists('fastvelocity_purge_others')) {
150
+ fastvelocity_purge_others();
151
+ }
152
+
153
+ # wordpress default cache
154
+ if (function_exists('wp_cache_flush')) {
155
+ wp_cache_flush();
156
+ }
157
+
158
+ # https://wordpress.org/plugins/hummingbird-performance/
159
+ do_action('wphb_clear_page_cache');
160
+
161
+ if (class_exists('Swift_Performance_Cache')) {
162
+ \Swift_Performance_Cache::clear_all_cache();
163
+ }
164
+
165
+ if (class_exists('\SiteGround_Optimizer\Supercacher\Supercacher')) {
166
+ \SiteGround_Optimizer\Supercacher\Supercacher::get_instance()->purge_everything();
167
+ do_action('siteground_delete_assets');
168
+ }
169
+
170
+ if (class_exists('ShortPixelAI')) {
171
+ \ShortPixelAI::clear_css_cache();
172
+ }
173
+ }
174
+ }
175
+
trunk/framework/cli.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class Cli {
6
+ public function __construct() {
7
+ \WP_CLI::add_command('blocksy demo plugins', function ($args) {
8
+ $plugins = [
9
+ 'coblocks',
10
+ 'elementor',
11
+ 'contact-form-7',
12
+ 'woocommerce'
13
+ ];
14
+
15
+ foreach ($plugins as $plugin) {
16
+ \WP_CLI::runcommand('plugin install ' . $plugin, [] );
17
+ \WP_CLI::runcommand('plugin activate ' . $plugin, [] );
18
+ }
19
+ });
20
+
21
+ \WP_CLI::add_command('blocksy demo options', function ($args) {
22
+ $options = new DemoInstallOptionsInstaller([
23
+ 'has_streaming' => false,
24
+ 'demo_name' => 'Main:elementor'
25
+ ]);
26
+
27
+ $options->import();
28
+ });
29
+
30
+ \WP_CLI::add_command('blocksy widgets drop', function ($args) {
31
+ $sidebars_widgets = get_option('sidebars_widgets', array());
32
+
33
+ if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
34
+ $sidebars_widgets['wp_inactive_widgets'] = [];
35
+ }
36
+
37
+ foreach ($sidebars_widgets as $sidebar_id => $widgets) {
38
+ if (! $widgets) continue;
39
+ if ($sidebar_id === 'wp_inactive_widgets') {
40
+ continue;
41
+ }
42
+
43
+ if ($sidebar_id === 'array_version') {
44
+ continue;
45
+ }
46
+
47
+ foreach ($widgets as $widget_id) {
48
+ $sidebars_widgets['wp_inactive_widgets'][] = $widget_id;
49
+ }
50
+
51
+ $sidebars_widgets[$sidebar_id] = [];
52
+ }
53
+
54
+ update_option('sidebars_widgets', $sidebars_widgets);
55
+ unset($sidebars_widgets['array_version']);
56
+
57
+ set_theme_mod('sidebars_widgets', [
58
+ 'time' => time(),
59
+ 'data' => $sidebars_widgets
60
+ ]);
61
+ });
62
+
63
+ \WP_CLI::add_command('blocksy demo widgets', function ($args) {
64
+ $options = new DemoInstallWidgetsInstaller([
65
+ 'has_streaming' => false,
66
+ 'demo_name' => 'Blocksy News:elementor'
67
+ ]);
68
+
69
+ $options->import();
70
+ });
71
+
72
+ \WP_CLI::add_command('blocksy demo content', function ($args) {
73
+ $options = new DemoInstallContentInstaller([
74
+ 'has_streaming' => false,
75
+ 'demo_name' => 'Main:elementor'
76
+ ]);
77
+
78
+ $options->import();
79
+ });
80
+ }
81
+ }
82
+
trunk/framework/dashboard.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class Dashboard {
6
+ public function __construct() {
7
+ add_action(
8
+ 'admin_enqueue_scripts',
9
+ [ $this, 'enqueue_static' ],
10
+ 100
11
+ );
12
+
13
+ add_action('admin_body_class', function ($class) {
14
+ if (blc_fs()->is_activation_mode()) {
15
+ $class .= ' blocksy-fs-optin-dashboard';
16
+ }
17
+
18
+ return $class;
19
+ });
20
+
21
+ blc_fs()->add_filter(
22
+ 'connect-message_on-premium',
23
+ function ($text) {
24
+ if (strpos($text, '<br>') !== false) {
25
+ $exploded_message = explode('<br>', $text);
26
+
27
+ $text = '<span>' . $exploded_message[0] . '</span>' . $exploded_message[1];
28
+ }
29
+
30
+ return $text;
31
+ }
32
+ );
33
+
34
+ blc_fs()->add_filter(
35
+ 'connect_message_on_update',
36
+ function (
37
+ $message,
38
+ $user_first_name,
39
+ $product_title,
40
+ $user_login,
41
+ $site_link,
42
+ $freemius_link
43
+ ) {
44
+ $is_network_upgrade_mode = ( fs_is_network_admin() && blc_fs()->is_network_upgrade_mode() );
45
+ $slug = blc_fs()->get_slug();
46
+ $is_gdpr_required = \FS_GDPR_Manager::instance()->is_required();
47
+ $hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $user_first_name ) );
48
+
49
+ $default_optin_message = $is_gdpr_required ?
50
+ fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) :
51
+ fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug );
52
+
53
+ return (($is_network_upgrade_mode ?
54
+ '' :
55
+ /* translators: %s: name (e.g. Hey John,) */
56
+ '<span>' . $hey_x_text . '</span>'
57
+ ) .
58
+ sprintf(
59
+ esc_html( $default_optin_message ),
60
+ '<b>' . esc_html( blc_fs()->get_plugin_name() ) . '</b>',
61
+ '<b>' . $user_login . '</b>',
62
+ $site_link,
63
+ $freemius_link
64
+ ));
65
+
66
+ }, 10, 6
67
+ );
68
+
69
+ blc_fs()->add_action('connect/before', function () {
70
+ $path = dirname(__FILE__) . '/views/optin.php';
71
+
72
+ echo blc_call_fn(
73
+ ['fn' => 'blocksy_render_view'],
74
+ $path,
75
+ []
76
+ );
77
+ });
78
+
79
+ blc_fs()->add_action('connect/after', function () {
80
+ echo '</div>';
81
+ });
82
+
83
+ add_action(
84
+ 'wp_ajax_blocksy_fs_connect_again',
85
+ function () {
86
+ if (! current_user_can('edit_theme_options')) {
87
+ wp_send_json_error();
88
+ }
89
+
90
+ blc_fs()->connect_again();
91
+ wp_send_json_success();
92
+ }
93
+ );
94
+
95
+ add_filter(
96
+ 'blocksy_dashboard_localizations',
97
+ function ($d) {
98
+ $is_anonymous = blc_fs()->is_anonymous();
99
+ $connect_template = '';
100
+
101
+ if ($is_anonymous) {
102
+ ob_start();
103
+ blc_fs()->_connect_page_render();
104
+ $connect_template = ob_get_clean();
105
+ }
106
+
107
+ $result = [
108
+ 'is_pro' => blc_fs()->is__premium_only(),
109
+ 'is_anonymous' => $is_anonymous,
110
+ 'connect_template' => $connect_template
111
+ ];
112
+
113
+ if (Plugin::instance()->premium) {
114
+ $result['has_beta_consent'] = Plugin::instance()->premium->user_wants_beta_updates();
115
+ }
116
+
117
+ return array_merge($result, $d);
118
+ }
119
+ );
120
+ }
121
+
122
+ public function enqueue_static() {
123
+ if (! function_exists('blocksy_is_dashboard_page')) return;
124
+ if (! blocksy_is_dashboard_page()) return;
125
+
126
+ $data = get_plugin_data(BLOCKSY__FILE__);
127
+
128
+ $deps = apply_filters('blocksy-dashboard-scripts-dependencies', [
129
+ 'wp-i18n',
130
+ 'ct-events',
131
+ 'ct-options-scripts'
132
+ ]);
133
+
134
+ wp_enqueue_script(
135
+ 'blocksy-dashboard-scripts',
136
+ BLOCKSY_URL . 'static/bundle/dashboard.js',
137
+ $deps,
138
+ $data['Version'],
139
+ false
140
+ );
141
+
142
+ wp_enqueue_style(
143
+ 'blocksy-dashboard-styles',
144
+ BLOCKSY_URL . 'static/bundle/dashboard.css',
145
+ [],
146
+ $data['Version']
147
+ );
148
+ }
149
+ }
trunk/framework/extensions-manager-api.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class ExtensionsManagerApi {
6
+ public function __construct() {
7
+ $this->attach_ajax_actions();
8
+
9
+ if (wp_doing_ajax()) {
10
+ $manager = Plugin::instance()->extensions;
11
+ $manager->do_extensions_preboot();
12
+ }
13
+ }
14
+
15
+ protected $ajax_actions = [
16
+ 'blocksy_extensions_status',
17
+ 'blocksy_extension_activate',
18
+ 'blocksy_extension_deactivate',
19
+ ];
20
+
21
+ public function blocksy_extensions_status() {
22
+ $this->check_capability('edit_theme_options');
23
+ $manager = Plugin::instance()->extensions;
24
+
25
+ $maybe_input = json_decode(file_get_contents('php://input'), true);
26
+
27
+ $data = $manager->get_extensions([
28
+ 'forced_reread' => true
29
+ ]);
30
+
31
+ if (
32
+ $maybe_input
33
+ &&
34
+ isset($maybe_input['extension'])
35
+ &&
36
+ isset($maybe_input['extAction'])
37
+ ) {
38
+ $ext_preboot = $manager->get($maybe_input['extension'], [
39
+ 'type' => 'preboot'
40
+ ]);
41
+
42
+ if (method_exists(
43
+ $ext_preboot, 'ext_action'
44
+ )) {
45
+ $result = $ext_preboot->ext_action($maybe_input['extAction']);
46
+
47
+ if ($result) {
48
+ $data[$maybe_input['extension']]['data'] = $result;
49
+ }
50
+ }
51
+ }
52
+
53
+ wp_send_json_success($data);
54
+ }
55
+
56
+ public function blocksy_extension_activate() {
57
+ $this->check_capability('edit_theme_options');
58
+ $manager = Plugin::instance()->extensions;
59
+
60
+ $manager->activate_extension($this->get_extension_from_request());
61
+
62
+ wp_send_json_success();
63
+ }
64
+
65
+ public function blocksy_extension_deactivate() {
66
+ $this->check_capability('edit_theme_options');
67
+ $manager = Plugin::instance()->extensions;
68
+
69
+ $manager->deactivate_extension($this->get_extension_from_request());
70
+
71
+ wp_send_json_success();
72
+ }
73
+
74
+ public function check_capability( $cap = 'install_plugins' ) {
75
+ $manager = Plugin::instance()->extensions;
76
+
77
+ if ( ! $manager->can( $cap ) ) {
78
+ wp_send_json_error();
79
+ }
80
+
81
+ return true;
82
+ }
83
+
84
+ public function get_extension_from_request() {
85
+ if ( ! isset( $_POST['ext'] ) ) {
86
+ wp_send_json_error();
87
+ }
88
+
89
+ return addslashes($_POST['ext']);
90
+ }
91
+
92
+ public function attach_ajax_actions() {
93
+ foreach ( $this->ajax_actions as $action ) {
94
+ add_action(
95
+ 'wp_ajax_' . $action,
96
+ [ $this, $action ]
97
+ );
98
+ }
99
+ }
100
+ }
101
+
trunk/framework/extensions-manager.php ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class ExtensionsManager
6
+ {
7
+ /**
8
+ * Collection of all the activated extensions.
9
+ *
10
+ * @var array The array of all the extension objects.
11
+ */
12
+ private $extensions = array() ;
13
+ private function get_option_name()
14
+ {
15
+ return 'blocksy_active_extensions';
16
+ }
17
+
18
+ public function get( $id, $args = array() )
19
+ {
20
+ $args = wp_parse_args( $args, [
21
+ 'type' => 'regular',
22
+ ] );
23
+ if ( !isset( $this->extensions[$id] ) ) {
24
+ return null;
25
+ }
26
+
27
+ if ( $args['type'] === 'preboot' ) {
28
+ if ( !isset( $this->extensions[$id]['__object_preboot'] ) ) {
29
+ return null;
30
+ }
31
+ return $this->extensions[$id]['__object_preboot'];
32
+ }
33
+
34
+ if ( !isset( $this->extensions[$id]['__object'] ) ) {
35
+ return null;
36
+ }
37
+ return $this->extensions[$id]['__object'];
38
+ }
39
+
40
+ /**
41
+ * Collect all available extensions and activate the ones that have to be so.
42
+ */
43
+ public function __construct()
44
+ {
45
+ $this->read_installed_extensions();
46
+ if ( $this->is_dashboard_page() ) {
47
+ $this->do_extensions_preboot();
48
+ }
49
+ foreach ( $this->get_activated_extensions() as $single_id ) {
50
+ $this->boot_activated_extension_for( $single_id );
51
+ }
52
+ add_action( 'activate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_activation' ], 11 );
53
+ add_action( 'deactivate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_deactivation' ], 11 );
54
+ }
55
+
56
+ public function handle_activation()
57
+ {
58
+ ob_start();
59
+ foreach ( $this->get_activated_extensions() as $id ) {
60
+ if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
61
+ call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
62
+ }
63
+ }
64
+ ob_get_clean();
65
+ }
66
+
67
+ public function handle_deactivation()
68
+ {
69
+ foreach ( $this->get_activated_extensions() as $id ) {
70
+ if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
71
+ call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
72
+ }
73
+ }
74
+ }
75
+
76
+ public function do_extensions_preboot()
77
+ {
78
+ foreach ( array_keys( $this->get_extensions() ) as $single_id ) {
79
+ $this->maybe_do_extension_preboot( $single_id );
80
+ }
81
+ }
82
+
83
+ private function is_dashboard_page()
84
+ {
85
+ global $pagenow ;
86
+ $is_ct_settings = isset( $_GET['page'] ) && 'ct-dashboard' === $_GET['page'];
87
+ return $is_ct_settings;
88
+ }
89
+
90
+ public function get_extensions( $args = array() )
91
+ {
92
+ $args = wp_parse_args( $args, [
93
+ 'forced_reread' => false,
94
+ ] );
95
+
96
+ if ( $args['forced_reread'] ) {
97
+ foreach ( $this->extensions as $id => $extension ) {
98
+ $this->extensions[$id]['config'] = $this->read_config_for( $extension['path'] );
99
+ $this->extensions[$id]['readme'] = $this->read_readme_for( $extension['path'] );
100
+ }
101
+ $this->register_fake_extensions();
102
+ }
103
+
104
+ return $this->extensions;
105
+ }
106
+
107
+ public function can( $capability = 'install_plugins' )
108
+ {
109
+ $user = wp_get_current_user();
110
+ // return array_intersect(['administrator'], $user->roles );
111
+
112
+ if ( is_multisite() ) {
113
+ // Only network admin can change files that affects the entire network.
114
+ $can = current_user_can_for_blog( get_current_blog_id(), $capability );
115
+ } else {
116
+ $can = current_user_can( $capability );
117
+ }
118
+
119
+ if ( $can ) {
120
+ // Also you can use this method to get the capability.
121
+ $can = $capability;
122
+ }
123
+ return $can;
124
+ }
125
+
126
+ public function activate_extension( $id )
127
+ {
128
+ if ( !isset( $this->extensions[$id] ) ) {
129
+ return;
130
+ }
131
+ if ( !$this->extensions[$id]['path'] ) {
132
+ return;
133
+ }
134
+ $activated = $this->get_activated_extensions();
135
+
136
+ if ( !in_array( strtolower( $id ), $activated ) ) {
137
+ $path = $this->extensions[$id]['path'];
138
+ require_once $path . '/extension.php';
139
+ if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
140
+ call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
141
+ }
142
+ $class = $this->get_class_name_for( $id );
143
+ // Init extension right away.
144
+ new $class();
145
+ }
146
+
147
+ $activated[] = strtolower( $id );
148
+ update_option( $this->get_option_name(), array_unique( $activated ) );
149
+ Plugin::instance()->dynamic_css->generate_css_files();
150
+ }
151
+
152
+ public function deactivate_extension( $id )
153
+ {
154
+ if ( !isset( $this->extensions[$id] ) ) {
155
+ return;
156
+ }
157
+ if ( !$this->extensions[$id]['path'] ) {
158
+ return;
159
+ }
160
+ $activated = $this->get_activated_extensions();
161
+ if ( in_array( strtolower( $id ), $activated ) ) {
162
+ if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
163
+ call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
164
+ }
165
+ }
166
+ update_option( $this->get_option_name(), array_diff( $activated, [ $id ] ) );
167
+ Plugin::instance()->dynamic_css->generate_css_files();
168
+ }
169
+
170
+ private function read_installed_extensions()
171
+ {
172
+ $paths_to_look_for_extensions = apply_filters( 'blocksy_extensions_paths', [ BLOCKSY_PATH . 'framework/extensions' ] );
173
+ foreach ( $paths_to_look_for_extensions as $single_path ) {
174
+ $all_extensions = glob( $single_path . '/*', GLOB_ONLYDIR );
175
+ foreach ( $all_extensions as $single_extension ) {
176
+ $this->register_extension_for( $single_extension );
177
+ }
178
+ }
179
+ $this->register_fake_extensions();
180
+ }
181
+
182
+ private function register_fake_extensions()
183
+ {
184
+ return;
185
+ $this->extensions['custom-fonts'] = [
186
+ 'path' => null,
187
+ '__object' => null,
188
+ 'config' => [
189
+ 'name' => __( 'Custom Fonts', 'blc' ),
190
+ 'description' => __( 'Upload unlimited number of custom fonts.', 'blc' ),
191
+ 'pro' => true,
192
+ ],
193
+ 'readme' => '',
194
+ 'data' => null,
195
+ ];
196
+ $this->extensions['sidebars'] = [
197
+ 'path' => null,
198
+ '__object' => null,
199
+ 'config' => [
200
+ 'name' => __( 'Sidebars', 'blc' ),
201
+ 'description' => __( 'Create unlimited number of custom sidebars.', 'blc' ),
202
+ 'pro' => true,
203
+ ],
204
+ 'readme' => '',
205
+ 'data' => null,
206
+ ];
207
+ $this->extensions['white-label'] = [
208
+ 'path' => null,
209
+ '__object' => null,
210
+ 'config' => [
211
+ 'name' => __( 'White Label', 'blc' ),
212
+ 'description' => __( 'Change theme/companion branding', 'blc' ),
213
+ 'pro' => true,
214
+ ],
215
+ 'readme' => '',
216
+ 'data' => null,
217
+ ];
218
+ }
219
+
220
+ private function register_extension_for( $path )
221
+ {
222
+ $id = str_replace( '_', '-', basename( $path ) );
223
+ if ( isset( $this->extensions[$id] ) ) {
224
+ return;
225
+ }
226
+ $this->extensions[$id] = [
227
+ 'path' => $path,
228
+ '__object' => null,
229
+ 'config' => $this->read_config_for( $path ),
230
+ 'readme' => $this->read_readme_for( $path ),
231
+ 'data' => null,
232
+ ];
233
+ }
234
+
235
+ private function maybe_do_extension_preboot( $id )
236
+ {
237
+ if ( !isset( $this->extensions[$id] ) ) {
238
+ return false;
239
+ }
240
+ if ( isset( $this->extensions[$id]['__object_preboot'] ) ) {
241
+ return;
242
+ }
243
+ $class_name = explode( '-', $id );
244
+ $class_name = array_map( 'ucfirst', $class_name );
245
+ $class_name = 'BlocksyExtension' . implode( '', $class_name ) . 'PreBoot';
246
+ $path = $this->extensions[$id]['path'];
247
+ if ( !file_exists( $path . '/pre-boot.php' ) ) {
248
+ return;
249
+ }
250
+ require_once $path . '/pre-boot.php';
251
+ $this->extensions[$id]['__object_preboot'] = new $class_name();
252
+ if ( method_exists( $this->extensions[$id]['__object_preboot'], 'ext_data' ) ) {
253
+ $this->extensions[$id]['data'] = $this->extensions[$id]['__object_preboot']->ext_data();
254
+ }
255
+ }
256
+
257
+ private function boot_activated_extension_for( $id )
258
+ {
259
+ if ( !isset( $this->extensions[$id] ) ) {
260
+ return false;
261
+ }
262
+ if ( !isset( $this->extensions[$id]['path'] ) ) {
263
+ return false;
264
+ }
265
+ if ( !$this->extensions[$id]['path'] ) {
266
+ return false;
267
+ }
268
+ if ( isset( $this->extensions[$id]['config']['hidden'] ) && $this->extensions[$id]['config']['hidden'] ) {
269
+ return;
270
+ }
271
+ if ( isset( $this->extensions[$id]['__object'] ) ) {
272
+ return;
273
+ }
274
+ $class_name = explode( '-', $id );
275
+ $class_name = array_map( 'ucfirst', $class_name );
276
+ $class_name = 'BlocksyExtension' . implode( '', $class_name );
277
+ $path = $this->extensions[$id]['path'];
278
+ if ( !file_exists( $path . '/extension.php' ) ) {
279
+ return;
280
+ }
281
+ require_once $path . '/extension.php';
282
+ $this->extensions[$id]['__object'] = new $class_name();
283
+ }
284
+
285
+ private function get_class_name_for( $id )
286
+ {
287
+ $class_name = explode( '-', $id );
288
+ $class_name = array_map( 'ucfirst', $class_name );
289
+ return 'BlocksyExtension' . implode( '', $class_name );
290
+ }
291
+
292
+ private function read_readme_for( $path )
293
+ {
294
+ $readme = '';
295
+ ob_start();
296
+ if ( is_readable( $path . '/readme.php' ) ) {
297
+ require $path . '/readme.php';
298
+ }
299
+ $readme = ob_get_clean();
300
+ if ( empty(trim( $readme )) ) {
301
+ return null;
302
+ }
303
+ return trim( $readme );
304
+ }
305
+
306
+ private function read_config_for( $file_path )
307
+ {
308
+ $_extract_variables = [
309
+ 'config' => [],
310
+ ];
311
+
312
+ if ( is_readable( $file_path . '/config.php' ) ) {
313
+ require $file_path . '/config.php';
314
+ foreach ( $_extract_variables as $variable_name => $default_value ) {
315
+ if ( isset( ${$variable_name} ) ) {
316
+ $_extract_variables[$variable_name] = ${$variable_name};
317
+ }
318
+ }
319
+ }
320
+
321
+ $name = explode( '-', basename( $file_path ) );
322
+ $name = array_map( 'ucfirst', $name );
323
+ $name = implode( ' ', $name );
324
+ $_extract_variables['config'] = array_merge( [
325
+ 'name' => $name,
326
+ 'description' => '',
327
+ 'pro' => false,
328
+ 'hidden' => false,
329
+ ], $_extract_variables['config'] );
330
+ return $_extract_variables['config'];
331
+ }
332
+
333
+ private function get_activated_extensions()
334
+ {
335
+ return get_option( $this->get_option_name(), [] );
336
+ }
337
+
338
+ }
trunk/framework/extensions/cookies-consent/config.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'name' => __('Cookies Consent', 'blc'),
5
+ 'description' => __('Enable this extension in order to comply with the GDPR regulations.', 'blc')
6
+ ];
trunk/framework/extensions/cookies-consent/customizer.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ 'title' => __('Cookie Consent', 'blc'),
5
+ 'container' => [ 'priority' => 8 ],
6
+ 'options' => [
7
+
8
+ 'cookie_consent_section_options' => [
9
+ 'type' => 'ct-options',
10
+ 'setting' => [ 'transport' => 'postMessage' ],
11
+ 'inner-options' => [
12
+ blocksy_rand_md5() => [
13
+ 'type' => 'ct-title',
14
+ 'label' => __( 'Cookies Notification', 'blocksy' ),
15
+ ],
16
+
17
+ blocksy_rand_md5() => [
18
+ 'title' => __( 'General', 'blc' ),
19
+ 'type' => 'tab',
20
+ 'options' => [
21
+
22
+ 'cookie_consent_type' => [
23
+ 'label' => false,
24
+ 'type' => 'ct-image-picker',
25
+ 'value' => 'type-1',
26
+ 'setting' => [ 'transport' => 'postMessage' ],
27
+ 'choices' => [
28
+
29
+ 'type-1' => [
30
+ 'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-1.svg',
31
+ 'title' => __( 'Type 1', 'blc' ),
32
+ ],
33
+
34
+ 'type-2' => [
35
+ 'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-2.svg',
36
+ 'title' => __( 'Type 2', 'blc' ),
37
+ ],
38
+
39
+ ],
40
+ ],
41
+
42
+ 'cookie_consent_period' => [
43
+ 'label' => __('Cookie period', 'blc'),
44
+ 'type' => 'ct-select',
45
+ 'value' => 'forever',
46
+ 'design' => 'inline',
47
+ 'setting' => [ 'transport' => 'postMessage' ],
48
+ 'choices' => blocksy_ordered_keys(
49
+
50
+ [
51
+ 'onehour' => __( 'One hour', 'blc' ),
52
+ 'oneday' => __( 'One day', 'blc' ),
53
+ 'oneweek' => __( 'One week', 'blc' ),
54
+ 'onemonth' => __( 'One month', 'blc' ),
55
+ 'threemonths' => __( 'Three months', 'blc' ),
56
+ 'sixmonths' => __( 'Six months', 'blc' ),
57
+ 'oneyear' => __( 'One year', 'blc' ),
58
+ 'forever' => __('Forever', 'blc')
59
+ ]
60
+
61
+ ),
62
+ ],
63
+
64
+ 'cookie_consent_content' => [
65
+ 'label' => __( 'Content', 'blc' ),
66
+ 'type' => 'wp-editor',
67
+ 'value' => __('We use cookies to ensure that we give you the best experience on our website.', 'blc'),
68
+ 'disableRevertButton' => true,
69
+ 'setting' => [ 'transport' => 'postMessage' ],
70
+
71
+ 'quicktags' => false,
72
+ 'mediaButtons' => false,
73
+ 'tinymce' => [
74
+ 'toolbar1' => 'bold,italic,link,alignleft,aligncenter,alignright,undo,redo',
75
+ ],
76
+ ],
77
+
78
+ 'cookie_consent_button_text' => [
79
+ 'label' => __( 'Button text', 'blc' ),
80
+ 'type' => 'text',
81
+ 'design' => 'block',
82
+ 'value' => __('Accept', 'blc'),
83
+ 'setting' => [ 'transport' => 'postMessage' ],
84
+ ],
85
+
86
+ ],
87
+ ],
88
+
89
+ blocksy_rand_md5() => [
90
+ 'title' => __( 'Design', 'blc' ),
91
+ 'type' => 'tab',
92
+ 'options' => [
93
+
94
+ 'cookieContentColor' => [
95
+ 'label' => __( 'Font Color', 'blc' ),
96
+ 'type' => 'ct-color-picker',
97
+ 'design' => 'inline',
98
+ 'setting' => [ 'transport' => 'postMessage' ],
99
+
100
+ 'value' => [
101
+ 'default' => [
102
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
103
+ ],
104
+
105
+ 'hover' => [
106
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
107
+ ],
108
+ ],
109
+
110
+ 'pickers' => [
111
+ [
112
+ 'title' => __( 'Initial', 'blc' ),
113
+ 'id' => 'default',
114
+ 'inherit' => 'var(--color)'
115
+ ],
116
+
117
+ [
118
+ 'title' => __( 'Hover', 'blc' ),
119
+ 'id' => 'hover',
120
+ 'inherit' => 'var(--colorHover)'
121
+ ],
122
+ ],
123
+ ],
124
+
125
+ 'cookieButtonBackground' => [
126
+ 'label' => __( 'Button Color', 'blc' ),
127
+ 'type' => 'ct-color-picker',
128
+ 'design' => 'inline',
129
+ 'setting' => [ 'transport' => 'postMessage' ],
130
+ 'value' => [
131
+ 'default' => [
132
+ 'color' => 'var(--paletteColor1)',
133
+ ],
134
+
135
+ 'hover' => [
136
+ 'color' => 'var(--paletteColor2)',
137
+ ],
138
+ ],
139
+
140
+ 'pickers' => [
141
+ [
142
+ 'title' => __( 'Initial', 'blc' ),
143
+ 'id' => 'default',
144
+ ],
145
+
146
+ [
147
+ 'title' => __( 'Hover', 'blc' ),
148
+ 'id' => 'hover',
149
+ ],
150
+ ],
151
+ ],
152
+
153
+ 'cookieBackground' => [
154
+ 'label' => __( 'Background Color', 'blc' ),
155
+ 'type' => 'ct-color-picker',
156
+ 'design' => 'inline',
157
+ 'setting' => [ 'transport' => 'postMessage' ],
158
+
159
+ 'value' => [
160
+ 'default' => [
161
+ 'color' => '#ffffff',
162
+ ],
163
+ ],
164
+
165
+ 'pickers' => [
166
+ [
167
+ 'title' => __( 'Initial', 'blc' ),
168
+ 'id' => 'default',
169
+ ],
170
+ ],
171
+ ],
172
+
173
+ blocksy_rand_md5() => [
174
+ 'type' => 'ct-condition',
175
+ 'condition' => [ 'cookie_consent_type' => 'type-1' ],
176
+ 'options' => [
177
+
178
+ 'cookieMaxWidth' => [
179
+ 'label' => __( 'Maximum Width', 'blc' ),
180
+ 'type' => 'ct-slider',
181
+ 'value' => 400,
182
+ 'min' => 200,
183
+ 'max' => 500,
184
+ 'setting' => [ 'transport' => 'postMessage' ],
185
+ ],
186
+
187
+ ],
188
+ ],
189
+
190
+ ],
191
+ ],
192
+
193
+ blocksy_rand_md5() => [
194
+ 'type' => 'ct-title',
195
+ 'label' => __( 'Forms Cookies Content', 'blocksy' ),
196
+ ],
197
+
198
+ 'forms_cookie_consent_content' => [
199
+ 'label' => false,
200
+ 'type' => 'wp-editor',
201
+ 'value' => sprintf(
202
+ __('I accept the %sPrivacy Policy%s', 'blc'),
203
+ '<a href="/privacy-policy">',
204
+ '</a>'
205
+ ),
206
+ 'desc' => __( 'This text will appear under each comment form and subscribe form.', 'blc' ),
207
+ // 'attr' => [ 'data-height' => 'heading-label' ],
208
+ 'disableRevertButton' => true,
209
+ 'setting' => [ 'transport' => 'postMessage' ],
210
+
211
+ 'quicktags' => false,
212
+ 'mediaButtons' => false,
213
+ 'tinymce' => [
214
+ 'toolbar1' => 'bold,italic,link,alignleft,aligncenter,alignright,undo,redo',
215
+ 'forced_root_block' => '',
216
+ 'force_br_newlines' => true,
217
+ 'force_p_newlines' => false
218
+ ],
219
+ ],
220
+
221
+ ],
222
+ ],
223
+ ],
224
+ ];
trunk/framework/extensions/cookies-consent/extension.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . '/helpers.php';
4
+
5
+ class BlocksyExtensionCookiesConsent {
6
+ public static function should_display_notification() {
7
+ return !isset($_COOKIE['blocksy_cookies_consent_accepted']);
8
+ }
9
+
10
+ public function __construct() {
11
+ add_filter('blocksy:footer:offcanvas-drawer', function ($els) {
12
+ $els[] = blocksy_ext_cookies_consent_output();
13
+ return $els;
14
+ });
15
+
16
+ add_filter('blocksy-async-scripts-handles', function ($d) {
17
+ $d[] = 'blocksy-ext-cookies-consent-scripts';
18
+ return $d;
19
+ });
20
+
21
+ add_filter(
22
+ 'blocksy_extensions_customizer_options',
23
+ [$this, 'add_options_panel']
24
+ );
25
+
26
+ add_action(
27
+ 'customize_preview_init',
28
+ function () {
29
+ if (! function_exists('get_plugin_data')){
30
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
31
+ }
32
+
33
+ $data = get_plugin_data(BLOCKSY__FILE__);
34
+
35
+ wp_enqueue_script(
36
+ 'blocksy-cookies-consent-customizer-sync',
37
+ BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/sync.js',
38
+ [ 'ct-events', 'customize-preview' ],
39
+ $data['Version'],
40
+ true
41
+ );
42
+ }
43
+ );
44
+
45
+ add_action('wp_enqueue_scripts', function () {
46
+ if (! function_exists('get_plugin_data')) {
47
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
48
+ }
49
+
50
+ $data = get_plugin_data(BLOCKSY__FILE__);
51
+
52
+ if (is_admin()) {
53
+ return;
54
+ }
55
+
56
+ wp_enqueue_style(
57
+ 'blocksy-ext-cookies-consent-styles',
58
+ BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.css',
59
+ ['ct-main-styles'],
60
+ $data['Version']
61
+ );
62
+
63
+ wp_enqueue_script(
64
+ 'blocksy-ext-cookies-consent-scripts',
65
+ BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.js',
66
+ ['ct-events'],
67
+ $data['Version'],
68
+ true
69
+ );
70
+ });
71
+
72
+ add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
73
+ blocksy_theme_get_dynamic_styles(array_merge([
74
+ 'path' => dirname( __FILE__ ) . '/global.php',
75
+ 'chunk' => 'global'
76
+ ], $args));
77
+ }, 10, 3);
78
+ }
79
+
80
+ public function add_options_panel($options) {
81
+ $options['cookie_consent_ext'] = blc_call_fn(
82
+ [
83
+ 'fn' => 'blocksy_get_options',
84
+ 'default' => 'array'
85
+ ],
86
+ dirname(__FILE__) . '/customizer.php',
87
+ [], false
88
+ );
89
+
90
+ return $options;
91
+ }
92
+ }
93
+
trunk/framework/extensions/cookies-consent/global.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Content color
4
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
5
+ 'value' => get_theme_mod('cookieContentColor'),
6
+ 'default' => [
7
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
8
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
9
+ ],
10
+ 'css' => $css,
11
+ 'variables' => [
12
+ 'default' => [
13
+ 'selector' => '.cookie-notification',
14
+ 'variable' => 'color'
15
+ ],
16
+
17
+ 'hover' => [
18
+ 'selector' => '.cookie-notification',
19
+ 'variable' => 'colorHover'
20
+ ],
21
+ ],
22
+ ]);
23
+
24
+ // Button color
25
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
26
+ 'value' => get_theme_mod('cookieButtonBackground'),
27
+ 'default' => [
28
+ 'default' => [ 'color' => 'var(--paletteColor1)' ],
29
+ 'hover' => [ 'color' => 'var(--paletteColor2)' ],
30
+ ],
31
+ 'css' => $css,
32
+ 'variables' => [
33
+ 'default' => [
34
+ 'selector' => '.cookie-notification',
35
+ 'variable' => 'buttonInitialColor'
36
+ ],
37
+
38
+ 'hover' => [
39
+ 'selector' => '.cookie-notification',
40
+ 'variable' => 'buttonHoverColor'
41
+ ]
42
+ ],
43
+ ]);
44
+
45
+
46
+ // Background color
47
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
48
+ 'value' => get_theme_mod('cookieBackground'),
49
+ 'default' => [
50
+ 'default' => [ 'color' => '#ffffff' ],
51
+ ],
52
+ 'css' => $css,
53
+ 'variables' => [
54
+ 'default' => [
55
+ 'selector' => '.cookie-notification',
56
+ 'variable' => 'backgroundColor'
57
+ ],
58
+ ],
59
+ ]);
60
+
61
+ $cookieMaxWidth = get_theme_mod( 'cookieMaxWidth', 400 );
62
+ $css->put(
63
+ '.cookie-notification',
64
+ '--maxWidth: ' . $cookieMaxWidth . 'px'
65
+ );
66
+
trunk/framework/extensions/cookies-consent/helpers.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_ext_cookies_consent_cache() {
4
+ if (! is_customize_preview()) return;
5
+
6
+ blocksy_add_customizer_preview_cache(
7
+ blocksy_html_tag(
8
+ 'div',
9
+ [ 'data-id' => 'blocksy-cookies-consent-section' ],
10
+ blocksy_ext_cookies_consent_output(true)
11
+ )
12
+ );
13
+ }
14
+
15
+ function blocksy_ext_cookies_consent_output($forced = false) {
16
+ if (! $forced) {
17
+ blc_ext_cookies_consent_cache();
18
+ }
19
+
20
+ /*
21
+ if (! BlocksyExtensionCookiesConsent::should_display_notification()) {
22
+ if (! $forced) {
23
+ return;
24
+ }
25
+ }
26
+ */
27
+
28
+ $content = get_theme_mod(
29
+ 'cookie_consent_content',
30
+ __('We use cookies to ensure that we give you the best experience on our website.', 'blc')
31
+ );
32
+
33
+ $button_text = get_theme_mod('cookie_consent_button_text', __('Accept', 'blc'));
34
+ $period = get_theme_mod('cookie_consent_period', 'forever');
35
+ $type = get_theme_mod('cookie_consent_type', 'type-1');
36
+
37
+ $class = 'container';
38
+
39
+ if ( $type === 'type-2' ) {
40
+ $class = 'ct-container';
41
+ }
42
+
43
+ ob_start();
44
+
45
+ ?>
46
+
47
+
48
+ <div class="cookie-notification ct-fade-in-start" data-period="<?php echo esc_attr($period) ?>" data-type="<?php echo esc_attr($type) ?>">
49
+
50
+ <div class="<?php echo esc_attr($class) ?>">
51
+ <?php if (!empty($content)) { ?>
52
+ <div class="ct-cookies-content"><?php echo wp_kses_post($content) ?></div>
53
+ <?php } ?>
54
+
55
+ <button type="submit" class="ct-button ct-accept"><?php echo esc_html($button_text) ?></button>
56
+
57
+ <?php if ($type === 'type-1' || is_customize_preview()) { ?>
58
+ <button class="ct-close">×</button>
59
+ <?php } ?>
60
+
61
+ </div>
62
+ </div>
63
+ <?php
64
+
65
+ return ob_get_clean();
66
+ }
67
+
68
+ function blocksy_ext_cookies_checkbox($prefix = '') {
69
+ ob_start();
70
+
71
+ if (! empty($prefix)) {
72
+ $prefix = '_' . $prefix;
73
+ }
74
+
75
+ $message = get_theme_mod(
76
+ 'forms_cookie_consent_content',
77
+ sprintf(
78
+ __('I accept the %sPrivacy Policy%s', 'blc'),
79
+ '<a href="/privacy-policy">',
80
+ '</a>'
81
+ )
82
+ );
83
+
84
+ ?>
85
+
86
+ <p class="gdpr-confirm-policy">
87
+ <input id="gdprconfirm<?php echo $prefix ?>" name="gdprconfirm" type="checkbox" required /><label for="gdprconfirm<?php echo $prefix ?>"><?php echo $message ?></label>
88
+ </p>
89
+
90
+ <?php
91
+
92
+ return ob_get_clean();
93
+ }
trunk/framework/extensions/cookies-consent/readme.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2><?php echo __('Instructions', 'blc'); ?></h2>
2
+
3
+ <p>
4
+ <?php echo __('After installing and activating the Cookies Consent extension you will be able to configure it from this location:', 'blc') ?>
5
+ </p>
6
+
7
+ <ul class="ct-modal-list">
8
+ <li>
9
+ <h4><?php echo __('Customizer', 'blc') ?></h4>
10
+ <i>
11
+ <?php
12
+ echo sprintf(
13
+ __('Navigate to %s and customize the notification to meet your needs.', 'blc'),
14
+ sprintf(
15
+ '<code>%s</code>',
16
+ __('Customizer ➝ Cookie Consent', 'blc')
17
+ )
18
+ );
19
+ ?>
20
+ </i>
21
+ </li>
22
+ </ul>
23
+
24
+ <div class="extension-notice">
25
+ <h4><?php echo __('Known problems with caching plugins', 'blc'); ?></h4>
26
+
27
+ <p>
28
+ <?php
29
+ echo sprintf(
30
+ __('Please read %s to find out more information.', 'blc'),
31
+ sprintf(
32
+ '<a href="https://creativethemes.com/blocksy/docs/extensions/cookies-consent/#cache/">%s</a>',
33
+ __('this article', 'blc')
34
+ )
35
+ );
36
+ ?>
37
+ </p>
38
+ </div>
trunk/framework/extensions/cookies-consent/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.7.62
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .cookie-notification{position:fixed;left:0;bottom:0;z-index:999999;color:var(--color)}.cookie-notification a:hover{color:var(--colorHover)}@media (max-width: 479.98px){.cookie-notification>div{flex-direction:column}}@media (max-width: 689.98px){.cookie-notification{right:0}.cookie-notification>div{display:flex;align-items:center;padding-top:15px;padding-bottom:15px}}@media (max-width: 689.98px){.cookie-notification[data-type='type-1']{background:var(--backgroundColor)}}@media (min-width: 690px){.cookie-notification[data-type='type-1']{padding:0 25px 25px 25px}.cookie-notification[data-type='type-1'] .ct-cookies-content{margin-bottom:15px;max-width:90%}}.cookie-notification[data-type='type-1'] .container{position:relative}@media (max-width: 689.98px){.cookie-notification[data-type='type-1'] .container{width:88%;margin:0 auto}}@media (min-width: 690px){.cookie-notification[data-type='type-1'] .container{background:var(--backgroundColor);box-shadow:0px 5px 30px -5px rgba(34,56,101,0.15);padding:25px 40px 25px 25px;border-radius:3px;max-width:var(--maxWidth)}}.cookie-notification[data-type='type-2']{right:0;background:var(--backgroundColor)}@media (min-width: 690px){.cookie-notification[data-type='type-2']{padding:15px 0}.cookie-notification[data-type='type-2'] .ct-container{display:flex;align-items:center;justify-content:center}.cookie-notification[data-type='type-2'] .ct-accept{margin-left:25px}}.cookie-notification[data-type='type-2'] .ct-close{display:none}.cookie-notification .ct-cookies-content{line-height:1.4}.cookie-notification .ct-cookies-content>*:last-child{margin-bottom:0}.cookie-notification .ct-cookies-content a{text-decoration:underline;color:var(--colorHover)}@media (max-width: 479.98px){.cookie-notification .ct-cookies-content{text-align:center;margin-bottom:15px}}@media (max-width: 689.98px){.cookie-notification .ct-cookies-content{font-size:13px}}@media (min-width: 690px){.cookie-notification .ct-cookies-content{font-size:14px}}.cookie-notification .ct-accept{--buttonFontSize: 13px;--buttonMinHeight: 35px;--padding: 0 20px;--buttonShadow: none;--buttonTransform: none}@media (max-width: 479.98px){.cookie-notification .ct-accept{width:100%}}@media (min-width: 480px) and (max-width: 689.98px){.cookie-notification .ct-accept{margin-left:20px}}.cookie-notification .ct-close{display:flex;align-items:center;justify-content:center;width:45px;height:45px;position:absolute;top:0;right:0;opacity:0.5;color:inherit;cursor:pointer;background:transparent}.cookie-notification .ct-close:hover{opacity:1}@media (max-width: 689.98px){.cookie-notification .ct-close{display:none}}.cookie-notification.ct-fade-in-start,.cookie-notification.ct-fade-in-end,.cookie-notification.ct-fade-start,.cookie-notification.ct-fade-end{transition:all 0.3s ease}.cookie-notification.ct-fade-in-start{opacity:0;transform:translate3d(0, 15px, 0)}.cookie-notification.ct-fade-end{opacity:0;transform:translate3d(0, 15px, 0)}
trunk/framework/extensions/cookies-consent/static/bundle/main.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var r,o;
2
+ /*!
3
+ * JavaScript Cookie v2.2.1
4
+ * https://github.com/js-cookie/js-cookie
5
+ *
6
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
7
+ * Released under the MIT license
8
+ */!function(i){if(void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o),!0,e.exports=i(),!!0){var c=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=c,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function o(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(n);/^[\{\[]/.test(c)&&(n=c)}catch(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,!0!==i[u]&&(a+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+a}}function c(e,n){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var a=i[c].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var f=t(a[0]);if(u=(r.read||r)(u,f)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(o[f]=u,e===f)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return c(e,!1)},o.getJSON=function(e){return c(e,!0)},o.remove=function(t,n){i(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}))},function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.ctFrontend},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),c=n.n(i),a=n(2);function u(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s=function(){var e=document.querySelector(".cookie-notification");e&&(c.a.get("blocksy_cookies_consent_accepted")?e.remove():(requestAnimationFrame((function(){e.classList.remove("ct-fade-in-start"),e.classList.add("ct-fade-in-end"),d(e,(function(){e.classList.remove("ct-fade-in-end")}))})),u(e.querySelectorAll("button")).map((function(t){t.addEventListener("click",(function(n){if(n.preventDefault(),t.classList.contains("ct-accept")){c.a.set("blocksy_cookies_consent_accepted","true",{expires:new Date(1*new Date+{onehour:36e5,oneday:864e5,oneweek:6048e5,onemonth:26784e5,threemonths:80352e5,sixmonths:160704e5,oneyear:31536e6,forever:864e9}[t.closest("[data-period]").dataset.period])})}e.classList.add("ct-fade-start"),requestAnimationFrame((function(){e.classList.remove("ct-fade-start"),e.classList.add("ct-fade-end"),d(e,(function(){e.parentNode.removeChild(e)}))}))}))}))))};function d(e,t){setTimeout((function(){t()}),300)}Object(a.onDocumentLoaded)((function(){s(),o.a.on("blocksy:cookies:init",(function(){s()}))}))}]);
trunk/framework/extensions/cookies-consent/static/bundle/sync.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=window.ctEvents},function(e,t,n){"use strict";n.r(t);var r,o=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},c=function(e,t){var n=t.forcedOutput,r=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return r?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return r?"none":"CT_CSS_SKIP_RULE";var o=[];return e.inset&&o.push("inset"),o.push("".concat(e.h_offset,"px")),o.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(o.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&o.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(o.push("".concat(e.blur,"px")),o.push("".concat(e.spread,"px"))),o.push(e.color.color),o.join(" ")},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},o=document.querySelector("style#".concat(r[n])),c=o.innerText,i="".concat(e["".concat(n,"_selector_prefix")]?"".concat(e["".concat(n,"_selector_prefix")]," "):"").concat(e.selector||":root"),a=null,l=c.match(a);0===c.trim().indexOf(i)?(a=new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)):(a=new RegExp("\\}\\s*?".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)),l||(0===(c="".concat(c," ").concat(i," { }")).trim().indexOf(i)?(a=new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)):(a=new RegExp("\\}\\s*?".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a))),o.innerText=c.replace(a,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(i," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(r=t&&"none"!==t.style?"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color):"none"),"spacing"===(e.type||"")&&(r=o(t)),"box-shadow"===(e.type||"")&&(r=c(t,e)),i(e,"".concat(r).concat(e.unit||"").concat(e.important?" !important":""),n)},l=function(e,t){var n=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,n),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),a(e,t.desktop,"desktop"),a(e,t.tablet,"tablet"),a(e,t.mobile,"mobile")):a(e,t)};r={cookieContentColor:[{selector:".cookie-notification",variable:"color",type:"color:default"},{selector:".cookie-notification",variable:"colorHover",type:"color:hover"}],cookieBackground:{selector:".cookie-notification",variable:"backgroundColor",type:"color"},cookieButtonBackground:[{selector:".cookie-notification",variable:"buttonInitialColor",type:"color:default"},{selector:".cookie-notification",variable:"buttonHoverColor",type:"color:hover"}],cookieMaxWidth:{selector:".cookie-notification",variable:"maxWidth",unit:"px"}},wp.customize.bind("change",(function(e){return r[e.id]&&(Array.isArray(r[e.id])?r[e.id]:[r[e.id]]).map((function(t){return l(t,e())}))}));var u=n(0),s=n.n(u);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(){var e=document.createElement("div");return e.innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,e},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(t||(t=h()),t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]'))){var r=t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]')).innerHTML,o=document.createElement("div");return o.innerHTML=r,o}},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=y({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},should_insert:!0},e);var t=document.querySelector(e.parent_selector);if(p(document.querySelectorAll("".concat(e.parent_selector," ").concat(e.selector))).map((function(e){return e.parentNode.removeChild(e)})),e.should_insert){var n=g(e.fragment_id);if(n){for(;n.firstElementChild;)if(e.beforeInsert(n.firstElementChild),"append"===e.strategy&&t.appendChild(n.firstElementChild),"firstChild"===e.strategy&&t.insertBefore(n.firstElementChild,t.firstElementChild),e.strategy.indexOf("maybeBefore")>-1){var r=e.strategy.split(":"),o=f(r,2),c=(o[0],o[1]);t.querySelector(c)?t.insertBefore(n.firstElementChild,t.querySelector(c)):t.appendChild(n.firstElementChild)}e.whenInserted()}}};function _(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var O=function(){var e=function(e){if(!document.querySelector(".cookie-notification"))return S({fragment_id:"blocksy-cookies-consent-section",selector:".cookie-notification",parent_selector:"#main-container"}),!0}(),t=document.querySelector(".cookie-notification");if(t){t.querySelector(".ct-cookies-content")&&(t.querySelector(".ct-cookies-content").innerHTML=wp.customize("cookie_consent_content")()),t.querySelector("button.ct-accept").innerHTML=wp.customize("cookie_consent_button_text")();var n=wp.customize("cookie_consent_type")();t.dataset.type=n,t.firstElementChild.classList.remove("ct-container","container"),t.firstElementChild.classList.add("type-1"===n?"container":"ct-container"),e&&setTimeout((function(){return s.a.trigger("blocksy:cookies:init")}))}};wp.customize("cookie_consent_content",(function(e){return e.bind((function(e){O()}))})),wp.customize("cookie_consent_button_text",(function(e){return e.bind((function(e){return O()}))})),wp.customize("cookie_consent_type",(function(e){return e.bind((function(e){return O()}))})),wp.customize("forms_cookie_consent_content",(function(e){return e.bind((function(e){return _(document.querySelectorAll(".gdpr-confirm-policy label")).map((function(t){return t.innerHTML=e}))}))}))}]);
trunk/framework/extensions/cookies-consent/static/images/type-1.svg ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#FFFFFF;}
7
+ .st1{fill:#EDEFF0;}
8
+ .st2{fill:#565D66;}
9
+ .st3{fill:#4F5459;}
10
+ .st4{fill:#6E747A;}
11
+ </style>
12
+ <path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
13
+ H13z"/>
14
+ <path class="st1" d="M11,11h78v14H11V11z"/>
15
+ <path class="st2" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
16
+ c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
17
+ <path class="st3" d="M77.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S77.8,18.5,77.5,18.5z
18
+ M70.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S70.8,18.5,70.5,18.5z M63.5,18.5h-4
19
+ c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,18.5,63.5,18.5z M22.4,16.5c0.5-0.9,1.4-1.4,2.4-1.4
20
+ c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V17
21
+ c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,17
22
+ c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,16.5,22.4,16.5,22.4,16.5z M22.7,16.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
23
+ c0,1.1,0.7,2.1,1.7,2.5L22.7,16.9z M27.2,16.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
24
+ C27.6,17.4,27.4,16.9,27.2,16.5 M24.9,18.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,18.8z"/>
25
+ <g>
26
+ <path class="st4" d="M48.2,65.9H16.6c-0.5,0-1-0.5-1-1V45.7c0-0.6,0.5-1,1-1h31.6c0.5,0,1,0.4,1,1v19.1
27
+ C49.2,65.4,48.8,65.9,48.2,65.9z"/>
28
+ <path class="st0" d="M35.9,53.3h-17c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5S36.2,53.3,35.9,53.3z"/>
29
+ <path class="st0" d="M24.7,56.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S25,56.3,24.7,56.3z"/>
30
+ <path class="st0" d="M35.9,56.3h-9.2c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5S36.2,56.3,35.9,56.3z"/>
31
+ <path class="st0" d="M27.8,63.2h-7.3c-1.1,0-2.1-0.9-2.1-2.1l0,0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1l0,0
32
+ C29.9,62.3,28.9,63.2,27.8,63.2z"/>
33
+ <path class="st0" d="M43.7,53.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S44,53.3,43.7,53.3z"/>
34
+ <path class="st0" d="M38.7,49.9H19.4c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0
35
+ C39.7,49.4,39.2,49.9,38.7,49.9z"/>
36
+ </g>
37
+ </svg>
trunk/framework/extensions/cookies-consent/static/images/type-2.svg ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#FFFFFF;}
7
+ .st1{fill:#6E747A;}
8
+ .st2{fill:#EDEFF0;}
9
+ .st3{fill:#565D66;}
10
+ .st4{fill:#4F5459;}
11
+ </style>
12
+ <path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
13
+ H13z"/>
14
+ <g>
15
+ <rect x="10.4" y="57.2" class="st1" width="79.1" height="13"/>
16
+ <path class="st0" d="M32.3,66.5h-17c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5S32.6,66.5,32.3,66.5z"/>
17
+ <path class="st0" d="M43.9,66.5h-9.2c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5S44.2,66.5,43.9,66.5z"/>
18
+ <path class="st0" d="M84.2,66.1h-7.3c-1.1,0-2.1-0.9-2.1-2.1l0,0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1l0,0
19
+ C86.3,65.2,85.4,66.1,84.2,66.1z"/>
20
+ <path class="st0" d="M51.9,66.5h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S52.2,66.5,51.9,66.5z"/>
21
+ <path class="st0" d="M35.1,63H15.9c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0C36.1,62.6,35.7,63,35.1,63z"/>
22
+ </g>
23
+ <path class="st2" d="M11,11h78v14H11V11z"/>
24
+ <path class="st3" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
25
+ c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
26
+ <path class="st4" d="M77.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S77.8,18.5,77.5,18.5z
27
+ M70.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S70.8,18.5,70.5,18.5z M63.5,18.5h-4
28
+ c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,18.5,63.5,18.5z M22.4,16.5c0.5-0.9,1.4-1.4,2.4-1.4
29
+ c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V17
30
+ c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,17
31
+ c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,16.5,22.4,16.5,22.4,16.5z M22.7,16.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
32
+ c0,1.1,0.7,2.1,1.7,2.5L22.7,16.9z M27.2,16.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
33
+ C27.6,17.4,27.4,16.9,27.2,16.5 M24.9,18.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,18.8z"/>
34
+ </svg>
trunk/framework/extensions/cookies-consent/static/js/ct-events.js ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Listen and trigger custom events to communicate between javascript components
3
+ */
4
+ window.ctEvents =
5
+ window.ctEvents ||
6
+ new (function () {
7
+ var _events = {}
8
+ var currentIndentation = 1
9
+ var debug = false
10
+
11
+ this.countAll = function (topic) {
12
+ return _events[topic]
13
+ }
14
+
15
+ /**
16
+ * Make log helper public
17
+ *
18
+ * @param {String} [message]
19
+ * @param {Object} [data]
20
+ */
21
+ this.log = log
22
+
23
+ /**
24
+ * Enable/Disable Debug
25
+ * @param {Boolean} enabled
26
+ */
27
+ this.debug = function (enabled) {
28
+ debug = Boolean(enabled)
29
+
30
+ return this
31
+ }
32
+
33
+ /**
34
+ * Add event listener
35
+ *
36
+ * @param event {String | Object}
37
+ * Can be a:
38
+ * - single event: 'event1'
39
+ * - space separated event list: 'event1 event2 event2'
40
+ * - an object: {event1: function () {}, event2: function () {}}
41
+ *
42
+ * @param callback {Function}
43
+ */
44
+ this.on = function (topicStringOrObject, listener) {
45
+ objectMap(
46
+ splitTopicStringOrObject(topicStringOrObject, listener),
47
+ function (eventName, listener) {
48
+ ;(_events[eventName] || (_events[eventName] = [])).push(
49
+ listener
50
+ )
51
+
52
+ debug && log('✚ ' + eventName)
53
+ }
54
+ )
55
+
56
+ return this
57
+ }
58
+
59
+ /**
60
+ * Same as .on(), but callback will executed only once
61
+ */
62
+ this.one = function (topicStringOrObject, listener) {
63
+ objectMap(
64
+ splitTopicStringOrObject(topicStringOrObject, listener),
65
+ function (eventName, listener) {
66
+ ;(_events[eventName] || (_events[eventName] = [])).push(
67
+ once(listener)
68
+ )
69
+
70
+ debug && log('✚ [' + eventName + ']')
71
+ }
72
+ )
73
+
74
+ return this
75
+
76
+ // https://github.com/jashkenas/underscore/blob/8fc7032295d60aff3620ef85d4aa6549a55688a0/underscore.js#L946
77
+ function once(func) {
78
+ var memo
79
+
80
+ var times = 2
81
+
82
+ return function () {
83
+ if (--times > 0) {
84
+ memo = func.apply(this, arguments)
85
+ }
86
+
87
+ if (times <= 1) func = null
88
+
89
+ return memo
90
+ }
91
+ }
92
+ }
93
+
94
+ /**
95
+ * In order to remove one single listener you should give as an argument
96
+ * the same callback function. If you want to remove *all* listeners from
97
+ * a particular event you should not pass the second argument.
98
+ *
99
+ * @param topicStringOrObject {String | Object}
100
+ * @param listener {Function | false}
101
+ */
102
+ this.off = function (topicStringOrObject, listener) {
103
+ objectMap(
104
+ splitTopicStringOrObject(topicStringOrObject, listener),
105
+ function (eventName, listener) {
106
+ if (_events[eventName]) {
107
+ if (listener) {
108
+ _events[eventName].splice(
109
+ _events[eventName].indexOf(listener) >>> 0,
110
+ 1
111
+ )
112
+ } else {
113
+ _events[eventName] = []
114
+ }
115
+
116
+ debug && log('✖ ' + eventName)
117
+ }
118
+ }
119
+ )
120
+
121
+ return this
122
+ }
123
+
124
+ /**
125
+ * Trigger an event. In case you provide multiple events via space-separated
126
+ * string or an object of events it will execute listeners for each event
127
+ * separatedly. You can use the "all" event to trigger all events.
128
+ *
129
+ * @param topicStringOrObject {String | Object}
130
+ * @param data {Object}
131
+ */
132
+ this.trigger = function (eventName, data) {
133
+ objectMap(splitTopicStringOrObject(eventName), function (
134
+ eventName
135
+ ) {
136
+ log('╭─ ' + eventName, data)
137
+
138
+ changeIndentation(+1)
139
+
140
+ try {
141
+ // TODO: REFACTOR THAT!!!!!!!!!
142
+ // Maybe this is an occasion for using 'all' event???
143
+ if (eventName === 'fw:options:init') {
144
+ fw.options.startListeningToEvents(
145
+ data.$elements || document.body
146
+ )
147
+ }
148
+
149
+ ;(_events[eventName] || []).map(dispatchSingleEvent)
150
+ ;(_events['all'] || []).map(dispatchSingleEvent)
151
+ } catch (e) {
152
+ console.log(
153
+ '%c [Events] Exception raised.',
154
+ 'color: red; font-weight: bold;'
155
+ )
156
+
157
+ if (typeof console !== 'undefined') {
158
+ console.error(e)
159
+ } else {
160
+ throw e
161
+ }
162
+ }
163
+
164
+ changeIndentation(-1)
165
+
166
+ log('╰─ ' + eventName, data)
167
+
168
+ function dispatchSingleEvent(listenerDescriptor) {
169
+ if (!listenerDescriptor) return
170
+
171
+ listenerDescriptor.call(window, data)
172
+ }
173
+ })
174
+
175
+ return this
176
+
177
+ function changeIndentation(increment) {
178
+ if (typeof increment != 'undefined') {
179
+ currentIndentation += increment > 0 ? +1 : -1
180
+ }
181
+
182
+ if (currentIndentation < 0) {
183
+ currentIndentation = 0
184
+ }
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Check if an event has listeners
190
+ * @param {String} [event]
191
+ * @return {Boolean}
192
+ */
193
+ this.hasListeners = function (eventName) {
194
+ if (!_events) {
195
+ return false
196
+ }
197
+
198
+ return (_events[eventName] || []).length > 0
199
+ }
200
+
201
+ /**
202
+ * Probably split string into general purpose object representation for
203
+ * event names and listeners. This function leaves objects un-modified.
204
+ *
205
+ * @param topicStringOrObject {String | Object}
206
+ * @param listener {Function | false}
207
+ *
208
+ * @returns {Object} {
209
+ * eventname: listener,
210
+ * otherevent: listener
211
+ * }
212
+ */
213
+ function splitTopicStringOrObject(topicStringOrObject, listener) {
214
+ if (typeof topicStringOrObject !== 'string') {
215
+ return topicStringOrObject
216
+ }
217
+
218
+ var arrayOfEvents = topicStringOrObject
219
+ .replace(/\s\s+/g, ' ')
220
+ .trim()
221
+ .split(' ')
222
+
223
+ var len = arrayOfEvents.length
224
+
225
+ var listenerDescriptor = Object.create(null)
226
+
227
+ for (var i = 0; i < len; i++) {
228
+ listenerDescriptor[arrayOfEvents[i]] = listener
229
+ }
230
+
231
+ return listenerDescriptor
232
+ }
233
+
234
+ /**
235
+ * returns a new object with the predicate applied to each value
236
+ * objectMap({a: 3, b: 5, c: 9}, (key, value) => value + 1); // {a: 4, b: 6, c: 10}
237
+ * objectMap({a: 3, b: 5, c: 9}, (key, value) => key); // {a: 'a', b: 'b', c: 'c'}
238
+ * objectMap({a: 3, b: 5, c: 9}, (key, value) => key + value); // {a: 'a3', b: 'b5', c: 'c9'}
239
+ *
240
+ * https://github.com/angus-c/just/tree/master/packages/object-map
241
+ */
242
+ function objectMap(obj, predicate) {
243
+ var result = {}
244
+ var keys = Object.keys(obj)
245
+ var len = keys.length
246
+
247
+ for (var i = 0; i < len; i++) {
248
+ var key = keys[i]
249
+ result[key] = predicate(key, obj[key])
250
+ }
251
+
252
+ return result
253
+ }
254
+
255
+ function log(message, data) {
256
+ if (!debug) {
257
+ return
258
+ }
259
+
260
+ if (typeof data != 'undefined') {
261
+ console.log('[Event] ' + getIndentation() + message, '─', data)
262
+ } else {
263
+ console.log('[Event] ' + getIndentation() + message)
264
+ }
265
+
266
+ function getIndentation() {
267
+ return new Array(currentIndentation).join('│ ')
268
+ }
269
+ }
270
+ })()
trunk/framework/extensions/cookies-consent/static/js/lazy-load-helpers.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export const markImagesAsLoaded = el =>
2
+ [...el.querySelectorAll('.ct-image-container.ct-lazy')].map(el => {
3
+ if (el.querySelector('img')) {
4
+ el.querySelector('img').setAttribute(
5
+ 'src',
6
+ el.querySelector('img').dataset.ctLazy
7
+ )
8
+
9
+ if (el.querySelector('img').dataset.ctLazySet) {
10
+ el.querySelector('img').setAttribute(
11
+ 'srcset',
12
+ el.querySelector('img').dataset.ctLazySet
13
+ )
14
+ }
15
+ }
16
+
17
+ el.classList.remove('ct-lazy')
18
+ el.classList.add('ct-lazy-loaded')
19
+ })
20
+
trunk/framework/extensions/cookies-consent/static/js/main.js ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctEvents from 'ct-events'
2
+ import cookie from 'js-cookie'
3
+ import { onDocumentLoaded } from 'blocksy-frontend'
4
+
5
+ const initCookies = () => {
6
+ const notification = document.querySelector('.cookie-notification')
7
+
8
+ if (!notification) return
9
+
10
+ if (cookie.get('blocksy_cookies_consent_accepted')) {
11
+ notification.remove()
12
+ return
13
+ }
14
+
15
+ requestAnimationFrame(() => {
16
+ notification.classList.remove('ct-fade-in-start')
17
+ notification.classList.add('ct-fade-in-end')
18
+
19
+ whenTransitionEnds(notification, () => {
20
+ notification.classList.remove('ct-fade-in-end')
21
+ })
22
+ })
23
+ ;[...notification.querySelectorAll('button')].map((el) => {
24
+ el.addEventListener('click', (e) => {
25
+ e.preventDefault()
26
+
27
+ if (el.classList.contains('ct-accept')) {
28
+ const periods = {
29
+ onehour: 36e5,
30
+ oneday: 864e5,
31
+ oneweek: 7 * 864e5,
32
+ onemonth: 31 * 864e5,
33
+ threemonths: 3 * 31 * 864e5,
34
+ sixmonths: 6 * 31 * 864e5,
35
+ oneyear: 365 * 864e5,
36
+ forever: 10000 * 864e5,
37
+ }
38
+
39
+ cookie.set('blocksy_cookies_consent_accepted', 'true', {
40
+ expires: new Date(
41
+ new Date() * 1 +
42
+ periods[el.closest('[data-period]').dataset.period]
43
+ ),
44
+ })
45
+ }
46
+
47
+ notification.classList.add('ct-fade-start')
48
+
49
+ requestAnimationFrame(() => {
50
+ notification.classList.remove('ct-fade-start')
51
+ notification.classList.add('ct-fade-end')
52
+
53
+ whenTransitionEnds(notification, () => {
54
+ notification.parentNode.removeChild(notification)
55
+ })
56
+ })
57
+ })
58
+ })
59
+ }
60
+
61
+ onDocumentLoaded(() => {
62
+ initCookies()
63
+
64
+ ctEvents.on('blocksy:cookies:init', () => {
65
+ initCookies()
66
+ })
67
+ })
68
+
69
+ function whenTransitionEnds(el, cb) {
70
+ setTimeout(() => {
71
+ cb()
72
+ }, 300)
73
+ return
74
+
75
+ const end = () => {
76
+ el.removeEventListener('transitionend', onEnd)
77
+ cb()
78
+ }
79
+
80
+ const onEnd = (e) => {
81
+ if (e.target === el) {
82
+ end()
83
+ }
84
+ }
85
+
86
+ el.addEventListener('transitionend', onEnd)
87
+ }
trunk/framework/extensions/cookies-consent/static/js/sync.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './variables'
2
+ import ctEvents from 'ct-events'
3
+
4
+ import { renderWithStrategy } from './sync/helpers'
5
+
6
+ const maybeAnimateCookiesConsent = cb => {
7
+ if (document.querySelector('.cookie-notification')) return
8
+
9
+ renderWithStrategy({
10
+ fragment_id: 'blocksy-cookies-consent-section',
11
+ selector: '.cookie-notification',
12
+ parent_selector: '#main-container'
13
+ })
14
+
15
+ return true
16
+ }
17
+
18
+ const render = () => {
19
+ const didInsert = maybeAnimateCookiesConsent()
20
+
21
+ const notification = document.querySelector('.cookie-notification')
22
+
23
+ if (!notification) {
24
+ return
25
+ }
26
+
27
+ if (notification.querySelector('.ct-cookies-content')) {
28
+ notification.querySelector(
29
+ '.ct-cookies-content'
30
+ ).innerHTML = wp.customize('cookie_consent_content')()
31
+ }
32
+
33
+ notification.querySelector('button.ct-accept').innerHTML = wp.customize(
34
+ 'cookie_consent_button_text'
35
+ )()
36
+
37
+ const type = wp.customize('cookie_consent_type')()
38
+
39
+ notification.dataset.type = type
40
+
41
+ notification.firstElementChild.classList.remove('ct-container', 'container')
42
+ notification.firstElementChild.classList.add(
43
+ type === 'type-1' ? 'container' : 'ct-container'
44
+ )
45
+
46
+ if (didInsert) {
47
+ setTimeout(() => ctEvents.trigger('blocksy:cookies:init'))
48
+ }
49
+ }
50
+
51
+ wp.customize('cookie_consent_content', val =>
52
+ val.bind(to => {
53
+ render()
54
+ })
55
+ )
56
+ wp.customize('cookie_consent_button_text', val => val.bind(to => render()))
57
+ wp.customize('cookie_consent_type', val => val.bind(to => render()))
58
+
59
+ wp.customize('forms_cookie_consent_content', val =>
60
+ val.bind(to =>
61
+ [...document.querySelectorAll('.gdpr-confirm-policy label')].map(
62
+ el => (el.innerHTML = to)
63
+ )
64
+ )
65
+ )
trunk/framework/extensions/cookies-consent/static/js/sync/helpers.js ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export const getCache = () => {
2
+ const div = document.createElement('div')
3
+
4
+ div.innerHTML = document.querySelector(
5
+ '.ct-customizer-preview-cache-container'
6
+ ).value
7
+
8
+ return div
9
+ }
10
+
11
+ export const getFreshHtmlFor = (id, cache = null, attr = 'id') => {
12
+ if (!cache) {
13
+ cache = getCache()
14
+ }
15
+
16
+ if (
17
+ !cache.querySelector(
18
+ `.ct-customizer-preview-cache [data-${attr}="${id}"]`
19
+ )
20
+ ) {
21
+ return
22
+ }
23
+
24
+ const newHtml = cache.querySelector(
25
+ `.ct-customizer-preview-cache [data-${attr}="${id}"]`
26
+ ).innerHTML
27
+
28
+ const e = document.createElement('div')
29
+ e.innerHTML = newHtml
30
+
31
+ return e
32
+ }
33
+
34
+ export const renderWithStrategy = (args = {}) => {
35
+ args = {
36
+ fragment_id: null,
37
+
38
+ selector: null,
39
+ parent_selector: null,
40
+
41
+ // append | firstChild | maybeBefore:selector
42
+ strategy: 'append',
43
+ whenInserted: () => {},
44
+ beforeInsert: el => {},
45
+
46
+ should_insert: true,
47
+
48
+ ...args
49
+ }
50
+
51
+ const parent = document.querySelector(args.parent_selector)
52
+ ;[
53
+ ...document.querySelectorAll(`${args.parent_selector} ${args.selector}`)
54
+ ].map(el => el.parentNode.removeChild(el))
55
+
56
+ if (!args.should_insert) return
57
+
58
+ const el = getFreshHtmlFor(args.fragment_id)
59
+
60
+ if (!el) {
61
+ return
62
+ }
63
+
64
+ while (el.firstElementChild) {
65
+ args.beforeInsert(el.firstElementChild)
66
+
67
+ if (args.strategy === 'append') {
68
+ parent.appendChild(el.firstElementChild)
69
+ }
70
+
71
+ if (args.strategy === 'firstChild') {
72
+ parent.insertBefore(el.firstElementChild, parent.firstElementChild)
73
+ }
74
+
75
+ if (args.strategy.indexOf('maybeBefore') > -1) {
76
+ const [_, selector] = args.strategy.split(':')
77
+
78
+ if (parent.querySelector(selector)) {
79
+ parent.insertBefore(
80
+ el.firstElementChild,
81
+ parent.querySelector(selector)
82
+ )
83
+ } else {
84
+ parent.appendChild(el.firstElementChild)
85
+ }
86
+ }
87
+ }
88
+
89
+ args.whenInserted()
90
+ }
91
+
92
+ export const checkAndReplace = (args = {}) => {
93
+ args = {
94
+ id: null,
95
+
96
+ fragment_id: null,
97
+
98
+ selector: null,
99
+ parent_selector: null,
100
+
101
+ // append | firstChild | maybeBefore:selector
102
+ strategy: 'append',
103
+ whenInserted: () => {},
104
+ beforeInsert: el => {},
105
+ watch: [],
106
+
107
+ ...args
108
+ }
109
+
110
+ const render = () => {
111
+ const to = wp.customize(args.id)()
112
+
113
+ renderWithStrategy({
114
+ ...args,
115
+ should_insert: to === 'yes'
116
+ })
117
+ }
118
+
119
+ wp.customize(args.id, val => val.bind(to => render()))
120
+ args.watch.map(opt => wp.customize(opt, val => val.bind(() => render())))
121
+ }
122
+
123
+ export const responsiveClassesFor = (id, el) => {
124
+ el.classList.remove('ct-hidden-sm', 'ct-hidden-md', 'ct-hidden-lg')
125
+
126
+ if (!wp.customize(id)) return
127
+
128
+ const data = wp.customize(id)() || {
129
+ mobile: false,
130
+ tablet: true,
131
+ desktop: true
132
+ }
133
+
134
+ if (!data.mobile) {
135
+ el.classList.add('ct-hidden-sm')
136
+ }
137
+
138
+ if (!data.tablet) {
139
+ el.classList.add('ct-hidden-md')
140
+ }
141
+
142
+ if (!data.desktop) {
143
+ el.classList.add('ct-hidden-lg')
144
+ }
145
+ }
trunk/framework/extensions/cookies-consent/static/js/variables.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { handleVariablesFor } from 'customizer-sync-helpers'
2
+
3
+ handleVariablesFor({
4
+ cookieContentColor: [
5
+ {
6
+ selector: '.cookie-notification',
7
+ variable: 'color',
8
+ type: 'color:default'
9
+ },
10
+
11
+ {
12
+ selector: '.cookie-notification',
13
+ variable: 'colorHover',
14
+ type: 'color:hover'
15
+ }
16
+ ],
17
+
18
+ cookieBackground: {
19
+ selector: '.cookie-notification',
20
+ variable: 'backgroundColor',
21
+ type: 'color'
22
+ },
23
+
24
+ cookieButtonBackground: [
25
+ {
26
+ selector: '.cookie-notification',
27
+ variable: 'buttonInitialColor',
28
+ type: 'color:default'
29
+ },
30
+
31
+ {
32
+ selector: '.cookie-notification',
33
+ variable: 'buttonHoverColor',
34
+ type: 'color:hover'
35
+ }
36
+ ],
37
+
38
+ cookieMaxWidth: {
39
+ selector: '.cookie-notification',
40
+ variable: 'maxWidth',
41
+ unit: 'px'
42
+ }
43
+ })
trunk/framework/extensions/cookies-consent/static/sass/main.scss ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ .cookie-notification {
4
+ position: fixed;
5
+ left: 0;
6
+ bottom: 0;
7
+ z-index: 999999;
8
+ color: var(--color);
9
+
10
+ a:hover {
11
+ color: var(--colorHover);
12
+ }
13
+
14
+ @include media-breakpoint-down (xs) {
15
+ > div {
16
+ flex-direction: column;
17
+ }
18
+ }
19
+
20
+ @include media-breakpoint-down (sm) {
21
+ right: 0;
22
+
23
+ > div {
24
+ display: flex;
25
+ align-items: center;
26
+ padding-top: 15px;
27
+ padding-bottom: 15px;
28
+ }
29
+ }
30
+
31
+
32
+ // type 1
33
+ &[data-type='type-1'] {
34
+ @include media-breakpoint-down (sm) {
35
+ background: var(--backgroundColor);
36
+ }
37
+
38
+ @include media-breakpoint-up (md) {
39
+ padding: 0 25px 25px 25px;
40
+
41
+ .ct-cookies-content {
42
+ margin-bottom: 15px;
43
+ max-width: 90%;
44
+ }
45
+ }
46
+
47
+ .container {
48
+ position: relative;
49
+
50
+ @include media-breakpoint-down (sm) {
51
+ width: 88%;
52
+ margin: 0 auto;
53
+ }
54
+
55
+ @include media-breakpoint-up (md) {
56
+ background: var(--backgroundColor);
57
+ box-shadow: 0px 5px 30px -5px rgba(34, 56, 101, 0.15);
58
+ padding: 25px 40px 25px 25px;
59
+ border-radius: 3px;
60
+ max-width: var(--maxWidth);
61
+ }
62
+ }
63
+ }
64
+
65
+
66
+ // type 2
67
+ &[data-type='type-2'] {
68
+ right: 0;
69
+ background: var(--backgroundColor);
70
+
71
+ @include media-breakpoint-up (md) {
72
+ padding: 15px 0;
73
+
74
+ .ct-container {
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ }
79
+
80
+ .ct-accept {
81
+ margin-left: 25px;
82
+ }
83
+ }
84
+
85
+ .ct-close {
86
+ display: none;
87
+ }
88
+ }
89
+
90
+
91
+ .ct-cookies-content {
92
+ line-height: 1.4;
93
+
94
+ > *:last-child {
95
+ margin-bottom: 0;
96
+ }
97
+
98
+ a {
99
+ text-decoration: underline;
100
+ color: var(--colorHover);
101
+ }
102
+
103
+ @include media-breakpoint-down (xs) {
104
+ text-align: center;
105
+ margin-bottom: 15px;
106
+ }
107
+
108
+ @include media-breakpoint-down (sm) {
109
+ font-size: 13px;
110
+ }
111
+
112
+ @include media-breakpoint-up (md) {
113
+ font-size: 14px;
114
+ }
115
+ }
116
+
117
+ .ct-accept {
118
+ --buttonFontSize: 13px;
119
+ --buttonMinHeight: 35px;
120
+ --padding: 0 20px;
121
+ --buttonShadow: none;
122
+ --buttonTransform: none;
123
+
124
+ @include media-breakpoint-down (xs) {
125
+ width: 100%;
126
+ }
127
+
128
+ @include media-breakpoint-only (sm) {
129
+ margin-left: 20px;
130
+ }
131
+ }
132
+
133
+ .ct-close {
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ width: 45px;
138
+ height: 45px;
139
+ position: absolute;
140
+ top: 0;
141
+ right: 0;
142
+ opacity: 0.5;
143
+ color: inherit;
144
+ cursor: pointer;
145
+ background: transparent;
146
+
147
+ &:hover {
148
+ opacity: 1;
149
+ }
150
+
151
+ @include media-breakpoint-down (sm) {
152
+ display: none;
153
+ }
154
+ }
155
+
156
+ // animation
157
+ &.ct-fade-in-start,
158
+ &.ct-fade-in-end,
159
+ &.ct-fade-start,
160
+ &.ct-fade-end {
161
+ transition: all 0.3s ease;
162
+ }
163
+
164
+ &.ct-fade-in-start {
165
+ opacity: 0;
166
+ transform: translate3d(0, 15px, 0);
167
+ }
168
+
169
+ &.ct-fade-end {
170
+ opacity: 0;
171
+ transform: translate3d(0, 15px, 0);
172
+ }
173
+ }
trunk/framework/extensions/mailchimp/admin-static/bundle/1.2c9ebf0a36c6c732fee6.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[1],[,,,,,,function(e,t,n){var o;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var s=r.apply(null,o);s&&e.push(s)}else if("object"===i)for(var u in o)n.call(o,u)&&o[u]&&e.push(u)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){e.exports=n(8)()},function(e,t,n){"use strict";var o=n(9);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=n(11)},function(e,t,n){"use strict";
7
+ /** @license React v16.13.1
8
+ * react-is.production.min.js
9
+ *
10
+ * Copyright (c) Facebook, Inc. and its affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */var o="function"==typeof Symbol&&Symbol.for,r=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,s=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,a=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,p=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.async_mode"):60111,c=o?Symbol.for("react.concurrent_mode"):60111,h=o?Symbol.for("react.forward_ref"):60112,f=o?Symbol.for("react.suspense"):60113,g=o?Symbol.for("react.suspense_list"):60120,m=o?Symbol.for("react.memo"):60115,v=o?Symbol.for("react.lazy"):60116,y=o?Symbol.for("react.block"):60121,I=o?Symbol.for("react.fundamental"):60117,S=o?Symbol.for("react.responder"):60118,b=o?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case c:case s:case a:case u:case f:return e;default:switch(e=e&&e.$$typeof){case p:case h:case v:case m:case l:return e;default:return t}}case i:return t}}}function x(e){return w(e)===c}t.AsyncMode=d,t.ConcurrentMode=c,t.ContextConsumer=p,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=u,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===p},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===v},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===u},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===c||e===a||e===u||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===p||e.$$typeof===h||e.$$typeof===I||e.$$typeof===S||e.$$typeof===b||e.$$typeof===y)},t.typeOf=w},function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var s=n(7),u=n.n(s),a=n(1);n(10);function l(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function p(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function d(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return p(n.overflowY,t)||p(n.overflowX,t)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function c(e,t,n,o,r,i,s,u){return i<e&&s>t||i>e&&s<t?0:i<=e&&u<=n||s>=t&&u>=n?i-e-o:s>t&&u<n||i<e&&u>n?s-t+r:0}var h=0;function f(e){return"function"==typeof e?e:g}function g(){}function m(e,t){null!==e&&function(e,t){var n=t.scrollMode,o=t.block,r=t.inline,i=t.boundary,s=t.skipOverflowHiddenElements,u="function"==typeof i?i:function(e){return e!==i};if(!l(e))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,p=[],h=e;l(h)&&u(h);){if((h=h.parentNode)===a){p.push(h);break}h===document.body&&d(h)&&!d(document.documentElement)||d(h,s)&&p.push(h)}for(var f=window.visualViewport?visualViewport.width:innerWidth,g=window.visualViewport?visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),I=y.height,S=y.width,b=y.top,w=y.right,x=y.bottom,C=y.left,H="start"===o||"nearest"===o?b:"end"===o?x:b+I/2,O="center"===r?C+S/2:"end"===r?w:C,E=[],P=0;P<p.length;P++){var M=p[P],D=M.getBoundingClientRect(),T=D.height,k=D.width,R=D.top,A=D.right,V=D.bottom,K=D.left;if("if-needed"===n&&b>=0&&C>=0&&x<=g&&w<=f&&b>=R&&x<=V&&C>=K&&w<=A)return E;var _=getComputedStyle(M),L=parseInt(_.borderLeftWidth,10),$=parseInt(_.borderTopWidth,10),B=parseInt(_.borderRightWidth,10),j=parseInt(_.borderBottomWidth,10),W=0,U=0,N="offsetWidth"in M?M.offsetWidth-M.clientWidth-L-B:0,F="offsetHeight"in M?M.offsetHeight-M.clientHeight-$-j:0;if(a===M)W="start"===o?H:"end"===o?H-g:"nearest"===o?c(v,v+g,g,$,j,v+H,v+H+I,I):H-g/2,U="start"===r?O:"center"===r?O-f/2:"end"===r?O-f:c(m,m+f,f,L,B,m+O,m+O+S,S),W=Math.max(0,W+v),U=Math.max(0,U+m);else{W="start"===o?H-R-$:"end"===o?H-V+j+F:"nearest"===o?c(R,V,T,$,j+F,H,H+I,I):H-(R+T/2)+F/2,U="start"===r?O-K-L:"center"===r?O-(K+k/2)+N/2:"end"===r?O-A+B+N:c(K,A,k,L,B+N,O,O+S,S);var z=M.scrollLeft,Y=M.scrollTop;H+=Y-(W=Math.max(0,Math.min(Y+W,M.scrollHeight-T+F))),O+=z-(U=Math.max(0,Math.min(z+U,M.scrollWidth-k+N)))}E.push({el:M,top:W,left:U})}return E}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o}))}function v(e,t){return e===t||e.contains&&e.contains(t)}function y(e,t){var n;function o(){n&&clearTimeout(n)}function r(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];o(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return r.cancel=o,r}function I(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function b(e){var t=e.isOpen,n=e.selectedItem,o=e.resultCount,r=e.previousResultCount,i=e.itemToString;return t?o?o!==r?o+" result"+(1===o?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function w(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function x(e){return"string"==typeof e.type}function C(e){return e.props}var H=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function O(e){void 0===e&&(e={});var t={};return H.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function E(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function P(e,t,n){var o=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:o+1);var r=t+e;return r<0?r=o:r>o&&(r=0),r}var M=y((function(){T().textContent=""}),500);function D(e,t){var n=T(t);e&&(n.textContent=e,M())}function T(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var k=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),R=function(){var e=function(e){var t,n;function s(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(h++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var o=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==o})),e()}),t);n.timeoutIds.push(o)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=O(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,o){t=O(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var r=n.items[e];null!=r&&n.selectItem(r,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,i,s={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),o=a.hasOwnProperty("selectedItem");var l={},p={};return o&&a.selectedItem!==t.selectedItem&&(i=a.selectedItem),a.type=a.type||0,Object.keys(a).forEach((function(e){t[e]!==a[e]&&(s[e]=a[e]),"type"!==e&&(p[e]=a[e],n.isControlledProp(e)||(l[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),{},a)),l}),(function(){f(t)(),Object.keys(s).length>1&&n.props.onStateChange(s,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==i&&n.props.onChange(i,n.getStateAndHelpers()),n.props.onUserAction(s,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,s=void 0===e?{}:e,u=s.refKey,a=void 0===u?"ref":u,l=s.ref,p=o(s,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,c=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=c;var h=n.getState().isOpen;return r(((i={})[a]=S(l,n.rootRef),i.role="combobox",i["aria-expanded"]=h,i["aria-haspopup"]="listbox",i["aria-owns"]=h?n.menuId:null,i["aria-labelledby"]=n.labelId,i),p)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(P(1,t.getState().highlightedIndex,e),{type:4})}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(P(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var r=this.items[o],i=this.getItemNodeFromIndex(o);if(null==r||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick,s=(t.onPress,t.onKeyDown),u=t.onKeyUp,a=t.onBlur,l=o(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),p=n.getState().isOpen,d={onClick:I(i,n.buttonHandleClick),onKeyDown:I(s,n.buttonHandleKeyDown),onKeyUp:I(u,n.buttonHandleKeyUp),onBlur:I(a,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":p?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:d,{},l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=E(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(i(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,s=t.onBlur,u=t.onChange,a=t.onInput,l=(t.onChangeText,o(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),p={};var d,c=n.getState(),h=c.inputValue,f=c.isOpen,g=c.highlightedIndex;l.disabled||((d={}).onChange=I(u,a,n.inputHandleChange),d.onKeyDown=I(i,n.inputHandleKeyDown),d.onBlur=I(s,n.inputHandleBlur),p=d);return r({"aria-autocomplete":"list","aria-activedescendant":f&&"number"==typeof g&&g>=0?n.getItemId(g):null,"aria-controls":f?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:h,id:n.inputId},p,{},l)},n.inputHandleKeyDown=function(e){var t=E(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(i(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,s=void 0===e?{}:e,u=s.refKey,a=void 0===u?"ref":u,l=s.ref,p=o(s,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,c=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=c,r(((i={})[a]=S(l,n.menuRef),i.role="listbox",i["aria-labelledby"]=p&&p["aria-label"]?null:n.labelId,i.id=n.menuId,i),p)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,s=i.onMouseMove,u=i.onMouseDown,a=i.onClick,l=(i.onPress,i.index),p=i.item,d=void 0===p?void 0:p,c=o(i,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===l?(n.items.push(d),l=n.items.indexOf(d)):n.items[l]=d;var h=a,f=((t={onMouseMove:I(s,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:I(u,(function(e){e.preventDefault()}))}).onClick=I(h,(function(){n.selectItemAtIndex(l,{type:9})})),t),g=c.disabled?{onMouseDown:f.onMouseDown}:f;return r({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},g,{},c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=O(e),n.internalSetState((function(t){var o=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(o)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=O(e),n.internalSetState((function(t){var o=t.isOpen;return r({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var o=n.getState(),r=o.isOpen,i=o.highlightedIndex;r&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),f(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=y((function(){var e=n.getState(),t=n.items[e.highlightedIndex],o=n.getItemCount(),i=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:t},e));n.previousResultCount=o,D(i,n.props.environment.document)}),200);var s=n.props,u=s.defaultHighlightedIndex,a=s.initialHighlightedIndex,l=void 0===a?u:a,p=s.defaultIsOpen,d=s.initialIsOpen,c=void 0===d?p:d,g=s.initialInputValue,m=void 0===g?"":g,v=s.initialSelectedItem,b=void 0===v?null:v,w=n.getState({highlightedIndex:l,isOpen:c,inputValue:m,selectedItem:b});return null!=w.selectedItem&&void 0===n.props.initialInputValue&&(w.inputValue=n.props.itemToString(w.selectedItem)),n.state=w,n}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=s.prototype;return u.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},u.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,o){return n[o]=t.isControlledProp(o)?t.props[o]:e[o],n}),{})},u.isControlledProp=function(e){return void 0!==this.props[e]},u.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},u.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},u.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},u.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var o=P(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(o,t)}},u.highlightFirstOrLastIndex=function(e,t,n){var o=this.getItemCount()-1;o<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:o,n))},u.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,r=e.isOpen,i=this.props.itemToString,s=this.id,u=this.getRootProps,a=this.getToggleButtonProps,l=this.getLabelProps,p=this.getMenuProps,d=this.getInputProps,c=this.getItemProps,h=this.openMenu,f=this.closeMenu,g=this.toggleMenu,m=this.selectItem,v=this.selectItemAtIndex,y=this.selectHighlightedItem,I=this.setHighlightedIndex,S=this.clearSelection,b=this.clearItems;return{getRootProps:u,getToggleButtonProps:a,getLabelProps:l,getMenuProps:p,getInputProps:d,getItemProps:c,reset:this.reset,openMenu:h,closeMenu:f,toggleMenu:g,selectItem:m,selectItemAtIndex:v,selectHighlightedItem:y,setHighlightedIndex:I,clearSelection:S,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:s,highlightedIndex:t,inputValue:n,isOpen:r,selectedItem:o}},u.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var o=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(v(e,t)||n&&v(e,o.activeElement))}))},n=function(){e.isMouseDown=!0},o=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},s=function(n){var o=t(n.target,!1);e.isTouchMove||o||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",n),u.addEventListener("mouseup",o),u.addEventListener("touchstart",r),u.addEventListener("touchmove",i),u.addEventListener("touchend",s),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",n),u.removeEventListener("mouseup",o),u.removeEventListener("touchstart",r),u.removeEventListener("touchmove",i),u.removeEventListener("touchend",s)}},u.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},u.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},u.componentWillUnmount=function(){this.cleanup()},u.render=function(){var e=w(this.props.children,g);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=w(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:x(t)?Object(a.cloneElement)(t,this.getRootProps(C(t))):void 0:null},s}(a.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:b,itemToString:function(e){return null==e?"":String(e)},onStateChange:g,onInputValueChange:g,onUserAction:g,onChange:g,onSelect:g,onOuterClick:g,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:m},e.stateChangeTypes=k,e}();u.a.array.isRequired,u.a.func,u.a.func,u.a.func,u.a.bool,u.a.number,u.a.number,u.a.number,u.a.bool,u.a.bool,u.a.bool,u.a.any,u.a.any,u.a.any,u.a.string,u.a.string,u.a.string,u.a.func,u.a.string,u.a.func,u.a.func,u.a.func,u.a.func,u.a.func,u.a.shape({addEventListener:u.a.func,removeEventListener:u.a.func,document:u.a.shape({getElementById:u.a.func,activeElement:u.a.any,body:u.a.any})});"undefined"==typeof window||window;t.a=R}]]);
trunk/framework/extensions/mailchimp/admin-static/bundle/2.976c8f43abfe584b1a9d.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[2],{13:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(12),c=n(2),i=n(6),o=n.n(i);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t,n,r,a,c,i){try{var o=e[c](i),u=o.value}catch(e){return void n(e)}o.done?t(u):Promise.resolve(u).then(r,a)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==o.return||o.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=null;t.default=function(e){var t=e.value,n=e.onChange,i=s(Object(r.useState)(d||[]),2),f=i[0],p=i[1],m=s(Object(r.useState)(!d),2),b=m[0],v=m[1],h=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(!(a.length>0&&void 0!==a[0])||a[0])&&v(!0),(t=new FormData).append("action","blocksy_ext_mailchimp_get_actual_lists"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:t});case 7:if(200!==(n=e.sent).status){e.next=18;break}return e.next=11,n.json();case 11:if(!(r=e.sent).success){e.next=18;break}if("api_key_invalid"===r.data.result){e.next=18;break}return v(!1),p(r.data.result),d=r.data.result,e.abrupt("return");case 18:e.next=22;break;case 20:e.prev=20,e.t0=e.catch(4);case 22:v(!1);case 23:case"end":return e.stop()}}),e,null,[[4,20]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function i(e){l(c,r,a,i,o,"next",e)}function o(e){l(c,r,a,i,o,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.useEffect)((function(){h(!d)}),[]),0===f.length?Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:b?Object(c.__)("Loading...","blc"):Object(c.__)("Invalid API Key...","blc")})):Object(r.createElement)(a.a,{selectedItem:t||f[0].id,onChange:function(e){return n(e)},itemToString:function(e){return e?(f.find((function(t){return t.id===e}))||{}).name:""}},(function(e){var t=e.getInputProps,n=e.getItemProps,a=(e.getLabelProps,e.getMenuProps),i=e.isOpen,l=(e.inputValue,e.highlightedIndex),s=e.selectedItem,d=e.openMenu;return Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",u({},t({onFocus:function(){return d()},onClick:function(){return d()}}),{placeholder:Object(c.__)("Select list...","blc"),readOnly:!0})),i&&Object(r.createElement)("div",a({className:"ct-select-dropdown"}),f.map((function(e,t){return Object(r.createElement)("div",n({key:e.id,index:t,item:e.id,className:o()("ct-select-dropdown-item",{active:l===t,selected:s===e.id})}),e.name)}))))}))}}}]);
trunk/framework/extensions/mailchimp/admin-static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(t){for(var n,o,c=t[0],i=t[1],u=0,a=[];u<c.length;u++)o=c[u],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&a.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(t);a.length;)a.shift()()}var n={},r={0:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,u=document.createElement("script");u.charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.src=function(e){return o.p+""+e+"."+{1:"2c9ebf0a36c6c732fee6",2:"976c8f43abfe584b1a9d"}[e]+".js"}(e);var l=new Error;i=function(t){u.onerror=u.onload=null,clearTimeout(a);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",l.name="ChunkLoadError",l.type=o,l.request=c,n[1](l)}r[e]=void 0}};var a=setTimeout((function(){i({type:"timeout",target:u})}),12e4);u.onerror=u.onload=i,document.head.appendChild(u)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var u=0;u<c.length;u++)t(c[u]);var l=i;o(o.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.ctEvents},function(e,t,n){n.p=blocksy_ext_newsletter_subscribe_localization.public_url},function(e,t,n){"use strict";n.r(t);n(4);var r=n(0),o=n(2),c=n(1),i=Object(c.lazy)((function(){return Promise.all([n.e(1),n.e(2)]).then(n.bind(null,13))})),u=function(e){return Object(r.createElement)("div",null,Object(r.createElement)(c.Suspense,{fallback:Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:Object(o.__)("Loading...","blc")}))},Object(r.createElement)(i,e)))},l=n(3),a=n.n(l);document.addEventListener("DOMContentLoaded",(function(){return a.a.on("blocksy:options:register",(function(e){e["blocksy-mailchimp"]=u}))}))}]);
trunk/framework/extensions/mailchimp/admin-static/bundle/sync.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function o(c){if(t[c])return t[c].exports;var i=t[c]={i:c,l:!1,exports:{}};return e[c].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,c){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(c,i,function(t){return e[t]}.bind(null,i));return c},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t){e.exports=window.blocksyCustomizerSync},function(e,t,o){"use strict";o.r(t);var c,i=o(0),n=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},a=function(e,t){var o=t.forcedOutput,c=void 0!==o&&o;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return c?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return c?"none":"CT_CSS_SKIP_RULE";var i=[];return e.inset&&i.push("inset"),i.push("".concat(e.h_offset,"px")),i.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(i.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&i.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(i.push("".concat(e.blur,"px")),i.push("".concat(e.spread,"px"))),i.push(e.color.color),i.join(" ")},r=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",c={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},i=document.querySelector("style#".concat(c[o])),n=i.innerText,a="".concat(e["".concat(o,"_selector_prefix")]?"".concat(e["".concat(o,"_selector_prefix")]," "):"").concat(e.selector||":root"),r=null,l=n.match(r);0===n.trim().indexOf(a)?(r=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=n.match(r)):(r=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=n.match(r)),l||(0===(n="".concat(n," ").concat(a," { }")).trim().indexOf(a)?(r=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=n.match(r)):(r=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=n.match(r))),i.innerText=n.replace(r,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(a," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},l=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",c=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(c=t&&"none"!==t.style?"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color):"none"),"spacing"===(e.type||"")&&(c=n(t)),"box-shadow"===(e.type||"")&&(c=a(t,e)),r(e,"".concat(c).concat(e.unit||"").concat(e.important?" !important":""),o)},s=function(e,t){var o=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,o),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),l(e,t.desktop,"desktop"),l(e,t.tablet,"tablet"),l(e,t.mobile,"mobile")):l(e,t)};c={mailchimpContent:[{selector:".ct-mailchimp-block",variable:"color",type:"color:default"},{selector:".ct-mailchimp-block",variable:"linkHoverColor",type:"color:hover"}],mailchimpButton:[{selector:".ct-mailchimp-block",variable:"buttonInitialColor",type:"color:default"},{selector:".ct-mailchimp-block",variable:"buttonHoverColor",type:"color:hover"}],mailchimpBackground:{selector:".ct-mailchimp-block",variable:"mailchimpBackground",type:"color"},mailchimpShadow:{selector:".ct-mailchimp-block",type:"box-shadow",variable:"box-shadow",responsive:!0},mailchimpSpacing:{selector:".ct-mailchimp-block",variable:"padding",responsive:!0,unit:""}},wp.customize.bind("change",(function(e){return c[e.id]&&(Array.isArray(c[e.id])?c[e.id]:[c[e.id]]).map((function(t){return s(t,e())}))})),wp.customize("mailchimp_subscribe_visibility",(function(e){return e.bind((function(e){var t=document.querySelector(".ct-mailchimp-block");Object(i.responsiveClassesFor)("mailchimp_subscribe_visibility",t)}))})),(document.body.classList.contains("single")||document.body.classList.contains("page"))&&Object(i.checkAndReplace)({id:"mailchimp_single_post_enabled",strategy:"append",parent_selector:".site-main article",selector:".ct-mailchimp-block",fragment_id:"blocksy-mailchimp-subscribe",watch:["has_mailchimp_name","mailchimp_button_text","mailchimp_title","mailchimp_text","mailchimp_name_label","mailchimp_mail_label"],whenInserted:function(){if(document.body.classList.contains("single")||document.body.classList.contains("page")){var e=document.querySelector(".ct-mailchimp-block");Object(i.responsiveClassesFor)("mailchimp_subscribe_visibility",e),"yes"!==wp.customize("has_mailchimp_name")()?(e.querySelector("[data-fields]").dataset.fields=1,e.querySelector('[name="FNAME"]').remove()):(e.querySelector("[data-fields]").dataset.fields=2,e.querySelector('[name="FNAME"]').setAttribute("placeholder","".concat(wp.customize("mailchimp_name_label")()))),e.querySelector('[name="EMAIL"]').setAttribute("placeholder","".concat(wp.customize("mailchimp_mail_label")()," *")),e.querySelector("button").innerHTML=wp.customize("mailchimp_button_text")(),e.querySelector("h3").innerHTML=wp.customize("mailchimp_title")(),e.querySelector(".ct-mailchimp-description").innerHTML=wp.customize("mailchimp_text")()}}})}]);
trunk/framework/extensions/mailchimp/admin-static/js/ListPicker.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { createElement, Component } from '@wordpress/element'
2
+ import { __ } from 'ct-i18n'
3
+ import { lazy, Suspense } from 'react'
4
+
5
+ const ListPickerImplementation = lazy(() =>
6
+ import('./ListPicker/Implementation')
7
+ )
8
+
9
+ const ListPicker = props => (
10
+ <div>
11
+ <Suspense
12
+ fallback={
13
+ <div className="ct-select-input">
14
+ <input disabled placeholder={__('Loading...', 'blc')} />
15
+ </div>
16
+ }>
17
+ <ListPickerImplementation {...props} />
18
+ </Suspense>
19
+ </div>
20
+ )
21
+
22
+ export default ListPicker
trunk/framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useState,
5
+ useEffect,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+ import Downshift from 'downshift'
9
+ import { __ } from 'ct-i18n'
10
+ import classnames from 'classnames'
11
+
12
+ let listsCache = null
13
+
14
+ const ListPickerImplementation = ({ value, onChange }) => {
15
+ const [lists, setLists] = useState(listsCache || [])
16
+ const [isLoadingLists, setListsLoading] = useState(!listsCache)
17
+
18
+ const maybeFetchLists = async (verbose = true) => {
19
+ if (verbose) {
20
+ setListsLoading(true)
21
+ }
22
+
23
+ const body = new FormData()
24
+ body.append('action', 'blocksy_ext_mailchimp_get_actual_lists')
25
+
26
+ try {
27
+ const response = await fetch(ajaxurl, {
28
+ method: 'POST',
29
+ body
30
+ })
31
+ if (response.status === 200) {
32
+ const body = await response.json()
33
+
34
+ if (body.success) {
35
+ if (body.data.result !== 'api_key_invalid') {
36
+ setListsLoading(false)
37
+ setLists(body.data.result)
38
+ listsCache = body.data.result
39
+
40
+ return
41
+ }
42
+ }
43
+ }
44
+ } catch (e) {}
45
+
46
+ setListsLoading(false)
47
+ }
48
+
49
+ useEffect(() => {
50
+ maybeFetchLists(!listsCache)
51
+ }, [])
52
+
53
+ return lists.length === 0 ? (
54
+ <div className="ct-select-input">
55
+ <input
56
+ disabled
57
+ placeholder={
58
+ isLoadingLists
59
+ ? __('Loading...', 'blc')
60
+ : __('Invalid API Key...', 'blc')
61
+ }
62
+ />
63
+ </div>
64
+ ) : (
65
+ <Downshift
66
+ selectedItem={value || lists[0].id}
67
+ onChange={selection => onChange(selection)}
68
+ itemToString={item =>
69
+ item ? (lists.find(({ id }) => id === item) || {}).name : ''
70
+ }>
71
+ {({
72
+ getInputProps,
73
+ getItemProps,
74
+ getLabelProps,
75
+ getMenuProps,
76
+ isOpen,
77
+ inputValue,
78
+ highlightedIndex,
79
+ selectedItem,
80
+ openMenu
81
+ }) => (
82
+ <div className="ct-select-input">
83
+ <input
84
+ {...getInputProps({
85
+ onFocus: () => openMenu(),
86
+ onClick: () => openMenu()
87
+ })}
88
+ placeholder={__('Select list...', 'blc')}
89
+ readOnly
90
+ />
91
+
92
+ {isOpen && (
93
+ <div
94
+ {...getMenuProps({
95
+ className: 'ct-select-dropdown'
96
+ })}>
97
+ {lists.map((item, index) => (
98
+ <div
99
+ {...getItemProps({
100
+ key: item.id,
101
+ index,
102
+ item: item.id,
103
+ className: classnames(
104
+ 'ct-select-dropdown-item',
105
+ {
106
+ active:
107
+ highlightedIndex === index,
108
+ selected:
109
+ selectedItem === item.id
110
+ }
111
+ )
112
+ })}>
113
+ {item.name}
114
+ </div>
115
+ ))}
116
+ </div>
117
+ )}
118
+ </div>
119
+ )}
120
+ </Downshift>
121
+ )
122
+ }
123
+
124
+ export default ListPickerImplementation
trunk/framework/extensions/mailchimp/admin-static/js/main.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ import './public-path'
2
+ import { createElement, Fragment, Component } from '@wordpress/element'
3
+ import ListPicker from './ListPicker'
4
+ import ctEvents from 'ct-events'
5
+
6
+ document.addEventListener('DOMContentLoaded', () =>
7
+ ctEvents.on('blocksy:options:register', opts => {
8
+ opts['blocksy-mailchimp'] = ListPicker
9
+ })
10
+ )
trunk/framework/extensions/mailchimp/admin-static/js/public-path.js ADDED
@@ -0,0 +1 @@
 
1
+ __webpack_public_path__ = blocksy_ext_newsletter_subscribe_localization.public_url
trunk/framework/extensions/mailchimp/admin-static/js/sync.js ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { checkAndReplace, responsiveClassesFor } from 'blocksy-customizer-sync'
2
+
3
+ import './variables'
4
+
5
+ wp.customize('mailchimp_subscribe_visibility', (val) =>
6
+ val.bind((to) => {
7
+ const block = document.querySelector('.ct-mailchimp-block')
8
+ responsiveClassesFor('mailchimp_subscribe_visibility', block)
9
+ })
10
+ )
11
+
12
+ if (
13
+ document.body.classList.contains('single') ||
14
+ document.body.classList.contains('page')
15
+ ) {
16
+ checkAndReplace({
17
+ id: 'mailchimp_single_post_enabled',
18
+ strategy: 'append',
19
+
20
+ parent_selector: '.site-main article',
21
+ selector: '.ct-mailchimp-block',
22
+ fragment_id: 'blocksy-mailchimp-subscribe',
23
+
24
+ watch: [
25
+ 'has_mailchimp_name',
26
+ 'mailchimp_button_text',
27
+ 'mailchimp_title',
28
+ 'mailchimp_text',
29
+ 'mailchimp_name_label',
30
+ 'mailchimp_mail_label',
31
+ ],
32
+
33
+ whenInserted: () => {
34
+ if (
35
+ !document.body.classList.contains('single') &&
36
+ !document.body.classList.contains('page')
37
+ ) {
38
+ return
39
+ }
40
+ const block = document.querySelector('.ct-mailchimp-block')
41
+
42
+ responsiveClassesFor('mailchimp_subscribe_visibility', block)
43
+
44
+ if (wp.customize('has_mailchimp_name')() !== 'yes') {
45
+ block.querySelector('[data-fields]').dataset.fields = 1
46
+ block.querySelector('[name="FNAME"]').remove()
47
+ } else {
48
+ block.querySelector('[data-fields]').dataset.fields = 2
49
+
50
+ block
51
+ .querySelector('[name="FNAME"]')
52
+ .setAttribute(
53
+ 'placeholder',
54
+ `${wp.customize('mailchimp_name_label')()}`
55
+ )
56
+ }
57
+
58
+ block
59
+ .querySelector('[name="EMAIL"]')
60
+ .setAttribute(
61
+ 'placeholder',
62
+ `${wp.customize('mailchimp_mail_label')()} *`
63
+ )
64
+
65
+ block.querySelector('button').innerHTML = wp.customize(
66
+ 'mailchimp_button_text'
67
+ )()
68
+
69
+ block.querySelector('h3').innerHTML = wp.customize(
70
+ 'mailchimp_title'
71
+ )()
72
+
73
+ block.querySelector(
74
+ '.ct-mailchimp-description'
75
+ ).innerHTML = wp.customize('mailchimp_text')()
76
+ },
77
+ })
78
+ }
trunk/framework/extensions/mailchimp/admin-static/js/variables.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { handleVariablesFor } from 'customizer-sync-helpers'
2
+
3
+ handleVariablesFor({
4
+
5
+ mailchimpContent: [
6
+ {
7
+ selector: '.ct-mailchimp-block',
8
+ variable: 'color',
9
+ type: 'color:default'
10
+ },
11
+
12
+ {
13
+ selector: '.ct-mailchimp-block',
14
+ variable: 'linkHoverColor',
15
+ type: 'color:hover'
16
+ }
17
+ ],
18
+
19
+ mailchimpButton: [
20
+ {
21
+ selector: '.ct-mailchimp-block',
22
+ variable: 'buttonInitialColor',
23
+ type: 'color:default'
24
+ },
25
+
26
+ {
27
+ selector: '.ct-mailchimp-block',
28
+ variable: 'buttonHoverColor',
29
+ type: 'color:hover'
30
+ }
31
+ ],
32
+
33
+ mailchimpBackground: {
34
+ selector: '.ct-mailchimp-block',
35
+ variable: 'mailchimpBackground',
36
+ type: 'color'
37
+ },
38
+
39
+ mailchimpShadow: {
40
+ selector: '.ct-mailchimp-block',
41
+ type: 'box-shadow',
42
+ variable: 'box-shadow',
43
+ responsive: true
44
+ },
45
+
46
+ mailchimpSpacing: {
47
+ selector: '.ct-mailchimp-block',
48
+ variable: 'padding',
49
+ responsive: true,
50
+ unit: ''
51
+ }
52
+ })
trunk/framework/extensions/mailchimp/config.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'name' => __('Mailchimp Subscribe', 'blc'),
5
+ 'description' => __('Display a subscribe form with the help of a widget or a block.', 'blc')
6
+ ];
7
+
trunk/framework/extensions/mailchimp/ct-mailchimp/options.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ $options = [
12
+ 'title' => [
13
+ 'type' => 'text',
14
+ 'label' => __( 'Title', 'blc' ),
15
+ 'field_attr' => [ 'id' => 'widget-title' ],
16
+ 'design' => 'inline',
17
+ 'value' => __( 'Newsletter', 'blc' ),
18
+ 'disableRevertButton' => true,
19
+ ],
20
+
21
+ 'mailchimp_text' => [
22
+ 'label' => __( 'Message', 'blc' ),
23
+ 'type' => 'textarea',
24
+ 'value' => __( 'Enter your email address below to subscribe to our newsletter', 'blc' ),
25
+ 'design' => 'inline',
26
+ 'disableRevertButton' => true,
27
+ ],
28
+
29
+ 'mailchimp_list_id_source' => [
30
+ 'type' => 'ct-radio',
31
+ 'label' => __( 'List Source', 'blc' ),
32
+ 'value' => 'default',
33
+ 'view' => 'radio',
34
+ 'inline' => true,
35
+ 'design' => 'inline',
36
+ 'disableRevertButton' => true,
37
+ 'choices' => [
38
+ 'default' => __('Default', 'blc'),
39
+ 'custom' => __('Custom', 'blc'),
40
+ ],
41
+ ],
42
+
43
+ blocksy_rand_md5() => [
44
+ 'type' => 'ct-condition',
45
+ 'condition' => [ 'mailchimp_list_id_source' => 'custom' ],
46
+ 'options' => [
47
+
48
+ 'mailchimp_list_id' => [
49
+ 'label' => __( 'List ID', 'blc' ),
50
+ 'type' => 'blocksy-mailchimp',
51
+ 'value' => '',
52
+ 'design' => 'inline',
53
+ 'disableRevertButton' => true,
54
+ ],
55
+
56
+ ],
57
+ ],
58
+
59
+ 'has_mailchimp_name' => [
60
+ 'type' => 'ct-switch',
61
+ 'label' => __( 'Name Field', 'blc' ),
62
+ 'value' => 'no',
63
+ 'disableRevertButton' => true,
64
+ ],
65
+
66
+ blocksy_rand_md5() => [
67
+ 'type' => 'ct-condition',
68
+ 'condition' => [ 'has_mailchimp_name' => 'yes' ],
69
+ 'options' => [
70
+
71
+ 'mailchimp_name_label' => [
72
+ 'type' => 'text',
73
+ 'label' => __( 'Name Label', 'blc' ),
74
+ 'design' => 'inline',
75
+ 'value' => __( 'Your name', 'blc' ),
76
+ 'disableRevertButton' => true,
77
+ ],
78
+
79
+ ],
80
+ ],
81
+
82
+ 'mailchimp_mail_label' => [
83
+ 'type' => 'text',
84
+ 'label' => __( 'Mail Label', 'blc' ),
85
+ 'design' => 'inline',
86
+ 'value' => __( 'Your email', 'blc' ),
87
+ 'disableRevertButton' => true,
88
+ ],
89
+
90
+ 'mailchimp_button_text' => [
91
+ 'type' => 'text',
92
+ 'label' => __( 'Button Label', 'blc' ),
93
+ 'design' => 'inline',
94
+ 'value' => __( 'Subscribe', 'blc' ),
95
+ 'disableRevertButton' => true,
96
+ ],
97
+
98
+ 'mailchimp_container' => [
99
+ 'label' => __( 'Container Type', 'blc' ),
100
+ 'type' => 'ct-select',
101
+ 'value' => 'default',
102
+ 'design' => 'inline',
103
+ 'disableRevertButton' => true,
104
+ 'choices' => [
105
+ 'default' => __( 'Default', 'blc' ),
106
+ 'boxed' => __( 'Boxed', 'blc' ),
107
+ ],
108
+ ],
109
+
110
+ 'mailchimp_alignment' => [
111
+ 'type' => 'ct-radio',
112
+ 'label' => __( 'Content Alignment', 'blc' ),
113
+ 'value' => 'left',
114
+ 'view' => 'text',
115
+ 'design' => 'inline',
116
+ 'attr' => [ 'data-type' => 'alignment' ],
117
+ 'disableRevertButton' => true,
118
+ 'choices' => [
119
+ 'left' => '',
120
+ 'center' => '',
121
+ 'right' => '',
122
+ ],
123
+ ],
124
+
125
+ ];
trunk/framework/extensions/mailchimp/ct-mailchimp/view.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'Newsletter', 'blc' ) );
13
+
14
+
15
+ // Message
16
+ $message = blocksy_default_akg( 'mailchimp_text', $atts, __( 'Enter your email address below to subscribe to our newsletter', 'blc' ) );
17
+
18
+ // Button text
19
+ $button_text = blocksy_default_akg( 'mailchimp_button_text', $atts, __( 'Subscribe', 'blc' ) );
20
+
21
+ // Form name
22
+ $has_name = blocksy_default_akg( 'has_mailchimp_name', $atts, 'no' ) === 'yes';
23
+
24
+ $list_id = null;
25
+
26
+ if (blocksy_default_akg( 'mailchimp_list_id_source', $atts, 'default' ) === 'custom') {
27
+ $list_id = blocksy_default_akg( 'mailchimp_list_id', $atts, '' );
28
+ }
29
+
30
+ $manager = new BlocksyMailchimpManager();
31
+
32
+ // Button value
33
+ $mailchimp_data = $manager->get_form_url_and_gdpr_for($list_id);
34
+
35
+ if (! $mailchimp_data) {
36
+ return;
37
+ }
38
+
39
+ $form_url = $mailchimp_data['form_url'];
40
+ $has_gdpr_fields = $mailchimp_data['has_gdpr_fields'];
41
+
42
+ $skip_submit_output = '';
43
+
44
+ if ($has_gdpr_fields) {
45
+ $skip_submit_output = 'data-skip-submit';
46
+ }
47
+
48
+ // container type
49
+ $container = blocksy_default_akg( 'mailchimp_container', $atts, 'default' );
50
+
51
+ $data_container = '';
52
+
53
+ if ( $container !== 'default' ) {
54
+ $data_container = ' data-container=' . $container;
55
+ }
56
+
57
+ // Content alignment
58
+ $alignment = blocksy_default_akg( 'mailchimp_alignment', $atts, 'left' );
59
+
60
+ $name_label = blocksy_default_akg('mailchimp_name_label', $atts, __( 'Your name', 'blc' ));
61
+ $email_label = blocksy_default_akg('mailchimp_mail_label', $atts, __( 'Your email', 'blc' ));
62
+
63
+ $data_alignment = '';
64
+
65
+ if ( $alignment !== 'left' ) {
66
+ $data_alignment = ' data-alignment=' . $alignment;
67
+ }
68
+
69
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
70
+ echo $before_widget;
71
+
72
+ echo '<div class="ct-widget-inner"' . $data_alignment . '' . $data_container . '>';
73
+
74
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
75
+ echo $before_title . wp_kses_post( $title ) . $after_title;
76
+
77
+ ?>
78
+
79
+
80
+ <form action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-widget-form" target="_blank" <?php echo $skip_submit_output ?>>
81
+
82
+ <?php if( !empty( $message ) ) { ?>
83
+ <div class="ct-mailchimp-description">
84
+ <?php echo wp_kses_post($message) ?>
85
+ </div>
86
+ <?php } ?>
87
+
88
+ <?php if ( $has_name ) { ?>
89
+ <input type="text" name="FNAME" placeholder="<?php esc_attr_e($name_label, 'blc'); ?>" title="<?php echo __('Name', 'blocksy') ?>" />
90
+ <?php } ?>
91
+
92
+ <input type="email" name="EMAIL" placeholder="<?php esc_attr_e($email_label, 'blc'); ?> *" title="<?php echo __('Email', 'blocksy') ?>" required />
93
+
94
+ <button class="button">
95
+ <?php echo esc_html($button_text) ?>
96
+ </button>
97
+
98
+ <div class="ct-mailchimp-message"></div>
99
+
100
+ <?php
101
+ if (function_exists('blocksy_ext_cookies_checkbox')) {
102
+ echo blocksy_ext_cookies_checkbox('mailchimp');
103
+ }
104
+ ?>
105
+ </form>
106
+
107
+ </div>
108
+
109
+ <?php echo wp_kses_post( $after_widget ); ?>
trunk/framework/extensions/mailchimp/ct-mailchimp/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Mailchimp extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Newsletter Subscribe', 'blc'),
14
+ 'description' => __('Newsletter subscribe form', 'blc'),
15
+ ];
16
+ }
17
+
18
+ public function get_path() {
19
+ return dirname(__FILE__);
20
+ }
21
+ }
22
+
trunk/framework/extensions/mailchimp/customizer.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ 'label' => __( 'Subscribe Form', 'blc' ),
5
+ 'type' => 'ct-panel',
6
+ 'switch' => true,
7
+ 'value' => 'yes',
8
+ 'setting' => [ 'transport' => 'postMessage' ],
9
+ 'inner-options' => [
10
+
11
+ blocksy_rand_md5() => [
12
+ 'title' => __( 'General', 'blc' ),
13
+ 'type' => 'tab',
14
+ 'options' => [
15
+
16
+ 'mailchimp_title' => [
17
+ 'type' => 'text',
18
+ 'label' => __( 'Title', 'blc' ),
19
+ 'field_attr' => [ 'id' => 'widget-title' ],
20
+ 'design' => 'block',
21
+ 'value' => __( 'Newsletter Updates', 'blc' ),
22
+ 'disableRevertButton' => true,
23
+ 'setting' => [ 'transport' => 'postMessage' ],
24
+ ],
25
+
26
+ 'mailchimp_text' => [
27
+ 'label' => __( 'Message', 'blc' ),
28
+ 'type' => 'textarea',
29
+ 'value' => __( 'Enter your email address below to subscribe to our newsletter', 'blc' ),
30
+ 'design' => 'block',
31
+ 'disableRevertButton' => true,
32
+ 'setting' => [ 'transport' => 'postMessage' ],
33
+ ],
34
+
35
+ blocksy_rand_md5() => [
36
+ 'type' => 'ct-divider',
37
+ 'attr' => [ 'data-type' => 'small' ],
38
+ ],
39
+
40
+ 'mailchimp_list_id_source' => [
41
+ 'type' => 'ct-radio',
42
+ 'label' => __( 'List Source', 'blc' ),
43
+ 'value' => 'default',
44
+ 'view' => 'radio',
45
+ 'inline' => true,
46
+ 'design' => 'inline',
47
+ 'disableRevertButton' => true,
48
+ 'choices' => [
49
+ 'default' => __('Default', 'blc'),
50
+ 'custom' => __('Custom', 'blc'),
51
+ ],
52
+
53
+ 'setting' => [ 'transport' => 'postMessage' ],
54
+ ],
55
+
56
+ blocksy_rand_md5() => [
57
+ 'type' => 'ct-condition',
58
+ 'condition' => [ 'mailchimp_list_id_source' => 'custom' ],
59
+ 'options' => [
60
+
61
+ 'mailchimp_list_id' => [
62
+ 'label' => __( 'List ID', 'blc' ),
63
+ 'type' => 'blocksy-mailchimp',
64
+ 'value' => '',
65
+ 'design' => 'inline',
66
+ 'disableRevertButton' => true,
67
+ 'setting' => [ 'transport' => 'postMessage' ],
68
+ ],
69
+
70
+ ],
71
+ ],
72
+
73
+ blocksy_rand_md5() => [
74
+ 'type' => 'ct-divider',
75
+ 'attr' => [ 'data-type' => 'small' ],
76
+ ],
77
+
78
+ 'has_mailchimp_name' => [
79
+ 'type' => 'ct-switch',
80
+ 'label' => __( 'Name Field', 'blc' ),
81
+ 'value' => 'no',
82
+ 'disableRevertButton' => true,
83
+ 'setting' => [ 'transport' => 'postMessage' ],
84
+ ],
85
+
86
+ blocksy_rand_md5() => [
87
+ 'type' => 'ct-condition',
88
+ 'condition' => [ 'has_mailchimp_name' => 'yes' ],
89
+ 'options' => [
90
+
91
+ 'mailchimp_name_label' => [
92
+ 'type' => 'text',
93
+ 'label' => __( 'Name Label', 'blc' ),
94
+ 'design' => 'inline',
95
+ 'value' => __( 'Your name', 'blc' ),
96
+ 'disableRevertButton' => true,
97
+ 'setting' => [ 'transport' => 'postMessage' ],
98
+ ],
99
+
100
+ ],
101
+ ],
102
+
103
+ 'mailchimp_mail_label' => [
104
+ 'type' => 'text',
105
+ 'label' => __( 'Mail Label', 'blc' ),
106
+ 'design' => 'inline',
107
+ 'value' => __( 'Your email', 'blc' ),
108
+ 'disableRevertButton' => true,
109
+ 'setting' => [ 'transport' => 'postMessage' ],
110
+ ],
111
+
112
+ 'mailchimp_button_text' => [
113
+ 'type' => 'text',
114
+ 'label' => __( 'Button Label', 'blc' ),
115
+ 'design' => 'inline',
116
+ 'value' => __( 'Subscribe', 'blc' ),
117
+ 'disableRevertButton' => true,
118
+ 'setting' => [ 'transport' => 'postMessage' ],
119
+ ],
120
+
121
+ blocksy_rand_md5() => [
122
+ 'type' => 'ct-divider',
123
+ ],
124
+
125
+ 'mailchimp_subscribe_visibility' => [
126
+ 'label' => __( 'Visibility', 'blc' ),
127
+ 'type' => 'ct-visibility',
128
+ 'design' => 'block',
129
+ 'setting' => [ 'transport' => 'postMessage' ],
130
+ 'value' => [
131
+ 'desktop' => true,
132
+ 'tablet' => true,
133
+ 'mobile' => false,
134
+ ],
135
+
136
+ 'choices' => blocksy_ordered_keys([
137
+ 'desktop' => __( 'Desktop', 'blc' ),
138
+ 'tablet' => __( 'Tablet', 'blc' ),
139
+ 'mobile' => __( 'Mobile', 'blc' ),
140
+ ]),
141
+ ],
142
+
143
+ ],
144
+ ],
145
+
146
+ blocksy_rand_md5() => [
147
+ 'title' => __( 'Design', 'blc' ),
148
+ 'type' => 'tab',
149
+ 'options' => [
150
+
151
+ 'mailchimpContent' => [
152
+ 'label' => __( 'Content Color', 'blc' ),
153
+ 'type' => 'ct-color-picker',
154
+ 'design' => 'inline',
155
+ 'setting' => [ 'transport' => 'postMessage' ],
156
+
157
+ 'value' => [
158
+ 'default' => [
159
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
160
+ ],
161
+
162
+ 'hover' => [
163
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
164
+ ],
165
+ ],
166
+
167
+ 'pickers' => [
168
+ [
169
+ 'title' => __( 'Initial', 'blc' ),
170
+ 'id' => 'default',
171
+ 'inherit' => 'var(--color)'
172
+ ],
173
+
174
+ [
175
+ 'title' => __( 'Hover', 'blc' ),
176
+ 'id' => 'hover',
177
+ 'inherit' => 'var(--linkHoverColor)'
178
+ ],
179
+ ],
180
+ ],
181
+
182
+ 'mailchimpButton' => [
183
+ 'label' => __( 'Button Color', 'blc' ),
184
+ 'type' => 'ct-color-picker',
185
+ 'design' => 'inline',
186
+ 'setting' => [ 'transport' => 'postMessage' ],
187
+
188
+ 'value' => [
189
+ 'default' => [
190
+ 'color' => 'var(--paletteColor1)',
191
+ ],
192
+
193
+ 'hover' => [
194
+ 'color' => 'var(--paletteColor2)',
195
+ ],
196
+ ],
197
+
198
+ 'pickers' => [
199
+ [
200
+ 'title' => __( 'Initial', 'blc' ),
201
+ 'id' => 'default',
202
+ ],
203
+
204
+ [
205
+ 'title' => __( 'Hover', 'blc' ),
206
+ 'id' => 'hover',
207
+ ],
208
+ ],
209
+ ],
210
+
211
+ 'mailchimpBackground' => [
212
+ 'label' => __( 'Background Color', 'blc' ),
213
+ 'type' => 'ct-color-picker',
214
+ 'design' => 'inline',
215
+ 'setting' => [ 'transport' => 'postMessage' ],
216
+
217
+ 'value' => [
218
+ 'default' => [
219
+ 'color' => '#ffffff',
220
+ ],
221
+ ],
222
+
223
+ 'pickers' => [
224
+ [
225
+ 'title' => __( 'Initial', 'blc' ),
226
+ 'id' => 'default',
227
+ ],
228
+ ],
229
+ ],
230
+
231
+ 'mailchimpSpacing' => [
232
+ 'label' => __( 'Container Inner Spacing', 'blc' ),
233
+ 'type' => 'ct-slider',
234
+ 'value' => '40px',
235
+ 'units' => blocksy_units_config([
236
+ [
237
+ 'unit' => 'px',
238
+ 'min' => 0,
239
+ 'max' => 300,
240
+ ],
241
+ ]),
242
+ 'responsive' => true,
243
+ 'divider' => 'top',
244
+ 'setting' => [ 'transport' => 'postMessage' ],
245
+ ],
246
+
247
+ 'mailchimpShadow' => [
248
+ 'label' => __( 'Shadow', 'blocksy' ),
249
+ 'type' => 'ct-box-shadow',
250
+ 'responsive' => true,
251
+ 'divider' => 'top',
252
+ 'setting' => [ 'transport' => 'postMessage' ],
253
+ 'value' => blocksy_box_shadow_value([
254
+ 'enable' => true,
255
+ 'h_offset' => 0,
256
+ 'v_offset' => 50,
257
+ 'blur' => 90,
258
+ 'spread' => 0,
259
+ 'inset' => false,
260
+ 'color' => [
261
+ 'color' => 'rgba(210, 213, 218, 0.4)',
262
+ ],
263
+ ])
264
+ ],
265
+
266
+ ],
267
+ ],
268
+
269
+ ],
270
+ ];
trunk/framework/extensions/mailchimp/dashboard-static/bundle/main.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t){e.exports=window.wp.element},function(e,t,n){e.exports=n(9)()},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t,n){var r;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var u in r)n.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.blocksyOptions},function(e,t,n){"use strict";e.exports=n(13)},function(e,t){e.exports=window.ctEvents},function(e,t,n){var r,o,i=n(11),a=n(12),u=(o=[],{activateTrap:function(e){if(o.length>0){var t=o[o.length-1];t!==e&&t.pause()}var n=o.indexOf(e);-1===n||o.splice(n,1),o.push(e)},deactivateTrap:function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1),o.length>0&&o[o.length-1].unpause()}});function c(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,o="string"==typeof e?n.querySelector(e):e,s=a({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},d={activate:function(e){if(l.active)return;w(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:s.onActivate;t&&t();return f(),d},deactivate:p,pause:function(){if(l.paused||!l.active)return;l.paused=!0,h()},unpause:function(){if(!l.paused||!l.active)return;l.paused=!1,w(),f()}};return d;function p(e){if(l.active){clearTimeout(r),h(),l.active=!1,l.paused=!1,u.deactivateTrap(d);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:s.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:s.returnFocusOnDeactivate)&&c((function(){var e;O((e=l.nodeFocusedBeforeActivation,m("setReturnFocus")||e))})),d}}function f(){if(l.active)return u.activateTrap(d),r=c((function(){O(v())})),n.addEventListener("focusin",y,!0),n.addEventListener("mousedown",g,{capture:!0,passive:!1}),n.addEventListener("touchstart",g,{capture:!0,passive:!1}),n.addEventListener("click",I,{capture:!0,passive:!1}),n.addEventListener("keydown",b,{capture:!0,passive:!1}),d}function h(){if(l.active)return n.removeEventListener("focusin",y,!0),n.removeEventListener("mousedown",g,!0),n.removeEventListener("touchstart",g,!0),n.removeEventListener("click",I,!0),n.removeEventListener("keydown",b,!0),d}function m(e){var t=s[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function v(){var e;if(!(e=null!==m("initialFocus")?m("initialFocus"):o.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||m("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return e}function g(e){o.contains(e.target)||(s.clickOutsideDeactivates?p({returnFocus:!i.isFocusable(e.target)}):s.allowOutsideClick&&s.allowOutsideClick(e)||e.preventDefault())}function y(e){o.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),O(l.mostRecentlyFocusedNode||v()))}function b(e){if(!1!==s.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void p();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(w(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void O(l.lastTabbableNode);if(!e.shiftKey&&e.target===l.lastTabbableNode)e.preventDefault(),O(l.firstTabbableNode)}(e)}function I(e){s.clickOutsideDeactivates||o.contains(e.target)||s.allowOutsideClick&&s.allowOutsideClick(e)||(e.preventDefault(),e.stopImmediatePropagation())}function w(){var e=i(o);l.firstTabbableNode=e[0]||v(),l.lastTabbableNode=e[e.length-1]||v()}function O(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):O(v()))}}},function(e,t,n){"use strict";var r=n(10);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],r=n.join(","),o="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function i(e,t){t=t||{};var n,i,u,c=[],d=[],p=e.querySelectorAll(r);for(t.includeContainer&&o.call(e,r)&&(p=Array.prototype.slice.apply(p)).unshift(e),n=0;n<p.length;n++)a(i=p[n])&&(0===(u=s(i))?c.push(i):d.push({documentOrder:n,tabIndex:u,node:i}));return d.sort(l).map((function(e){return e.node})).concat(c)}function a(e){return!(!u(e)||function(e){return function(e){return d(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||s(e)<0)}function u(e){return!(e.disabled||function(e){return d(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}i.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==o.call(e,r)&&a(e)},i.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==o.call(e,c)&&u(e)};var c=n.concat("iframe").join(",");function s(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function l(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function d(e){return"INPUT"===e.tagName}e.exports=i},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var o in r)n.call(r,o)&&(e[o]=r[o])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";
7
+ /** @license React v16.13.1
8
+ * react-is.production.min.js
9
+ *
10
+ * Copyright (c) Facebook, Inc. and its affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,I=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case p:case a:case c:case u:case h:return e;default:switch(e=e&&e.$$typeof){case l:case f:case g:case v:case s:return e;default:return t}}case i:return t}}}function S(e){return O(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=s,t.Element=o,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=v,t.Portal=i,t.Profiler=c,t.StrictMode=u,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||O(e)===d},t.isConcurrentMode=S,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===f},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===g},t.isMemo=function(e){return O(e)===v},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===c},t.isStrictMode=function(e){return O(e)===u},t.isSuspense=function(e){return O(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===c||e===u||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===s||e.$$typeof===l||e.$$typeof===f||e.$$typeof===b||e.$$typeof===I||e.$$typeof===w||e.$$typeof===y)},t.typeOf=O},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(7),i=n.n(o),a=n(3),u=n(4),c=n.n(u),s=n(2),l=n.n(s),d=n(1),p=n.n(d);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var m=function(e){e.initialState,e.getInitialState,e.refs,e.getRefs,e.didMount,e.didUpdate,e.willUnmount,e.getSnapshotBeforeUpdate,e.shouldUpdate,e.render;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},v=function(e){function t(){var n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=h(this,e.call.apply(e,[this].concat(i))),g.call(r),h(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getArgs=function(){var e=this.state,t=this.props,n=this._setState,r=this._forceUpdate,o=this._refs;return{state:e,props:m(t),refs:o,setState:n,forceUpdate:r}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:m(e),nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:m(this.props),refs:this._refs})},t.prototype.componentDidUpdate=function(e,t,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t}),n)},t.prototype.getSnapshotBeforeUpdate=function(e,t){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t})):null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return n?n(this.getArgs()):"function"==typeof t?t(this.getArgs()):t||null},t}(l.a.Component);v.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var g=function(){var e=this;this.state=this.props.initialState||this.props.getInitialState(this.props),this._refs=this.props.refs||this.props.getRefs(this.getArgs()),this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},y=v,b=function(e){var t=e.children,n=e.container,o=void 0===n?document.body:n,i=e.type,a=void 0===i?"reach-portal":i;return Object(r.createElement)(y,{getRefs:function(){return{node:null}},didMount:function(e){var t=e.refs,n=e.forceUpdate,r=o.hasOwnProperty("current")?o.current:o;t.node=document.createElement(a),r.appendChild(t.node),n()},willUnmount:function(e){var t=e.refs.node,n=o.hasOwnProperty("current")?o.current:o;n&&n.removeChild(t)},render:function(e){var n=e.refs.node;return n?Object(r.createPortal)(t,n):null}})};var I=function(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}},w=n(8),O=n.n(w);function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var E=function(){},j=function(){},C=function(e,t){var n,r,o;e.disposeAriaHider=(n=e.overlayNode,r=[],o=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),(function(e){if(e!==n.parentNode){var t=e.getAttribute("aria-hidden");null!==t&&"false"!==t||(r.push(t),o.push(e),e.setAttribute("aria-hidden","true"))}})),function(){o.forEach((function(e,t){var n=r[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)}))}),e.trap=O()(e.overlayNode,{initialFocus:t?function(){return t.current}:void 0,fallbackFocus:e.contentNode,escapeDeactivates:!1,clickOutsideDeactivates:!1})},_=function(e){var t=e.refs;t.trap.deactivate(),t.disposeAriaHider()},P=React.createContext(),A=React.forwardRef((function(e,t){var n=e.container,o=e.isOpen,i=void 0===o||o,a=e.onDismiss,u=void 0===a?E:a,c=e.initialFocusRef,s=e.onClick,l=e.onKeyDown,d=x(e,["container","isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return Object(r.createElement)(y,{didMount:j},i?Object(r.createElement)(b,{container:n,"data-reach-dialog-wrapper":!0},Object(r.createElement)(y,{refs:{overlayNode:null,contentNode:null},didMount:function(e){var t=e.refs;C(t,c)},willUnmount:_},(function(e){var n=e.refs;return Object(r.createElement)(P.Provider,{value:function(e){return n.contentNode=e}},Object(r.createElement)("div",S({"data-reach-dialog-overlay":!0,onClick:I(s,(function(e){e.stopPropagation(),u()})),onKeyDown:I(l,(function(e){"Escape"===e.key&&(e.stopPropagation(),u())})),ref:function(e){n.overlayNode=e,t&&t(e)}},d)))}))):null)}));A.propTypes={initialFocusRef:function(){}};var k=function(e){return e.stopPropagation()},D=React.forwardRef((function(e,t){var n=e.onClick,o=(e.onKeyDown,x(e,["onClick","onKeyDown"]));return Object(r.createElement)(P.Consumer,null,(function(e){return Object(r.createElement)("div",S({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:I(n,k),ref:function(n){e(n),t&&t(n)}},o))}))})),M=n(5),T=function(e){return!!e},H=function(e){var t=e.items,n=e.isVisible,o=void 0===n?T:n,i=e.render,a=e.className,u=e.onDismiss;return Object(r.createElement)(M.Transition,{items:t,onStart:function(){return document.body.classList[o(t)?"add":"remove"]("ct-dashboard-overlay-open")},config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},(function(e){return o(e)&&function(t){return Object(r.createElement)(A,{style:{opacity:t.opacity},container:document.querySelector("#wpbody"),onDismiss:function(){return u()}},Object(r.createElement)(D,{className:c()("ct-admin-modal",a),style:{transform:"translate3d(0px, ".concat(t.y,"px, 0px)")}},Object(r.createElement)("button",{className:"close-button",onClick:function(){return u()}},"×"),i(e,t)))}}))};function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var L=function(e){var t=R(Object(r.useState)(!1),2),n=t[0],o=t[1];return[function(){return o(!0)},Object(r.createElement)(H,{items:n,onDismiss:function(){return o(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content",dangerouslySetInnerHTML:{__html:e.readme}})}})]};function U(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function K(){return(K=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(6);function V(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function B(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function $(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return B(n.overflowY,t)||B(n.overflowX,t)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function W(e,t,n,r,o,i,a,u){return i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0}var z=0;function q(e){return"function"==typeof e?e:Y}function Y(){}function X(e,t){null!==e&&function(e,t){var n=t.scrollMode,r=t.block,o=t.inline,i=t.boundary,a=t.skipOverflowHiddenElements,u="function"==typeof i?i:function(e){return e!==i};if(!V(e))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,s=[],l=e;V(l)&&u(l);){if((l=l.parentNode)===c){s.push(l);break}l===document.body&&$(l)&&!$(document.documentElement)||$(l,a)&&s.push(l)}for(var d=window.visualViewport?visualViewport.width:innerWidth,p=window.visualViewport?visualViewport.height:innerHeight,f=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),v=m.height,g=m.width,y=m.top,b=m.right,I=m.bottom,w=m.left,O="start"===r||"nearest"===r?y:"end"===r?I:y+v/2,S="center"===o?w+g/2:"end"===o?b:w,x=[],E=0;E<s.length;E++){var j=s[E],C=j.getBoundingClientRect(),_=C.height,P=C.width,A=C.top,k=C.right,D=C.bottom,M=C.left;if("if-needed"===n&&y>=0&&w>=0&&I<=p&&b<=d&&y>=A&&I<=D&&w>=M&&b<=k)return x;var T=getComputedStyle(j),H=parseInt(T.borderLeftWidth,10),R=parseInt(T.borderTopWidth,10),N=parseInt(T.borderRightWidth,10),L=parseInt(T.borderBottomWidth,10),U=0,K=0,F="offsetWidth"in j?j.offsetWidth-j.clientWidth-H-N:0,B="offsetHeight"in j?j.offsetHeight-j.clientHeight-R-L:0;if(c===j)U="start"===r?O:"end"===r?O-p:"nearest"===r?W(h,h+p,p,R,L,h+O,h+O+v,v):O-p/2,K="start"===o?S:"center"===o?S-d/2:"end"===o?S-d:W(f,f+d,d,H,N,f+S,f+S+g,g),U=Math.max(0,U+h),K=Math.max(0,K+f);else{U="start"===r?O-A-R:"end"===r?O-D+L+B:"nearest"===r?W(A,D,_,R,L+B,O,O+v,v):O-(A+_/2)+B/2,K="start"===o?S-M-H:"center"===o?S-(M+P/2)+F/2:"end"===o?S-k+N+F:W(M,k,P,H,N+F,S,S+g,g);var z=j.scrollLeft,q=j.scrollTop;O+=q-(U=Math.max(0,Math.min(q+U,j.scrollHeight-_+B))),S+=z-(K=Math.max(0,Math.min(z+K,j.scrollWidth-P+F)))}x.push({el:j,top:U,left:K})}return x}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function G(e,t){return e===t||e.contains&&e.contains(t)}function J(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function ee(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function te(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function ne(e){return"string"==typeof e.type}function re(e){return e.props}var oe=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function ie(e){void 0===e&&(e={});var t={};return oe.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function ae(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function ue(e,t,n){var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var o=t+e;return o<0?o=r:o>r&&(o=0),o}var ce=J((function(){le().textContent=""}),500);function se(e,t){var n=le(t);e&&(n.textContent=e,ce())}function le(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var de=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),pe=function(){var e=function(e){var t,n;function r(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(z++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=ie(t),n.internalSetState(K({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=ie(t),n.internalSetState(K({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,K({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var u=a?e(t):e;u=n.props.stateReducer(t,u),r=u.hasOwnProperty("selectedItem");var c={},s={};return r&&u.selectedItem!==t.selectedItem&&(o=u.selectedItem),u.type=u.type||0,Object.keys(u).forEach((function(e){t[e]!==u[e]&&(i[e]=u[e]),"type"!==e&&(s[e]=u[e],n.isControlledProp(e)||(c[e]=u[e]))})),a&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,K({},n.getStateAndHelpers(),{},u)),c}),(function(){q(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=U(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=l;var d=n.getState().isOpen;return K(((r={})[a]=Z(u,n.rootRef),r.role="combobox",r["aria-expanded"]=d,r["aria-haspopup"]="listbox",r["aria-owns"]=d?n.menuId:null,r["aria-labelledby"]=n.labelId,r),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(ue(1,t.getState().highlightedIndex,e),{type:4})}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(ue(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=K({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=K({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,a=t.onBlur,u=U(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),c=n.getState().isOpen,s={onClick:Q(r,n.buttonHandleClick),onKeyDown:Q(o,n.buttonHandleKeyDown),onKeyUp:Q(i,n.buttonHandleKeyUp),onBlur:Q(a,n.buttonHandleBlur)};return K({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},u.disabled?{}:s,{},u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=ae(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(F(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return K({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput,u=(t.onChangeText,U(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),c={};var s,l=n.getState(),d=l.inputValue,p=l.isOpen,f=l.highlightedIndex;u.disabled||((s={}).onChange=Q(i,a,n.inputHandleChange),s.onKeyDown=Q(r,n.inputHandleKeyDown),s.onBlur=Q(o,n.inputHandleBlur),c=s);return K({"aria-autocomplete":"list","aria-activedescendant":p&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":p?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:d,id:n.inputId},c,{},u)},n.inputHandleKeyDown=function(e){var t=ae(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(F(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,u=o.ref,c=U(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=l,K(((r={})[a]=Z(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:n.labelId,r.id=n.menuId,r),c)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick,u=(r.onPress,r.index),c=r.item,s=void 0===c?void 0:c,l=U(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var d=a,p=((t={onMouseMove:Q(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:Q(i,(function(e){e.preventDefault()}))}).onClick=Q(d,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:p.onMouseDown}:p;return K({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},f,{},l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var r=t.selectedItem;return K({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var r=t.isOpen;return K({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),q(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=J((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(K({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,se(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,u=r.defaultIsOpen,c=r.initialIsOpen,s=void 0===c?u:c,l=r.initialInputValue,d=void 0===l?"":l,p=r.initialSelectedItem,f=void 0===p?null:p,h=n.getState({highlightedIndex:a,isOpen:s,inputValue:d,selectedItem:f});return null!=h.selectedItem&&void 0===n.props.initialInputValue&&(h.inputValue=n.props.itemToString(h.selectedItem)),n.state=h,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,r){return n[r]=t.isControlledProp(r)?t.props[r]:e[r],n}),{})},o.isControlledProp=function(e){return void 0!==this.props[e]},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var r=ue(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(r,t)}},o.highlightFirstOrLastIndex=function(e,t,n){var r=this.getItemCount()-1;r<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:r,n))},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,u=this.getRootProps,c=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,m=this.toggleMenu,v=this.selectItem,g=this.selectItemAtIndex,y=this.selectHighlightedItem,b=this.setHighlightedIndex,I=this.clearSelection,w=this.clearItems;return{getRootProps:u,getToggleButtonProps:c,getLabelProps:s,getMenuProps:l,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:m,selectItem:v,selectItemAtIndex:g,selectHighlightedItem:y,setHighlightedIndex:b,clearSelection:I,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var r=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(G(e,t)||n&&G(e,r.activeElement))}))},n=function(){e.isMouseDown=!0},r=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},a=function(n){var r=t(n.target,!1);e.isTouchMove||r||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",n),u.addEventListener("mouseup",r),u.addEventListener("touchstart",o),u.addEventListener("touchmove",i),u.addEventListener("touchend",a),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",n),u.removeEventListener("mouseup",r),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",i),u.removeEventListener("touchend",a)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=te(this.props.children,Y);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=te(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:ne(t)?Object(s.cloneElement)(t,this.getRootProps(re(t))):void 0:null},r}(s.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:ee,itemToString:function(e){return null==e?"":String(e)},onStateChange:Y,onInputValueChange:Y,onUserAction:Y,onChange:Y,onSelect:Y,onOuterClick:Y,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:X},e.stateChangeTypes=de,e}();p.a.array.isRequired,p.a.func,p.a.func,p.a.func,p.a.bool,p.a.number,p.a.number,p.a.number,p.a.bool,p.a.bool,p.a.bool,p.a.any,p.a.any,p.a.any,p.a.string,p.a.string,p.a.string,p.a.func,p.a.string,p.a.func,p.a.func,p.a.func,p.a.func,p.a.func,p.a.shape({addEventListener:p.a.func,removeEventListener:p.a.func,document:p.a.shape({getElementById:p.a.func,activeElement:p.a.any,body:p.a.any})});"undefined"==typeof window||window;var fe=pe;function he(){return(he=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function me(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ye=function(e){var t=e.listId,n=e.apiKey,o=e.onChange,i=ve(Object(r.useState)([]),2),u=i[0],s=i[1],l=ve(Object(r.useState)(!1),2),d=l[0],p=l[1],f=ve(Object(r.useState)({controller:null}),2),h=f[0].controller,m=f[1],v=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h&&h.abort(),p(!0),"AbortController"in window&&(h=new AbortController,m({controller:h})),(t=new FormData).append("api_key",n),t.append("action","blocksy_ext_mailchimp_maybe_get_lists"),e.prev=6,e.next=9,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:h.signal,body:t});case 9:if(200!==(r=e.sent).status){e.next=19;break}return e.next=13,r.json();case 13:if(!(o=e.sent).success){e.next=19;break}if("api_key_invalid"===o.data.result){e.next=19;break}return p(!1),s(o.data.result),e.abrupt("return");case 19:e.next=23;break;case 21:e.prev=21,e.t0=e.catch(6);case 23:s([]),p(!1);case 25:case"end":return e.stop()}}),e,null,[[6,21]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){me(i,r,o,a,u,"next",e)}function u(e){me(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.useEffect)((function(){n&&-1!==n.indexOf("-")?v():s([])}),[n]),0===u.length?Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:d?Object(a.__)("Loading","blc"):Object(a.__)("Invalid API Key...","blc")})):Object(r.createElement)(fe,{selectedItem:t||"",onChange:function(e){return o(e)},itemToString:function(e){return e?(u.find((function(t){return t.id===e}))||{}).name:""}},(function(e){var t=e.getInputProps,n=e.getItemProps,o=(e.getLabelProps,e.getMenuProps),i=e.isOpen,s=(e.inputValue,e.highlightedIndex),l=e.selectedItem,d=e.openMenu;return Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",he({},t({onFocus:function(){return d()},onClick:function(){return d()}}),{placeholder:Object(a.__)("Select list...","blc"),readOnly:!0})),i&&Object(r.createElement)("div",o({className:"ct-select-dropdown"}),u.map((function(e,t){return Object(r.createElement)("div",n({key:e.id,index:t,item:e.id,className:c()("ct-select-dropdown-item",{active:s===t,selected:l===e.id})}),e.name)}))))}))};function be(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return we(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Oe=function(e){var t=e.extension,n=e.isEditingCredentials,o=e.setIsEditingCredentials,i=e.onCredentialsValidated,u=Ie(Object(r.useState)(t.data.api_key),2),s=u[0],l=u[1],d=Ie(Object(r.useState)(t.data.list_id),2),p=d[0],f=d[1],h=Ie(Object(r.useState)(!1),2),m=h[0],v=h[1],g=Ie(Object(r.useState)(!1),2),y=g[0],b=g[1],I=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new FormData).append("api_key",s),t.append("list_id",p),t.append("action","blocksy_ext_mailchimp_maybe_save_credentials"),v(!0),e.prev=5,e.next=8,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 8:if(200!==(n=e.sent).status){e.next=14;break}return e.next=12,n.json();case 12:(r=e.sent).success&&"api_key_invalid"!==r.data.result&&(i(),b(!1));case 14:b(!0),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),b(!0);case 20:return e.next=22,new Promise((function(e){return setTimeout((function(){return e()}),1e3)}));case 22:v(!1);case 23:case"end":return e.stop()}}),e,null,[[5,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){be(i,r,o,a,u,"next",e)}function u(e){be(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.createElement)(H,{items:n,onDismiss:function(){return o(!1)},className:"ct-mailchimp-modal",render:function(){return Object(r.createElement)("div",{className:c()("ct-modal-content",{"ct-key-invalid":y})},Object(r.createElement)("h2",null,Object(a.__)("API Credentials","blc")),Object(r.createElement)("p",{dangerouslySetInnerHTML:{__html:Object(a.sprintf)(Object(a.__)("Enter your Mailchimp API credentials in the form below. More info on how to generate an API key can be found %shere%s.","blc"),'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',"</a>")}}),null,Object(r.createElement)("div",{className:"mailchimp-credentials"},Object(r.createElement)("section",null,Object(r.createElement)("label",null,Object(a.__)("API Key","blc")),Object(r.createElement)("div",{className:"ct-option-input"},Object(r.createElement)("input",{type:"text",onChange:function(e){var t=e.target.value;return l(t)},value:s||""}))),Object(r.createElement)("section",null,Object(r.createElement)("label",null,Object(a.__)("List ID","blc")),Object(r.createElement)(ye,{listId:p,onChange:function(e){return f(e)},apiKey:s})),Object(r.createElement)("section",null,Object(r.createElement)("label",null," "),Object(r.createElement)("button",{className:"ct-button","data-button":"blue",disabled:!s||!p||m,onClick:function(){return I()}},m?Object(a.__)("Loading...","blc"):t.__object?Object(a.__)("Save Settings","blc"):Object(a.__)("Activate","blc")))))}})};function Se(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function xe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Se(i,r,o,a,u,"next",e)}function u(e){Se(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=Object(r.useState)(!1),o=Ee(n,2),i=o[0],u=o[1],c=Object(r.useState)(!1),s=Ee(c,2),l=s[0],d=s[1],p=function(){var n=xe(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(r=new FormData).append("ext",e.name),r.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),u(!0),n.prev=4,n.next=7,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:r});case 7:t(),n.next=12;break;case 10:n.prev=10,n.t0=n.catch(4);case 12:u(!1);case 13:case"end":return n.stop()}}),n,null,[[4,10]])})));return function(){return n.apply(this,arguments)}}(),f=function(){e.__object||e.data.api_key?p():d(!0)};return[i,f,Object(r.createElement)(r.Fragment,null,e.__object&&e.data.api_key&&Object(r.createElement)("button",{className:"ct-button ct-config-btn","data-button":"white",title:"Edit Credentials",onClick:function(){return d(!0)}},Object(a.__)("Configure","blc")),Object(r.createElement)(Oe,{isEditingCredentials:l,setIsEditingCredentials:d,extension:e,onCredentialsValidated:function(){e.__object||p(),d(!1)}}))]};function _e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ae=function(e){var t=e.extension,n=e.onExtsSync,o=_e(Ce(t,(function(){n()})),3),i=o[0],u=o[1],s=o[2],l=_e(L(t),2),d=l[0],p=l[1];return Object(r.createElement)("li",{className:c()({active:!!t.__object})},Object(r.createElement)("h4",{className:"ct-extension-title"},t.config.name,i&&Object(r.createElement)("svg",{width:"15",height:"15",viewBox:"0 0 100 100"},Object(r.createElement)("g",{transform:"translate(50,50)"},Object(r.createElement)("g",{transform:"scale(1)"},Object(r.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"#687c93"}),Object(r.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"#ffffff",transform:"rotate(161.634)"},Object(r.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"})))))),t.config.description&&Object(r.createElement)("div",{className:"ct-extension-description"},t.config.description),Object(r.createElement)("div",{className:"ct-extension-actions"},Object(r.createElement)("button",{className:c()(t.__object?"ct-button":"ct-button-primary"),"data-button":"white",disabled:i,onClick:function(){return u()}},t.__object?Object(a.__)("Deactivate","blc"):Object(a.__)("Activate","blc")),s,t.readme&&Object(r.createElement)("button",{onClick:function(){return d()},"data-button":"white",className:"ct-minimal-button ct-instruction"},Object(r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})))),p)};i.a.on("ct:extensions:card",(function(e){var t=e.CustomComponent;"mailchimp"===e.extension.name&&(t.extension=Ae)}))}]);
trunk/framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+
9
+ import classnames from 'classnames'
10
+ import { __, sprintf } from 'ct-i18n'
11
+ import ListPicker from './ListPicker'
12
+ import Overlay from '../../../../../static/js/helpers/Overlay'
13
+ import { Select } from 'blocksy-options'
14
+
15
+ const EditCredentials = ({
16
+ extension,
17
+ isEditingCredentials,
18
+ setIsEditingCredentials,
19
+ onCredentialsValidated,
20
+ }) => {
21
+ const [apiKey, setApiKey] = useState(extension.data.api_key)
22
+ const [listId, setListId] = useState(extension.data.list_id)
23
+ const [isLoading, setIsLoading] = useState(false)
24
+ const [isApiKeyInvalid, makeKeyInvalid] = useState(false)
25
+
26
+ const attemptToSaveCredentials = async () => {
27
+ const body = new FormData()
28
+
29
+ body.append('api_key', apiKey)
30
+ body.append('list_id', listId)
31
+
32
+ body.append('action', 'blocksy_ext_mailchimp_maybe_save_credentials')
33
+
34
+ setIsLoading(true)
35
+
36
+ try {
37
+ const response = await fetch(ctDashboardLocalizations.ajax_url, {
38
+ method: 'POST',
39
+ body,
40
+ })
41
+
42
+ if (response.status === 200) {
43
+ const body = await response.json()
44
+
45
+ if (body.success) {
46
+ if (body.data.result !== 'api_key_invalid') {
47
+ onCredentialsValidated()
48
+ makeKeyInvalid(false)
49
+ }
50
+ }
51
+ }
52
+
53
+ makeKeyInvalid(true)
54
+ } catch (e) {
55
+ makeKeyInvalid(true)
56
+ }
57
+
58
+ await new Promise((r) => setTimeout(() => r(), 1000))
59
+
60
+ setIsLoading(false)
61
+ }
62
+
63
+ return (
64
+ <Overlay
65
+ items={isEditingCredentials}
66
+ onDismiss={() => setIsEditingCredentials(false)}
67
+ className={'ct-mailchimp-modal'}
68
+ render={() => (
69
+ <div
70
+ className={classnames('ct-modal-content', {
71
+ 'ct-key-invalid': isApiKeyInvalid,
72
+ })}>
73
+ <h2>{__('API Credentials', 'blc')}</h2>
74
+
75
+ <p
76
+ dangerouslySetInnerHTML={{
77
+ __html: sprintf(
78
+ __(
79
+ 'Enter your Mailchimp API credentials in the form below. More info on how to generate an API key can be found %shere%s.',
80
+ 'blc'
81
+ ),
82
+ '<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',
83
+ '</a>'
84
+ ),
85
+ }}
86
+ />
87
+
88
+ {null && (
89
+ <Fragment>
90
+ <h4>{__('Pick service', 'blc')}</h4>
91
+
92
+ <Select
93
+ onChange={(copy) => {}}
94
+ option={{
95
+ placeholder: __(
96
+ 'Pick Mailing Service',
97
+ 'blocksy'
98
+ ),
99
+ choices: [
100
+ {
101
+ key: 'mailchimp',
102
+ value: 'Mailchimp',
103
+ },
104
+ ],
105
+ }}
106
+ value={'mailchimp'}
107
+ />
108
+ </Fragment>
109
+ )}
110
+
111
+ <div className="mailchimp-credentials">
112
+ <section>
113
+ <label>{__('API Key', 'blc')}</label>
114
+
115
+ <div className="ct-option-input">
116
+ <input
117
+ type="text"
118
+ onChange={({ target: { value } }) =>
119
+ setApiKey(value)
120
+ }
121
+ value={apiKey || ''}
122
+ />
123
+ </div>
124
+ </section>
125
+
126
+ <section>
127
+ <label>{__('List ID', 'blc')}</label>
128
+
129
+ <ListPicker
130
+ listId={listId}
131
+ onChange={(id) => setListId(id)}
132
+ apiKey={apiKey}
133
+ />
134
+ </section>
135
+
136
+ <section>
137
+ <label>&nbsp;</label>
138
+ <button
139
+ className="ct-button"
140
+ data-button="blue"
141
+ disabled={!apiKey || !listId || isLoading}
142
+ onClick={() => attemptToSaveCredentials()}>
143
+ {isLoading
144
+ ? __('Loading...', 'blc')
145
+ : !extension.__object
146
+ ? __('Activate', 'blc')
147
+ : __('Save Settings', 'blc')}
148
+ </button>
149
+ </section>
150
+ </div>
151
+ </div>
152
+ )}
153
+ />
154
+ )
155
+ }
156
+
157
+ export default EditCredentials
trunk/framework/extensions/mailchimp/dashboard-static/js/ListPicker.js ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+ import Downshift from 'downshift'
9
+ import { __ } from 'ct-i18n'
10
+ import classnames from 'classnames'
11
+
12
+ const ListPicker = ({ listId, apiKey, onChange }) => {
13
+ const [lists, setLists] = useState([])
14
+ const [isLoadingLists, setListsLoading] = useState(false)
15
+
16
+ let [{ controller }, setAbortState] = useState({
17
+ controller: null,
18
+ })
19
+
20
+ const maybeFetchLists = async () => {
21
+ if (controller) {
22
+ controller.abort()
23
+ }
24
+
25
+ setListsLoading(true)
26
+
27
+ if ('AbortController' in window) {
28
+ controller = new AbortController()
29
+
30
+ setAbortState({
31
+ controller,
32
+ })
33
+ }
34
+
35
+ const body = new FormData()
36
+
37
+ body.append('api_key', apiKey)
38
+ body.append('action', 'blocksy_ext_mailchimp_maybe_get_lists')
39
+
40
+ try {
41
+ const response = await fetch(ctDashboardLocalizations.ajax_url, {
42
+ method: 'POST',
43
+ signal: controller.signal,
44
+ body,
45
+ })
46
+ if (response.status === 200) {
47
+ const body = await response.json()
48
+
49
+ if (body.success) {
50
+ if (body.data.result !== 'api_key_invalid') {
51
+ setListsLoading(false)
52
+ setLists(body.data.result)
53
+
54
+ return
55
+ }
56
+ }
57
+ }
58
+ } catch (e) {}
59
+
60
+ setLists([])
61
+ setListsLoading(false)
62
+ }
63
+
64
+ useEffect(() => {
65
+ if (!apiKey) {
66
+ setLists([])
67
+ return
68
+ }
69
+
70
+ if (apiKey.indexOf('-') === -1) {
71
+ setLists([])
72
+ return
73
+ }
74
+
75
+ maybeFetchLists()
76
+ }, [apiKey])
77
+
78
+ return lists.length === 0 ? (
79
+ <div className="ct-select-input">
80
+ <input
81
+ disabled
82
+ placeholder={
83
+ isLoadingLists
84
+ ? __('Loading', 'blc')
85
+ : __('Invalid API Key...', 'blc')
86
+ }
87
+ />
88
+ </div>
89
+ ) : (
90
+ <Downshift
91
+ selectedItem={listId || ''}
92
+ onChange={(selection) => onChange(selection)}
93
+ itemToString={(item) =>
94
+ item ? (lists.find(({ id }) => id === item) || {}).name : ''
95
+ }>
96
+ {({
97
+ getInputProps,
98
+ getItemProps,
99
+ getLabelProps,
100
+ getMenuProps,
101
+ isOpen,
102
+ inputValue,
103
+ highlightedIndex,
104
+ selectedItem,
105
+ openMenu,
106
+ }) => (
107
+ <div className="ct-select-input">
108
+ <input
109
+ {...getInputProps({
110
+ onFocus: () => openMenu(),
111
+ onClick: () => openMenu(),
112
+ })}
113
+ placeholder={__('Select list...', 'blc')}
114
+ readOnly
115
+ />
116
+
117
+ {isOpen && (
118
+ <div
119
+ {...getMenuProps({
120
+ className: 'ct-select-dropdown',
121
+ })}>
122
+ {lists.map((item, index) => (
123
+ <div
124
+ {...getItemProps({
125
+ key: item.id,
126
+ index,
127
+ item: item.id,
128
+ className: classnames(
129
+ 'ct-select-dropdown-item',
130
+ {
131
+ active:
132
+ highlightedIndex === index,
133
+ selected:
134
+ selectedItem === item.id,
135
+ }
136
+ ),
137
+ })}>
138
+ {item.name}
139
+ </div>
140
+ ))}
141
+ </div>
142
+ )}
143
+ </div>
144
+ )}
145
+ </Downshift>
146
+ )
147
+ }
148
+
149
+ export default ListPicker
trunk/framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+ import { __ } from 'ct-i18n'
9
+ import classnames from 'classnames'
10
+
11
+ import useExtensionReadme from '../../../../../static/js/helpers/useExtensionReadme'
12
+ // import useActivationAction from '../../../../../static/js/helpers/useActivationAction'
13
+ import useActivationWithRequirements from './hooks/useActivationWithRequirements'
14
+
15
+ const Mailchimp = ({ extension, onExtsSync }) => {
16
+ const [isLoading, activationAction, ui] = useActivationWithRequirements(
17
+ extension,
18
+ () => {
19
+ onExtsSync()
20
+ }
21
+ )
22
+
23
+ const [showReadme, readme] = useExtensionReadme(extension)
24
+
25
+ return (
26
+ <li className={classnames({ active: !!extension.__object })}>
27
+ <h4 className="ct-extension-title">
28
+ {extension.config.name}
29
+
30
+ {isLoading && (
31
+ <svg width="15" height="15" viewBox="0 0 100 100">
32
+ <g transform="translate(50,50)">
33
+ <g transform="scale(1)">
34
+ <circle cx="0" cy="0" r="50" fill="#687c93" />
35
+ <circle
36
+ cx="0"
37
+ cy="-26"
38
+ r="12"
39
+ fill="#ffffff"
40
+ transform="rotate(161.634)">
41
+ <animateTransform
42
+ attributeName="transform"
43
+ type="rotate"
44
+ calcMode="linear"
45
+ values="0 0 0;360 0 0"
46
+ keyTimes="0;1"
47
+ dur="1s"
48
+ begin="0s"
49
+ repeatCount="indefinite"
50
+ />
51
+ </circle>
52
+ </g>
53
+ </g>
54
+ </svg>
55
+ )}
56
+ </h4>
57
+
58
+ {extension.config.description && (
59
+ <div className="ct-extension-description">
60
+ {extension.config.description}
61
+ </div>
62
+ )}
63
+
64
+ <div className="ct-extension-actions">
65
+ <button
66
+ className={classnames(
67
+ extension.__object ? 'ct-button' : 'ct-button-primary'
68
+ )}
69
+ data-button="white"
70
+ disabled={isLoading}
71
+ onClick={() => activationAction()}>
72
+ {extension.__object
73
+ ? __('Deactivate', 'blc')
74
+ : __('Activate', 'blc')}
75
+ </button>
76
+
77
+ {ui}
78
+
79
+ {extension.readme && (
80
+ <button
81
+ onClick={() => showReadme()}
82
+ data-button="white"
83
+ className="ct-minimal-button ct-instruction">
84
+ <svg width="16" height="16" viewBox="0 0 24 24">
85
+ <path d="M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z" />
86
+ </svg>
87
+ </button>
88
+ )}
89
+ </div>
90
+ {readme}
91
+ </li>
92
+ )
93
+ }
94
+
95
+ export default Mailchimp
trunk/framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+
9
+ import EditCredentials from '../EditCredentials'
10
+ import { __, sprintf } from 'ct-i18n'
11
+
12
+ const useActivationWithRequirements = (extension, cb = () => {}) => {
13
+ const [isLoading, setIsLoading] = useState(false)
14
+ const [isEditingCredentials, setIsEditingCredentials] = useState(false)
15
+
16
+ const toggleActivationState = async () => {
17
+ const body = new FormData()
18
+
19
+ body.append('ext', extension.name)
20
+ body.append(
21
+ 'action',
22
+ extension.__object
23
+ ? 'blocksy_extension_deactivate'
24
+ : 'blocksy_extension_activate'
25
+ )
26
+
27
+ setIsLoading(true)
28
+
29
+ try {
30
+ await fetch(ctDashboardLocalizations.ajax_url, {
31
+ method: 'POST',
32
+ body,
33
+ })
34
+
35
+ cb()
36
+ } catch (e) {}
37
+
38
+ setIsLoading(false)
39
+ }
40
+
41
+ const handleActionWithRequirements = () => {
42
+ if (extension.__object || extension.data.api_key) {
43
+ toggleActivationState()
44
+ return
45
+ }
46
+
47
+ setIsEditingCredentials(true)
48
+ }
49
+
50
+ return [
51
+ isLoading,
52
+ handleActionWithRequirements,
53
+ <Fragment>
54
+ {extension.__object && extension.data.api_key && (
55
+ <button
56
+ className="ct-button ct-config-btn"
57
+ data-button="white"
58
+ title="Edit Credentials"
59
+ onClick={() => setIsEditingCredentials(true)}>
60
+ {__('Configure', 'blc')}
61
+ </button>
62
+ )}
63
+
64
+ <EditCredentials
65
+ isEditingCredentials={isEditingCredentials}
66
+ setIsEditingCredentials={setIsEditingCredentials}
67
+ extension={extension}
68
+ onCredentialsValidated={() => {
69
+ if (!extension.__object) {
70
+ toggleActivationState()
71
+ }
72
+
73
+ setIsEditingCredentials(false)
74
+ }}
75
+ />
76
+ </Fragment>,
77
+ ]
78
+ }
79
+
80
+ export default useActivationWithRequirements
trunk/framework/extensions/mailchimp/dashboard-static/js/main.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+ import ctEvents from 'ct-events'
9
+
10
+ import Mailchimp from './Mailchimp'
11
+
12
+ ctEvents.on('ct:extensions:card', ({ CustomComponent, extension }) => {
13
+ if (extension.name !== 'mailchimp') return
14
+ CustomComponent.extension = Mailchimp
15
+ })
trunk/framework/extensions/mailchimp/extension.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . '/helpers.php';
4
+ require_once dirname(__FILE__) . '/mailchimp-manager.php';
5
+
6
+ class BlocksyExtensionMailchimp {
7
+ public function __construct() {
8
+ add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
9
+ blocksy_theme_get_dynamic_styles(array_merge([
10
+ 'path' => dirname( __FILE__ ) . '/global.php',
11
+ 'chunk' => 'global'
12
+ ], $args));
13
+ }, 10, 3);
14
+
15
+ add_filter('blocksy-options-scripts-dependencies', function ($d) {
16
+ $d[] = 'blocksy-ext-newsletter-subscribe-admin-scripts';
17
+ return $d;
18
+ });
19
+
20
+ add_action('admin_enqueue_scripts', function () {
21
+ if (! function_exists('get_plugin_data')) {
22
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
23
+ }
24
+
25
+ $data = get_plugin_data(BLOCKSY__FILE__);
26
+
27
+ wp_register_script(
28
+ 'blocksy-ext-newsletter-subscribe-admin-scripts',
29
+ BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
30
+ [],
31
+ $data['Version'],
32
+ true
33
+ );
34
+
35
+ wp_localize_script(
36
+ 'blocksy-ext-newsletter-subscribe-admin-scripts',
37
+ 'blocksy_ext_newsletter_subscribe_localization',
38
+ [
39
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/',
40
+ ]
41
+ );
42
+ });
43
+
44
+ add_action('customize_controls_enqueue_scripts', function () {
45
+ if (! function_exists('get_plugin_data')) {
46
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
47
+ }
48
+
49
+ $data = get_plugin_data(BLOCKSY__FILE__);
50
+
51
+ wp_register_script(
52
+ 'blocksy-ext-newsletter-subscribe-admin-scripts',
53
+ BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
54
+ [],
55
+ $data['Version'],
56
+ true
57
+ );
58
+
59
+ wp_localize_script(
60
+ 'blocksy-ext-newsletter-subscribe-admin-scripts',
61
+ 'blocksy_ext_newsletter_subscribe_localization',
62
+ [
63
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/',
64
+ ]
65
+ );
66
+ });
67
+
68
+ add_action('wp_enqueue_scripts', function () {
69
+ if (! function_exists('get_plugin_data')) {
70
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
71
+ }
72
+
73
+ $data = get_plugin_data(BLOCKSY__FILE__);
74
+
75
+ if (is_admin()) {
76
+ return;
77
+ }
78
+
79
+ wp_enqueue_style(
80
+ 'blocksy-ext-newsletter-subscribe-styles',
81
+ BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.css',
82
+ ['ct-main-styles'],
83
+ $data['Version']
84
+ );
85
+
86
+ wp_enqueue_script(
87
+ 'blocksy-ext-newsletter-subscribe-scripts',
88
+ BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.js',
89
+ ['ct-scripts'],
90
+ $data['Version'],
91
+ true
92
+ );
93
+ });
94
+
95
+ add_filter('blocksy_widgets_paths', function ($all_widgets) {
96
+ $all_widgets[] = dirname(__FILE__) . '/ct-mailchimp';
97
+ return $all_widgets;
98
+ });
99
+
100
+ add_filter(
101
+ 'blocksy_single_posts_end_customizer_options',
102
+ function ($opts) {
103
+ $opts['mailchimp_single_post_enabled'] = blc_call_fn(
104
+ ['fn' => 'blocksy_get_options'],
105
+ dirname( __FILE__ ) . '/customizer.php',
106
+ [], false
107
+ );
108
+
109
+ return $opts;
110
+ }
111
+ );
112
+
113
+ add_filter('blocksy_extensions_metabox_post:elements:before', function ($opts) {
114
+ $opts['disable_subscribe_form'] = [
115
+ 'label' => __( 'Disable Subscribe Form', 'blc' ),
116
+ 'type' => 'ct-switch',
117
+ 'value' => 'no',
118
+ ];
119
+
120
+ return $opts;
121
+ }, 5);
122
+
123
+ add_action(
124
+ 'customize_preview_init',
125
+ function () {
126
+ if (! function_exists('get_plugin_data')) {
127
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
128
+ }
129
+
130
+ $data = get_plugin_data(BLOCKSY__FILE__);
131
+
132
+ wp_enqueue_script(
133
+ 'blocksy-newsletter-subscribe-customizer-sync',
134
+ BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/sync.js',
135
+ [ 'customize-preview', 'ct-events' ],
136
+ $data['Version'],
137
+ true
138
+ );
139
+ }
140
+ );
141
+
142
+ }
143
+ }
144
+
trunk/framework/extensions/mailchimp/global.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Mailchimp
4
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
5
+ 'value' => get_theme_mod('mailchimpContent'),
6
+ 'default' => [
7
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
8
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
9
+ ],
10
+ 'css' => $css,
11
+ 'variables' => [
12
+ 'default' => [
13
+ 'selector' => '.ct-mailchimp-block',
14
+ 'variable' => 'color'
15
+ ],
16
+
17
+ 'hover' => [
18
+ 'selector' => '.ct-mailchimp-block',
19
+ 'variable' => 'linkHoverColor'
20
+ ],
21
+ ],
22
+ ]);
23
+
24
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
25
+ 'value' => get_theme_mod('mailchimpButton'),
26
+ 'default' => [
27
+ 'default' => [ 'color' => 'var(--paletteColor1)' ],
28
+ 'hover' => [ 'color' => 'var(--paletteColor2)' ],
29
+ ],
30
+ 'css' => $css,
31
+ 'variables' => [
32
+ 'default' => [
33
+ 'selector' => '.ct-mailchimp-block',
34
+ 'variable' => 'buttonInitialColor'
35
+ ],
36
+
37
+ 'hover' => [
38
+ 'selector' => '.ct-mailchimp-block',
39
+ 'variable' => 'buttonHoverColor'
40
+ ]
41
+ ],
42
+ ]);
43
+
44
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
45
+ 'value' => get_theme_mod('mailchimpBackground'),
46
+ 'default' => ['default' => [ 'color' => '#ffffff' ]],
47
+ 'css' => $css,
48
+ 'variables' => [
49
+ 'default' => [
50
+ 'selector' => '.ct-mailchimp-block',
51
+ 'variable' => 'backgroundColor'
52
+ ],
53
+ ],
54
+ ]);
55
+
56
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
57
+ 'value' => get_theme_mod('mailchimpShadow'),
58
+ 'default' => ['default' => [ 'color' => 'rgba(210, 213, 218, 0.4)' ]],
59
+ 'css' => $css,
60
+ 'variables' => [
61
+ 'default' => [
62
+ 'selector' => '.ct-mailchimp-block',
63
+ 'variable' => 'mailchimpShadow'
64
+ ],
65
+ ],
66
+ ]);
67
+
68
+ blc_call_fn(['fn' => 'blocksy_output_box_shadow'], [
69
+ 'css' => $css,
70
+ 'tablet_css' => $tablet_css,
71
+ 'mobile_css' => $mobile_css,
72
+ 'selector' => '.ct-mailchimp-block',
73
+ 'value' => get_theme_mod(
74
+ 'mailchimpShadow',
75
+ blc_call_fn(['fn' => 'blocksy_box_shadow_value'], [
76
+ 'enable' => true,
77
+ 'h_offset' => 0,
78
+ 'v_offset' => 50,
79
+ 'blur' => 90,
80
+ 'spread' => 0,
81
+ 'inset' => false,
82
+ 'color' => [
83
+ 'color' => 'rgba(210, 213, 218, 0.4)',
84
+ ],
85
+ ])
86
+ ),
87
+ 'responsive' => true
88
+ ]);
89
+
90
+ blc_call_fn(['fn' => 'blocksy_output_responsive'], [
91
+ 'css' => $css,
92
+ 'tablet_css' => $tablet_css,
93
+ 'mobile_css' => $mobile_css,
94
+ 'selector' => '.ct-mailchimp-block',
95
+ 'variableName' => 'padding',
96
+ 'value' => get_theme_mod('mailchimpSpacing', [
97
+ 'mobile' => '40px',
98
+ 'tablet' => '40px',
99
+ 'desktop' => '40px',
100
+ ]),
101
+ 'unit' => ''
102
+ ]);
103
+
trunk/framework/extensions/mailchimp/helpers.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_output_mailchimp_subscribe_form_cache() {
4
+ if (! is_customize_preview()) return;
5
+
6
+ blocksy_add_customizer_preview_cache(
7
+ blocksy_html_tag(
8
+ 'div',
9
+ [ 'data-id' => 'blocksy-mailchimp-subscribe' ],
10
+ blc_ext_mailchimp_subscribe_form(true)
11
+ )
12
+ );
13
+ }
14
+
15
+ function blc_ext_mailchimp_subscribe_form($forced = false) {
16
+ if (! $forced) {
17
+ blc_output_mailchimp_subscribe_form_cache();
18
+ }
19
+
20
+ if (get_theme_mod('mailchimp_single_post_enabled', 'yes') !== 'yes') {
21
+ if (! $forced) {
22
+ return '';
23
+ }
24
+ }
25
+
26
+ if (
27
+ blocksy_default_akg(
28
+ 'disable_subscribe_form',
29
+ blc_call_fn([
30
+ 'fn' => 'blocksy_get_post_options',
31
+ 'default' => 'array'
32
+ ]),
33
+ 'no'
34
+ ) === 'yes'
35
+ ) {
36
+ return '';
37
+ }
38
+
39
+ $title = get_theme_mod('mailchimp_title', __(
40
+ 'Newsletter Updates', 'blc'
41
+ ));
42
+
43
+ $description = get_theme_mod('mailchimp_text', __(
44
+ 'Enter your email address below to subscribe to our newsletter',
45
+ 'blc'
46
+ ));
47
+
48
+ $button_text = get_theme_mod('mailchimp_button_text', __(
49
+ 'Subscribe', 'blc'
50
+ ));
51
+
52
+ $has_name = get_theme_mod( 'has_mailchimp_name', 'no' ) === 'yes';
53
+
54
+ $name_label = get_theme_mod('mailchimp_name_label', __( 'Your name', 'blc' ));
55
+ $email_label = get_theme_mod('mailchimp_mail_label', __( 'Your email', 'blc' ));
56
+
57
+ if ($forced) {
58
+ $has_name = true;
59
+ }
60
+
61
+ $list_id = null;
62
+
63
+ if (get_theme_mod( 'mailchimp_list_id_source', 'default' ) === 'custom') {
64
+ $list_id = get_theme_mod( 'mailchimp_list_id', '' );
65
+ }
66
+
67
+ $manager = new BlocksyMailchimpManager();
68
+
69
+ $mailchimp_data = $manager->get_form_url_and_gdpr_for($list_id);
70
+
71
+ if (! $mailchimp_data) {
72
+ return '';
73
+ }
74
+
75
+ $form_url = $mailchimp_data['form_url'];
76
+ $has_gdpr_fields = $mailchimp_data['has_gdpr_fields'];
77
+
78
+ $skip_submit_output = '';
79
+
80
+ if ($has_gdpr_fields) {
81
+ $skip_submit_output = 'data-skip-submit';
82
+ }
83
+
84
+ $class = 'ct-mailchimp-block';
85
+
86
+ $class .= ' ' . blc_call_fn(
87
+ ['fn' => 'blocksy_visibility_classes'],
88
+ get_theme_mod('mailchimp_subscribe_visibility', [
89
+ 'desktop' => true,
90
+ 'tablet' => true,
91
+ 'mobile' => false,
92
+ ])
93
+ );
94
+
95
+ $fields_number = '1';
96
+
97
+ if ($has_name) {
98
+ $fields_number = '2';
99
+ }
100
+
101
+ ob_start();
102
+
103
+ ?>
104
+
105
+ <div class="<?php echo esc_attr($class) ?>">
106
+ <h3><?php echo esc_html($title) ?></h3>
107
+
108
+ <p class="ct-mailchimp-description">
109
+ <?php echo $description ?>
110
+ </p>
111
+
112
+ <form target="_blank" action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-block-form" <?php echo $skip_submit_output ?>>
113
+ <section data-fields="<?php echo $fields_number ?>">
114
+ <?php if ($has_name) { ?>
115
+ <input type="text" name="FNAME" placeholder="<?php esc_attr_e($name_label, 'blc'); ?>" title="<?php echo __('Name', 'blc') ?>" />
116
+ <?php } ?>
117
+
118
+ <input type="email" name="EMAIL" placeholder="<?php esc_attr_e($email_label, 'blc'); ?> *" title="<?php echo __('Email', 'blc') ?>" required />
119
+
120
+ <button class="button">
121
+ <?php echo esc_html($button_text) ?>
122
+ </button>
123
+ </section>
124
+
125
+ <div class="ct-mailchimp-message"></div>
126
+
127
+ <?php
128
+ if (function_exists('blocksy_ext_cookies_checkbox')) {
129
+ echo blocksy_ext_cookies_checkbox('subscribe');
130
+ }
131
+ ?>
132
+
133
+ </form>
134
+
135
+ </div>
136
+
137
+ <?php
138
+
139
+ return ob_get_clean();
140
+ }
trunk/framework/extensions/mailchimp/mailchimp-manager.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyMailchimpManager {
4
+ public function __construct() {
5
+ }
6
+
7
+ public function get_settings() {
8
+ $option = get_option('blocksy_ext_mailchimp_credentials', []);
9
+
10
+ if (empty($option)) {
11
+ $option = [];
12
+ }
13
+
14
+ return array_merge([
15
+ 'api_key' => null,
16
+ 'list_id' => null
17
+ ], $option);
18
+ }
19
+
20
+ public function set_settings($vals) {
21
+ update_option('blocksy_ext_mailchimp_credentials', array_merge([
22
+ 'api_key' => null,
23
+ 'list_id' => null
24
+ ], $vals));
25
+ }
26
+
27
+ public function can($capability = 'manage_options') {
28
+ if (is_multisite()) {
29
+ // Only network admin can change files that affects the entire network.
30
+ $can = current_user_can_for_blog( get_current_blog_id(), $capability );
31
+ } else {
32
+ $can = current_user_can( $capability );
33
+ }
34
+
35
+ if ($can) {
36
+ // Also you can use this method to get the capability.
37
+ $can = $capability;
38
+ }
39
+
40
+ return $can;
41
+ }
42
+
43
+ public function fetch_lists($api_key) {
44
+ if (! $api_key) {
45
+ return 'api_key_invalid';
46
+ }
47
+
48
+ if (strpos($api_key, '-') === false) {
49
+ return 'api_key_invalid';
50
+ }
51
+
52
+ $region = explode('-', $api_key);
53
+
54
+ $response = wp_remote_get('https://' . $region[1] . '.api.mailchimp.com/3.0/lists', [
55
+ 'headers' => [
56
+ 'Authorization' => 'Basic ' . base64_encode('asd:' . $api_key)
57
+ ]
58
+ ]);
59
+
60
+ if ( ! is_wp_error( $response ) ) {
61
+ if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
62
+ return 'api_key_invalid';
63
+ }
64
+
65
+ $body = json_decode(wp_remote_retrieve_body( $response ), true);
66
+
67
+ if (! $body) {
68
+ return 'api_key_invalid';
69
+ }
70
+
71
+ if (! isset($body['lists'])) {
72
+ return 'api_key_invalid';
73
+ }
74
+
75
+ return array_map(function($list) {
76
+ return [
77
+ 'name' => $list['name'],
78
+ 'id' => $list['id'],
79
+ 'subscribe_url_long' => $list['subscribe_url_long'],
80
+ 'subscribe_url_long_json' => $this->transform_subscribe_url(
81
+ $list['subscribe_url_long']
82
+ ),
83
+
84
+ 'has_gdpr_fields' => $list['marketing_permissions']
85
+ ];
86
+ }, $body['lists']);
87
+ } else {
88
+ return 'api_key_invalid';
89
+ }
90
+ }
91
+
92
+ public function transform_subscribe_url($url) {
93
+ return str_replace(
94
+ 'subscribe',
95
+ 'subscribe/post-json',
96
+ $url . '&c=callback'
97
+ );
98
+ }
99
+
100
+ public function get_form_url_and_gdpr_for($maybe_custom_list = null) {
101
+ $settings = $this->get_settings();
102
+
103
+ if (! isset($settings['api_key'])) {
104
+ return false;
105
+ }
106
+
107
+ if (! $settings['api_key']) {
108
+ return false;
109
+ }
110
+
111
+ $lists = $this->fetch_lists($settings['api_key']);
112
+
113
+ if (! is_array($lists)) {
114
+ return false;
115
+ }
116
+
117
+ if (empty($lists)) {
118
+ return false;
119
+ }
120
+
121
+ if ($maybe_custom_list) {
122
+ $settings['list_id'] = $maybe_custom_list;
123
+ }
124
+
125
+ if (! $settings['list_id']) {
126
+ return [
127
+ 'form_url' => $lists[0]['subscribe_url_long'],
128
+ 'has_gdpr_fields' => $lists[0]['has_gdpr_fields']
129
+ ];
130
+ }
131
+
132
+ foreach ($lists as $single_list) {
133
+ if ($single_list['id'] === $settings['list_id']) {
134
+ return [
135
+ 'form_url' => $single_list['subscribe_url_long'],
136
+ 'has_gdpr_fields' => $single_list['has_gdpr_fields']
137
+ ];
138
+ }
139
+ }
140
+
141
+ return [
142
+ 'form_url' => $lists[0]['subscribe_url_long'],
143
+ 'has_gdpr_fields' => $lists[0]['has_gdpr_fields']
144
+ ];
145
+ }
146
+ }
147
+
trunk/framework/extensions/mailchimp/pre-boot.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . '/mailchimp-manager.php';
4
+
5
+ class BlocksyExtensionMailchimpPreBoot {
6
+ public function __construct() {
7
+ add_action(
8
+ 'wp_ajax_blocksy_ext_mailchimp_maybe_get_lists',
9
+ [$this, 'get_lists']
10
+ );
11
+
12
+ add_action(
13
+ 'wp_ajax_blocksy_ext_mailchimp_get_actual_lists',
14
+ [$this, 'get_actual_lists']
15
+ );
16
+
17
+ add_action(
18
+ 'wp_ajax_blocksy_ext_mailchimp_maybe_save_credentials',
19
+ [$this, 'save_credentials']
20
+ );
21
+
22
+ add_filter('blocksy-dashboard-scripts-dependencies', function ($s) {
23
+ $s[] = 'blocksy-ext-mailchimp-dashboard-scripts';
24
+ return $s;
25
+ });
26
+
27
+ add_action('admin_enqueue_scripts', function () {
28
+ if (! function_exists('get_plugin_data')) {
29
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
30
+ }
31
+
32
+ $data = get_plugin_data(BLOCKSY__FILE__);
33
+
34
+ wp_register_script(
35
+ 'blocksy-ext-mailchimp-dashboard-scripts',
36
+ BLOCKSY_URL . 'framework/extensions/mailchimp/dashboard-static/bundle/main.js',
37
+ [],
38
+ $data['Version'],
39
+ true
40
+ );
41
+ });
42
+ }
43
+
44
+ public function ext_data() {
45
+ $m = new BlocksyMailchimpManager();
46
+ return $m->get_settings();
47
+ }
48
+
49
+ public function save_credentials() {
50
+ $this->maybe_save_credentials();
51
+ }
52
+
53
+ public function get_actual_lists() {
54
+ $m = new BlocksyMailchimpManager();
55
+
56
+ if ( ! $m->can() ) {
57
+ wp_send_json_error();
58
+ }
59
+
60
+ $settings = $m->get_settings();
61
+
62
+ $lists = $m->fetch_lists($settings['api_key']);
63
+
64
+ wp_send_json_success([
65
+ 'result' => $lists
66
+ ]);
67
+ }
68
+
69
+ public function get_lists() {
70
+ $this->maybe_save_credentials(false);
71
+ }
72
+
73
+ public function maybe_save_credentials($save = true) {
74
+ $m = new BlocksyMailchimpManager();
75
+
76
+ if ( ! $m->can() ) {
77
+ wp_send_json_error();
78
+ }
79
+
80
+ $lists = $m->fetch_lists($this->get_api_key_from_request());
81
+
82
+ if ($save) {
83
+ if (is_array($lists)) {
84
+ $m->set_settings([
85
+ 'api_key' => $this->get_api_key_from_request(),
86
+ 'list_id' => $this->get_list_id_from_request(),
87
+ ]);
88
+ }
89
+ }
90
+
91
+ wp_send_json_success([
92
+ 'result' => $lists
93
+ ]);
94
+ }
95
+
96
+ public function get_api_key_from_request() {
97
+ if ( ! isset( $_POST['api_key'] ) ) {
98
+ wp_send_json_error();
99
+ }
100
+
101
+ return addslashes( $_POST['api_key'] );
102
+ }
103
+
104
+ public function get_list_id_from_request() {
105
+ if ( ! isset( $_POST['list_id'] ) ) {
106
+ wp_send_json_error();
107
+ }
108
+
109
+ return addslashes( $_POST['list_id'] );
110
+ }
111
+ }
trunk/framework/extensions/mailchimp/readme.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2><?php echo __('Instructions', 'blc'); ?></h2>
2
+
3
+ <p>
4
+ <?php echo __('After installing and activating the Mailchimp extension you will have two possibilities to show your subscribe form:', 'blc') ?>
5
+ </p>
6
+
7
+ <ol class="ct-modal-list">
8
+ <li>
9
+ <h4><?php echo __('Mailchimp Widget', 'blc') ?></h4>
10
+ <i>
11
+ <?php
12
+ echo sprintf(
13
+ __('Navigate to %s and place the widget in any widget area you want.', 'blc'),
14
+ sprintf(
15
+ '<code>%s</code>',
16
+ __('Appearance ➝ Widgets', 'blc')
17
+ )
18
+ );
19
+ ?>
20
+ </i>
21
+ </li>
22
+
23
+ <li>
24
+ <h4><?php echo __('Mailchimp Block', 'blc') ?></h4>
25
+ <i>
26
+ <?php
27
+ echo sprintf(
28
+ __('Navigate to %s and customize the form and more.', 'blc'),
29
+ sprintf(
30
+ '<code>%s</code>',
31
+ __('Customizer ➝ Single Posts', 'blc')
32
+ )
33
+ );
34
+ ?>
35
+ </i>
36
+ </li>
37
+ </ol>
trunk/framework/extensions/mailchimp/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.7.62
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-widget-inner[data-alignment="center"]{text-align:center}.ct-widget-inner[data-alignment="right"]{text-align:right}.ct-widget-inner[data-container="boxed"]{padding:30px;background:#fff;border-radius:3px;box-shadow:0px 12px 18px -6px rgba(34,56,101,0.04)}.ct-mailchimp-widget-form .ct-mailchimp-description:not(:empty){margin-bottom:10px}.ct-mailchimp-widget-form>*:not(:first-child){margin-top:10px}.ct-mailchimp-widget-form button{width:100%}.ct-mailchimp-widget-form .gdpr-confirm-policy{--display: inline-flex;--contentSpacing: 0;margin-top:20px}.ct-mailchimp-block{margin-top:60px;text-align:center;color:var(--color);padding:var(--padding);background:var(--backgroundColor);box-shadow:var(--box-shadow);--linkInitialColor: var(--color)}.ct-mailchimp-block>*:first-child{margin-top:20px}.ct-mailchimp-block>*:last-child{margin-bottom:20px}.ct-mailchimp-block>h3{--fontSize: 25px}.ct-mailchimp-block .ct-mailchimp-description:not(:empty){margin-bottom:30px}.ct-mailchimp-block form{max-width:550px;margin:0 auto}@media (min-width: 690px){.ct-mailchimp-block form{width:85%}}.ct-mailchimp-block form button{--buttonMinHeight: var(--formInputHeight);--padding: 0 15px;width:100%}.ct-mailchimp-block form [data-fields]{display:grid;grid-column-gap:15px;grid-row-gap:15px}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="1"]{grid-template-columns:65% 1fr}}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="2"]{grid-template-columns:32.5% 32.5% 1fr}}.ct-mailchimp-block .ct-mailchimp-message,.ct-mailchimp-block .gdpr-confirm-policy{margin-top:15px;--contentSpacing: 0}form[class*="ct-mailchimp"] .button{--buttonFontWeight: 600}.ct-mailchimp-message{display:none;font-size:16px}.ct-mailchimp-message a{text-decoration:underline}.subscribe-error .ct-mailchimp-message{display:block;font-size:14px;color:#e42b2b}.subscribe-success button.button,.subscribe-success input[type="text"],.subscribe-success input[type="email"],.subscribe-success .gdpr-confirm-policy,.subscribe-success .ct-mailchimp-description{display:none}.subscribe-success .ct-mailchimp-message{display:block}
trunk/framework/extensions/mailchimp/static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=window.ctFrontend},function(e,t,r){"use strict";r.r(t);var n=r(0);function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Object(n.onDocumentLoaded)((function(){o(document.querySelectorAll(".ct-mailchimp-widget-form, .ct-mailchimp-block-form")).map((function(e){e.matches("[data-skip-submit]")||e.addEventListener("submit",(function(e){e.preventDefault();var t=e.target;if(t.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var r=t.action.replace("subscribe","subscribe/post-json"),n="",o="mailchimpCallback",i=t.querySelectorAll("input"),c=0;c<i.length;c++)n+="&"+i[c].name+"="+encodeURIComponent(i[c].value);n+="&c=".concat(o);var u=document.createElement("script");u.src=r+n,document.body.appendChild(u),t.classList.remove("subscribe-error","subscribe-success"),t.classList.add("subscribe-loading"),window[o]=function(e){delete window[o],document.body.removeChild(u),t.classList.remove("subscribe-loading"),e&&(t.classList.add("error"===e.result?"subscribe-error":"subscribe-success"),t.querySelector(".ct-mailchimp-message").innerHTML=e.msg.replace("0 - ",""))}}}))}))}))}]);
trunk/framework/extensions/mailchimp/static/js/main.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { onDocumentLoaded } from 'blocksy-frontend'
2
+
3
+ onDocumentLoaded(() => {
4
+ ;[
5
+ ...document.querySelectorAll(
6
+ '.ct-mailchimp-widget-form, .ct-mailchimp-block-form'
7
+ ),
8
+ ].map((el) => {
9
+ if (el.matches('[data-skip-submit]')) {
10
+ return
11
+ }
12
+
13
+ el.addEventListener('submit', (e) => {
14
+ e.preventDefault()
15
+ const form = e.target
16
+
17
+ if (!form.querySelector('[type="email"]').value.trim()) {
18
+ return
19
+ }
20
+
21
+ // Check for spam
22
+ if (
23
+ document.getElementById('js-validate-robot') &&
24
+ document.getElementById('js-validate-robot').value !== ''
25
+ ) {
26
+ return false
27
+ }
28
+
29
+ // Get url for mailchimp
30
+ var url = form.action.replace('subscribe', 'subscribe/post-json')
31
+
32
+ // Add form data to object
33
+ var data = ''
34
+
35
+ var callback = 'mailchimpCallback'
36
+
37
+ var inputs = form.querySelectorAll('input')
38
+
39
+ for (var i = 0; i < inputs.length; i++) {
40
+ data +=
41
+ '&' +
42
+ inputs[i].name +
43
+ '=' +
44
+ encodeURIComponent(inputs[i].value)
45
+ }
46
+
47
+ data += `&c=${callback}`
48
+
49
+ // Create & add post script to the DOM
50
+ var script = document.createElement('script')
51
+ script.src = url + data
52
+
53
+ document.body.appendChild(script)
54
+
55
+ form.classList.remove('subscribe-error', 'subscribe-success')
56
+ form.classList.add('subscribe-loading')
57
+
58
+ // Callback function
59
+ window[callback] = function (data) {
60
+ // Remove post script from the DOM
61
+ delete window[callback]
62
+ document.body.removeChild(script)
63
+
64
+ form.classList.remove('subscribe-loading')
65
+
66
+ if (!data) {
67
+ return
68
+ }
69
+
70
+ form.classList.add(
71
+ data.result === 'error'
72
+ ? 'subscribe-error'
73
+ : 'subscribe-success'
74
+ )
75
+
76
+ form.querySelector(
77
+ '.ct-mailchimp-message'
78
+ ).innerHTML = data.msg.replace('0 - ', '')
79
+ }
80
+ })
81
+ })
82
+ })
trunk/framework/extensions/mailchimp/static/sass/main.scss ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+ @import 'widget';
3
+ @import 'single-block';
4
+
5
+
6
+ form[class*="ct-mailchimp"] {
7
+ .button {
8
+ --buttonFontWeight: 600;
9
+ }
10
+ }
11
+
12
+ // form messages
13
+ .ct-mailchimp-message {
14
+ display: none;
15
+ font-size: 16px;
16
+
17
+ a {
18
+ text-decoration: underline;
19
+ }
20
+ }
21
+
22
+ .subscribe-error .ct-mailchimp-message {
23
+ display: block;
24
+ font-size: 14px;
25
+ color: #e42b2b;
26
+ }
27
+
28
+ .subscribe-success {
29
+ button.button,
30
+ input[type="text"],
31
+ input[type="email"],
32
+ .gdpr-confirm-policy,
33
+ .ct-mailchimp-description {
34
+ display: none;
35
+ }
36
+
37
+ .ct-mailchimp-message {
38
+ display: block;
39
+ }
40
+ }
trunk/framework/extensions/mailchimp/static/sass/single-block.scss ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-mailchimp-block {
2
+ margin-top: 60px;
3
+ text-align: center;
4
+ color: var(--color);
5
+ padding: var(--padding);
6
+ background: var(--backgroundColor);
7
+ box-shadow: var(--box-shadow);
8
+ --linkInitialColor: var(--color);
9
+
10
+ > * {
11
+ &:first-child {
12
+ margin-top: 20px;
13
+ }
14
+
15
+ &:last-child {
16
+ margin-bottom: 20px;
17
+ }
18
+ }
19
+
20
+ > h3 {
21
+ --fontSize: 25px;
22
+ }
23
+
24
+ .ct-mailchimp-description {
25
+ &:not(:empty) {
26
+ // margin-top: 10px;
27
+ margin-bottom: 30px;
28
+ }
29
+ }
30
+
31
+ form {
32
+ max-width: 550px;
33
+ margin: 0 auto;
34
+
35
+ @include media-breakpoint-up (md) {
36
+ width: 85%;
37
+ }
38
+
39
+ button {
40
+ --buttonMinHeight: var(--formInputHeight);
41
+ --padding: 0 15px;
42
+ width: 100%;
43
+ }
44
+
45
+ [data-fields] {
46
+ display: grid;
47
+ grid-column-gap: 15px;
48
+ grid-row-gap: 15px;
49
+ }
50
+
51
+ [data-fields="1"] {
52
+
53
+ @include media-breakpoint-up (md) {
54
+ grid-template-columns: 65% 1fr;
55
+ }
56
+ }
57
+
58
+ [data-fields="2"] {
59
+ @include media-breakpoint-up (md) {
60
+ grid-template-columns: 32.5% 32.5% 1fr;
61
+ }
62
+ }
63
+ }
64
+
65
+ .ct-mailchimp-message,
66
+ .gdpr-confirm-policy {
67
+ margin-top: 15px;
68
+ --contentSpacing: 0;
69
+ }
70
+ }
trunk/framework/extensions/mailchimp/static/sass/widget.scss ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-widget-inner {
2
+ &[data-alignment="center"] {
3
+ text-align: center;
4
+ }
5
+
6
+ &[data-alignment="right"] {
7
+ text-align: right;
8
+ }
9
+
10
+ &[data-container="boxed"] {
11
+ padding: 30px;
12
+ background: #fff;
13
+ border-radius: 3px;
14
+ box-shadow: 0px 12px 18px -6px rgba(34, 56, 101, 0.04);
15
+ }
16
+ }
17
+
18
+ .ct-mailchimp-widget-form {
19
+
20
+ .ct-mailchimp-description {
21
+ &:not(:empty) {
22
+ margin-bottom: 10px;
23
+ }
24
+ }
25
+
26
+ > *:not(:first-child) {
27
+ margin-top: 10px;
28
+ }
29
+
30
+ button {
31
+ width: 100%;
32
+ }
33
+
34
+ .gdpr-confirm-policy {
35
+ --display: inline-flex;
36
+ --contentSpacing: 0;
37
+ margin-top: 20px;
38
+ }
39
+ }
trunk/framework/extensions/product-reviews/config.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'name' => __('Product Reviews', 'blc'),
5
+ 'description' => __('A custom post type specially designed for creating product reviews.', 'blc'),
6
+ 'require_refresh' => true
7
+
8
+ // 'hidden' => true
9
+ ];
10
+
11
+
12
+
trunk/framework/extensions/product-reviews/extension.php ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . '/helpers.php';
4
+
5
+ class BlocksyExtensionProductReviews {
6
+ public function __construct() {
7
+ add_filter(
8
+ 'blocksy:options:cpt:page-title-args',
9
+ function ($args, $cpt) {
10
+ if ($cpt === 'blc-product-review') {
11
+ $args['has_hero_type'] = false;
12
+ }
13
+
14
+ return $args;
15
+ },
16
+ 10, 2
17
+ );
18
+
19
+ add_action('init', [$this, 'declare_cpt']);
20
+
21
+ add_action('load-post.php', [$this, 'init_metabox']);
22
+ add_action('load-post-new.php', [$this, 'init_metabox']);
23
+
24
+ add_filter('blocksy:single:has-default-hero', function ($def) {
25
+ if (! is_singular('blc-product-review')) {
26
+ return $def;
27
+ }
28
+
29
+ return false;
30
+ });
31
+
32
+ add_filter(
33
+ 'blocksy:hero:type-1:default-alignment',
34
+ function ($default, $prefix) {
35
+ if ($prefix === 'blc-product-review_single') {
36
+ return 'center';
37
+ }
38
+
39
+ return $default;
40
+ },
41
+ 10, 2
42
+ );
43
+
44
+ add_filter('blocksy:archive:render-card-layers', function ($layers, $prefix) {
45
+ if ($prefix !== 'blc-product-review_archive') {
46
+ return $layers;
47
+ }
48
+
49
+ $layers['overall_score'] = blocksy_get_product_review_overall_score();
50
+
51
+ return $layers;
52
+ }, 10, 2);
53
+
54
+ add_filter('blocksy:posts-listing:archive-order:default', function ($default, $prefix) {
55
+ if ($prefix !== 'blc-product-review_archive') {
56
+ return $default;
57
+ }
58
+
59
+ $default[] = [
60
+ 'id' => 'overall_score',
61
+ 'enabled' => true
62
+ ];
63
+
64
+ return $default;
65
+ }, 10, 2);
66
+
67
+ add_filter('blocksy:options:posts-listing-archive-order', function ($option, $prefix) {
68
+ if ($prefix !== 'blc-product-review_archive') {
69
+ return $option;
70
+ }
71
+
72
+ $option['value'][] = [
73
+ 'id' => 'overall_score',
74
+ 'enabled' => true
75
+ ];
76
+
77
+ $option['settings']['overall_score'] = [
78
+ 'label' => __('Overall Score', 'blocksy'),
79
+ /*
80
+ 'options' => [
81
+ 'excerpt_length' => [
82
+ 'label' => __('Length', 'blocksy'),
83
+ 'type' => 'ct-number',
84
+ 'design' => 'inline',
85
+ 'value' => 40,
86
+ 'min' => 10,
87
+ 'max' => 100,
88
+ ],
89
+ ],
90
+ */
91
+ ];
92
+
93
+ return $option;
94
+ }, 10, 2);
95
+
96
+ add_action(
97
+ 'blocksy:content:top',
98
+ function () {
99
+ if (! is_singular('blc-product-review')) {
100
+ return;
101
+ }
102
+
103
+ echo blc_call_fn(
104
+ ['fn' => 'blocksy_render_view'],
105
+ dirname(__FILE__) . '/views/single-top.php',
106
+ []
107
+ );
108
+ }
109
+ );
110
+
111
+ add_action('wp_enqueue_scripts', function () {
112
+ if (! function_exists('get_plugin_data')) {
113
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
114
+ }
115
+
116
+ $data = get_plugin_data(BLOCKSY__FILE__);
117
+
118
+ if (is_admin()) {
119
+ return;
120
+ }
121
+
122
+ wp_enqueue_style(
123
+ 'blocksy-ext-product-reviews-styles',
124
+ BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main.css',
125
+ ['ct-main-styles'],
126
+ $data['Version']
127
+ );
128
+ });
129
+ }
130
+
131
+ public function init_metabox() {
132
+ add_action('add_meta_boxes', [$this, 'setup_meta_box']);
133
+ add_action('save_post', [$this, 'save_meta_box']);
134
+ }
135
+
136
+ public function declare_cpt() {
137
+ $settings = $this->get_settings();
138
+
139
+ register_post_type('blc-product-review', [
140
+ 'label' => __('Product Reviews', 'blc'),
141
+ 'description' => __( 'Product Reviews', 'blc'),
142
+ 'menu_icon' => 'dashicons-star-filled',
143
+ 'labels' => [
144
+ 'name' => __('Product Reviews', 'blc'),
145
+ 'singular_name' => __('Product Review', 'blc'),
146
+ 'menu_name' => __('Product Reviews', 'blc'),
147
+ 'parent_item_colon' => __('Parent Product Review', 'blc'),
148
+ 'all_items' => __('All Reviews', 'blc'),
149
+ 'view_item' => __('View Product Review', 'blc'),
150
+ 'add_new_item' => __('Add New Product Review', 'blc'),
151
+ 'add_new' => __('Add New Review', 'blc'),
152
+ 'edit_item' => __('Edit Product Review', 'blc'),
153
+ 'update_item' => __('Update Product Review', 'blc'),
154
+ 'search_items' => __('Search Product Review', 'blc'),
155
+ 'not_found' => __('Not Found', 'blc'),
156
+ 'not_found_in_trash' => __('Not found in Trash', 'blc')
157
+ ],
158
+ 'supports' => [
159
+ 'comments',
160
+ 'title', 'editor', 'excerpt',
161
+ 'author', 'thumbnail', 'revisions',
162
+ 'custom-fields'
163
+ ],
164
+ 'show_in_rest' => true,
165
+ 'public' => true,
166
+ 'hierarchical' => false,
167
+ 'show_ui' => true,
168
+ 'show_in_menu' => true,
169
+ 'show_in_nav_menus' => true,
170
+ 'show_in_admin_bar' => true,
171
+ 'has_archive' => true,
172
+ 'can_export' => true,
173
+ 'exclude_from_search' => false,
174
+ // 'taxonomies' => array('post_tag'),
175
+ 'publicly_queryable' => true,
176
+ 'capability_type' => 'page',
177
+ 'rewrite' => [
178
+ 'slug' => $settings['single_slug']
179
+ ],
180
+ ]);
181
+
182
+ register_taxonomy(
183
+ 'blc-product-review-categories',
184
+ [
185
+ 'blc-product-review'
186
+ ],
187
+ [
188
+ 'hierarchical' => true,
189
+ 'labels' => [
190
+ 'name' => __('Categories', 'blc'),
191
+ 'singular_name' => __('Category', 'blc'),
192
+ 'search_items' => __('Search Category', 'blc'),
193
+ 'all_items' => __('All Categories', 'blc'),
194
+ 'parent_item' => __('Parent Category', 'blc'),
195
+ 'parent_item_colon' => __('Parent Category:', 'blc'),
196
+ 'edit_item' => __('Edit Category', 'blc'),
197
+ 'update_item' => __('Update Category', 'blc'),
198
+ 'add_new_item' => __('Add New Category', 'blc'),
199
+ 'new_item_name' => __('New Category Name', 'blc'),
200
+ 'menu_name' => __('Categories', 'blc'),
201
+ ],
202
+ 'show_ui' => true,
203
+ 'show_admin_column' => true,
204
+ 'query_var' => true,
205
+ 'show_in_rest' => true,
206
+ 'rewrite' => [
207
+ 'slug' => $settings['category_slug']
208
+ ],
209
+ ]
210
+ );
211
+ }
212
+
213
+ public function setup_meta_box() {
214
+ add_meta_box(
215
+ 'blocksy_settings_meta_box',
216
+ sprintf(
217
+ // Translators: %s is the theme name.
218
+ __( '%s Settings', 'blocksy' ),
219
+ __( 'Blocksy', 'blocksy' )
220
+ ),
221
+ function ($post) {
222
+ $values = get_post_meta($post->ID, 'blocksy_product_review_options');
223
+
224
+ if (empty($values)) {
225
+ $values = [[]];
226
+ }
227
+
228
+ $options = blc_call_fn(
229
+ ['fn' => 'blocksy_get_options'],
230
+ dirname(__FILE__) . '/metabox.php',
231
+ [],
232
+ false
233
+ );
234
+
235
+ /**
236
+ * Note to code reviewers: This line doesn't need to be escaped.
237
+ * Function blocksy_output_options_panel() used here escapes the value properly.
238
+ */
239
+ echo blocksy_output_options_panel(
240
+ [
241
+ 'options' => $options,
242
+ 'values' => $values[0],
243
+ 'id_prefix' => 'ct-post-meta-options',
244
+ 'name_prefix' => 'blocksy_product_review_options',
245
+ 'attr' => [
246
+ 'class' => 'ct-meta-box',
247
+ 'data-disable-reverse-button' => 'yes'
248
+ ]
249
+ ]
250
+ );
251
+
252
+ wp_nonce_field(basename(__FILE__), 'blocksy_settings_meta_box');
253
+ },
254
+ 'blc-product-review', 'normal', 'default'
255
+ );
256
+ }
257
+
258
+ public function save_meta_box($post_id) {
259
+ $is_autosave = wp_is_post_autosave($post_id);
260
+ $is_revision = wp_is_post_revision($post_id);
261
+ $is_valid_nonce = !! (
262
+ isset($_POST['blocksy_settings_meta_box']) && wp_verify_nonce(
263
+ sanitize_text_field(wp_unslash($_POST['blocksy_settings_meta_box'])),
264
+ basename(__FILE__)
265
+ )
266
+ );
267
+
268
+ if ($is_autosave || $is_revision || !$is_valid_nonce) {
269
+ return;
270
+ }
271
+
272
+ $values = [];
273
+
274
+ if (isset($_POST['blocksy_product_review_options'][blocksy_post_name()])) {
275
+ $values = json_decode(
276
+ wp_unslash($_POST['blocksy_product_review_options'][blocksy_post_name()]),
277
+ true
278
+ );
279
+ }
280
+
281
+ update_post_meta(
282
+ $post_id,
283
+ 'blocksy_product_review_options',
284
+ $values
285
+ );
286
+ }
287
+
288
+ public function get_settings() {
289
+ if (wp_doing_ajax()) {
290
+ $maybe_input = json_decode(file_get_contents('php://input'), true);
291
+
292
+ if (
293
+ $maybe_input
294
+ &&
295
+ isset($maybe_input['extension'])
296
+ &&
297
+ $maybe_input['extension'] === 'product-reviews'
298
+ &&
299
+ isset($maybe_input['extAction'])
300
+ &&
301
+ $maybe_input['extAction']['type'] === 'persist'
302
+ ) {
303
+ return $maybe_input['extAction']['settings'];
304
+ }
305
+ }
306
+
307
+ return get_option('blocksy_ext_product_reviews_settings', [
308
+ 'single_slug' => 'product-review',
309
+ 'category_slug' => 'product-review-category',
310
+ ]);
311
+ }
312
+
313
+ public function set_settings($value) {
314
+ update_option('blocksy_ext_product_reviews_settings', $value);
315
+ }
316
+ }
trunk/framework/extensions/product-reviews/helpers.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blocksy_get_product_review_overall_score($post_id = null) {
4
+ if (! $post_id) {
5
+ global $post;
6
+ $post_id = $post->ID;
7
+ }
8
+
9
+ $atts = blocksy_get_post_options($post_id, [
10
+ 'meta_id' => 'blocksy_product_review_options'
11
+ ]);
12
+
13
+ $scores = blocksy_akg('scores', $atts, []);
14
+
15
+ if (empty($scores)) {
16
+ return '';
17
+ }
18
+
19
+ $output = '<div class="ct-overall-score-layer">';
20
+
21
+ $avg_score = round(array_reduce($scores, function ($carry, $score) {
22
+ return $carry + intval($score['score']);
23
+ }, 0) / count($scores) * 2) / 2;
24
+
25
+ $output .= '<span class="ct-score-label">';
26
+ $output .= __('Rating', 'blc');
27
+ $output .= ':</span>';
28
+
29
+ $output .= '<span class="ct-average-score">' . $avg_score . '/5</span>';
30
+
31
+ $output .= '<div class="star-rating" role="img">';
32
+ $width = ( ( $avg_score / 5 ) * 100 );
33
+ $output .= '<span style="width: ' . $width . '%;"></span>';
34
+ $output .= '</div>';
35
+
36
+ $output .= '</div>';
37
+
38
+ return $output;
39
+ }
trunk/framework/extensions/product-reviews/metabox.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+
5
+ blocksy_rand_md5() => [
6
+ 'title' => __( 'General', 'blocksy' ),
7
+ 'type' => 'tab',
8
+ 'options' => [
9
+
10
+ 'gallery' => [
11
+ 'type' => 'ct-multi-image-uploader',
12
+ 'label' => __('Gallery', 'blc'),
13
+ 'design' => 'inline',
14
+ 'value' => []
15
+ ],
16
+
17
+ blocksy_rand_md5() => [
18
+ 'type' => 'ct-divider',
19
+ ],
20
+
21
+ 'product_button_label' => [
22
+ 'type' => 'text',
23
+ 'label' => __('Affiliate Button Label', 'blc'),
24
+ 'design' => 'inline',
25
+ 'value' => __('Buy Now', 'blc')
26
+ ],
27
+
28
+ 'product_link' => [
29
+ 'type' => 'text',
30
+ 'label' => __('Affiliate Link', 'blc'),
31
+ 'design' => 'inline',
32
+ 'value' => '#'
33
+ ],
34
+
35
+ /*
36
+ 'product_button_icon' => [
37
+ 'type' => 'icon-picker',
38
+ 'label' => __('Button Icon', 'blc'),
39
+ 'design' => 'inline',
40
+ 'value' => [
41
+ 'icon' => 'fas fa-shopping-cart'
42
+ ]
43
+ ],
44
+ */
45
+
46
+ blocksy_rand_md5() => [
47
+ 'type' => 'ct-divider',
48
+ ],
49
+
50
+ 'product_read_content_button_label' => [
51
+ 'type' => 'text',
52
+ 'label' => __('Read More Button Label', 'blc'),
53
+ 'design' => 'inline',
54
+ 'value' => __('Read More', 'blc')
55
+ ],
56
+
57
+ /*
58
+ 'product_read_content_button_icon' => [
59
+ 'type' => 'icon-picker',
60
+ 'label' => __('Button Icon', 'blc'),
61
+ 'design' => 'inline',
62
+ 'value' => [
63
+ 'icon' => 'fas fa-arrow-down'
64
+ ]
65
+ ],
66
+ */
67
+
68
+ blocksy_rand_md5() => [
69
+ 'type' => 'ct-divider',
70
+ ],
71
+
72
+ 'product_description' => [
73
+ 'type' => 'wp-editor',
74
+ 'label' => __('Small Description', 'blc'),
75
+ 'value' => '',
76
+ 'design' => 'inline',
77
+ ]
78
+
79
+ ],
80
+ ],
81
+
82
+ blocksy_rand_md5() => [
83
+ 'title' => __( 'Rating', 'blocksy' ),
84
+ 'type' => 'tab',
85
+ 'options' => [
86
+
87
+ 'scores' => [
88
+ 'type' => 'ct-addable-box',
89
+ 'label' => __('Scores', 'blc'),
90
+ 'design' => 'inline',
91
+ 'preview-template' => '<%= label %> (<%= score === 1 ? "1 star" : score + " stars" %>)',
92
+
93
+ 'inner-options' => [
94
+ 'label' => [
95
+ 'type' => 'text',
96
+ 'value' => 'Default'
97
+ ],
98
+
99
+ 'score' => [
100
+ 'type' => 'ct-number',
101
+ 'value' => 5,
102
+ 'min' => 1,
103
+ 'max' => 5
104
+ ]
105
+ ],
106
+
107
+ 'value' => [
108
+ /*
109
+ [
110
+ 'label' => 'Features',
111
+ 'score' => 5
112
+ ],
113
+
114
+ [
115
+ 'label' => 'Quality',
116
+ 'score' => 5
117
+ ]
118
+ */
119
+ ]
120
+ ],
121
+
122
+ blocksy_rand_md5() => [
123
+ 'type' => 'ct-divider',
124
+ ],
125
+
126
+ 'product_specs' => [
127
+ 'type' => 'ct-addable-box',
128
+ 'label' => __('Product specs', 'blc'),
129
+ 'design' => 'inline',
130
+ 'preview-template' => '<%= label %>',
131
+
132
+ 'inner-options' => [
133
+ 'label' => [
134
+ 'type' => 'text',
135
+ 'value' => 'Default'
136
+ ],
137
+
138
+ 'value' => [
139
+ 'type' => 'text',
140
+ 'value' => ''
141
+ ]
142
+ ],
143
+
144
+ 'value' => []
145
+ ],
146
+
147
+ blocksy_rand_md5() => [
148
+ 'type' => 'ct-divider',
149
+ ],
150
+
151
+ 'product_pros' => [
152
+ 'type' => 'ct-addable-box',
153
+ 'label' => __('Pros', 'blc'),
154
+ 'design' => 'inline',
155
+ 'preview-template' => '<%= label %>',
156
+
157
+ 'inner-options' => [
158
+ 'label' => [
159
+ 'type' => 'text',
160
+ 'value' => 'Default'
161
+ ],
162
+ ],
163
+
164
+ 'value' => []
165
+ ],
166
+
167
+ blocksy_rand_md5() => [
168
+ 'type' => 'ct-divider',
169
+ ],
170
+
171
+ 'product_cons' => [
172
+ 'type' => 'ct-addable-box',
173
+ 'label' => __('Cons', 'blc'),
174
+ 'design' => 'inline',
175
+ 'preview-template' => '<%= label %>',
176
+
177
+ 'inner-options' => [
178
+ 'label' => [
179
+ 'type' => 'text',
180
+ 'value' => 'Default'
181
+ ],
182
+ ],
183
+
184
+ 'value' => []
185
+ ],
186
+
187
+ ],
188
+ ],
189
+
190
+ // blocksy_rand_md5() => [
191
+ // 'title' => __( 'Design', 'blocksy' ),
192
+ // 'type' => 'tab',
193
+ // 'options' => [
194
+
195
+ // ],
196
+ // ],
197
+ ];
198
+
trunk/framework/extensions/product-reviews/pre-boot.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyExtensionProductReviewsPreBoot {
4
+ public function __construct() {
5
+ add_action('admin_enqueue_scripts', function () {
6
+ if (! function_exists('get_plugin_data')) {
7
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
8
+ }
9
+
10
+ $data = get_plugin_data(BLOCKSY__FILE__);
11
+
12
+ if (! function_exists('blocksy_is_dashboard_page')) return;
13
+ if (! blocksy_is_dashboard_page()) return;
14
+
15
+ wp_enqueue_script(
16
+ 'blocksy-ext-product-reviews-admin-dashboard-scripts',
17
+ BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/dashboard.js',
18
+ ['ct-options-scripts'],
19
+ $data['Version']
20
+ );
21
+
22
+ wp_enqueue_style(
23
+ 'blocksy-ext-product-reviews-admin-dashboard-styles',
24
+ BLOCKSY_URL . 'framework/extensions/product-reviews/static/bundle/main-admin.css',
25
+ [],
26
+ $data['Version']
27
+ );
28
+ });
29
+ }
30
+
31
+ public function ext_action($payload) {
32
+ $ext = \Blocksy\Plugin::instance()->extensions->get('product-reviews');
33
+
34
+ if (
35
+ ! isset($payload['type'])
36
+ ||
37
+ ! isset($payload['settings'])
38
+ ||
39
+ $payload['type'] !== 'persist'
40
+ ||
41
+ ! $ext
42
+ ) {
43
+ return;
44
+ }
45
+
46
+ $ext->set_settings($payload['settings']);
47
+
48
+ global $wp_rewrite;
49
+ $wp_rewrite->flush_rules();
50
+
51
+ return $this->ext_data([
52
+ 'settings' => $payload['settings']
53
+ ]);
54
+ }
55
+
56
+ public function ext_data($args = []) {
57
+ return wp_parse_args($args, [
58
+ 'settings' => get_option('blocksy_ext_product_reviews_settings', [
59
+ 'single_slug' => 'product-review',
60
+ 'category_slug' => 'product-review-category',
61
+ ])
62
+ ]);
63
+ }
64
+ }
65
+
trunk/framework/extensions/product-reviews/static/bundle/dashboard.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t,n){var r;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var c=a.apply(null,r);c&&e.push(c)}else if("object"===o)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.blocksyOptions},function(e,t){e.exports=window.ctEvents},function(e,t){e.exports=window.React},function(e,t,n){var r,a,o=n(10),c=n(11),i=(a=[],{activateTrap:function(e){if(a.length>0){var t=a[a.length-1];t!==e&&t.pause()}var n=a.indexOf(e);-1===n||a.splice(n,1),a.push(e)},deactivateTrap:function(e){var t=a.indexOf(e);-1!==t&&a.splice(t,1),a.length>0&&a[a.length-1].unpause()}});function u(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,a="string"==typeof e?n.querySelector(e):e,s=c({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},f={activate:function(e){if(l.active)return;j(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:s.onActivate;t&&t();return d(),f},deactivate:p,pause:function(){if(l.paused||!l.active)return;l.paused=!0,m()},unpause:function(){if(!l.paused||!l.active)return;l.paused=!1,j(),d()}};return f;function p(e){if(l.active){clearTimeout(r),m(),l.active=!1,l.paused=!1,i.deactivateTrap(f);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:s.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:s.returnFocusOnDeactivate)&&u((function(){var e;w((e=l.nodeFocusedBeforeActivation,v("setReturnFocus")||e))})),f}}function d(){if(l.active)return i.activateTrap(f),r=u((function(){w(b())})),n.addEventListener("focusin",h,!0),n.addEventListener("mousedown",y,{capture:!0,passive:!1}),n.addEventListener("touchstart",y,{capture:!0,passive:!1}),n.addEventListener("click",O,{capture:!0,passive:!1}),n.addEventListener("keydown",g,{capture:!0,passive:!1}),f}function m(){if(l.active)return n.removeEventListener("focusin",h,!0),n.removeEventListener("mousedown",y,!0),n.removeEventListener("touchstart",y,!0),n.removeEventListener("click",O,!0),n.removeEventListener("keydown",g,!0),f}function v(e){var t=s[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function b(){var e;if(!(e=null!==v("initialFocus")?v("initialFocus"):a.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||v("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return e}function y(e){a.contains(e.target)||(s.clickOutsideDeactivates?p({returnFocus:!o.isFocusable(e.target)}):s.allowOutsideClick&&s.allowOutsideClick(e)||e.preventDefault())}function h(e){a.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),w(l.mostRecentlyFocusedNode||b()))}function g(e){if(!1!==s.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void p();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(j(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void w(l.lastTabbableNode);if(!e.shiftKey&&e.target===l.lastTabbableNode)e.preventDefault(),w(l.firstTabbableNode)}(e)}function O(e){s.clickOutsideDeactivates||a.contains(e.target)||s.allowOutsideClick&&s.allowOutsideClick(e)||(e.preventDefault(),e.stopImmediatePropagation())}function j(){var e=o(a);l.firstTabbableNode=e[0]||b(),l.lastTabbableNode=e[e.length-1]||b()}function w(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):w(b()))}}},function(e,t,n){e.exports=n(8)()},function(e,t,n){"use strict";var r=n(9);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,c){if(c!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],r=n.join(","),a="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function o(e,t){t=t||{};var n,o,i,u=[],f=[],p=e.querySelectorAll(r);for(t.includeContainer&&a.call(e,r)&&(p=Array.prototype.slice.apply(p)).unshift(e),n=0;n<p.length;n++)c(o=p[n])&&(0===(i=s(o))?u.push(o):f.push({documentOrder:n,tabIndex:i,node:o}));return f.sort(l).map((function(e){return e.node})).concat(u)}function c(e){return!(!i(e)||function(e){return function(e){return f(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||s(e)<0)}function i(e){return!(e.disabled||function(e){return f(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}o.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==a.call(e,r)&&c(e)},o.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==a.call(e,u)&&i(e)};var u=n.concat("iframe").join(",");function s(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function l(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function f(e){return"INPUT"===e.tagName}e.exports=o},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var a in r)n.call(r,a)&&(e[a]=r[a])}return e};var n=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(1),o=n(2),c=n.n(o),i=n(4),u=n.n(i),s=n(3),l=n(5),f=n.n(l);n(7);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var m=function(e){e.initialState,e.getInitialState,e.refs,e.getRefs,e.didMount,e.didUpdate,e.willUnmount,e.getSnapshotBeforeUpdate,e.shouldUpdate,e.render;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},v=function(e){function t(){var n,r;p(this,t);for(var a=arguments.length,o=Array(a),c=0;c<a;c++)o[c]=arguments[c];return n=r=d(this,e.call.apply(e,[this].concat(o))),b.call(r),d(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getArgs=function(){var e=this.state,t=this.props,n=this._setState,r=this._forceUpdate,a=this._refs;return{state:e,props:m(t),refs:a,setState:n,forceUpdate:r}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:m(e),nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:m(this.props),refs:this._refs})},t.prototype.componentDidUpdate=function(e,t,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t}),n)},t.prototype.getSnapshotBeforeUpdate=function(e,t){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t})):null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return n?n(this.getArgs()):"function"==typeof t?t(this.getArgs()):t||null},t}(f.a.Component);v.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var b=function(){var e=this;this.state=this.props.initialState||this.props.getInitialState(this.props),this._refs=this.props.refs||this.props.getRefs(this.getArgs()),this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},y=v,h=function(e){var t=e.children,n=e.container,a=void 0===n?document.body:n,o=e.type,c=void 0===o?"reach-portal":o;return Object(r.createElement)(y,{getRefs:function(){return{node:null}},didMount:function(e){var t=e.refs,n=e.forceUpdate,r=a.hasOwnProperty("current")?a.current:a;t.node=document.createElement(c),r.appendChild(t.node),n()},willUnmount:function(e){var t=e.refs.node,n=a.hasOwnProperty("current")?a.current:a;n&&n.removeChild(t)},render:function(e){var n=e.refs.node;return n?Object(r.createPortal)(t,n):null}})};var g=function(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}},O=n(6),j=n.n(O);function w(){return(w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var S=function(){},x=function(){},_=function(e,t){var n,r,a;e.disposeAriaHider=(n=e.overlayNode,r=[],a=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),(function(e){if(e!==n.parentNode){var t=e.getAttribute("aria-hidden");null!==t&&"false"!==t||(r.push(t),a.push(e),e.setAttribute("aria-hidden","true"))}})),function(){a.forEach((function(e,t){var n=r[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)}))}),e.trap=j()(e.overlayNode,{initialFocus:t?function(){return t.current}:void 0,fallbackFocus:e.contentNode,escapeDeactivates:!1,clickOutsideDeactivates:!1})},A=function(e){var t=e.refs;t.trap.deactivate(),t.disposeAriaHider()},z=React.createContext(),C=React.forwardRef((function(e,t){var n=e.container,a=e.isOpen,o=void 0===a||a,c=e.onDismiss,i=void 0===c?S:c,u=e.initialFocusRef,s=e.onClick,l=e.onKeyDown,f=E(e,["container","isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return Object(r.createElement)(y,{didMount:x},o?Object(r.createElement)(h,{container:n,"data-reach-dialog-wrapper":!0},Object(r.createElement)(y,{refs:{overlayNode:null,contentNode:null},didMount:function(e){var t=e.refs;_(t,u)},willUnmount:A},(function(e){var n=e.refs;return Object(r.createElement)(z.Provider,{value:function(e){return n.contentNode=e}},Object(r.createElement)("div",w({"data-reach-dialog-overlay":!0,onClick:g(s,(function(e){e.stopPropagation(),i()})),onKeyDown:g(l,(function(e){"Escape"===e.key&&(e.stopPropagation(),i())})),ref:function(e){n.overlayNode=e,t&&t(e)}},f)))}))):null)}));C.propTypes={initialFocusRef:function(){}};var N=function(e){return e.stopPropagation()},P=React.forwardRef((function(e,t){var n=e.onClick,a=(e.onKeyDown,E(e,["onClick","onKeyDown"]));return Object(r.createElement)(z.Consumer,null,(function(e){return Object(r.createElement)("div",w({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:g(n,N),ref:function(n){e(n),t&&t(n)}},a))}))})),k=function(e){return!!e},D=function(e){var t=e.items,n=e.isVisible,a=void 0===n?k:n,o=e.render,i=e.className,u=e.onDismiss;return Object(r.createElement)(s.Transition,{items:t,onStart:function(){return document.body.classList[a(t)?"add":"remove"]("ct-dashboard-overlay-open")},config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},(function(e){return a(e)&&function(t){return Object(r.createElement)(C,{style:{opacity:t.opacity},container:document.querySelector("#wpbody"),onDismiss:function(){return u()}},Object(r.createElement)(P,{className:c()("ct-admin-modal",i),style:{transform:"translate3d(0px, ".concat(t.y,"px, 0px)")}},Object(r.createElement)("button",{className:"close-button",onClick:function(){return u()}},"×"),o(e,t)))}}))};function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F=function(e){var t=e.extsSyncLoading,n=e.extensionData,o=e.onExtsSync,i=I(Object(r.useState)(!1),2),u=i[0],l=i[1],f=I(Object(r.useState)(null),2),p=f[0],d=f[1];return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("button",{className:"ct-button ct-config-btn","data-button":"white",onClick:function(){l(!0),d(n.settings)}},Object(a.__)("Configure","blc")),Object(r.createElement)(D,{items:u,onDismiss:function(){return l(!1)},className:"ct-product-reviews-settings-modal",render:function(){return Object(r.createElement)("div",{className:c()("ct-modal-content")},Object(r.createElement)("h2",null,Object(a.__)("Product Reviews Settings","blc")),Object(r.createElement)("p",{className:"ct-modal-description"},Object(a.__)("Configure the slugs for single and category pages of the product review custom post type.","blc")),Object(r.createElement)("div",{className:"ct-controls-group"},Object(r.createElement)("section",{"data-columns":"medium:2"},Object(r.createElement)(s.OptionsPanel,{onChange:function(e,t){return d((function(n){return T(T({},n),{},U({},e,t))}))},options:{single_slug:{type:"text",value:"",label:Object(a.__)("Single Slug","blc")},category_slug:{type:"text",value:"",label:Object(a.__)("Category Slug","blc")}},value:p||{},hasRevertButton:!1}))),Object(r.createElement)("div",{className:"ct-modal-actions has-divider"},Object(r.createElement)("button",{className:"button-primary",disabled:t||!p,onClick:function(e){e.preventDefault(),p&&(o({extAction:{type:"persist",settings:p}}),l(!1))}},t?Object(r.createElement)("svg",{width:"15",height:"15",viewBox:"0 0 100 100"},Object(r.createElement)("g",{transform:"translate(50,50)"},Object(r.createElement)("g",{transform:"scale(1)"},Object(r.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"#687c93"}),Object(r.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"#ffffff",transform:"rotate(161.634)"},Object(r.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))))):Object(a.__)("Save","blc"))))}}))};function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var q=function(e){var t=L(Object(r.useState)(!1),2),n=t[0],a=t[1];return[function(){return a(!0)},Object(r.createElement)(D,{items:n,onDismiss:function(){return a(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content",dangerouslySetInnerHTML:{__html:e.readme}})}})]};function K(e,t,n,r,a,o,c){try{var i=e[o](c),u=i.value}catch(e){return void n(e)}i.done?t(u):Promise.resolve(u).then(r,a)}function V(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){K(o,r,a,c,i,"next",e)}function i(e){K(o,r,a,c,i,"throw",e)}c(void 0)}))}}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=Object(r.useState)(!1),o=H(n,2),c=o[0],i=o[1],u=Object(r.useState)(!1),s=H(u,2),l=s[0],f=s[1],p=ctDashboardLocalizations.plugin_data.is_pro,d=function(){var n=V(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(p||!e.config.pro){n.next=3;break}return f(!0),n.abrupt("return");case 3:return(r=new FormData).append("ext",e.name),r.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),i(!0),n.prev=7,n.next=10,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:r});case 10:e.config.require_refresh&&location.reload(),t(),n.next=16;break;case 14:n.prev=14,n.t0=n.catch(7);case 16:i(!1);case 17:case"end":return n.stop()}}),n,null,[[7,14]])})));return function(){return n.apply(this,arguments)}}();return[c,d,!p&&e.config.pro?Object(r.createElement)(D,{items:l,onDismiss:function(){return f(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-activation-action-modal"},Object(r.createElement)("svg",{viewBox:"0 0 59.99 60"},Object(r.createElement)("path",{d:"M14.41 43.65c0 .13.08.27.11.41a5.91 5.91 0 010 2.37c-1.78 1.14-3.2 1.19-4.34.68-2.83-1.27-3.81-6-3.81-6s.38-.08 1-.15a6.08 6.08 0 012.64.91 4.17 4.17 0 01-.22-1 6.47 6.47 0 013.2 1 8.14 8.14 0 01.35-5 12.74 12.74 0 01.65-1.62s8.51 4.32 3 9.27a5.81 5.81 0 01-2.34-.68 2 2 0 01-.24-.19zM7.17 15.93q.2.22.42.45a5.74 5.74 0 002.68-.74 5.51 5.51 0 00-.28 2.76 6.79 6.79 0 001.47.81c5 1.94 6.91-5.79 6.91-5.79a13.35 13.35 0 00-4.5-.26 5.64 5.64 0 00-2.15.72 4.42 4.42 0 00.23-.81c.51-2.62-.94-5.82-.94-5.82a13.76 13.76 0 00-2.44 1.51c-2 1.51-4 4-1.53 7a.65.65 0 00.13.17zm.93 16.56a6.7 6.7 0 00.84.76c7.28-1.28 2.36-9.46 2.36-9.46a14.28 14.28 0 00-2.18 1.69 7.39 7.39 0 00-2.13 3.35v-1.19a5.49 5.49 0 00-1.27-1.71 12.75 12.75 0 00-3.94-2.44 13.32 13.32 0 00-.39 1.37c-.49 2-.91 5.69 1.85 7a4.83 4.83 0 001.75.46 8.25 8.25 0 00.86 0 6.45 6.45 0 001.14-1.76 4.41 4.41 0 001.11 1.93zM18.79 9.27c6 1.85 8.82-7.61 8.82-7.61a17.44 17.44 0 00-6.1-.58c-2.92.35-5.71 1.92-5.33 6.76a8.42 8.42 0 002.61 1.43zM49.6 40.93a6.08 6.08 0 00-2.64.91 4.21 4.21 0 00.22-1 11.57 11.57 0 00-1.19-5.59 13.88 13.88 0 00-2.36 1.58c-1.87 1.58-3.82 4.16-1.33 7 .06.08.13.15.2.23s.29.3.46.45a5.69 5.69 0 002.65-.86 5.82 5.82 0 00-.14 2.78 6.75 6.75 0 001.34.68c5.16 1.94 6.81-6 6.81-6a13.28 13.28 0 00-4.02-.18zm-6.49-27.77a10.69 10.69 0 00-1.5.26s1.15 4.53 3.91 5.79c1.18.54 2.66.47 4.47-.81a5.88 5.88 0 00-.16-2.47 1.42 1.42 0 00-.1-.29l.23.13a6 6 0 002.45.61c5.24-5.19-3.42-9.13-3.42-9.13a13.57 13.57 0 00-.54 1.51 8.37 8.37 0 00-.17 5.12 6.62 6.62 0 00-3.29-.81 12.09 12.09 0 00-1.88.09zm15.13 10.33a13.53 13.53 0 00-2.61 1.37 7.1 7.1 0 00-2.64 2.78v1.18a6.69 6.69 0 00-1.73-2.89 13.85 13.85 0 00-2.62-2.14 13.17 13.17 0 00-.82 1.69c-.83 2-1.65 5.4 1 7a6.4 6.4 0 002.16.76 7.35 7.35 0 001-.93 4.26 4.26 0 001-1.76 6.06 6.06 0 00.76 1.3 6.25 6.25 0 00.4.5c7.43.09 4.1-8.86 4.1-8.86zM38.19 9.27c1.55.52 3.41.27 5.61-1.43.51-6.56-4.81-7.11-8.33-6.76a19.24 19.24 0 00-3.1.58S34.25 8 38.19 9.27zM41.99 54h-3v-6a2 2 0 00-2-2h-14a2 2 0 00-2 2v6h-3a2 2 0 00-2 2v3h28v-3a2 2 0 00-2-2zM25.76 21.65l-5.77.84a1 1 0 00-.81.68 1 1 0 00.26 1l4.19 4.11a1 1 0 01.28.88l-.92 5.44-.07.4a1 1 0 00.4 1 1 1 0 001.06.07l3.55-1.88 1.6-.85a1 1 0 01.94 0l2.4 1.27 2.75 1.46a1 1 0 001.05-.07 1 1 0 00.4-1l-1-5.81a1 1 0 01.28-.88l4.19-4.11a1 1 0 00.26-1 1 1 0 00-.81-.68l-5.78-.84a1 1 0 01-.75-.55l-2.57-5.3a1 1 0 00-1.8 0l-1.17 2.39-1.41 2.88a1 1 0 01-.75.55z",fill:"#ffa800"}),Object(r.createElement)("path",{d:"M19.99 22.49l5.78-.84a1 1 0 00.75-.55l1.41-2.88 1.41 2.88a1 1 0 00.75.55l5.78.84a1 1 0 01.56 1.71l-4.19 4.11a1 1 0 00-.29.88l.92 5.4-2.4-1.27a1 1 0 00-.94 0l-1.6.85-1.6-.85a1 1 0 00-.93 0l-2.41 1.28.92-5.41a1 1 0 00-.28-.88l-4.2-4.11a1 1 0 01-.26-1 1 1 0 01.82-.71zm-13 8.07a4.41 4.41 0 001.14 1.93c2.67-1.61 1.85-5 1-7a7.39 7.39 0 00-2.14 3.34 3.49 3.49 0 000 1.7zm11.8-21.29c3.94-1.27 5.82-7.61 5.82-7.61a19.24 19.24 0 00-3.1-.58c-2.92.35-5.71 1.92-5.33 6.76a8.42 8.42 0 002.61 1.43zm-7.31 9.94c2.76-1.26 3.91-5.79 3.91-5.79a10.69 10.69 0 00-1.5-.26 12.35 12.35 0 00-1.9-.09 4.42 4.42 0 01-.23.81 3.48 3.48 0 00-1.46 1.75 5.51 5.51 0 00-.31 2.77 6.79 6.79 0 001.49.81zm37.4 13.28a4.41 4.41 0 001.11-1.93 3.57 3.57 0 000-1.72 7.31 7.31 0 00-2.17-3.34c-.83 2.02-1.61 5.38 1.06 6.99zM45.5 19.21a6.79 6.79 0 001.49-.81 5.51 5.51 0 00-.26-2.76 3.53 3.53 0 00-1.46-1.75 5.79 5.79 0 00-2.13-.72 10.69 10.69 0 00-1.5.26s1.1 4.57 3.86 5.78zm-7.31-9.94a8.42 8.42 0 002.61-1.43c.38-4.84-2.41-6.41-5.33-6.76a19.24 19.24 0 00-3.1.58S34.25 8 38.19 9.27zm8.8 32.57l-1.4 1.8a5.82 5.82 0 00-.14 2.78 6.75 6.75 0 001.34.68c2.83-1.27 3.81-6 3.81-6s-.38-.08-1-.15a6.08 6.08 0 00-2.61.89zm1.42-33.08a8.37 8.37 0 00-.17 5.12l1.46 1.75a1.42 1.42 0 01.1.29.65.65 0 00.13-.16c2.48-2.97.44-5.49-1.52-7zm-6.15 35.08a1.92 1.92 0 00.31-.18 3.55 3.55 0 001.42-1.79 8.1 8.1 0 00-.35-5c-1.92 1.54-3.87 4.13-1.38 6.97zm13.37-19a7.1 7.1 0 00-2.64 2.8v2.91a6.06 6.06 0 00.76 1.3c2.79-1.3 2.37-4.98 1.88-6.99zM11.41 43.65l-1.34-1.75a6.08 6.08 0 00-2.64-.91c-.6.07-1 .15-1 .15s1 4.77 3.81 6a6.75 6.75 0 001.34-.68 5.82 5.82 0 00-.14-2.78zM38.99 54h-3v-6a2 2 0 00-2-2h-11a2 2 0 00-2 2v6h-3a2 2 0 00-2 2v3h25v-3a2 2 0 00-2-2zm-25.6-17.17a8.14 8.14 0 00-.35 5 3.45 3.45 0 001.31 1.72h.05c0 .13.08.27.11.41.07-.08.14-.15.2-.23 2.5-2.73.55-5.32-1.32-6.9z",fill:"#fedd0a"}),Object(r.createElement)("path",{d:"M16.18 7.84C15.8 3 18.59 1.43 21.51 1.08a14.84 14.84 0 013 0C21.6 1.44 18.82 3 19.2 7.84a8.42 8.42 0 002.59 1.43 4.81 4.81 0 01-3 0 8.42 8.42 0 01-2.61-1.43zm-7.61.92c-2 1.51-4 4-1.53 7a.65.65 0 00.13.16q.2.22.42.45a5.91 5.91 0 002.4-.61c-2.45-3-.42-5.49 1.54-7a13.57 13.57 0 00-.54-1.51 13.76 13.76 0 00-2.42 1.51zM15.99 56v3h3v-3a2 2 0 012-2h-3a2 2 0 00-2 2zm7-10a2 2 0 00-2 2v6h3v-6a2 2 0 012-2zM4.35 24.86a13.53 13.53 0 00-2.61-1.37 13.32 13.32 0 00-.39 1.37c-.49 2-.91 5.69 1.85 7a4.83 4.83 0 001.79.46 8.25 8.25 0 00.86 0 5.84 5.84 0 00.4-.5c-2.81-1.27-2.39-4.95-1.9-6.96z",fill:"#fff"}),Object(r.createElement)("path",{d:"M59.18 23.14a1 1 0 00-1.29-.59 14.74 14.74 0 00-3.85 2.26 24.35 24.35 0 00-.45-3.4 23.39 23.39 0 00-1.21-4 1 1 0 00.71-.29 5.42 5.42 0 001.9-4.91c-.64-3.56-5.44-5.78-5.65-5.87a1 1 0 00-1.32.5 14.57 14.57 0 00-.85 2.6 26.55 26.55 0 00-2.37-2.12 6.66 6.66 0 00-2.23-5.7C38.99-1.31 32.36.61 32.08.7a1 1 0 00-.59.48 1 1 0 00-.08.76c.08.28 2.09 6.87 6.51 8.3a5.84 5.84 0 001.74.27 7.41 7.41 0 004.15-1.44 22.7 22.7 0 013.1 3 1.48 1.48 0 000 .21 13.38 13.38 0 00-5.58.15 1 1 0 00-.72 1.21c.06.22 1.39 5.34 4.79 6.59a4.42 4.42 0 001.55.28 6.3 6.3 0 003.59-1.31 1.2 1.2 0 00.26-.29 22.46 22.46 0 01.82 2.88 21.37 21.37 0 01.43 3.47 15 15 0 00-2.86-2.35 1 1 0 00-1.38.34c-.11.2-2.81 4.75-1.3 8a5.31 5.31 0 004.07 2.87c-.08.21-.15.42-.24.63a21.75 21.75 0 01-2.25 4 14.51 14.51 0 00-1.26-4 1 1 0 00-.58-.5 1 1 0 00-.76.06c-.2.1-4.9 2.53-5.38 6.11a5.19 5.19 0 001.7 4.37 22.47 22.47 0 01-2.46 1.34A3 3 0 0036.99 45h-6V34.73l4.15 2.2a2.1 2.1 0 00.94.23 2 2 0 002-2.33l-1-5.81 4.2-4.11a2 2 0 00-1.12-3.4l-5.78-.85-2.59-5.26a2 2 0 00-3.6 0l-2.58 5.26-5.77.85a2 2 0 00-1.11 3.4L22.92 29l-1 5.81a2 2 0 00.8 1.94 2 2 0 002.11.15l4.16-2.17V45h-6a3 3 0 00-2.37 1.18 21 21 0 01-2.46-1.35 5.16 5.16 0 001.7-4.36c-.48-3.58-5.18-6-5.38-6.11a1 1 0 00-.76-.06 1 1 0 00-.58.5 14.38 14.38 0 00-1.26 4 21.11 21.11 0 01-2.25-4c-.09-.21-.16-.42-.24-.64a5.26 5.26 0 004.07-2.86c1.51-3.29-1.19-7.84-1.3-8a1 1 0 00-1.38-.34 15 15 0 00-2.86 2.35 21.37 21.37 0 01.43-3.47 22.46 22.46 0 01.82-2.88 1.2 1.2 0 00.26.29 6.3 6.3 0 003.56 1.28 4.42 4.42 0 001.55-.28c3.4-1.25 4.73-6.37 4.79-6.59a1 1 0 00-.72-1.21 13.57 13.57 0 00-5.58-.15 1.48 1.48 0 000-.21 22.7 22.7 0 013.1-3 7.39 7.39 0 004.15 1.44 5.73 5.73 0 001.73-.27c4.43-1.43 6.44-8 6.52-8.3a1 1 0 00-.08-.76 1 1 0 00-.55-.5c-.28-.09-6.89-2-10.51.92a6.66 6.66 0 00-2.23 5.7 26.55 26.55 0 00-2.37 2.12 14.57 14.57 0 00-.8-2.6 1 1 0 00-1.32-.5c-.2.09-5 2.31-5.65 5.87a5.42 5.42 0 001.91 4.88 1 1 0 00.71.29 23.65 23.65 0 00-1.21 4 24.35 24.35 0 00-.44 3.43 14.74 14.74 0 00-3.9-2.26 1 1 0 00-1.29.59c-.08.21-1.89 5.18.19 8.14a5.37 5.37 0 004.71 2.08h.11a1 1 0 00.73-.36c.09-.1.16-.22.25-.33a24.67 24.67 0 001 2.89 23.67 23.67 0 002.4 4.32 14.22 14.22 0 00-4 .19 1 1 0 00-.77 1.18c0 .22 1.15 5.4 4.49 6.8a4.41 4.41 0 001.75.35 6.4 6.4 0 003.43-1.15 1 1 0 00.44-.64 6.59 6.59 0 00.11-1.08l.84.59a23 23 0 003.51 1.97V53h-2a3 3 0 00-3 3v3a1 1 0 001 1h28a1 1 0 001-1v-3a3 3 0 00-3-3h-2v-4.91a23 23 0 003.51-1.94c.29-.19.56-.41.84-.62a7 7 0 00.11 1.11 1 1 0 00.44.64 6.4 6.4 0 003.43 1.15 4.41 4.41 0 001.75-.35c3.34-1.4 4.45-6.58 4.49-6.8a1 1 0 00-.77-1.18 14.22 14.22 0 00-4-.19 23.67 23.67 0 002.4-4.32 24.67 24.67 0 001-2.89c.09.11.16.23.25.33a1 1 0 00.73.33h.11a5.37 5.37 0 004.71-2.08c2.08-2.96.27-7.93.19-8.14zM38.65 6a22.22 22.22 0 013.4 1.82 4.32 4.32 0 01-3.51.53c-2.55-.82-4.18-4.24-4.86-6 1.81-.38 5.57-.88 7.65.81a4.12 4.12 0 011.42 2.71 23.48 23.48 0 00-3.33-1.75 1 1 0 00-1.31.53A1 1 0 0038.65 6zm-20-2.8c2.08-1.71 5.84-1.2 7.65-.83-.68 1.72-2.31 5.14-4.86 6a4.32 4.32 0 01-3.51-.53A22.22 22.22 0 0121.33 6a1 1 0 00.54-1.31 1 1 0 00-1.31-.53 24 24 0 00-3.33 1.75 4.12 4.12 0 011.42-2.73zM5.92 30.41a5.66 5.66 0 01-.58.94 3.27 3.27 0 01-2.71-1.21c-1-1.37-.65-3.75-.26-5.28a8.32 8.32 0 013.62 3.05v.61a4.45 4.45 0 00-.15.9 4.12 4.12 0 00.08.99zm6-15.39c1.25-1.11 3.66-1 5.21-.83-.55 1.47-1.64 3.61-3.21 4.18a3.23 3.23 0 01-2.93-.54 3.27 3.27 0 01.89-2.83zm-4.93-2.45c.29-1.65 2.21-3.11 3.56-3.91a8.35 8.35 0 01.38 4.61 3.81 3.81 0 00-.32.24 4.52 4.52 0 00-1.05 1.37 3.53 3.53 0 01-.56.25h-.01a4.51 4.51 0 01-.95.22 3.26 3.26 0 01-1.05-2.78zm.91 17c.09-1.7 1.78-3.37 3.09-4.32.66 1.42 1.4 3.7.7 5.23a3.23 3.23 0 01-2.43 1.69 3.25 3.25 0 01-1.41-2.63zm5.78 16.29a3.26 3.26 0 01-2.94.41c-1.55-.65-2.55-2.84-3-4.34a8.39 8.39 0 014.58.65 2.92 2.92 0 00.17.36 4.51 4.51 0 001.1 1.32 4.53 4.53 0 01.04 1.57zm3.08-2.36a5 5 0 01-.85-.21h-.08A2.84 2.84 0 0114.16 42c-.8-1.46-.22-3.8.34-5.27 1.32.86 3.16 2.4 3.38 4.06a3.28 3.28 0 01-1.17 2.68zm7.19-8.3l1-5.8a2 2 0 00-.57-1.77l-4.19-4.11 5.77-.85a2 2 0 001.51-1.1l2.52-5.3 2.58 5.27a2 2 0 001.51 1.1l5.77.84-4.19 4.12a2 2 0 00-.57 1.76l1 5.8-5.15-2.73a2 2 0 00-1.88 0zM21.99 48a1 1 0 011-1h14a1 1 0 011 1v5h-16zm20 7a1 1 0 011 1v2h-26v-2a1 1 0 011-1h24zm3.83-13a2.84 2.84 0 01-1.62 1.28h-.07a6.37 6.37 0 01-.86.21 3.28 3.28 0 01-1.17-2.73c.22-1.66 2.06-3.2 3.38-4.06.56 1.45 1.14 3.79.34 5.3zm6.5-.05c-.48 1.5-1.48 3.69-3 4.34a3.26 3.26 0 01-2.94-.41 4.53 4.53 0 01.12-1.6 4.51 4.51 0 001.1-1.32c.07-.12.11-.24.17-.36a8.39 8.39 0 014.55-.7zM46.1 18.37c-1.57-.57-2.66-2.71-3.21-4.18 1.55-.22 4-.28 5.21.83a3.27 3.27 0 01.89 2.81 3.26 3.26 0 01-2.89.54zm4.67 13.8a3.23 3.23 0 01-2.43-1.69c-.7-1.52 0-3.8.71-5.23 1.25.95 3 2.62 3.08 4.29a3.25 3.25 0 01-1.36 2.63zm1.22-16.82a4.75 4.75 0 01-1-.22 3.87 3.87 0 01-.55-.25 4.52 4.52 0 00-1-1.37 3.81 3.81 0 00-.32-.24 8.45 8.45 0 01.38-4.61c1.35.8 3.27 2.25 3.56 3.9a3.27 3.27 0 01-1.07 2.79zm5.36 14.79a3.27 3.27 0 01-2.71 1.21 5.66 5.66 0 01-.58-.94 4.09 4.09 0 00.06-1 5.28 5.28 0 00-.15-.9v-.6a8.37 8.37 0 013.6-3.06c.42 1.54.74 3.92-.22 5.29zM33.99 50a1 1 0 01-1 1h-6a1 1 0 010-2h6a1 1 0 011 1z"})),Object(r.createElement)("h2",null,"Upgrade to Pro"),Object(r.createElement)("p",null,Object(a.__)("Upgrade to the Pro version and get instant full access to all premium extensions and features.","blc")),Object(r.createElement)("button",{className:"ct-button-primary"},Object(a.__)("Upgrade Now","blc")))}}):null]};function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var J=function(e){var t=e.extsSyncLoading,n=e.extension,o=e.onExtsSync,i=Y($(n,(function(){return o()})),2),u=i[0],s=i[1],l=Y(q(n),2),f=l[0],p=l[1];return Object(r.createElement)("li",{className:c()({active:!!n.__object})},Object(r.createElement)("h4",{className:"ct-extension-title"},n.config.name,u&&Object(r.createElement)("svg",{width:"15",height:"15",viewBox:"0 0 100 100"},Object(r.createElement)("g",{transform:"translate(50,50)"},Object(r.createElement)("g",{transform:"scale(1)"},Object(r.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"#687c93"}),Object(r.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"#ffffff",transform:"rotate(161.634)"},Object(r.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"})))))),n.config.description&&Object(r.createElement)("div",{className:"ct-extension-description"},n.config.description),Object(r.createElement)("div",{className:"ct-extension-actions"},Object(r.createElement)("button",{className:c()(n.__object?"ct-button":"ct-button-primary"),"data-button":"white",disabled:u,onClick:function(){s()}},n.__object?Object(a.__)("Deactivate","blc"):Object(a.__)("Activate","blc")),n.__object&&Object(r.createElement)(F,{extsSyncLoading:t,extensionData:n.data,onExtsSync:o}),n.readme&&Object(r.createElement)("button",{onClick:function(){return f()},"data-button":"white",className:"ct-minimal-button ct-instruction"},Object(r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})))),p)};u.a.on("ct:extensions:card",(function(e){var t=e.CustomComponent;"product-reviews"===e.extension.name&&(t.extension=J)}))}]);
trunk/framework/extensions/product-reviews/static/bundle/main-admin.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.7.62
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-product-reviews-settings-modal .ct-controls-group{padding-top:30px;margin-top:5px;border-top:1px dashed #eee}
trunk/framework/extensions/product-reviews/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.7.62
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-product-hero .flexy-container{overflow:hidden}@media (max-width: 999.98px){.ct-product-hero .flexy-pills{--thumbs-spacing: 10px}}@media (min-width: 1000px){.ct-product-hero .flexy-pills{max-width:70%;margin:-8% auto 0 auto;--thumbs-spacing: 20px}}.ct-product-hero .flexy-pills ol{margin:0 calc(var(--thumbs-spacing) * -1)}.ct-product-hero .flexy-pills li{padding-top:var(--thumbs-spacing);padding-left:var(--thumbs-spacing);padding-right:var(--thumbs-spacing)}.ct-product-hero .flexy-pills li img{width:100%;border-radius:3px;border-radius:2px;border:3px solid #fff}.ct-product-hero .hero-section{margin-top:var(--margin-bottom)}.ct-product-scores{display:grid;grid-column-gap:25px;grid-row-gap:25px;margin:0 auto;max-width:800px}@media (min-width: 690px){.ct-product-scores{grid-template-columns:2fr 1fr}}.ct-product-scores:not(:last-child){margin-bottom:60px}.ct-product-scores li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:10px 20px;background:rgba(243,243,243,0.5);border-radius:2px}.ct-product-scores li:hover{background:#f3f3f3}.ct-product-scores li>span{font-size:15px;font-weight:500}.ct-overall-score{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;color:#fff;border-radius:2px;background:#1A202C}.ct-overall-score .ct-average-score{font-size:55px;font-weight:800;line-height:normal;margin-bottom:10px}.ct-overall-score .ct-score-label{font-size:15px;font-weight:700;text-transform:uppercase;letter-spacing:0.02em;color:#fff;margin:15px 0 0 0}.ct-overall-score-layer{display:flex;flex-wrap:wrap;align-items:center}.ct-overall-score-layer .ct-score-label,.ct-overall-score-layer .ct-average-score{font-size:14px;font-weight:600}.ct-overall-score-layer .ct-average-score{margin:0 5px}.ct-overall-score-layer .star-rating{margin-left:auto}.ct-product-actions{display:flex;align-items:center;justify-content:center}.ct-product-actions:not(:last-child){margin-bottom:60px}.ct-product-actions .ct-button:not(:last-child){margin-right:25px}.ct-product-actions .ct-icon-container{color:inherit;margin-left:10px}.ct-product-description:not(:last-child){margin-bottom:60px}.ct-product-info{display:grid;grid-template-columns:var(--grid-template-columns);grid-column-gap:40px;grid-row-gap:40px;border-top:1px solid #ececec;padding-top:var(--content-vertical-spacing, 60px)}@media (min-width: 1000px){.ct-product-info{--grid-template-columns: 1.5fr 1fr 1fr}}@media (min-width: 690px) and (max-width: 999.98px){.ct-product-info{--grid-template-columns: 1fr 1fr}}@media (min-width: 690px) and (max-width: 999.98px){.ct-specs{grid-column:1/-1}}.ct-specs ul{display:grid;grid-column-gap:40px}@media (min-width: 690px){.ct-specs ul{grid-template-columns:repeat(2, 1fr)}}.ct-product-hero{padding-top:var(--content-vertical-spacing, 60px)}.ct-product-hero .ct-container{padding-bottom:var(--content-vertical-spacing, 60px);border-bottom:1px solid #ececec}.ct-product-hero ul{--listIndent: 0;--listStyleType: none;--contentSpacing: 0}
trunk/framework/extensions/product-reviews/static/js/EditSettings.js ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+ import ctEvents from 'ct-events'
9
+
10
+ import { OptionsPanel } from 'blocksy-options'
11
+ import nanoid from 'nanoid'
12
+
13
+ import classnames from 'classnames'
14
+ import { __, sprintf } from 'ct-i18n'
15
+ import Overlay from '../../../../../static/js/helpers/Overlay'
16
+
17
+ const EditSettings = ({ extsSyncLoading, extensionData, onExtsSync }) => {
18
+ const [isEditing, setIsEditing] = useState(false)
19
+ const [settings, setSettings] = useState(null)
20
+
21
+ return (
22
+ <Fragment>
23
+ <button
24
+ className="ct-button ct-config-btn"
25
+ data-button="white"
26
+ onClick={() => {
27
+ setIsEditing(true)
28
+ setSettings(extensionData.settings)
29
+ }}>
30
+ {__('Configure', 'blc')}
31
+ </button>
32
+
33
+ <Overlay
34
+ items={isEditing}
35
+ onDismiss={() => setIsEditing(false)}
36
+ className={'ct-product-reviews-settings-modal'}
37
+ render={() => (
38
+ <div className={classnames('ct-modal-content')}>
39
+ <h2>{__('Product Reviews Settings', 'blc')}</h2>
40
+
41
+ <p className="ct-modal-description">
42
+ {__(
43
+ 'Configure the slugs for single and category pages of the product review custom post type.',
44
+ 'blc'
45
+ )}
46
+ </p>
47
+
48
+ <div className="ct-controls-group">
49
+ <section data-columns="medium:2">
50
+ <OptionsPanel
51
+ onChange={(optionId, optionValue) =>
52
+ setSettings((settings) => ({
53
+ ...settings,
54
+ [optionId]: optionValue,
55
+ }))
56
+ }
57
+ options={{
58
+ single_slug: {
59
+ type: 'text',
60
+ value: '',
61
+ label: __('Single Slug', 'blc'),
62
+ },
63
+
64
+ category_slug: {
65
+ type: 'text',
66
+ value: '',
67
+ label: __('Category Slug', 'blc'),
68
+ },
69
+ }}
70
+ value={settings || {}}
71
+ hasRevertButton={false}
72
+ />
73
+ </section>
74
+ </div>
75
+
76
+ <div className="ct-modal-actions has-divider">
77
+ <button
78
+ className="button-primary"
79
+ disabled={extsSyncLoading || !settings}
80
+ onClick={(e) => {
81
+ e.preventDefault()
82
+
83
+ if (!settings) {
84
+ return
85
+ }
86
+
87
+ onExtsSync({
88
+ extAction: {
89
+ type: 'persist',
90
+ settings,
91
+ },
92
+ })
93
+
94
+ setIsEditing(false)
95
+ }}>
96
+ {extsSyncLoading ? (
97
+ <svg
98
+ width="15"
99
+ height="15"
100
+ viewBox="0 0 100 100">
101
+ <g transform="translate(50,50)">
102
+ <g transform="scale(1)">
103
+ <circle
104
+ cx="0"
105
+ cy="0"
106
+ r="50"
107
+ fill="#687c93"
108
+ />
109
+ <circle
110
+ cx="0"
111
+ cy="-26"
112
+ r="12"
113
+ fill="#ffffff"
114
+ transform="rotate(161.634)">
115
+ <animateTransform
116
+ attributeName="transform"
117
+ type="rotate"
118
+ calcMode="linear"
119
+ values="0 0 0;360 0 0"
120
+ keyTimes="0;1"
121
+ dur="1s"
122
+ begin="0s"
123
+ repeatCount="indefinite"
124
+ />
125
+ </circle>
126
+ </g>
127
+ </g>
128
+ </svg>
129
+ ) : (
130
+ __('Save', 'blc')
131
+ )}
132
+ </button>
133
+ </div>
134
+ </div>
135
+ )}
136
+ />
137
+ </Fragment>
138
+ )
139
+ }
140
+
141
+ export default EditSettings
trunk/framework/extensions/product-reviews/static/js/ProductReviews.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment,
7
+ } from '@wordpress/element'
8
+ import { __ } from 'ct-i18n'
9
+ import classnames from 'classnames'
10
+
11
+ import EditSettings from './EditSettings'
12
+ import useExtensionReadme from '../../../../../static/js/helpers/useExtensionReadme'
13
+ import useActivationAction from '../../../../../static/js/helpers/useActivationAction'
14
+
15
+ const ProductReviews = ({ extsSyncLoading, extension, onExtsSync }) => {
16
+ const [isLoading, activationAction] = useActivationAction(extension, () =>
17
+ onExtsSync()
18
+ )
19
+
20
+ const [showReadme, readme] = useExtensionReadme(extension)
21
+
22
+ return (
23
+ <li className={classnames({ active: !!extension.__object })}>
24
+ <h4 className="ct-extension-title">
25
+ {extension.config.name}
26
+
27
+ {isLoading && (
28
+ <svg width="15" height="15" viewBox="0 0 100 100">
29
+ <g transform="translate(50,50)">
30
+ <g transform="scale(1)">
31
+ <circle cx="0" cy="0" r="50" fill="#687c93" />
32
+ <circle
33
+ cx="0"
34
+ cy="-26"
35
+ r="12"
36
+ fill="#ffffff"
37
+ transform="rotate(161.634)">
38
+ <animateTransform
39
+ attributeName="transform"
40
+ type="rotate"
41
+ calcMode="linear"
42
+ values="0 0 0;360 0 0"
43
+ keyTimes="0;1"
44
+ dur="1s"
45
+ begin="0s"
46
+ repeatCount="indefinite"
47
+ />
48
+ </circle>
49
+ </g>
50
+ </g>
51
+ </svg>
52
+ )}
53
+ </h4>
54
+
55
+ {extension.config.description && (
56
+ <div className="ct-extension-description">
57
+ {extension.config.description}
58
+ </div>
59
+ )}
60
+
61
+ <div className="ct-extension-actions">
62
+ <button
63
+ className={classnames(
64
+ extension.__object ? 'ct-button' : 'ct-button-primary'
65
+ )}
66
+ data-button="white"
67
+ disabled={isLoading}
68
+ onClick={() => {
69
+ activationAction()
70
+ }}>
71
+ {extension.__object
72
+ ? __('Deactivate', 'blc')
73
+ : __('Activate', 'blc')}
74
+ </button>
75
+
76
+ {extension.__object && (
77
+ <EditSettings
78
+ extsSyncLoading={extsSyncLoading}
79
+ extensionData={extension.data}
80
+ onExtsSync={onExtsSync}
81
+ />
82
+ )}
83
+
84
+ {extension.readme && (
85
+ <button
86
+ onClick={() => showReadme()}
87
+ data-button="white"
88
+ className="ct-minimal-button ct-instruction">
89
+ <svg width="16" height="16" viewBox="0 0 24 24">
90
+ <path d="M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z" />
91
+ </svg>
92
+ </button>
93
+ )}
94
+ </div>
95
+ {readme}
96
+ </li>
97
+ )
98
+ }
99
+
100
+ export default ProductReviews
trunk/framework/extensions/product-reviews/static/js/dashboard.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ import { createElement } from '@wordpress/element'
2
+
3
+ import ProductReviews from './ProductReviews'
4
+
5
+ import ctEvents from 'ct-events'
6
+
7
+ ctEvents.on('ct:extensions:card', ({ CustomComponent, extension }) => {
8
+ if (extension.name !== 'product-reviews') return
9
+ CustomComponent.extension = ProductReviews
10
+ })
trunk/framework/extensions/product-reviews/static/sass/actions.scss ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-product-actions {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+
6
+ &:not(:last-child) {
7
+ margin-bottom: 60px;
8
+ }
9
+
10
+ .ct-button:not(:last-child) {
11
+ margin-right: 25px;
12
+ }
13
+
14
+ .ct-icon-container {
15
+ color: inherit;
16
+ margin-left: 10px;
17
+ }
18
+ }
trunk/framework/extensions/product-reviews/static/sass/description.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ .ct-product-description {
2
+ &:not(:last-child) {
3
+ margin-bottom: 60px;
4
+ }
5
+ }
trunk/framework/extensions/product-reviews/static/sass/main-admin.scss ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ .ct-product-reviews-settings-modal {
2
+
3
+ .ct-controls-group {
4
+ padding-top: 30px;
5
+ margin-top: 5px;
6
+ border-top: 1px dashed #eee;
7
+ }
8
+ }
trunk/framework/extensions/product-reviews/static/sass/main.scss ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+ @import 'slider';
3
+ @import 'title';
4
+ @import 'scores';
5
+ @import 'actions';
6
+ @import 'description';
7
+ @import 'quick-info';
8
+
9
+ .ct-product-hero {
10
+ padding-top: var(--content-vertical-spacing, 60px);
11
+
12
+ .ct-container {
13
+ padding-bottom: var(--content-vertical-spacing, 60px);
14
+ border-bottom: 1px solid #ececec;
15
+ }
16
+
17
+ ul {
18
+ --listIndent: 0;
19
+ // --listItemSpacing: 0;
20
+ --listStyleType: none;
21
+ --contentSpacing: 0;
22
+ }
23
+ }
trunk/framework/extensions/product-reviews/static/sass/quick-info.scss ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-product-info {
2
+ display: grid;
3
+ grid-template-columns: var(--grid-template-columns);
4
+ grid-column-gap: 40px;
5
+ grid-row-gap: 40px;
6
+
7
+ border-top: 1px solid #ececec;
8
+ padding-top: var(--content-vertical-spacing, 60px);
9
+
10
+ @include media-breakpoint-up (lg) {
11
+ --grid-template-columns: 1.5fr 1fr 1fr;
12
+ }
13
+
14
+ @include media-breakpoint-only (md) {
15
+ --grid-template-columns: 1fr 1fr;
16
+ }
17
+ }
18
+
19
+ .ct-specs {
20
+ @include media-breakpoint-only (md) {
21
+ grid-column: 1/-1;
22
+ }
23
+
24
+ ul {
25
+ display: grid;
26
+ grid-column-gap: 40px;
27
+
28
+ @include media-breakpoint-up (md) {
29
+ grid-template-columns: repeat(2, 1fr);
30
+ }
31
+ }
32
+ }
trunk/framework/extensions/product-reviews/static/sass/scores.scss ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-product-scores {
2
+ display: grid;
3
+ grid-column-gap: 25px;
4
+ grid-row-gap: 25px;
5
+ margin: 0 auto;
6
+ max-width: 800px;
7
+
8
+ @include media-breakpoint-up (md) {
9
+ grid-template-columns: 2fr 1fr;
10
+ }
11
+
12
+ &:not(:last-child) {
13
+ margin-bottom: 60px;
14
+ }
15
+
16
+ li {
17
+ display: flex;
18
+ flex-wrap: wrap;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ padding: 10px 20px;
22
+ background: rgba(243, 243, 243, 0.5);
23
+ border-radius: 2px;
24
+ // --listItemSpacing: 5px;
25
+
26
+ &:hover {
27
+ background: rgba(243, 243, 243, 1);
28
+ }
29
+
30
+ > span {
31
+ font-size: 15px;
32
+ font-weight: 500;
33
+ }
34
+ }
35
+ }
36
+
37
+ .ct-overall-score {
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: center;
41
+ justify-content: center;
42
+ padding: 20px;
43
+ color: #fff;
44
+ border-radius: 2px;
45
+ background: #1A202C;
46
+
47
+ .ct-average-score {
48
+ font-size: 55px;
49
+ font-weight: 800;
50
+ line-height: normal;
51
+ margin-bottom: 10px;
52
+ }
53
+
54
+ .ct-score-label {
55
+ font-size: 15px;
56
+ font-weight: 700;
57
+ text-transform: uppercase;
58
+ letter-spacing: 0.02em;
59
+ color: #fff;
60
+ margin: 15px 0 0 0;
61
+ }
62
+ }
63
+
64
+ // layer
65
+ .ct-overall-score-layer {
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ align-items: center;
69
+
70
+ .ct-score-label,
71
+ .ct-average-score {
72
+ font-size: 14px;
73
+ font-weight: 600;
74
+ }
75
+
76
+ .ct-average-score {
77
+ margin: 0 5px;
78
+ }
79
+
80
+ .star-rating {
81
+ margin-left: auto;
82
+ }
83
+ }
trunk/framework/extensions/product-reviews/static/sass/slider.scss ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-product-hero {
2
+
3
+ .flexy-container {
4
+ overflow: hidden;
5
+ }
6
+
7
+ .flexy-pills {
8
+ @include media-breakpoint-down (md) {
9
+ --thumbs-spacing: 10px;
10
+ }
11
+
12
+ @include media-breakpoint-up (lg) {
13
+ max-width: 70%;
14
+ margin: -8% auto 0 auto;
15
+
16
+ --thumbs-spacing: 20px;
17
+ }
18
+
19
+ ol {
20
+ margin: 0 calc(var(--thumbs-spacing) * -1);
21
+ }
22
+
23
+ li {
24
+ padding-top: var(--thumbs-spacing);
25
+ padding-left: var(--thumbs-spacing);
26
+ padding-right: var(--thumbs-spacing);
27
+
28
+ img {
29
+ width: 100%;
30
+ border-radius: 3px;
31
+ border-radius: 2px;
32
+ border: 3px solid #fff;
33
+ }
34
+ }
35
+ }
36
+ }
trunk/framework/extensions/product-reviews/static/sass/title.scss ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .ct-product-hero {
2
+
3
+ .hero-section {
4
+ margin-top: var(--margin-bottom);
5
+ }
6
+ }
trunk/framework/extensions/product-reviews/views/single-top.php ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $atts = blocksy_get_post_options(null, [
4
+ 'meta_id' => 'blocksy_product_review_options'
5
+ ]);
6
+
7
+ $gallery_images = array_map(function ($item) {
8
+ return $item['attachment_id'];
9
+ }, blocksy_akg('gallery', $atts, []));
10
+
11
+ $thumb_id = get_post_thumbnail_id();
12
+
13
+ if ($thumb_id) {
14
+ array_unshift($gallery_images, intval($thumb_id));
15
+ } else {
16
+ $gallery_images = [];
17
+ }
18
+
19
+ echo '<section class="ct-product-hero">';
20
+ echo '<div class="ct-container">';
21
+ if (count($gallery_images) === 1) {
22
+ $attachment_id = $gallery_images[0];
23
+
24
+ $image_href = wp_get_attachment_image_src(
25
+ $attachment_id,
26
+ 'full'
27
+ );
28
+
29
+ $width = null;
30
+ $height = null;
31
+
32
+ if ($image_href) {
33
+ $width = $image_href[1];
34
+ $height = $image_href[2];
35
+
36
+ $image_href = $image_href[0];
37
+ }
38
+
39
+ echo blocksy_image([
40
+ 'attachment_id' => $gallery_images[0],
41
+ 'size' => 'full',
42
+ 'ratio' => '2/1',
43
+ 'tag_name' => 'a',
44
+ 'html_atts' => array_merge([
45
+ 'href' => $image_href
46
+ ], $width ? [
47
+ 'data-width' => $width,
48
+ 'data-height' => $height
49
+ ] : []),
50
+ ]);
51
+ }
52
+
53
+ if (count($gallery_images) > 1) {
54
+ $args = [
55
+ 'images' => $gallery_images,
56
+ 'size' => 'full',
57
+ 'images_ratio' => '2/1'
58
+ ];
59
+
60
+ $args['pills_images'] = $gallery_images;
61
+
62
+ if (count($gallery_images) <= 5) {
63
+ } else {
64
+ $args['pills_have_arrows'] = true;
65
+ $args['pills_container_attr'] = [
66
+ 'data-flexy' => 'no'
67
+ ];
68
+ }
69
+
70
+ echo blocksy_flexy($args);
71
+ }
72
+
73
+ echo blocksy_output_hero_section([
74
+ 'type' => 'type-1'
75
+ ]);
76
+
77
+ $scores = blocksy_akg('scores', $atts, []);
78
+
79
+ if (! empty($scores)) {
80
+ echo '<div class="ct-product-scores">';
81
+
82
+ echo '<ul>';
83
+
84
+ foreach ($scores as $single_score) {
85
+ echo '<li>';
86
+ echo '<span>' . $single_score['label'] . '</span>';
87
+
88
+ echo '<div class="star-rating" role="img">';
89
+ $width = ( ( intval($single_score['score']) / 5 ) * 100 );
90
+
91
+ echo '<span style="width: ' . $width . '%;">Rated <strong class="rating">3</strong> out of 5</span>';
92
+ echo '</div>';
93
+ echo '</li>';
94
+ }
95
+
96
+ echo '</ul>';
97
+
98
+ echo '<div class="ct-overall-score">';
99
+
100
+ $avg_score = round(array_reduce($scores, function ($carry, $score) {
101
+ return $carry + intval($score['score']);
102
+ }, 0) / count($scores) * 2) / 2;
103
+
104
+ echo '<span class="ct-average-score">' . $avg_score . '/5</span>';
105
+
106
+ echo '<div class="star-rating" role="img">';
107
+ $width = ( ( $avg_score / 5 ) * 100 );
108
+ echo '<span style="width: ' . $width . '%;"></span>';
109
+ echo '</div>';
110
+
111
+ echo '<span class="ct-score-label">';
112
+ echo __('Overall Score', 'blc');
113
+ echo '</span>';
114
+ echo '</div>';
115
+
116
+ echo '</div>';
117
+ }
118
+
119
+ echo '<div class="ct-product-actions">';
120
+
121
+ $product_link = blocksy_akg('product_link', $atts, '#');
122
+ $product_button_label = blocksy_akg(
123
+ 'product_button_label',
124
+ $atts,
125
+ __('Buy Now', 'blc')
126
+ );
127
+
128
+ $product_read_content_button_label = blocksy_akg(
129
+ 'product_read_content_button_label',
130
+ $atts,
131
+ __('Read More', 'blc')
132
+ );
133
+
134
+ if (! empty($product_button_label)) {
135
+ echo '<a href="#post-' . get_the_ID() . '" class="ct-button">';
136
+ echo $product_read_content_button_label;
137
+
138
+ /*
139
+ echo blc_get_icon([
140
+ 'icon_descriptor' => blocksy_akg('product_read_content_button_icon', $atts, [
141
+ 'icon' => 'fas fa-arrow-down'
142
+ ]),
143
+ ]);
144
+ */
145
+
146
+ echo '</a>';
147
+ }
148
+
149
+ if (! empty($product_button_label) && ! empty($product_link)) {
150
+ echo '<a href="' . esc_url($product_link) . '" class="ct-button">';
151
+ echo $product_button_label;
152
+
153
+ /*
154
+ echo blc_get_icon([
155
+ 'icon_descriptor' => blocksy_akg('product_button_icon', $atts, [
156
+ 'icon' => 'fas fa-cart-arrow-down'
157
+ ]),
158
+ ]);
159
+ */
160
+
161
+ echo '</a>';
162
+ }
163
+
164
+ echo '</div>';
165
+
166
+ $product_specs = blocksy_akg('product_specs', $atts, []);
167
+ $product_pros = blocksy_akg('product_pros', $atts, []);
168
+ $product_cons = blocksy_akg('product_cons', $atts, []);
169
+ $product_description = blocksy_akg('product_description', $atts, '');
170
+
171
+ if (! empty($product_description)) {
172
+ echo '<div class="ct-product-description">';
173
+
174
+ echo '<div class="entry-content">';
175
+ echo do_shortcode($product_description);
176
+ echo '</div>';
177
+
178
+ echo '</div>';
179
+ }
180
+
181
+ if (
182
+ ! empty($product_specs)
183
+ ||
184
+ ! empty($product_pros)
185
+ ||
186
+ ! empty($product_cons)
187
+ ) {
188
+ echo '<div class="ct-product-info">';
189
+
190
+ if (! empty($product_specs)) {
191
+ echo '<div class="ct-specs">';
192
+ echo '<h5>' . __('Specs', 'blc') . '</h5>';
193
+
194
+ echo '<ul>';
195
+
196
+ foreach ($product_specs as $single_spec) {
197
+ echo '<li>';
198
+ echo '<b>' . blocksy_akg('label', $single_spec, '') . ': </b>';
199
+ echo blocksy_akg('value', $single_spec, '');
200
+ echo '</li>';
201
+ }
202
+
203
+ echo '</ul>';
204
+ echo '</div>';
205
+ }
206
+
207
+ if (! empty($product_pros)) {
208
+ echo '<div>';
209
+ echo '<h5>' . __('Pros', 'blc') . '</h5>';
210
+
211
+ echo '<ul>';
212
+
213
+ foreach ($product_pros as $single_pro) {
214
+ echo '<li>';
215
+ echo blocksy_akg('label', $single_pro, '');
216
+ echo '</li>';
217
+ }
218
+
219
+ echo '</ul>';
220
+ echo '</div>';
221
+ }
222
+
223
+ if (! empty($product_cons)) {
224
+ echo '<div>';
225
+ echo '<h5>' . __('Cons', 'blc') . '</h5>';
226
+
227
+ echo '<ul>';
228
+
229
+ foreach ($product_cons as $single_cons) {
230
+ echo '<li>';
231
+ echo blocksy_akg('label', $single_cons, '');
232
+ echo '</li>';
233
+ }
234
+
235
+ echo '</ul>';
236
+ echo '</div>';
237
+ }
238
+
239
+ echo '</div>';
240
+ }
241
+
242
+ echo '</div>';
243
+ echo '</section>';
trunk/framework/extensions/trending/config.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'title' => __('Trending Block', 'blc'),
5
+ 'description' => __('Display a trending list of posts, products or custom post types at the bottom of your website.', 'blc')
6
+ ];
trunk/framework/extensions/trending/customizer.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $all_post_types = [
4
+ 'post' => __('Posts', 'blc')
5
+ ];
6
+
7
+ if (class_exists('WooCommerce')) {
8
+ $all_post_types['product'] = __('Products', 'blc');
9
+ }
10
+
11
+ if (function_exists('blocksy_manager')) {
12
+ $post_types = blocksy_manager()->post_types->get_supported_post_types();
13
+
14
+ foreach ($post_types as $single_post_type) {
15
+ $post_type_object = get_post_type_object($single_post_type);
16
+
17
+ if (! $post_type_object) {
18
+ continue;
19
+ }
20
+
21
+ $all_post_types[$single_post_type] = $post_type_object->labels->singular_name;
22
+ }
23
+ }
24
+
25
+ $options = [
26
+ 'title' => __('Trending Posts', 'blc'),
27
+ 'container' => [ 'priority' => 8 ],
28
+ 'options' => [
29
+ 'trending_posts_section_options' => [
30
+ 'type' => 'ct-options',
31
+ 'setting' => [ 'transport' => 'postMessage' ],
32
+ 'inner-options' => [
33
+ blocksy_rand_md5() => [
34
+ 'type' => 'ct-title',
35
+ 'label' => __( 'Trending Posts', 'blocksy' ),
36
+ ],
37
+
38
+ blocksy_rand_md5() => [
39
+ 'title' => __( 'General', 'blc' ),
40
+ 'type' => 'tab',
41
+ 'options' => [
42
+ 'trending_block_post_type' => count($all_post_types) > 1 ? [
43
+ 'label' => __( 'Post Type', 'blc' ),
44
+ 'type' => 'ct-select',
45
+ 'value' => 'post',
46
+ 'design' => 'inline',
47
+ 'setting' => [ 'transport' => 'postMessage' ],
48
+ 'choices' => blocksy_ordered_keys($all_post_types),
49
+
50
+ 'sync' => [
51
+ 'selector' => '.ct-trending-block',
52
+ 'render' => function () {
53
+ echo blc_get_trending_block();
54
+ }
55
+ ],
56
+ ] : [
57
+ 'label' => __('Post Type', 'blc'),
58
+ 'type' => 'hidden',
59
+ 'value' => 'post',
60
+ 'design' => 'none',
61
+ 'setting' => ['transport' => 'postMessage'],
62
+ ],
63
+
64
+ 'trending_block_filter' => [
65
+ 'label' => __( 'Trending From', 'blc' ),
66
+ 'type' => 'ct-select',
67
+ 'value' => 'all_time',
68
+ 'view' => 'text',
69
+ 'design' => 'inline',
70
+ 'setting' => [ 'transport' => 'postMessage' ],
71
+ 'choices' => blocksy_ordered_keys(
72
+ [
73
+ 'all_time' => __( 'All Time', 'blc' ),
74
+ 'last_24_hours' => __( 'Last 24 Hours', 'blc' ),
75
+ 'last_7_days' => __( 'Last 7 Days', 'blc' ),
76
+ 'last_month' => __( 'Last Month', 'blc' ),
77
+ ]
78
+ ),
79
+
80
+ 'sync' => [
81
+ 'selector' => '.ct-trending-block',
82
+ 'render' => function () {
83
+ echo blocksy_get_trending_block();
84
+ }
85
+ ],
86
+ ],
87
+
88
+ blocksy_rand_md5() => [
89
+ 'type' => 'ct-divider',
90
+ ],
91
+
92
+ 'trendingBlockContainerSpacing' => [
93
+ 'label' => __( 'Container Inner Spacing', 'blc' ),
94
+ 'type' => 'ct-slider',
95
+ 'value' => [
96
+ 'mobile' => '30px',
97
+ 'tablet' => '30px',
98
+ 'desktop' => '30px',
99
+ ],
100
+ 'units' => blocksy_units_config([
101
+ [
102
+ 'unit' => 'px',
103
+ 'min' => 0,
104
+ 'max' => 100,
105
+ ],
106
+ ]),
107
+ 'responsive' => true,
108
+ 'sync' => 'live',
109
+ ],
110
+
111
+ blocksy_rand_md5() => [
112
+ 'type' => 'ct-divider',
113
+ ],
114
+
115
+ 'trending_block_visibility' => [
116
+ 'label' => __( 'Container Visibility', 'blc' ),
117
+ 'type' => 'ct-visibility',
118
+ 'design' => 'block',
119
+ 'sync' => 'live',
120
+
121
+ 'value' => [
122
+ 'desktop' => true,
123
+ 'tablet' => true,
124
+ 'mobile' => false,
125
+ ],
126
+
127
+ 'choices' => blocksy_ordered_keys([
128
+ 'desktop' => __( 'Desktop', 'blc' ),
129
+ 'tablet' => __( 'Tablet', 'blc' ),
130
+ 'mobile' => __( 'Mobile', 'blc' ),
131
+ ]),
132
+ ],
133
+
134
+ ],
135
+ ],
136
+
137
+ blocksy_rand_md5() => [
138
+ 'title' => __( 'Design', 'blc' ),
139
+ 'type' => 'tab',
140
+ 'options' => [
141
+
142
+ 'trendingBlockFontColor' => [
143
+ 'label' => __( 'Font Color', 'blc' ),
144
+ 'type' => 'ct-color-picker',
145
+ 'design' => 'inline',
146
+ 'sync' => 'live',
147
+
148
+ 'value' => [
149
+ 'default' => [
150
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
151
+ ],
152
+
153
+ 'hover' => [
154
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
155
+ ],
156
+ ],
157
+
158
+ 'pickers' => [
159
+ [
160
+ 'title' => __( 'Initial', 'blc' ),
161
+ 'id' => 'default',
162
+ 'inherit' => 'var(--color)'
163
+ ],
164
+
165
+ [
166
+ 'title' => __( 'Hover', 'blc' ),
167
+ 'id' => 'hover',
168
+ 'inherit' => 'var(--linkHoverColor)'
169
+ ],
170
+ ],
171
+ ],
172
+
173
+ 'trending_block_background' => [
174
+ 'label' => __( 'Container Background', 'blc' ),
175
+ 'type' => 'ct-background',
176
+ 'design' => 'inline',
177
+ 'divider' => 'top',
178
+ 'sync' => 'live',
179
+ 'value' => blocksy_background_default_value([
180
+ 'backgroundColor' => [
181
+ 'default' => [
182
+ 'color' => '#e0e3e8',
183
+ ],
184
+ ],
185
+ ])
186
+ ],
187
+
188
+ ],
189
+ ],
190
+ ]
191
+ ]
192
+ ]
193
+ ];
trunk/framework/extensions/trending/extension.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . '/helpers.php';
4
+
5
+ class BlocksyExtensionTrending {
6
+ public function __construct() {
7
+ add_action('wp_enqueue_scripts', function () {
8
+ if (! function_exists('get_plugin_data')) {
9
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
10
+ }
11
+
12
+ $data = get_plugin_data(BLOCKSY__FILE__);
13
+
14
+ if (is_admin()) {
15
+ return;
16
+ }
17
+
18
+ wp_enqueue_script(
19
+ 'blocksy-ext-trending-scripts',
20
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js',
21
+ ['ct-events'],
22
+ $data['Version'],
23
+ true
24
+ );
25
+ });
26
+
27
+ add_filter(
28
+ 'blocksy_extensions_customizer_options',
29
+ function ($opts) {
30
+ $opts['trending_posts_ext'] = blc_call_fn(
31
+ [
32
+ 'fn' => 'blocksy_get_options',
33
+ 'default' => 'array'
34
+ ],
35
+ dirname( __FILE__ ) . '/customizer.php',
36
+ [], false
37
+ );
38
+
39
+ return $opts;
40
+ }
41
+ );
42
+
43
+ add_action(
44
+ 'blocksy:template:after',
45
+ function () {
46
+ echo blc_get_trending_block();
47
+ }
48
+ );
49
+
50
+ add_action(
51
+ 'customize_preview_init',
52
+ function () {
53
+ if (! function_exists('get_plugin_data')) {
54
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
55
+ }
56
+
57
+ $data = get_plugin_data(BLOCKSY__FILE__);
58
+
59
+ wp_enqueue_script(
60
+ 'blocksy-trending-customizer-sync',
61
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
62
+ ['customize-preview', 'ct-events', 'ct-customizer'],
63
+ $data['Version'],
64
+ true
65
+ );
66
+ }
67
+ );
68
+
69
+ add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
70
+ blocksy_theme_get_dynamic_styles(array_merge([
71
+ 'path' => dirname( __FILE__ ) . '/global.php',
72
+ 'chunk' => 'global'
73
+ ], $args));
74
+ }, 10, 3);
75
+ }
76
+ }
trunk/framework/extensions/trending/global.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ blc_call_fn(['fn' => 'blocksy_output_background_css'], [
4
+ 'selector' => '.ct-trending-block',
5
+ 'css' => $css,
6
+ 'value' => get_theme_mod(
7
+ 'trending_block_background',
8
+ blc_call_fn([
9
+ 'fn' => 'blocksy_background_default_value',
10
+ 'default' => null
11
+ ], [
12
+ 'backgroundColor' => [
13
+ 'default' => [
14
+ 'color' => '#e0e3e8'
15
+ ],
16
+ ],
17
+ ])
18
+ )
19
+ ]);
20
+
21
+ blc_call_fn(['fn' => 'blocksy_output_responsive'], [
22
+ 'css' => $css,
23
+ 'tablet_css' => $tablet_css,
24
+ 'mobile_css' => $mobile_css,
25
+ 'selector' => ".ct-trending-block",
26
+ 'variableName' => 'padding',
27
+ 'value' => get_theme_mod('trendingBlockContainerSpacing', [
28
+ 'mobile' => '30px',
29
+ 'tablet' => '30px',
30
+ 'desktop' => '30px',
31
+ ]),
32
+ 'unit' => ''
33
+ ]);
34
+
35
+ blc_call_fn(['fn' => 'blocksy_output_colors'], [
36
+ 'value' => get_theme_mod('trendingBlockFontColor'),
37
+ 'default' => [
38
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
39
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
40
+ ],
41
+ 'css' => $css,
42
+ 'variables' => [
43
+ 'default' => [
44
+ 'selector' => '.ct-trending-block',
45
+ 'variable' => 'color'
46
+ ],
47
+
48
+ 'hover' => [
49
+ 'selector' => '.ct-trending-block',
50
+ 'variable' => 'linkHoverColor'
51
+ ],
52
+ ],
53
+ ]);
trunk/framework/extensions/trending/helpers.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('wp_ajax_blocksy_get_trending_posts', 'blc_get_trending_posts');
4
+ add_action('wp_ajax_nopriv_blocksy_get_trending_posts', 'blc_get_trending_posts');
5
+
6
+ if (! function_exists('blc_get_trending_posts')) {
7
+ function blc_get_trending_posts() {
8
+ if (! isset($_REQUEST['page'])) {
9
+ wp_send_json_error();
10
+ }
11
+
12
+ $page = intval(sanitize_text_field($_REQUEST['page']));
13
+
14
+ if (! $page) {
15
+ wp_send_json_error();
16
+ }
17
+
18
+ wp_send_json_success([
19
+ 'posts' => blc_get_trending_posts_value([
20
+ 'paged' => $page
21
+ ])
22
+ ]);
23
+ }
24
+ }
25
+
26
+ if (! function_exists('blc_get_trending_posts_value')) {
27
+ function blc_get_trending_posts_value($args = []) {
28
+ $args = wp_parse_args(
29
+ $args,
30
+ [
31
+ 'paged' => 1
32
+ ]
33
+ );
34
+
35
+ $date_query = [];
36
+
37
+ $date_filter = get_theme_mod('trending_block_filter', 'all_time');
38
+
39
+ if ($date_filter && 'all_time' !== $date_filter) {
40
+ $days = [
41
+ 'last_24_hours' => 1,
42
+ 'last_7_days' => 7,
43
+ 'last_month' => 30
44
+ ][$date_filter];
45
+
46
+ if (! $days) {
47
+ $days = 30;
48
+ }
49
+
50
+ $time = time() - (intval($days) * 24 * 60 * 60);
51
+
52
+ $date_query = array(
53
+ 'after' => [
54
+ 'year' => date('Y', $time),
55
+ 'month' => date('n', $time),
56
+ 'days' => date('j', $time),
57
+ ],
58
+ 'before' => [
59
+ 'year' => date('Y'),
60
+ 'month' => date('n'),
61
+ 'days' => date('j'),
62
+ ],
63
+ 'inclusive' => true,
64
+ );
65
+ }
66
+
67
+ $post_type = get_theme_mod('trending_block_post_type', 'post');
68
+
69
+ if ($post_type === 'product' && !class_exists('WooCommerce')) {
70
+ $post_type = 'post';
71
+ }
72
+
73
+ $query = new WP_Query(
74
+ [
75
+ 'post_type' => $post_type,
76
+ 'order' => 'DESC',
77
+ 'date_query' => $date_query,
78
+ 'posts_per_page' => 4,
79
+ 'orderby' => 'comment_count',
80
+ 'paged' => $args['paged'],
81
+ 'ignore_sticky_posts' => true,
82
+ 'post_status' => 'publish'
83
+ ]
84
+ );
85
+
86
+ if (! $query->have_posts()) {
87
+ return [
88
+ 'posts' => [],
89
+ 'is_last_page' => false
90
+ ];
91
+ }
92
+
93
+ $result = [];
94
+
95
+ while ($query->have_posts()) {
96
+ $query->the_post();
97
+
98
+ $result[] = [
99
+ 'id' => get_the_ID(),
100
+ 'attachment_id' => get_post_thumbnail_id(),
101
+ 'title' => get_the_title(),
102
+ 'url' => get_permalink(),
103
+ 'image' => blc_call_fn(['fn' => 'blocksy_image'], [
104
+ 'attachment_id' => get_post_thumbnail_id(),
105
+ 'size' => 'thumbnail',
106
+ 'ratio' => '1/1',
107
+ 'tag_name' => 'div',
108
+ ])
109
+ ];
110
+ }
111
+
112
+ $is_last = intval($query->max_num_pages) === intval($args['paged']);
113
+
114
+ wp_reset_postdata();
115
+
116
+ return [
117
+ 'posts' => $result,
118
+ 'is_last_page' => $is_last
119
+ ];
120
+ }
121
+ }
122
+
123
+ if (! function_exists('blc_get_trending_block')) {
124
+ function blc_get_trending_block($forced = false) {
125
+ $result = blc_get_trending_posts_value();
126
+
127
+ if (empty($result['posts'])) {
128
+ return '';
129
+ }
130
+
131
+ ob_start();
132
+
133
+ $data_page = 'data-page="1"';
134
+
135
+ if ($result['is_last_page']) {
136
+ $data_page = '';
137
+ }
138
+
139
+ $class = 'ct-trending-block';
140
+
141
+ $class .= ' ' . blc_call_fn(
142
+ ['fn' => 'blocksy_visibility_classes'],
143
+ get_theme_mod('trending_block_visibility', [
144
+ 'desktop' => true,
145
+ 'tablet' => true,
146
+ 'mobile' => false,
147
+ ])
148
+ );
149
+
150
+ ?>
151
+
152
+ <section class="<?php echo $class ?>">
153
+ <div class="ct-container" <?php echo $data_page ?>>
154
+ <h5 class="ct-block-title">
155
+ <?php echo __('Trending now', 'blc') ?>
156
+
157
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>
158
+
159
+ <?php if (! $result['is_last_page']) { ?>
160
+ <span class="ct-arrow-left">
161
+ </span>
162
+
163
+ <span class="ct-arrow-right">
164
+ </span>
165
+ <?php } ?>
166
+ </h5>
167
+
168
+ <?php
169
+ foreach ($result['posts'] as $post) {
170
+ echo blocksy_html_tag(
171
+ 'a',
172
+ [
173
+ 'href' => $post['url']
174
+ ],
175
+
176
+ $post['image'] . blocksy_html_tag(
177
+ 'span',
178
+ [
179
+ 'class' => 'ct-item-title',
180
+ ],
181
+ $post['title']
182
+ )
183
+ );
184
+ }
185
+
186
+ ?>
187
+
188
+ </div>
189
+ </section>
190
+
191
+ <?php
192
+
193
+ return ob_get_clean();
194
+ }
195
+ }
trunk/framework/extensions/trending/static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=window.ctFrontend},function(e,t){e.exports=window.ctEvents},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1),c=n.n(o);function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var p={},y=function(e){return p[e]?new Promise((function(t){t(p[e]),window.ct_customizer_localizations||(p[e]=p[e].clone())})):new Promise((function(t){return fetch(e).then((function(n){t(n),window.ct_customizer_localizations||(p[e]=n.clone())}))}))},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((e=f({el:null,action:null},e)).el&&e.action&&!e.el.classList.contains("ct-loading")){var t=parseInt(e.el.dataset.page,10);if(("prev"!==e.action||1!==t)&&!(e.el.querySelectorAll(".ct-container > a").length<4&&1===t||e.el.dataset.page.indexOf("last")>-1&&"next"===e.action)){e.el.classList.add("ct-loading");var n="prev"===e.action?t-1:t+1;Promise.all([new Promise((function(t){e.el.classList.add("ct-leave-active"),requestAnimationFrame((function(){e.el.classList.remove("ct-leave-active"),e.el.classList.add("ct-leave"),setTimeout((function(){return t()}),650)}))})),y("".concat(ct_localizations.ajax_url,"?action=blocksy_get_trending_posts&page=").concat(n)).then((function(e){return e.json()}))]).then((function(t){var o=a(t,2),c=(o[0],o[1]),l=c.success,u=c.data;if(l){var s=u.posts,f=s.is_last_page,d=s.posts;e.el.dataset.page="".concat(n).concat(f?":last":""),i(e.el.querySelectorAll("a")).map((function(e){return e.remove()})),d.map((function(t){return e.el.insertAdjacentHTML("beforeend",'<a href="'.concat(t.url,'">\n ').concat(t.image,'\n <span class="ct-item-title">\n ').concat(t.title,"\n </span>\n </a>"))})),setTimeout((function(){e.el.classList.remove("ct-leave"),e.el.classList.add("ct-enter-active"),requestAnimationFrame((function(){e.el.classList.remove("ct-enter-active"),e.el.classList.add("ct-active"),setTimeout((function(){e.el.classList.remove("ct-active"),e.el.classList.remove("ct-loading")}),650)}))}),50),Object(r.markImagesAsLoaded)(e.el)}}))}}},b=function(){Array.from(document.querySelectorAll(".ct-trending-block [data-page]")).map((function(e){return function(e){e.hasListeners||(e.hasListeners=!0,e.querySelector(".ct-arrow-left").addEventListener("click",(function(t){t.preventDefault(),m({el:e,action:"prev"})})),e.querySelector(".ct-arrow-right").addEventListener("click",(function(t){t.preventDefault(),m({el:e,action:"next"})})))}(e)}))};Object(r.onDocumentLoaded)((function(){b()})),c.a.on("blocksy:frontend:init",(function(){b()}))}]);
trunk/framework/extensions/trending/static/bundle/sync.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=window.blocksyCustomizerSync},function(e,t,n){"use strict";n.r(t);var o,r=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},c=function(e,t){var n=t.forcedOutput,o=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return o?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return o?"none":"CT_CSS_SKIP_RULE";var r=[];return e.inset&&r.push("inset"),r.push("".concat(e.h_offset,"px")),r.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(r.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&r.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(r.push("".concat(e.blur,"px")),r.push("".concat(e.spread,"px"))),r.push(e.color.color),r.join(" ")},a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",o={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},r=document.querySelector("style#".concat(o[n])),c=r.innerText,a="".concat(e["".concat(n,"_selector_prefix")]?"".concat(e["".concat(n,"_selector_prefix")]," "):"").concat(e.selector||":root"),i=null,l=c.match(i);0===c.trim().indexOf(a)?(i=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)):(i=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)),l||(0===(c="".concat(c," ").concat(a," { }")).trim().indexOf(a)?(i=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)):(i=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i))),r.innerText=c.replace(i,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(a," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",o=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(o=t&&"none"!==t.style?"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color):"none"),"spacing"===(e.type||"")&&(o=r(t)),"box-shadow"===(e.type||"")&&(o=c(t,e)),a(e,"".concat(o).concat(e.unit||"").concat(e.important?" !important":""),n)},l=function(e,t){var n=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,n),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),i(e,t.desktop,"desktop"),i(e,t.tablet,"tablet"),i(e,t.mobile,"mobile")):i(e,t)},s=n(0);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({trendingBlockContainerSpacing:{selector:".ct-trending-block",variable:"padding",responsive:!0,unit:""},trendingBlockFontColor:[{selector:".ct-trending-block",variable:"color",type:"color:default"},{selector:".ct-trending-block",variable:"linkHoverColor",type:"color:hover"}]},Object(s.handleBackgroundOptionFor)({id:"trending_block_background",selector:".ct-trending-block"})),wp.customize.bind("change",(function(e){return o[e.id]&&(Array.isArray(o[e.id])?o[e.id]:[o[e.id]]).map((function(t){return l(t,e())}))})),wp.customize("trending_block_visibility",(function(e){return e.bind((function(e){return Object(s.responsiveClassesFor)("trending_block_visibility",document.querySelector(".ct-trending-block"))}))}))}]);
trunk/framework/extensions/trending/static/js/main.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { onDocumentLoaded } from 'blocksy-frontend'
2
+ import ctEvents from 'ct-events'
3
+ import { mount } from './trending-block'
4
+
5
+ const initTrending = () => {
6
+ Array.from(
7
+ document.querySelectorAll('.ct-trending-block [data-page]')
8
+ ).map((el) => mount(el))
9
+ }
10
+
11
+ onDocumentLoaded(() => {
12
+ initTrending()
13
+ })
14
+
15
+ ctEvents.on('blocksy:frontend:init', () => {
16
+ initTrending()
17
+ })
trunk/framework/extensions/trending/static/js/sync.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { handleVariablesFor } from 'customizer-sync-helpers'
2
+ import {
3
+ handleBackgroundOptionFor,
4
+ responsiveClassesFor
5
+ } from 'blocksy-customizer-sync'
6
+
7
+ handleVariablesFor({
8
+ trendingBlockContainerSpacing: {
9
+ selector: '.ct-trending-block',
10
+ variable: 'padding',
11
+ responsive: true,
12
+ unit: ''
13
+ },
14
+
15
+ trendingBlockFontColor: [
16
+ {
17
+ selector: '.ct-trending-block',
18
+ variable: 'color',
19
+ type: 'color:default'
20
+ },
21
+
22
+ {
23
+ selector: '.ct-trending-block',
24
+ variable: 'linkHoverColor',
25
+ type: 'color:hover'
26
+ }
27
+ ],
28
+
29
+ ...handleBackgroundOptionFor({
30
+ id: 'trending_block_background',
31
+ selector: '.ct-trending-block'
32
+ })
33
+ })
34
+
35
+ wp.customize('trending_block_visibility', value =>
36
+ value.bind(to =>
37
+ responsiveClassesFor(
38
+ 'trending_block_visibility',
39
+ document.querySelector('.ct-trending-block')
40
+ )
41
+ )
42
+ )
trunk/framework/extensions/trending/static/js/trending-block.js ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { markImagesAsLoaded } from 'blocksy-frontend'
2
+
3
+ const store = {}
4
+
5
+ const cachedFetch = (url) =>
6
+ store[url]
7
+ ? new Promise((resolve) => {
8
+ resolve(store[url])
9
+ if (!window.ct_customizer_localizations) {
10
+ store[url] = store[url].clone()
11
+ }
12
+ })
13
+ : new Promise((resolve) =>
14
+ fetch(url).then((response) => {
15
+ resolve(response)
16
+
17
+ if (!window.ct_customizer_localizations) {
18
+ store[url] = response.clone()
19
+ }
20
+ })
21
+ )
22
+
23
+ const loadPage = (args = {}) => {
24
+ args = {
25
+ el: null,
26
+ // prev | next
27
+ action: null,
28
+
29
+ ...args,
30
+ }
31
+
32
+ if (!args.el) {
33
+ return
34
+ }
35
+
36
+ if (!args.action) {
37
+ return
38
+ }
39
+
40
+ if (args.el.classList.contains('ct-loading')) {
41
+ return
42
+ }
43
+
44
+ let currentPage = parseInt(args.el.dataset.page, 10)
45
+
46
+ if (args.action === 'prev' && currentPage === 1) {
47
+ return
48
+ }
49
+
50
+ if (args.el.querySelectorAll('.ct-container > a').length < 4) {
51
+ if (currentPage === 1) {
52
+ return
53
+ }
54
+ }
55
+
56
+ if (args.el.dataset.page.indexOf('last') > -1) {
57
+ if (args.action === 'next') {
58
+ return
59
+ }
60
+ }
61
+
62
+ args.el.classList.add('ct-loading')
63
+
64
+ let newPage = args.action === 'prev' ? currentPage - 1 : currentPage + 1
65
+
66
+ Promise.all([
67
+ new Promise((resolve) => {
68
+ args.el.classList.add('ct-leave-active')
69
+ requestAnimationFrame(() => {
70
+ args.el.classList.remove('ct-leave-active')
71
+ args.el.classList.add('ct-leave')
72
+
73
+ setTimeout(() => resolve(), 650)
74
+ })
75
+ }),
76
+
77
+ cachedFetch(
78
+ `${ct_localizations.ajax_url}?action=blocksy_get_trending_posts&page=${newPage}`
79
+ ).then((response) => response.json()),
80
+ ]).then(([_, { success, data }]) => {
81
+ if (!success) {
82
+ return
83
+ }
84
+
85
+ let {
86
+ posts: { is_last_page, posts },
87
+ } = data
88
+
89
+ args.el.dataset.page = `${newPage}${is_last_page ? ':last' : ''}`
90
+ ;[...args.el.querySelectorAll('a')].map((el) => el.remove())
91
+
92
+ posts.map((post) =>
93
+ args.el.insertAdjacentHTML(
94
+ 'beforeend',
95
+ `<a href="${post.url}">
96
+ ${post.image}
97
+ <span class="ct-item-title">
98
+ ${post.title}
99
+ </span>
100
+ </a>`
101
+ )
102
+ )
103
+
104
+ setTimeout(() => {
105
+ args.el.classList.remove('ct-leave')
106
+ args.el.classList.add('ct-enter-active')
107
+
108
+ requestAnimationFrame(() => {
109
+ args.el.classList.remove('ct-enter-active')
110
+ args.el.classList.add('ct-active')
111
+
112
+ setTimeout(() => {
113
+ args.el.classList.remove('ct-active')
114
+ args.el.classList.remove('ct-loading')
115
+ }, 650)
116
+ })
117
+ }, 50)
118
+
119
+ markImagesAsLoaded(args.el)
120
+ })
121
+ }
122
+
123
+ export const mount = (el) => {
124
+ if (el.hasListeners) {
125
+ return
126
+ }
127
+
128
+ el.hasListeners = true
129
+
130
+ el.querySelector('.ct-arrow-left').addEventListener('click', (e) => {
131
+ e.preventDefault()
132
+ loadPage({ el, action: 'prev' })
133
+ })
134
+
135
+ el.querySelector('.ct-arrow-right').addEventListener('click', (e) => {
136
+ e.preventDefault()
137
+ loadPage({ el, action: 'next' })
138
+ })
139
+ }
trunk/framework/extensions/widgets/config.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'description' => __('Popular/Recent Posts, Advertisement, Contact Info, Mailchimp Subscribe, Social Icons and more.', 'blc')
5
+ ];
trunk/framework/extensions/widgets/extension.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyExtensionWidgets {
4
+ public function __construct() {
5
+ add_filter('blocksy_widgets_paths', function ($all_widgets) {
6
+ $all_widgets = array_merge(
7
+ $all_widgets,
8
+ glob(
9
+ dirname(__FILE__) . '/widgets/*',
10
+ GLOB_ONLYDIR
11
+ )
12
+ );
13
+
14
+ return $all_widgets;
15
+ });
16
+
17
+ add_action('wp_enqueue_scripts', function () {
18
+ if (! function_exists('get_plugin_data')){
19
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
20
+ }
21
+
22
+ $data = get_plugin_data(BLOCKSY__FILE__);
23
+
24
+ if (is_admin()) return;
25
+
26
+ wp_enqueue_style(
27
+ 'blocksy-ext-widgets-styles',
28
+ BLOCKSY_URL . 'framework/extensions/widgets/static/bundle/main.css',
29
+ [
30
+ 'ct-main-styles'
31
+ ],
32
+ $data['Version']
33
+ );
34
+ });
35
+ }
36
+ }
trunk/framework/extensions/widgets/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.7.62
3
+ *
4
+ * Copyright (c) 2021
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-posts-widget ul{--listItemSpacing: 20px}.ct-posts-widget ul a{display:var(--display, grid)}.ct-posts-widget ul .ct-image-container{align-self:start}.ct-posts-widget ul .ct-entry-content{align-self:center}.ct-posts-widget ul .ct-post-title{--fontSize: 15px;--lineHeight: 1.5;--fontWeight: 500;word-break:break-word}.ct-posts-widget ul .ct-entry-excerpt{margin-top:5px;font-size:13px;color:var(--color)}.ct-posts-widget ul .ct-entry-meta{color:var(--color)}.ct-posts-widget ul .ct-entry-meta span:not(:last-child):after{content:'/';margin:0 3px}.ct-posts-widget ul[data-type="rounded"] a,.ct-posts-widget ul[data-type="large-small"] a,.ct-posts-widget ul[data-type="small-thumbs"] a{grid-template-columns:25% 1fr;grid-column-gap:20px}.ct-posts-widget ul[data-type="no-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"]{--listItemSpacing: 25px}.ct-posts-widget ul[data-type="large-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-image-container{margin-bottom:12px}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="large-small"] li:first-child{--listItemSpacing: 30px}.ct-posts-widget ul[data-type="large-small"] li:first-child a{--display: block}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-image-container{margin-bottom:20px}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="rounded"] .ct-image-container{overflow:hidden;border-radius:100%;-webkit-mask-image:-webkit-radial-gradient(white, black)}.ct-posts-widget ul[data-type="numbered"]{counter-reset:ct-counter}.ct-posts-widget ul[data-type="numbered"] a{grid-template-columns:34px 1fr;grid-column-gap:15px}.ct-posts-widget ul[data-type="numbered"] a:before{counter-increment:ct-counter;content:counter(ct-counter);display:flex;align-items:center;justify-content:center;width:34px;height:34px;font-size:12px;font-weight:700;border-radius:100%;border:1px solid #E5E5E5;transition:var(--transition)}.ct-posts-widget ul[data-type="numbered"] a:hover:before{color:#fff;border-color:var(--paletteColor1);background:var(--paletteColor1)}.ct-posts-widget ul[data-type="numbered"] .ct-post-title::before{content:'';display:block;height:0;width:0;margin-top:calc((1 - 1.65) * 0.5em)}.ct-quote-widget{--color: #fff;position:relative;min-height:250px;border-radius:7px;padding:70px 40px 60px 60px !important;background:var(--paletteColor1) !important}.ct-quote-widget:before{position:absolute;top:50px;left:35px;content:"”";font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:bold;font-size:200px;line-height:150px;opacity:0.3;width:80px;height:80px;display:flex;justify-content:center;transform:rotate(180deg)}.ct-quote-widget .ct-quote-author{display:grid;grid-template-columns:40px 1fr;grid-column-gap:15px;align-items:center;margin-top:25px;--fontWeight: 500}.ct-quote-widget .ct-quote-author figure{max-width:40px;border-radius:100%}.ct-about-me-widget figure{margin-bottom:15px}.ct-about-me-widget figure[data-size="small"]{max-width:90px}.ct-about-me-widget figure[data-size="medium"]{max-width:140px}.ct-about-me-widget figure[data-shape="square"]{border-radius:2px}.ct-about-me-widget figure[data-shape="rounded"]{border-radius:100%}.ct-about-me-widget .ct-about-me-name{display:flex;flex-direction:column}.ct-about-me-widget .ct-about-me-name:not(:last-child){margin-bottom:15px}.ct-about-me-widget .ct-about-me-text:not(:last-child){margin-bottom:25px}.ct-about-me-widget .ct-about-me-link{font-size:13px;font-weight:normal}.ct-about-me-widget [data-alignment="center"]{text-align:center}.ct-about-me-widget [data-alignment="center"] .ct-social-box{justify-content:center}.ct-about-me-widget [data-alignment="right"]{text-align:right}.ct-about-me-widget [data-alignment="right"] .ct-social-box{justify-content:flex-end}.ct-about-me-widget [data-type="bordered"]{padding:35px 25px;border-radius:7px;background:#fff;border:1px dashed rgba(0,0,0,0.1)}.ct-facebook-like-box{overflow:hidden;--fbHeader: 0px;--fbFacepile: 0px}.ct-facebook-like-box .fb-page{display:flex;justify-content:center}.ct-facebook-like-box .fb-page[data-small-header="false"]{--fbHeader: 130px}.ct-facebook-like-box .fb-page[data-small-header="true"]{--fbHeader: 70px}.ct-facebook-like-box .fb-page[data-show-facepile="true"]{--fbFacepile: 84px}.ct-facebook-like-box .fb-page:not([data-tabs="timeline"]){min-height:calc(var(--fbHeader) + var(--fbFacepile))}.ct-facebook-like-box .fb-page[data-tabs="timeline"]{min-height:500px}.ct-facebook-like-box iframe{max-width:500px;margin:0 auto}.ct-socials-widget [data-icons-type*="solid"],.ct-about-me-widget [data-icons-type*="solid"],.ct-contact-info-widget [data-icons-type*="solid"]{--icon-color: rgba(100, 110, 119, 1);--icon-hover-color: #fff;--background-color: rgba(218, 222, 228, 0.3);--background-hover-color: var(--paletteColor1)}.ct-socials-widget [data-icons-type*="outline"],.ct-about-me-widget [data-icons-type*="outline"],.ct-contact-info-widget [data-icons-type*="outline"]{--icon-color: rgba(100, 110, 119, 1);--icon-hover-color: var(--paletteColor1);--background-color: rgba(218, 222, 228, 1);--background-hover-color: var(--paletteColor1)}
trunk/framework/extensions/widgets/static/sass/about-me.scss ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-about-me-widget {
2
+
3
+ figure {
4
+ margin-bottom: 15px;
5
+
6
+ &[data-size="small"] {
7
+ max-width: 90px;
8
+ }
9
+
10
+ &[data-size="medium"] {
11
+ max-width: 140px;
12
+ }
13
+
14
+ &[data-shape="square"] {
15
+ border-radius: 2px;
16
+ }
17
+
18
+ &[data-shape="rounded"] {
19
+ border-radius: 100%;
20
+ }
21
+ }
22
+
23
+ .ct-about-me-name {
24
+ display: flex;
25
+ flex-direction: column;
26
+
27
+ &:not(:last-child) {
28
+ margin-bottom: 15px;
29
+ }
30
+ }
31
+
32
+ .ct-about-me-text {
33
+ &:not(:last-child) {
34
+ margin-bottom: 25px;
35
+ }
36
+ }
37
+
38
+ .ct-about-me-link {
39
+ font-size: 13px;
40
+ font-weight: normal;
41
+ }
42
+
43
+ // alignment
44
+ [data-alignment="center"] {
45
+ text-align: center;
46
+
47
+ .ct-social-box {
48
+ justify-content: center;
49
+ }
50
+ }
51
+
52
+ [data-alignment="right"] {
53
+ text-align: right;
54
+
55
+ .ct-social-box {
56
+ justify-content: flex-end;
57
+ }
58
+ }
59
+
60
+ // bordered
61
+ [data-type="bordered"] {
62
+ padding: 35px 25px;
63
+ border-radius: 7px;
64
+ background: #fff;
65
+ border: 1px dashed rgba(0, 0, 0, 0.1);
66
+ }
67
+ }
trunk/framework/extensions/widgets/static/sass/facebook.scss ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-facebook-like-box {
2
+ overflow: hidden;
3
+
4
+ --fbHeader: 0px;
5
+ --fbFacepile: 0px;
6
+
7
+ .fb-page {
8
+ display: flex;
9
+ justify-content: center;
10
+
11
+ &[data-small-header="false"] {
12
+ --fbHeader: 130px;
13
+ }
14
+
15
+ &[data-small-header="true"] {
16
+ --fbHeader: 70px;
17
+ }
18
+
19
+ &[data-show-facepile="true"] {
20
+ --fbFacepile: 84px;
21
+ }
22
+
23
+ &:not([data-tabs="timeline"]) {
24
+ min-height: calc(var(--fbHeader) + var(--fbFacepile));
25
+ }
26
+
27
+ &[data-tabs="timeline"] {
28
+ min-height: 500px;
29
+ }
30
+
31
+ }
32
+
33
+ iframe {
34
+ max-width: 500px;
35
+ margin: 0 auto;
36
+ }
37
+ }
trunk/framework/extensions/widgets/static/sass/main.scss ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ @import 'posts';
4
+ @import 'quote';
5
+ @import 'about-me';
6
+ @import 'facebook';
7
+ @import 'social-icons';
trunk/framework/extensions/widgets/static/sass/posts.scss ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-posts-widget ul {
2
+ --listItemSpacing: 20px;
3
+
4
+ a {
5
+ display: var(--display, grid);
6
+ }
7
+
8
+ .ct-image-container {
9
+ align-self: start;
10
+ }
11
+
12
+ .ct-entry-content {
13
+ align-self: center;
14
+ }
15
+
16
+ .ct-post-title {
17
+ --fontSize: 15px;
18
+ --lineHeight: 1.5;
19
+ --fontWeight: 500;
20
+ word-break: break-word;
21
+ }
22
+
23
+ .ct-entry-excerpt {
24
+ margin-top: 5px;
25
+ font-size: 13px;
26
+ color: var(--color);
27
+ }
28
+
29
+ .ct-entry-meta {
30
+ color: var(--color);
31
+
32
+ span:not(:last-child) {
33
+ &:after {
34
+ content: '/';
35
+ margin: 0 3px;
36
+ }
37
+ }
38
+ }
39
+
40
+
41
+ &[data-type="rounded"],
42
+ &[data-type="large-small"],
43
+ &[data-type="small-thumbs"] {
44
+ a {
45
+ grid-template-columns: 25% 1fr;
46
+ grid-column-gap: 20px;
47
+ }
48
+ }
49
+
50
+
51
+ &[data-type="no-thumbs"] a {
52
+ --display: block;
53
+ }
54
+
55
+ &[data-type="large-thumbs"] {
56
+ --listItemSpacing: 25px;
57
+
58
+ a {
59
+ --display: block;
60
+
61
+ .ct-image-container {
62
+ margin-bottom: 12px;
63
+ }
64
+
65
+ .ct-post-title {
66
+ --fontSize: 17px;
67
+ --fontWeight: 600;
68
+ }
69
+ }
70
+ }
71
+
72
+ &[data-type="large-small"] li:first-child {
73
+ --listItemSpacing: 30px;
74
+
75
+ a {
76
+ --display: block;
77
+
78
+ .ct-image-container {
79
+ margin-bottom: 20px;
80
+ }
81
+
82
+ .ct-post-title {
83
+ --fontSize: 17px;
84
+ --fontWeight: 600;
85
+ }
86
+ }
87
+ }
88
+
89
+ &[data-type="rounded"] {
90
+ .ct-image-container {
91
+ overflow: hidden;
92
+ border-radius: 100%;
93
+ -webkit-mask-image: -webkit-radial-gradient(white, black);
94
+ }
95
+ }
96
+
97
+ &[data-type="numbered"] {
98
+ counter-reset: ct-counter;
99
+
100
+ a {
101
+ grid-template-columns: 34px 1fr;
102
+ grid-column-gap: 15px;
103
+
104
+ &:before {
105
+ counter-increment: ct-counter;
106
+ content: counter(ct-counter);
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ width: 34px;
111
+ height: 34px;
112
+ font-size: 12px;
113
+ font-weight: 700;
114
+ border-radius: 100%;
115
+ border: 1px solid #E5E5E5;
116
+ transition: var(--transition);
117
+ }
118
+
119
+ &:hover {
120
+ &:before {
121
+ color: #fff;
122
+ border-color: var(--paletteColor1);
123
+ background: var(--paletteColor1);
124
+ }
125
+ }
126
+ }
127
+
128
+ .ct-post-title {
129
+ @include lhCrop(1.65);
130
+ }
131
+ }
132
+ }
trunk/framework/extensions/widgets/static/sass/quote.scss ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-quote-widget {
2
+ --color: #fff;
3
+ position: relative;
4
+ min-height: 250px;
5
+ border-radius: 7px;
6
+ padding: 70px 40px 60px 60px !important;
7
+ background: var(--paletteColor1) !important;
8
+
9
+ &:before {
10
+ position: absolute;
11
+ top: 50px;
12
+ left: 35px;
13
+ content: "”";
14
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
15
+ font-weight: bold;
16
+ font-size: 200px;
17
+ line-height: 150px;
18
+ opacity: 0.3;
19
+ width: 80px;
20
+ height: 80px;
21
+ display: flex;
22
+ justify-content: center;
23
+ transform: rotate(180deg);
24
+ }
25
+
26
+ .ct-quote-author {
27
+ display: grid;
28
+ grid-template-columns: 40px 1fr;
29
+ grid-column-gap: 15px;
30
+ align-items: center;
31
+ margin-top: 25px;
32
+ --fontWeight: 500;
33
+
34
+ figure {
35
+ max-width: 40px;
36
+ border-radius: 100%;
37
+ }
38
+ }
39
+ }
trunk/framework/extensions/widgets/static/sass/social-icons.scss ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-socials-widget,
2
+ .ct-about-me-widget,
3
+ .ct-contact-info-widget {
4
+
5
+ // [data-icons-type*="simple"] {
6
+ // --icon-color: rgba(100, 110, 119, 1);
7
+ // --icon-hover-color: var(--paletteColor1);
8
+ // }
9
+
10
+ [data-icons-type*="solid"] {
11
+ --icon-color: rgba(100, 110, 119, 1);
12
+ --icon-hover-color: #fff;
13
+ --background-color: rgba(218, 222, 228, 0.3);
14
+ --background-hover-color: var(--paletteColor1);
15
+ }
16
+
17
+ [data-icons-type*="outline"] {
18
+ --icon-color: rgba(100, 110, 119, 1);
19
+ --icon-hover-color: var(--paletteColor1);
20
+ --background-color: rgba(218, 222, 228, 1);
21
+ --background-hover-color: var(--paletteColor1);
22
+ }
23
+ }
trunk/framework/extensions/widgets/widgets/ct-about-me/helpers.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_get_user_choices() {
4
+ global $wpdb;
5
+
6
+ $wp_user_search = $wpdb->get_results(
7
+ "SELECT ID, display_name FROM $wpdb->users ORDER BY ID"
8
+ );
9
+
10
+ $result = [];
11
+
12
+ foreach ($wp_user_search as $userid) {
13
+ $user_id = (int) $userid->ID;
14
+ $result[$user_id] = $userid->display_name;
15
+ }
16
+
17
+ return $result;
18
+ }
trunk/framework/extensions/widgets/widgets/ct-about-me/options.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * About me widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ require_once dirname( __FILE__ ) . '/helpers.php';
11
+
12
+ $options = [
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'About me', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'about_type' => [
23
+ 'label' => __( 'Type', 'blc' ),
24
+ 'type' => 'ct-radio',
25
+ 'value' => 'simple',
26
+ 'view' => 'radio',
27
+ 'design' => 'inline',
28
+ 'inline' => true,
29
+ 'disableRevertButton' => true,
30
+ 'choices' => [
31
+ 'simple' => __( 'Simple', 'blc' ),
32
+ 'bordered' => __( 'Boxed', 'blc' ),
33
+ ],
34
+ ],
35
+
36
+ 'about_source' => [
37
+ 'label' => __( 'Source', 'blc' ),
38
+ 'type' => 'ct-radio',
39
+ 'value' => 'from_wp',
40
+ 'view' => 'radio',
41
+ 'design' => 'inline',
42
+ 'inline' => true,
43
+ 'disableRevertButton' => true,
44
+ 'choices' => [
45
+ 'from_wp' => __( 'From WP', 'blc' ),
46
+ 'custom' => __( 'Custom', 'blc' ),
47
+ ],
48
+ ],
49
+
50
+ blocksy_rand_md5() => [
51
+ 'type' => 'ct-condition',
52
+ 'condition' => [ 'about_source' => 'from_wp' ],
53
+ 'options' => [
54
+
55
+ 'wp_user' => [
56
+ 'type' => 'ct-select',
57
+ 'label' => __( 'User', 'blc' ),
58
+ 'value' => array_keys(blc_get_user_choices())[0],
59
+ 'design' => 'inline',
60
+ 'choices' => blocksy_ordered_keys(blc_get_user_choices()),
61
+ ],
62
+
63
+ ]
64
+ ],
65
+
66
+ blocksy_rand_md5() => [
67
+ 'type' => 'ct-condition',
68
+ 'condition' => [ 'about_source' => 'custom' ],
69
+ 'options' => [
70
+
71
+ 'about_avatar' => [
72
+ 'label' => __('Avatar', 'blc'),
73
+ 'type' => 'ct-image-uploader',
74
+ 'design' => 'inline',
75
+ 'value' => [ 'attachment_id' => null ],
76
+ 'attr' => [ 'data-type' => 'no-frame' ],
77
+ ],
78
+
79
+ 'about_name' => [
80
+ 'type' => 'text',
81
+ 'label' => __( 'Name', 'blc' ),
82
+ 'field_attr' => [ 'id' => 'widget-title' ],
83
+ 'design' => 'inline',
84
+ 'value' => __( 'John Doe', 'blc' ),
85
+ 'disableRevertButton' => true,
86
+ ],
87
+
88
+ 'about_text' => [
89
+ 'label' => __( 'Description', 'blc' ),
90
+ 'type' => 'textarea',
91
+ 'value' => '',
92
+ 'design' => 'inline',
93
+ 'disableRevertButton' => true,
94
+ ],
95
+ ],
96
+ ],
97
+
98
+ 'about_avatar_size' => [
99
+ 'type' => 'text',
100
+ 'label' => __( 'Avatar Size', 'blc' ),
101
+ 'design' => 'inline',
102
+ 'value' => 75,
103
+ 'disableRevertButton' => true,
104
+ ],
105
+
106
+ 'about_avatar_size' => [
107
+ 'label' => __( 'Avatar Size', 'blc' ),
108
+ 'type' => 'ct-select',
109
+ 'value' => 'small',
110
+ 'design' => 'inline',
111
+ 'disableRevertButton' => true,
112
+ 'choices' => [
113
+ 'small' => __( 'Small', 'blc' ),
114
+ 'medium' => __( 'Medium', 'blc' ),
115
+ 'large' => __( 'Large', 'blc' ),
116
+ ],
117
+ ],
118
+
119
+ 'avatar_shape' => [
120
+ 'label' => __( 'Avatar Shape', 'blc' ),
121
+ 'type' => 'ct-radio',
122
+ 'value' => 'rounded',
123
+ 'view' => 'radio',
124
+ 'design' => 'inline',
125
+ 'inline' => true,
126
+ 'disableRevertButton' => true,
127
+ 'choices' => [
128
+ 'rounded' => __( 'Rounded', 'blc' ),
129
+ 'square' => __( 'Square', 'blc' ),
130
+ ],
131
+ ],
132
+
133
+ 'about_alignment' => [
134
+ 'type' => 'ct-radio',
135
+ 'label' => __( 'Alignment', 'blocksy' ),
136
+ 'value' => 'center',
137
+ 'view' => 'text',
138
+ 'attr' => [ 'data-type' => 'alignment' ],
139
+ 'disableRevertButton' => true,
140
+ 'design' => 'inline',
141
+ 'setting' => [ 'transport' => 'postMessage' ],
142
+ 'choices' => [
143
+ 'left' => '',
144
+ 'center' => '',
145
+ 'right' => '',
146
+ ],
147
+ ],
148
+
149
+ 'about_socials' => [
150
+ 'type' => 'ct-layers',
151
+ 'label' => __( 'Social Channels', 'blc' ),
152
+ 'manageable' => true,
153
+ 'desc' => sprintf(
154
+ __( 'You can configure social URLs in %s.', 'blc' ),
155
+ sprintf(
156
+ '<a href="%s" target="_blank">%s</a>',
157
+ admin_url('/customize.php?autofocus[section]=social_accounts'),
158
+ __('Customizer', 'blc')
159
+ )
160
+ ),
161
+ 'value' => [
162
+ [
163
+ 'id' => 'facebook',
164
+ 'enabled' => true,
165
+ ],
166
+
167
+ [
168
+ 'id' => 'twitter',
169
+ 'enabled' => true,
170
+ ],
171
+
172
+ [
173
+ 'id' => 'instagram',
174
+ 'enabled' => true,
175
+ ],
176
+ ],
177
+
178
+ 'settings' => blc_call_fn(
179
+ [
180
+ 'fn' => 'blocksy_get_social_networks_list',
181
+ 'default' => []
182
+ ]
183
+ )
184
+ ],
185
+
186
+ 'about_social_icons_size' => [
187
+ 'label' => __( 'Icons Size', 'blc' ),
188
+ 'type' => 'ct-radio',
189
+ 'value' => 'small',
190
+ 'view' => 'text',
191
+ 'design' => 'block',
192
+ 'setting' => [ 'transport' => 'postMessage' ],
193
+ 'choices' => [
194
+ 'small' => __( 'Small', 'blc' ),
195
+ 'medium' => __( 'Medium', 'blc' ),
196
+ 'large' => __( 'Large', 'blc' ),
197
+ ],
198
+ ],
199
+
200
+ 'about_social_type' => [
201
+ 'label' => __( 'Icons Shape Type', 'blc' ),
202
+ 'type' => 'ct-radio',
203
+ 'value' => 'rounded',
204
+ 'view' => 'text',
205
+ 'design' => 'block',
206
+ 'setting' => [ 'transport' => 'postMessage' ],
207
+ 'choices' => [
208
+ 'simple' => __( 'None', 'blc' ),
209
+ 'rounded' => __( 'Rounded', 'blc' ),
210
+ 'square' => __( 'Square', 'blc' ),
211
+ ],
212
+ ],
213
+
214
+ blocksy_rand_md5() => [
215
+ 'type' => 'ct-condition',
216
+ 'condition' => [ 'about_social_type' => '!simple' ],
217
+ 'options' => [
218
+
219
+ 'about_social_icons_fill' => [
220
+ 'label' => __( 'Shape Fill Type', 'blc' ),
221
+ 'type' => 'ct-radio',
222
+ 'value' => 'outline',
223
+ 'view' => 'text',
224
+ 'design' => 'block',
225
+ 'setting' => [ 'transport' => 'postMessage' ],
226
+ 'choices' => [
227
+ 'solid' => __( 'Solid', 'blc' ),
228
+ 'outline' => __( 'Outline', 'blc' ),
229
+ ],
230
+ ],
231
+
232
+ ],
233
+ ],
234
+
235
+ ];
trunk/framework/extensions/widgets/widgets/ct-about-me/view.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * About me widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'About me', 'blc' ) );
13
+
14
+ $about_source = blocksy_default_akg('about_source', $atts, 'from_wp');
15
+ $about_type = blocksy_default_akg('about_type', $atts, 'simple');
16
+ $alignment = blocksy_default_akg('about_alignment', $atts, 'center');
17
+ $avatar_size = blocksy_default_akg('about_avatar_size', $atts, 'small');
18
+ $avatar_shape = blocksy_default_akg('avatar_shape', $atts, 'rounded');
19
+
20
+ $sizes = [
21
+ 'small' => 90,
22
+ 'medium' => 140,
23
+ 'large' => 200
24
+ ];
25
+
26
+ $user_id = blocksy_akg('wp_user', $atts, null);
27
+
28
+ $image_output = blc_call_fn(['fn' => 'blocksy_image'], [
29
+ 'attachment_id' => blocksy_default_akg('about_avatar/attachment_id', $atts, null),
30
+ 'ratio' => '1/1',
31
+ 'tag_name' => 'figure',
32
+ 'size' => $avatar_size === 'small' ? 'thumb' : 'medium',
33
+ // 'lazyload' => false,
34
+ 'html_atts' => [
35
+ 'data-size' => $avatar_size,
36
+ 'data-shape' => $avatar_shape,
37
+ ]
38
+ ]);
39
+
40
+ $about_name = blocksy_default_akg('about_name', $atts, __('John Doe', 'blc'));
41
+ $about_text = blocksy_default_akg('about_text', $atts, '');
42
+
43
+ if ($about_source === 'from_wp') {
44
+ if (! $user_id) {
45
+ require_once dirname( __FILE__ ) . '/helpers.php';
46
+ $user_id = array_keys(blc_get_user_choices())[0];
47
+ }
48
+
49
+ $image_output = blc_call_fn(
50
+ ['fn' => 'blocksy_simple_image'],
51
+ get_avatar_url($user_id, [
52
+ /*
53
+ 'size' => intval(
54
+ blocksy_default_akg('about_avatar_size', $atts, 75)
55
+ )
56
+ */
57
+ 'size' => $sizes[$avatar_size] * 2
58
+ ]),
59
+ [
60
+ 'tag_name' => 'figure',
61
+ 'ratio' => '1/1',
62
+ 'html_atts' => [
63
+ 'data-size' => $avatar_size,
64
+ 'data-shape' => $avatar_shape,
65
+ // 'style' => 'max-width: ' . blocksy_default_akg(
66
+ // 'about_avatar_size', $atts, 75
67
+ // ) . 'px'
68
+ ]
69
+ ]
70
+ );
71
+
72
+ $about_name = get_the_author_meta('display_name', $user_id);
73
+ $about_text = get_the_author_meta('description', $user_id);
74
+ }
75
+
76
+ $size = blocksy_default_akg('about_social_icons_size', $atts, 'small');
77
+ $type = blocksy_default_akg('about_social_type', $atts, 'rounded');
78
+ $fill = blocksy_default_akg('about_social_icons_fill', $atts, 'outline');
79
+
80
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
81
+ echo $before_widget;
82
+
83
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
84
+ echo $before_title . wp_kses_post( $title ) . $after_title;
85
+ ?>
86
+
87
+
88
+ <section
89
+ data-type="<?php echo esc_attr($about_type) ?>"
90
+ data-alignment="<?php echo esc_attr($alignment) ?>">
91
+
92
+ <?php echo $image_output; ?>
93
+
94
+ <h6 class="ct-about-me-name">
95
+ <?php echo $about_name; ?>
96
+
97
+ <?php if ($about_source === 'from_wp') { ?>
98
+ <a href="<?php echo get_author_posts_url($user_id) ?>" class="ct-about-me-link">
99
+ <?php echo __('View Profile', 'blc') ?>
100
+ </a>
101
+ <?php } ?>
102
+ </h6>
103
+
104
+ <div class="ct-about-me-text"><?php echo $about_text; ?></div>
105
+
106
+ <?php
107
+ echo blc_call_fn(
108
+ ['fn' => 'blocksy_social_icons'],
109
+ blocksy_default_akg(
110
+ 'about_socials',
111
+ $atts,
112
+ [
113
+ [
114
+ 'id' => 'facebook',
115
+ 'enabled' => true,
116
+ ],
117
+
118
+ [
119
+ 'id' => 'twitter',
120
+ 'enabled' => true,
121
+ ],
122
+
123
+ [
124
+ 'id' => 'instagram',
125
+ 'enabled' => true,
126
+ ],
127
+ ]
128
+ ),
129
+
130
+ [
131
+ 'size' => $size,
132
+ 'type' => $type,
133
+ 'fill' => $fill
134
+ ]
135
+ );
136
+ ?>
137
+ </section>
138
+
139
+ <?php echo wp_kses_post($after_widget); ?>
trunk/framework/extensions/widgets/widgets/ct-about-me/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * About me widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_About_Me extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('About Me', 'blc'),
14
+ 'description' => __('About me', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
trunk/framework/extensions/widgets/widgets/ct-advertisement/options.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ $options = [
12
+
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'Advertisement', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'ad_source' => [
23
+ 'label' => __( 'Source', 'blc' ),
24
+ 'type' => 'ct-radio',
25
+ 'value' => 'code',
26
+ 'view' => 'radio',
27
+ 'design' => 'inline',
28
+ 'inline' => true,
29
+ 'disableRevertButton' => true,
30
+ 'choices' => [
31
+ 'code' => __( 'Code', 'blc' ),
32
+ 'upload' => __( 'Image', 'blc' ),
33
+ ],
34
+ ],
35
+
36
+ blocksy_rand_md5() => [
37
+ 'type' => 'ct-condition',
38
+ 'condition' => [ 'ad_source' => 'code' ],
39
+ 'options' => [
40
+
41
+ 'ad_code' => [
42
+ 'label' => __( 'Ad Code', 'blc' ),
43
+ 'type' => 'textarea',
44
+ 'value' => '',
45
+ 'design' => 'inline',
46
+ 'disableRevertButton' => true,
47
+ ],
48
+
49
+ ],
50
+ ],
51
+
52
+ blocksy_rand_md5() => [
53
+ 'type' => 'ct-condition',
54
+ 'condition' => [ 'ad_source' => 'upload' ],
55
+ 'options' => [
56
+
57
+ 'ad_image' => [
58
+ 'label' => __('Upload Image', 'blc'),
59
+ 'type' => 'ct-image-uploader',
60
+ 'design' => 'inline',
61
+ 'value' => [ 'attachment_id' => null ],
62
+ 'emptyLabel' => __('Select Image', 'blc'),
63
+ 'filledLabel' => __('Change Image', 'blc'),
64
+ ],
65
+
66
+ 'ad_link' => [
67
+ 'type' => 'text',
68
+ 'label' => __( 'Ad URL', 'blc' ),
69
+ 'design' => 'inline',
70
+ 'value' => 'https://creativethemes.com',
71
+ 'disableRevertButton' => true,
72
+ ],
73
+
74
+ 'ad_link_target' => [
75
+ 'type' => 'ct-switch',
76
+ 'label' => __( 'Open link in new tab', 'blc' ),
77
+ 'value' => 'yes',
78
+ 'disableRevertButton' => true,
79
+ ],
80
+
81
+ ],
82
+ ],
83
+
84
+ ];
trunk/framework/extensions/widgets/widgets/ct-advertisement/view.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'Advertisement', 'blc' ) );
13
+
14
+ // Ad source
15
+ $source = blocksy_default_akg( 'ad_source', $atts, 'code' );
16
+
17
+ // Button text
18
+ $ad_code = blocksy_default_akg( 'ad_code', $atts, '' );
19
+
20
+ // Ad link
21
+ $ad_link = blocksy_default_akg( 'ad_link', $atts, '' );
22
+
23
+ if (empty(trim($ad_link))) {
24
+ $ad_link = '#';
25
+ }
26
+
27
+ // Ad link target
28
+ $ad_link_target = blocksy_default_akg( 'ad_link_target', $atts, 'yes' );
29
+
30
+ $image_output = blc_call_fn(['fn' => 'blocksy_image'], [
31
+ 'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
32
+ 'ratio' => 'original',
33
+ 'tag_name' => 'a',
34
+ 'size' => 'large',
35
+ 'html_atts' => array_merge([
36
+ 'href' => esc_url( $ad_link ),
37
+ ], $ad_link_target !== 'yes' ? [] : [
38
+ 'target' => '_blank'
39
+ ]),
40
+ ]);
41
+
42
+
43
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
44
+ echo $before_widget;
45
+
46
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
47
+ if (! empty(trim($title))) {
48
+ echo $before_title . wp_kses_post( $title ) . $after_title;
49
+ }
50
+
51
+ ?>
52
+
53
+ <div class="ct-advertisement">
54
+ <?php if ( $source === 'code' ) {
55
+ echo $ad_code;
56
+ } else {
57
+ echo $image_output;
58
+ } ?>
59
+ </div>
60
+
61
+ <?php echo wp_kses_post($after_widget); ?>
trunk/framework/extensions/widgets/widgets/ct-advertisement/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Advertisement extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Advertisement', 'blc'),
14
+ 'description' => __('Advertisement', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
trunk/framework/extensions/widgets/widgets/ct-contact-info/options.php ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contact Info widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ $options = [
12
+
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'Contact Info', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'contact_text' => [
23
+ 'label' => __( 'Text', 'blc' ),
24
+ 'type' => 'textarea',
25
+ 'design' => 'inline',
26
+ 'disableRevertButton' => true,
27
+ ],
28
+
29
+ 'contact_information' => [
30
+ 'label' => false,
31
+ 'type' => 'ct-layers',
32
+ 'manageable' => true,
33
+ 'value' => [
34
+ [
35
+ 'id' => 'address',
36
+ 'enabled' => true,
37
+ 'title' => __('Address:', 'blc'),
38
+ 'content' => 'Street Name, NY 38954',
39
+ ],
40
+
41
+ [
42
+ 'id' => 'phone',
43
+ 'enabled' => true,
44
+ 'title' => __('Phone:', 'blc'),
45
+ 'content' => '578-393-4937',
46
+ 'link' => 'tel:578-393-4937',
47
+ ],
48
+
49
+ [
50
+ 'id' => 'mobile',
51
+ 'enabled' => true,
52
+ 'title' => __('Mobile:', 'blc'),
53
+ 'content' => '578-393-4937',
54
+ 'link' => 'tel:578-393-4937',
55
+ ],
56
+
57
+ ],
58
+
59
+ 'settings' => [
60
+ 'address' => [
61
+ 'label' => __( 'Address', 'blc' ),
62
+ 'options' => [
63
+ 'title' => [
64
+ 'type' => 'text',
65
+ 'label' => __('Title', 'blc'),
66
+ 'value' => __('Address:', 'blc'),
67
+ 'design' => 'inline',
68
+ ],
69
+
70
+ 'content' => [
71
+ 'type' => 'text',
72
+ 'label' => __('Content', 'blc'),
73
+ 'value' => 'Street Name, NY 38954',
74
+ 'design' => 'inline',
75
+ ],
76
+
77
+ 'link' => [
78
+ 'type' => 'text',
79
+ 'label' => __('Link (optional)', 'blc'),
80
+ 'design' => 'inline',
81
+ ]
82
+ ],
83
+
84
+ 'clone' => true
85
+ ],
86
+
87
+ 'phone' => [
88
+ 'label' => __( 'Phone', 'blc' ),
89
+ 'clone' => true,
90
+ 'options' => [
91
+
92
+ 'title' => [
93
+ 'type' => 'text',
94
+ 'label' => __('Title', 'blc'),
95
+ 'value' => __('Phone:', 'blc'),
96
+ 'design' => 'inline',
97
+ ],
98
+
99
+ 'content' => [
100
+ 'type' => 'text',
101
+ 'label' => __('Content', 'blc'),
102
+ 'value' => '578-393-4937',
103
+ 'design' => 'inline',
104
+ ],
105
+
106
+ 'link' => [
107
+ 'type' => 'text',
108
+ 'label' => __('Link (optional)', 'blc'),
109
+ 'value' => 'tel:578-393-4937',
110
+ 'design' => 'inline',
111
+ ]
112
+
113
+ ]
114
+ ],
115
+
116
+ 'mobile' => [
117
+ 'label' => __( 'Mobile', 'blc' ),
118
+ 'clone' => true,
119
+ 'options' => [
120
+ 'title' => [
121
+ 'type' => 'text',
122
+ 'label' => __('Title', 'blc'),
123
+ 'value' => __('Mobile:', 'blc'),
124
+ 'design' => 'inline',
125
+ ],
126
+
127
+ 'content' => [
128
+ 'type' => 'text',
129
+ 'label' => __('Content', 'blc'),
130
+ 'value' => '578-393-4937',
131
+ 'design' => 'inline',
132
+ ],
133
+
134
+ 'link' => [
135
+ 'type' => 'text',
136
+ 'label' => __('Link (optional)', 'blc'),
137
+ 'value' => 'tel:578-393-4937',
138
+ 'design' => 'inline',
139
+ ],
140
+
141
+ ]
142
+ ],
143
+
144
+ 'hours' => [
145
+ 'label' => __( 'Work Hours', 'blc' ),
146
+ 'clone' => true,
147
+ 'options' => [
148
+ 'title' => [
149
+ 'type' => 'text',
150
+ 'label' => __('Title', 'blc'),
151
+ 'value' => __('Opening hours', 'blc'),
152
+ 'design' => 'inline',
153
+ ],
154
+
155
+ 'content' => [
156
+ 'type' => 'text',
157
+ 'label' => __('Content', 'blc'),
158
+ 'value' => '9AM - 5PM',
159
+ 'design' => 'inline',
160
+ ],
161
+
162
+ 'link' => [
163
+ 'type' => 'text',
164
+ 'label' => __('Link (optional)', 'blc'),
165
+ 'value' => '',
166
+ 'design' => 'inline',
167
+ ],
168
+
169
+ ]
170
+ ],
171
+
172
+ 'fax' => [
173
+ 'label' => __( 'Fax', 'blc' ),
174
+ 'clone' => true,
175
+ 'options' => [
176
+ 'title' => [
177
+ 'type' => 'text',
178
+ 'label' => __('Title', 'blc'),
179
+ 'value' => __('Fax:', 'blc'),
180
+ 'design' => 'inline',
181
+ ],
182
+
183
+ 'content' => [
184
+ 'type' => 'text',
185
+ 'label' => __('Content', 'blc'),
186
+ 'value' => '578-393-4937',
187
+ 'design' => 'inline',
188
+ ],
189
+
190
+ 'link' => [
191
+ 'type' => 'text',
192
+ 'label' => __('Link (optional)', 'blc'),
193
+ 'value' => 'tel:578-393-4937',
194
+ 'design' => 'inline',
195
+ ],
196
+
197
+ ]
198
+ ],
199
+
200
+ 'email' => [
201
+ 'label' => __( 'Email', 'blc' ),
202
+ 'clone' => true,
203
+ 'options' => [
204
+ 'title' => [
205
+ 'type' => 'text',
206
+ 'label' => __('Title', 'blc'),
207
+ 'value' => __('Email:', 'blc'),
208
+ 'design' => 'inline',
209
+ ],
210
+
211
+ 'content' => [
212
+ 'type' => 'text',
213
+ 'label' => __('Content', 'blc'),
214
+ 'value' => 'contact@yourwebsite.com',
215
+ 'design' => 'inline',
216
+ ],
217
+
218
+ 'link' => [
219
+ 'type' => 'text',
220
+ 'label' => __('Link (optional)', 'blc'),
221
+ 'value' => 'mailto:contact@yourwebsite.com',
222
+ 'design' => 'inline',
223
+ ],
224
+
225
+ ]
226
+ ],
227
+
228
+ 'website' => [
229
+ 'label' => __( 'Website', 'blc' ),
230
+ 'clone' => true,
231
+ 'options' => [
232
+ 'title' => [
233
+ 'type' => 'text',
234
+ 'label' => __('Title', 'blc'),
235
+ 'value' => __('Website:', 'blc'),
236
+ 'design' => 'inline',
237
+ ],
238
+
239
+ 'content' => [
240
+ 'type' => 'text',
241
+ 'label' => __('Content', 'blc'),
242
+ 'value' => 'creativethemes.com',
243
+ 'design' => 'inline',
244
+ ],
245
+
246
+ 'link' => [
247
+ 'type' => 'text',
248
+ 'label' => __('Link (optional)', 'blc'),
249
+ 'value' => 'https://creativethemes.com',
250
+ 'design' => 'inline',
251
+ ],
252
+ ]
253
+ ],
254
+ ],
255
+ ],
256
+
257
+ 'contacts_icons_size' => [
258
+ 'label' => __( 'Icons Size', 'blc' ),
259
+ 'type' => 'ct-radio',
260
+ 'value' => 'medium',
261
+ 'view' => 'text',
262
+ 'design' => 'block',
263
+ 'setting' => [ 'transport' => 'postMessage' ],
264
+ 'choices' => [
265
+ 'small' => __( 'Small', 'blc' ),
266
+ 'medium' => __( 'Medium', 'blc' ),
267
+ 'large' => __( 'Large', 'blc' ),
268
+ ],
269
+ ],
270
+
271
+ 'contacts_icon_shape' => [
272
+ 'label' => __( 'Icons Shape Type', 'blc' ),
273
+ 'type' => 'ct-radio',
274
+ 'value' => 'rounded',
275
+ 'view' => 'text',
276
+ 'design' => 'block',
277
+ 'setting' => [ 'transport' => 'postMessage' ],
278
+ 'choices' => [
279
+ 'simple' => __( 'None', 'blc' ),
280
+ 'rounded' => __( 'Rounded', 'blc' ),
281
+ 'square' => __( 'Square', 'blc' ),
282
+ ],
283
+ ],
284
+
285
+ blocksy_rand_md5() => [
286
+ 'type' => 'ct-condition',
287
+ 'condition' => [ 'contacts_icon_shape' => '!simple' ],
288
+ 'options' => [
289
+
290
+ 'contacts_icon_fill_type' => [
291
+ 'label' => __( 'Shape Fill Type', 'blc' ),
292
+ 'type' => 'ct-radio',
293
+ 'value' => 'outline',
294
+ 'view' => 'text',
295
+ 'design' => 'block',
296
+ 'setting' => [ 'transport' => 'postMessage' ],
297
+ 'choices' => [
298
+ 'solid' => __( 'Solid', 'blc' ),
299
+ 'outline' => __( 'Outline', 'blc' ),
300
+ ],
301
+ ],
302
+
303
+ ],
304
+ ],
305
+
306
+ 'contact_link_target' => [
307
+ 'type' => 'ct-switch',
308
+ 'label' => __( 'Open link in new tab', 'blc' ),
309
+ 'value' => 'no',
310
+ 'disableRevertButton' => true,
311
+ ],
312
+ ];
trunk/framework/extensions/widgets/widgets/ct-contact-info/view.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'Contact Info', 'blc' ) );
13
+
14
+ // Text
15
+ $text = blocksy_default_akg( 'contact_text', $atts, '' );
16
+
17
+ $contact_information = blocksy_default_akg(
18
+ 'contact_information',
19
+ $atts,
20
+ [
21
+ [
22
+ 'id' => 'address',
23
+ 'enabled' => true,
24
+ 'title' => __('Address:', 'blc'),
25
+ 'content' => 'Street Name, NY 38954',
26
+ ],
27
+
28
+ [
29
+ 'id' => 'phone',
30
+ 'enabled' => true,
31
+ 'title' => __('Phone:', 'blc'),
32
+ 'content' => '578-393-4937',
33
+ 'link' => 'tel:578-393-4937',
34
+ ],
35
+
36
+ [
37
+ 'id' => 'mobile',
38
+ 'enabled' => true,
39
+ 'title' => __('Mobile:', 'blc'),
40
+ 'content' => '578-393-4937',
41
+ 'link' => 'tel:578-393-4937',
42
+ ],
43
+ ]
44
+ );
45
+
46
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
47
+ echo $before_widget;
48
+
49
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
50
+ if (! empty($title)) {
51
+ echo $before_title . wp_kses_post($title) . $after_title;
52
+ }
53
+
54
+ ?>
55
+
56
+ <?php if (! empty($text)) { ?>
57
+ <div class="ct-contact-info-text">
58
+ <?php echo wp_kses_post($text) ?>
59
+ </div>
60
+ <?php }
61
+
62
+ echo blc_call_fn(['fn' => 'blc_get_contacts_output'], [
63
+ 'data' => $contact_information,
64
+ 'link_target' => blocksy_default_akg('contact_link_target', $atts, 'no'),
65
+ 'type' => blocksy_akg('contacts_icon_shape', $atts, 'rounded'),
66
+ 'fill' => blocksy_akg('contacts_icon_fill_type', $atts, 'outline'),
67
+ 'size' => blocksy_akg('contacts_icons_size', $atts, 'medium')
68
+ ]);
69
+
70
+ echo wp_kses_post($after_widget);
trunk/framework/extensions/widgets/widgets/ct-contact-info/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contact Info widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Contact_Info extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Contact Info', 'blc'),
14
+ 'description' => __('Contact info', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
trunk/framework/extensions/widgets/widgets/ct-facebook/options.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Facebook widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ $options = [
11
+ 'title' => [
12
+ 'type' => 'text',
13
+ 'label' => __( 'Title', 'blc' ),
14
+ 'field_attr' => [ 'id' => 'widget-title' ],
15
+ 'design' => 'inline',
16
+ 'value' => __( 'Facebook', 'blc' ),
17
+ 'disableRevertButton' => true,
18
+ ],
19
+
20
+ 'facebook_page_url' => [
21
+ 'type' => 'text',
22
+ 'label' => __( 'Page URL', 'blc' ),
23
+ 'field_attr' => [ 'id' => 'widget-title' ],
24
+ 'design' => 'inline',
25
+ 'disableRevertButton' => true,
26
+ ],
27
+
28
+ 'facebook_faces' => [
29
+ 'type' => 'ct-switch',
30
+ 'label' => __( 'Profile Photos', 'blc' ),
31
+ 'value' => 'yes',
32
+ ],
33
+
34
+ 'facebook_timeline' => [
35
+ 'type' => 'ct-switch',
36
+ 'label' => __( 'Timeline', 'blc' ),
37
+ 'value' => 'no',
38
+ ],
39
+
40
+ 'facebook_cover' => [
41
+ 'type' => 'ct-switch',
42
+ 'label' => __( 'Cover Photo', 'blc' ),
43
+ 'value' => 'no',
44
+ ],
45
+
46
+ 'facebook_small_header' => [
47
+ 'type' => 'ct-switch',
48
+ 'label' => __( 'Small Header', 'blc' ),
49
+ 'value' => 'no',
50
+ ],
51
+
52
+ ];
trunk/framework/extensions/widgets/widgets/ct-facebook/view.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Facebook widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'Facebook', 'blc' ) );
13
+
14
+ $url = blocksy_default_akg('facebook_page_url', $atts, '');
15
+
16
+ if (empty($url)) {
17
+ return;
18
+ }
19
+
20
+ $faces = blocksy_default_akg('facebook_faces', $atts, 'yes') === 'yes' ? 'true' : 'false';
21
+ $cover = blocksy_default_akg('facebook_cover', $atts, 'no') === 'yes' ? 'false' : 'true';
22
+ $header = blocksy_default_akg('facebook_small_header', $atts, 'no') === 'yes' ? 'true' : 'false';
23
+ $timeline = blocksy_default_akg('facebook_timeline', $atts, 'no') === 'yes' ? 'timeline' : '';
24
+ $posts = blocksy_default_akg('facebook_posts', $atts, 'no') === 'yes' ? 'true' : 'false';
25
+
26
+ $app_id = '';
27
+
28
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
29
+ echo $before_widget;
30
+
31
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
32
+ echo $before_title . wp_kses_post( $title ) . $after_title;
33
+
34
+ ?>
35
+
36
+ <div class="ct-facebook-like-box">
37
+ <div class="fb-page"
38
+ data-href="<?php echo esc_url( $url ); ?>"
39
+ data-width="500"
40
+ data-hide-cover="<?php echo $cover; ?>"
41
+ data-show-facepile="<?php echo $faces; ?>"
42
+ data-small-header="<?php echo $header; ?>"
43
+ data-tabs="<?php echo $timeline; ?>"></div>
44
+
45
+ <div id="fb-root"></div>
46
+
47
+ <script>(function(d, s, id) {
48
+ var js, fjs = d.getElementsByTagName(s)[0];
49
+ if (d.getElementById(id)) return;
50
+ js = d.createElement(s); js.id = id;
51
+ js.src = 'https://connect.facebook.net/<?php echo esc_attr(get_locale()); ?>/sdk.js#xfbml=1&version=v3.2<?php
52
+ if ( ! empty( $app_id ) ) {
53
+ echo '&appId=' . esc_attr($app_id);
54
+ }
55
+ ?>';
56
+ fjs.parentNode.insertBefore(js, fjs);
57
+ }(document, 'script', 'facebook-jssdk'));</script>
58
+
59
+ </div>
60
+
61
+ <?php echo wp_kses_post( $after_widget ); ?>
trunk/framework/extensions/widgets/widgets/ct-facebook/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Facebook widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Facebook extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Facebook', 'blc'),
14
+ 'description' => __('Facebook like box', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
trunk/framework/extensions/widgets/widgets/ct-posts/options.php ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ $all_post_types = [
11
+ 'post' => __('Posts', 'blc'),
12
+ 'page' => __('Pages', 'blc'),
13
+ ];
14
+
15
+ if (function_exists('blocksy_manager')) {
16
+ $post_types = blocksy_manager()->post_types->get_supported_post_types();
17
+
18
+ foreach ($post_types as $single_post_type) {
19
+ $post_type_object = get_post_type_object($single_post_type);
20
+
21
+ if (! $post_type_object) {
22
+ continue;
23
+ }
24
+
25
+ $all_post_types[$single_post_type] = $post_type_object->labels->singular_name;
26
+ }
27
+ }
28
+
29
+ $cpt_options = [];
30
+
31
+ foreach ($all_post_types as $custom_post_type => $label) {
32
+ if ($custom_post_type === 'page') {
33
+ continue;
34
+ }
35
+
36
+ $opt_id = 'category';
37
+ $label = __('Category', 'blc');
38
+ $label_multiple = __('All categories', 'blc');
39
+ $taxonomy = 'category';
40
+
41
+ if ($custom_post_type !== 'post') {
42
+ $opt_id = $custom_post_type . '_taxonomy';
43
+ $label = __('Taxonomy', 'blc');
44
+ $label_multiple = __('All taxonomies', 'blc');
45
+
46
+ $taxonomies = get_object_taxonomies($custom_post_type);
47
+
48
+ if (count($taxonomies) > 0) {
49
+ $taxonomy = $taxonomies[0];
50
+ } else {
51
+ $taxonomy = 'nonexistent';
52
+ }
53
+ }
54
+
55
+ $categories = get_terms([
56
+ 'taxonomy' => $taxonomy,
57
+ // 'post_type' => $custom_post_type,
58
+ 'orderby' => 'name',
59
+ 'order' => 'ASC',
60
+ 'hide_empty' => false
61
+ ]);
62
+
63
+ $category_choices = [
64
+ 'all_categories' => $label_multiple
65
+ ];
66
+
67
+ if (! is_wp_error($categories)) {
68
+ foreach ($categories as $category) {
69
+ $category_choices[$category->term_id] = $category->name;
70
+ }
71
+ }
72
+
73
+ $cpt_options[blocksy_rand_md5()] = [
74
+ 'type' => 'ct-condition',
75
+ 'condition' => [
76
+ 'post_type_source' => $custom_post_type,
77
+ 'post_source' => '!custom'
78
+ ],
79
+ 'options' => [
80
+ $opt_id => [
81
+ 'type' => 'ct-select',
82
+ 'label' => $label,
83
+ 'value' => 'all_categories',
84
+ 'choices' => blocksy_ordered_keys($category_choices),
85
+ 'design' => 'inline',
86
+ ],
87
+ ]
88
+ ];
89
+ }
90
+
91
+ $options = [
92
+ [
93
+ 'title' => [
94
+ 'type' => 'text',
95
+ 'label' => __('Title', 'blc'),
96
+ 'field_attr' => ['id' => 'widget-title'],
97
+ 'design' => 'inline',
98
+ 'value' => __('Posts', 'blc'),
99
+ ],
100
+
101
+ 'posts_type' => [
102
+ 'type' => 'ct-select',
103
+ 'label' => __('Widget Design', 'blc'),
104
+ 'value' => 'small-thumbs',
105
+ 'design' => 'inline',
106
+ 'choices' => blocksy_ordered_keys(
107
+ [
108
+ 'no-thumbs' => __( 'Without Thumbnails', 'blc' ),
109
+ 'small-thumbs' => __( 'Small Thumbnails', 'blc' ),
110
+ 'large-thumbs' => __( 'Large Thumbnails', 'blc' ),
111
+ 'large-small' => __( 'First Thumbnail Large', 'blc' ),
112
+ 'rounded' => __( 'Rounded Thumbnails', 'blc' ),
113
+ 'numbered' => __( 'Numbered', 'blc' ),
114
+ ]
115
+ ),
116
+ ],
117
+
118
+ blocksy_rand_md5() => [
119
+ 'type' => 'ct-condition',
120
+ 'condition' => [
121
+ 'posts_type' => 'small-thumbs|large-thumbs|large-small',
122
+ ],
123
+ 'options' => [
124
+
125
+ 'post_widget_image_ratio' => [
126
+ 'label' => __( 'Image Ratio', 'blocksy' ),
127
+ 'type' => 'ct-ratio',
128
+ 'value' => 'original',
129
+ 'design' => 'inline',
130
+ ],
131
+
132
+ ],
133
+ ],
134
+
135
+ 'post_type_source' => [
136
+ 'type' => 'ct-select',
137
+ 'label' => __( 'Post Type', 'blc' ),
138
+ 'value' => 'post',
139
+ 'design' => 'inline',
140
+ 'choices' => blocksy_ordered_keys($all_post_types)
141
+ ],
142
+
143
+ blocksy_rand_md5() => [
144
+ 'type' => 'ct-condition',
145
+ 'condition' => ['post_type_source' => '!page'],
146
+ 'options' => [
147
+ 'post_source' => [
148
+ 'type' => 'ct-select',
149
+ 'label' => __( 'Source', 'blc' ),
150
+ 'value' => 'categories',
151
+ 'design' => 'inline',
152
+ 'choices' => blocksy_ordered_keys(
153
+ [
154
+ 'categories' => __('Taxonomies', 'blc'),
155
+ 'custom' => __( 'Custom Query', 'blc' ),
156
+ ]
157
+ ),
158
+ ],
159
+ ],
160
+ ],
161
+
162
+ blocksy_rand_md5() => [
163
+ 'type' => 'ct-condition',
164
+ 'condition' => ['post_type_source' => 'page'],
165
+ 'options' => [
166
+ 'page_source' => [
167
+ 'type' => 'ct-select',
168
+ 'label' => __('Source', 'blc'),
169
+ 'value' => 'default',
170
+ 'design' => 'inline',
171
+ 'choices' => blocksy_ordered_keys(
172
+ [
173
+ 'default' => __('Default', 'blc'),
174
+ 'custom' => __('Custom Query', 'blc'),
175
+ ]
176
+ ),
177
+ ],
178
+ ],
179
+ ],
180
+ ],
181
+
182
+ $cpt_options,
183
+
184
+ blocksy_rand_md5() => [
185
+ 'type' => 'ct-condition',
186
+ 'condition' => [
187
+ 'post_type_source' => '!page',
188
+ 'post_source' => '!custom'
189
+ ],
190
+ 'options' => [
191
+ 'type' => [
192
+ 'type' => 'ct-select',
193
+ 'label' => __( 'Sort by', 'blc' ),
194
+ 'value' => 'commented',
195
+ 'design' => 'inline',
196
+ 'choices' => blocksy_ordered_keys(
197
+ [
198
+ 'recent' => __( 'Recent', 'blc' ),
199
+ 'commented' => __( 'Most Commented', 'blc' ),
200
+ ]
201
+ ),
202
+ ],
203
+
204
+ 'days' => [
205
+ 'type' => 'ct-select',
206
+ 'label' => __( 'Order by', 'blc' ),
207
+ 'value' => 'all_time',
208
+ 'design' => 'inline',
209
+ 'choices' => blocksy_ordered_keys(
210
+ [
211
+ 'all_time' => __( 'All Time', 'blc' ),
212
+ '7' => __( '1 Week', 'blc' ),
213
+ '30' => __( '1 Month', 'blc' ),
214
+ '90' => __( '3 Months', 'blc' ),
215
+ '180' => __( '6 Months', 'blc' ),
216
+ '360' => __( '1 Year', 'blc' ),
217
+ ]
218
+ ),
219
+ ],
220
+
221
+ 'posts_number' => [
222
+ 'type' => 'ct-number',
223
+ 'label' => __( 'Posts Count', 'blc' ),
224
+ 'min' => 1,
225
+ 'max' => 30,
226
+ 'value' => 5,
227
+ 'design' => 'inline',
228
+ ],
229
+ ],
230
+ ],
231
+
232
+ blocksy_rand_md5() => [
233
+ 'type' => 'ct-condition',
234
+ 'condition' => [
235
+ 'post_type_source' => '!page',
236
+ 'post_source' => 'custom'
237
+ ],
238
+ 'options' => [
239
+
240
+ 'post_id' => [
241
+ 'label' => __( 'Posts ID', 'blocksy' ),
242
+ 'type' => 'text',
243
+ 'design' => 'inline',
244
+ 'desc' => sprintf(
245
+ __('Separate posts ID by comma. How to find the %spost ID%s.', 'blocksy'),
246
+ '<a href="https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/" target="_blank">',
247
+ '</a>'
248
+ ),
249
+ ],
250
+
251
+ ],
252
+ ],
253
+
254
+ blocksy_rand_md5() => [
255
+ 'type' => 'ct-condition',
256
+ 'condition' => [
257
+ 'post_type_source' => 'page',
258
+ 'page_source' => 'custom'
259
+ ],
260
+ 'options' => [
261
+
262
+ 'page_id' => [
263
+ 'label' => __( 'Pages ID', 'blocksy' ),
264
+ 'type' => 'text',
265
+ 'design' => 'inline',
266
+ 'desc' => sprintf(
267
+ __('Separate pages ID by comma. How to find the %spage ID%s.', 'blocksy'),
268
+ '<a href="https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/" target="_blank">',
269
+ '</a>'
270
+ ),
271
+ ],
272
+
273
+ ],
274
+ ],
275
+
276
+ blocksy_rand_md5() => [
277
+ 'type' => 'ct-condition',
278
+ 'condition' => [
279
+ 'post_type_source' => 'page',
280
+ 'page_source' => '!custom'
281
+ ],
282
+ 'options' => [
283
+ 'page_number' => [
284
+ 'type' => 'ct-number',
285
+ 'label' => __( 'Pages Count', 'blc' ),
286
+ 'min' => 1,
287
+ 'max' => 30,
288
+ 'value' => 5,
289
+ 'design' => 'inline',
290
+ ],
291
+ ],
292
+ ],
293
+
294
+ 'display_date' => [
295
+ 'type' => 'ct-switch',
296
+ 'label' => __( 'Show Date', 'blc' ),
297
+ 'value' => 'no',
298
+ ],
299
+
300
+ 'display_comments' => [
301
+ 'type' => 'ct-switch',
302
+ 'label' => __( 'Show Comments', 'blc' ),
303
+ 'value' => 'no',
304
+ ],
305
+
306
+ 'display_excerpt' => [
307
+ 'type' => 'ct-switch',
308
+ 'label' => __( 'Show Excerpt', 'blc' ),
309
+ 'value' => 'no',
310
+ ],
311
+
312
+ blocksy_rand_md5() => [
313
+ 'type' => 'ct-condition',
314
+ 'condition' => [ 'display_excerpt' => 'yes' ],
315
+ 'options' => [
316
+
317
+ 'excerpt_lenght' => [
318
+ 'type' => 'ct-number',
319
+ 'label' => __( 'Excerpt Lenght', 'blc' ),
320
+ 'min' => 5,
321
+ 'max' => 30,
322
+ 'value' => 10,
323
+ 'design' => 'inline',
324
+ ],
325
+
326
+ ],
327
+ ],
328
+ ];
329
+
trunk/framework/extensions/widgets/widgets/ct-posts/view.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ $post_type = blocksy_default_akg('post_type_source', $atts, 'post');
11
+
12
+ $query_args = [
13
+ 'order' => 'DESC',
14
+ 'ignore_sticky_posts' => true,
15
+ 'post_type' => $post_type
16
+ ];
17
+
18
+ if ($post_type !== 'page') {
19
+ $source = blocksy_default_akg('post_source', $atts, 'categories');
20
+
21
+ if ($source === 'categories') {
22
+ $date_query = [];
23
+
24
+ $days = blocksy_default_akg('days', $atts, 'all_time');
25
+
26
+ if ($days && 'all_time' !== $days) {
27
+ $time = time() - (intval($days) * 24 * 60 * 60);
28
+
29
+ $date_query = [
30
+ 'after' => date('F jS, Y', $time),
31
+ 'before' => date('F jS, Y'),
32
+ 'inclusive' => true,
33
+ ];
34
+ }
35
+
36
+ $cat_option_id = 'category';
37
+ $taxonomy = 'category';
38
+
39
+ if ($post_type !== 'post') {
40
+ $cat_option_id = $post_type . '_taxonomy';
41
+ $taxonomies = get_object_taxonomies($post_type);
42
+
43
+ if (count($taxonomies) > 0) {
44
+ $taxonomy = $taxonomies[0];
45
+ }
46
+ }
47
+
48
+ $cat_id = blocksy_default_akg($cat_option_id, $atts, 'all_categories');
49
+ $cat_id = (empty($cat_id) || 'all_categories' === $cat_id) ? '' : $cat_id;
50
+
51
+ $query_args['orderby'] = ('recent' === blocksy_default_akg(
52
+ 'type', $atts, 'recent'
53
+ )) ? 'post_date' : 'comment_count';
54
+
55
+ $query_args['date_query'] = $date_query;
56
+
57
+ if (! empty($cat_id)) {
58
+ $query_args['tax_query'] = [
59
+ [
60
+ 'taxonomy' => $taxonomy,
61
+ 'field' => 'term_id',
62
+ 'terms' => [$cat_id]
63
+ ]
64
+ ];
65
+ }
66
+
67
+ $query_args['posts_per_page'] = intval(
68
+ blocksy_default_akg('posts_number', $atts, 5)
69
+ );
70
+ }
71
+
72
+ if ($source === 'custom') {
73
+ $post_id = blocksy_default_akg('post_id', $atts, '');
74
+
75
+ $query_args['orderby'] = 'post__in';
76
+ $query_args['post__in'] = ['__INEXISTING__'];
77
+
78
+ if (! empty(trim($post_id))) {
79
+ $query_args['post__in'] = explode(',', str_replace(' ', '', trim(
80
+ $post_id
81
+ )));
82
+ }
83
+ }
84
+ }
85
+
86
+ if ($post_type === 'page') {
87
+ $source = blocksy_default_akg('page_source', $atts, 'default');
88
+
89
+ if ($source === 'default') {
90
+ $query_args['posts_per_page'] = intval(
91
+ blocksy_default_akg('page_number', $atts, 5)
92
+ );
93
+ }
94
+
95
+ if ($source === 'custom') {
96
+ $post_id = blocksy_default_akg('page_id', $atts, '');
97
+
98
+ $query_args['orderby'] = 'post__in';
99
+ $query_args['post__in'] = ['__INEXISTING__'];
100
+
101
+ if (! empty(trim($post_id))) {
102
+ $query_args['post__in'] = explode(',', str_replace(' ', '', trim(
103
+ $post_id
104
+ )));
105
+ }
106
+ }
107
+ }
108
+
109
+ $query = new WP_Query($query_args);
110
+
111
+ // Post thumbnail
112
+ $has_thumbnail = false;
113
+
114
+ $posts_type = blocksy_default_akg('posts_type', $atts, 'small-thumbs');
115
+ $type_output = 'data-type="' . esc_attr($posts_type) . '"';
116
+
117
+ if ($posts_type !== 'no-thumbs' && $posts_type !== 'numbered' ) {
118
+ $has_thumbnail = true;
119
+ }
120
+
121
+ // Post meta
122
+ $has_meta = blocksy_default_akg( 'display_date', $atts, 'no' ) === 'yes';
123
+
124
+
125
+ // Comments
126
+ $has_comments = blocksy_default_akg( 'display_comments', $atts, 'no' ) === 'yes';
127
+
128
+ // Widget title
129
+ $title = blocksy_default_akg( 'title', $atts, __( 'Posts', 'blc' ) );
130
+
131
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
132
+ echo $before_widget;
133
+
134
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
135
+ echo $before_title . wp_kses_post( $title ) . $after_title;
136
+
137
+ ?>
138
+
139
+ <?php if ($query->have_posts()) { ?>
140
+ <ul <?php echo $type_output ?>>
141
+ <?php while ($query->have_posts()) { ?>
142
+ <?php $query->the_post(); ?>
143
+
144
+ <li>
145
+ <a href="<?php echo esc_url( get_permalink() ); ?>">
146
+ <?php
147
+ if ( $has_thumbnail ) {
148
+ $size = 'thumbnail';
149
+ $ratio = blocksy_default_akg('post_widget_image_ratio', $atts, '1/1');
150
+
151
+ if ( $posts_type === 'large-thumbs' ) {
152
+ $size = 'medium';
153
+ }
154
+
155
+ if ( $posts_type === 'rounded' ) {
156
+ $ratio = '1/1';
157
+ }
158
+
159
+ if (
160
+ $posts_type === 'large-small'
161
+ &&
162
+ $query->current_post === 0
163
+ ) {
164
+ $size = 'medium';
165
+ $ratio = '4/3';
166
+ }
167
+
168
+ echo wp_kses_post(
169
+ blc_call_fn(
170
+ ['fn' => 'blocksy_image'],
171
+ [
172
+ 'attachment_id' => get_post_thumbnail_id(),
173
+ 'ratio' => $ratio,
174
+ 'tag_name' => 'div',
175
+ 'size' => $size,
176
+ ]
177
+ )
178
+ );
179
+ }
180
+ ?>
181
+
182
+ <div class="ct-entry-content">
183
+ <div class="ct-post-title">
184
+ <?php echo wp_kses_post(get_the_title()); ?>
185
+ </div>
186
+
187
+ <?php
188
+ if (blocksy_default_akg('display_excerpt', $atts, 'no') === 'yes') {
189
+ echo blocksy_entry_excerpt(
190
+ blocksy_default_akg('excerpt_lenght', $atts, '10'),
191
+ 'ct-entry-excerpt',
192
+ get_the_ID()
193
+ );
194
+ }
195
+ ?>
196
+
197
+ <?php if ( $has_meta || $has_comments ) { ?>
198
+ <div class="ct-entry-meta">
199
+ <?php if ( $has_meta ) { ?>
200
+ <span>
201
+ <?php echo esc_attr(get_the_time(get_option('date_format', 'M j, Y'))); ?>
202
+
203
+ </span>
204
+ <?php } ?>
205
+
206
+ <?php if ( $has_comments && get_comments_number() > 0 ) { ?>
207
+ <span>
208
+ <?php echo wp_kses_post( get_comments_number_text( '', '1 Comment', '% Comments' ) ); ?>
209
+ </span>
210
+ <?php } ?>
211
+ </div>
212
+ <?php } ?>
213
+ </div>
214
+ </a>
215
+ </li>
216
+ <?php } ?>
217
+ </ul>
218
+ <?php } ?>
219
+
220
+ <?php wp_reset_postdata(); ?>
221
+
222
+ <?php
223
+ echo wp_kses_post( $after_widget );
224
+ ?>
trunk/framework/extensions/widgets/widgets/ct-posts/widget.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts list widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Posts extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Posts', 'blc'),
14
+ 'description' => __('Description', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
23
+
trunk/framework/extensions/widgets/widgets/ct-quote/options.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quote widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ $options = [
12
+
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'Quote', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'quote_text' => [
23
+ 'label' => __( 'Quote text', 'blc' ),
24
+ 'type' => 'textarea',
25
+ 'value' => '',
26
+ 'design' => 'inline',
27
+ 'disableRevertButton' => true,
28
+ ],
29
+
30
+ 'quote_author' => [
31
+ 'type' => 'text',
32
+ 'label' => __( 'Author Name', 'blc' ),
33
+ 'field_attr' => [ 'id' => 'widget-title' ],
34
+ 'design' => 'inline',
35
+ 'value' => __( 'John Doe', 'blc' ),
36
+ 'disableRevertButton' => true,
37
+ ],
38
+
39
+ 'quote_has_by_label' => [
40
+ 'type' => 'ct-switch',
41
+ 'label' => __( 'Author Label', 'blc' ),
42
+ 'value' => 'yes',
43
+ 'disableRevertButton' => true,
44
+ ],
45
+
46
+ 'quote_avatar' => [
47
+ 'label' => __('Author Avatar', 'blc'),
48
+ 'type' => 'ct-image-uploader',
49
+ 'design' => 'inline',
50
+ 'value' => [ 'attachment_id' => null ],
51
+ 'emptyLabel' => __('Select Image', 'blc'),
52
+ 'filledLabel' => __('Change Image', 'blc'),
53
+ ],
54
+
55
+ ];
trunk/framework/extensions/widgets/widgets/ct-quote/view.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quote widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+
11
+ // Widget title
12
+ $title = blocksy_default_akg( 'title', $atts, __( 'Quote', 'blc' ) );
13
+
14
+ // Quote text
15
+ $quote_text = blocksy_default_akg( 'quote_text', $atts, '' );
16
+
17
+ // Quote author
18
+ $quote_author = blocksy_default_akg( 'quote_author', $atts, __( 'John Doe', 'blc' ) );
19
+
20
+ // Quote avatar
21
+ $image_output = blc_call_fn(['fn' => 'blocksy_image'], [
22
+ 'attachment_id' => blocksy_default_akg( 'quote_avatar/attachment_id', $atts, null ),
23
+ 'ratio' => '1/1',
24
+ 'tag_name' => 'figure',
25
+ 'size' => 'thumbnail'
26
+ ]);
27
+
28
+
29
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
30
+ echo $before_widget;
31
+
32
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
33
+ if (! empty(trim($title))) {
34
+ echo $before_title . wp_kses_post( $title ) . $after_title;
35
+ }
36
+
37
+ ?>
38
+
39
+ <blockquote>
40
+ <?php echo $quote_text; ?>
41
+ </blockquote>
42
+
43
+ <div class="ct-quote-author">
44
+ <?php echo $image_output; ?>
45
+
46
+ <?php if (blocksy_default_akg('quote_has_by_label', $atts, 'yes') === 'yes') { ?>
47
+ <?php echo sprintf(
48
+ // translators: %s here is the author name
49
+ __('By %s', 'blc'),
50
+ $quote_author
51
+ ) ?>
52
+ <?php } else { ?>
53
+ <?php echo $quote_author; ?>
54
+ <?php } ?>
55
+ </div>
56
+
57
+ <?php echo wp_kses_post( $after_widget ); ?>
trunk/framework/extensions/widgets/widgets/ct-quote/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quote widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ class Blocksy_Widget_Ct_Quote extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Quote', 'blc'),
14
+ 'description' => __('Quote', 'blc'),
15
+ 'customize_selective_refresh' => true
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
trunk/framework/extensions/widgets/widgets/ct-socials/options.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Options for socials widget.
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
11
+ $options = [
12
+
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'Social Icons', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'socials' => [
23
+ 'type' => 'ct-layers',
24
+ 'label' => false,
25
+ 'manageable' => true,
26
+ 'desc' => sprintf(
27
+ __( 'You can configure social URLs in %s.', 'blc' ),
28
+ sprintf(
29
+ '<a href="%s" target="_blank">%s</a>',
30
+ admin_url('/customize.php?autofocus[section]=social_accounts'),
31
+ __('Customizer', 'blc')
32
+ )
33
+ ),
34
+ 'value' => [
35
+ [
36
+ 'id' => 'facebook',
37
+ 'enabled' => true,
38
+ ],
39
+
40
+ [
41
+ 'id' => 'twitter',
42
+ 'enabled' => true,
43
+ ],
44
+
45
+ [
46
+ 'id' => 'instagram',
47
+ 'enabled' => true,
48
+ ],
49
+ ],
50
+
51
+ 'settings' => blc_call_fn([
52
+ 'fn' => 'blocksy_get_social_networks_list',
53
+ 'default' => []
54
+ ])
55
+ ],
56
+
57
+ 'social_icons_size' => [
58
+ 'label' => __( 'Icons Size', 'blc' ),
59
+ 'type' => 'ct-radio',
60
+ 'value' => 'medium',
61
+ 'view' => 'text',
62
+ 'design' => 'block',
63
+ 'setting' => [ 'transport' => 'postMessage' ],
64
+ 'choices' => [
65
+ 'small' => __( 'Small', 'blc' ),
66
+ 'medium' => __( 'Medium', 'blc' ),
67
+ 'large' => __( 'Large', 'blc' ),
68
+ ],
69
+ ],
70
+
71
+ 'social_type' => [
72
+ 'label' => __( 'Icons Shape Type', 'blc' ),
73
+ 'type' => 'ct-radio',
74
+ 'value' => 'simple',
75
+ 'view' => 'text',
76
+ 'design' => 'block',
77
+ 'setting' => [ 'transport' => 'postMessage' ],
78
+ 'choices' => [
79
+ 'simple' => __( 'None', 'blc' ),
80
+ 'rounded' => __( 'Rounded', 'blc' ),
81
+ 'square' => __( 'Square', 'blc' ),
82
+ ],
83
+ ],
84
+
85
+ blocksy_rand_md5() => [
86
+ 'type' => 'ct-condition',
87
+ 'condition' => [ 'social_type' => '!simple' ],
88
+ 'options' => [
89
+
90
+ 'social_icons_fill' => [
91
+ 'label' => __( 'Shape Fill Type', 'blc' ),
92
+ 'type' => 'ct-radio',
93
+ 'value' => 'outline',
94
+ 'view' => 'text',
95
+ 'design' => 'block',
96
+ 'setting' => [ 'transport' => 'postMessage' ],
97
+ 'choices' => [
98
+ 'solid' => __( 'Solid', 'blc' ),
99
+ 'outline' => __( 'Outline', 'blc' ),
100
+ ],
101
+ ],
102
+
103
+ ],
104
+ ],
105
+
106
+ ];
trunk/framework/extensions/widgets/widgets/ct-socials/view.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Socials Widget
4
+ *
5
+ * @copyright 2019-present Creative Themes
6
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
7
+ * @package Blocksy
8
+ */
9
+
10
+ // Widget title.
11
+ $title = blocksy_default_akg( 'title', $atts, __('Social Icons', 'blc') );
12
+
13
+ echo wp_kses_post($before_widget . $before_title . $title . $after_title);
14
+
15
+ $size = blocksy_default_akg('social_icons_size', $atts, 'medium');
16
+ $type = blocksy_default_akg('social_type', $atts, 'simple');
17
+ $fill = blocksy_default_akg('social_icons_fill', $atts, 'outline');
18
+
19
+ /**
20
+ * blocksy_social_icons() function is already properly escaped.
21
+ * Escaping it again here would cause SVG icons to not be outputed
22
+ */
23
+ echo blc_call_fn(
24
+ ['fn' => 'blocksy_social_icons'],
25
+ blocksy_default_akg(
26
+ 'socials',
27
+ $atts,
28
+ [
29
+ [
30
+ 'id' => 'facebook',
31
+ 'enabled' => true,
32
+ ],
33
+
34
+ [
35
+ 'id' => 'twitter',
36
+ 'enabled' => true,
37
+ ],
38
+
39
+ [
40
+ 'id' => 'instagram',
41
+ 'enabled' => true,
42
+ ],
43
+ ]
44
+ ),
45
+ [
46
+ 'size' => $size,
47
+ 'fill' => $fill,
48
+ 'type' => $type
49
+ ]
50
+ );
51
+
52
+ echo wp_kses_post($after_widget);
53
+
trunk/framework/extensions/widgets/widgets/ct-socials/widget.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Socials Widget
5
+ *
6
+ * @copyright 2019-present Creative Themes
7
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
8
+ * @package Blocksy
9
+ */
10
+
11
+ class Blocksy_Widget_Ct_Socials extends BlocksyWidgetFactory {
12
+ protected function get_config() {
13
+ return [
14
+ 'name' => __('Social Icons', 'blc'),
15
+ 'description' => __('Social channels icons', 'blc'),
16
+ 'customize_selective_refresh' => true
17
+ ];
18
+ }
19
+
20
+ public function get_path() {
21
+ return dirname(__FILE__);
22
+ }
23
+ }
trunk/framework/features/conditions-manager.php ADDED
@@ -0,0 +1,487 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class ConditionsManager {
6
+ public function __construct() {
7
+ }
8
+
9
+ public function condition_matches($rules = []) {
10
+ if (empty($rules)) {
11
+ return false;
12
+ }
13
+
14
+ $all_includes = array_filter($rules, function ($el) {
15
+ return $el['type'] === 'include';
16
+ });
17
+
18
+ $all_excludes = array_filter($rules, function ($el) {
19
+ return $el['type'] === 'exclude';
20
+ });
21
+
22
+ $resolved_includes = array_filter($all_includes, function ($el) {
23
+ return $this->resolve_single_condition($el);
24
+ });
25
+
26
+ $resolved_excludes = array_filter($all_excludes, function ($el) {
27
+ return $this->resolve_single_condition($el);
28
+ });
29
+
30
+ // If at least one exclusion is true -- return false
31
+ if (! empty($resolved_excludes)) {
32
+ return false;
33
+ }
34
+
35
+ if (empty($all_includes)) {
36
+ return true;
37
+ }
38
+
39
+ if (! empty($all_includes)) {
40
+ // If at least one inclusion is true - return true
41
+ if (! empty($resolved_includes)) {
42
+ return true;
43
+ }
44
+ }
45
+
46
+ return false;
47
+ }
48
+
49
+ public function resolve_single_condition($rule) {
50
+ if ($rule['rule'] === 'everywhere') {
51
+ return true;
52
+ }
53
+
54
+ if ($rule['rule'] === 'singulars') {
55
+ return is_singular();
56
+ }
57
+
58
+ if ($rule['rule'] === 'archives') {
59
+ return is_archive();
60
+ }
61
+
62
+ if ($rule['rule'] === '404') {
63
+ return is_404();
64
+ }
65
+
66
+ if ($rule['rule'] === 'search') {
67
+ return is_search();
68
+ }
69
+
70
+ if ($rule['rule'] === 'blog') {
71
+ return !is_front_page() && is_home();
72
+ }
73
+
74
+ if ($rule['rule'] === 'front_page') {
75
+ return is_front_page();
76
+ }
77
+
78
+ if ($rule['rule'] === 'date') {
79
+ return is_date();
80
+ }
81
+
82
+ if ($rule['rule'] === 'author') {
83
+ return is_author();
84
+ }
85
+
86
+ if ($rule['rule'] === 'woo_shop') {
87
+ return function_exists('is_shop') && is_shop();
88
+ }
89
+
90
+ if ($rule['rule'] === 'single_post') {
91
+ return is_singular('post');
92
+ }
93
+
94
+ if ($rule['rule'] === 'all_post_archives') {
95
+ return is_post_type_archive('post');
96
+ }
97
+
98
+ if ($rule['rule'] === 'post_categories') {
99
+ return is_category();
100
+ }
101
+
102
+ if ($rule['rule'] === 'post_tags') {
103
+ return is_tag();
104
+ }
105
+
106
+ if ($rule['rule'] === 'single_page') {
107
+ return is_singular('page');
108
+ }
109
+
110
+ if ($rule['rule'] === 'single_product') {
111
+ return function_exists('is_product') && is_product();
112
+ }
113
+
114
+ if ($rule['rule'] === 'all_product_archives') {
115
+ if (function_exists('is_shop')) {
116
+ return is_shop() || is_product_tag() || is_product_category();
117
+ }
118
+ }
119
+
120
+ if ($rule['rule'] === 'all_product_categories') {
121
+ if (function_exists('is_shop')) {
122
+ return is_product_category();
123
+ }
124
+ }
125
+
126
+ if ($rule['rule'] === 'all_product_tags') {
127
+ if (function_exists('is_shop')) {
128
+ return is_product_tag();
129
+ }
130
+ }
131
+
132
+ if ($rule['rule'] === 'user_logged_in') {
133
+ return is_user_logged_in();
134
+ }
135
+
136
+ if ($rule['rule'] === 'user_logged_out') {
137
+ return !is_user_logged_in();
138
+ }
139
+
140
+ if (strpos($rule['rule'], 'user_role_') !== false) {
141
+ if (! is_user_logged_in()) {
142
+ return false;
143
+ }
144
+
145
+ return in_array(
146
+ str_replace('user_role_', '', $rule['rule']),
147
+ get_userdata(wp_get_current_user()->ID)->roles
148
+ );
149
+ }
150
+
151
+ if (strpos($rule['rule'], 'post_type_single_') !== false) {
152
+ return is_singular(str_replace(
153
+ 'post_type_single_',
154
+ '',
155
+ $rule['rule']
156
+ ));
157
+ }
158
+
159
+ if (strpos($rule['rule'], 'post_type_archive_') !== false) {
160
+ return is_post_type_archive(str_replace(
161
+ 'post_type_archive_',
162
+ '',
163
+ $rule['rule']
164
+ ));
165
+ }
166
+
167
+ if (
168
+ $rule['rule'] === 'post_ids'
169
+ ||
170
+ $rule['rule'] === 'page_ids'
171
+ ||
172
+ $rule['rule'] === 'custom_post_type_ids'
173
+ ) {
174
+ $is_blocksy_page = blocksy_is_page();
175
+
176
+ if (is_singular() || $is_blocksy_page) {
177
+ $post_id = get_the_ID();
178
+
179
+ if ($is_blocksy_page) {
180
+ $post_id = $is_blocksy_page;
181
+ }
182
+
183
+ global $post;
184
+
185
+ if (
186
+ isset($rule['payload'])
187
+ &&
188
+ isset($rule['payload']['post_id'])
189
+ &&
190
+ $post_id
191
+ &&
192
+ intval($post_id) === intval($rule['payload']['post_id'])
193
+ ) {
194
+ return true;
195
+ }
196
+ }
197
+ }
198
+
199
+ if ($rule['rule'] === 'taxonomy_ids') {
200
+ if (is_tax() || is_category() || is_tag()) {
201
+ $tax_id = get_queried_object_id();
202
+
203
+ if (
204
+ isset($rule['payload'])
205
+ &&
206
+ isset($rule['payload']['taxonomy_id'])
207
+ &&
208
+ $tax_id
209
+ &&
210
+ intval($tax_id) === intval($rule['payload']['taxonomy_id'])
211
+ ) {
212
+ return true;
213
+ }
214
+ }
215
+ }
216
+
217
+ if ($rule['rule'] === 'post_with_taxonomy_ids') {
218
+ $is_blocksy_page = blocksy_is_page();
219
+
220
+ if (is_singular() || $is_blocksy_page) {
221
+ $post_id = get_the_ID();
222
+
223
+ if ($is_blocksy_page) {
224
+ $post_id = $is_blocksy_page;
225
+ }
226
+
227
+ global $post;
228
+
229
+ if (
230
+ isset($rule['payload'])
231
+ &&
232
+ isset($rule['payload']['taxonomy_id'])
233
+ &&
234
+ $post_id
235
+ ) {
236
+ return has_term(
237
+ $rule['payload']['taxonomy_id'],
238
+ get_term($rule['payload']['taxonomy_id'])->taxonomy
239
+ );
240
+ }
241
+ }
242
+ }
243
+
244
+ return false;
245
+ }
246
+
247
+ public function get_all_rules() {
248
+ $has_woo = class_exists('WooCommerce');
249
+
250
+ $cpts = [];
251
+
252
+ $custom_post_types = array_diff(
253
+ get_post_types(['public' => true]),
254
+ [
255
+ 'post',
256
+ 'page',
257
+ 'attachment',
258
+ 'documentation',
259
+ 'ct_content_block',
260
+ 'product'
261
+ ]
262
+ );
263
+
264
+ foreach ($custom_post_types as $custom_post_type) {
265
+ $post_type_object = get_post_type_object($custom_post_type);
266
+
267
+ $cpts[] = [
268
+ 'id' => 'post_type_single_' . $custom_post_type,
269
+ 'title' => sprintf(
270
+ __('%s Single', 'blc'),
271
+ $post_type_object->labels->singular_name
272
+ )
273
+ ];
274
+
275
+ $cpts[] = [
276
+ 'id' => 'post_type_archive_' . $custom_post_type,
277
+ 'title' => sprintf(
278
+ __('%s Archive', 'blc'),
279
+ $post_type_object->labels->singular_name
280
+ )
281
+ ];
282
+ }
283
+
284
+ return array_merge([
285
+ [
286
+ 'title' => '',
287
+ 'rules' => [
288
+ [
289
+ 'id' => 'everywhere',
290
+ 'title' => __('Entire Website', 'blc')
291
+ ]
292
+ ]
293
+ ],
294
+ [
295
+ 'title' => __('Basic', 'blc'),
296
+ 'rules' => [
297
+ [
298
+ 'id' => 'singulars',
299
+ 'title' => __('Singulars', 'blc')
300
+ ],
301
+
302
+ [
303
+ 'id' => 'archives',
304
+ 'title' => __('Archives', 'blc')
305
+ ]
306
+ ]
307
+ ],
308
+
309
+ [
310
+ 'title' => __('Posts', 'blc'),
311
+ 'rules' => [
312
+ [
313
+ 'id' => 'single_post',
314
+ 'title' => __('Single Post', 'blc')
315
+ ],
316
+
317
+ [
318
+ 'id' => 'all_post_archives',
319
+ 'title' => __('All Post Archives', 'blc')
320
+ ],
321
+
322
+ [
323
+ 'id' => 'post_categories',
324
+ 'title' => __('Post Categories', 'blc')
325
+ ],
326
+
327
+ [
328
+ 'id' => 'post_tags',
329
+ 'title' => __('Post Tags', 'blc')
330
+ ],
331
+ ]
332
+ ],
333
+
334
+ [
335
+ 'title' => __('Pages', 'blc'),
336
+ 'rules' => [
337
+ [
338
+ 'id' => 'single_page',
339
+ 'title' => __('Single Page', 'blc')
340
+ ],
341
+ ]
342
+ ],
343
+ ],
344
+
345
+ $has_woo ? [
346
+ [
347
+ 'title' => __('WooCommerce', 'blc'),
348
+ 'rules' => [
349
+ [
350
+ 'id' => 'woo_shop',
351
+ 'title' => __('Shop Home', 'blc')
352
+ ],
353
+
354
+ [
355
+ 'id' => 'single_product',
356
+ 'title' => __('Single Product', 'blc')
357
+ ],
358
+
359
+ [
360
+ 'id' => 'all_product_archives',
361
+ 'title' => __('Product Archives', 'blc')
362
+ ],
363
+
364
+ [
365
+ 'id' => 'all_product_categories',
366
+ 'title' => __('Product Categories', 'blc')
367
+ ],
368
+
369
+ [
370
+ 'id' => 'all_product_tags',
371
+ 'title' => __('Product Tags', 'blc')
372
+ ],
373
+ ]
374
+ ]
375
+ ] : [],
376
+
377
+ count($cpts) > 0 ? [
378
+ [
379
+ 'title' => __('Custom Post Types', 'blc'),
380
+ 'rules' => $cpts
381
+ ]
382
+ ] : [],
383
+
384
+ [
385
+ [
386
+ 'title' => __('Specific', 'blc'),
387
+ 'rules' => [
388
+ [
389
+ 'id' => 'post_ids',
390
+ 'title' => __('Post ID', 'blc')
391
+ ],
392
+
393
+ [
394
+ 'id' => 'page_ids',
395
+ 'title' => __('Page ID', 'blc')
396
+ ],
397
+
398
+ [
399
+ 'id' => 'custom_post_type_ids',
400
+ 'title' => __('Custom Post Type ID', 'blc')
401
+ ],
402
+
403
+ [
404
+ 'id' => 'taxonomy_ids',
405
+ 'title' => __('Taxonomy ID', 'blc')
406
+ ],
407
+
408
+ [
409
+ 'id' => 'post_with_taxonomy_ids',
410
+ 'title' => __('Post with Taxonomy ID', 'blc')
411
+ ],
412
+ ]
413
+ ],
414
+
415
+ [
416
+ 'title' => __('Other Pages', 'blc'),
417
+ 'rules' => [
418
+ [
419
+ 'id' => '404',
420
+ 'title' => __('404', 'blc')
421
+ ],
422
+
423
+ [
424
+ 'id' => 'search',
425
+ 'title' => __('Search', 'blc')
426
+ ],
427
+
428
+ [
429
+ 'id' => 'blog',
430
+ 'title' => __('Blog', 'blc')
431
+ ],
432
+
433
+ [
434
+ 'id' => 'front_page',
435
+ 'title' => __('Front Page', 'blc')
436
+ ],
437
+
438
+ /*
439
+ [
440
+ 'id' => 'date',
441
+ 'title' => __('Date', 'blc')
442
+ ],
443
+ */
444
+
445
+ [
446
+ 'id' => 'author',
447
+ 'title' => __('Author', 'blc')
448
+ ],
449
+ ],
450
+ ],
451
+
452
+ [
453
+ 'title' => __('User Auth', 'blc'),
454
+ 'rules' => [
455
+ [
456
+ 'id' => 'user_logged_in',
457
+ 'title' => __('User Logged In', 'blc')
458
+ ],
459
+
460
+ [
461
+ 'id' => 'user_logged_out',
462
+ 'title' => __('User Logged Out', 'blc')
463
+ ],
464
+ ]
465
+ ],
466
+
467
+ [
468
+ 'title' => __('User Roles', 'blc'),
469
+ 'rules' => $this->get_user_roles_rules()
470
+ ]
471
+ ]);
472
+ }
473
+
474
+ private function get_user_roles_rules() {
475
+ $result = [];
476
+
477
+ foreach (get_editable_roles() as $role_id => $role_info) {
478
+ $result[] = [
479
+ 'id' => 'user_role_' . $role_id,
480
+ 'title' => $role_info['name']
481
+ ];
482
+ }
483
+
484
+ return $result;
485
+ }
486
+ }
487
+
trunk/framework/features/customizer-options-manager.php ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class CustomizerOptionsManager {
6
+ public function __construct() {
7
+ add_filter('blocksy:options:general:bottom', function ($options) {
8
+ $options[blocksy_rand_md5()] = [
9
+ 'label' => __( 'Customizer Import/Export', 'blocksy' ),
10
+ 'type' => 'ct-panel',
11
+ 'setting' => ['transport' => 'postMessage'],
12
+ 'inner-options' => [
13
+
14
+ 'importer' => [
15
+ 'type' => 'blocksy-customizer-options-manager',
16
+ 'design' => 'none',
17
+ ],
18
+
19
+ ],
20
+ ];
21
+
22
+ return $options;
23
+ });
24
+
25
+ add_action('wp_ajax_blocksy_customizer_export', function () {
26
+ if (! current_user_can('manage_options')) {
27
+ wp_send_json_error();
28
+ }
29
+
30
+ if (! isset($_POST['strategy'])) {
31
+ wp_send_json_error();
32
+ }
33
+
34
+ wp_send_json_success([
35
+ 'data' => serialize($this->get_data(null, $_POST['strategy']))
36
+ ]);
37
+ });
38
+
39
+ add_action('wp_ajax_blocksy_customizer_import', function () {
40
+ if (! current_user_can('manage_options')) {
41
+ wp_send_json_error();
42
+ }
43
+
44
+ if (! isset($_POST['data'])) {
45
+ wp_send_json_error();
46
+ }
47
+
48
+ $data = @unserialize(wp_unslash($_POST['data']));
49
+
50
+ if (isset($data['mods'])) {
51
+ $importer = new DemoInstallOptionsInstaller([
52
+ 'has_streaming' => false
53
+ ]);
54
+
55
+ $demo_data = null;
56
+
57
+ if (isset($data['site_url'])) {
58
+ $demo_data = [
59
+ 'url' => $data['site_url']
60
+ ];
61
+ }
62
+
63
+ $importer->import_options($data, $demo_data);
64
+ }
65
+
66
+ if (isset($data['blocksy_widgets'])) {
67
+ $importer = new DemoInstallWidgetsInstaller([
68
+ 'has_streaming' => false
69
+ ]);
70
+
71
+ $importer->import_data($data['blocksy_widgets']);
72
+ }
73
+
74
+ wp_send_json_success([]);
75
+ });
76
+
77
+ add_action('wp_ajax_blocksy_customizer_copy_options', function () {
78
+ if (! current_user_can('manage_options')) {
79
+ wp_send_json_error();
80
+ }
81
+
82
+ if (! isset($_POST['strategy'])) {
83
+ wp_send_json_error();
84
+ }
85
+
86
+ $theme_for_data = get_option('stylesheet');
87
+
88
+ if ($_POST['strategy'] === 'parent') {
89
+ foreach (wp_get_themes() as $id => $theme) {
90
+ if (! $theme->parent()) {
91
+ continue;
92
+ }
93
+
94
+ if ($theme->parent()->get_stylesheet() === 'blocksy') {
95
+ $theme_for_data = $theme->parent()->get_stylesheet();
96
+ }
97
+ }
98
+ }
99
+
100
+ if ($_POST['strategy'] === 'child') {
101
+ foreach (wp_get_themes() as $id => $theme) {
102
+ if (! $theme->parent()) {
103
+ continue;
104
+ }
105
+
106
+ if ($theme->parent()->get_stylesheet() === 'blocksy') {
107
+ $theme_for_data = $theme->get_stylesheet();
108
+ }
109
+ }
110
+ }
111
+
112
+ $data = $this->get_data($theme_for_data);
113
+
114
+ $importer = new DemoInstallOptionsInstaller([
115
+ 'has_streaming' => false
116
+ ]);
117
+
118
+ $importer->import_options($data);
119
+
120
+ wp_send_json_success([]);
121
+ });
122
+ }
123
+
124
+ private function get_data($theme_slug = null, $strategy = 'options') {
125
+ $data = [];
126
+
127
+ if (strpos($strategy, 'options') !== false) {
128
+ if (! $theme_slug) {
129
+ $theme_slug = get_option('stylesheet');
130
+ }
131
+
132
+ global $wp_customize;
133
+
134
+ $mods = $this->get_theme_mods($theme_slug);
135
+ $data = [
136
+ 'template' => $theme_slug,
137
+ 'site_url' => get_site_url(),
138
+ 'mods' => $mods ? $mods : array(),
139
+ 'options' => array()
140
+ ];
141
+
142
+ $core_options = [
143
+ 'blogname',
144
+ 'blogdescription',
145
+ 'show_on_front',
146
+ 'page_on_front',
147
+ 'page_for_posts',
148
+ ];
149
+
150
+ $settings = $wp_customize->settings();
151
+
152
+ foreach ($settings as $key => $setting) {
153
+ if ('option' === $setting->type) {
154
+ // Don't save widget data.
155
+ if ('widget_' === substr(strtolower($key), 0, 7)) {
156
+ continue;
157
+ }
158
+
159
+ // Don't save sidebar data.
160
+ if ('sidebars_' === substr(strtolower($key), 0, 9)) {
161
+ continue;
162
+ }
163
+
164
+ // Don't save core options.
165
+ if (in_array($key, $core_options)) {
166
+ continue;
167
+ }
168
+
169
+ $data['options'][$key] = $setting->value();
170
+ }
171
+ }
172
+
173
+ if (function_exists('wp_get_custom_css_post')) {
174
+ $data['wp_css'] = wp_get_custom_css();
175
+ }
176
+ }
177
+
178
+ if (strpos($strategy, 'widgets') !== false) {
179
+ $widgets = new DemoInstallWidgetsExport();
180
+ $data['blocksy_widgets'] = json_decode($widgets->export());
181
+ }
182
+
183
+ return $data;
184
+ }
185
+
186
+ private function get_theme_mods($theme_slug = null) {
187
+ if (! $theme_slug) {
188
+ $theme_slug = get_option('stylesheet');
189
+ }
190
+
191
+ $mods = get_option("theme_mods_$theme_slug");
192
+
193
+ if (false === $mods) {
194
+ $theme_name = wp_get_theme($theme_slug)->get( 'Name' );
195
+
196
+ $mods = get_option( "mods_$theme_name" ); // Deprecated location.
197
+
198
+ if ( is_admin() && false !== $mods ) {
199
+ update_option( "theme_mods_$theme_slug", $mods );
200
+ delete_option( "mods_$theme_name" );
201
+ }
202
+ }
203
+
204
+ return $mods;
205
+ }
206
+ }
trunk/framework/features/demo-install.php ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstall {
6
+ protected $ajax_actions = [
7
+ 'blocksy_demo_export',
8
+ 'blocksy_demo_list',
9
+ 'blocksy_demo_install_child_theme',
10
+ 'blocksy_demo_activate_plugins',
11
+ 'blocksy_demo_fake_step',
12
+ 'blocksy_demo_erase_content',
13
+ 'blocksy_demo_install_widgets',
14
+ 'blocksy_demo_install_options',
15
+ 'blocksy_demo_install_content',
16
+ 'blocksy_demo_register_current_demo',
17
+ 'blocksy_demo_deregister_current_demo',
18
+ 'blocksy_demo_deactivate_plugins',
19
+ 'blocksy_demo_install_finish',
20
+
21
+ // 'blocksy_extension_activate',
22
+ // 'blocksy_extension_deactivate',
23
+ ];
24
+
25
+ public function has_mock() {
26
+ return true;
27
+ }
28
+
29
+ public function __construct() {
30
+ $this->attach_ajax_actions();
31
+
32
+ add_filter(
33
+ 'blocksy_dashboard_localizations',
34
+ function ($d) {
35
+ $d['has_demo_install'] = apply_filters(
36
+ 'blocksy_ext_demo_install_enabled',
37
+ 'yes'
38
+ );
39
+
40
+ return $d;
41
+ }
42
+ );
43
+
44
+ // add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
45
+ // add_filter( 'woocommerce_show_admin_notice', '__return_false' );
46
+ // add_filter( 'woocommerce_prevent_automatic_wizard_redirect', '__return_false' );
47
+ }
48
+
49
+ public function blocksy_demo_install_child_theme() {
50
+ $m = new DemoInstallChildThemeInstaller();
51
+ $m->import();
52
+ }
53
+
54
+ public function blocksy_demo_erase_content() {
55
+ $plugins = new DemoInstallContentEraser();
56
+ $plugins->import();
57
+ }
58
+
59
+ public function blocksy_demo_install_widgets() {
60
+ $plugins = new DemoInstallWidgetsInstaller();
61
+ $plugins->import();
62
+ }
63
+
64
+ public function blocksy_demo_install_options() {
65
+ $plugins = new DemoInstallOptionsInstaller();
66
+ $plugins->import();
67
+ }
68
+
69
+ public function blocksy_demo_install_content() {
70
+ $plugins = new DemoInstallContentInstaller();
71
+ $plugins->import();
72
+ }
73
+
74
+ public function blocksy_demo_activate_plugins() {
75
+ $plugins = new DemoInstallPluginsInstaller();
76
+ $plugins->import();
77
+ }
78
+
79
+ public function blocksy_demo_fake_step() {
80
+ $plugins = new DemoInstallFakeContentEraser();
81
+ $plugins->import();
82
+ }
83
+
84
+ public function blocksy_demo_register_current_demo() {
85
+ $this->start_streaming();
86
+
87
+ if (! isset($_REQUEST['demo_name']) || !$_REQUEST['demo_name']) {
88
+ Plugin::instance()->demo->emit_sse_message([
89
+ 'action' => 'complete',
90
+ 'error' => 'No demo name passed.',
91
+ ]);
92
+
93
+ exit;
94
+ }
95
+
96
+ $demo_name = explode(':', $_REQUEST['demo_name']);
97
+
98
+ if (! isset($demo_name[1])) {
99
+ $demo_name[1] = '';
100
+ }
101
+
102
+ $demo = $demo_name[0];
103
+ $builder = $demo_name[1];
104
+
105
+ $this->set_current_demo($demo . ':' . $builder);
106
+
107
+ Plugin::instance()->demo->emit_sse_message([
108
+ 'action' => 'complete',
109
+ 'error' => false
110
+ ]);
111
+
112
+ exit;
113
+ }
114
+
115
+ public function blocksy_demo_deregister_current_demo() {
116
+ $this->start_streaming();
117
+
118
+ update_option('blocksy_ext_demos_current_demo', null);
119
+
120
+ Plugin::instance()->demo->emit_sse_message([
121
+ 'action' => 'complete',
122
+ 'error' => false
123
+ ]);
124
+
125
+ exit;
126
+ }
127
+
128
+ public function blocksy_demo_deactivate_plugins() {
129
+ $plugins = new DemoInstallPluginsUninstaller();
130
+ $plugins->import();
131
+ }
132
+
133
+ public function blocksy_demo_install_finish() {
134
+ $finish = new DemoInstallFinalActions();
135
+ $finish->import();
136
+ }
137
+
138
+ public function get_current_demo() {
139
+ return get_option('blocksy_ext_demos_current_demo', null);
140
+ }
141
+
142
+ public function set_current_demo($demo) {
143
+ update_option('blocksy_ext_demos_current_demo', [
144
+ 'demo' => $demo
145
+ ]);
146
+ }
147
+
148
+ public function fetch_single_demo($args = []) {
149
+ $args = wp_parse_args(
150
+ $args,
151
+ [
152
+ 'demo' => $args['demo'],
153
+ 'builder' => '',
154
+ 'field' => ''
155
+ ]
156
+ );
157
+
158
+ $request = wp_remote_get('https://demo.creativethemes.com/?' . http_build_query([
159
+ 'route' => 'get_single',
160
+ 'demo' => $args['demo'] . ':' . $args['builder'],
161
+ 'field' => $args['field']
162
+ ]));
163
+
164
+ if (is_wp_error($request)) {
165
+ return false;
166
+ }
167
+
168
+ $body = wp_remote_retrieve_body( $request );
169
+
170
+ $body = json_decode($body, true);
171
+
172
+ if (! $body) {
173
+ return false;
174
+ }
175
+
176
+ return $body;
177
+ }
178
+
179
+ public function fetch_all_demos() {
180
+ $request = wp_remote_get('https://demo.creativethemes.com/?route=get_all');
181
+ // $request = wp_remote_get('https://demo.creativethemes.BROKEN/?route=get_all');
182
+
183
+ if (is_wp_error($request)) {
184
+ return false;
185
+ }
186
+
187
+ $body = wp_remote_retrieve_body($request);
188
+
189
+ $body = json_decode($body, true);
190
+
191
+ if (! $body) {
192
+ return false;
193
+ }
194
+
195
+ return $body;
196
+ }
197
+
198
+ public function blocksy_demo_list() {
199
+ $demos = $this->fetch_all_demos();
200
+
201
+ if (! $demos) {
202
+ wp_send_json_error();
203
+ }
204
+
205
+ $plugins = [
206
+ 'coblocks' => false,
207
+ 'contact-form-7' => false,
208
+ 'woocommerce' => false,
209
+ 'brizy' => false,
210
+ 'elementor' => false,
211
+ ];
212
+
213
+ foreach ($plugins as $plugin_name => $status) {
214
+ $plugins_manager = $this->get_plugins_manager();
215
+
216
+ $path = $plugins_manager->is_plugin_installed( $plugin_name );
217
+
218
+ if ($path) {
219
+ if ($plugins_manager->is_plugin_active($path)) {
220
+ $plugins[$plugin_name] = true;
221
+ }
222
+ }
223
+ }
224
+
225
+ $has_demo_error = false;
226
+
227
+ if (! extension_loaded('xml') && ! extension_loaded('simplexml')) {
228
+ $has_demo_error = __("Your PHP installation doesn't have support for XML. Please install the <i>xml</i> or <i>simplexml</i> PHP extension in order to be able to install starter sites. You might need to contact your hosting provider to assist you in doing so.", 'blc');
229
+ }
230
+
231
+ wp_send_json_success([
232
+ 'demos' => $demos,
233
+ 'active_plugins' => $plugins,
234
+ 'current_installed_demo' => $this->get_current_demo(),
235
+ 'demo_error' => $has_demo_error
236
+ ]);
237
+ }
238
+
239
+ public function blocksy_demo_export() {
240
+ if (! current_user_can('edit_theme_options')) {
241
+ wp_send_json_error();
242
+ }
243
+
244
+ global $wp_customize;
245
+
246
+ $name = sanitize_text_field($_REQUEST['name']);
247
+ $builder = sanitize_text_field($_REQUEST['builder']);
248
+ $plugins = sanitize_text_field($_REQUEST['plugins']);
249
+ $url = sanitize_text_field($_REQUEST['url']);
250
+ $is_pro = sanitize_text_field($_REQUEST['is_pro']) === 'true';
251
+
252
+ $plugins = explode(',', preg_replace('/\s+/', '', $plugins));
253
+
254
+ $options_data = new DemoInstallOptionsExport();
255
+
256
+ $widgets_data = new DemoInstallWidgetsExport();
257
+ $widgets_data = $widgets_data->export();
258
+
259
+ add_filter(
260
+ 'export_wp_all_post_types',
261
+ function ($post_types) {
262
+ $post_types['wpforms'] = 'wpforms';
263
+ return $post_types;
264
+ }
265
+ );
266
+
267
+ $content_data = new DemoInstallContentExport();
268
+ $content_data = $content_data->export();
269
+
270
+ wp_send_json_success([
271
+ 'demo' => [
272
+ 'name' => $name,
273
+ 'options' => $options_data->export(),
274
+ 'widgets' => $widgets_data,
275
+ 'content' => $content_data,
276
+
277
+ 'pages_ids_options' => $options_data->export_pages_ids_options(),
278
+ 'created_at' => date('d-m-Y'),
279
+
280
+ 'url' => $url,
281
+ 'is_pro' => !!$is_pro,
282
+ 'builder' => $builder,
283
+ 'plugins' => $plugins
284
+ ]
285
+ ]);
286
+ }
287
+
288
+ public function attach_ajax_actions() {
289
+ foreach ($this->ajax_actions as $action) {
290
+ add_action(
291
+ 'wp_ajax_' . $action,
292
+ [ $this, $action ]
293
+ );
294
+ }
295
+ }
296
+
297
+ public function get_plugins_manager() {
298
+ if (! class_exists('Blocksy_Plugin_Manager')) {
299
+ require_once get_template_directory() . '/admin/dashboard/plugins/ct-plugin-manager.php';
300
+ }
301
+
302
+ return new \Blocksy_Plugin_Manager();
303
+ }
304
+
305
+ public function start_streaming() {
306
+ // Turn off PHP output compression
307
+ // $previous = error_reporting(error_reporting() ^ E_WARNING);
308
+ ini_set('output_buffering', 'off');
309
+ ini_set('zlib.output_compression', false);
310
+ // error_reporting( $previous );
311
+ // error_reporting(0);
312
+
313
+ if ($GLOBALS['is_nginx']) {
314
+ // Setting this header instructs Nginx to disable fastcgi_buffering
315
+ // and disable gzip for this request.
316
+ header('X-Accel-Buffering: no');
317
+ header('Content-Encoding: none');
318
+ }
319
+
320
+ // Start the event stream.
321
+ header('Content-Type: text/event-stream, charset=UTF-8');
322
+
323
+ flush();
324
+
325
+ // 2KB padding for IE
326
+ echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
327
+ // Time to run the import!
328
+ set_time_limit( 0 );
329
+ // Ensure we're not buffered.
330
+ wp_ob_end_flush_all();
331
+ }
332
+
333
+ public function emit_sse_message( $data ) {
334
+ echo "event: message\n";
335
+ echo 'data: ' . wp_json_encode( $data ) . "\n\n";
336
+ // Extra padding.
337
+ echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
338
+ flush();
339
+ }
340
+ }
trunk/framework/features/demo-install/child-theme.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallChildThemeInstaller {
6
+ public function import() {
7
+ Plugin::instance()->demo->start_streaming();
8
+
9
+ if (! current_user_can('edit_theme_options')) {
10
+ Plugin::instance()->demo->emit_sse_message([
11
+ 'action' => 'complete',
12
+ 'error' => 'No permission.',
13
+ ]);
14
+
15
+ exit;
16
+ }
17
+
18
+ $theme = wp_get_theme();
19
+
20
+ if (is_child_theme()) {
21
+ Plugin::instance()->demo->emit_sse_message([
22
+ 'action' => 'complete',
23
+ 'error' => false,
24
+ ]);
25
+
26
+ exit;
27
+ }
28
+
29
+ $name = $theme . ' Child';
30
+ $slug = sanitize_title($name);
31
+
32
+ $path = get_theme_root() . '/' . $slug;
33
+
34
+ WP_Filesystem();
35
+ global $wp_filesystem;
36
+
37
+ Plugin::instance()->demo->emit_sse_message([
38
+ 'action' => 'import_install_child',
39
+ 'error' => false,
40
+ ]);
41
+
42
+ if (! $wp_filesystem->exists($path)) {
43
+ $wp_filesystem->mkdir( $path );
44
+
45
+ $wp_filesystem->put_contents(
46
+ $path . '/style.css',
47
+ $this->get_style_css()
48
+ );
49
+
50
+ $wp_filesystem->put_contents(
51
+ $path . '/functions.php',
52
+ $this->get_functions_php()
53
+ );
54
+
55
+ $this->make_screenshot($path);
56
+ $allowed_themes = get_option('allowedthemes');
57
+ $allowed_themes[$slug] = true;
58
+
59
+ update_option('allowedthemes', $allowed_themes);
60
+ }
61
+
62
+ Plugin::instance()->demo->emit_sse_message([
63
+ 'action' => 'import_activate_child',
64
+ 'error' => false,
65
+ ]);
66
+
67
+ switch_theme($slug);
68
+
69
+ Plugin::instance()->demo->emit_sse_message([
70
+ 'action' => 'complete',
71
+ 'error' => false,
72
+ ]);
73
+
74
+ exit;
75
+ }
76
+
77
+ private function get_style_css() {
78
+ return '/**
79
+ * Theme Name: Blocksy Child
80
+ * Description: Blocksy Child theme
81
+ * Author: Creative Themes
82
+ * Template: blocksy
83
+ * Text Domain: blocksy
84
+ */';
85
+ }
86
+
87
+ private function get_functions_php() {
88
+ return "<?php
89
+
90
+ if (! defined('WP_DEBUG')) {
91
+ die( 'Direct access forbidden.' );
92
+ }
93
+
94
+ add_action( 'wp_enqueue_scripts', function () {
95
+ wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
96
+ });
97
+ ";
98
+ }
99
+
100
+ private function make_screenshot($path) {
101
+ $base_path = get_parent_theme_file_path();
102
+
103
+ global $wp_filesystem;
104
+
105
+ if ($wp_filesystem->exists($base_path . '/screenshot.png')) {
106
+ $screenshot = $base_path . '/screenshot.png';
107
+ $screenshot_ext = 'png';
108
+ } elseif ($wp_filesystem->exists($base_path . '/screenshot.jpg')) {
109
+ $screenshot = $base_path . '/screenshot.jpg';
110
+ $screenshot_ext = 'jpg';
111
+ }
112
+
113
+ if (! empty($screenshot) && $wp_filesystem->exists($screenshot)) {
114
+ $copied = $wp_filesystem->copy(
115
+ $screenshot,
116
+ $path . '/screenshot.' . $screenshot_ext
117
+ );
118
+ }
119
+ }
120
+ }
121
+
trunk/framework/features/demo-install/content-eraser.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallContentEraser {
6
+ public function import() {
7
+ Plugin::instance()->demo->start_streaming();
8
+
9
+ if (! current_user_can('edit_theme_options')) {
10
+ /*
11
+ Plugin::instance()->demo->emit_sse_message([
12
+ 'action' => 'complete',
13
+ 'error' => 'No permission.',
14
+ ]);
15
+
16
+ exit;
17
+ */
18
+ }
19
+
20
+ $this->reset_widgets_data();
21
+ $this->reset_customizer();
22
+ $this->erase_default_pages();
23
+ $this->reset_previous_posts();
24
+ $this->reset_previous_terms();
25
+ $this->reset_menus();
26
+
27
+ Plugin::instance()->demo->emit_sse_message([
28
+ 'action' => 'complete',
29
+ 'error' => false,
30
+ ]);
31
+
32
+ exit;
33
+ }
34
+
35
+ private function reset_previous_posts() {
36
+ Plugin::instance()->demo->emit_sse_message([
37
+ 'action' => 'erase_previous_posts',
38
+ 'error' => false,
39
+ ]);
40
+
41
+ global $wpdb;
42
+
43
+ $post_ids = $wpdb->get_col(
44
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='blocksy_demos_imported_post'"
45
+ );
46
+
47
+ $_GET['force_delete_kit'] = '1';
48
+
49
+ foreach ($post_ids as $post_id) {
50
+ ob_start();
51
+ wp_delete_post($post_id, true);
52
+ ob_get_clean();
53
+ }
54
+ }
55
+
56
+ private function reset_previous_terms() {
57
+ Plugin::instance()->demo->emit_sse_message([
58
+ 'action' => 'erase_previous_terms',
59
+ 'error' => false,
60
+ ]);
61
+
62
+ global $wpdb;
63
+
64
+ $term_ids = $wpdb->get_col(
65
+ "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='blocksy_demos_imported_term'"
66
+ );
67
+
68
+ foreach ($term_ids as $term_id) {
69
+ if (! $term_id) {
70
+ continue;
71
+ }
72
+
73
+ $term = get_term($term_id);
74
+
75
+ if (! $term) continue;
76
+
77
+ wp_delete_term($term_id, $term->taxonomy);
78
+ }
79
+ }
80
+
81
+ private function erase_default_pages() {
82
+ Plugin::instance()->demo->emit_sse_message([
83
+ 'action' => 'erase_default_pages',
84
+ 'error' => false,
85
+ ]);
86
+
87
+ $sample_page = get_page_by_path('sample-page', OBJECT, 'page');
88
+ $hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
89
+
90
+ if ($sample_page) {
91
+ wp_delete_post($sample_page->ID, true);
92
+ }
93
+
94
+ if ($hello_world_post) {
95
+ wp_delete_post($hello_world_post->ID, true);
96
+ }
97
+ }
98
+
99
+ private function reset_customizer() {
100
+ global $wp_customize;
101
+
102
+ Plugin::instance()->demo->emit_sse_message([
103
+ 'action' => 'erase_customizer_settings',
104
+ 'error' => false,
105
+ ]);
106
+
107
+ if (! $wp_customize) {
108
+ return;
109
+ }
110
+
111
+ $settings = $wp_customize->settings();
112
+
113
+ foreach ($settings as $single_setting) {
114
+ if ('theme_mod' !== $single_setting->type) {
115
+ continue;
116
+ }
117
+
118
+ remove_theme_mod( $single_setting->id );
119
+ }
120
+ }
121
+
122
+ private function reset_widgets_data() {
123
+ Plugin::instance()->demo->emit_sse_message([
124
+ 'action' => 'erase_widgets_data',
125
+ 'error' => false,
126
+ ]);
127
+
128
+ $sidebars_widgets = get_option('sidebars_widgets', array());
129
+
130
+ if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
131
+ $sidebars_widgets['wp_inactive_widgets'] = [];
132
+ }
133
+
134
+ foreach ($sidebars_widgets as $sidebar_id => $widgets) {
135
+ if (! $widgets) continue;
136
+ if ($sidebar_id === 'wp_inactive_widgets') {
137
+ continue;
138
+ }
139
+
140
+ if ($sidebar_id === 'array_version') {
141
+ continue;
142
+ }
143
+
144
+ foreach ($widgets as $widget_id) {
145
+ $sidebars_widgets['wp_inactive_widgets'][] = $widget_id;
146
+ }
147
+
148
+ $sidebars_widgets[$sidebar_id] = [];
149
+ }
150
+
151
+ update_option('sidebars_widgets', $sidebars_widgets);
152
+ unset($sidebars_widgets['array_version']);
153
+ set_theme_mod('sidebars_widgets', [
154
+ 'time' => time(),
155
+ 'data' => $sidebars_widgets
156
+ ]);
157
+ }
158
+
159
+ private function reset_menus() {
160
+ return;
161
+
162
+ Plugin::instance()->demo->emit_sse_message([
163
+ 'action' => 'erase_menus_data',
164
+ 'error' => false,
165
+ ]);
166
+
167
+ $menus = get_terms('nav_menu', ['hide_empty' => false]);
168
+
169
+ foreach ($menus as $single_menu) {
170
+ if (! isset($single_menu->term_id)) {
171
+ continue;
172
+ }
173
+
174
+ wp_delete_nav_menu($single_menu->term_id);
175
+ }
176
+ }
177
+ }
178
+
179
+
trunk/framework/features/demo-install/content-export.php ADDED
@@ -0,0 +1,663 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallContentExport {
6
+ public function export() {
7
+ /**
8
+ * Version number for the export format.
9
+ *
10
+ * Bump this when something changes that might affect compatibility.
11
+ *
12
+ * @since 2.5.0
13
+ */
14
+ define( 'WXR_VERSION', '1.2' );
15
+
16
+ /**
17
+ * Generates the WXR export file for download.
18
+ *
19
+ * Default behavior is to export all content, however, note that post content will only
20
+ * be exported for post types with the `can_export` argument enabled. Any posts with the
21
+ * 'auto-draft' status will be skipped.
22
+ *
23
+ * @since 2.1.0
24
+ *
25
+ * @global wpdb $wpdb WordPress database abstraction object.
26
+ * @global WP_Post $post Global `$post`.
27
+ *
28
+ * @param array $args {
29
+ * Optional. Arguments for generating the WXR export file for download. Default empty array.
30
+ *
31
+ * @type string $content Type of content to export. If set, only the post content of this post type
32
+ * will be exported. Accepts 'all', 'post', 'page', 'attachment', or a defined
33
+ * custom post. If an invalid custom post type is supplied, every post type for
34
+ * which `can_export` is enabled will be exported instead. If a valid custom post
35
+ * type is supplied but `can_export` is disabled, then 'posts' will be exported
36
+ * instead. When 'all' is supplied, only post types with `can_export` enabled will
37
+ * be exported. Default 'all'.
38
+ * @type string $author Author to export content for. Only used when `$content` is 'post', 'page', or
39
+ * 'attachment'. Accepts false (all) or a specific author ID. Default false (all).
40
+ * @type string $category Category (slug) to export content for. Used only when `$content` is 'post'. If
41
+ * set, only post content assigned to `$category` will be exported. Accepts false
42
+ * or a specific category slug. Default is false (all categories).
43
+ * @type string $start_date Start date to export content from. Expected date format is 'Y-m-d'. Used only
44
+ * when `$content` is 'post', 'page' or 'attachment'. Default false (since the
45
+ * beginning of time).
46
+ * @type string $end_date End date to export content to. Expected date format is 'Y-m-d'. Used only when
47
+ * `$content` is 'post', 'page' or 'attachment'. Default false (latest publish date).
48
+ * @type string $status Post status to export posts for. Used only when `$content` is 'post' or 'page'.
49
+ * Accepts false (all statuses except 'auto-draft'), or a specific status, i.e.
50
+ * 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', or
51
+ * 'trash'. Default false (all statuses except 'auto-draft').
52
+ * }
53
+ */
54
+ global $wpdb, $post;
55
+
56
+ $defaults = array(
57
+ 'content' => 'all',
58
+ 'author' => false,
59
+ 'category' => false,
60
+ 'start_date' => false,
61
+ 'end_date' => false,
62
+ 'status' => false,
63
+ );
64
+ $args = wp_parse_args( $args, $defaults );
65
+
66
+ /**
67
+ * Fires at the beginning of an export, before any headers are sent.
68
+ *
69
+ * @since 2.3.0
70
+ *
71
+ * @param array $args An array of export arguments.
72
+ */
73
+ do_action( 'export_wp', $args );
74
+
75
+ $sitename = sanitize_key( get_bloginfo( 'name' ) );
76
+ if ( ! empty( $sitename ) ) {
77
+ $sitename .= '.';
78
+ }
79
+ $date = date( 'Y-m-d' );
80
+ $wp_filename = $sitename . 'WordPress.' . $date . '.xml';
81
+ /**
82
+ * Filters the export filename.
83
+ *
84
+ * @since 4.4.0
85
+ *
86
+ * @param string $wp_filename The name of the file for download.
87
+ * @param string $sitename The site name.
88
+ * @param string $date Today's date, formatted.
89
+ */
90
+ $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
91
+
92
+ // header( 'Content-Description: File Transfer' );
93
+ // header( 'Content-Disposition: attachment; filename=' . $filename );
94
+ // header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
95
+
96
+ if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) {
97
+ $ptype = get_post_type_object( $args['content'] );
98
+ if ( ! $ptype->can_export ) {
99
+ $args['content'] = 'post';
100
+ }
101
+
102
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] );
103
+ } else {
104
+ $post_types = apply_filters('export_wp_all_post_types', get_post_types( array( 'can_export' => true ) ));
105
+ $esses = array_fill( 0, count( $post_types ), '%s' );
106
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
107
+ }
108
+
109
+ if ( $args['status'] && ( 'post' == $args['content'] || 'page' == $args['content'] ) ) {
110
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_status = %s", $args['status'] );
111
+ } else {
112
+ $where .= " AND {$wpdb->posts}.post_status != 'auto-draft'";
113
+ }
114
+
115
+ $join = '';
116
+ if ( $args['category'] && 'post' == $args['content'] ) {
117
+ if ( $term = term_exists( $args['category'], 'category' ) ) {
118
+ $join = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
119
+ $where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
120
+ }
121
+ }
122
+
123
+ if ( 'post' == $args['content'] || 'page' == $args['content'] || 'attachment' == $args['content'] ) {
124
+ if ( $args['author'] ) {
125
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
126
+ }
127
+
128
+ if ( $args['start_date'] ) {
129
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date >= %s", date( 'Y-m-d', strtotime( $args['start_date'] ) ) );
130
+ }
131
+
132
+ if ( $args['end_date'] ) {
133
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date < %s", date( 'Y-m-d', strtotime( '+1 month', strtotime( $args['end_date'] ) ) ) );
134
+ }
135
+ }
136
+
137
+ // Grab a snapshot of post IDs, just in case it changes during the export.
138
+ $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
139
+
140
+ /*
141
+ * Get the requested terms ready, empty unless posts filtered by category
142
+ * or all content.
143
+ */
144
+ $cats = $tags = $terms = array();
145
+ if ( isset( $term ) && $term ) {
146
+ $cat = get_term( $term['term_id'], 'category' );
147
+ $cats = array( $cat->term_id => $cat );
148
+ unset( $term, $cat );
149
+ } elseif ( 'all' == $args['content'] ) {
150
+ $categories = (array) get_categories( array( 'get' => 'all' ) );
151
+ $tags = (array) get_tags( array( 'get' => 'all' ) );
152
+
153
+ $custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );
154
+ $custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
155
+
156
+ // Put categories in order with no child going before its parent.
157
+ while ( $cat = array_shift( $categories ) ) {
158
+ if ( $cat->parent == 0 || isset( $cats[ $cat->parent ] ) ) {
159
+ $cats[ $cat->term_id ] = $cat;
160
+ } else {
161
+ $categories[] = $cat;
162
+ }
163
+ }
164
+
165
+ // Put terms in order with no child going before its parent.
166
+ while ( $t = array_shift( $custom_terms ) ) {
167
+ if ( $t->parent == 0 || isset( $terms[ $t->parent ] ) ) {
168
+ $terms[ $t->term_id ] = $t;
169
+ } else {
170
+ $custom_terms[] = $t;
171
+ }
172
+ }
173
+
174
+ unset( $categories, $custom_taxonomies, $custom_terms );
175
+ }
176
+
177
+ /**
178
+ * Wrap given string in XML CDATA tag.
179
+ *
180
+ * @since 2.1.0
181
+ *
182
+ * @param string $str String to wrap in XML CDATA tag.
183
+ * @return string
184
+ */
185
+ function wxr_cdata( $str ) {
186
+ if ( ! seems_utf8( $str ) ) {
187
+ $str = utf8_encode( $str );
188
+ }
189
+ // $str = ent2ncr(esc_html($str));
190
+ $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
191
+
192
+ return $str;
193
+ }
194
+
195
+ /**
196
+ * Return the URL of the site
197
+ *
198
+ * @since 2.5.0
199
+ *
200
+ * @return string Site URL.
201
+ */
202
+ function wxr_site_url() {
203
+ if ( is_multisite() ) {
204
+ // Multisite: the base URL.
205
+ return network_home_url();
206
+ } else {
207
+ // WordPress (single site): the blog URL.
208
+ return get_bloginfo_rss( 'url' );
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Output a cat_name XML tag from a given category object
214
+ *
215
+ * @since 2.1.0
216
+ *
217
+ * @param object $category Category Object
218
+ */
219
+ function wxr_cat_name( $category ) {
220
+ if ( empty( $category->name ) ) {
221
+ return;
222
+ }
223
+
224
+ echo '<wp:cat_name>' . wxr_cdata( $category->name ) . "</wp:cat_name>\n";
225
+ }
226
+
227
+ /**
228
+ * Output a category_description XML tag from a given category object
229
+ *
230
+ * @since 2.1.0
231
+ *
232
+ * @param object $category Category Object
233
+ */
234
+ function wxr_category_description( $category ) {
235
+ if ( empty( $category->description ) ) {
236
+ return;
237
+ }
238
+
239
+ echo '<wp:category_description>' . wxr_cdata( $category->description ) . "</wp:category_description>\n";
240
+ }
241
+
242
+ /**
243
+ * Output a tag_name XML tag from a given tag object
244
+ *
245
+ * @since 2.3.0
246
+ *
247
+ * @param object $tag Tag Object
248
+ */
249
+ function wxr_tag_name( $tag ) {
250
+ if ( empty( $tag->name ) ) {
251
+ return;
252
+ }
253
+
254
+ echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . "</wp:tag_name>\n";
255
+ }
256
+
257
+ /**
258
+ * Output a tag_description XML tag from a given tag object
259
+ *
260
+ * @since 2.3.0
261
+ *
262
+ * @param object $tag Tag Object
263
+ */
264
+ function wxr_tag_description( $tag ) {
265
+ if ( empty( $tag->description ) ) {
266
+ return;
267
+ }
268
+
269
+ echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . "</wp:tag_description>\n";
270
+ }
271
+
272
+ /**
273
+ * Output a term_name XML tag from a given term object
274
+ *
275
+ * @since 2.9.0
276
+ *
277
+ * @param object $term Term Object
278
+ */
279
+ function wxr_term_name( $term ) {
280
+ if ( empty( $term->name ) ) {
281
+ return;
282
+ }
283
+
284
+ echo '<wp:term_name>' . wxr_cdata( $term->name ) . "</wp:term_name>\n";
285
+ }
286
+
287
+ /**
288
+ * Output a term_description XML tag from a given term object
289
+ *
290
+ * @since 2.9.0
291
+ *
292
+ * @param object $term Term Object
293
+ */
294
+ function wxr_term_description( $term ) {
295
+ if ( empty( $term->description ) ) {
296
+ return;
297
+ }
298
+
299
+ echo "\t\t<wp:term_description>" . wxr_cdata( $term->description ) . "</wp:term_description>\n";
300
+ }
301
+
302
+ /**
303
+ * Output term meta XML tags for a given term object.
304
+ *
305
+ * @since 4.6.0
306
+ *
307
+ * @param WP_Term $term Term object.
308
+ */
309
+ function wxr_term_meta( $term ) {
310
+ global $wpdb;
311
+
312
+ $termmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->termmeta WHERE term_id = %d", $term->term_id ) );
313
+
314
+ foreach ( $termmeta as $meta ) {
315
+ /**
316
+ * Filters whether to selectively skip term meta used for WXR exports.
317
+ *
318
+ * Returning a truthy value to the filter will skip the current meta
319
+ * object from being exported.
320
+ *
321
+ * @since 4.6.0
322
+ *
323
+ * @param bool $skip Whether to skip the current piece of term meta. Default false.
324
+ * @param string $meta_key Current meta key.
325
+ * @param object $meta Current meta object.
326
+ */
327
+ if ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {
328
+ printf( "\t\t<wp:termmeta>\n\t\t\t<wp:meta_key>%s</wp:meta_key>\n\t\t\t<wp:meta_value>%s</wp:meta_value>\n\t\t</wp:termmeta>\n", wxr_cdata( $meta->meta_key ), wxr_cdata( $meta->meta_value ) );
329
+ }
330
+ }
331
+ }
332
+
333
+ /**
334
+ * Output list of authors with posts
335
+ *
336
+ * @since 3.1.0
337
+ *
338
+ * @global wpdb $wpdb WordPress database abstraction object.
339
+ *
340
+ * @param int[] $post_ids Optional. Array of post IDs to filter the query by.
341
+ */
342
+ function wxr_authors_list( array $post_ids = null ) {
343
+ global $wpdb;
344
+
345
+ if ( ! empty( $post_ids ) ) {
346
+ $post_ids = array_map( 'absint', $post_ids );
347
+ $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
348
+ } else {
349
+ $and = '';
350
+ }
351
+
352
+ $authors = array();
353
+ $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
354
+ foreach ( (array) $results as $result ) {
355
+ $authors[] = get_userdata( $result->post_author );
356
+ }
357
+
358
+ $authors = array_filter( $authors );
359
+
360
+ foreach ( $authors as $author ) {
361
+ echo "\t<wp:author>";
362
+ echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
363
+ echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
364
+ echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
365
+ echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
366
+ echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
367
+ echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
368
+ echo "</wp:author>\n";
369
+ }
370
+ }
371
+
372
+ /**
373
+ * Output all navigation menu terms
374
+ *
375
+ * @since 3.1.0
376
+ */
377
+ function wxr_nav_menu_terms() {
378
+ $nav_menus = wp_get_nav_menus();
379
+ if ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {
380
+ return;
381
+ }
382
+
383
+ foreach ( $nav_menus as $menu ) {
384
+ echo "\t<wp:term>";
385
+ echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
386
+ echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
387
+ echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
388
+ wxr_term_name( $menu );
389
+ echo "</wp:term>\n";
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Output list of taxonomy terms, in XML tag format, associated with a post
395
+ *
396
+ * @since 2.3.0
397
+ */
398
+ function wxr_post_taxonomy() {
399
+ $post = get_post();
400
+
401
+ $taxonomies = get_object_taxonomies( $post->post_type );
402
+ if ( empty( $taxonomies ) ) {
403
+ return;
404
+ }
405
+ $terms = wp_get_object_terms( $post->ID, $taxonomies );
406
+
407
+ foreach ( (array) $terms as $term ) {
408
+ echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
409
+ }
410
+ }
411
+
412
+ /**
413
+ * @param bool $return_me
414
+ * @param string $meta_key
415
+ * @return bool
416
+ */
417
+ add_filter( 'wxr_export_skip_postmeta', function ($return_me, $meta_key) {
418
+ if ( '_edit_lock' == $meta_key ) {
419
+ $return_me = true;
420
+ }
421
+
422
+ return $return_me;
423
+ }, 10, 2 );
424
+
425
+ ob_start();
426
+
427
+ echo '<?xml version="1.0" encoding="' . get_bloginfo( 'charset' ) . "\" ?>\n";
428
+
429
+ ?>
430
+ <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
431
+ <!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
432
+ <!-- You may use this file to transfer that content from one site to another. -->
433
+ <!-- This file is not intended to serve as a complete backup of your site. -->
434
+
435
+ <!-- To import this information into a WordPress site follow these steps: -->
436
+ <!-- 1. Log in to that site as an administrator. -->
437
+ <!-- 2. Go to Tools: Import in the WordPress admin panel. -->
438
+ <!-- 3. Install the "WordPress" importer from the list. -->
439
+ <!-- 4. Activate & Run Importer. -->
440
+ <!-- 5. Upload this file using the form provided on that page. -->
441
+ <!-- 6. You will first be asked to map the authors in this export file to users -->
442
+ <!-- on the site. For each author, you may choose to map to an -->
443
+ <!-- existing user on the site or to create a new user. -->
444
+ <!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
445
+ <!-- contained in this file into your site. -->
446
+
447
+ <?php the_generator( 'export' ); ?>
448
+ <rss version="2.0"
449
+ xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
450
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
451
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
452
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
453
+ xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
454
+ >
455
+
456
+ <channel>
457
+ <title><?php bloginfo_rss( 'name' ); ?></title>
458
+ <link><?php bloginfo_rss( 'url' ); ?></link>
459
+ <description><?php bloginfo_rss( 'description' ); ?></description>
460
+ <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
461
+ <language><?php bloginfo_rss( 'language' ); ?></language>
462
+ <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
463
+ <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
464
+ <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
465
+
466
+ <?php wxr_authors_list( $post_ids ); ?>
467
+
468
+ <?php foreach ( $cats as $c ) : ?>
469
+ <wp:category>
470
+ <wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id>
471
+ <wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>
472
+ <wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
473
+ <?php
474
+ wxr_cat_name( $c );
475
+ wxr_category_description( $c );
476
+ wxr_term_meta( $c );
477
+ ?>
478
+ </wp:category>
479
+ <?php endforeach; ?>
480
+ <?php foreach ( $tags as $t ) : ?>
481
+ <wp:tag>
482
+ <wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>
483
+ <wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>
484
+ <?php
485
+ wxr_tag_name( $t );
486
+ wxr_tag_description( $t );
487
+ wxr_term_meta( $t );
488
+ ?>
489
+ </wp:tag>
490
+ <?php endforeach; ?>
491
+ <?php foreach ( $terms as $t ) : ?>
492
+ <wp:term>
493
+ <wp:term_id><?php echo wxr_cdata( $t->term_id ); ?></wp:term_id>
494
+ <wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>
495
+ <wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug>
496
+ <wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>
497
+ <?php
498
+ wxr_term_name( $t );
499
+ wxr_term_description( $t );
500
+ wxr_term_meta( $t );
501
+ ?>
502
+ </wp:term>
503
+ <?php endforeach; ?>
504
+ <?php
505
+ if ( 'all' == $args['content'] ) {
506
+ wxr_nav_menu_terms();}
507
+ ?>
508
+
509
+ <?php
510
+ /** This action is documented in wp-includes/feed-rss2.php */
511
+ do_action( 'rss2_head' );
512
+ ?>
513
+
514
+ <?php
515
+ if ( $post_ids ) {
516
+ /**
517
+ * @global WP_Query $wp_query
518
+ */
519
+ global $wp_query;
520
+
521
+ // Fake being in the loop.
522
+ $wp_query->in_the_loop = true;
523
+
524
+ // Fetch 20 posts at a time rather than loading the entire table into memory.
525
+ while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
526
+ $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
527
+ $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
528
+
529
+ // Begin Loop.
530
+ foreach ( $posts as $post ) {
531
+ setup_postdata( $post );
532
+
533
+ /** This filter is documented in wp-includes/feed.php */
534
+ $title = apply_filters( 'the_title_rss', $post->post_title );
535
+
536
+ /**
537
+ * Filters the post content used for WXR exports.
538
+ *
539
+ * @since 2.5.0
540
+ *
541
+ * @param string $post_content Content of the current post.
542
+ */
543
+ $content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
544
+
545
+ /**
546
+ * Filters the post excerpt used for WXR exports.
547
+ *
548
+ * @since 2.6.0
549
+ *
550
+ * @param string $post_excerpt Excerpt for the current post.
551
+ */
552
+ $excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
553
+
554
+ $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
555
+ ?>
556
+ <item>
557
+ <title><?php echo $title; ?></title>
558
+ <link><?php the_permalink_rss(); ?></link>
559
+ <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
560
+ <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
561
+ <guid isPermaLink="false"><?php the_guid(); ?></guid>
562
+ <description></description>
563
+ <content:encoded><?php echo $content; ?></content:encoded>
564
+ <excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
565
+ <wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
566
+ <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
567
+ <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
568
+ <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
569
+ <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
570
+ <wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
571
+ <wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
572
+ <wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
573
+ <wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
574
+ <wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
575
+ <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
576
+ <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
577
+ <?php if ( $post->post_type == 'attachment' ) : ?>
578
+ <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
579
+ <?php endif; ?>
580
+ <?php wxr_post_taxonomy(); ?>
581
+ <?php
582
+ $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
583
+ foreach ( $postmeta as $meta ) :
584
+ /**
585
+ * Filters whether to selectively skip post meta used for WXR exports.
586
+ *
587
+ * Returning a truthy value to the filter will skip the current meta
588
+ * object from being exported.
589
+ *
590
+ * @since 3.3.0
591
+ *
592
+ * @param bool $skip Whether to skip the current post meta. Default false.
593
+ * @param string $meta_key Current meta key.
594
+ * @param object $meta Current meta object.
595
+ */
596
+ if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
597
+ continue;
598
+ }
599
+ ?>
600
+ <wp:postmeta>
601
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
602
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
603
+ </wp:postmeta>
604
+ <?php
605
+ endforeach;
606
+
607
+ $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
608
+ $comments = array_map( 'get_comment', $_comments );
609
+ foreach ( $comments as $c ) :
610
+ ?>
611
+ <wp:comment>
612
+ <wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
613
+ <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
614
+ <wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
615
+ <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
616
+ <wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
617
+ <wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
618
+ <wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
619
+ <wp:comment_content><?php echo wxr_cdata( $c->comment_content ); ?></wp:comment_content>
620
+ <wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
621
+ <wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
622
+ <wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
623
+ <wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
624
+ <?php
625
+ $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
626
+ foreach ( $c_meta as $meta ) :
627
+ /**
628
+ * Filters whether to selectively skip comment meta used for WXR exports.
629
+ *
630
+ * Returning a truthy value to the filter will skip the current meta
631
+ * object from being exported.
632
+ *
633
+ * @since 4.0.0
634
+ *
635
+ * @param bool $skip Whether to skip the current comment meta. Default false.
636
+ * @param string $meta_key Current meta key.
637
+ * @param object $meta Current meta object.
638
+ */
639
+ if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
640
+ continue;
641
+ }
642
+ ?>
643
+ <wp:commentmeta>
644
+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
645
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
646
+ </wp:commentmeta>
647
+ <?php endforeach; ?>
648
+ </wp:comment>
649
+ <?php endforeach; ?>
650
+ </item>
651
+ <?php
652
+ }
653
+ }
654
+ }
655
+ ?>
656
+ </channel>
657
+ </rss>
658
+ <?php
659
+ return ob_get_clean();
660
+ }
661
+ }
662
+
663
+
trunk/framework/features/demo-install/content-installer.php ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallContentInstaller {
6
+ protected $has_streaming = true;
7
+ protected $demo_name = null;
8
+
9
+ public function __construct($args = []) {
10
+ $args = wp_parse_args($args, [
11
+ 'has_streaming' => true,
12
+ 'demo_name' => null
13
+ ]);
14
+
15
+ if (
16
+ !$args['demo_name']
17
+ &&
18
+ isset($_REQUEST['demo_name'])
19
+ &&
20
+ $_REQUEST['demo_name']
21
+ ) {
22
+ $args['demo_name'] = $_REQUEST['demo_name'];
23
+ }
24
+
25
+ $this->has_streaming = $args['has_streaming'];
26
+ $this->demo_name = $args['demo_name'];
27
+ }
28
+
29
+ public function import() {
30
+ if ($this->has_streaming) {
31
+ Plugin::instance()->demo->start_streaming();
32
+
33
+ if (! current_user_can('edit_theme_options')) {
34
+ Plugin::instance()->demo->emit_sse_message([
35
+ 'action' => 'complete',
36
+ 'error' => 'No permission.',
37
+ ]);
38
+
39
+ exit;
40
+ }
41
+ }
42
+
43
+ if (class_exists('\Elementor\Compatibility')) {
44
+ remove_filter('wp_import_post_meta', [
45
+ '\Elementor\Compatibility',
46
+ 'on_wp_import_post_meta'
47
+ ]);
48
+ }
49
+
50
+ add_action(
51
+ 'blocksy_wp_import_insert_term',
52
+ function($term_id) {
53
+ $this->track_term_insert($term_id);
54
+ $this->send_update('term');
55
+ },
56
+ 10,
57
+ 1
58
+ );
59
+
60
+ add_action(
61
+ 'wp_import_insert_term',
62
+ function($t) {
63
+ $term_id = $t['term_id'];
64
+ $this->track_term_insert($term_id);
65
+ $this->send_update('term');
66
+ },
67
+ 10,
68
+ 1
69
+ );
70
+
71
+ add_filter(
72
+ 'wp_import_post_meta',
73
+ function($meta, $post_id, $post) {
74
+ $this->track_post_insert($post_id);
75
+
76
+ if (get_post_type($post_id) === 'attachment') {
77
+ $this->send_update('media');
78
+ } else {
79
+ $this->send_update('post');
80
+ }
81
+
82
+ $wp_importer = get_plugins( '/wordpress-importer' );
83
+
84
+ if (! empty($wp_importer)) {
85
+ $wp_importer_version = $wp_importer['wordpress-importer.php']['Version'];
86
+
87
+ if (! empty($wp_importer_version)) {
88
+ if (version_compare($wp_importer_version, '0.7', '>=')) {
89
+ foreach ($meta as &$m) {
90
+ if ('_elementor_data' === $m['key']) {
91
+ $m['value'] = wp_slash($m['value']);
92
+ break;
93
+ }
94
+ }
95
+ }
96
+ }
97
+ } else {
98
+ foreach ($meta as &$m) {
99
+ if ('_elementor_data' === $m['key']) {
100
+ $m['value'] = wp_slash($m['value']);
101
+ break;
102
+ }
103
+ }
104
+ }
105
+
106
+ return $meta;
107
+ },
108
+ 10,
109
+ 3
110
+ );
111
+
112
+ add_action(
113
+ 'wp_import_insert_post',
114
+ function ($post_id, $old_post_id) {
115
+ Plugin::instance()->header->patch_conditions(
116
+ intval($post_id),
117
+ intval($old_post_id)
118
+ );
119
+ },
120
+ 10, 2
121
+ );
122
+
123
+ add_filter(
124
+ 'wp_import_term_meta',
125
+ function( $meta, $term_id, $post ) {
126
+ $this->track_term_insert($term_id);
127
+ $this->send_update('term');
128
+
129
+ return $meta;
130
+ },
131
+ 10,
132
+ 3
133
+ );
134
+
135
+ add_action(
136
+ 'wp_import_insert_comment',
137
+ function($comment_id, $comment, $comment_post_id, $post) {
138
+ $this->send_update('comment');
139
+ },
140
+ 10,
141
+ 4
142
+ );
143
+
144
+ if ($this->has_streaming) {
145
+ if (! $this->demo_name) {
146
+ Plugin::instance()->demo->emit_sse_message([
147
+ 'action' => 'complete',
148
+ 'error' => 'No demo name passed.',
149
+ ]);
150
+ exit;
151
+ }
152
+ }
153
+
154
+ $demo_name = explode(':', $this->demo_name);
155
+
156
+ if (! isset($demo_name[1])) {
157
+ $demo_name[1] = '';
158
+ }
159
+
160
+ $demo = $demo_name[0];
161
+ $builder = $demo_name[1];
162
+
163
+ $url = 'https://demo.creativethemes.com/?' . http_build_query([
164
+ 'route' => 'get_single_xml',
165
+ 'demo' => $demo . ':' . $builder
166
+ ]);
167
+
168
+ $wp_import = new \Blocksy_WP_Import();
169
+ $import_data = $wp_import->parse($url);
170
+
171
+ if ($this->has_streaming) {
172
+ Plugin::instance()->demo->emit_sse_message([
173
+ 'action' => 'get_content_preliminary_data',
174
+ 'url' => $url,
175
+ 'our_data' => blc_load_xml_file($url),
176
+ 'data' => $import_data,
177
+ ]);
178
+ }
179
+
180
+ $wp_import->get_authors_from_import($import_data);
181
+
182
+ unset($import_data);
183
+
184
+ $author_data = [];
185
+
186
+ foreach ($wp_import->authors as $wxr_author) {
187
+ $author = new \stdClass();
188
+
189
+ // Always in the WXR
190
+ $author->user_login = $wxr_author['author_login'];
191
+
192
+ // Should be in the WXR; no guarantees
193
+ if (isset($wxr_author['author_email'])) {
194
+ $author->user_email = $wxr_author['author_email'];
195
+ }
196
+
197
+ if (isset($wxr_author['author_display_name'])) {
198
+ $author->display_name = $wxr_author['author_display_name'];
199
+ }
200
+
201
+ if (isset($wxr_author['author_first_name'])) {
202
+ $author->first_name = $wxr_author['author_first_name'];
203
+ }
204
+
205
+ if (isset($wxr_author['author_last_name'])) {
206
+ $author->last_name = $wxr_author['author_last_name'];
207
+ }
208
+
209
+ $author_data[] = $author;
210
+ }
211
+
212
+ // Build the author mapping
213
+ $author_mapping = $this->process_author_mapping( 'skip', $author_data );
214
+
215
+ $author_in = wp_list_pluck($author_mapping, 'old_user_login');
216
+ $author_out = wp_list_pluck($author_mapping, 'new_user_login');
217
+ unset($author_mapping, $author_data);
218
+
219
+ // $user_select needs to be an array of user IDs
220
+ $user_select = [];
221
+ $invalid_user_select = [];
222
+
223
+ foreach ($author_out as $author_login) {
224
+ $user = get_user_by('login', $author_login);
225
+
226
+ if ($user) {
227
+ $user_select[] = $user->ID;
228
+ } else {
229
+ $invalid_user_select[] = $author_login;
230
+ }
231
+ }
232
+
233
+ if (! empty($invalid_user_select)) {
234
+ # return new WP_Error( 'invalid-author-mapping', sprintf( 'These user_logins are invalid: %s', implode( ',', $invalid_user_select ) ) );
235
+ }
236
+
237
+ unset($author_out);
238
+
239
+ $wp_import->fetch_attachments = true;
240
+
241
+ $_GET['import'] = 'wordpress';
242
+ $_GET['step'] = 2;
243
+
244
+ $_POST['imported_authors'] = $author_in;
245
+ $_POST['user_map'] = $user_select;
246
+ $_POST['fetch_attachments'] = $wp_import->fetch_attachments;
247
+
248
+ ob_start();
249
+ $wp_import->import( $url );
250
+ ob_end_clean();
251
+
252
+ if ($this->has_streaming) {
253
+ Plugin::instance()->demo->emit_sse_message([
254
+ 'action' => 'test_terms',
255
+ 'error' => false,
256
+ 'terms' => $wp_import->processed_terms
257
+ ]);
258
+ }
259
+
260
+ if (class_exists('Blocksy_Customizer_Builder')) {
261
+ $header_builder = new \Blocksy_Customizer_Builder();
262
+ $header_builder->patch_header_value_for($wp_import->processed_terms);
263
+ }
264
+
265
+ $this->clean_plugins_cache();
266
+ $this->assign_pages_ids($demo, $builder);
267
+
268
+ if ($this->has_streaming) {
269
+ Plugin::instance()->demo->emit_sse_message([
270
+ 'action' => 'complete',
271
+ 'error' => false
272
+ ]);
273
+
274
+ exit;
275
+ }
276
+ }
277
+
278
+ public function track_post_insert($post_id) {
279
+ update_post_meta($post_id, 'blocksy_demos_imported_post', true);
280
+ }
281
+
282
+ public function track_term_insert($term_id) {
283
+ update_term_meta($term_id, 'blocksy_demos_imported_term', true);
284
+ }
285
+
286
+ public function send_update($kind = null) {
287
+ if ($this->has_streaming) {
288
+ ob_end_clean();
289
+
290
+ Plugin::instance()->demo->emit_sse_message([
291
+ 'action' => 'content_installer_progress',
292
+ 'kind' => $kind,
293
+ 'error' => false,
294
+ ]);
295
+
296
+ ob_start();
297
+ }
298
+ }
299
+
300
+ public function clean_plugins_cache() {
301
+ if ($this->has_streaming) {
302
+ Plugin::instance()->demo->emit_sse_message([
303
+ 'action' => 'cleanup_plugins_cache',
304
+ 'error' => false,
305
+ ]);
306
+ }
307
+
308
+ if (class_exists('\Elementor\Plugin')) {
309
+ \Elementor\Plugin::$instance->posts_css_manager->clear_cache();
310
+ }
311
+
312
+ if (is_callable('FLBuilderModel::delete_asset_cache_for_all_posts')) {
313
+ \FLBuilderModel::delete_asset_cache_for_all_posts();
314
+ }
315
+ }
316
+
317
+ public function assign_pages_ids($demo, $builder) {
318
+ if ($this->has_streaming) {
319
+ Plugin::instance()->demo->emit_sse_message([
320
+ 'action' => 'cleanup_plugins_cache',
321
+ 'error' => false,
322
+ ]);
323
+ }
324
+
325
+ $demo_content = Plugin::instance()->demo->fetch_single_demo([
326
+ 'demo' => $demo,
327
+ 'builder' => $builder,
328
+ 'field' => 'content'
329
+ ]);
330
+
331
+ if (! isset($demo_content['pages_ids_options'])) {
332
+ if ($this->has_streaming) {
333
+ Plugin::instance()->demo->emit_sse_message([
334
+ 'action' => 'complete',
335
+ 'error' => __('Downloaded demo is corrupted.'),
336
+ ]);
337
+
338
+ exit;
339
+ }
340
+ }
341
+
342
+ foreach ($demo_content['pages_ids_options'] as $option_id => $page_title) {
343
+ if (strpos($option_id, 'woocommerce') !== false) {
344
+ if (! class_exists('WooCommerce')) {
345
+ continue;
346
+ }
347
+ }
348
+
349
+ $page = get_page_by_title($page_title);
350
+
351
+ if (isset($page) && $page->ID) {
352
+ update_option($option_id, $page->ID);
353
+ }
354
+ }
355
+ }
356
+
357
+ private function process_author_mapping( $authors_arg, $author_data ) {
358
+ switch ($authors_arg) {
359
+ // Create authors if they don't yet exist; maybe match on email or user_login
360
+ case 'create':
361
+ return $this->create_authors_for_mapping($author_data);
362
+ // Skip any sort of author mapping
363
+ case 'skip':
364
+ return array();
365
+ default:
366
+ return new WP_Error( 'invalid-argument', "'authors' argument is invalid." );
367
+ }
368
+ }
369
+
370
+ private function create_authors_for_mapping( $author_data ) {
371
+ $author_mapping = array();
372
+ foreach ($author_data as $author) {
373
+ if (isset($author->user_email)) {
374
+ $user = get_user_by('email', $author->user_email);
375
+
376
+ if ($user instanceof WP_User) {
377
+ $author_mapping[] = [
378
+ 'old_user_login' => $author->user_login,
379
+ 'new_user_login' => $user->user_login,
380
+ ];
381
+ continue;
382
+ }
383
+ }
384
+
385
+ $user = get_user_by('login', $author->user_login);
386
+
387
+ if ($user instanceof WP_User) {
388
+ $author_mapping[] = [
389
+ 'old_user_login' => $author->user_login,
390
+ 'new_user_login' => $user->user_login,
391
+ ];
392
+ continue;
393
+ }
394
+ $user = array(
395
+ 'user_login' => '',
396
+ 'user_email' => '',
397
+ 'user_pass' => wp_generate_password(),
398
+ );
399
+
400
+ $user = array_merge($user, (array) $author);
401
+ $user_id = wp_insert_user($user);
402
+
403
+ if (is_wp_error($user_id)) {
404
+ return $user_id;
405
+ }
406
+
407
+ $user = get_user_by( 'id', $user_id );
408
+ $author_mapping[] = [
409
+ 'old_user_login' => $author->user_login,
410
+ 'new_user_login' => $user->user_login,
411
+ ];
412
+ }
413
+ return $author_mapping;
414
+ }
415
+ }
416
+
trunk/framework/features/demo-install/fake-content-eraser.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallFakeContentEraser {
6
+ public function import() {
7
+ Plugin::instance()->demo->start_streaming();
8
+
9
+ if (! current_user_can('edit_theme_options')) {
10
+ /*
11
+ Plugin::instance()->demo->emit_sse_message([
12
+ 'action' => 'complete',
13
+ 'error' => 'No permission.',
14
+ ]);
15
+
16
+ exit;
17
+ */
18
+ }
19
+
20
+ if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
21
+ define('WP_CLI', true);
22
+
23
+ $s = new \WC_REST_System_Status_Tools_V2_Controller();
24
+
25
+ $s->execute_tool('clear_transients');
26
+ if (function_exists('wc_update_product_lookup_tables')) {
27
+ wc_update_product_lookup_tables();
28
+ }
29
+ $s->execute_tool('clear_transients');
30
+ $s->execute_tool('db_update_routine');
31
+ }
32
+
33
+ // $this->reset_widgets_data();
34
+ // $this->reset_customizer();
35
+ // $this->erase_default_pages();
36
+ // $this->reset_previous_posts();
37
+ // $this->reset_previous_terms();
38
+ // $this->reset_menus();
39
+
40
+ Plugin::instance()->demo->emit_sse_message([
41
+ 'action' => 'complete',
42
+ 'error' => false,
43
+ ]);
44
+
45
+ exit;
46
+ }
47
+
48
+ private function reset_previous_posts() {
49
+ Plugin::instance()->demo->emit_sse_message([
50
+ 'action' => 'erase_previous_posts',
51
+ 'error' => false,
52
+ ]);
53
+
54
+ global $wpdb;
55
+
56
+ $post_ids = $wpdb->get_col(
57
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='blocksy_demos_imported_post'"
58
+ );
59
+
60
+ foreach ($post_ids as $post_id) {
61
+ wp_delete_post($post_id, true);
62
+ }
63
+ }
64
+
65
+ private function reset_previous_terms() {
66
+ Plugin::instance()->demo->emit_sse_message([
67
+ 'action' => 'erase_previous_terms',
68
+ 'error' => false,
69
+ ]);
70
+
71
+ global $wpdb;
72
+
73
+ $term_ids = $wpdb->get_col(
74
+ "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='blocksy_demos_imported_term'"
75
+ );
76
+
77
+ foreach ($term_ids as $term_id) {
78
+ if (! $term_id) {
79
+ continue;
80
+ }
81
+
82
+ $term = get_term($term_id);
83
+
84
+ if (! $term) continue;
85
+
86
+ wp_delete_term($term_id, $term->taxonomy);
87
+ }
88
+ }
89
+
90
+ private function erase_default_pages() {
91
+ Plugin::instance()->demo->emit_sse_message([
92
+ 'action' => 'erase_default_pages',
93
+ 'error' => false,
94
+ ]);
95
+
96
+ $sample_page = get_page_by_path('sample-page', OBJECT, 'page');
97
+ $hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
98
+
99
+ if ($sample_page) {
100
+ wp_delete_post($sample_page->ID, true);
101
+ }
102
+
103
+ if ($hello_world_post) {
104
+ wp_delete_post($hello_world_post->ID, true);
105
+ }
106
+ }
107
+
108
+ private function reset_customizer() {
109
+ global $wp_customize;
110
+
111
+ Plugin::instance()->demo->emit_sse_message([
112
+ 'action' => 'erase_customizer_settings',
113
+ 'error' => false,
114
+ ]);
115
+
116
+ if (! $wp_customize) {
117
+ return;
118
+ }
119
+
120
+ $settings = $wp_customize->settings();
121
+
122
+ foreach ($settings as $single_setting) {
123
+ if ('theme_mod' !== $single_setting->type) {
124
+ continue;
125
+ }
126
+
127
+ remove_theme_mod( $single_setting->id );
128
+ }
129
+ }
130
+
131
+ private function reset_widgets_data() {
132
+ Plugin::instance()->demo->emit_sse_message([
133
+ 'action' => 'erase_widgets_data',
134
+ 'error' => false,
135
+ ]);
136
+
137
+ $sidebars_widgets = get_option('sidebars_widgets', array());
138
+
139
+ if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
140
+ $sidebars_widgets['wp_inactive_widgets'] = [];
141
+ }
142
+
143
+ foreach ($sidebars_widgets as $sidebar_id => $widgets) {
144
+ if (! $widgets) continue;
145
+ if ($sidebar_id === 'wp_inactive_widgets') {
146
+ continue;
147
+ }
148
+
149
+ if ($sidebar_id === 'array_version') {
150
+ continue;
151
+ }
152
+
153
+ foreach ($widgets as $widget_key => $widget_data) {
154
+ list(
155
+ $name, $option_index, $sidebar_id, $sidebar_index
156
+ ) = $this->get_widget_data($widget_data);
157
+
158
+ if ($sidebar_id === 'wp_inactive_widgets') {
159
+ continue;
160
+ }
161
+
162
+ $this->move_sidebar_widget(
163
+ $widget_data,
164
+ $sidebar_id,
165
+ 'wp_inactive_widgets',
166
+ $sidebar_index,
167
+ 0
168
+ );
169
+ }
170
+ }
171
+ }
172
+
173
+ private function get_widget_data( $widget_id ) {
174
+ $parts = explode('-', $widget_id);
175
+ $option_index = array_pop($parts);
176
+ $name = implode('-', $parts);
177
+ $sidebar_id = false;
178
+ $sidebar_index = false;
179
+ $all_widgets = $this->wp_get_sidebars_widgets();
180
+
181
+ foreach ($all_widgets as $s_id => &$widgets) {
182
+ $key = array_search($widget_id, $widgets, true);
183
+
184
+ if (false !== $key) {
185
+ $sidebar_id = $s_id;
186
+ $sidebar_index = $key;
187
+ break;
188
+ }
189
+ }
190
+
191
+ return [$name, $option_index, $sidebar_id, $sidebar_index];
192
+ }
193
+
194
+ private function move_sidebar_widget(
195
+ $widget_id,
196
+ $current_sidebar_id,
197
+ $new_sidebar_id,
198
+ $current_index, $new_index
199
+ ) {
200
+ $all_widgets = $this->wp_get_sidebars_widgets();
201
+ $needs_placement = true;
202
+
203
+ // Existing widget
204
+ if ($current_sidebar_id && !is_null($current_index)) {
205
+ $widgets = $all_widgets[$current_sidebar_id];
206
+ if ($current_sidebar_id !== $new_sidebar_id) {
207
+ unset($widgets[$current_index]);
208
+ } else {
209
+ $part = array_splice($widgets, $current_index, 1);
210
+ array_splice($widgets, $new_index, 0, $part);
211
+ $needs_placement = false;
212
+ }
213
+
214
+ $all_widgets[$current_sidebar_id] = array_values($widgets);
215
+ }
216
+
217
+ if ($needs_placement) {
218
+ $widgets = !empty($all_widgets[$new_sidebar_id]) ? $all_widgets[$new_sidebar_id] : [];
219
+ $before = array_slice($widgets, 0, $new_index, true);
220
+ $after = array_slice($widgets, $new_index, count($widgets), true);
221
+ $widgets = array_merge($before, [$widget_id], $after);
222
+ $all_widgets[$new_sidebar_id] = array_values($widgets);
223
+ }
224
+
225
+ update_option('sidebars_widgets', $all_widgets);
226
+
227
+ $widgets = get_theme_mod('sidebars_widgets');
228
+
229
+ if (! $widgets) {
230
+ $widgets = [];
231
+ }
232
+
233
+ set_theme_mod('sidebars_widgets', array_merge(
234
+ $widgets,
235
+ [
236
+ 'time' => time(),
237
+ 'data' => $all_widgets
238
+ ]
239
+ ));
240
+ }
241
+
242
+ private function wp_get_sidebars_widgets() {
243
+ $sidebars_widgets = get_option('sidebars_widgets', []);
244
+
245
+ if (is_array($sidebars_widgets) && isset($sidebars_widgets['array_version'])) {
246
+ unset($sidebars_widgets['array_version']);
247
+ }
248
+
249
+ return $sidebars_widgets;
250
+ }
251
+
252
+ private function reset_menus() {
253
+ return;
254
+
255
+ Plugin::instance()->demo->emit_sse_message([
256
+ 'action' => 'erase_menus_data',
257
+ 'error' => false,
258
+ ]);
259
+
260
+ $menus = get_terms('nav_menu', ['hide_empty' => false]);
261
+
262
+ foreach ($menus as $single_menu) {
263
+ if (! isset($single_menu->term_id)) {
264
+ continue;
265
+ }
266
+
267
+ wp_delete_nav_menu($single_menu->term_id);
268
+ }
269
+ }
270
+ }
271
+
272
+
273
+
trunk/framework/features/demo-install/install-finish.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallFinalActions {
6
+ public function import() {
7
+ Plugin::instance()->demo->start_streaming();
8
+
9
+ if (! current_user_can('edit_theme_options')) {
10
+ Plugin::instance()->demo->emit_sse_message([
11
+ 'action' => 'complete',
12
+ 'error' => false,
13
+ ]);
14
+ exit;
15
+ }
16
+
17
+ $this->replace_urls();
18
+
19
+ do_action('blocksy:dynamic-css:regenere_css_files');
20
+ Plugin::instance()->cache_manager->run_cache_purge();
21
+
22
+ if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
23
+ define('WP_CLI', true);
24
+
25
+ $s = new \WC_REST_System_Status_Tools_V2_Controller();
26
+
27
+ $s->execute_tool('clear_transients');
28
+ if (function_exists('wc_update_product_lookup_tables')) {
29
+ wc_update_product_lookup_tables();
30
+ }
31
+ $s->execute_tool('clear_transients');
32
+ }
33
+
34
+ $this->handle_brizy_posts();
35
+
36
+ global $wp_rewrite;
37
+ $wp_rewrite->flush_rules();
38
+
39
+ Plugin::instance()->demo->emit_sse_message([
40
+ 'action' => 'complete',
41
+ 'error' => false,
42
+ ]);
43
+ exit;
44
+ }
45
+
46
+ /**
47
+ * Replace elementor URLs
48
+ */
49
+ public function replace_urls() {
50
+ $current_demo = Plugin::instance()->demo->get_current_demo();
51
+
52
+ if (! $current_demo) {
53
+ return;
54
+ }
55
+
56
+ if (! isset($current_demo['demo'])) {
57
+ return;
58
+ }
59
+
60
+ $demo_name = explode(':', $current_demo['demo']);
61
+
62
+ if (! isset($demo_name[1])) {
63
+ $demo_name[1] = '';
64
+ }
65
+
66
+ $demo = $demo_name[0];
67
+ $builder = $demo_name[1];
68
+
69
+ $demo_content = Plugin::instance()->demo->fetch_single_demo([
70
+ 'demo' => $demo,
71
+ 'builder' => $builder
72
+ ]);
73
+
74
+ if (! $demo_content) {
75
+ return;
76
+ }
77
+
78
+ if (! isset($demo_content['url'])) {
79
+ return;
80
+ }
81
+
82
+ $from = $demo_content['url'];
83
+
84
+ $to = get_site_url();
85
+
86
+ $wp_uploads = wp_upload_dir();
87
+
88
+ if (isset($wp_uploads['baseurl'])) {
89
+ $from .= '/wp-content/uploads';
90
+ $to = $wp_uploads['baseurl'];
91
+ }
92
+
93
+ $from = trim($from);
94
+ $to = trim($to);
95
+
96
+ if (
97
+ ! filter_var($from, FILTER_VALIDATE_URL)
98
+ ||
99
+ ! filter_var($to, FILTER_VALIDATE_URL)
100
+ ) {
101
+ return;
102
+ }
103
+
104
+ global $wpdb;
105
+
106
+ // @codingStandardsIgnoreStart cannot use `$wpdb->prepare` because it remove's the backslashes
107
+ $wpdb->query(
108
+ "UPDATE {$wpdb->postmeta} " .
109
+ "SET `meta_value` = REPLACE(`meta_value`, '" . str_replace( '/', '\\\/', $from ) . "', '" . str_replace( '/', '\\\/', $to ) . "') " .
110
+ "WHERE `meta_key` = '_elementor_data' AND `meta_value` LIKE '[%' ;"
111
+ ); // meta_value LIKE '[%' are json formatted
112
+ // @codingStandardsIgnoreEnd
113
+
114
+ $option_keys = $wpdb->get_results(
115
+ $wpdb->prepare(
116
+ "SELECT option_name from {$wpdb->options} WHERE `option_value` LIKE %s;",
117
+ '%%' . $from . '%%'
118
+ )
119
+ );
120
+
121
+ foreach ($option_keys as $single_key) {
122
+ update_option($single_key->option_name, json_decode(str_replace(
123
+ str_replace('/', '\\/', $from),
124
+ str_replace('/', '\\/', $to),
125
+ json_encode(get_option($single_key->option_name))
126
+ ), true));
127
+ }
128
+ }
129
+
130
+ private function handle_brizy_posts() {
131
+ if (! is_callable('Brizy_Editor_Storage_Common::instance')) {
132
+ return;
133
+ }
134
+
135
+ $post_types = \Brizy_Editor_Storage_Common::instance()->get('post-types');
136
+
137
+ if (empty($post_types) && ! is_array($post_types)) {
138
+ return;
139
+ }
140
+
141
+ $post_ids = $this->get_pages($post_types);
142
+
143
+ if (empty($post_ids) && ! is_array($post_ids)) {
144
+ return;
145
+ }
146
+
147
+ foreach ($post_ids as $post_id) {
148
+ $this->import_single_post($post_id);
149
+ }
150
+ }
151
+
152
+ public function import_single_post($post_id = 0) {
153
+ $is_brizy_post = get_post_meta($post_id, 'brizy_post_uid', true);
154
+
155
+ if (! $is_brizy_post) {
156
+ return;
157
+ }
158
+
159
+ update_post_meta($post_id, 'brizy_enabled', true);
160
+
161
+ $post = \Brizy_Editor_Post::get((int) $post_id);
162
+ $editor_data = $post->get_editor_data();
163
+
164
+ $post->set_editor_data( $editor_data );
165
+ $post->set_editor_version(BRIZY_EDITOR_VERSION);
166
+ $post->set_needs_compile(true);
167
+ $post->saveStorage();
168
+ }
169
+
170
+ private function get_pages($post_types = array()) {
171
+ if (! $post_types) {
172
+ return null;
173
+ }
174
+
175
+ $args = array(
176
+ 'post_type' => $post_types,
177
+
178
+ // Query performance optimization.
179
+ 'fields' => 'ids',
180
+ 'no_found_rows' => true,
181
+ 'post_status' => 'publish',
182
+ 'posts_per_page' => -1,
183
+ );
184
+
185
+ $query = new \WP_Query($args);
186
+
187
+ if (! $query->have_posts()) {
188
+ return null;
189
+ }
190
+
191
+ return $query->posts;
192
+ }
193
+ }
194
+
trunk/framework/features/demo-install/options-export.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallOptionsExport {
6
+ public function get_exported_options_keys() {
7
+ return [
8
+ 'blocksy_ext_mailchimp_credentials',
9
+ 'blocksy_active_extensions'
10
+ ];
11
+ }
12
+
13
+ private $core_options = array(
14
+ 'blogname',
15
+ 'blogdescription',
16
+ // 'show_on_front',
17
+ // 'page_on_front',
18
+ // 'page_for_posts',
19
+ );
20
+
21
+ private $page_ids = [
22
+ 'woocommerce_shop_page_id',
23
+ 'woocommerce_cart_page_id',
24
+ 'woocommerce_checkout_page_id',
25
+ 'woocommerce_pay_page_id',
26
+ 'woocommerce_thanks_page_id',
27
+ 'woocommerce_myaccount_page_id',
28
+ 'woocommerce_edit_address_page_id',
29
+ 'woocommerce_view_order_page_id',
30
+ 'woocommerce_change_password_page_id',
31
+ 'woocommerce_logout_page_id',
32
+ 'woocommerce_lost_password_page_id',
33
+ 'page_on_front',
34
+ 'page_for_posts'
35
+ ];
36
+
37
+ public function export() {
38
+ $theme = get_stylesheet();
39
+ $template = get_template();
40
+ $charset = get_option( 'blog_charset' );
41
+ $mods = get_theme_mods();
42
+
43
+ $data = [
44
+ 'template' => $template,
45
+ 'mods' => $mods ? $mods : [],
46
+ 'options' => []
47
+ ];
48
+
49
+ global $wp_customize;
50
+
51
+ // Get options from the Customizer API.
52
+ $settings = $wp_customize->settings();
53
+
54
+ foreach ($settings as $key => $setting) {
55
+ if ('option' == $setting->type) {
56
+ if ('widget_' === substr(strtolower($key), 0, 7)) {
57
+ continue;
58
+ }
59
+
60
+ if ('sidebars_' === substr(strtolower($key), 0, 9)) {
61
+ continue;
62
+ }
63
+
64
+ if (in_array($key, $this->core_options)) {
65
+ continue;
66
+ }
67
+
68
+ $data['options'][$key] = $setting->value();
69
+ }
70
+ }
71
+
72
+ $option_keys = $this->get_exported_options_keys();
73
+
74
+ foreach ($option_keys as $option_key) {
75
+ $data['options'][$option_key] = get_option($option_key);
76
+ }
77
+
78
+ if (function_exists('wp_get_custom_css_post')) {
79
+ $data['wp_css'] = wp_get_custom_css();
80
+ }
81
+
82
+ /**
83
+ * Temporary work around until Elementor comes up with something better
84
+ */
85
+ if (class_exists('\Elementor\Plugin')) {
86
+ $default_post_id = \Elementor\Plugin::$instance->kits_manager->get_active_id();
87
+
88
+ if (! empty($default_post_id)) {
89
+ $global_data = get_post_meta(
90
+ $default_post_id,
91
+ '_elementor_page_settings',
92
+ true
93
+ );
94
+
95
+ $data['elementor_active_kit_settings'] = $global_data;
96
+ }
97
+ }
98
+
99
+ return $data;
100
+
101
+ return serialize($data);
102
+ }
103
+
104
+ public function export_pages_ids_options() {
105
+ $result = [];
106
+
107
+ foreach ($this->page_ids as $single_page_id) {
108
+ $id = get_option($single_page_id, null);
109
+
110
+ $title = false;
111
+
112
+ if ($id) {
113
+ $title = get_the_title($id);
114
+ }
115
+
116
+ $result[$single_page_id] = $title;
117
+ }
118
+
119
+ return $result;
120
+ }
121
+ }
122
+
123
+
trunk/framework/features/demo-install/options-import.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallOptionsInstaller {
6
+ protected $has_streaming = true;
7
+ protected $demo_name = null;
8
+
9
+ protected $sideloaded_images = [];
10
+
11
+ public function __construct($args = []) {
12
+ $args = wp_parse_args($args, [
13
+ 'has_streaming' => true,
14
+ 'demo_name' => null
15
+ ]);
16
+
17
+ if (
18
+ !$args['demo_name']
19
+ &&
20
+ isset($_REQUEST['demo_name'])
21
+ &&
22
+ $_REQUEST['demo_name']
23
+ ) {
24
+ $args['demo_name'] = $_REQUEST['demo_name'];
25
+ }
26
+
27
+ $this->has_streaming = $args['has_streaming'];
28
+ $this->demo_name = $args['demo_name'];
29
+ }
30
+
31
+ public function import() {
32
+ if ($this->has_streaming) {
33
+ Plugin::instance()->demo->start_streaming();
34
+
35
+ if (! current_user_can('edit_theme_options')) {
36
+ Plugin::instance()->demo->emit_sse_message([
37
+ 'action' => 'complete',
38
+ 'error' => 'No permission.',
39
+ ]);
40
+
41
+ exit;
42
+ }
43
+
44
+ if (! $this->demo_name) {
45
+ Plugin::instance()->demo->emit_sse_message([
46
+ 'action' => 'complete',
47
+ 'error' => 'No demo name passed.',
48
+ ]);
49
+ exit;
50
+ }
51
+ }
52
+
53
+ $demo_name = explode(':', $this->demo_name);
54
+
55
+ if (! isset($demo_name[1])) {
56
+ $demo_name[1] = '';
57
+ }
58
+
59
+ $demo = $demo_name[0];
60
+ $builder = $demo_name[1];
61
+
62
+ if ($this->has_streaming) {
63
+ Plugin::instance()->demo->emit_sse_message([
64
+ 'action' => 'download_demo_options',
65
+ 'error' => false,
66
+ ]);
67
+ }
68
+
69
+ $demo_content = Plugin::instance()->demo->fetch_single_demo([
70
+ 'demo' => $demo,
71
+ 'builder' => $builder,
72
+ 'field' => 'options'
73
+ ]);
74
+
75
+ if (! isset($demo_content['options']) && $this->has_streaming) {
76
+ Plugin::instance()->demo->emit_sse_message([
77
+ 'action' => 'complete',
78
+ 'error' => __('Downloaded demo is corrupted.'),
79
+ ]);
80
+
81
+ exit;
82
+ }
83
+
84
+ $options = $demo_content['options'];
85
+ $this->import_options($options, $demo_content);
86
+
87
+ if ($this->has_streaming) {
88
+ Plugin::instance()->demo->emit_sse_message([
89
+ 'action' => 'complete',
90
+ 'error' => false,
91
+ ]);
92
+
93
+ exit;
94
+ }
95
+ }
96
+
97
+ public function import_options($options, $demo_content = null) {
98
+ if ($this->has_streaming) {
99
+ Plugin::instance()->demo->emit_sse_message([
100
+ 'action' => 'import_mods_images',
101
+ 'error' => false,
102
+ ]);
103
+ }
104
+
105
+ if ($demo_content) {
106
+ $options['mods'] = $this->import_images(
107
+ $demo_content,
108
+ $options['mods']
109
+ );
110
+ }
111
+
112
+ global $wp_customize;
113
+
114
+ if ($this->has_streaming) {
115
+ Plugin::instance()->demo->emit_sse_message([
116
+ 'action' => 'import_customizer_options',
117
+ 'error' => false,
118
+ ]);
119
+ }
120
+
121
+ do_action('customize_save', $wp_customize);
122
+
123
+ foreach ($options['mods'] as $key => $val) {
124
+ if ($key === 'nav_menu_locations') continue;
125
+ if ($key === 'sidebars_widgets') continue;
126
+
127
+ do_action('customize_save_' . $key, $wp_customize);
128
+ set_theme_mod($key, $val);
129
+ }
130
+
131
+ do_action('customize_save_after', $wp_customize);
132
+
133
+ foreach ($options['options'] as $key => $val) {
134
+ if ($key === 'blocksy_active_extensions') {
135
+ if ($val && is_array($val)) {
136
+ if ($this->has_streaming) {
137
+ Plugin::instance()->demo->emit_sse_message([
138
+ 'action' => 'activate_required_extensions',
139
+ 'error' => false,
140
+ ]);
141
+ }
142
+
143
+ foreach ($val as $single_extension) {
144
+ Plugin::instance()->extensions->activate_extension(
145
+ $single_extension
146
+ );
147
+ }
148
+ }
149
+ } else {
150
+ if (
151
+ strpos($key, 'woocommerce') !== false
152
+ &&
153
+ $key !== 'woocommerce_thumbnail_cropping'
154
+ ) {
155
+ if (empty(get_option($key))) {
156
+ update_option($key, $val);
157
+ } else {
158
+ add_option($key, $val);
159
+ }
160
+ } else {
161
+ update_option($key, $val);
162
+ }
163
+ }
164
+ }
165
+
166
+ /*
167
+ $all = get_option('sidebars_widgets');
168
+ $all['sidebar-1'] = [];
169
+ update_option('sidebars_widgets', $all);
170
+
171
+ $all = get_theme_mod('sidebars_widgets');
172
+
173
+ if ($all) {
174
+ $all['data']['sidebar-1'] = [];
175
+ set_theme_mod('sidebars_widgets', $all);
176
+ }
177
+ */
178
+
179
+ if (
180
+ function_exists('wp_update_custom_css_post')
181
+ &&
182
+ isset($options['wp_css'])
183
+ &&
184
+ $options['wp_css']
185
+ ) {
186
+ wp_update_custom_css_post($options['wp_css']);
187
+ }
188
+
189
+ /**
190
+ * Temporary work around until Elementor comes up with something better
191
+ */
192
+ if (class_exists('\Elementor\Plugin')) {
193
+ $default_post_id = \Elementor\Plugin::$instance->kits_manager->get_active_id();
194
+
195
+ if (
196
+ ! empty($default_post_id)
197
+ &&
198
+ isset($options['elementor_active_kit_settings'])
199
+ ) {
200
+ update_post_meta(
201
+ $default_post_id,
202
+ '_elementor_page_settings',
203
+ $options['elementor_active_kit_settings']
204
+ );
205
+ }
206
+ }
207
+ }
208
+
209
+ private function import_images($demo_content, $mods) {
210
+ foreach ($mods as $key => $val) {
211
+ if ($this->is_image_url($val)) {
212
+ $data = $this->sideload_image($val);
213
+
214
+ if (! is_wp_error($data)) {
215
+ $mods[$key] = $data->url;
216
+
217
+ // Handle header image controls.
218
+ if (isset($mods[$key . '_data'])) {
219
+ $mods[$key . '_data'] = $data;
220
+
221
+ update_post_meta(
222
+ $data->attachment_id,
223
+ '_wp_attachment_is_custom_header',
224
+ get_stylesheet()
225
+ );
226
+ }
227
+ }
228
+ }
229
+
230
+ if ($key === 'header_placements') {
231
+ foreach ($val['sections'] as $section_index => $section) {
232
+ foreach ($section['items'] as $item_index => $item) {
233
+ $mods['header_placements']['sections'][$section_index][
234
+ 'items'
235
+ ][$item_index]['values'] = $this->import_images(
236
+ $demo_content,
237
+ $item['values']
238
+ );
239
+ }
240
+ }
241
+ }
242
+
243
+ if ($key === 'custom_logo' && is_array($val) && isset($val['desktop'])) {
244
+ $maybe_url = $this->sideload_image_for_url(
245
+ $demo_content['url'],
246
+ $val['desktop']
247
+ );
248
+
249
+ if ($maybe_url) {
250
+ $data = $this->sideload_image($maybe_url);
251
+ $mods[$key]['desktop'] = $data->attachment_id;
252
+ }
253
+
254
+ $maybe_url = $this->sideload_image_for_url(
255
+ $demo_content['url'],
256
+ $val['tablet']
257
+ );
258
+
259
+ if ($maybe_url) {
260
+ $data = $this->sideload_image($maybe_url);
261
+ $mods[$key]['tablet'] = $data->attachment_id;
262
+ }
263
+
264
+ $maybe_url = $this->sideload_image_for_url(
265
+ $demo_content['url'],
266
+ $val['mobile']
267
+ );
268
+
269
+ if ($maybe_url) {
270
+ $data = $this->sideload_image($maybe_url);
271
+ $mods[$key]['mobile'] = $data->attachment_id;
272
+ }
273
+ }
274
+
275
+ if ($key === 'custom_logo' && is_numeric($val)) {
276
+ $maybe_url = $this->sideload_image_for_url(
277
+ $demo_content['url'],
278
+ $val
279
+ );
280
+
281
+ if ($maybe_url) {
282
+ $data = $this->sideload_image($maybe_url);
283
+ $mods[$key] = $data->attachment_id;
284
+ }
285
+ }
286
+
287
+ if (
288
+ is_array($val)
289
+ &&
290
+ isset($val['attachment_id'])
291
+ &&
292
+ $val['attachment_id']
293
+ ) {
294
+ $maybe_url = $this->sideload_image_for_url(
295
+ $demo_content['url'],
296
+ $val['attachment_id']
297
+ );
298
+
299
+ if ($maybe_url) {
300
+ $data = $this->sideload_image($maybe_url);
301
+ $mods[$key]['attachment_id'] = $data->attachment_id;
302
+ }
303
+ }
304
+ }
305
+
306
+ return $mods;
307
+ }
308
+
309
+ public function sideload_image_for_url($url, $id) {
310
+ $url = rtrim($url,"/") . '/wp-json/wp/v2/media/' . $id;
311
+
312
+ $request = wp_remote_get($url);
313
+
314
+ if (is_wp_error($request)) {
315
+ return false;
316
+ }
317
+
318
+ $body = wp_remote_retrieve_body($request);
319
+
320
+ $body = json_decode($body, true);
321
+
322
+ if (! $body) {
323
+ return false;
324
+ }
325
+
326
+ if (! isset($body['source_url'])) {
327
+ return false;
328
+ }
329
+
330
+ return $body['source_url'];
331
+ }
332
+
333
+ private function sideload_image($file) {
334
+ if (isset($this->sideloaded_images[$file])) {
335
+ return $this->sideloaded_images[$file];
336
+ }
337
+
338
+ $data = new \stdClass();
339
+
340
+ if (! function_exists('media_handle_sideload')) {
341
+ require_once( ABSPATH . 'wp-admin/includes/media.php' );
342
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
343
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
344
+ }
345
+
346
+ if (empty($file)) {
347
+ return $data;
348
+ }
349
+
350
+ // Set variables for storage, fix file filename for query strings.
351
+ preg_match('/[^\?]+\.(jpe?g|jpe|gif|png|svg)\b/i', $file, $matches);
352
+
353
+ $file_array = [];
354
+
355
+ $file_array['name'] = basename($matches[0]);
356
+
357
+ // Download file to temp location.
358
+ $file_array['tmp_name'] = download_url($file);
359
+
360
+ // If error storing temporarily, return the error.
361
+ if (is_wp_error($file_array['tmp_name'])) {
362
+ return $file_array['tmp_name'];
363
+ }
364
+
365
+ // Do the validation and storage stuff.
366
+ $id = media_handle_sideload($file_array, 0);
367
+
368
+ // If error storing permanently, unlink.
369
+ if (is_wp_error($id)) {
370
+ @unlink($file_array['tmp_name']);
371
+ return $id;
372
+ }
373
+
374
+ update_post_meta($id, 'blocksy_demos_imported_post', true);
375
+
376
+ // Build the object to return.
377
+ $meta = wp_get_attachment_metadata($id);
378
+ $data->attachment_id = $id;
379
+ $data->url = wp_get_attachment_url($id);
380
+ $data->thumbnail_url = wp_get_attachment_thumb_url($id);
381
+ $data->height = $meta['height'];
382
+ $data->width = $meta['width'];
383
+
384
+ $this->sideloaded_images[$file] = $data;
385
+
386
+ return $data;
387
+ }
388
+
389
+ private function is_image_url($string = '') {
390
+ if (is_string($string)) {
391
+ if (preg_match('/\.(jpg|jpeg|png|gif|svg)/i', $string)) {
392
+ return true;
393
+ }
394
+ }
395
+
396
+ return false;
397
+ }
398
+ }
399
+
400
+
trunk/framework/features/demo-install/parsers.php ADDED
@@ -0,0 +1,701 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WordPress eXtended RSS file parser implementations
5
+ *
6
+ * @package WordPress
7
+ * @subpackage Importer
8
+ */
9
+
10
+ /**
11
+ * WordPress Importer class for managing parsing of WXR files.
12
+ */
13
+ class WXR_Parser {
14
+ function parse( $file ) {
15
+ // Attempt to use proper XML parsers first
16
+ if ( extension_loaded( 'simplexml' ) ) {
17
+ $parser = new WXR_Parser_SimpleXML;
18
+ $result = $parser->parse( $file );
19
+
20
+ // If SimpleXML succeeds or this is an invalid WXR file then return the results
21
+ if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' != $result->get_error_code() )
22
+ return $result;
23
+ } else if ( extension_loaded( 'xml' ) ) {
24
+ $parser = new WXR_Parser_XML;
25
+ $result = $parser->parse( $file );
26
+
27
+ // If XMLParser succeeds or this is an invalid WXR file then return the results
28
+ if ( ! is_wp_error( $result ) || 'XML_parse_error' != $result->get_error_code() )
29
+ return $result;
30
+ }
31
+
32
+ // We have a malformed XML file, so display the error and fallthrough to regex
33
+ if ( isset($result) && defined('IMPORT_DEBUG') && IMPORT_DEBUG ) {
34
+ echo '<pre>';
35
+ if ( 'SimpleXML_parse_error' == $result->get_error_code() ) {
36
+ foreach ( $result->get_error_data() as $error )
37
+ echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n";
38
+ } else if ( 'XML_parse_error' == $result->get_error_code() ) {
39
+ $error = $result->get_error_data();
40
+ echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] );
41
+ }
42
+ echo '</pre>';
43
+ echo '<p><strong>' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '</strong><br />';
44
+ echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '</p>';
45
+ }
46
+
47
+ // use regular expressions if nothing else available or this is bad XML
48
+ $parser = new WXR_Parser_Regex;
49
+ return $parser->parse( $file );
50
+ }
51
+ }
52
+
53
+ /**
54
+ * WXR Parser that makes use of the SimpleXML PHP extension.
55
+ */
56
+ class WXR_Parser_SimpleXML {
57
+ function parse( $file ) {
58
+ $authors = $posts = $categories = $tags = $terms = array();
59
+
60
+ $internal_errors = libxml_use_internal_errors(true);
61
+
62
+ $dom = new DOMDocument;
63
+ $old_value = null;
64
+ if ( function_exists( 'libxml_disable_entity_loader' ) ) {
65
+ $old_value = libxml_disable_entity_loader( true );
66
+ }
67
+ $success = $dom->loadXML(blc_load_xml_file($file));
68
+
69
+ if (! is_null($old_value)) {
70
+ libxml_disable_entity_loader( $old_value );
71
+ }
72
+
73
+ if ( ! $success || isset( $dom->doctype ) ) {
74
+ return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
75
+ }
76
+
77
+ $xml = simplexml_import_dom( $dom );
78
+ unset( $dom );
79
+
80
+ // halt if loading produces an error
81
+ if ( ! $xml )
82
+ return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
83
+
84
+ $wxr_version = $xml->xpath('/rss/channel/wp:wxr_version');
85
+ if ( ! $wxr_version )
86
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
87
+
88
+ $wxr_version = (string) trim( $wxr_version[0] );
89
+ // confirm that we are dealing with the correct file format
90
+ if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) )
91
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
92
+
93
+ $base_url = $xml->xpath('/rss/channel/wp:base_site_url');
94
+ $base_url = (string) trim( $base_url[0] );
95
+
96
+ $namespaces = $xml->getDocNamespaces();
97
+ if ( ! isset( $namespaces['wp'] ) )
98
+ $namespaces['wp'] = 'http://wordpress.org/export/1.1/';
99
+ if ( ! isset( $namespaces['excerpt'] ) )
100
+ $namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/';
101
+
102
+ // grab authors
103
+ foreach ( $xml->xpath('/rss/channel/wp:author') as $author_arr ) {
104
+ $a = $author_arr->children( $namespaces['wp'] );
105
+ $login = (string) $a->author_login;
106
+ $authors[$login] = array(
107
+ 'author_id' => (int) $a->author_id,
108
+ 'author_login' => $login,
109
+ 'author_email' => (string) $a->author_email,
110
+ 'author_display_name' => (string) $a->author_display_name,
111
+ 'author_first_name' => (string) $a->author_first_name,
112
+ 'author_last_name' => (string) $a->author_last_name
113
+ );
114
+ }
115
+
116
+ // grab cats, tags and terms
117
+ foreach ( $xml->xpath('/rss/channel/wp:category') as $term_arr ) {
118
+ $t = $term_arr->children( $namespaces['wp'] );
119
+ $category = array(
120
+ 'term_id' => (int) $t->term_id,
121
+ 'category_nicename' => (string) $t->category_nicename,
122
+ 'category_parent' => (string) $t->category_parent,
123
+ 'cat_name' => (string) $t->cat_name,
124
+ 'category_description' => (string) $t->category_description
125
+ );
126
+
127
+ foreach ( $t->termmeta as $meta ) {
128
+ $category['termmeta'][] = array(
129
+ 'key' => (string) $meta->meta_key,
130
+ 'value' => (string) $meta->meta_value
131
+ );
132
+ }
133
+
134
+ $categories[] = $category;
135
+ }
136
+
137
+ foreach ( $xml->xpath('/rss/channel/wp:tag') as $term_arr ) {
138
+ $t = $term_arr->children( $namespaces['wp'] );
139
+ $tag = array(
140
+ 'term_id' => (int) $t->term_id,
141
+ 'tag_slug' => (string) $t->tag_slug,
142
+ 'tag_name' => (string) $t->tag_name,
143
+ 'tag_description' => (string) $t->tag_description
144
+ );
145
+
146
+ foreach ( $t->termmeta as $meta ) {
147
+ $tag['termmeta'][] = array(
148
+ 'key' => (string) $meta->meta_key,
149
+ 'value' => (string) $meta->meta_value
150
+ );
151
+ }
152
+
153
+ $tags[] = $tag;
154
+ }
155
+
156
+ foreach ( $xml->xpath('/rss/channel/wp:term') as $term_arr ) {
157
+ $t = $term_arr->children( $namespaces['wp'] );
158
+ $term = array(
159
+ 'term_id' => (int) $t->term_id,
160
+ 'term_taxonomy' => (string) $t->term_taxonomy,
161
+ 'slug' => (string) $t->term_slug,
162
+ 'term_parent' => (string) $t->term_parent,
163
+ 'term_name' => (string) $t->term_name,
164
+ 'term_description' => (string) $t->term_description
165
+ );
166
+
167
+ foreach ( $t->termmeta as $meta ) {
168
+ $term['termmeta'][] = array(
169
+ 'key' => (string) $meta->meta_key,
170
+ 'value' => (string) $meta->meta_value
171
+ );
172
+ }
173
+
174
+ $terms[] = $term;
175
+ }
176
+
177
+ // grab posts
178
+ foreach ( $xml->channel->item as $item ) {
179
+ $post = array(
180
+ 'post_title' => (string) $item->title,
181
+ 'guid' => (string) $item->guid,
182
+ );
183
+
184
+ $dc = $item->children( 'http://purl.org/dc/elements/1.1/' );
185
+ $post['post_author'] = (string) $dc->creator;
186
+
187
+ $content = $item->children( 'http://purl.org/rss/1.0/modules/content/' );
188
+ $excerpt = $item->children( $namespaces['excerpt'] );
189
+ $post['post_content'] = (string) $content->encoded;
190
+ $post['post_excerpt'] = (string) $excerpt->encoded;
191
+
192
+ $wp = $item->children( $namespaces['wp'] );
193
+ $post['post_id'] = (int) $wp->post_id;
194
+ $post['post_date'] = (string) $wp->post_date;
195
+ $post['post_date_gmt'] = (string) $wp->post_date_gmt;
196
+ $post['comment_status'] = (string) $wp->comment_status;
197
+ $post['ping_status'] = (string) $wp->ping_status;
198
+ $post['post_name'] = (string) $wp->post_name;
199
+ $post['status'] = (string) $wp->status;
200
+ $post['post_parent'] = (int) $wp->post_parent;
201
+ $post['menu_order'] = (int) $wp->menu_order;
202
+ $post['post_type'] = (string) $wp->post_type;
203
+ $post['post_password'] = (string) $wp->post_password;
204
+ $post['is_sticky'] = (int) $wp->is_sticky;
205
+
206
+ if ( isset($wp->attachment_url) )
207
+ $post['attachment_url'] = (string) $wp->attachment_url;
208
+
209
+ foreach ( $item->category as $c ) {
210
+ $att = $c->attributes();
211
+ if ( isset( $att['nicename'] ) )
212
+ $post['terms'][] = array(
213
+ 'name' => (string) $c,
214
+ 'slug' => (string) $att['nicename'],
215
+ 'domain' => (string) $att['domain']
216
+ );
217
+ }
218
+
219
+ foreach ( $wp->postmeta as $meta ) {
220
+ $post['postmeta'][] = array(
221
+ 'key' => (string) $meta->meta_key,
222
+ 'value' => (string) $meta->meta_value
223
+ );
224
+ }
225
+
226
+ foreach ( $wp->comment as $comment ) {
227
+ $meta = array();
228
+ if ( isset( $comment->commentmeta ) ) {
229
+ foreach ( $comment->commentmeta as $m ) {
230
+ $meta[] = array(
231
+ 'key' => (string) $m->meta_key,
232
+ 'value' => (string) $m->meta_value
233
+ );
234
+ }
235
+ }
236
+
237
+ $post['comments'][] = array(
238
+ 'comment_id' => (int) $comment->comment_id,
239
+ 'comment_author' => (string) $comment->comment_author,
240
+ 'comment_author_email' => (string) $comment->comment_author_email,
241
+ 'comment_author_IP' => (string) $comment->comment_author_IP,
242
+ 'comment_author_url' => (string) $comment->comment_author_url,
243
+ 'comment_date' => (string) $comment->comment_date,
244
+ 'comment_date_gmt' => (string) $comment->comment_date_gmt,
245
+ 'comment_content' => (string) $comment->comment_content,
246
+ 'comment_approved' => (string) $comment->comment_approved,
247
+ 'comment_type' => (string) $comment->comment_type,
248
+ 'comment_parent' => (string) $comment->comment_parent,
249
+ 'comment_user_id' => (int) $comment->comment_user_id,
250
+ 'commentmeta' => $meta,
251
+ );
252
+ }
253
+
254
+ $posts[] = $post;
255
+ }
256
+
257
+ return array(
258
+ 'authors' => $authors,
259
+ 'posts' => $posts,
260
+ 'categories' => $categories,
261
+ 'tags' => $tags,
262
+ 'terms' => $terms,
263
+ 'base_url' => $base_url,
264
+ 'version' => $wxr_version
265
+ );
266
+ }
267
+ }
268
+
269
+ /**
270
+ * WXR Parser that makes use of the XML Parser PHP extension.
271
+ */
272
+ class WXR_Parser_XML {
273
+ var $wp_tags = array(
274
+ 'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status', 'wp:attachment_url',
275
+ 'wp:status', 'wp:post_name', 'wp:post_parent', 'wp:menu_order', 'wp:post_type', 'wp:post_password',
276
+ 'wp:is_sticky', 'wp:term_id', 'wp:category_nicename', 'wp:category_parent', 'wp:cat_name', 'wp:category_description',
277
+ 'wp:tag_slug', 'wp:tag_name', 'wp:tag_description', 'wp:term_taxonomy', 'wp:term_parent',
278
+ 'wp:term_name', 'wp:term_description', 'wp:author_id', 'wp:author_login', 'wp:author_email', 'wp:author_display_name',
279
+ 'wp:author_first_name', 'wp:author_last_name',
280
+ );
281
+ var $wp_sub_tags = array(
282
+ 'wp:comment_id', 'wp:comment_author', 'wp:comment_author_email', 'wp:comment_author_url',
283
+ 'wp:comment_author_IP', 'wp:comment_date', 'wp:comment_date_gmt', 'wp:comment_content',
284
+ 'wp:comment_approved', 'wp:comment_type', 'wp:comment_parent', 'wp:comment_user_id',
285
+ );
286
+
287
+ function parse( $file ) {
288
+ $this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false;
289
+ $this->authors = $this->posts = $this->term = $this->category = $this->tag = array();
290
+
291
+ $xml = xml_parser_create( 'UTF-8' );
292
+ xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
293
+ xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
294
+ xml_set_object( $xml, $this );
295
+ xml_set_character_data_handler( $xml, 'cdata' );
296
+ xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
297
+
298
+ if ( ! xml_parse( $xml, blc_load_xml_file($file), true ) ) {
299
+ $current_line = xml_get_current_line_number( $xml );
300
+ $current_column = xml_get_current_column_number( $xml );
301
+ $error_code = xml_get_error_code( $xml );
302
+ $error_string = xml_error_string( $error_code );
303
+ return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array( $current_line, $current_column, $error_string ) );
304
+ }
305
+ xml_parser_free( $xml );
306
+
307
+ if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) )
308
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
309
+
310
+ return array(
311
+ 'authors' => $this->authors,
312
+ 'posts' => $this->posts,
313
+ 'categories' => $this->category,
314
+ 'tags' => $this->tag,
315
+ 'terms' => $this->term,
316
+ 'base_url' => $this->base_url,
317
+ 'version' => $this->wxr_version
318
+ );
319
+ }
320
+
321
+ function tag_open( $parse, $tag, $attr ) {
322
+ if ( in_array( $tag, $this->wp_tags ) ) {
323
+ $this->in_tag = substr( $tag, 3 );
324
+ return;
325
+ }
326
+
327
+ if ( in_array( $tag, $this->wp_sub_tags ) ) {
328
+ $this->in_sub_tag = substr( $tag, 3 );
329
+ return;
330
+ }
331
+
332
+ switch ( $tag ) {
333
+ case 'category':
334
+ if ( isset($attr['domain'], $attr['nicename']) ) {
335
+ $this->sub_data['domain'] = $attr['domain'];
336
+ $this->sub_data['slug'] = $attr['nicename'];
337
+ }
338
+ break;
339
+ case 'item': $this->in_post = true;
340
+ case 'title': if ( $this->in_post ) $this->in_tag = 'post_title'; break;
341
+ case 'guid': $this->in_tag = 'guid'; break;
342
+ case 'dc:creator': $this->in_tag = 'post_author'; break;
343
+ case 'content:encoded': $this->in_tag = 'post_content'; break;
344
+ case 'excerpt:encoded': $this->in_tag = 'post_excerpt'; break;
345
+
346
+ case 'wp:term_slug': $this->in_tag = 'slug'; break;
347
+ case 'wp:meta_key': $this->in_sub_tag = 'key'; break;
348
+ case 'wp:meta_value': $this->in_sub_tag = 'value'; break;
349
+ }
350
+ }
351
+
352
+ function cdata( $parser, $cdata ) {
353
+ if ( ! trim( $cdata ) )
354
+ return;
355
+
356
+ if ( false !== $this->in_tag || false !== $this->in_sub_tag ) {
357
+ $this->cdata .= $cdata;
358
+ } else {
359
+ $this->cdata .= trim( $cdata );
360
+ }
361
+ }
362
+
363
+ function tag_close( $parser, $tag ) {
364
+ switch ( $tag ) {
365
+ case 'wp:comment':
366
+ unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data
367
+ if ( ! empty( $this->sub_data ) )
368
+ $this->data['comments'][] = $this->sub_data;
369
+ $this->sub_data = false;
370
+ break;
371
+ case 'wp:commentmeta':
372
+ $this->sub_data['commentmeta'][] = array(
373
+ 'key' => $this->sub_data['key'],
374
+ 'value' => $this->sub_data['value']
375
+ );
376
+ break;
377
+ case 'category':
378
+ if ( ! empty( $this->sub_data ) ) {
379
+ $this->sub_data['name'] = $this->cdata;
380
+ $this->data['terms'][] = $this->sub_data;
381
+ }
382
+ $this->sub_data = false;
383
+ break;
384
+ case 'wp:postmeta':
385
+ if ( ! empty( $this->sub_data ) )
386
+ $this->data['postmeta'][] = $this->sub_data;
387
+ $this->sub_data = false;
388
+ break;
389
+ case 'item':
390
+ $this->posts[] = $this->data;
391
+ $this->data = false;
392
+ break;
393
+ case 'wp:category':
394
+ case 'wp:tag':
395
+ case 'wp:term':
396
+ $n = substr( $tag, 3 );
397
+ array_push( $this->$n, $this->data );
398
+ $this->data = false;
399
+ break;
400
+ case 'wp:author':
401
+ if ( ! empty($this->data['author_login']) )
402
+ $this->authors[$this->data['author_login']] = $this->data;
403
+ $this->data = false;
404
+ break;
405
+ case 'wp:base_site_url':
406
+ $this->base_url = $this->cdata;
407
+ break;
408
+ case 'wp:wxr_version':
409
+ $this->wxr_version = $this->cdata;
410
+ break;
411
+
412
+ default:
413
+ if ( $this->in_sub_tag ) {
414
+ $this->sub_data[$this->in_sub_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
415
+ $this->in_sub_tag = false;
416
+ } else if ( $this->in_tag ) {
417
+ $this->data[$this->in_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
418
+ $this->in_tag = false;
419
+ }
420
+ }
421
+
422
+ $this->cdata = false;
423
+ }
424
+ }
425
+
426
+ /**
427
+ * WXR Parser that uses regular expressions. Fallback for installs without an XML parser.
428
+ */
429
+ class WXR_Parser_Regex {
430
+ var $authors = array();
431
+ var $posts = array();
432
+ var $categories = array();
433
+ var $tags = array();
434
+ var $terms = array();
435
+ var $base_url = '';
436
+
437
+ function __construct() {
438
+ $this->has_gzip = is_callable( 'gzopen' );
439
+ }
440
+
441
+ function parse( $file ) {
442
+ $wxr_version = $in_multiline = false;
443
+
444
+ $multiline_content = '';
445
+
446
+ $multiline_tags = array(
447
+ 'item' => array( 'posts', array( $this, 'process_post' ) ),
448
+ 'wp:category' => array( 'categories', array( $this, 'process_category' ) ),
449
+ 'wp:tag' => array( 'tags', array( $this, 'process_tag' ) ),
450
+ 'wp:term' => array( 'terms', array( $this, 'process_term' ) ),
451
+ );
452
+
453
+ $fp = $this->fopen( $file, 'r' );
454
+ if ( $fp ) {
455
+ while ( ! $this->feof( $fp ) ) {
456
+ $importline = rtrim( $this->fgets( $fp ) );
457
+
458
+ if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) )
459
+ $wxr_version = $version[1];
460
+
461
+ if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) {
462
+ preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url );
463
+ $this->base_url = $url[1];
464
+ continue;
465
+ }
466
+
467
+ if ( false !== strpos( $importline, '<wp:author>' ) ) {
468
+ preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author );
469
+ $a = $this->process_author( $author[1] );
470
+ $this->authors[$a['author_login']] = $a;
471
+ continue;
472
+ }
473
+
474
+ foreach ( $multiline_tags as $tag => $handler ) {
475
+ // Handle multi-line tags on a singular line
476
+ if ( preg_match( '|<' . $tag . '>(.*?)</' . $tag . '>|is', $importline, $matches ) ) {
477
+ $this->{$handler[0]}[] = call_user_func( $handler[1], $matches[1] );
478
+
479
+ } elseif ( false !== ( $pos = strpos( $importline, "<$tag>" ) ) ) {
480
+ // Take note of any content after the opening tag
481
+ $multiline_content = trim( substr( $importline, $pos + strlen( $tag ) + 2 ) );
482
+
483
+ // We don't want to have this line added to `$is_multiline` below.
484
+ $importline = '';
485
+ $in_multiline = $tag;
486
+
487
+ } elseif ( false !== ( $pos = strpos( $importline, "</$tag>" ) ) ) {
488
+ $in_multiline = false;
489
+ $multiline_content .= trim( substr( $importline, 0, $pos ) );
490
+
491
+ $this->{$handler[0]}[] = call_user_func( $handler[1], $multiline_content );
492
+ }
493
+ }
494
+
495
+ if ( $in_multiline && $importline ) {
496
+ $multiline_content .= $importline . "\n";
497
+ }
498
+ }
499
+
500
+ $this->fclose($fp);
501
+ }
502
+
503
+ if ( ! $wxr_version )
504
+ return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
505
+
506
+ return array(
507
+ 'authors' => $this->authors,
508
+ 'posts' => $this->posts,
509
+ 'categories' => $this->categories,
510
+ 'tags' => $this->tags,
511
+ 'terms' => $this->terms,
512
+ 'base_url' => $this->base_url,
513
+ 'version' => $wxr_version
514
+ );
515
+ }
516
+
517
+ function get_tag( $string, $tag ) {
518
+ preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
519
+ if ( isset( $return[1] ) ) {
520
+ if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) {
521
+ if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
522
+ preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
523
+ $return = '';
524
+ foreach( $matches[1] as $match )
525
+ $return .= $match;
526
+ } else {
527
+ $return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
528
+ }
529
+ } else {
530
+ $return = $return[1];
531
+ }
532
+ } else {
533
+ $return = '';
534
+ }
535
+ return $return;
536
+ }
537
+
538
+ function process_category( $c ) {
539
+ return array(
540
+ 'term_id' => $this->get_tag( $c, 'wp:term_id' ),
541
+ 'cat_name' => $this->get_tag( $c, 'wp:cat_name' ),
542
+ 'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ),
543
+ 'category_parent' => $this->get_tag( $c, 'wp:category_parent' ),
544
+ 'category_description' => $this->get_tag( $c, 'wp:category_description' ),
545
+ );
546
+ }
547
+
548
+ function process_tag( $t ) {
549
+ return array(
550
+ 'term_id' => $this->get_tag( $t, 'wp:term_id' ),
551
+ 'tag_name' => $this->get_tag( $t, 'wp:tag_name' ),
552
+ 'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ),
553
+ 'tag_description' => $this->get_tag( $t, 'wp:tag_description' ),
554
+ );
555
+ }
556
+
557
+ function process_term( $t ) {
558
+ return array(
559
+ 'term_id' => $this->get_tag( $t, 'wp:term_id' ),
560
+ 'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ),
561
+ 'slug' => $this->get_tag( $t, 'wp:term_slug' ),
562
+ 'term_parent' => $this->get_tag( $t, 'wp:term_parent' ),
563
+ 'term_name' => $this->get_tag( $t, 'wp:term_name' ),
564
+ 'term_description' => $this->get_tag( $t, 'wp:term_description' ),
565
+ );
566
+ }
567
+
568
+ function process_author( $a ) {
569
+ return array(
570
+ 'author_id' => $this->get_tag( $a, 'wp:author_id' ),
571
+ 'author_login' => $this->get_tag( $a, 'wp:author_login' ),
572
+ 'author_email' => $this->get_tag( $a, 'wp:author_email' ),
573
+ 'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ),
574
+ 'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ),
575
+ 'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ),
576
+ );
577
+ }
578
+
579
+ function process_post( $post ) {
580
+ $post_id = $this->get_tag( $post, 'wp:post_id' );
581
+ $post_title = $this->get_tag( $post, 'title' );
582
+ $post_date = $this->get_tag( $post, 'wp:post_date' );
583
+ $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
584
+ $comment_status = $this->get_tag( $post, 'wp:comment_status' );
585
+ $ping_status = $this->get_tag( $post, 'wp:ping_status' );
586
+ $status = $this->get_tag( $post, 'wp:status' );
587
+ $post_name = $this->get_tag( $post, 'wp:post_name' );
588
+ $post_parent = $this->get_tag( $post, 'wp:post_parent' );
589
+ $menu_order = $this->get_tag( $post, 'wp:menu_order' );
590
+ $post_type = $this->get_tag( $post, 'wp:post_type' );
591
+ $post_password = $this->get_tag( $post, 'wp:post_password' );
592
+ $is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
593
+ $guid = $this->get_tag( $post, 'guid' );
594
+ $post_author = $this->get_tag( $post, 'dc:creator' );
595
+
596
+ $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
597
+ $post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt );
598
+ $post_excerpt = str_replace( '<br>', '<br />', $post_excerpt );
599
+ $post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt );
600
+
601
+ $post_content = $this->get_tag( $post, 'content:encoded' );
602
+ $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
603
+ $post_content = str_replace( '<br>', '<br />', $post_content );
604
+ $post_content = str_replace( '<hr>', '<hr />', $post_content );
605
+
606
+ $postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt',
607
+ 'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent',
608
+ 'menu_order', 'post_type', 'post_password', 'is_sticky'
609
+ );
610
+
611
+ $attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
612
+ if ( $attachment_url )
613
+ $postdata['attachment_url'] = $attachment_url;
614
+
615
+ preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
616
+ foreach ( $terms as $t ) {
617
+ $post_terms[] = array(
618
+ 'slug' => $t[2],
619
+ 'domain' => $t[1],
620
+ 'name' => str_replace( array( '<![CDATA[', ']]>' ), '', $t[3] ),
621
+ );
622
+ }
623
+ if ( ! empty( $post_terms ) ) $postdata['terms'] = $post_terms;
624
+
625
+ preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments );
626
+ $comments = $comments[1];
627
+ if ( $comments ) {
628
+ foreach ( $comments as $comment ) {
629
+ preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta );
630
+ $commentmeta = $commentmeta[1];
631
+ $c_meta = array();
632
+ foreach ( $commentmeta as $m ) {
633
+ $c_meta[] = array(
634
+ 'key' => $this->get_tag( $m, 'wp:meta_key' ),
635
+ 'value' => $this->get_tag( $m, 'wp:meta_value' ),
636
+ );
637
+ }
638
+
639
+ $post_comments[] = array(
640
+ 'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ),
641
+ 'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ),
642
+ 'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ),
643
+ 'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ),
644
+ 'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ),
645
+ 'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ),
646
+ 'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ),
647
+ 'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ),
648
+ 'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
649
+ 'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
650
+ 'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
651
+ 'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
652
+ 'commentmeta' => $c_meta,
653
+ );
654
+ }
655
+ }
656
+ if ( ! empty( $post_comments ) ) $postdata['comments'] = $post_comments;
657
+
658
+ preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta );
659
+ $postmeta = $postmeta[1];
660
+ if ( $postmeta ) {
661
+ foreach ( $postmeta as $p ) {
662
+ $post_postmeta[] = array(
663
+ 'key' => $this->get_tag( $p, 'wp:meta_key' ),
664
+ 'value' => $this->get_tag( $p, 'wp:meta_value' ),
665
+ );
666
+ }
667
+ }
668
+ if ( ! empty( $post_postmeta ) ) $postdata['postmeta'] = $post_postmeta;
669
+
670
+ return $postdata;
671
+ }
672
+
673
+ function _normalize_tag( $matches ) {
674
+ return '<' . strtolower( $matches[1] );
675
+ }
676
+
677
+ function fopen( $filename, $mode = 'r' ) {
678
+ if ( $this->has_gzip )
679
+ return gzopen( $filename, $mode );
680
+ return fopen( $filename, $mode );
681
+ }
682
+
683
+ function feof( $fp ) {
684
+ if ( $this->has_gzip )
685
+ return gzeof( $fp );
686
+ return feof( $fp );
687
+ }
688
+
689
+ function fgets( $fp, $len = 8192 ) {
690
+ if ( $this->has_gzip )
691
+ return gzgets( $fp, $len );
692
+ return fgets( $fp, $len );
693
+ }
694
+
695
+ function fclose( $fp ) {
696
+ if ( $this->has_gzip )
697
+ return gzclose( $fp );
698
+ return fclose( $fp );
699
+ }
700
+ }
701
+
trunk/framework/features/demo-install/plugins-uninstaller.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallPluginsUninstaller {
6
+ public function import() {
7
+ Plugin::instance()->demo->start_streaming();
8
+
9
+ if (! current_user_can('edit_theme_options')) {
10
+ Plugin::instance()->demo->emit_sse_message([
11
+ 'action' => 'complete',
12
+ 'error' => false,
13
+ ]);
14
+
15
+ exit;
16
+ }
17
+
18
+ if (! isset($_REQUEST['plugins']) || !$_REQUEST['plugins']) {
19
+ Plugin::instance()->demo->emit_sse_message([
20
+ 'action' => 'complete',
21
+ 'error' => false,
22
+ ]);
23
+
24
+ exit;
25
+ }
26
+
27
+ $plugins = explode(':', $_REQUEST['plugins']);
28
+
29
+ $plugins_manager = Plugin::instance()->demo->get_plugins_manager();
30
+
31
+ foreach ($plugins as $single_plugin) {
32
+ $plugins_manager->plugin_deactivation($single_plugin);
33
+ }
34
+
35
+ Plugin::instance()->demo->emit_sse_message([
36
+ 'action' => 'complete',
37
+ 'error' => false,
38
+ ]);
39
+
40
+ exit;
41
+ }
42
+ }
43
+
44
+
trunk/framework/features/demo-install/required-plugins.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallPluginsInstaller {
6
+ protected $has_streaming = true;
7
+ protected $plugins = null;
8
+
9
+ public function __construct($args = []) {
10
+ $args = wp_parse_args($args, [
11
+ 'has_streaming' => true,
12
+ 'plugins' => null
13
+ ]);
14
+
15
+ if (
16
+ !$args['plugins']
17
+ &&
18
+ isset($_REQUEST['plugins'])
19
+ &&
20
+ $_REQUEST['plugins']
21
+ ) {
22
+ $args['plugins'] = $_REQUEST['plugins'];
23
+ }
24
+
25
+ $this->has_streaming = $args['has_streaming'];
26
+ $this->plugins = $args['plugins'];
27
+ }
28
+
29
+ public function import() {
30
+ if ($this->has_streaming) {
31
+ Plugin::instance()->demo->start_streaming();
32
+
33
+ if (! current_user_can('edit_theme_options')) {
34
+ Plugin::instance()->demo->emit_sse_message([
35
+ 'action' => 'complete',
36
+ 'error' => false,
37
+ ]);
38
+ exit;
39
+ }
40
+
41
+ if (! isset($_REQUEST['plugins']) || !$_REQUEST['plugins']) {
42
+ Plugin::instance()->demo->emit_sse_message([
43
+ 'action' => 'complete',
44
+ 'error' => false,
45
+ ]);
46
+ exit;
47
+ }
48
+ }
49
+
50
+ $plugins = explode(':', $this->plugins);
51
+
52
+ $plugins_manager = Plugin::instance()->demo->get_plugins_manager();
53
+
54
+ foreach ($plugins as $single_plugin) {
55
+ if ($this->has_streaming) {
56
+ Plugin::instance()->demo->emit_sse_message([
57
+ 'action' => 'install_plugin',
58
+ 'name' => $single_plugin
59
+ ]);
60
+ }
61
+
62
+ $plugins_manager->prepare_install($single_plugin);
63
+ echo $single_plugin;
64
+
65
+ if ($this->has_streaming) {
66
+ Plugin::instance()->demo->emit_sse_message([
67
+ 'action' => 'activate_plugin',
68
+ 'name' => $single_plugin
69
+ ]);
70
+ }
71
+
72
+ $plugins_manager->plugin_activation($single_plugin);
73
+ }
74
+
75
+ if ($this->has_streaming) {
76
+ Plugin::instance()->demo->emit_sse_message([
77
+ 'action' => 'complete',
78
+ 'error' => false,
79
+ ]);
80
+
81
+ exit;
82
+ }
83
+ }
84
+ }
85
+
trunk/framework/features/demo-install/widgets-export.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallWidgetsExport {
6
+ public function export() {
7
+ $available_widgets = $this->available_widgets();
8
+
9
+ $widget_instances = array();
10
+
11
+ foreach ( $available_widgets as $widget_data ) {
12
+ $instances = get_option('widget_' . $widget_data['id_base']);
13
+
14
+ if (! empty($instances)) {
15
+ foreach ($instances as $instance_id => $instance_data) {
16
+ if (is_numeric($instance_id)) {
17
+ $unique_instance_id = $widget_data['id_base'] . '-' . $instance_id;
18
+ $widget_instances[ $unique_instance_id ] = $instance_data;
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ $sidebars_widgets = get_option('sidebars_widgets');
25
+ $sidebars_widget_instances = [];
26
+
27
+ foreach ($sidebars_widgets as $sidebar_id => $widget_ids) {
28
+ if ('wp_inactive_widgets' === $sidebar_id) {
29
+ continue;
30
+ }
31
+
32
+ if (! is_array($widget_ids) || empty($widget_ids)) {
33
+ continue;
34
+ }
35
+
36
+ foreach ($widget_ids as $widget_id) {
37
+ if (isset($widget_instances[$widget_id])) {
38
+ $sidebars_widget_instances[$sidebar_id][$widget_id] = $widget_instances[$widget_id];
39
+ }
40
+ }
41
+ }
42
+
43
+ return wp_json_encode($sidebars_widget_instances);
44
+ }
45
+
46
+ public function available_widgets() {
47
+ global $wp_registered_widget_controls;
48
+
49
+ $widget_controls = $wp_registered_widget_controls;
50
+
51
+ $available_widgets = array();
52
+
53
+ foreach ($widget_controls as $widget) {
54
+ // No duplicates.
55
+ if (
56
+ ! empty($widget['id_base'])
57
+ &&
58
+ ! isset($available_widgets[$widget['id_base']])
59
+ ) {
60
+ $available_widgets[$widget['id_base']]['id_base'] = $widget['id_base'];
61
+ $available_widgets[$widget['id_base']]['name'] = $widget['name'];
62
+ }
63
+ }
64
+
65
+ return $available_widgets;
66
+ }
67
+ }
trunk/framework/features/demo-install/widgets-import.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DemoInstallWidgetsInstaller {
6
+ protected $has_streaming = true;
7
+ protected $demo_name = null;
8
+
9
+ public function __construct($args = []) {
10
+ $args = wp_parse_args($args, [
11
+ 'has_streaming' => true,
12
+ 'demo_name' => null
13
+ ]);
14
+
15
+ if (
16
+ !$args['demo_name']
17
+ &&
18
+ isset($_REQUEST['demo_name'])
19
+ &&
20
+ $_REQUEST['demo_name']
21
+ ) {
22
+ $args['demo_name'] = $_REQUEST['demo_name'];
23
+ }
24
+
25
+ $this->has_streaming = $args['has_streaming'];
26
+ $this->demo_name = $args['demo_name'];
27
+ }
28
+
29
+ public function import() {
30
+ if ($this->has_streaming) {
31
+ Plugin::instance()->demo->start_streaming();
32
+
33
+ if (! current_user_can('edit_theme_options')) {
34
+ Plugin::instance()->demo->emit_sse_message([
35
+ 'action' => 'complete',
36
+ 'error' => 'No permission.',
37
+ ]);
38
+
39
+ exit;
40
+ }
41
+
42
+ if (! $this->demo_name) {
43
+ Plugin::instance()->demo->emit_sse_message([
44
+ 'action' => 'complete',
45
+ 'error' => 'No demo name passed.',
46
+ ]);
47
+ exit;
48
+ }
49
+ }
50
+
51
+ $demo_name = explode(':', $this->demo_name);
52
+
53
+ if (! isset($demo_name[1])) {
54
+ $demo_name[1] = '';
55
+ }
56
+
57
+ $demo = $demo_name[0];
58
+ $builder = $demo_name[1];
59
+
60
+ if ($this->has_streaming) {
61
+ Plugin::instance()->demo->emit_sse_message([
62
+ 'action' => 'download_demo_widgets',
63
+ 'error' => false,
64
+ ]);
65
+ }
66
+
67
+ $demo_content = Plugin::instance()->demo->fetch_single_demo([
68
+ 'demo' => $demo,
69
+ 'builder' => $builder,
70
+ 'field' => 'widgets'
71
+ ]);
72
+
73
+ if ($this->has_streaming) {
74
+ if (! isset($demo_content['widgets'])) {
75
+ Plugin::instance()->demo->emit_sse_message([
76
+ 'action' => 'complete',
77
+ 'demo' => $demo,
78
+ 'error' => __('Downloaded demo is corrupted.'),
79
+ ]);
80
+
81
+ exit;
82
+ }
83
+
84
+ Plugin::instance()->demo->emit_sse_message([
85
+ 'action' => 'apply_demo_widgets',
86
+ 'error' => false,
87
+ ]);
88
+ }
89
+
90
+ $data = json_decode(json_encode($demo_content['widgets']));
91
+
92
+ $result = $this->import_data($data);
93
+
94
+ if ($this->has_streaming) {
95
+ Plugin::instance()->demo->emit_sse_message([
96
+ 'action' => 'complete',
97
+ 'data' => $result,
98
+ 'error' => false,
99
+ ]);
100
+
101
+ exit;
102
+ }
103
+ }
104
+
105
+ public function import_data($data) {
106
+ if (empty($data) || !is_object($data)) {
107
+ return false;
108
+ }
109
+
110
+ $sidebars_widgets = get_option('sidebars_widgets');
111
+
112
+ if (! $sidebars_widgets) {
113
+ $sidebars_widgets = [];
114
+ }
115
+
116
+ foreach ($data as $sidebar_id => $widgets) {
117
+ if ('wp_inactive_widgets' === $sidebar_id) {
118
+ continue;
119
+ }
120
+
121
+ $result = $this->handle_single_sidebar($sidebar_id, $widgets);
122
+
123
+ foreach ($result as $widget_id) {
124
+ $sidebars_widgets[$sidebar_id][] = $widget_id;
125
+ }
126
+ }
127
+
128
+ update_option('sidebars_widgets', $sidebars_widgets);
129
+ unset($sidebars_widgets['array_version']);
130
+ set_theme_mod('sidebars_widgets', [
131
+ 'time' => time(),
132
+ 'data' => $sidebars_widgets
133
+ ]);
134
+ }
135
+
136
+ private function handle_single_sidebar($sidebar_id, $widgets) {
137
+ global $wp_registered_sidebars;
138
+
139
+ $available_widgets = $this->available_widgets();
140
+
141
+ $widget_instances = [];
142
+
143
+ foreach ($available_widgets as $widget_data) {
144
+ $widget_instances[$widget_data['id_base']] = get_option(
145
+ 'widget_' . $widget_data['id_base']
146
+ );
147
+ }
148
+
149
+ if (! isset($wp_registered_sidebars[$sidebar_id])) {
150
+ $sidebar_id = 'wp_inactive_widgets';
151
+ }
152
+
153
+ $result = [];
154
+
155
+ foreach ($widgets as $widget_instance_id => $widget) {
156
+ $id_base = preg_replace('/-[0-9]+$/', '', $widget_instance_id);
157
+ $instance_id_number = str_replace($id_base . '-', '', $widget_instance_id);
158
+
159
+ // Does site support this widget?
160
+ if (! isset($available_widgets[$id_base])) {
161
+ continue;
162
+ }
163
+
164
+ // Convert multidimensional objects to multidimensional arrays
165
+ // Some plugins like Jetpack Widget Visibility store settings
166
+ // as multidimensional arrays Without this, they are imported as
167
+ // objects and cause fatal error on Widgets page If this creates
168
+ // problems for plugins that do actually intend settings in
169
+ // objects then may need to consider other
170
+ // approach: https://wordpress.org/support/topic/problem-with-array-of-arrays
171
+ // It is probably much more likely that arrays are used than objects, however.
172
+ $widget = json_decode(wp_json_encode($widget), true);
173
+
174
+ /**
175
+ * Does widget with identical settings already exist in same sidebar?
176
+ * Skip identical widget.
177
+ */
178
+ /*
179
+ if (isset($widget_instances[$id_base])) {
180
+ // Get existing widgets in this sidebar.
181
+ $sidebar_widgets = isset(
182
+ $sidebars_widgets[$sidebar_id]
183
+ ) ? $sidebars_widgets[$sidebar_id] : [];
184
+
185
+ // Loop widgets with ID base.
186
+ $single_widget_instances = ! empty(
187
+ $widget_instances[$id_base]
188
+ ) ? $widget_instances[$id_base] : [];
189
+
190
+ $is_in_same_sidebar_with_same_id = false;
191
+
192
+ foreach ($single_widget_instances as $check_id => $check_widget) {
193
+ // Is widget in same sidebar and has identical settings?
194
+ if (
195
+ in_array("$id_base-$check_id", $sidebar_widgets, true)
196
+ &&
197
+ (array) $widget === $check_widget
198
+ ) {
199
+ $is_in_same_sidebar_with_same_id = true;
200
+ }
201
+ }
202
+
203
+ if ($is_in_same_sidebar_with_same_id) {
204
+ continue;
205
+ }
206
+ }
207
+ */
208
+
209
+ // Add widget instance
210
+ // All instances for that widget ID base, get fresh every time.
211
+ global $wpdb;
212
+
213
+ $single_widget_instances = maybe_unserialize(
214
+ $wpdb->get_row(
215
+ $wpdb->prepare(
216
+ "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
217
+ 'widget_' . $id_base
218
+ )
219
+ )->option_value
220
+ );
221
+
222
+ if (empty($single_widget_instances)) {
223
+ $single_widget_instances = [
224
+ '_multiwidget' => 1,
225
+ ];
226
+ }
227
+
228
+ $new_instance_id_number = 1;
229
+
230
+ while (true) {
231
+ if (! isset($single_widget_instances[$new_instance_id_number])) {
232
+ break;
233
+ }
234
+
235
+ $new_instance_id_number++;
236
+ }
237
+
238
+ // Add it.
239
+ $single_widget_instances[$new_instance_id_number] = $widget;
240
+
241
+ if (isset($single_widget_instances['_multiwidget'])) {
242
+ $multiwidget = $single_widget_instances['_multiwidget'];
243
+ unset($single_widget_instances['_multiwidget']);
244
+ $single_widget_instances['_multiwidget'] = $multiwidget;
245
+ }
246
+
247
+ update_option('widget_' . $id_base, $single_widget_instances, false);
248
+
249
+ $new_instance_id = $id_base . '-' . $new_instance_id_number;
250
+
251
+ $result[] = $new_instance_id;
252
+ }
253
+
254
+ return $result;
255
+ }
256
+
257
+ private function available_widgets() {
258
+ global $wp_registered_widget_controls;
259
+
260
+ $widget_controls = $wp_registered_widget_controls;
261
+ $available_widgets = [];
262
+
263
+ foreach ($widget_controls as $widget) {
264
+ if (
265
+ !empty($widget['id_base'])
266
+ &&
267
+ !isset($available_widgets[$widget['id_base']])
268
+ ) {
269
+ $available_widgets[$widget['id_base']]['id_base'] = $widget['id_base'];
270
+ $available_widgets[$widget['id_base']]['name'] = $widget['name'];
271
+ }
272
+ }
273
+
274
+ return $available_widgets;
275
+ }
276
+ }
277
+
trunk/framework/features/demo-install/wp-importer.php ADDED
@@ -0,0 +1,1348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** Display verbose errors */
4
+ define( 'IMPORT_DEBUG', false );
5
+ // Load Importer API
6
+ require_once ABSPATH . 'wp-admin/includes/import.php';
7
+
8
+ if ( ! class_exists( 'WP_Importer' ) ) {
9
+ $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
10
+ if ( file_exists( $class_wp_importer ) )
11
+ require $class_wp_importer;
12
+ }
13
+
14
+ // include WXR file parsers
15
+ require dirname( __FILE__ ) . '/parsers.php';
16
+
17
+ function blc_load_xml_file($url) {
18
+ set_time_limit(100);
19
+
20
+ if (ini_get('allow_url_fopen') == true) {
21
+ return file_get_contents($url, false, stream_context_create([
22
+ "ssl" => [
23
+ "verify_peer"=>false,
24
+ "verify_peer_name"=>false,
25
+ ]
26
+ ]));
27
+ } else if (function_exists('curl_init')) {
28
+ $curl = curl_init($url);
29
+
30
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
31
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
32
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
33
+
34
+ $result = curl_exec($curl);
35
+ curl_close($curl);
36
+
37
+ return $result;
38
+ } else {
39
+ throw new Exception("Can't load data.");
40
+ }
41
+ }
42
+
43
+ if ( ! function_exists( 'wp_slash_strings_only' ) ) {
44
+ /**
45
+ * Adds slashes to only string values in an array of values.
46
+ *
47
+ * Compat for WordPress < 5.3.0.
48
+ *
49
+ * @since 0.7.0
50
+ *
51
+ * @param mixed $value Scalar or array of scalars.
52
+ * @return mixed Slashes $value
53
+ */
54
+ function wp_slash_strings_only( $value ) {
55
+ return map_deep( $value, 'addslashes_strings_only' );
56
+ }
57
+ }
58
+
59
+ if ( ! function_exists( 'addslashes_strings_only' ) ) {
60
+ /**
61
+ * Adds slashes only if the provided value is a string.
62
+ *
63
+ * Compat for WordPress < 5.3.0.
64
+ *
65
+ * @since 0.7.0
66
+ *
67
+ * @param mixed $value
68
+ * @return mixed
69
+ */
70
+ function addslashes_strings_only( $value ) {
71
+ return is_string( $value ) ? addslashes( $value ) : $value;
72
+ }
73
+ }
74
+
75
+ if ( ! function_exists( 'map_deep' ) ) {
76
+ /**
77
+ * Maps a function to all non-iterable elements of an array or an object.
78
+ *
79
+ * Compat for WordPress < 4.4.0.
80
+ *
81
+ * @since 0.7.0
82
+ *
83
+ * @param mixed $value The array, object, or scalar.
84
+ * @param callable $callback The function to map onto $value.
85
+ * @return mixed The value with the callback applied to all non-arrays and non-objects inside it.
86
+ */
87
+ function map_deep( $value, $callback ) {
88
+ if ( is_array( $value ) ) {
89
+ foreach ( $value as $index => $item ) {
90
+ $value[ $index ] = map_deep( $item, $callback );
91
+ }
92
+ } elseif ( is_object( $value ) ) {
93
+ $object_vars = get_object_vars( $value );
94
+ foreach ( $object_vars as $property_name => $property_value ) {
95
+ $value->$property_name = map_deep( $property_value, $callback );
96
+ }
97
+ } else {
98
+ $value = call_user_func( $callback, $value );
99
+ }
100
+
101
+ return $value;
102
+ }
103
+ }
104
+
105
+ /**
106
+ * WordPress Importer class for managing the import process of a WXR file
107
+ *
108
+ * @package WordPress
109
+ * @subpackage Importer
110
+ */
111
+ if ( class_exists( 'WP_Importer' ) ) {
112
+ class Blocksy_WP_Import extends WP_Importer {
113
+ var $max_wxr_version = 1.2; // max. supported WXR version
114
+
115
+ var $id; // WXR attachment ID
116
+
117
+ // information to import from WXR file
118
+ var $version;
119
+ var $authors = array();
120
+ var $posts = array();
121
+ var $terms = array();
122
+ var $categories = array();
123
+ var $tags = array();
124
+ var $base_url = '';
125
+
126
+ // mappings from old information to new
127
+ var $processed_authors = array();
128
+ var $author_mapping = array();
129
+ var $processed_terms = array();
130
+ var $processed_posts = array();
131
+ var $post_orphans = array();
132
+ var $processed_menu_items = array();
133
+ var $menu_item_orphans = array();
134
+ var $missing_menu_items = array();
135
+
136
+ var $fetch_attachments = false;
137
+ var $url_remap = array();
138
+ var $featured_images = array();
139
+
140
+ /**
141
+ * Registered callback function for the WordPress Importer
142
+ *
143
+ * Manages the three separate stages of the WXR import process
144
+ */
145
+ function dispatch() {
146
+ $this->header();
147
+
148
+ $step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step'];
149
+ switch ( $step ) {
150
+ case 0:
151
+ $this->greet();
152
+ break;
153
+ case 1:
154
+ check_admin_referer( 'import-upload' );
155
+ if ( $this->handle_upload() )
156
+ $this->import_options();
157
+ break;
158
+ case 2:
159
+ check_admin_referer( 'import-wordpress' );
160
+ $this->fetch_attachments = ( ! empty( $_POST['fetch_attachments'] ) && $this->allow_fetch_attachments() );
161
+ $this->id = (int) $_POST['import_id'];
162
+ $file = get_attached_file( $this->id );
163
+ set_time_limit(0);
164
+ $this->import( $file );
165
+ break;
166
+ }
167
+
168
+ $this->footer();
169
+ }
170
+
171
+ /**
172
+ * The main controller for the actual import stage.
173
+ *
174
+ * @param string $file Path to the WXR file for importing
175
+ */
176
+ function import( $file ) {
177
+ add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
178
+ add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
179
+
180
+ $this->import_start( $file );
181
+
182
+ $this->get_author_mapping();
183
+
184
+ wp_suspend_cache_invalidation( true );
185
+ $this->process_categories();
186
+ $this->process_tags();
187
+ $this->process_terms();
188
+ $this->process_posts();
189
+ wp_suspend_cache_invalidation( false );
190
+
191
+ // update incorrect/missing information in the DB
192
+ $this->backfill_parents();
193
+ $this->backfill_attachment_urls();
194
+ $this->remap_featured_images();
195
+
196
+ $this->import_end();
197
+ }
198
+
199
+ /**
200
+ * Parses the WXR file and prepares us for the task of processing parsed data
201
+ *
202
+ * @param string $file Path to the WXR file for importing
203
+ */
204
+ function import_start( $file ) {
205
+ if ( ! is_file($file) ) {
206
+ /*
207
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
208
+ echo __( 'The file does not exist, please try again.', 'wordpress-importer' ) . '</p>';
209
+ $this->footer();
210
+ die();
211
+ */
212
+ }
213
+
214
+ $import_data = $this->parse( $file );
215
+
216
+ if ( is_wp_error( $import_data ) ) {
217
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
218
+ echo esc_html( $import_data->get_error_message() ) . '</p>';
219
+ $this->footer();
220
+ die();
221
+ }
222
+
223
+ $this->version = $import_data['version'];
224
+ $this->get_authors_from_import( $import_data );
225
+ $this->posts = $import_data['posts'];
226
+ $this->terms = $import_data['terms'];
227
+ $this->categories = $import_data['categories'];
228
+ $this->tags = $import_data['tags'];
229
+ $this->base_url = esc_url( $import_data['base_url'] );
230
+
231
+ wp_defer_term_counting( true );
232
+ wp_defer_comment_counting( true );
233
+
234
+ do_action( 'import_start' );
235
+ }
236
+
237
+ /**
238
+ * Performs post-import cleanup of files and the cache
239
+ */
240
+ function import_end() {
241
+ wp_import_cleanup( $this->id );
242
+
243
+ wp_cache_flush();
244
+ foreach ( get_taxonomies() as $tax ) {
245
+ delete_option( "{$tax}_children" );
246
+ _get_term_hierarchy( $tax );
247
+ }
248
+
249
+ wp_defer_term_counting( false );
250
+ wp_defer_comment_counting( false );
251
+
252
+ echo '<p>' . __( 'All done.', 'wordpress-importer' ) . ' <a href="' . admin_url() . '">' . __( 'Have fun!', 'wordpress-importer' ) . '</a>' . '</p>';
253
+ echo '<p>' . __( 'Remember to update the passwords and roles of imported users.', 'wordpress-importer' ) . '</p>';
254
+
255
+ do_action( 'import_end' );
256
+ }
257
+
258
+ /**
259
+ * Handles the WXR upload and initial parsing of the file to prepare for
260
+ * displaying author import options
261
+ *
262
+ * @return bool False if error uploading or invalid file, true otherwise
263
+ */
264
+ function handle_upload() {
265
+ $file = wp_import_handle_upload();
266
+
267
+ if ( isset( $file['error'] ) ) {
268
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
269
+ echo esc_html( $file['error'] ) . '</p>';
270
+ return false;
271
+ } else if ( ! file_exists( $file['file'] ) ) {
272
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
273
+ printf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'wordpress-importer' ), esc_html( $file['file'] ) );
274
+ echo '</p>';
275
+ return false;
276
+ }
277
+
278
+ $this->id = (int) $file['id'];
279
+ $import_data = $this->parse( $file['file'] );
280
+ if ( is_wp_error( $import_data ) ) {
281
+ echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
282
+ echo esc_html( $import_data->get_error_message() ) . '</p>';
283
+ return false;
284
+ }
285
+
286
+ $this->version = $import_data['version'];
287
+ if ( $this->version > $this->max_wxr_version ) {
288
+ echo '<div class="error"><p><strong>';
289
+ printf( __( 'This WXR file (version %s) may not be supported by this version of the importer. Please consider updating.', 'wordpress-importer' ), esc_html($import_data['version']) );
290
+ echo '</strong></p></div>';
291
+ }
292
+
293
+ $this->get_authors_from_import( $import_data );
294
+
295
+ return true;
296
+ }
297
+
298
+ /**
299
+ * Retrieve authors from parsed WXR data
300
+ *
301
+ * Uses the provided author information from WXR 1.1 files
302
+ * or extracts info from each post for WXR 1.0 files
303
+ *
304
+ * @param array $import_data Data returned by a WXR parser
305
+ */
306
+ function get_authors_from_import( $import_data ) {
307
+ if ( ! empty( $import_data['authors'] ) ) {
308
+ $this->authors = $import_data['authors'];
309
+ // no author information, grab it from the posts
310
+ } else {
311
+ foreach ( $import_data['posts'] as $post ) {
312
+ $login = sanitize_user( $post['post_author'], true );
313
+ if ( empty( $login ) ) {
314
+ printf( __( 'Failed to import author %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html( $post['post_author'] ) );
315
+ echo '<br />';
316
+ continue;
317
+ }
318
+
319
+ if ( ! isset($this->authors[$login]) )
320
+ $this->authors[$login] = array(
321
+ 'author_login' => $login,
322
+ 'author_display_name' => $post['post_author']
323
+ );
324
+ }
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Display pre-import options, author importing/mapping and option to
330
+ * fetch attachments
331
+ */
332
+ function import_options() {
333
+ $j = 0;
334
+ ?>
335
+ <form action="<?php echo admin_url( 'admin.php?import=wordpress&amp;step=2' ); ?>" method="post">
336
+ <?php wp_nonce_field( 'import-wordpress' ); ?>
337
+ <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
338
+
339
+ <?php if ( ! empty( $this->authors ) ) : ?>
340
+ <h3><?php _e( 'Assign Authors', 'wordpress-importer' ); ?></h3>
341
+ <p><?php _e( 'To make it simpler for you to edit and save the imported content, you may want to reassign the author of the imported item to an existing user of this site, such as your primary administrator account.', 'wordpress-importer' ); ?></p>
342
+ <?php if ( $this->allow_create_users() ) : ?>
343
+ <p><?php printf( __( 'If a new user is created by WordPress, a new password will be randomly generated and the new user&#8217;s role will be set as %s. Manually changing the new user&#8217;s details will be necessary.', 'wordpress-importer' ), esc_html( get_option('default_role') ) ); ?></p>
344
+ <?php endif; ?>
345
+ <ol id="authors">
346
+ <?php foreach ( $this->authors as $author ) : ?>
347
+ <li><?php $this->author_select( $j++, $author ); ?></li>
348
+ <?php endforeach; ?>
349
+ </ol>
350
+ <?php endif; ?>
351
+
352
+ <?php if ( $this->allow_fetch_attachments() ) : ?>
353
+ <h3><?php _e( 'Import Attachments', 'wordpress-importer' ); ?></h3>
354
+ <p>
355
+ <input type="checkbox" value="1" name="fetch_attachments" id="import-attachments" />
356
+ <label for="import-attachments"><?php _e( 'Download and import file attachments', 'wordpress-importer' ); ?></label>
357
+ </p>
358
+ <?php endif; ?>
359
+
360
+ <p class="submit"><input type="submit" class="button" value="<?php esc_attr_e( 'Submit', 'wordpress-importer' ); ?>" /></p>
361
+ </form>
362
+ <?php
363
+ }
364
+
365
+ /**
366
+ * Display import options for an individual author. That is, either create
367
+ * a new user based on import info or map to an existing user
368
+ *
369
+ * @param int $n Index for each author in the form
370
+ * @param array $author Author information, e.g. login, display name, email
371
+ */
372
+ function author_select( $n, $author ) {
373
+ _e( 'Import author:', 'wordpress-importer' );
374
+ echo ' <strong>' . esc_html( $author['author_display_name'] );
375
+ if ( $this->version != '1.0' ) echo ' (' . esc_html( $author['author_login'] ) . ')';
376
+ echo '</strong><br />';
377
+
378
+ if ( $this->version != '1.0' )
379
+ echo '<div style="margin-left:18px">';
380
+
381
+ $create_users = $this->allow_create_users();
382
+ if ( $create_users ) {
383
+ if ( $this->version != '1.0' ) {
384
+ _e( 'or create new user with login name:', 'wordpress-importer' );
385
+ $value = '';
386
+ } else {
387
+ _e( 'as a new user:', 'wordpress-importer' );
388
+ $value = esc_attr( sanitize_user( $author['author_login'], true ) );
389
+ }
390
+
391
+ echo ' <input type="text" name="user_new['.$n.']" value="'. $value .'" /><br />';
392
+ }
393
+
394
+ if ( ! $create_users && $this->version == '1.0' ) {
395
+ _e( 'assign posts to an existing user:', 'wordpress-importer' );
396
+ } else {
397
+ _e( 'or assign posts to an existing user:', 'wordpress-importer' );
398
+ }
399
+
400
+ wp_dropdown_users( array(
401
+ 'name' => "user_map[$n]",
402
+ 'multi' => true,
403
+ 'show_option_all' => __( '- Select -', 'wordpress-importer' ),
404
+ 'show' => 'display_name_with_login',
405
+ ) );
406
+
407
+ echo '<input type="hidden" name="imported_authors['.$n.']" value="' . esc_attr( $author['author_login'] ) . '" />';
408
+
409
+ if ( $this->version != '1.0' )
410
+ echo '</div>';
411
+ }
412
+
413
+ /**
414
+ * Map old author logins to local user IDs based on decisions made
415
+ * in import options form. Can map to an existing user, create a new user
416
+ * or falls back to the current user in case of error with either of the previous
417
+ */
418
+ function get_author_mapping() {
419
+ if ( ! isset( $_POST['imported_authors'] ) )
420
+ return;
421
+
422
+ $create_users = $this->allow_create_users();
423
+
424
+ foreach ( (array) $_POST['imported_authors'] as $i => $old_login ) {
425
+ // Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts.
426
+ $santized_old_login = sanitize_user( $old_login, true );
427
+ $old_id = isset( $this->authors[$old_login]['author_id'] ) ? intval($this->authors[$old_login]['author_id']) : false;
428
+
429
+ if ( ! empty( $_POST['user_map'][$i] ) ) {
430
+ $user = get_userdata( intval($_POST['user_map'][$i]) );
431
+ if ( isset( $user->ID ) ) {
432
+ if ( $old_id )
433
+ $this->processed_authors[$old_id] = $user->ID;
434
+ $this->author_mapping[$santized_old_login] = $user->ID;
435
+ }
436
+ } else if ( $create_users ) {
437
+ if ( ! empty($_POST['user_new'][$i]) ) {
438
+ $user_id = wp_create_user( $_POST['user_new'][$i], wp_generate_password() );
439
+ } else if ( $this->version != '1.0' ) {
440
+ $user_data = array(
441
+ 'user_login' => $old_login,
442
+ 'user_pass' => wp_generate_password(),
443
+ 'user_email' => isset( $this->authors[$old_login]['author_email'] ) ? $this->authors[$old_login]['author_email'] : '',
444
+ 'display_name' => $this->authors[$old_login]['author_display_name'],
445
+ 'first_name' => isset( $this->authors[$old_login]['author_first_name'] ) ? $this->authors[$old_login]['author_first_name'] : '',
446
+ 'last_name' => isset( $this->authors[$old_login]['author_last_name'] ) ? $this->authors[$old_login]['author_last_name'] : '',
447
+ );
448
+ $user_id = wp_insert_user( $user_data );
449
+ }
450
+
451
+ if ( ! is_wp_error( $user_id ) ) {
452
+ if ( $old_id )
453
+ $this->processed_authors[$old_id] = $user_id;
454
+ $this->author_mapping[$santized_old_login] = $user_id;
455
+ } else {
456
+ printf( __( 'Failed to create new user for %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html($this->authors[$old_login]['author_display_name']) );
457
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
458
+ echo ' ' . $user_id->get_error_message();
459
+ echo '<br />';
460
+ }
461
+ }
462
+
463
+ // failsafe: if the user_id was invalid, default to the current user
464
+ if ( ! isset( $this->author_mapping[$santized_old_login] ) ) {
465
+ if ( $old_id )
466
+ $this->processed_authors[$old_id] = (int) get_current_user_id();
467
+ $this->author_mapping[$santized_old_login] = (int) get_current_user_id();
468
+ }
469
+ }
470
+ }
471
+
472
+ /**
473
+ * Create new categories based on import information
474
+ *
475
+ * Doesn't create a new category if its slug already exists
476
+ */
477
+ function process_categories() {
478
+ $this->categories = apply_filters( 'wp_import_categories', $this->categories );
479
+
480
+ if ( empty( $this->categories ) )
481
+ return;
482
+
483
+ foreach ( $this->categories as $cat ) {
484
+ // if the category already exists leave it alone
485
+ $term_id = term_exists( $cat['category_nicename'], 'category' );
486
+ if ( $term_id ) {
487
+ if ( is_array($term_id) ) $term_id = $term_id['term_id'];
488
+ if ( isset($cat['term_id']) )
489
+ $this->processed_terms[intval($cat['term_id'])] = (int) $term_id;
490
+ continue;
491
+ }
492
+
493
+ $category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );
494
+ $category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';
495
+ $catarr = array(
496
+ 'category_nicename' => $cat['category_nicename'],
497
+ 'category_parent' => $category_parent,
498
+ 'cat_name' => $cat['cat_name'],
499
+ 'category_description' => $category_description
500
+ );
501
+ $catarr = wp_slash( $catarr );
502
+
503
+ $id = wp_insert_category( $catarr );
504
+ if ( ! is_wp_error( $id ) && $id > 0 ) {
505
+ if ( isset($cat['term_id']) )
506
+ $this->processed_terms[intval($cat['term_id'])] = $id;
507
+ } else {
508
+ printf( __( 'Failed to import category %s', 'wordpress-importer' ), esc_html($cat['category_nicename']) );
509
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
510
+ echo ': ' . $id->get_error_message();
511
+ echo '<br />';
512
+ continue;
513
+ }
514
+
515
+ $this->process_termmeta( $cat, $id );
516
+
517
+ // TODO: added action
518
+ do_action('blocksy_wp_import_insert_term', $cat['term_id']);
519
+ }
520
+
521
+ unset( $this->categories );
522
+ }
523
+
524
+ /**
525
+ * Create new post tags based on import information
526
+ *
527
+ * Doesn't create a tag if its slug already exists
528
+ */
529
+ function process_tags() {
530
+ $this->tags = apply_filters( 'wp_import_tags', $this->tags );
531
+
532
+ if ( empty( $this->tags ) )
533
+ return;
534
+
535
+ foreach ( $this->tags as $tag ) {
536
+ // if the tag already exists leave it alone
537
+ $term_id = term_exists( $tag['tag_slug'], 'post_tag' );
538
+ if ( $term_id ) {
539
+ if ( is_array($term_id) ) $term_id = $term_id['term_id'];
540
+ if ( isset($tag['term_id']) )
541
+ $this->processed_terms[intval($tag['term_id'])] = (int) $term_id;
542
+ continue;
543
+ }
544
+
545
+ $tag = wp_slash( $tag );
546
+ $tag_desc = isset( $tag['tag_description'] ) ? $tag['tag_description'] : '';
547
+ $tagarr = array( 'slug' => $tag['tag_slug'], 'description' => $tag_desc );
548
+
549
+ $id = wp_insert_term( $tag['tag_name'], 'post_tag', $tagarr );
550
+ if ( ! is_wp_error( $id ) ) {
551
+ if ( isset($tag['term_id']) )
552
+ $this->processed_terms[intval($tag['term_id'])] = $id['term_id'];
553
+ } else {
554
+ printf( __( 'Failed to import post tag %s', 'wordpress-importer' ), esc_html($tag['tag_name']) );
555
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
556
+ echo ': ' . $id->get_error_message();
557
+ echo '<br />';
558
+ continue;
559
+ }
560
+
561
+ $this->process_termmeta( $tag, $id['term_id'] );
562
+
563
+ // TODO: added action
564
+ do_action('blocksy_wp_import_insert_term', $id['term_id']);
565
+ }
566
+
567
+ unset( $this->tags );
568
+ }
569
+
570
+ /**
571
+ * Create new terms based on import information
572
+ *
573
+ * Doesn't create a term its slug already exists
574
+ */
575
+ function process_terms() {
576
+ $this->terms = apply_filters( 'wp_import_terms', $this->terms );
577
+
578
+ if ( empty( $this->terms ) )
579
+ return;
580
+
581
+ foreach ( $this->terms as $term ) {
582
+ // if the term already exists in the correct taxonomy leave it alone
583
+ $term_id = term_exists( $term['slug'], $term['term_taxonomy'] );
584
+
585
+ if ( $term_id ) {
586
+ if ( is_array($term_id) ) $term_id = $term_id['term_id'];
587
+ if ( isset($term['term_id']) )
588
+ $this->processed_terms[intval($term['term_id'])] = (int) $term_id;
589
+ continue;
590
+ }
591
+
592
+ if ( empty( $term['term_parent'] ) ) {
593
+ $parent = 0;
594
+ } else {
595
+ $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );
596
+ if ( is_array( $parent ) ) $parent = $parent['term_id'];
597
+ }
598
+ $term = wp_slash( $term );
599
+ $description = isset( $term['term_description'] ) ? $term['term_description'] : '';
600
+ $termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) );
601
+
602
+ $id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );
603
+ if ( ! is_wp_error( $id ) ) {
604
+ if ( isset($term['term_id']) )
605
+ $this->processed_terms[intval($term['term_id'])] = $id['term_id'];
606
+ } else {
607
+ printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($term['term_taxonomy']), esc_html($term['term_name']) );
608
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
609
+ echo ': ' . $id->get_error_message();
610
+ echo '<br />';
611
+ continue;
612
+ }
613
+
614
+ $this->process_termmeta( $term, $id['term_id'] );
615
+
616
+ // TODO: added action
617
+ do_action('blocksy_wp_import_insert_term', $id['term_id']);
618
+ }
619
+
620
+ unset( $this->terms );
621
+ }
622
+
623
+ /**
624
+ * Add metadata to imported term.
625
+ *
626
+ * @since 0.6.2
627
+ *
628
+ * @param array $term Term data from WXR import.
629
+ * @param int $term_id ID of the newly created term.
630
+ */
631
+ protected function process_termmeta( $term, $term_id ) {
632
+ if ( ! isset( $term['termmeta'] ) ) {
633
+ $term['termmeta'] = array();
634
+ }
635
+
636
+ /**
637
+ * Filters the metadata attached to an imported term.
638
+ *
639
+ * @since 0.6.2
640
+ *
641
+ * @param array $termmeta Array of term meta.
642
+ * @param int $term_id ID of the newly created term.
643
+ * @param array $term Term data from the WXR import.
644
+ */
645
+ $term['termmeta'] = apply_filters( 'wp_import_term_meta', $term['termmeta'], $term_id, $term );
646
+
647
+ if ( empty( $term['termmeta'] ) ) {
648
+ return;
649
+ }
650
+
651
+ foreach ( $term['termmeta'] as $meta ) {
652
+ /**
653
+ * Filters the meta key for an imported piece of term meta.
654
+ *
655
+ * @since 0.6.2
656
+ *
657
+ * @param string $meta_key Meta key.
658
+ * @param int $term_id ID of the newly created term.
659
+ * @param array $term Term data from the WXR import.
660
+ */
661
+ $key = apply_filters( 'import_term_meta_key', $meta['key'], $term_id, $term );
662
+ if ( ! $key ) {
663
+ continue;
664
+ }
665
+
666
+ // Export gets meta straight from the DB so could have a serialized string
667
+ $value = maybe_unserialize( $meta['value'] );
668
+
669
+ add_term_meta($term_id, wp_slash($key), $value);
670
+
671
+ /**
672
+ * Fires after term meta is imported.
673
+ *
674
+ * @since 0.6.2
675
+ *
676
+ * @param int $term_id ID of the newly created term.
677
+ * @param string $key Meta key.
678
+ * @param mixed $value Meta value.
679
+ */
680
+ do_action( 'import_term_meta', $term_id, $key, $value );
681
+ }
682
+ }
683
+
684
+ /**
685
+ * Create new posts based on import information
686
+ *
687
+ * Posts marked as having a parent which doesn't exist will become top level items.
688
+ * Doesn't create a new post if: the post type doesn't exist, the given post ID
689
+ * is already noted as imported or a post with the same title and date already exists.
690
+ * Note that new/updated terms, comments and meta are imported for the last of the above.
691
+ */
692
+ function process_posts() {
693
+ $this->posts = apply_filters( 'wp_import_posts', $this->posts );
694
+
695
+ foreach ( $this->posts as $post ) {
696
+ $post = apply_filters( 'wp_import_post_data_raw', $post );
697
+
698
+ if ( ! post_type_exists( $post['post_type'] ) ) {
699
+ printf( __( 'Failed to import &#8220;%s&#8221;: Invalid post type %s', 'wordpress-importer' ),
700
+ esc_html($post['post_title']), esc_html($post['post_type']) );
701
+ echo '<br />';
702
+ do_action( 'wp_import_post_exists', $post );
703
+ continue;
704
+ }
705
+
706
+ if ( isset( $this->processed_posts[$post['post_id']] ) && ! empty( $post['post_id'] ) )
707
+ continue;
708
+
709
+ if ( $post['status'] == 'auto-draft' )
710
+ continue;
711
+
712
+ if ( 'nav_menu_item' == $post['post_type'] ) {
713
+ $this->process_menu_item( $post );
714
+ continue;
715
+ }
716
+
717
+ $post_type_object = get_post_type_object( $post['post_type'] );
718
+
719
+ $post_exists = post_exists( $post['post_title'], '', $post['post_date'] );
720
+
721
+ /**
722
+ * Filter ID of the existing post corresponding to post currently importing.
723
+ *
724
+ * Return 0 to force the post to be imported. Filter the ID to be something else
725
+ * to override which existing post is mapped to the imported post.
726
+ *
727
+ * @see post_exists()
728
+ * @since 0.6.2
729
+ *
730
+ * @param int $post_exists Post ID, or 0 if post did not exist.
731
+ * @param array $post The post array to be inserted.
732
+ */
733
+ if ($post['post_type'] !== 'brizy-project') {
734
+ $post_exists = apply_filters( 'wp_import_existing_post', $post_exists, $post );
735
+ } else {
736
+ if (class_exists('Brizy_Editor_Project')) {
737
+ $currentProject = Brizy_Editor_Project::get();
738
+ $currentProjectGlobals = $currentProject->getDecodedData();
739
+ $currentProjectPostId = $currentProject->getWpPost()->ID;
740
+ $currentProjectStorage = Brizy_Editor_Storage_Project::instance( $currentProjectPostId );
741
+
742
+ $projectMeta = null;
743
+
744
+ foreach ( $post['postmeta'] as $meta ) {
745
+ if ( $meta['key'] == 'brizy-project' ) {
746
+ $projectMeta = maybe_unserialize( $meta['value'] );
747
+ break;
748
+ }
749
+ }
750
+
751
+ if ($projectMeta) {
752
+ $projectData = json_decode( base64_decode( $projectMeta['data'] ) );
753
+
754
+ // create project data backup
755
+ $data = $currentProjectStorage->get_storage();
756
+ update_post_meta( $currentProjectPostId, 'brizy-project-import-backup-' . md5( time() ), $data );
757
+ //---------------------------------------------------------
758
+
759
+ $currentProject->setDataAsJson( json_encode( $projectData ) );
760
+ $currentProject->saveStorage();
761
+
762
+ $post_exists = $currentProjectPostId;
763
+ }
764
+ }
765
+ }
766
+
767
+ if ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) {
768
+ printf( __('%s &#8220;%s&#8221; already exists.', 'wordpress-importer'), $post_type_object->labels->singular_name, esc_html($post['post_title']) );
769
+ echo '<br />';
770
+ $comment_post_ID = $post_id = $post_exists;
771
+ $this->processed_posts[ intval( $post['post_id'] ) ] = intval( $post_exists );
772
+ } else {
773
+ $post_parent = (int) $post['post_parent'];
774
+ if ( $post_parent ) {
775
+ // if we already know the parent, map it to the new local ID
776
+ if ( isset( $this->processed_posts[$post_parent] ) ) {
777
+ $post_parent = $this->processed_posts[$post_parent];
778
+ // otherwise record the parent for later
779
+ } else {
780
+ $this->post_orphans[intval($post['post_id'])] = $post_parent;
781
+ $post_parent = 0;
782
+ }
783
+ }
784
+
785
+ // map the post author
786
+ $author = sanitize_user( $post['post_author'], true );
787
+ if ( isset( $this->author_mapping[$author] ) )
788
+ $author = $this->author_mapping[$author];
789
+ else
790
+ $author = (int) get_current_user_id();
791
+
792
+ $postdata = array(
793
+ 'import_id' => $post['post_id'], 'post_author' => $author, 'post_date' => $post['post_date'],
794
+ 'post_date_gmt' => $post['post_date_gmt'], 'post_content' => $post['post_content'],
795
+ 'post_excerpt' => $post['post_excerpt'], 'post_title' => $post['post_title'],
796
+ 'post_status' => $post['status'], 'post_name' => $post['post_name'],
797
+ 'comment_status' => $post['comment_status'], 'ping_status' => $post['ping_status'],
798
+ 'guid' => $post['guid'], 'post_parent' => $post_parent, 'menu_order' => $post['menu_order'],
799
+ 'post_type' => $post['post_type'], 'post_password' => $post['post_password']
800
+ );
801
+
802
+ $original_post_ID = $post['post_id'];
803
+ $postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );
804
+
805
+ $postdata = wp_slash( $postdata );
806
+
807
+ if ( 'attachment' == $postdata['post_type'] ) {
808
+ $remote_url = ! empty($post['attachment_url']) ? $post['attachment_url'] : $post['guid'];
809
+
810
+ // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
811
+ // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
812
+ $postdata['upload_date'] = $post['post_date'];
813
+ if ( isset( $post['postmeta'] ) ) {
814
+ foreach( $post['postmeta'] as $meta ) {
815
+ if ( $meta['key'] == '_wp_attached_file' ) {
816
+ if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) )
817
+ $postdata['upload_date'] = $matches[0];
818
+ break;
819
+ }
820
+ }
821
+ }
822
+
823
+ $comment_post_ID = $post_id = $this->process_attachment( $postdata, $remote_url );
824
+ } else {
825
+ $comment_post_ID = $post_id = wp_insert_post( $postdata, true );
826
+ do_action( 'wp_import_insert_post', $post_id, $original_post_ID, $postdata, $post );
827
+ }
828
+
829
+ if ( is_wp_error( $post_id ) ) {
830
+ printf( __( 'Failed to import %s &#8220;%s&#8221;', 'wordpress-importer' ),
831
+ $post_type_object->labels->singular_name, esc_html($post['post_title']) );
832
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
833
+ echo ': ' . $post_id->get_error_message();
834
+ echo '<br />';
835
+ continue;
836
+ }
837
+
838
+ if ( $post['is_sticky'] == 1 )
839
+ stick_post( $post_id );
840
+ }
841
+
842
+ // map pre-import ID to local ID
843
+ $this->processed_posts[intval($post['post_id'])] = (int) $post_id;
844
+
845
+ if ( ! isset( $post['terms'] ) )
846
+ $post['terms'] = array();
847
+
848
+ $post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );
849
+
850
+ // add categories, tags and other terms
851
+ if ( ! empty( $post['terms'] ) ) {
852
+ $terms_to_set = array();
853
+ foreach ( $post['terms'] as $term ) {
854
+ // back compat with WXR 1.0 map 'tag' to 'post_tag'
855
+ $taxonomy = ( 'tag' == $term['domain'] ) ? 'post_tag' : $term['domain'];
856
+ $term_exists = term_exists( $term['slug'], $taxonomy );
857
+ $term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;
858
+ if ( ! $term_id ) {
859
+ $t = wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) );
860
+ if ( ! is_wp_error( $t ) ) {
861
+ $term_id = $t['term_id'];
862
+ do_action( 'wp_import_insert_term', $t, $term, $post_id, $post );
863
+ } else {
864
+ printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($taxonomy), esc_html($term['name']) );
865
+ if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
866
+ echo ': ' . $t->get_error_message();
867
+ echo '<br />';
868
+ do_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );
869
+ continue;
870
+ }
871
+ }
872
+ $terms_to_set[$taxonomy][] = intval( $term_id );
873
+ }
874
+
875
+ foreach ( $terms_to_set as $tax => $ids ) {
876
+ $tt_ids = wp_set_post_terms( $post_id, $ids, $tax );
877
+ do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );
878
+ }
879
+ unset( $post['terms'], $terms_to_set );
880
+ }
881
+
882
+ if ( ! isset( $post['comments'] ) )
883
+ $post['comments'] = array();
884
+
885
+ $post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );
886
+
887
+ // add/update comments
888
+ if ( ! empty( $post['comments'] ) ) {
889
+ $num_comments = 0;
890
+ $inserted_comments = array();
891
+ foreach ( $post['comments'] as $comment ) {
892
+ $comment_id = $comment['comment_id'];
893
+ $newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;
894
+ $newcomments[$comment_id]['comment_author'] = $comment['comment_author'];
895
+ $newcomments[$comment_id]['comment_author_email'] = $comment['comment_author_email'];
896
+ $newcomments[$comment_id]['comment_author_IP'] = $comment['comment_author_IP'];
897
+ $newcomments[$comment_id]['comment_author_url'] = $comment['comment_author_url'];
898
+ $newcomments[$comment_id]['comment_date'] = $comment['comment_date'];
899
+ $newcomments[$comment_id]['comment_date_gmt'] = $comment['comment_date_gmt'];
900
+ $newcomments[$comment_id]['comment_content'] = $comment['comment_content'];
901
+ $newcomments[$comment_id]['comment_approved'] = $comment['comment_approved'];
902
+ $newcomments[$comment_id]['comment_type'] = $comment['comment_type'];
903
+ $newcomments[$comment_id]['comment_parent'] = $comment['comment_parent'];
904
+ $newcomments[$comment_id]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array();
905
+ if ( isset( $this->processed_authors[$comment['comment_user_id']] ) )
906
+ $newcomments[$comment_id]['user_id'] = $this->processed_authors[$comment['comment_user_id']];
907
+ }
908
+ ksort( $newcomments );
909
+
910
+ foreach ( $newcomments as $key => $comment ) {
911
+ // if this is a new post we can skip the comment_exists() check
912
+ if ( ! $post_exists || ! comment_exists( $comment['comment_author'], $comment['comment_date'] ) ) {
913
+ if ( isset( $inserted_comments[$comment['comment_parent']] ) )
914
+ $comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];
915
+ $comment = wp_slash( $comment );
916
+ $comment = wp_filter_comment( $comment );
917
+ $inserted_comments[$key] = wp_insert_comment( $comment );
918
+ do_action( 'wp_import_insert_comment', $inserted_comments[$key], $comment, $comment_post_ID, $post );
919
+
920
+ foreach( $comment['commentmeta'] as $meta ) {
921
+ $value = maybe_unserialize( $meta['value'] );
922
+ add_comment_meta( $inserted_comments[$key], $meta['key'], $value );
923
+ }
924
+
925
+ $num_comments++;
926
+ }
927
+ }
928
+ unset( $newcomments, $inserted_comments, $post['comments'] );
929
+ }
930
+
931
+ if ( ! isset( $post['postmeta'] ) )
932
+ $post['postmeta'] = array();
933
+
934
+ $post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );
935
+
936
+ // add/update post meta
937
+ if ( ! empty( $post['postmeta'] ) ) {
938
+ foreach ( $post['postmeta'] as $meta ) {
939
+ $key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );
940
+ $value = false;
941
+
942
+ if ( '_edit_last' == $key ) {
943
+ if ( isset( $this->processed_authors[intval($meta['value'])] ) )
944
+ $value = $this->processed_authors[intval($meta['value'])];
945
+ else
946
+ $key = false;
947
+ }
948
+
949
+ if ( $key ) {
950
+ // export gets meta straight from the DB so could have a serialized string
951
+ if (! $value) {
952
+ $value = maybe_unserialize( $meta['value'] );
953
+ }
954
+
955
+ // add_post_meta($post_id, wp_slash($key), wp_slash_strings_only($value));
956
+ add_post_meta($post_id, wp_slash($key), $value);
957
+
958
+ do_action('import_post_meta', $post_id, $key, $value);
959
+
960
+ // if the post has a featured image, take note of this in case of remap
961
+ if ( '_thumbnail_id' == $key )
962
+ $this->featured_images[$post_id] = (int) $value;
963
+ }
964
+ }
965
+ }
966
+ }
967
+
968
+ unset( $this->posts );
969
+ }
970
+
971
+ /**
972
+ * Attempt to create a new menu item from import data
973
+ *
974
+ * Fails for draft, orphaned menu items and those without an associated nav_menu
975
+ * or an invalid nav_menu term. If the post type or term object which the menu item
976
+ * represents doesn't exist then the menu item will not be imported (waits until the
977
+ * end of the import to retry again before discarding).
978
+ *
979
+ * @param array $item Menu item details from WXR file
980
+ */
981
+ function process_menu_item( $item ) {
982
+ // skip draft, orphaned menu items
983
+ if ( 'draft' == $item['status'] )
984
+ return;
985
+
986
+
987
+ $menu_slug = false;
988
+ if ( isset($item['terms']) ) {
989
+ // loop through terms, assume first nav_menu term is correct menu
990
+ foreach ( $item['terms'] as $term ) {
991
+ if ( 'nav_menu' == $term['domain'] ) {
992
+ $menu_slug = $term['slug'];
993
+ break;
994
+ }
995
+ }
996
+ }
997
+
998
+ // no nav_menu term associated with this menu item
999
+ if ( ! $menu_slug ) {
1000
+ _e( 'Menu item skipped due to missing menu slug', 'wordpress-importer' );
1001
+ echo '<br />';
1002
+ return;
1003
+ }
1004
+
1005
+ $menu_id = term_exists( $menu_slug, 'nav_menu' );
1006
+ if ( ! $menu_id ) {
1007
+ printf( __( 'Menu item skipped due to invalid menu slug: %s', 'wordpress-importer' ), esc_html( $menu_slug ) );
1008
+ echo '<br />';
1009
+ return;
1010
+ } else {
1011
+ $menu_id = is_array( $menu_id ) ? $menu_id['term_id'] : $menu_id;
1012
+ }
1013
+
1014
+ foreach ( $item['postmeta'] as $meta )
1015
+ ${$meta['key']} = $meta['value'];
1016
+
1017
+ if ( 'taxonomy' == $_menu_item_type && isset( $this->processed_terms[intval($_menu_item_object_id)] ) ) {
1018
+ $_menu_item_object_id = $this->processed_terms[intval($_menu_item_object_id)];
1019
+ } else if ( 'post_type' == $_menu_item_type && isset( $this->processed_posts[intval($_menu_item_object_id)] ) ) {
1020
+ $_menu_item_object_id = $this->processed_posts[intval($_menu_item_object_id)];
1021
+ } else if ( 'custom' != $_menu_item_type && 'post_type_archive' !== $_menu_item_type) {
1022
+ // associated object is missing or not imported yet, we'll retry later
1023
+ $this->missing_menu_items[] = $item;
1024
+ return;
1025
+ }
1026
+
1027
+ if ( isset( $this->processed_menu_items[intval($_menu_item_menu_item_parent)] ) ) {
1028
+ $_menu_item_menu_item_parent = $this->processed_menu_items[intval($_menu_item_menu_item_parent)];
1029
+ } else if ( $_menu_item_menu_item_parent ) {
1030
+ $this->menu_item_orphans[intval($item['post_id'])] = (int) $_menu_item_menu_item_parent;
1031
+ $_menu_item_menu_item_parent = 0;
1032
+ }
1033
+
1034
+ // wp_update_nav_menu_item expects CSS classes as a space separated string
1035
+ $_menu_item_classes = maybe_unserialize( $_menu_item_classes );
1036
+ if ( is_array( $_menu_item_classes ) )
1037
+ $_menu_item_classes = implode( ' ', $_menu_item_classes );
1038
+
1039
+ $args = array(
1040
+ 'menu-item-object-id' => $_menu_item_object_id,
1041
+ 'menu-item-object' => $_menu_item_object,
1042
+ 'menu-item-parent-id' => $_menu_item_menu_item_parent,
1043
+ 'menu-item-position' => intval( $item['menu_order'] ),
1044
+ 'menu-item-type' => $_menu_item_type,
1045
+ 'menu-item-title' => $item['post_title'],
1046
+ 'menu-item-url' => $_menu_item_url,
1047
+ 'menu-item-description' => $item['post_content'],
1048
+ 'menu-item-attr-title' => $item['post_excerpt'],
1049
+ 'menu-item-target' => $_menu_item_target,
1050
+ 'menu-item-classes' => $_menu_item_classes,
1051
+ 'menu-item-xfn' => $_menu_item_xfn,
1052
+ 'menu-item-status' => $item['status']
1053
+ );
1054
+
1055
+
1056
+ $id = wp_update_nav_menu_item( $menu_id, 0, $args );
1057
+ if ( $id && ! is_wp_error( $id ) )
1058
+ $this->processed_menu_items[intval($item['post_id'])] = (int) $id;
1059
+ }
1060
+
1061
+ /**
1062
+ * If fetching attachments is enabled then attempt to create a new attachment
1063
+ *
1064
+ * @param array $post Attachment post details from WXR
1065
+ * @param string $url URL to fetch attachment from
1066
+ * @return int|WP_Error Post ID on success, WP_Error otherwise
1067
+ */
1068
+ function process_attachment( $post, $url ) {
1069
+ if ( ! $this->fetch_attachments )
1070
+ return new WP_Error( 'attachment_processing_error',
1071
+ __( 'Fetching attachments is not enabled', 'wordpress-importer' ) );
1072
+
1073
+ // if the URL is absolute, but does not contain address, then upload it assuming base_site_url
1074
+ if ( preg_match( '|^/[\w\W]+$|', $url ) )
1075
+ $url = rtrim( $this->base_url, '/' ) . $url;
1076
+
1077
+ $upload = $this->fetch_remote_file( $url, $post );
1078
+ if ( is_wp_error( $upload ) )
1079
+ return $upload;
1080
+
1081
+ if ( $info = wp_check_filetype( $upload['file'] ) )
1082
+ $post['post_mime_type'] = $info['type'];
1083
+ else
1084
+ return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') );
1085
+
1086
+ $post['guid'] = $upload['url'];
1087
+
1088
+ // as per wp-admin/includes/upload.php
1089
+ $post_id = wp_insert_attachment( $post, $upload['file'] );
1090
+ wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
1091
+
1092
+ // remap resized image URLs, works by stripping the extension and remapping the URL stub.
1093
+ if ( preg_match( '!^image/!', $info['type'] ) ) {
1094
+ $parts = pathinfo( $url );
1095
+ $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
1096
+
1097
+ $parts_new = pathinfo( $upload['url'] );
1098
+ $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
1099
+
1100
+ $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new;
1101
+ }
1102
+
1103
+ return $post_id;
1104
+ }
1105
+
1106
+ /**
1107
+ * Attempt to download a remote file attachment
1108
+ *
1109
+ * @param string $url URL of item to fetch
1110
+ * @param array $post Attachment details
1111
+ * @return array|WP_Error Local file location details on success, WP_Error otherwise
1112
+ */
1113
+ function fetch_remote_file( $url, $post ) {
1114
+ // extract the file name and extension from the url
1115
+ $file_name = basename( $url );
1116
+
1117
+ // get placeholder file in the upload dir with a unique, sanitized filename
1118
+ $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );
1119
+ if ( $upload['error'] )
1120
+ return new WP_Error( 'upload_dir_error', $upload['error'] );
1121
+
1122
+ // fetch the remote url and write it to the placeholder file
1123
+ $remote_response = wp_safe_remote_get( $url, array(
1124
+ 'timeout' => 300,
1125
+ 'stream' => true,
1126
+ 'filename' => $upload['file'],
1127
+ ) );
1128
+
1129
+ $headers = wp_remote_retrieve_headers( $remote_response );
1130
+
1131
+ // request failed
1132
+ if ( ! $headers ) {
1133
+ @unlink( $upload['file'] );
1134
+ return new WP_Error( 'import_file_error', __('Remote server did not respond', 'wordpress-importer') );
1135
+ }
1136
+
1137
+ $remote_response_code = wp_remote_retrieve_response_code( $remote_response );
1138
+
1139
+ // make sure the fetch was successful
1140
+ if ( $remote_response_code != '200' ) {
1141
+ @unlink( $upload['file'] );
1142
+ return new WP_Error( 'import_file_error', sprintf( __('Remote server returned error response %1$d %2$s', 'wordpress-importer'), esc_html($remote_response_code), get_status_header_desc($remote_response_code) ) );
1143
+ }
1144
+
1145
+ $filesize = filesize( $upload['file'] );
1146
+
1147
+ if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) {
1148
+ @unlink( $upload['file'] );
1149
+ return new WP_Error( 'import_file_error', __('Remote file is incorrect size', 'wordpress-importer') );
1150
+ }
1151
+
1152
+ if ( 0 == $filesize ) {
1153
+ @unlink( $upload['file'] );
1154
+ return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'wordpress-importer') );
1155
+ }
1156
+
1157
+ $max_size = (int) $this->max_attachment_size();
1158
+ if ( ! empty( $max_size ) && $filesize > $max_size ) {
1159
+ @unlink( $upload['file'] );
1160
+ return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', 'wordpress-importer'), size_format($max_size) ) );
1161
+ }
1162
+
1163
+ // keep track of the old and new urls so we can substitute them later
1164
+ $this->url_remap[$url] = $upload['url'];
1165
+ $this->url_remap[$post['guid']] = $upload['url']; // r13735, really needed?
1166
+ // keep track of the destination if the remote url is redirected somewhere else
1167
+ if ( isset($headers['x-final-location']) && $headers['x-final-location'] != $url )
1168
+ $this->url_remap[$headers['x-final-location']] = $upload['url'];
1169
+
1170
+ return $upload;
1171
+ }
1172
+
1173
+ /**
1174
+ * Attempt to associate posts and menu items with previously missing parents
1175
+ *
1176
+ * An imported post's parent may not have been imported when it was first created
1177
+ * so try again. Similarly for child menu items and menu items which were missing
1178
+ * the object (e.g. post) they represent in the menu
1179
+ */
1180
+ function backfill_parents() {
1181
+ global $wpdb;
1182
+
1183
+ // find parents for post orphans
1184
+ foreach ( $this->post_orphans as $child_id => $parent_id ) {
1185
+ $local_child_id = $local_parent_id = false;
1186
+ if ( isset( $this->processed_posts[$child_id] ) )
1187
+ $local_child_id = $this->processed_posts[$child_id];
1188
+ if ( isset( $this->processed_posts[$parent_id] ) )
1189
+ $local_parent_id = $this->processed_posts[$parent_id];
1190
+
1191
+ if ( $local_child_id && $local_parent_id ) {
1192
+ $wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );
1193
+ clean_post_cache( $local_child_id );
1194
+ }
1195
+ }
1196
+
1197
+ // all other posts/terms are imported, retry menu items with missing associated object
1198
+ $missing_menu_items = $this->missing_menu_items;
1199
+ foreach ( $missing_menu_items as $item )
1200
+ $this->process_menu_item( $item );
1201
+
1202
+ // find parents for menu item orphans
1203
+ foreach ( $this->menu_item_orphans as $child_id => $parent_id ) {
1204
+ $local_child_id = $local_parent_id = 0;
1205
+ if ( isset( $this->processed_menu_items[$child_id] ) )
1206
+ $local_child_id = $this->processed_menu_items[$child_id];
1207
+ if ( isset( $this->processed_menu_items[$parent_id] ) )
1208
+ $local_parent_id = $this->processed_menu_items[$parent_id];
1209
+
1210
+ if ( $local_child_id && $local_parent_id )
1211
+ update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );
1212
+ }
1213
+ }
1214
+
1215
+ /**
1216
+ * Use stored mapping information to update old attachment URLs
1217
+ */
1218
+ function backfill_attachment_urls() {
1219
+ global $wpdb;
1220
+ // make sure we do the longest urls first, in case one is a substring of another
1221
+ uksort( $this->url_remap, array(&$this, 'cmpr_strlen') );
1222
+
1223
+ foreach ( $this->url_remap as $from_url => $to_url ) {
1224
+ // remap urls in post_content
1225
+ $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url) );
1226
+ // remap enclosure urls
1227
+ $result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url) );
1228
+ }
1229
+ }
1230
+
1231
+ /**
1232
+ * Update _thumbnail_id meta to new, imported attachment IDs
1233
+ */
1234
+ function remap_featured_images() {
1235
+ // cycle through posts that have a featured image
1236
+ foreach ( $this->featured_images as $post_id => $value ) {
1237
+ if ( isset( $this->processed_posts[$value] ) ) {
1238
+ $new_id = $this->processed_posts[$value];
1239
+ // only update if there's a difference
1240
+ if ( $new_id != $value )
1241
+ update_post_meta( $post_id, '_thumbnail_id', $new_id );
1242
+ }
1243
+ }
1244
+ }
1245
+
1246
+ /**
1247
+ * Parse a WXR file
1248
+ *
1249
+ * @param string $file Path to WXR file for parsing
1250
+ * @return array Information gathered from the WXR file
1251
+ */
1252
+ function parse( $file ) {
1253
+ $parser = new WXR_Parser();
1254
+ return $parser->parse( $file );
1255
+ }
1256
+
1257
+ // Display import page title
1258
+ function header() {
1259
+ echo '<div class="wrap">';
1260
+ echo '<h2>' . __( 'Import WordPress', 'wordpress-importer' ) . '</h2>';
1261
+
1262
+ $updates = get_plugin_updates();
1263
+ $basename = plugin_basename(__FILE__);
1264
+ if ( isset( $updates[$basename] ) ) {
1265
+ $update = $updates[$basename];
1266
+ echo '<div class="error"><p><strong>';
1267
+ printf( __( 'A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer' ), $update->update->new_version );
1268
+ echo '</strong></p></div>';
1269
+ }
1270
+ }
1271
+
1272
+ // Close div.wrap
1273
+ function footer() {
1274
+ echo '</div>';
1275
+ }
1276
+
1277
+ /**
1278
+ * Display introductory text and file upload form
1279
+ */
1280
+ function greet() {
1281
+ echo '<div class="narrow">';
1282
+ echo '<p>'.__( 'Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts, pages, comments, custom fields, categories, and tags into this site.', 'wordpress-importer' ).'</p>';
1283
+ echo '<p>'.__( 'Choose a WXR (.xml) file to upload, then click Upload file and import.', 'wordpress-importer' ).'</p>';
1284
+ wp_import_upload_form( 'admin.php?import=wordpress&amp;step=1' );
1285
+ echo '</div>';
1286
+ }
1287
+
1288
+ /**
1289
+ * Decide if the given meta key maps to information we will want to import
1290
+ *
1291
+ * @param string $key The meta key to check
1292
+ * @return string|bool The key if we do want to import, false if not
1293
+ */
1294
+ function is_valid_meta_key( $key ) {
1295
+ // skip attachment metadata since we'll regenerate it from scratch
1296
+ // skip _edit_lock as not relevant for import
1297
+ if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) )
1298
+ return false;
1299
+ return $key;
1300
+ }
1301
+
1302
+ /**
1303
+ * Decide whether or not the importer is allowed to create users.
1304
+ * Default is true, can be filtered via import_allow_create_users
1305
+ *
1306
+ * @return bool True if creating users is allowed
1307
+ */
1308
+ function allow_create_users() {
1309
+ return apply_filters( 'import_allow_create_users', true );
1310
+ }
1311
+
1312
+ /**
1313
+ * Decide whether or not the importer should attempt to download attachment files.
1314
+ * Default is true, can be filtered via import_allow_fetch_attachments. The choice
1315
+ * made at the import options screen must also be true, false here hides that checkbox.
1316
+ *
1317
+ * @return bool True if downloading attachments is allowed
1318
+ */
1319
+ function allow_fetch_attachments() {
1320
+ return apply_filters( 'import_allow_fetch_attachments', true );
1321
+ }
1322
+
1323
+ /**
1324
+ * Decide what the maximum file size for downloaded attachments is.
1325
+ * Default is 0 (unlimited), can be filtered via import_attachment_size_limit
1326
+ *
1327
+ * @return int Maximum attachment file size to import
1328
+ */
1329
+ function max_attachment_size() {
1330
+ return apply_filters( 'import_attachment_size_limit', 0 );
1331
+ }
1332
+
1333
+ /**
1334
+ * Added to http_request_timeout filter to force timeout at 60 seconds during import
1335
+ * @return int 60
1336
+ */
1337
+ function bump_request_timeout( $val ) {
1338
+ return 60;
1339
+ }
1340
+
1341
+ // return the difference in length between two strings
1342
+ function cmpr_strlen( $a, $b ) {
1343
+ return strlen($b) - strlen($a);
1344
+ }
1345
+ }
1346
+
1347
+ } // class_exists( 'WP_Importer' )
1348
+
trunk/framework/features/dynamic-css.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class DynamicCss {
6
+ public function __construct() {
7
+ add_filter(
8
+ 'blocksy:dynamic-css:has_files_cache',
9
+ function ($r) {
10
+ if (is_customize_preview()) {
11
+ if (! wp_doing_ajax()) {
12
+ return false;
13
+ }
14
+ }
15
+
16
+ if (! $this->should_use_files()) {
17
+ return false;
18
+ }
19
+
20
+ $theme_paths = $this->maybe_prepare_theme_uploads_path();
21
+
22
+ if (! $theme_paths) {
23
+ return false;
24
+ }
25
+
26
+ foreach ($this->get_chunks() as $chunk) {
27
+ if (! $chunk['enabled']) {
28
+ continue;
29
+ }
30
+
31
+ $file = $theme_paths['css_path'] . '/' . $chunk['filename'];
32
+
33
+ if (! file_exists($file)) {
34
+ return false;
35
+ }
36
+ }
37
+
38
+ return true;
39
+ }
40
+ );
41
+
42
+ add_filter(
43
+ 'blocksy_performance_end_customizer_options',
44
+ function ($opts) {
45
+ $opts['dynamic_css_file'] = [
46
+ 'label' => __( 'Dynamic CSS Output', 'blc' ),
47
+ 'type' => 'ct-radio',
48
+ 'value' => 'file',
49
+ 'view' => 'text',
50
+ 'desc' => __( 'The strategy of outputing the dynamic CSS. File - all the CSS code will be placed in a static file, otherwise it will be placed inline in head.', 'blc' ),
51
+ 'choices' => [
52
+ 'file' => __( 'File', 'blc' ),
53
+ 'inline' => __( 'Inline', 'blc' ),
54
+ ],
55
+ ];
56
+
57
+
58
+ $opts[blocksy_rand_md5()] = [
59
+ 'type' => 'ct-divider',
60
+ ];
61
+
62
+ $opts['emoji_scripts'] = [
63
+ 'label' => __( 'Emojis Script', 'blc' ),
64
+ 'type' => 'ct-switch',
65
+ 'value' => 'no',
66
+ 'setting' => [ 'transport' => 'postMessage' ],
67
+ 'desc' => __( 'Disable WordPress emojis script if you don\'t use them in order to improve the performance. ', 'blc' )
68
+ ];
69
+
70
+ $opts[blocksy_rand_md5()] = [
71
+ 'type' => 'ct-divider',
72
+ ];
73
+
74
+ return $opts;
75
+ }
76
+ );
77
+
78
+ add_action('updated_option', function($option_name, $old_value, $value) {
79
+ if ('active_plugins' === $option_name) {
80
+ $this->generate_css_files();
81
+ }
82
+ }, 10, 3);
83
+
84
+ add_action('customize_save_after', function () {
85
+ $this->generate_css_files();
86
+ });
87
+
88
+ add_action('blocksy:dynamic-css:regenere_css_files', function () {
89
+ $this->generate_css_files();
90
+ });
91
+
92
+ $this->enqueue_dynamic_css();
93
+ }
94
+
95
+ public function should_use_files() {
96
+ return get_theme_mod('dynamic_css_file', 'file') === 'file';
97
+ }
98
+
99
+ public function get_chunks() {
100
+ return [
101
+ [
102
+ 'filename' => 'global.css',
103
+ 'context' => 'files:global',
104
+ 'enabled' => true
105
+ ],
106
+ ];
107
+ }
108
+
109
+ public function enqueue_dynamic_css() {
110
+ if (is_admin()) {
111
+ return;
112
+ }
113
+
114
+ if (
115
+ ! function_exists('blocksy_has_css_in_files')
116
+ ||
117
+ ! blocksy_has_css_in_files()
118
+ ) {
119
+ return;
120
+ }
121
+
122
+ $theme_paths = $this->maybe_prepare_theme_uploads_path();
123
+
124
+ if (! $theme_paths) {
125
+ return;
126
+ }
127
+
128
+ foreach ($this->get_chunks() as $chunk) {
129
+ if (! $chunk['enabled']) {
130
+ continue;
131
+ }
132
+
133
+ $file = $theme_paths['css_path'] . '/' . $chunk['filename'];
134
+ $url = $theme_paths['css_url'] . '/' . $chunk['filename'];
135
+
136
+ wp_enqueue_style(
137
+ 'blocksy-dynamic-' . pathinfo($chunk['filename'], PATHINFO_FILENAME),
138
+ set_url_scheme($url),
139
+ [],
140
+ substr((string) filemtime($file), -5, 5)
141
+ );
142
+ }
143
+ }
144
+
145
+ public function generate_css_files() {
146
+ if (! $this->should_use_files()) {
147
+ return false;
148
+ }
149
+
150
+ $theme_paths = $this->maybe_prepare_theme_uploads_path([
151
+ 'should_generate' => true
152
+ ]);
153
+
154
+ if (! $theme_paths) {
155
+ return false;
156
+ }
157
+
158
+ $chunks = $this->get_chunks();
159
+
160
+ foreach ($chunks as $chunk) {
161
+ if (! $chunk['enabled']) {
162
+ continue;
163
+ }
164
+
165
+ $file = $theme_paths['css_path'] . '/' . $chunk['filename'];
166
+ $url = $theme_paths['css_url'] . '/' . $chunk['filename'];
167
+
168
+ if (function_exists('blocksy_get_dynamic_css_file_content')) {
169
+ $this->wp_filesystem->put_contents(
170
+ $file,
171
+ blocksy_get_dynamic_css_file_content(['context' => $chunk['context']])
172
+ );
173
+ }
174
+ }
175
+ }
176
+
177
+ private function maybe_prepare_theme_uploads_path($args = []) {
178
+ $args = wp_parse_args($args, [
179
+ 'should_generate' => false,
180
+ ]);
181
+
182
+ require_once (ABSPATH . '/wp-admin/includes/file.php');
183
+ WP_Filesystem();
184
+
185
+ global $wp_filesystem;
186
+
187
+ $this->wp_filesystem = $wp_filesystem;
188
+ $uploads = wp_upload_dir();
189
+
190
+ // Theme folders in `uploads` directory.
191
+ $folders_in_uploads = array(
192
+ 'base' => 'blocksy',
193
+ 'css' => 'blocksy/css'
194
+ );
195
+
196
+ foreach($folders_in_uploads as $folder => $path) {
197
+ // Server path.
198
+ $theme_paths[
199
+ $folder . '_path'
200
+ ] = $uploads['basedir'] . '/' . $path;
201
+
202
+ // URL.
203
+ $theme_paths[
204
+ $folder . '_url'
205
+ ] = $uploads['baseurl'] . '/' . $path;
206
+ }
207
+
208
+ // Custom css file.
209
+
210
+ if (! $this->has_direct_access()) {
211
+ return false;
212
+ }
213
+
214
+ if (null === $this->wp_filesystem) {
215
+ return false;
216
+ }
217
+
218
+ if ($args['should_generate']) {
219
+ foreach(array_keys($folders_in_uploads) as $folder) {
220
+ $path = $theme_paths[$folder . '_path'];
221
+ $parent = dirname($path);
222
+
223
+ if ($this->wp_filesystem->is_writable($parent)) {
224
+ if (! $this->wp_filesystem->is_dir($path)) {
225
+ $this->wp_filesystem->mkdir($path);
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ return $theme_paths;
232
+ }
233
+
234
+ public function has_direct_access( $context = null ) {
235
+ require_once ABSPATH . 'wp-admin/includes/file.php';
236
+ WP_Filesystem();
237
+
238
+ /** @var WP_Filesystem_Base $wp_filesystem */
239
+ global $wp_filesystem;
240
+
241
+ if ($wp_filesystem) {
242
+ if ($wp_filesystem->method !== 'direct') {
243
+ if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
244
+ return true;
245
+ } else {
246
+ return $wp_filesystem->method === 'direct';
247
+ }
248
+ } else {
249
+ return true;
250
+ }
251
+ }
252
+
253
+ if ( get_filesystem_method( [], $context ) === 'direct' ) {
254
+ ob_start();
255
+
256
+ {
257
+ $creds = request_filesystem_credentials( admin_url(), '', false, $context, null );
258
+ }
259
+
260
+ ob_end_clean();
261
+
262
+ if ( WP_Filesystem( $creds ) ) {
263
+ return true;
264
+ }
265
+ }
266
+
267
+ return false;
268
+ }
269
+ }
270
+
trunk/framework/features/google-analytics.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class GoogleAnalytics {
6
+ public function __construct() {
7
+ add_filter(
8
+ 'blocksy_engagement_general_start_customizer_options',
9
+ [$this, 'generate_google_analytics_opts']
10
+ );
11
+
12
+ if (is_admin()) return;
13
+
14
+ add_action('print_footer_scripts', function () {
15
+ if (is_admin()) return;
16
+
17
+ if (class_exists('BlocksyExtensionCookiesConsent')) {
18
+ if (\BlocksyExtensionCookiesConsent::should_display_notification()) {
19
+ return;
20
+ }
21
+ }
22
+
23
+ $analytics_id = get_theme_mod('analytics_id', '');
24
+
25
+ if (! empty($analytics_id)) {
26
+ ?>
27
+
28
+ <!-- Google Analytics -->
29
+ <script>
30
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
31
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
32
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
33
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
34
+ ga('create', '<?php echo $analytics_id ?>', 'auto');
35
+ ga('send', 'pageview');
36
+ <?php if (get_theme_mod('ip_anonymization', 'no') === 'yes') { ?>
37
+ ga('set', 'anonymizeIp', true);
38
+ <?php } ?>
39
+ </script>
40
+ <!-- End Google Analytics -->
41
+
42
+ <?php
43
+ };
44
+
45
+ $analytics_v4_id = get_theme_mod('analytics_v4_id', '');
46
+
47
+ if (! empty($analytics_v4_id)) {
48
+ ?>
49
+
50
+ <!-- Global site tag (gtag.js) - Google Analytics v4 -->
51
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $analytics_v4_id ?>"></script>
52
+ <script>
53
+ window.dataLayer = window.dataLayer || [];
54
+ function gtag(){dataLayer.push(arguments);}
55
+ gtag('js', new Date());
56
+
57
+ gtag('config', '<?php echo $analytics_v4_id?>');
58
+ </script>
59
+ <!-- End Google Analytics v4 -->
60
+
61
+ <?php
62
+ };
63
+
64
+
65
+ });
66
+ }
67
+
68
+ public function generate_google_analytics_opts($options) {
69
+ $options[] = [
70
+ 'analytics_id' => [
71
+ 'label' => __( 'Google Analytics', 'blc' ),
72
+ 'type' => 'text',
73
+ 'design' => 'block',
74
+ 'divider' => 'bottom',
75
+ 'value' => '',
76
+ 'desc' => __( 'Insert your Google Analytics tracking ID.', 'blc' ),
77
+ 'disableRevertButton' => true,
78
+ 'setting' => [ 'transport' => 'postMessage' ],
79
+ ],
80
+
81
+ 'analytics_v4_id' => [
82
+ 'label' => __( 'Google Analytics v4', 'blc' ),
83
+ 'type' => 'text',
84
+ 'design' => 'block',
85
+ 'divider' => 'bottom',
86
+ 'value' => '',
87
+ 'desc' => sprintf(
88
+ __(
89
+ 'Insert your Google Analytics v4 tracking ID. Instructions on how to activate this for your site can be found %shere%s.',
90
+ 'blc'
91
+ ),
92
+ '<a href="https://support.google.com/analytics/answer/9744165?hl=en">',
93
+ '</a>'
94
+ ),
95
+ 'disableRevertButton' => true,
96
+ 'setting' => [ 'transport' => 'postMessage' ],
97
+ ],
98
+
99
+ 'ip_anonymization' => [
100
+ 'label' => __( 'IP Anonymization', 'blc' ),
101
+ 'type' => 'ct-switch',
102
+ 'value' => 'no',
103
+ 'desc' => __( 'Enable Google Analytics IP anonymization feature <a href="https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization">(more info)</a>.', 'blc' ),
104
+ 'setting' => [ 'transport' => 'postMessage' ],
105
+ ],
106
+ ];
107
+
108
+ return $options;
109
+ }
110
+ }
trunk/framework/features/header.php ADDED
@@ -0,0 +1,542 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class HeaderAdditions {
6
+ private $has_transparent_header = '__DEFAULT__';
7
+ private $has_sticky_header = '__DEFAULT__';
8
+
9
+ public function __construct() {
10
+ add_action(
11
+ 'customize_controls_enqueue_scripts',
12
+ function () {
13
+ $this->enqueue_static();
14
+ }
15
+ );
16
+
17
+ add_action(
18
+ 'admin_enqueue_scripts',
19
+ function () {
20
+ $this->enqueue_static();
21
+ },
22
+ 50
23
+ );
24
+
25
+ add_filter('blocksy:header:selective_refresh', function ($selective_refresh) {
26
+ $selective_refresh[] = [
27
+ 'id' => 'header_placements_item:account',
28
+ 'fallback_refresh' => false,
29
+ 'container_inclusive' => true,
30
+ 'selector' => 'header [data-id="account"]',
31
+ 'settings' => ['header_placements'],
32
+ 'render_callback' => function () {
33
+ $header = new \Blocksy_Header_Builder_Render();
34
+ echo $header->render_single_item('account');
35
+ }
36
+ ];
37
+
38
+ return $selective_refresh;
39
+ });
40
+
41
+ add_filter('blocksy:header:device-wrapper-attr', function ($attr, $device) {
42
+ $transparent_result = $this->current_screen_has_transparent();
43
+
44
+ if (! $transparent_result) {
45
+ return $attr;
46
+ }
47
+
48
+ if (in_array($device, $transparent_result)) {
49
+ $attr['data-transparent'] = '';
50
+ }
51
+
52
+ return $attr;
53
+ }, 10, 2);
54
+
55
+ add_filter('blocksy:header:item-template-args', function ($args) {
56
+ $args['has_transparent_header'] = $this->current_screen_has_transparent();
57
+ $args['has_sticky_header'] = $this->current_screen_has_sticky();
58
+
59
+ return $args;
60
+ });
61
+
62
+ add_filter('blocksy:header:row-wrapper-attr', function ($attr, $row, $device) {
63
+ $current_section = blocksy_manager()->header_builder->get_current_section();
64
+
65
+ if (! isset($current_section['settings'])) {
66
+ $current_section['settings'] = [];
67
+ }
68
+
69
+ $atts = $current_section['settings'];
70
+
71
+ $transparent_result = $this->current_screen_has_transparent();
72
+
73
+ if ($transparent_result) {
74
+ if (in_array($device, $transparent_result)) {
75
+ $attr['data-transparent-row'] = 'yes';
76
+ }
77
+ }
78
+
79
+ return $attr;
80
+ }, 10, 3);
81
+
82
+ add_filter(
83
+ 'blocksy:header:rows-render',
84
+ function ($custom_content, $rows, $device) {
85
+ $sticky_result = $this->current_screen_has_sticky();
86
+
87
+ if (! $sticky_result) {
88
+ return $custom_content;
89
+ }
90
+
91
+ if (! in_array($device, $sticky_result['devices'])) {
92
+ return $custom_content;
93
+ }
94
+
95
+ $start_html = '<div class="ct-sticky-container">';
96
+ $start_html .= '<div data-sticky="' . $sticky_result['effect'] . '">';
97
+
98
+ $end_html = '</div></div>';
99
+
100
+ if (
101
+ $sticky_result['behaviour'] === 'top_middle'
102
+ &&
103
+ (
104
+ isset($rows['top-row'])
105
+ ||
106
+ isset($rows['middle-row'])
107
+ )
108
+ ) {
109
+ if (isset($rows['top-row'])) {
110
+ $rows['top-row'] = $start_html . $rows['top-row'];
111
+ } else {
112
+ $rows['middle-row'] = $start_html . $rows['middle-row'];
113
+ }
114
+
115
+ if (isset($rows['middle-row'])) {
116
+ $rows['middle-row'] = $rows['middle-row'] . $end_html;
117
+ } else {
118
+ $rows['top-row'] = $rows['top-row'] . $end_html;
119
+ }
120
+
121
+ return implode('', array_values($rows));
122
+ }
123
+
124
+ if (
125
+ $sticky_result['behaviour'] === 'middle_bottom'
126
+ &&
127
+ (
128
+ isset($rows['middle-row'])
129
+ ||
130
+ isset($rows['bottom-row'])
131
+ )
132
+ ) {
133
+ if (isset($rows['middle-row'])) {
134
+ $rows['middle-row'] = $start_html . $rows['middle-row'];
135
+ } else {
136
+ $rows['bottom-row'] = $start_html . $rows['bottom-row'];
137
+ }
138
+
139
+ if (isset($rows['bottom-row'])) {
140
+ $rows['bottom-row'] = $rows['bottom-row'] . $end_html;
141
+ } else {
142
+ $rows['middle-row'] = $rows['middle-row'] . $end_html;
143
+ }
144
+
145
+ return implode('', array_values($rows));
146
+ }
147
+
148
+ if (
149
+ $sticky_result['behaviour'] === 'middle'
150
+ &&
151
+ isset($rows['middle-row'])
152
+ ) {
153
+ $rows['middle-row'] = $start_html . $rows['middle-row'] . $end_html;
154
+ return implode('', array_values($rows));
155
+ }
156
+
157
+ if (
158
+ $sticky_result['behaviour'] === 'bottom'
159
+ &&
160
+ isset($rows['bottom-row'])
161
+ ) {
162
+ $rows['bottom-row'] = $start_html . $rows['bottom-row'] . $end_html;
163
+ return implode('', array_values($rows));
164
+ }
165
+
166
+ if (
167
+ $sticky_result['behaviour'] === 'top'
168
+ &&
169
+ isset($rows['top-row'])
170
+ ) {
171
+ $rows['top-row'] = $start_html . $rows['top-row'] . $end_html;
172
+ return implode('', array_values($rows));
173
+ }
174
+
175
+ if (
176
+ $sticky_result['behaviour'] === 'entire_header'
177
+ ) {
178
+ return $start_html . implode('', array_values($rows)) . $end_html;
179
+ }
180
+
181
+ return null;
182
+ },
183
+ 10, 3
184
+ );
185
+
186
+ add_filter('blocksy:header:dynamic-styles-args', function ($args) {
187
+ $args['has_transparent_header'] = $this->current_screen_has_transparent(false);
188
+ $args['has_sticky_header'] = $this->current_screen_has_sticky();
189
+
190
+ return $args;
191
+ });
192
+
193
+ add_filter('blocksy:header:default_value', function ($value, $header_builder) {
194
+ $value['sections'][] = $header_builder->get_structure_for([
195
+ 'id' => 'ct-custom-transparent',
196
+ 'name' => __('Transparent', 'blocksy'),
197
+ 'mode' => 'placements',
198
+ 'settings' => [
199
+ 'is_absolute' => 'yes'
200
+ ],
201
+ 'items' => [
202
+ 'desktop' => [
203
+ 'middle-row' => [
204
+ 'start' => ['logo'],
205
+ 'end' => ['menu', 'search']
206
+ ]
207
+ ],
208
+
209
+ 'mobile' => [
210
+ 'middle-row' => [
211
+ 'start' => ['logo'],
212
+ 'end' => ['trigger']
213
+ ],
214
+
215
+ 'offcanvas' => [
216
+ 'start' => [
217
+ 'mobile-menu',
218
+ ]
219
+ ]
220
+ ]
221
+ ]
222
+ ]);
223
+
224
+ return $value;
225
+ }, 10, 2);
226
+
227
+ add_filter('blocksy:header:items-paths', function ($paths) {
228
+ $paths[] = dirname(__FILE__) . '/header/items';
229
+ return $paths;
230
+ });
231
+
232
+ add_filter('blocksy:footer:offcanvas-drawer', function ($els) {
233
+ if (! class_exists('Blocksy_Header_Builder_Render')) {
234
+ return;
235
+ }
236
+
237
+ $render = new \Blocksy_Header_Builder_Render();
238
+
239
+ if (! $render->contains_item('account')) {
240
+ return $els;
241
+ }
242
+
243
+ remove_filter('lostpassword_url', 'wc_lostpassword_url', 10, 1);
244
+
245
+ $els[] = blc_call_fn(
246
+ ['fn' => 'blocksy_render_view'],
247
+ dirname(__FILE__) . '/header/account-modal.php'
248
+ );
249
+
250
+ add_filter('lostpassword_url', 'wc_lostpassword_url', 10, 1);
251
+
252
+ return $els;
253
+ });
254
+
255
+ add_filter('blocksy:header:settings', function ($opt) {
256
+ $opt = blc_call_fn(
257
+ [
258
+ 'fn' => 'blocksy_get_options',
259
+ 'default' => 'array'
260
+ ],
261
+ dirname( __FILE__ ) . '/header/header-options.php',
262
+ [], false
263
+ );
264
+
265
+ return $opt;
266
+ });
267
+ }
268
+
269
+ public function enqueue_static() {
270
+ if (! function_exists('get_plugin_data')) {
271
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
272
+ }
273
+
274
+ global $wp_customize;
275
+
276
+ $data = get_plugin_data(BLOCKSY__FILE__);
277
+
278
+ $deps = ['ct-options-scripts'];
279
+
280
+ $current_screen = get_current_screen();
281
+
282
+ if ($current_screen && $current_screen->id === 'customize') {
283
+ $deps = ['ct-customizer-controls'];
284
+ }
285
+
286
+ wp_enqueue_script(
287
+ 'blocksy-admin-scripts',
288
+ BLOCKSY_URL . 'static/bundle/options.js',
289
+ $deps,
290
+ $data['Version'],
291
+ true
292
+ );
293
+
294
+ $conditions_manager = new ConditionsManager();
295
+
296
+ $localize = array_merge(
297
+ [
298
+ 'all_condition_rules' => $conditions_manager->get_all_rules(),
299
+ 'ajax_url' => admin_url('admin-ajax.php'),
300
+ 'rest_url' => get_rest_url(),
301
+ ]
302
+ );
303
+
304
+ wp_localize_script(
305
+ 'blocksy-admin-scripts',
306
+ 'blocksy_admin',
307
+ $localize
308
+ );
309
+
310
+ wp_enqueue_style(
311
+ 'blocksy-styles',
312
+ BLOCKSY_URL . 'static/bundle/options.css',
313
+ [],
314
+ $data['Version']
315
+ );
316
+ }
317
+
318
+ public function current_screen_has_transparent($check_conditions = true) {
319
+ if (true || $this->has_transparent_header === '__DEFAULT__' || ! $check_conditions) {
320
+ $current_section = blocksy_manager()->header_builder->get_current_section();
321
+
322
+ if (! isset($current_section['settings'])) {
323
+ $current_section['settings'] = [];
324
+ }
325
+
326
+ $atts = $current_section['settings'];
327
+
328
+ if (blocksy_akg('has_transparent_header', $atts, 'no') === 'no') {
329
+ $this->has_transparent_header = false;
330
+ return false;
331
+ }
332
+
333
+ $transparent_behaviour = blocksy_akg(
334
+ 'transparent_behaviour',
335
+ $atts,
336
+ [
337
+ 'desktop' => true,
338
+ 'tablet' => true,
339
+ 'mobile' => true,
340
+ ]
341
+ );
342
+
343
+ $transparent_result = [];
344
+
345
+ foreach ($transparent_behaviour as $device => $value) {
346
+ if (! $value) {
347
+ continue;
348
+ }
349
+
350
+ $transparent_result[] = $device;
351
+ }
352
+
353
+ $conditions_manager = new \Blocksy\ConditionsManager();
354
+
355
+ $this->has_transparent_header = false;
356
+
357
+ if (
358
+ count($transparent_result) > 0
359
+ &&
360
+ (
361
+ (
362
+ $current_section['id'] === 'type-1'
363
+ &&
364
+ $conditions_manager->condition_matches(blocksy_akg(
365
+ 'transparent_conditions',
366
+ $atts,
367
+ [
368
+ [
369
+ 'type' => 'include',
370
+ 'rule' => 'everywhere'
371
+ ],
372
+
373
+ [
374
+ 'type' => 'exclude',
375
+ 'rule' => '404'
376
+ ],
377
+
378
+ [
379
+ 'type' => 'exclude',
380
+ 'rule' => 'search'
381
+ ],
382
+
383
+ [
384
+ 'type' => 'exclude',
385
+ 'rule' => 'archives'
386
+ ]
387
+ ]
388
+ ))
389
+ ) || (
390
+ $current_section['id'] !== 'type-1'
391
+ ) || !$check_conditions
392
+ )
393
+ ) {
394
+ $this->has_transparent_header = $transparent_result;
395
+ }
396
+ }
397
+
398
+ return $this->has_transparent_header;
399
+ }
400
+
401
+ public function current_screen_has_sticky() {
402
+ if ($this->has_sticky_header === '__DEFAULT__') {
403
+ $current_section = blocksy_manager()->header_builder->get_current_section();
404
+
405
+ if (! isset($current_section['settings'])) {
406
+ $current_section['settings'] = [];
407
+ }
408
+
409
+ $atts = $current_section['settings'];
410
+
411
+ if (blocksy_akg('has_sticky_header', $atts, 'no') === 'no') {
412
+ $this->has_sticky_header = false;
413
+ return $this->has_sticky_header;
414
+ }
415
+
416
+ $atts = $current_section['settings'];
417
+
418
+ $sticky_behaviour = blocksy_akg(
419
+ 'sticky_behaviour',
420
+ $atts,
421
+ [
422
+ 'desktop' => true,
423
+ 'mobile' => true,
424
+ ]
425
+ );
426
+
427
+ $sticky_result = [
428
+ 'devices' => [],
429
+
430
+ // top
431
+ // middle
432
+ // bottom
433
+ // middle_bottom
434
+ // entire_header
435
+ // 'behaviour' => 'middle_bottom'
436
+ // 'behaviour' => 'middle'
437
+ // 'behaviour' => 'middle_bottom'
438
+ 'behaviour' => blocksy_akg('sticky_rows', $atts, 'middle'),
439
+ 'effect' => blocksy_akg('sticky_effect', $atts, 'shrink')
440
+ ];
441
+
442
+ foreach ($sticky_behaviour as $device => $value) {
443
+ if (! $value) {
444
+ continue;
445
+ }
446
+
447
+ $sticky_result['devices'][] = $device;
448
+ }
449
+
450
+ $this->has_sticky_header = $sticky_result;
451
+ }
452
+
453
+ return $this->has_sticky_header;
454
+ }
455
+
456
+ public function patch_conditions($post_id, $old_post_id) {
457
+ $conditions = $this->get_conditions();
458
+
459
+ foreach ($conditions as $index => $single_condition) {
460
+ $particular_conditions = $single_condition['conditions'];
461
+
462
+ foreach ($particular_conditions as $nested_index => $single_particular_condition) {
463
+ if (
464
+ (
465
+ $single_particular_condition['rule'] === 'page_ids'
466
+ ||
467
+ $single_particular_condition['rule'] === 'post_ids'
468
+ ) && (
469
+ isset($single_particular_condition['payload'])
470
+ &&
471
+ isset($single_particular_condition['payload']['post_id'])
472
+ &&
473
+ intval(
474
+ $single_particular_condition['payload']['post_id']
475
+ ) === $old_post_id
476
+ )
477
+ ) {
478
+ $particular_conditions[$nested_index]['payload']['post_id'] = $post_id;
479
+ }
480
+ }
481
+
482
+ $conditions[$index]['conditions'] = $particular_conditions;
483
+ }
484
+
485
+ $this->set_conditions($conditions);
486
+
487
+ $section_value = blocksy_manager()->header_builder->get_section_value();
488
+
489
+ foreach ($section_value['sections'] as $index => $current_section) {
490
+ if (! isset($current_section['settings'])) {
491
+ continue;
492
+ }
493
+
494
+ if (! isset($current_section['settings']['transparent_conditions'])) {
495
+ continue;
496
+ }
497
+
498
+ foreach ($current_section['settings']['transparent_conditions'] as $cond_index => $single_condition) {
499
+ $particular_conditions = $single_condition;
500
+
501
+ if (
502
+ (
503
+ $single_condition['rule'] === 'page_ids'
504
+ ||
505
+ $single_condition['rule'] === 'post_ids'
506
+ ) && (
507
+ isset($single_condition['payload'])
508
+ &&
509
+ isset($single_condition['payload']['post_id'])
510
+ &&
511
+ intval(
512
+ $single_condition['payload']['post_id']
513
+ ) === $old_post_id
514
+ )
515
+ ) {
516
+ $single_condition['payload']['post_id'] = $post_id;
517
+ }
518
+
519
+ $section_value['sections'][$index]['settings'][
520
+ 'transparent_conditions'
521
+ ][$cond_index] = $single_condition;
522
+ }
523
+ }
524
+
525
+ set_theme_mod('header_placements', $section_value);
526
+ }
527
+
528
+ public function get_conditions() {
529
+ $option = get_theme_mod('blocksy_premium_header_conditions', []);
530
+
531
+ if (empty($option)) {
532
+ return [];
533
+ }
534
+
535
+ return $option;
536
+ }
537
+
538
+ public function set_conditions($conditions) {
539
+ set_theme_mod('blocksy_premium_header_conditions', $conditions);
540
+ }
541
+ }
542
+
trunk/framework/features/header/account-modal.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $users_can_register = get_option('users_can_register');
4
+ // $users_can_register = true;
5
+
6
+ ?>
7
+
8
+ <div id="account-modal" class="ct-panel" data-behaviour="modal">
9
+ <div class="ct-panel-actions">
10
+ <div class="close-button">
11
+ <span class="ct-trigger closed">
12
+ <span></span>
13
+ </span>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="ct-panel-content">
18
+ <div class="ct-account-form">
19
+ <?php if ($users_can_register) { ?>
20
+ <ul>
21
+ <li class="active ct-login">
22
+ <?php echo __('Login', 'blc') ?>
23
+ </li>
24
+
25
+ <li class="ct-register">
26
+ <?php echo __('Sign Up', 'blc') ?>
27
+ </li>
28
+ </ul>
29
+ <?php } ?>
30
+
31
+ <section class="ct-login-form active">
32
+ <?php //wp_login_form([]); ?>
33
+
34
+ <form name="loginform" id="loginform" action="<?php echo wp_login_url() ?>" method="post">
35
+ <?php do_action('woocommerce_login_form_start'); ?>
36
+ <?php do_action('blocksy:account:modal:login:start'); ?>
37
+
38
+ <p class="login-username">
39
+ <label for="user_login"><?php echo __('Email Address', 'blc') ?></label>
40
+ <input type="text" name="log" id="user_login" class="input" value="" size="20">
41
+ </p>
42
+
43
+ <p class="login-password">
44
+ <label for="user_pass"><?php echo __('Password', 'blc') ?></label>
45
+ <input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
46
+ </p>
47
+
48
+ <p class="login-remember col-2">
49
+ <label>
50
+ <input name="rememberme" type="checkbox" id="rememberme" value="forever">
51
+ <?php echo __('Remember Me', 'blc') ?>
52
+ </label>
53
+
54
+ <a href="<?php echo wp_lostpassword_url() ?>" class="ct-forgot-password">
55
+ <?php echo __('Forgot Password?', 'blc') ?>
56
+ </a>
57
+ </p>
58
+
59
+ <?php do_action('login_form') ?>
60
+
61
+ <p class="login-submit">
62
+ <button name="wp-submit" class="ct-button">
63
+ <?php echo __('Log In', 'blc') ?>
64
+ </button>
65
+
66
+ <input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>">
67
+ </p>
68
+
69
+ <?php do_action('blocksy:account:modal:login:end'); ?>
70
+ <?php do_action('woocommerce_login_form_end'); ?>
71
+ </form>
72
+ </section>
73
+
74
+ <?php if ($users_can_register) { ?>
75
+ <section class="ct-register-form">
76
+
77
+ <form name="registerform" id="registerform" action="<?php echo wp_registration_url() ?>" method="post" novalidate="novalidate">
78
+ <?php do_action('woocommerce_register_form_start') ?>
79
+ <?php do_action('blocksy:account:modal:register:start'); ?>
80
+
81
+ <p>
82
+ <label for="user_login_register"><?php echo __('Username', 'blc') ?></label>
83
+ <input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
84
+ </p>
85
+
86
+ <p>
87
+ <label for="user_email"><?php echo __('Email', 'blc') ?></label>
88
+ <input type="email" name="user_email" id="user_email" class="input" value="" size="25">
89
+ </p>
90
+
91
+ <?php do_action('register_form') ?>
92
+
93
+ <p id="reg_passmail">
94
+ <?php echo __('Registration confirmation will be emailed to you', 'blc') ?>
95
+ </p>
96
+
97
+ <p>
98
+ <button name="wp-submit" class="ct-button">
99
+ <?php echo __('Register', 'blc') ?>
100
+ </button>
101
+
102
+ <!-- <input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>"> -->
103
+ </p>
104
+
105
+ <?php do_action('blocksy:account:modal:register:end'); ?>
106
+ <?php do_action('woocommerce_register_form_end') ?>
107
+ </form>
108
+
109
+ </section>
110
+ <?php } ?>
111
+
112
+ <section class="ct-forgot-password-form">
113
+ <form name="lostpasswordform" id="lostpasswordform" action="<?php echo wp_lostpassword_url() ?>" method="post">
114
+ <?php do_action('blocksy:account:modal:lostpassword:start'); ?>
115
+
116
+ <p>
117
+ <label for="user_login_forgot"><?php echo __('Username or Email Address', 'blc')?></label>
118
+ <input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
119
+ </p>
120
+
121
+ <p>
122
+ <button name="wp-submit" class="ct-button">
123
+ <?php echo __('Get New Password', 'blc') ?>
124
+ </button>
125
+
126
+ <!-- <input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>"> -->
127
+ </p>
128
+
129
+ <?php do_action('blocksy:account:modal:lostpassword:end'); ?>
130
+ </form>
131
+
132
+ <a href="<?php echo wp_login_url() ?>" class="ct-back-to-login ct-login">
133
+ ← <?php echo __('Back to login', 'blc') ?>
134
+ </a>
135
+ </section>
136
+ </div>
137
+ </div>
138
+ </div>
139
+
trunk/framework/features/header/header-options.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+
5
+ 'has_sticky_header' => [
6
+ 'label' => __( 'Sticky Functionality', 'blc' ),
7
+ 'type' => 'ct-switch',
8
+ 'value' => 'no',
9
+
10
+ 'sync' => [
11
+ 'id' => 'header_placements_1'
12
+ ]
13
+ ],
14
+
15
+ blocksy_rand_md5() => [
16
+ 'type' => 'ct-condition',
17
+ 'condition' => [ 'has_sticky_header' => 'yes' ],
18
+ 'options' => [
19
+
20
+ 'sticky_rows' => [
21
+ 'label' => false,
22
+ 'type' => 'ct-image-picker',
23
+ 'value' => 'middle',
24
+ 'design' => 'block',
25
+ 'sync' => [
26
+ 'id' => 'header_placements_1'
27
+ ],
28
+
29
+ 'choices' => [
30
+ 'middle' => [
31
+ 'src' => blocksy_image_picker_url('sticky-main.svg'),
32
+ 'title' => __('Only Main Row', 'blocksy'),
33
+ ],
34
+
35
+ 'top_middle' => [
36
+ 'src' => blocksy_image_picker_url('sticky-top-main.svg'),
37
+ 'title' => __('Top & Main Row', 'blocksy'),
38
+ ],
39
+
40
+ 'entire_header' => [
41
+ 'src' => blocksy_image_picker_url('sticky-all.svg'),
42
+ 'title' => __('All Rows', 'blocksy'),
43
+ ],
44
+
45
+ 'middle_bottom' => [
46
+ 'src' => blocksy_image_picker_url('sticky-main-bottom.svg'),
47
+ 'title' => __('Main & Bottom Row', 'blocksy'),
48
+ ],
49
+
50
+ 'top' => [
51
+ 'src' => blocksy_image_picker_url('sticky-top.svg'),
52
+ 'title' => __('Only Top Row', 'blocksy'),
53
+ ],
54
+
55
+ 'bottom' => [
56
+ 'src' => blocksy_image_picker_url('sticky-bottom.svg'),
57
+ 'title' => __('Only Bottom Row', 'blocksy'),
58
+ ],
59
+ ],
60
+ ],
61
+
62
+ 'sticky_effect' => [
63
+ 'label' => __('Sticky Effect', 'blc' ),
64
+ 'type' => 'ct-select',
65
+ 'value' => 'shrink',
66
+ 'design' => 'block',
67
+ 'sync' => [
68
+ 'id' => 'header_placements_1'
69
+ ],
70
+ 'choices' => blocksy_ordered_keys([
71
+ 'shrink' => __('Default', 'blc'),
72
+ 'slide' => __('Slide Down', 'blc'),
73
+ 'fade' => __('Fade', 'blc'),
74
+ 'auto-hide' => __('Auto Hide/Show', 'blc'),
75
+ ]),
76
+ ],
77
+
78
+ 'sticky_behaviour' => [
79
+ 'label' => __( 'Enable on', 'blc' ),
80
+ 'type' => 'ct-visibility',
81
+ 'design' => 'block',
82
+ 'sync' => 'live',
83
+ 'value' => [
84
+ 'desktop' => true,
85
+ // 'tablet' => true,
86
+ 'mobile' => true,
87
+ ],
88
+
89
+ 'choices' => blocksy_ordered_keys([
90
+ 'desktop' => __('Desktop', 'blc'),
91
+ // 'tablet' => __('Tablet', 'blc'),
92
+ 'mobile' => __('Mobile', 'blc'),
93
+ ]),
94
+ ],
95
+ ],
96
+ ],
97
+
98
+ blocksy_rand_md5() => [
99
+ 'type' => 'ct-divider',
100
+ ],
101
+
102
+ 'has_transparent_header' => [
103
+ 'label' => __( 'Transparent Functionality', 'blc' ),
104
+ 'type' => 'ct-switch',
105
+ 'value' => 'no',
106
+ 'sync' => [
107
+ 'id' => 'header_placements_1'
108
+ ]
109
+ ],
110
+
111
+ blocksy_rand_md5() => [
112
+ 'type' => 'ct-condition',
113
+ 'condition' => [
114
+ 'has_transparent_header' => 'yes',
115
+ 'id' => 'type-1'
116
+ ],
117
+ 'options' => [
118
+ 'transparent_conditions' => [
119
+ 'type' => 'blocksy-display-condition',
120
+ 'value' => [
121
+ [
122
+ 'type' => 'include',
123
+ 'rule' => 'everywhere'
124
+ ],
125
+
126
+ [
127
+ 'type' => 'exclude',
128
+ 'rule' => '404'
129
+ ],
130
+
131
+ [
132
+ 'type' => 'exclude',
133
+ 'rule' => 'search'
134
+ ],
135
+
136
+ [
137
+ 'type' => 'exclude',
138
+ 'rule' => 'archives'
139
+ ]
140
+ ],
141
+ 'label' => __( 'Display Conditions', 'blc' ),
142
+ 'display' => 'modal',
143
+ 'design' => 'block',
144
+ // 'divider' => 'top',
145
+ 'sync' => [
146
+ 'id' => 'header_placements_1'
147
+ ]
148
+ ],
149
+ ]
150
+ ],
151
+
152
+ blocksy_rand_md5() => [
153
+ 'type' => 'ct-condition',
154
+ 'condition' => [ 'has_transparent_header' => 'yes' ],
155
+ 'options' => [
156
+ 'transparent_behaviour' => [
157
+ 'label' => __( 'Enable on', 'blc' ),
158
+ 'type' => 'ct-visibility',
159
+ 'design' => 'block',
160
+ 'sync' => 'live',
161
+ 'value' => [
162
+ 'desktop' => true,
163
+ // 'tablet' => true,
164
+ 'mobile' => true,
165
+ ],
166
+
167
+ 'choices' => blocksy_ordered_keys([
168
+ 'desktop' => __('Desktop', 'blc'),
169
+ // 'tablet' => __('Tablet', 'blc'),
170
+ 'mobile' => __('Mobile', 'blc'),
171
+ ]),
172
+ ],
173
+
174
+ ],
175
+ ],
176
+
177
+ ];
178
+
trunk/framework/features/header/items/account/config.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'name' => __('Account', 'blocksy'),
5
+
6
+ 'typography_keys' => ['account_label_font'],
7
+
8
+ 'selective_refresh' => [
9
+ 'account_state',
10
+ 'account_link',
11
+ 'loggedin_media',
12
+ 'account_loggedin_icon',
13
+ 'account_loggedin_icon_position',
14
+ 'loggedin_text',
15
+ 'login_account_action',
16
+ 'loggedout_account_custom_page',
17
+ 'logged_out_style',
18
+ 'accountHeaderIcon'
19
+ ],
20
+
21
+ 'translation_keys' => [
22
+ ['key' => 'login_label']
23
+ ]
24
+ ];
25
+
trunk/framework/features/header/items/account/dynamic-styles.php ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (! isset($root_selector)) {
4
+ $root_selector = ['.ct-header-account'];
5
+ }
6
+
7
+ // Icon size
8
+ $accountHeaderIconSize = blocksy_akg( 'accountHeaderIconSize', $atts, 15 );
9
+
10
+ if ($accountHeaderIconSize !== 15) {
11
+ blocksy_output_responsive([
12
+ 'css' => $css,
13
+ 'tablet_css' => $tablet_css,
14
+ 'mobile_css' => $mobile_css,
15
+ 'selector' => blocksy_assemble_selector(
16
+ blocksy_mutate_selector([
17
+ 'selector' => $root_selector,
18
+ 'operation' => 'el-suffix',
19
+ 'to_add' => '[data-state="out"]'
20
+ ])
21
+ ),
22
+ 'variableName' => 'icon-size',
23
+ 'value' => $accountHeaderIconSize,
24
+ ]);
25
+ }
26
+
27
+ $accountHeaderIconSize = blocksy_akg( 'account_loggedin_icon_size', $atts, 15 );
28
+
29
+ if ($accountHeaderIconSize !== 15) {
30
+ blocksy_output_responsive([
31
+ 'css' => $css,
32
+ 'tablet_css' => $tablet_css,
33
+ 'mobile_css' => $mobile_css,
34
+ 'selector' => blocksy_assemble_selector(
35
+ blocksy_mutate_selector([
36
+ 'selector' => $root_selector,
37
+ 'operation' => 'el-suffix',
38
+ 'to_add' => '[data-state="in"]'
39
+ ])
40
+ ),
41
+ 'variableName' => 'icon-size',
42
+ 'value' => $accountHeaderIconSize,
43
+ ]);
44
+ }
45
+
46
+
47
+ // Avatar size
48
+ $accountHeaderAvatarSize = blocksy_akg( 'accountHeaderAvatarSize', $atts, 18 );
49
+
50
+ if ($accountHeaderAvatarSize !== 18) {
51
+ blocksy_output_responsive([
52
+ 'css' => $css,
53
+ 'tablet_css' => $tablet_css,
54
+ 'mobile_css' => $mobile_css,
55
+ 'selector' => blc_call_fn([
56
+ 'fn' => 'blocksy_assemble_selector',
57
+ 'default' => $root_selector
58
+ ], $root_selector),
59
+ 'variableName' => 'avatar-size',
60
+ 'value' => $accountHeaderAvatarSize,
61
+ ]);
62
+ }
63
+
64
+ // Modal background
65
+ blocksy_output_background_css([
66
+ 'selector' => blc_call_fn([
67
+ 'fn' => 'blocksy_assemble_selector',
68
+ 'default' => $root_selector
69
+ ], blc_call_fn([
70
+ 'fn' => 'blocksy_mutate_selector',
71
+ ], [
72
+ 'selector' => [$root_selector[0]],
73
+ 'operation' => 'suffix',
74
+ 'to_add' => '#account-modal .ct-account-form'
75
+ ])),
76
+ 'css' => $css,
77
+ 'value' => blocksy_akg('accountHeaderFormBackground', $atts,
78
+ blocksy_background_default_value([
79
+ 'backgroundColor' => [
80
+ 'default' => [
81
+ 'color' => '#ffffff'
82
+ ],
83
+ ],
84
+ ])
85
+ )
86
+ ]);
87
+
88
+ // Modal backdrop
89
+ blocksy_output_background_css([
90
+ 'selector' => blc_call_fn([
91
+ 'fn' => 'blocksy_assemble_selector',
92
+ 'default' => $root_selector
93
+ ], blc_call_fn([
94
+ 'fn' => 'blocksy_mutate_selector',
95
+ ], [
96
+ 'selector' => [$root_selector[0]],
97
+ 'operation' => 'suffix',
98
+ 'to_add' => '#account-modal'
99
+ ])),
100
+ 'css' => $css,
101
+ 'value' => blocksy_akg('accountHeaderBackground', $atts,
102
+ blocksy_background_default_value([
103
+ 'backgroundColor' => [
104
+ 'default' => [
105
+ 'color' => 'rgba(18, 21, 25, 0.6)'
106
+ ],
107
+ ],
108
+ ])
109
+ )
110
+ ]);
111
+
112
+ blocksy_output_box_shadow([
113
+ 'css' => $css,
114
+ 'tablet_css' => $tablet_css,
115
+ 'mobile_css' => $mobile_css,
116
+ 'selector' => blc_call_fn([
117
+ 'fn' => 'blocksy_assemble_selector',
118
+ 'default' => $root_selector
119
+ ], blc_call_fn([
120
+ 'fn' => 'blocksy_mutate_selector',
121
+ ], [
122
+ 'selector' => [$root_selector[0]],
123
+ 'operation' => 'suffix',
124
+ 'to_add' => '#account-modal .ct-account-form'
125
+ ])),
126
+ 'value' => blocksy_akg('account_form_shadow', $atts, blocksy_box_shadow_value([
127
+ 'enable' => true,
128
+ 'h_offset' => 0,
129
+ 'v_offset' => 0,
130
+ 'blur' => 70,
131
+ 'spread' => 0,
132
+ 'inset' => false,
133
+ 'color' => [
134
+ 'color' => 'rgba(0, 0, 0, 0.35)',
135
+ ],
136
+ ])),
137
+ 'responsive' => true
138
+ ]);
139
+
140
+ // Item margin
141
+ blocksy_output_spacing([
142
+ 'css' => $css,
143
+ 'tablet_css' => $tablet_css,
144
+ 'mobile_css' => $mobile_css,
145
+ 'selector' => blc_call_fn([
146
+ 'fn' => 'blocksy_assemble_selector',
147
+ 'default' => $root_selector
148
+ ], $root_selector),
149
+ 'important' => true,
150
+ 'value' => blocksy_default_akg(
151
+ 'accountHeaderMargin', $atts,
152
+ blocksy_spacing_value([
153
+ 'linked' => true,
154
+ ])
155
+ )
156
+ ]);
157
+
158
+ blocksy_output_font_css([
159
+ 'font_value' => blocksy_akg( 'account_label_font', $atts,
160
+ blocksy_typography_default_values([
161
+ 'size' => '12px',
162
+ 'variation' => 'n6',
163
+ 'text-transform' => 'uppercase',
164
+ ])
165
+ ),
166
+ 'css' => $css,
167
+ 'tablet_css' => $tablet_css,
168
+ 'mobile_css' => $mobile_css,
169
+ 'selector' => blc_call_fn([
170
+ 'fn' => 'blocksy_assemble_selector',
171
+ 'default' => $root_selector
172
+ ], blc_call_fn([
173
+ 'fn' => 'blocksy_mutate_selector',
174
+ ], [
175
+ 'selector' => $root_selector,
176
+ 'operation' => 'suffix',
177
+ 'to_add' => '.ct-label'
178
+ ])),
179
+ ]);
180
+
181
+ // default state
182
+ blocksy_output_colors([
183
+ 'value' => blocksy_akg('accountHeaderColor', $atts),
184
+ 'default' => [
185
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
186
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
187
+ ],
188
+ 'css' => $css,
189
+ 'tablet_css' => $tablet_css,
190
+ 'mobile_css' => $mobile_css,
191
+ 'variables' => [
192
+ 'default' => [
193
+ 'selector' => blc_call_fn([
194
+ 'fn' => 'blocksy_assemble_selector',
195
+ 'default' => $root_selector
196
+ ], $root_selector),
197
+ 'variable' => 'linkInitialColor'
198
+ ],
199
+
200
+ 'hover' => [
201
+ 'selector' => blc_call_fn([
202
+ 'fn' => 'blocksy_assemble_selector',
203
+ 'default' => $root_selector
204
+ ], $root_selector),
205
+ 'variable' => 'linkHoverColor'
206
+ ],
207
+ ],
208
+ 'responsive' => true
209
+ ]);
210
+
211
+ blocksy_output_colors([
212
+ 'value' => blocksy_akg('header_account_icon_color', $atts),
213
+ 'default' => [
214
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
215
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
216
+ ],
217
+ 'css' => $css,
218
+ 'tablet_css' => $tablet_css,
219
+ 'mobile_css' => $mobile_css,
220
+ 'variables' => [
221
+ 'default' => [
222
+ 'selector' => blocksy_assemble_selector($root_selector),
223
+ 'variable' => 'icon-color'
224
+ ],
225
+
226
+ 'hover' => [
227
+ 'selector' => blocksy_assemble_selector($root_selector),
228
+ 'variable' => 'icon-hover-color'
229
+ ],
230
+ ],
231
+ 'responsive' => true
232
+ ]);
233
+
234
+ // transparent state
235
+ if (isset($has_transparent_header) && $has_transparent_header) {
236
+ blocksy_output_colors([
237
+ 'value' => blocksy_akg('transparentAccountHeaderColor', $atts),
238
+ 'default' => [
239
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
240
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
241
+ ],
242
+ 'css' => $css,
243
+ 'tablet_css' => $tablet_css,
244
+ 'mobile_css' => $mobile_css,
245
+
246
+ 'variables' => [
247
+ 'default' => [
248
+ 'selector' => blc_call_fn([
249
+ 'fn' => 'blocksy_assemble_selector',
250
+ 'default' => $root_selector
251
+ ], blc_call_fn([
252
+ 'fn' => 'blocksy_mutate_selector',
253
+ ], [
254
+ 'selector' => $root_selector,
255
+ 'to_add' => '[data-transparent-row="yes"]'
256
+ ])),
257
+ 'variable' => 'linkInitialColor'
258
+ ],
259
+
260
+ 'hover' => [
261
+ 'selector' => blc_call_fn([
262
+ 'fn' => 'blocksy_assemble_selector',
263
+ 'default' => $root_selector
264
+ ], blc_call_fn([
265
+ 'fn' => 'blocksy_mutate_selector',
266
+ ], [
267
+ 'selector' => $root_selector,
268
+ 'to_add' => '[data-transparent-row="yes"]'
269
+ ])),
270
+ 'variable' => 'linkHoverColor'
271
+ ],
272
+ ],
273
+ 'responsive' => true
274
+ ]);
275
+
276
+ blocksy_output_colors([
277
+ 'value' => blocksy_akg('transparent_header_account_icon_color', $atts),
278
+ 'default' => [
279
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
280
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
281
+ ],
282
+ 'css' => $css,
283
+ 'tablet_css' => $tablet_css,
284
+ 'mobile_css' => $mobile_css,
285
+
286
+ 'variables' => [
287
+ 'default' => [
288
+ 'selector' => blocksy_assemble_selector(blocksy_mutate_selector([
289
+ 'selector' => $root_selector,
290
+ 'operation' => 'between',
291
+ 'to_add' => '[data-transparent-row="yes"]'
292
+ ])),
293
+ 'variable' => 'icon-color'
294
+ ],
295
+
296
+ 'hover' => [
297
+ 'selector' => blocksy_assemble_selector(blocksy_mutate_selector([
298
+ 'selector' => $root_selector,
299
+ 'operation' => 'between',
300
+ 'to_add' => '[data-transparent-row="yes"]'
301
+ ])),
302
+ 'variable' => 'icon-hover-color'
303
+ ],
304
+ ],
305
+ 'responsive' => true
306
+ ]);
307
+ }
308
+
309
+ // sticky state
310
+ if (isset($has_sticky_header) && $has_sticky_header) {
311
+ blocksy_output_colors([
312
+ 'value' => blocksy_akg('stickyAccountHeaderColor', $atts),
313
+ 'default' => [
314
+ 'default' => ['color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT')],
315
+ 'hover' => ['color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT')],
316
+ ],
317
+ 'css' => $css,
318
+ 'tablet_css' => $tablet_css,
319
+ 'mobile_css' => $mobile_css,
320
+
321
+ 'variables' => [
322
+ 'default' => [
323
+ 'selector' => blc_call_fn([
324
+ 'fn' => 'blocksy_assemble_selector',
325
+ 'default' => $root_selector
326
+ ], blc_call_fn([
327
+ 'fn' => 'blocksy_mutate_selector',
328
+ ], [
329
+ 'selector' => $root_selector,
330
+ 'to_add' => '[data-sticky*="yes"]'
331
+ ])),
332
+ 'variable' => 'linkInitialColor'
333
+ ],
334
+
335
+ 'hover' => [
336
+ 'selector' => blc_call_fn([
337
+ 'fn' => 'blocksy_assemble_selector',
338
+ 'default' => $root_selector
339
+ ], blc_call_fn([
340
+ 'fn' => 'blocksy_mutate_selector',
341
+ ], [
342
+ 'selector' => $root_selector,
343
+ 'to_add' => '[data-sticky*="yes"]'
344
+ ])),
345
+ 'variable' => 'linkHoverColor'
346
+ ],
347
+ ],
348
+ 'responsive' => true
349
+ ]);
350
+
351
+ blocksy_output_colors([
352
+ 'value' => blocksy_akg('sticky_header_account_icon_color', $atts),
353
+ 'default' => [
354
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
355
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
356
+ ],
357
+ 'css' => $css,
358
+ 'tablet_css' => $tablet_css,
359
+ 'mobile_css' => $mobile_css,
360
+
361
+ 'variables' => [
362
+ 'default' => [
363
+ 'selector' => blocksy_assemble_selector(blocksy_mutate_selector([
364
+ 'selector' => $root_selector,
365
+ 'operation' => 'between',
366
+ 'to_add' => '[data-sticky*="yes"]'
367
+ ])),
368
+ 'variable' => 'icon-color'
369
+ ],
370
+
371
+ 'hover' => [
372
+ 'selector' => blocksy_assemble_selector(blocksy_mutate_selector([
373
+ 'selector' => $root_selector,
374
+ 'operation' => 'between',
375
+ 'to_add' => '[data-sticky*="yes"]'
376
+ ])),
377
+ 'variable' => 'icon-hover-color'
378
+ ],
379
+ ],
380
+ 'responsive' => true
381
+ ]);
382
+ }
383
+
384
+ blocksy_output_colors([
385
+ 'value' => blocksy_akg('account_close_button_color', $atts),
386
+ 'default' => [
387
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
388
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
389
+ ],
390
+ 'css' => $css,
391
+
392
+ 'variables' => [
393
+ 'default' => [
394
+ 'selector' => blc_call_fn([
395
+ 'fn' => 'blocksy_assemble_selector',
396
+ 'default' => $root_selector
397
+ ], blc_call_fn([
398
+ 'fn' => 'blocksy_mutate_selector',
399
+ ], [
400
+ 'selector' => [$root_selector[0]],
401
+ 'operation' => 'suffix',
402
+ 'to_add' => '#account-modal .close-button'
403
+ ])),
404
+ 'variable' => 'closeButtonColor'
405
+ ],
406
+
407
+ 'hover' => [
408
+ 'selector' => blc_call_fn([
409
+ 'fn' => 'blocksy_assemble_selector',
410
+ 'default' => $root_selector
411
+ ], blc_call_fn([
412
+ 'fn' => 'blocksy_mutate_selector',
413
+ ], [
414
+ 'selector' => [$root_selector[0]],
415
+ 'operation' => 'suffix',
416
+ 'to_add' => '#account-modal .close-button'
417
+ ])),
418
+ 'variable' => 'closeButtonHoverColor'
419
+ ]
420
+ ],
421
+ ]);
422
+
423
+ blocksy_output_colors([
424
+ 'value' => blocksy_akg('account_close_button_shape_color', $atts),
425
+ 'default' => [
426
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
427
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
428
+ ],
429
+ 'css' => $css,
430
+
431
+ 'variables' => [
432
+ 'default' => [
433
+ 'selector' => blc_call_fn([
434
+ 'fn' => 'blocksy_assemble_selector',
435
+ 'default' => $root_selector
436
+ ], blc_call_fn([
437
+ 'fn' => 'blocksy_mutate_selector',
438
+ ], [
439
+ 'selector' => [$root_selector[0]],
440
+ 'operation' => 'suffix',
441
+ 'to_add' => '#account-modal .close-button'
442
+ ])),
443
+ 'variable' => 'closeButtonBackground'
444
+ ],
445
+
446
+ 'hover' => [
447
+ 'selector' => blc_call_fn([
448
+ 'fn' => 'blocksy_assemble_selector',
449
+ 'default' => $root_selector
450
+ ], blc_call_fn([
451
+ 'fn' => 'blocksy_mutate_selector',
452
+ ], [
453
+ 'selector' => [$root_selector[0]],
454
+ 'operation' => 'suffix',
455
+ 'to_add' => '#account-modal .close-button'
456
+ ])),
457
+ 'variable' => 'closeButtonHoverBackground'
458
+ ]
459
+ ],
460
+ ]);
trunk/framework/features/header/items/account/options.php ADDED
@@ -0,0 +1,946 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ blocksy_rand_md5() => [
5
+ 'type' => 'ct-title',
6
+ 'label' => __( 'Customizing: Logged in State', 'blc' ),
7
+ ],
8
+
9
+ 'account_state' => [
10
+ 'label' => false,
11
+ 'type' => 'ct-image-picker',
12
+ 'value' => 'in',
13
+ 'attr' => [ 'data-type' => 'background' ],
14
+ 'switchDeviceOnChange' => 'desktop',
15
+ 'choices' => [
16
+ 'in' => [
17
+ 'src' => blocksy_image_picker_url( 'log-in-state.svg' ),
18
+ 'title' => __( 'Logged In Options', 'blc' ),
19
+ ],
20
+
21
+ 'out' => [
22
+ 'src' => blocksy_image_picker_url('log-out-state.svg'),
23
+ 'title' => __('Logged Out Options', 'blc'),
24
+ ],
25
+ ],
26
+ ],
27
+
28
+ blocksy_rand_md5() => [
29
+ 'type' => 'ct-divider',
30
+ ],
31
+
32
+ blocksy_rand_md5() => [
33
+ 'title' => __( 'General', 'blocksy' ),
34
+ 'type' => 'tab',
35
+ 'options' => [
36
+
37
+ blocksy_rand_md5() => [
38
+ 'type' => 'ct-condition',
39
+ 'condition' => [ 'account_state' => 'in' ],
40
+ 'options' => [
41
+
42
+ 'account_link' => [
43
+ 'label' => __( 'Account Action', 'blc' ),
44
+ 'type' => 'ct-select',
45
+ 'value' => 'profile',
46
+ 'view' => 'text',
47
+ 'design' => 'inline',
48
+ 'choices' => blocksy_ordered_keys(
49
+ [
50
+ 'profile' => __( 'Profile Page', 'blc' ),
51
+ 'dashboard' => __( 'Dashboard Page', 'blc' ),
52
+ // 'menu' => __( 'Menu', 'blc' ),
53
+ 'custom' => __( 'Custom Link', 'blc' ),
54
+ 'logout' => __( 'Logout', 'blc' ),
55
+ ]
56
+ ),
57
+ ],
58
+
59
+ blocksy_rand_md5() => [
60
+ 'type' => 'ct-condition',
61
+ 'condition' => [ 'account_link' => 'menu' ],
62
+ 'options' => [
63
+ 'loggedin_account_menu' => [
64
+ 'label' => __('Select Menu', 'blc'),
65
+ 'type' => 'ct-select',
66
+ 'value' => 'blocksy_location',
67
+ 'view' => 'text',
68
+ 'design' => 'inline',
69
+ 'setting' => ['transport' => 'postMessage'],
70
+ 'placeholder' => __('Select menu...', 'blc'),
71
+ 'choices' => blocksy_ordered_keys(blocksy_get_menus_items()),
72
+ 'desc' => sprintf(
73
+ // translators: placeholder here means the actual URL.
74
+ __( 'Manage your menu items in the %sMenus screen%s.', 'blc' ),
75
+ sprintf(
76
+ '<a href="%s" target="_blank">',
77
+ admin_url('/nav-menus.php')
78
+ ),
79
+ '</a>'
80
+ ),
81
+ ],
82
+ ],
83
+ ],
84
+
85
+ blocksy_rand_md5() => [
86
+ 'type' => 'ct-condition',
87
+ 'condition' => [ 'account_link' => 'custom' ],
88
+ 'options' => [
89
+
90
+ 'account_custom_page' => [
91
+ 'label' => __( 'Custom Page Link', 'blc' ),
92
+ 'type' => 'text',
93
+ 'design' => 'inline',
94
+ 'disableRevertButton' => true,
95
+ 'value' => ''
96
+ ],
97
+
98
+ ],
99
+ ],
100
+
101
+ blocksy_rand_md5() => [
102
+ 'type' => 'ct-divider',
103
+ ],
104
+
105
+ 'loggedin_media' => [
106
+ 'label' => __( 'Account Image', 'blc' ),
107
+ 'type' => 'ct-radio',
108
+ 'design' => 'block',
109
+ 'view' => 'text',
110
+ 'value' => 'avatar',
111
+ 'choices' => [
112
+ 'avatar' => __( 'Avatar', 'blc' ),
113
+ 'icon' => __( 'Icon', 'blc' ),
114
+ 'none' => __( 'None', 'blc' ),
115
+ ],
116
+ 'setting' => [ 'transport' => 'postMessage' ],
117
+ ],
118
+
119
+ blocksy_rand_md5() => [
120
+ 'type' => 'ct-condition',
121
+ 'condition' => [ 'loggedin_media' => 'avatar' ],
122
+ 'options' => [
123
+
124
+ 'accountHeaderAvatarSize' => [
125
+ 'label' => __( 'Avatar Size', 'blc' ),
126
+ 'type' => 'ct-slider',
127
+ 'min' => 10,
128
+ 'max' => 40,
129
+ 'value' => 18,
130
+ 'responsive' => true,
131
+ 'divider' => 'top',
132
+ 'setting' => [ 'transport' => 'postMessage' ],
133
+ ],
134
+
135
+ ],
136
+ ],
137
+
138
+ blocksy_rand_md5() => [
139
+ 'type' => 'ct-condition',
140
+ 'condition' => [ 'loggedin_media' => 'icon' ],
141
+ 'options' => [
142
+
143
+ 'account_loggedin_icon' => [
144
+ 'label' => false,
145
+ 'type' => 'ct-image-picker',
146
+ 'value' => 'type-1',
147
+ 'attr' => [
148
+ 'data-type' => 'background',
149
+ 'data-columns' => '3',
150
+ ],
151
+ 'divider' => 'top',
152
+ 'setting' => [ 'transport' => 'postMessage' ],
153
+ 'choices' => [
154
+
155
+ 'type-1' => [
156
+ 'src' => blocksy_image_picker_file( 'account-1' ),
157
+ 'title' => __( 'Type 1', 'blocksy' ),
158
+ ],
159
+
160
+ 'type-2' => [
161
+ 'src' => blocksy_image_picker_file( 'account-2' ),
162
+ 'title' => __( 'Type 2', 'blocksy' ),
163
+ ],
164
+
165
+ 'type-3' => [
166
+ 'src' => blocksy_image_picker_file( 'account-3' ),
167
+ 'title' => __( 'Type 3', 'blocksy' ),
168
+ ],
169
+
170
+ 'type-4' => [
171
+ 'src' => blocksy_image_picker_file( 'account-4' ),
172
+ 'title' => __( 'Type 4', 'blocksy' ),
173
+ ],
174
+
175
+ 'type-5' => [
176
+ 'src' => blocksy_image_picker_file( 'account-5' ),
177
+ 'title' => __( 'Type 5', 'blocksy' ),
178
+ ],
179
+
180
+ 'type-6' => [
181
+ 'src' => blocksy_image_picker_file( 'account-6' ),
182
+ 'title' => __( 'Type 6', 'blocksy' ),
183
+ ],
184
+ ],
185
+ ],
186
+
187
+ 'account_loggedin_icon_size' => [
188
+ 'label' => __( 'Icon Size', 'blc' ),
189
+ 'type' => 'ct-slider',
190
+ 'min' => 5,
191
+ 'max' => 50,
192
+ 'value' => 15,
193
+ 'responsive' => true,
194
+ 'divider' => 'top',
195
+ 'setting' => [ 'transport' => 'postMessage' ],
196
+ ],
197
+
198
+ ],
199
+ ],
200
+
201
+ blocksy_rand_md5() => [
202
+ 'type' => 'ct-divider',
203
+ ],
204
+
205
+ 'loggedin_account_label_visibility' => [
206
+ 'label' => __( 'Label Visibility', 'blc' ),
207
+ 'type' => 'ct-visibility',
208
+ 'design' => 'block',
209
+ 'allow_empty' => true,
210
+ 'setting' => [ 'transport' => 'postMessage' ],
211
+ 'value' => [
212
+ 'desktop' => true,
213
+ 'tablet' => true,
214
+ 'mobile' => true,
215
+ ],
216
+
217
+ 'choices' => blocksy_ordered_keys([
218
+ 'desktop' => __( 'Desktop', 'blocksy' ),
219
+ 'tablet' => __( 'Tablet', 'blocksy' ),
220
+ 'mobile' => __( 'Mobile', 'blocksy' ),
221
+ ]),
222
+ ],
223
+
224
+ blocksy_rand_md5() => [
225
+ 'type' => 'ct-condition',
226
+ 'condition' => [
227
+ 'any' => [
228
+ 'loggedin_account_label_visibility/desktop' => true,
229
+ 'loggedin_account_label_visibility/tablet' => true,
230
+ 'loggedin_account_label_visibility/mobile' => true,
231
+ ]
232
+ ],
233
+ 'options' => [
234
+
235
+ blocksy_rand_md5() => [
236
+ 'type' => 'ct-condition',
237
+ 'condition' => [ 'loggedin_media' => '!none' ],
238
+ 'options' => [
239
+
240
+ 'loggedin_label_position' => [
241
+ 'type' => 'ct-radio',
242
+ 'label' => __( 'Label Position', 'blc' ),
243
+ 'value' => 'right',
244
+ 'view' => 'text',
245
+ 'design' => 'block',
246
+ 'divider' => 'top',
247
+ 'responsive' => [ 'tablet' => 'skip' ],
248
+ 'choices' => [
249
+ 'left' => __( 'Left', 'blc' ),
250
+ 'right' => __( 'Right', 'blc' ),
251
+ 'bottom' => __( 'Bottom', 'blc' ),
252
+ ],
253
+ ],
254
+
255
+ ],
256
+ ],
257
+
258
+ 'loggedin_text' => [
259
+ 'label' => __('Label Type', 'blc'),
260
+ 'type' => 'ct-radio',
261
+ 'view' => 'text',
262
+ 'design' => 'block',
263
+ 'divider' => 'top',
264
+ 'setting' => ['transport' => 'postMessage'],
265
+ 'value' => 'label',
266
+ 'choices' => [
267
+ 'label' => __('Text', 'blc'),
268
+ 'username' => __('Name', 'blc'),
269
+ ],
270
+ ],
271
+
272
+ blocksy_rand_md5() => [
273
+ 'type' => 'ct-condition',
274
+ 'condition' => ['loggedin_text' => 'label'],
275
+ 'options' => [
276
+
277
+ 'loggedin_label' => [
278
+ 'label' => __('Label Text', 'blc'),
279
+ 'type' => 'text',
280
+ 'design' => 'block',
281
+ 'divider' => 'top',
282
+ 'setting' => ['transport' => 'postMessage'],
283
+ 'value' => __('My Account', 'blc')
284
+ ],
285
+
286
+ ],
287
+ ],
288
+
289
+ ],
290
+ ],
291
+
292
+ ],
293
+ ],
294
+
295
+ blocksy_rand_md5() => [
296
+ 'type' => 'ct-condition',
297
+ 'condition' => [ 'account_state' => 'out' ],
298
+ 'options' => [
299
+
300
+ 'login_account_action' => [
301
+ 'label' => __( 'Account Action', 'blc' ),
302
+ 'type' => 'ct-select',
303
+ 'value' => 'modal',
304
+ 'view' => 'text',
305
+ 'design' => 'inline',
306
+ 'setting' => [ 'transport' => 'postMessage' ],
307
+ 'choices' => blocksy_ordered_keys(
308
+ [
309
+ 'modal' => __( 'Modal', 'blc' ),
310
+ 'custom' => __( 'Custom Link', 'blc' ),
311
+ ]
312
+ ),
313
+ ],
314
+
315
+ blocksy_rand_md5() => [
316
+ 'type' => 'ct-condition',
317
+ 'condition' => [ 'login_account_action' => 'custom' ],
318
+ 'options' => [
319
+
320
+ 'loggedout_account_custom_page' => [
321
+ 'label' => __( 'Custom Page Link', 'blc' ),
322
+ 'type' => 'text',
323
+ 'design' => 'inline',
324
+ 'disableRevertButton' => true,
325
+ 'setting' => [ 'transport' => 'postMessage' ],
326
+ 'value' => ''
327
+ ],
328
+
329
+ ],
330
+ ],
331
+
332
+ blocksy_rand_md5() => [
333
+ 'type' => 'ct-divider',
334
+ ],
335
+
336
+ 'logged_out_style' => [
337
+ 'label' => __( 'Account Image', 'blc' ),
338
+ 'type' => 'ct-radio',
339
+ 'design' => 'block',
340
+ 'view' => 'text',
341
+ 'value' => 'icon',
342
+ 'choices' => [
343
+ 'icon' => __( 'Icon', 'blc' ),
344
+ 'none' => __( 'None', 'blc' ),
345
+ ],
346
+ 'setting' => [ 'transport' => 'postMessage' ],
347
+ ],
348
+
349
+ blocksy_rand_md5() => [
350
+ 'type' => 'ct-condition',
351
+ 'condition' => [ 'logged_out_style' => 'icon' ],
352
+ 'options' => [
353
+
354
+ 'accountHeaderIcon' => [
355
+ 'label' => false,
356
+ 'type' => 'ct-image-picker',
357
+ 'value' => 'type-1',
358
+ 'attr' => [
359
+ 'data-type' => 'background',
360
+ 'data-columns' => '3',
361
+ ],
362
+ 'divider' => 'top',
363
+ 'setting' => [ 'transport' => 'postMessage' ],
364
+ 'choices' => [
365
+
366
+ 'type-1' => [
367
+ 'src' => blocksy_image_picker_file( 'account-1' ),
368
+ 'title' => __( 'Type 1', 'blocksy' ),
369
+ ],
370
+
371
+ 'type-2' => [
372
+ 'src' => blocksy_image_picker_file( 'account-2' ),
373
+ 'title' => __( 'Type 2', 'blocksy' ),
374
+ ],
375
+
376
+ 'type-3' => [
377
+ 'src' => blocksy_image_picker_file( 'account-3' ),
378
+ 'title' => __( 'Type 3', 'blocksy' ),
379
+ ],
380
+
381
+ 'type-4' => [
382
+ 'src' => blocksy_image_picker_file( 'account-4' ),
383
+ 'title' => __( 'Type 4', 'blocksy' ),
384
+ ],
385
+
386
+ 'type-5' => [
387
+ 'src' => blocksy_image_picker_file( 'account-5' ),
388
+ 'title' => __( 'Type 5', 'blocksy' ),
389
+ ],
390
+
391
+ 'type-6' => [
392
+ 'src' => blocksy_image_picker_file( 'account-6' ),
393
+ 'title' => __( 'Type 6', 'blocksy' ),
394
+ ],
395
+ ],
396
+ ],
397
+
398
+ 'accountHeaderIconSize' => [
399
+ 'label' => __( 'Icon Size', 'blc' ),
400
+ 'type' => 'ct-slider',
401
+ 'min' => 5,
402
+ 'max' => 50,
403
+ 'value' => 15,
404
+ 'responsive' => true,
405
+ 'divider' => 'top',
406
+ 'setting' => [ 'transport' => 'postMessage' ],
407
+ ],
408
+
409
+ ],
410
+ ],
411
+
412
+ blocksy_rand_md5() => [
413
+ 'type' => 'ct-divider',
414
+ ],
415
+
416
+ 'loggedout_account_label_visibility' => [
417
+ 'label' => __( 'Label Visibility', 'blc' ),
418
+ 'type' => 'ct-visibility',
419
+ 'design' => 'block',
420
+ 'allow_empty' => true,
421
+ 'setting' => [ 'transport' => 'postMessage' ],
422
+ 'value' => [
423
+ 'desktop' => true,
424
+ 'tablet' => true,
425
+ 'mobile' => true,
426
+ ],
427
+
428
+ 'choices' => blocksy_ordered_keys([
429
+ 'desktop' => __( 'Desktop', 'blocksy' ),
430
+ 'tablet' => __( 'Tablet', 'blocksy' ),
431
+ 'mobile' => __( 'Mobile', 'blocksy' ),
432
+ ]),
433
+ ],
434
+
435
+ blocksy_rand_md5() => [
436
+ 'type' => 'ct-condition',
437
+ 'condition' => [
438
+ 'any' => [
439
+ 'loggedout_account_label_visibility/desktop' => true,
440
+ 'loggedout_account_label_visibility/tablet' => true,
441
+ 'loggedout_account_label_visibility/mobile' => true,
442
+ ]
443
+ ],
444
+ 'options' => [
445
+
446
+ blocksy_rand_md5() => [
447
+ 'type' => 'ct-condition',
448
+ 'condition' => [ 'logged_out_style' => 'icon' ],
449
+ 'options' => [
450
+
451
+ 'loggedout_label_position' => [
452
+ 'type' => 'ct-radio',
453
+ 'label' => __( 'Label Position', 'blc' ),
454
+ 'value' => 'right',
455
+ 'view' => 'text',
456
+ 'design' => 'block',
457
+ 'divider' => 'top',
458
+ 'responsive' => [ 'tablet' => 'skip' ],
459
+ 'choices' => [
460
+ 'left' => __( 'Left', 'blc' ),
461
+ 'right' => __( 'Right', 'blc' ),
462
+ 'bottom' => __( 'Bottom', 'blc' ),
463
+ ],
464
+ ],
465
+
466
+ ],
467
+ ],
468
+
469
+ 'login_label' => [
470
+ 'label' => __('Label Text', 'blc'),
471
+ 'type' => 'text',
472
+ 'design' => 'block',
473
+ 'divider' => 'top',
474
+ 'disableRevertButton' => true,
475
+ 'setting' => [ 'transport' => 'postMessage' ],
476
+ 'value' => __('Login', 'blc')
477
+ ],
478
+
479
+ ],
480
+ ],
481
+
482
+ ],
483
+ ],
484
+
485
+ ],
486
+ ],
487
+
488
+
489
+
490
+
491
+ blocksy_rand_md5() => [
492
+ 'title' => __( 'Design', 'blocksy' ),
493
+ 'type' => 'tab',
494
+ 'options' => [
495
+
496
+ 'account_label_font' => [
497
+ 'type' => 'ct-typography',
498
+ 'label' => __( 'Label Font', 'blc' ),
499
+ 'value' => blocksy_typography_default_values([
500
+ 'size' => '12px',
501
+ 'variation' => 'n6',
502
+ 'text-transform' => 'uppercase',
503
+ ]),
504
+ 'setting' => [ 'transport' => 'postMessage' ],
505
+ ],
506
+
507
+ blocksy_rand_md5() => [
508
+ 'type' => 'ct-labeled-group',
509
+ 'label' => __( 'Label Color', 'blc' ),
510
+ 'responsive' => true,
511
+ 'choices' => [
512
+ [
513
+ 'id' => 'accountHeaderColor',
514
+ 'label' => __('Default State', 'blc')
515
+ ],
516
+
517
+ [
518
+ 'id' => 'transparentAccountHeaderColor',
519
+ 'label' => __('Transparent State', 'blc'),
520
+ 'condition' => [
521
+ 'row' => '!offcanvas',
522
+ 'builderSettings/has_transparent_header' => 'yes',
523
+ ],
524
+ ],
525
+
526
+ [
527
+ 'id' => 'stickyAccountHeaderColor',
528
+ 'label' => __('Sticky State', 'blc'),
529
+ 'condition' => [
530
+ 'row' => '!offcanvas',
531
+ 'builderSettings/has_sticky_header' => 'yes',
532
+ ],
533
+ ],
534
+ ],
535
+ 'options' => [
536
+
537
+ 'accountHeaderColor' => [
538
+ 'label' => __( 'Label Color', 'blc' ),
539
+ 'type' => 'ct-color-picker',
540
+ 'design' => 'block:right',
541
+ 'responsive' => true,
542
+ 'setting' => [ 'transport' => 'postMessage' ],
543
+
544
+ 'value' => [
545
+ 'default' => [
546
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
547
+ ],
548
+
549
+ 'hover' => [
550
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
551
+ ],
552
+ ],
553
+
554
+ 'pickers' => [
555
+ [
556
+ 'title' => __( 'Initial', 'blc' ),
557
+ 'id' => 'default',
558
+ 'inherit' => 'var(--color)'
559
+ ],
560
+
561
+ [
562
+ 'title' => __( 'Hover', 'blc' ),
563
+ 'id' => 'hover',
564
+ 'inherit' => 'var(--linkHoverColor)'
565
+ ],
566
+ ],
567
+ ],
568
+
569
+ 'transparentAccountHeaderColor' => [
570
+ 'label' => __( 'Label Color', 'blc' ),
571
+ 'type' => 'ct-color-picker',
572
+ 'design' => 'block:right',
573
+ 'responsive' => true,
574
+ 'setting' => [ 'transport' => 'postMessage' ],
575
+
576
+ 'value' => [
577
+ 'default' => [
578
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
579
+ ],
580
+
581
+ 'hover' => [
582
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
583
+ ],
584
+ ],
585
+
586
+ 'pickers' => [
587
+ [
588
+ 'title' => __( 'Initial', 'blc' ),
589
+ 'id' => 'default',
590
+ ],
591
+
592
+ [
593
+ 'title' => __( 'Hover', 'blc' ),
594
+ 'id' => 'hover',
595
+ ],
596
+ ],
597
+ ],
598
+
599
+ 'stickyAccountHeaderColor' => [
600
+ 'label' => __( 'Label Color', 'blc' ),
601
+ 'type' => 'ct-color-picker',
602
+ 'design' => 'block:right',
603
+ 'responsive' => true,
604
+ 'setting' => [ 'transport' => 'postMessage' ],
605
+
606
+ 'value' => [
607
+ 'default' => [
608
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
609
+ ],
610
+
611
+ 'hover' => [
612
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
613
+ ],
614
+ ],
615
+
616
+ 'pickers' => [
617
+ [
618
+ 'title' => __( 'Initial', 'blc' ),
619
+ 'id' => 'default',
620
+ ],
621
+
622
+ [
623
+ 'title' => __( 'Hover', 'blc' ),
624
+ 'id' => 'hover',
625
+ ],
626
+ ],
627
+ ],
628
+
629
+ ],
630
+ ],
631
+
632
+ blocksy_rand_md5() => [
633
+ 'type' => 'ct-divider',
634
+ ],
635
+
636
+
637
+ blocksy_rand_md5() => [
638
+ 'type' => 'ct-condition',
639
+ 'condition' => [
640
+ 'any' => [
641
+ 'all' => [
642
+ 'account_state' => 'in',
643
+ 'loggedin_media' => 'icon'
644
+ ],
645
+
646
+ 'all~' => [
647
+ 'account_state' => 'out',
648
+ 'logged_out_style' => 'icon'
649
+ ]
650
+ ]
651
+ ],
652
+ 'options' => [
653
+ blocksy_rand_md5() => [
654
+ 'type' => 'ct-labeled-group',
655
+ 'label' => __( 'Icon Color', 'blc' ),
656
+ 'responsive' => true,
657
+ 'choices' => [
658
+ [
659
+ 'id' => 'header_account_icon_color',
660
+ 'label' => __('Default State', 'blc'),
661
+ ],
662
+
663
+ [
664
+ 'id' => 'transparent_header_account_icon_color',
665
+ 'label' => __('Transparent State', 'blc'),
666
+ 'condition' => [
667
+ 'row' => '!offcanvas',
668
+ 'builderSettings/has_transparent_header' => 'yes',
669
+ ],
670
+ ],
671
+
672
+ [
673
+ 'id' => 'sticky_header_account_icon_color',
674
+ 'label' => __('Sticky State', 'blc'),
675
+ 'condition' => [
676
+ 'row' => '!offcanvas',
677
+ 'builderSettings/has_sticky_header' => 'yes',
678
+ ],
679
+ ],
680
+ ],
681
+ 'options' => [
682
+ 'header_account_icon_color' => [
683
+ 'label' => __( 'Icon Color', 'blc' ),
684
+ 'type' => 'ct-color-picker',
685
+ 'design' => 'block:right',
686
+ 'responsive' => true,
687
+ 'setting' => [ 'transport' => 'postMessage' ],
688
+ 'value' => [
689
+ 'default' => [
690
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
691
+ ],
692
+
693
+ 'hover' => [
694
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
695
+ ],
696
+ ],
697
+
698
+ 'pickers' => [
699
+ [
700
+ 'title' => __( 'Initial', 'blc' ),
701
+ 'id' => 'default',
702
+ 'inherit' => 'var(--color)',
703
+ ],
704
+
705
+ [
706
+ 'title' => __( 'Hover', 'blc' ),
707
+ 'id' => 'hover',
708
+ 'inherit' => 'var(--paletteColor2)',
709
+ ],
710
+ ],
711
+ ],
712
+
713
+ 'transparent_header_account_icon_color' => [
714
+ 'label' => __( 'Icon Color', 'blc' ),
715
+ 'type' => 'ct-color-picker',
716
+ 'design' => 'block:right',
717
+ 'responsive' => true,
718
+ 'setting' => [ 'transport' => 'postMessage' ],
719
+ 'value' => [
720
+ 'default' => [
721
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
722
+ ],
723
+
724
+ 'hover' => [
725
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
726
+ ],
727
+ ],
728
+
729
+ 'pickers' => [
730
+ [
731
+ 'title' => __( 'Initial', 'blc' ),
732
+ 'id' => 'default',
733
+ ],
734
+
735
+ [
736
+ 'title' => __( 'Hover', 'blc' ),
737
+ 'id' => 'hover',
738
+ ],
739
+ ],
740
+ ],
741
+
742
+ 'sticky_header_account_icon_color' => [
743
+ 'label' => __( 'Icon Color', 'blc' ),
744
+ 'type' => 'ct-color-picker',
745
+ 'design' => 'block:right',
746
+ 'responsive' => true,
747
+ 'setting' => [ 'transport' => 'postMessage' ],
748
+ 'value' => [
749
+ 'default' => [
750
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
751
+ ],
752
+
753
+ 'hover' => [
754
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
755
+ ],
756
+ ],
757
+
758
+ 'pickers' => [
759
+ [
760
+ 'title' => __( 'Initial', 'blc' ),
761
+ 'id' => 'default',
762
+ ],
763
+
764
+ [
765
+ 'title' => __( 'Hover', 'blc' ),
766
+ 'id' => 'hover',
767
+ ],
768
+ ],
769
+ ],
770
+ ],
771
+ ],
772
+
773
+ blocksy_rand_md5() => [
774
+ 'type' => 'ct-divider',
775
+ ],
776
+ ]
777
+ ],
778
+
779
+ 'accountHeaderMargin' => [
780
+ 'label' => __( 'Item Margin', 'blc' ),
781
+ 'type' => 'ct-spacing',
782
+ 'setting' => [ 'transport' => 'postMessage' ],
783
+ 'value' => blocksy_spacing_value([
784
+ 'linked' => true,
785
+ ]),
786
+ 'responsive' => true
787
+ ],
788
+
789
+ blocksy_rand_md5() => [
790
+ 'type' => 'ct-condition',
791
+ 'condition' => [
792
+ 'account_state' => 'out',
793
+ 'login_account_action' => 'modal'
794
+ ],
795
+ 'options' => [
796
+
797
+ blocksy_rand_md5() => [
798
+ 'type' => 'ct-divider',
799
+ ],
800
+
801
+ 'account_form_shadow' => [
802
+ 'label' => __( 'Form Shadow', 'blc' ),
803
+ 'type' => 'ct-box-shadow',
804
+ 'design' => 'block',
805
+ 'responsive' => true,
806
+ 'value' => blocksy_box_shadow_value([
807
+ 'enable' => true,
808
+ 'h_offset' => 0,
809
+ 'v_offset' => 0,
810
+ 'blur' => 70,
811
+ 'spread' => 0,
812
+ 'inset' => false,
813
+ 'color' => [
814
+ 'color' => 'rgba(0, 0, 0, 0.35)',
815
+ ],
816
+ ])
817
+ ],
818
+
819
+ 'accountHeaderFormBackground' => [
820
+ 'label' => __( 'Form Background', 'blc' ),
821
+ 'type' => 'ct-background',
822
+ 'design' => 'inline',
823
+ 'divider' => 'top',
824
+ 'setting' => [ 'transport' => 'postMessage' ],
825
+ 'value' => blocksy_background_default_value([
826
+ 'backgroundColor' => [
827
+ 'default' => [
828
+ 'color' => '#ffffff'
829
+ ],
830
+ ],
831
+ ])
832
+ ],
833
+
834
+ 'accountHeaderBackground' => [
835
+ 'label' => __( 'Form Backdrop', 'blc' ),
836
+ 'type' => 'ct-background',
837
+ 'design' => 'inline',
838
+ 'divider' => 'top',
839
+ 'setting' => [ 'transport' => 'postMessage' ],
840
+ 'value' => blocksy_background_default_value([
841
+ 'backgroundColor' => [
842
+ 'default' => [
843
+ 'color' => 'rgba(18, 21, 25, 0.6)'
844
+ ],
845
+ ],
846
+ ])
847
+ ],
848
+
849
+ 'account_close_button_color' => [
850
+ 'label' => __( 'Close Icon Color', 'blc' ),
851
+ 'type' => 'ct-color-picker',
852
+ 'design' => 'inline',
853
+ 'divider' => 'top',
854
+ 'setting' => [ 'transport' => 'postMessage' ],
855
+
856
+ 'value' => [
857
+ 'default' => [
858
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
859
+ ],
860
+
861
+ 'hover' => [
862
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
863
+ ],
864
+ ],
865
+
866
+ 'pickers' => [
867
+ [
868
+ 'title' => __( 'Initial', 'blc' ),
869
+ 'id' => 'default',
870
+ 'inherit' => 'rgba(255, 255, 255, 0.7)'
871
+ ],
872
+
873
+ [
874
+ 'title' => __( 'Hover', 'blc' ),
875
+ 'id' => 'hover',
876
+ 'inherit' => '#ffffff'
877
+ ],
878
+ ],
879
+ ],
880
+
881
+ 'account_close_button_shape_color' => [
882
+ 'label' => __( 'Close Icon Background', 'blc' ),
883
+ 'type' => 'ct-color-picker',
884
+ 'design' => 'inline',
885
+ 'setting' => [ 'transport' => 'postMessage' ],
886
+
887
+ 'value' => [
888
+ 'default' => [
889
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
890
+ ],
891
+
892
+ 'hover' => [
893
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
894
+ ],
895
+ ],
896
+
897
+ 'pickers' => [
898
+ [
899
+ 'title' => __( 'Initial', 'blc' ),
900
+ 'id' => 'default',
901
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
902
+ ],
903
+
904
+ [
905
+ 'title' => __( 'Hover', 'blc' ),
906
+ 'id' => 'hover',
907
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
908
+ ],
909
+ ],
910
+ ],
911
+
912
+ ],
913
+ ],
914
+
915
+ ],
916
+ ],
917
+
918
+ blocksy_rand_md5() => [
919
+ 'type' => 'ct-condition',
920
+ 'condition' => [ 'wp_customizer_current_view' => 'tablet|mobile' ],
921
+ 'options' => [
922
+
923
+ blocksy_rand_md5() => [
924
+ 'type' => 'ct-divider',
925
+ ],
926
+
927
+ 'header_account_visibility' => [
928
+ 'label' => __( 'Element Visibility', 'blocksy' ),
929
+ 'type' => 'ct-visibility',
930
+ 'design' => 'block',
931
+ 'setting' => [ 'transport' => 'postMessage' ],
932
+ 'allow_empty' => true,
933
+ 'value' => [
934
+ 'tablet' => true,
935
+ 'mobile' => true,
936
+ ],
937
+
938
+ 'choices' => blocksy_ordered_keys([
939
+ 'tablet' => __( 'Tablet', 'blocksy' ),
940
+ 'mobile' => __( 'Mobile', 'blocksy' ),
941
+ ]),
942
+ ],
943
+
944
+ ],
945
+ ],
946
+ ];
trunk/framework/features/header/items/account/sync.js ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctEvents from 'ct-events'
2
+ import {
3
+ updateAndSaveEl,
4
+ handleBackgroundOptionFor,
5
+ assembleSelector,
6
+ typographyOption,
7
+ mutateSelector,
8
+ getRootSelectorFor,
9
+ responsiveClassesFor,
10
+ } from 'blocksy-customizer-sync'
11
+ import { markImagesAsLoaded } from 'blocksy-frontend'
12
+
13
+ ctEvents.on(
14
+ 'ct:header:sync:collect-variable-descriptors',
15
+ (variableDescriptors) => {
16
+ variableDescriptors['account'] = ({ itemId }) => {
17
+ return {
18
+ accountHeaderIconSize: {
19
+ selector: assembleSelector(
20
+ mutateSelector({
21
+ selector: getRootSelectorFor({ itemId }),
22
+ operation: 'el-suffix',
23
+ to_add: '[data-state="out"]',
24
+ })
25
+ ),
26
+ variable: 'icon-size',
27
+ responsive: true,
28
+ unit: 'px',
29
+ },
30
+
31
+ account_loggedin_icon_size: {
32
+ selector: assembleSelector(
33
+ mutateSelector({
34
+ selector: getRootSelectorFor({ itemId }),
35
+ operation: 'el-suffix',
36
+ to_add: '[data-state="in"]',
37
+ })
38
+ ),
39
+ variable: 'icon-size',
40
+ responsive: true,
41
+ unit: 'px',
42
+ },
43
+
44
+ accountHeaderAvatarSize: {
45
+ selector: assembleSelector(getRootSelectorFor({ itemId })),
46
+ variable: 'avatar-size',
47
+ responsive: true,
48
+ unit: 'px',
49
+ },
50
+
51
+ ...handleBackgroundOptionFor({
52
+ id: 'accountHeaderFormBackground',
53
+ selector: assembleSelector(
54
+ mutateSelector({
55
+ selector: [getRootSelectorFor({ itemId })[0]],
56
+ operation: 'suffix',
57
+ to_add: '#account-modal .ct-account-form',
58
+ })
59
+ ),
60
+ }),
61
+
62
+ ...handleBackgroundOptionFor({
63
+ id: 'accountHeaderBackground',
64
+ selector: assembleSelector(
65
+ mutateSelector({
66
+ selector: [getRootSelectorFor({ itemId })[0]],
67
+ operation: 'suffix',
68
+ to_add: '#account-modal',
69
+ })
70
+ ),
71
+ }),
72
+
73
+ account_form_shadow: {
74
+ selector: assembleSelector(
75
+ mutateSelector({
76
+ selector: [getRootSelectorFor({ itemId })[0]],
77
+ operation: 'suffix',
78
+ to_add: '#account-modal .ct-account-form',
79
+ })
80
+ ),
81
+ type: 'box-shadow',
82
+ variable: 'box-shadow',
83
+ responsive: true,
84
+ },
85
+
86
+ accountHeaderMargin: {
87
+ selector: assembleSelector(getRootSelectorFor({ itemId })),
88
+ type: 'spacing',
89
+ variable: 'margin',
90
+ responsive: true,
91
+ important: true,
92
+ },
93
+
94
+ ...typographyOption({
95
+ id: 'account_label_font',
96
+ selector: assembleSelector(
97
+ mutateSelector({
98
+ selector: getRootSelectorFor({ itemId }),
99
+ operation: 'suffix',
100
+ to_add: '.ct-label',
101
+ })
102
+ ),
103
+ }),
104
+
105
+ // default state
106
+ accountHeaderColor: [
107
+ {
108
+ selector: assembleSelector(
109
+ getRootSelectorFor({ itemId })
110
+ ),
111
+ variable: 'linkInitialColor',
112
+ type: 'color:default',
113
+ responsive: true,
114
+ },
115
+
116
+ {
117
+ selector: assembleSelector(
118
+ getRootSelectorFor({ itemId })
119
+ ),
120
+ variable: 'linkHoverColor',
121
+ type: 'color:hover',
122
+ responsive: true,
123
+ },
124
+ ],
125
+
126
+ header_account_icon_color: [
127
+ {
128
+ selector: assembleSelector(
129
+ getRootSelectorFor({ itemId })
130
+ ),
131
+ variable: 'icon-color',
132
+ type: 'color:default',
133
+ responsive: true,
134
+ },
135
+
136
+ {
137
+ selector: assembleSelector(
138
+ getRootSelectorFor({ itemId })
139
+ ),
140
+ variable: 'icon-hover-color',
141
+ type: 'color:hover',
142
+ responsive: true,
143
+ },
144
+ ],
145
+
146
+ // transparent state
147
+ transparentAccountHeaderColor: [
148
+ {
149
+ selector: assembleSelector(
150
+ mutateSelector({
151
+ selector: getRootSelectorFor({ itemId }),
152
+ operation: 'between',
153
+ to_add: '[data-transparent-row="yes"]',
154
+ })
155
+ ),
156
+
157
+ variable: 'linkInitialColor',
158
+ type: 'color:default',
159
+ responsive: true,
160
+ },
161
+
162
+ {
163
+ selector: assembleSelector(
164
+ mutateSelector({
165
+ selector: getRootSelectorFor({ itemId }),
166
+ operation: 'between',
167
+ to_add: '[data-transparent-row="yes"]',
168
+ })
169
+ ),
170
+
171
+ variable: 'linkHoverColor',
172
+ type: 'color:hover',
173
+ responsive: true,
174
+ },
175
+ ],
176
+
177
+ transparent_header_account_icon_color: [
178
+ {
179
+ selector: assembleSelector(
180
+ mutateSelector({
181
+ selector: getRootSelectorFor({ itemId }),
182
+ operation: 'between',
183
+ to_add: '[data-transparent-row="yes"]',
184
+ })
185
+ ),
186
+ variable: 'icon-color',
187
+ type: 'color:default',
188
+ responsive: true,
189
+ },
190
+
191
+ {
192
+ selector: assembleSelector(
193
+ mutateSelector({
194
+ selector: getRootSelectorFor({ itemId }),
195
+ operation: 'between',
196
+ to_add: '[data-transparent-row="yes"]',
197
+ })
198
+ ),
199
+ variable: 'icon-hover-color',
200
+ type: 'color:hover',
201
+ responsive: true,
202
+ },
203
+ ],
204
+
205
+ // sticky state
206
+ stickyAccountHeaderColor: [
207
+ {
208
+ selector: assembleSelector(
209
+ mutateSelector({
210
+ selector: getRootSelectorFor({ itemId }),
211
+ operation: 'between',
212
+ to_add: '[data-sticky*="yes"]',
213
+ })
214
+ ),
215
+ variable: 'linkInitialColor',
216
+ type: 'color:default',
217
+ responsive: true,
218
+ },
219
+
220
+ {
221
+ selector: assembleSelector(
222
+ mutateSelector({
223
+ selector: getRootSelectorFor({ itemId }),
224
+ operation: 'between',
225
+ to_add: '[data-sticky*="yes"]',
226
+ })
227
+ ),
228
+ variable: 'linkHoverColor',
229
+ type: 'color:hover',
230
+ responsive: true,
231
+ },
232
+ ],
233
+
234
+ sticky_header_account_icon_color: [
235
+ {
236
+ selector: assembleSelector(
237
+ mutateSelector({
238
+ selector: getRootSelectorFor({ itemId }),
239
+ operation: 'between',
240
+ to_add: '[data-sticky*="yes"]',
241
+ })
242
+ ),
243
+ variable: 'icon-color',
244
+ type: 'color:default',
245
+ responsive: true,
246
+ },
247
+
248
+ {
249
+ selector: assembleSelector(
250
+ mutateSelector({
251
+ selector: getRootSelectorFor({ itemId }),
252
+ operation: 'between',
253
+ to_add: '[data-sticky*="yes"]',
254
+ })
255
+ ),
256
+ variable: 'icon-hover-color',
257
+ type: 'color:hover',
258
+ responsive: true,
259
+ },
260
+ ],
261
+ }
262
+ }
263
+ }
264
+ )
265
+
266
+ ctEvents.on('ct:header:sync:item:account', ({ optionId, optionValue }) => {
267
+ const selector = '[data-id="account"]'
268
+
269
+ if (optionId === 'header_account_visibility') {
270
+ updateAndSaveEl(selector, (el) =>
271
+ responsiveClassesFor({ ...optionValue, desktop: true }, el)
272
+ )
273
+ }
274
+
275
+ if (
276
+ optionId === 'loggedin_account_label_visibility' ||
277
+ optionId === 'loggedout_account_label_visibility'
278
+ ) {
279
+ updateAndSaveEl(selector, (el) => {
280
+ ;[...el.querySelectorAll('.ct-label')].map((label) => {
281
+ responsiveClassesFor(optionValue, label)
282
+ })
283
+ })
284
+ }
285
+
286
+ if (optionId === 'loggedin_label') {
287
+ updateAndSaveEl(selector, (el) => {
288
+ ;[...el.querySelectorAll('.ct-label')].map((label) => {
289
+ label.innerHTML = optionValue
290
+ })
291
+ })
292
+ }
293
+
294
+ if (optionId === 'login_label') {
295
+ updateAndSaveEl(selector, (el) => {
296
+ ;[...el.querySelectorAll('.ct-label')].map((label) => {
297
+ label.innerHTML = optionValue
298
+ })
299
+ })
300
+ }
301
+
302
+ if (
303
+ optionId === 'loggedout_label_position' ||
304
+ optionId === 'loggedin_label_position'
305
+ ) {
306
+ updateAndSaveEl(
307
+ selector,
308
+ (el) => {
309
+ if (!optionValue.desktop) {
310
+ optionValue = {
311
+ desktop: optionValue,
312
+ mobile: optionValue,
313
+ }
314
+ }
315
+
316
+ el.dataset.label = optionValue.desktop
317
+ },
318
+ { onlyView: 'desktop' }
319
+ )
320
+
321
+ updateAndSaveEl(
322
+ selector,
323
+ (el) => {
324
+ if (!optionValue.desktop) {
325
+ optionValue = {
326
+ desktop: optionValue,
327
+ mobile: optionValue,
328
+ }
329
+ }
330
+
331
+ el.dataset.label = optionValue.mobile
332
+ },
333
+ { onlyView: 'mobile' }
334
+ )
335
+ }
336
+ })
trunk/framework/features/header/items/account/view.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (! isset($device)) {
4
+ $device = 'desktop';
5
+ }
6
+
7
+ $current_user_id = get_current_user_id();
8
+
9
+ if (is_customize_preview()) {
10
+ if (blocksy_akg('account_state', $atts, 'in') === 'out') {
11
+ $current_user_id = null;
12
+ }
13
+ }
14
+
15
+ $icon = apply_filters('blocksy:header:account:icons', [
16
+ 'type-1' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M7.5 0C3.4 0 0 3.4 0 7.5S3.4 15 7.5 15 15 11.6 15 7.5 11.6 0 7.5 0zm0 1.5c3.3 0 6 2.7 6 6 0 1.2-.4 2.4-1 3.2l-.6-.5C10.8 9.4 8.6 9 7.5 9s-3.3.4-4.4 1.2l-.6.5c-.6-.9-1-2-1-3.2 0-3.3 2.7-6 6-6zm0 1.4C6.1 2.9 5.1 4 5.1 5.3s1.1 2.5 2.4 2.5 2.4-1.1 2.4-2.5-1-2.4-2.4-2.4zm0 1.3c.5 0 .9.4.9.9 0 .6-.5.9-.9.9s-.9-.3-.9-.8.4-1 .9-1zm0 6.3c2.4 0 3.6.9 4.1 1.4-1 1-2.5 1.6-4.1 1.6s-3.1-.6-4.1-1.6c.5-.5 1.7-1.4 4.1-1.4zm-4.4 1c0 .1.1.2.3.3-.2-.1-.3-.2-.3-.3zm8.8 0c-.1 0-.1.1-.2.3.1-.1.2-.2.2-.3z"/></svg>',
17
+
18
+ 'type-2' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M6.2 0C3.8 0 1.6 2 1.7 4.5v3.1c-.4.3-.7.8-.7 1.5 0 .8.4 1.4.9 1.7.3.2.3.1.5.2 1 2 2.9 3.7 5 4h.2c2.1-.3 4-2 5-4 .1 0 .2 0 .4-.1.5-.3 1-.9 1-1.8 0-.8-.4-1.4-.9-1.7-.2-.1-.2-.1-.4-.1V3.9c0-1.4-1.1-2.6-2.6-2.6h-.7S8.8 0 6.2 0zm1.6 5.2h1.6c1 0 1.9.8 1.9 1.9v1.4h.7s.1 0 .3.1c.1.1.2.1.2.5s-.1.4-.2.5c-.1.1-.3.1-.3.1h-.4l-.1.3c-.7 1.7-2.4 3.2-4.1 3.5-1.6-.2-3.3-1.7-4.1-3.5v-.2h-.4s-.1 0-.3-.1c-.2-.1-.3-.2-.3-.6 0-.4.1-.4.2-.5.1-.1.3-.1.3-.1h.7v-2h1.9c1.1 0 2-.5 2.4-1.3z"/></svg>',
19
+
20
+ 'type-3' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M14.3 12.8v1.5c0 .4-.3.7-.7.7-.4 0-.7-.3-.7-.7v-1.5c0-1.3-1-2.4-2.4-2.4h-6c-1.3 0-2.4 1-2.4 2.4v1.5c0 .4-.3.7-.7.7s-.7-.3-.7-.7v-1.5c0-2 1.6-3.7 3.7-3.7h6.1c2.1 0 3.8 1.6 3.8 3.7zM3.8 3.7C3.8 1.6 5.5 0 7.5 0s3.7 1.6 3.7 3.7-1.6 3.7-3.7 3.7-3.7-1.6-3.7-3.7zm1.4 0C5.2 5 6.2 6 7.5 6s2.4-1 2.4-2.3-1-2.4-2.4-2.4-2.3 1.1-2.3 2.4z"/></svg>',
21
+
22
+ 'type-4' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M7.5 0C3.4 0 0 3.4 0 7.5S3.4 15 7.5 15 15 11.6 15 7.5 11.6 0 7.5 0zm0 2.1c1.4 0 2.5 1.1 2.5 2.4S8.9 7 7.5 7 5 5.9 5 4.5s1.1-2.4 2.5-2.4zm0 11.4c-2.1 0-3.9-1-5-2.6C3.4 9.6 6 9 7.5 9s4.1.6 5 1.9c-1.1 1.6-2.9 2.6-5 2.6z"/></svg>',
23
+
24
+ 'type-5' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M7.5 0C3.4 0 0 3.4 0 7.5S3.4 15 7.5 15 15 11.6 15 7.5 11.6 0 7.5 0zm0 1.2c3.5 0 6.3 2.8 6.3 6.3 0 1.6-.6 3.1-1.7 4.3-.4-.8-1.7-1.4-3.1-1.7 0 0-.6-.2-.4-.8.6-.6.8-1.2.8-1.3 0 0 .6-.5.6-1.2.1-.6-.1-.7-.1-.7.2-.8.3-3.6-1.5-3.2-.3-.6-2.2-1-3 .5-.4.8-.6 1.9-.2 2.7 0 0-.1-.1-.2.3 0 .4.2 1 .4 1.2.1.1.2.2.3.2 0 0 .1.7.6 1.3.1.6-.4.9-.4.9-1.4.3-2.7.9-3.1 1.7-1-1.1-1.6-2.6-1.6-4.2C1.2 4 4 1.2 7.5 1.2z"/></svg>',
25
+
26
+ 'type-6' => '<svg class="ct-icon" width="15" height="15" viewBox="0 0 15 15"><path d="M14.1 4.9L7.9.1c-.2-.1-.6-.1-.8 0L.9 4.9c-.1.1-.2.3-.2.5V13c0 1.1.9 2 2 2h9.6c1.1 0 2-.9 2-2V5.5c0-.2-.1-.4-.2-.6zm-5.2 8.7H6.1V8.2h2.8v5.4zm4.1-.7c0 .4-.3.7-.7.7h-2V7.5c0-.4-.3-.7-.7-.7H5.4c-.4 0-.7.3-.7.7v6.1h-2c-.4 0-.7-.3-.7-.7V5.8l5.6-4.2L13 5.8v7.1z"/></svg>',
27
+ ]);
28
+
29
+ $path = 'login';
30
+
31
+ if (! $current_user_id) {
32
+ $path = 'logout';
33
+ }
34
+
35
+ $attr['class'] = trim('ct-header-account ' . blocksy_visibility_classes(
36
+ blocksy_default_akg(
37
+ 'header_account_visibility',
38
+ $atts,
39
+ [
40
+ 'tablet' => true,
41
+ 'mobile' => true,
42
+ ]
43
+ )
44
+ ));
45
+
46
+ echo blocksy_render_view(
47
+ dirname(__FILE__) . '/views/' . $path . '.php',
48
+ [
49
+ 'atts' => $atts,
50
+ 'attr' => $attr,
51
+ 'icon' => $icon,
52
+ 'device' => $device,
53
+ 'current_user_id' => $current_user_id
54
+ ]
55
+ );
56
+
trunk/framework/features/header/items/account/views/login.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $loggedin_account_label_visibility = blocksy_akg(
4
+ 'loggedin_account_label_visibility',
5
+ $atts,
6
+ [
7
+ 'desktop' => true,
8
+ 'tablet' => true,
9
+ 'mobile' => true,
10
+ ]
11
+ );
12
+
13
+ // Logged in
14
+ $link = get_edit_profile_url();
15
+ $account_link = blocksy_akg('account_link', $atts, 'profile');
16
+
17
+ if ($account_link === 'dashboard') {
18
+ $link = admin_url();
19
+ }
20
+
21
+ if ($account_link === 'logout') {
22
+ $link = wp_logout_url(blocksy_current_url());
23
+ }
24
+
25
+ if ($account_link === 'custom') {
26
+ $link = blocksy_akg('account_custom_page', $atts, '');
27
+ }
28
+
29
+ // Media
30
+ $media_html = '';
31
+ $loggedin_media = blocksy_akg('loggedin_media', $atts, 'avatar');
32
+
33
+ if ($loggedin_media === 'avatar') {
34
+ $avatar_size = intval(
35
+ blocksy_expand_responsive_value(
36
+ blocksy_akg('accountHeaderAvatarSize', $atts, 18)
37
+ )['desktop']
38
+ );
39
+
40
+ $media_html = blocksy_simple_image(
41
+ get_avatar_url(
42
+ $current_user_id,
43
+ [
44
+ 'size' => $avatar_size * 2
45
+ ]
46
+ ),
47
+ [
48
+ 'img_atts' => [
49
+ 'width' => $avatar_size,
50
+ 'height' => $avatar_size
51
+ ]
52
+ ]
53
+ );
54
+ }
55
+
56
+ if ($loggedin_media === 'icon') {
57
+ $media_html = $icon[
58
+ blocksy_akg('account_loggedin_icon', $atts, 'type-1')
59
+ ];
60
+ }
61
+
62
+ // Label
63
+ $loggedin_label = blocksy_akg('loggedin_label', $atts, __('My Account', 'blc'));
64
+
65
+ if (blocksy_akg('loggedin_text', $atts, 'label') === 'username') {
66
+ $user = wp_get_current_user();
67
+ $loggedin_label = $user->display_name;
68
+ }
69
+
70
+ $loggedin_label_position = blocksy_expand_responsive_value(
71
+ blocksy_akg('loggedin_label_position', $atts, 'right')
72
+ );
73
+
74
+ $attr['data-state'] = 'in';
75
+
76
+ if (! empty($media_html)) {
77
+ $attr['data-label'] = $loggedin_label_position[$device];
78
+ }
79
+
80
+ $attr['href'] = $link;
81
+ $attr['aria-label'] = $loggedin_label;
82
+
83
+ echo '<a ' . blocksy_attr_to_html($attr) . '>';
84
+
85
+ if (! empty($loggedin_label) && blocksy_some_device(
86
+ $loggedin_account_label_visibility
87
+ )) {
88
+ echo '<span class="' . trim('ct-label ' . blocksy_visibility_classes(
89
+ $loggedin_account_label_visibility
90
+ )) . '">';
91
+ echo $loggedin_label;
92
+ echo '</span>';
93
+ }
94
+
95
+ echo $media_html;
96
+
97
+ echo '</a>';
trunk/framework/features/header/items/account/views/logout.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $loggedout_account_label_visibility = blocksy_akg(
4
+ 'loggedout_account_label_visibility',
5
+ $atts,
6
+ [
7
+ 'desktop' => true,
8
+ 'tablet' => true,
9
+ 'mobile' => true,
10
+ ]
11
+ );
12
+
13
+ $link = '#account-modal';
14
+
15
+ if (blocksy_akg('login_account_action', $atts, 'modal') === 'custom') {
16
+ $link = blocksy_akg('loggedout_account_custom_page', $atts, '');
17
+ }
18
+
19
+ $loggedout_label_position = blocksy_expand_responsive_value(
20
+ blocksy_akg('loggedout_label_position', $atts, 'right')
21
+ );
22
+
23
+ $attr['data-state'] = 'out';
24
+
25
+ if (blocksy_akg('logged_out_style', $atts, 'icon') !== 'none') {
26
+ $attr['data-label'] = $loggedout_label_position[$device];
27
+ }
28
+
29
+ $attr['href'] = $link;
30
+
31
+ echo '<a ' . blocksy_attr_to_html($attr) . '>';
32
+
33
+ if (
34
+ blocksy_some_device($loggedout_account_label_visibility)
35
+ ||
36
+ is_customize_preview()
37
+ ) {
38
+ echo '<span class="' . trim('ct-label ' . blocksy_visibility_classes(
39
+ $loggedout_account_label_visibility
40
+ )) . '">';
41
+
42
+ echo blocksy_akg('login_label', $atts, __('Login', 'blc'));
43
+
44
+ echo '</span>';
45
+ }
46
+
47
+ if (blocksy_akg('logged_out_style', $atts, 'icon') === 'icon') {
48
+ echo $icon[
49
+ blocksy_default_akg('accountHeaderIcon', $atts, 'type-1')
50
+ ];
51
+ }
52
+
53
+ echo '</a>';
trunk/framework/features/opengraph-meta-data.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class OpenGraphMetaData {
6
+ public function __construct() {
7
+ add_filter(
8
+ 'blocksy_engagement_general_end_customizer_options',
9
+ function ($opts) {
10
+
11
+ $opts[] = [
12
+ blocksy_rand_md5() => [
13
+ 'type' => 'ct-divider',
14
+ ],
15
+
16
+ 'enable_opengraph' => [
17
+ 'label' => __( 'Opengraph Meta Data', 'blc' ),
18
+ 'type' => 'ct-switch',
19
+ 'value' => 'no',
20
+ 'desc' => __( 'Display a preview image and text excerpt when a link to your site is shared.', 'blc' ),
21
+ ],
22
+
23
+ blocksy_rand_md5() => [
24
+ 'type' => 'ct-condition',
25
+ 'condition' => [ 'enable_opengraph' => 'yes' ],
26
+ 'options' => [
27
+
28
+ 'opengraph_facebook_page_url' => [
29
+ 'label' => __( 'Facebook Page URL', 'blc' ),
30
+ 'type' => 'text',
31
+ 'design' => 'inline',
32
+ 'value' => ''
33
+ ],
34
+
35
+ 'opengraph_facebook_app_id' => [
36
+ 'label' => __( 'Facebook App ID', 'blc' ),
37
+ 'type' => 'text',
38
+ 'design' => 'inline',
39
+ 'value' => ''
40
+ ],
41
+
42
+ 'opengraph_twitter_username' => [
43
+ 'label' => __( 'Twitter Username', 'blc' ),
44
+ 'type' => 'text',
45
+ 'design' => 'inline',
46
+ 'value' => ''
47
+ ],
48
+
49
+ ],
50
+ ],
51
+ ];
52
+
53
+ return $opts;
54
+ }
55
+ );
56
+
57
+ add_action('wp_head', array($this, 'output_meta_tags'), 1 );
58
+ }
59
+
60
+ public function output_meta_tags() {
61
+ if (defined('WPSEO_VERSION')) {
62
+ return;
63
+ }
64
+
65
+ if (defined('RANK_MATH_FILE')) {
66
+ return;
67
+ }
68
+
69
+ if (get_theme_mod('enable_opengraph', 'no') !== 'yes') {
70
+ return;
71
+ }
72
+
73
+ $facebook_url = get_theme_mod('opengraph_facebook_page_url', '');
74
+
75
+ add_filter('jetpack_disable_twitter_cards', '__return_true', 999999);
76
+ add_filter('jetpack_enable_open_graph', '__return_false', 999999);
77
+ add_filter('jetpack_enable_opengraph', '__return_false', 999999);
78
+
79
+ // Type
80
+ if (is_front_page() || is_home()) {
81
+ $type = 'website';
82
+ } else if (is_singular()) {
83
+ $type = 'article';
84
+ } else {
85
+ $type = 'object';
86
+ }
87
+
88
+ if (is_singular()) {
89
+ $title = get_the_title();
90
+ } else {
91
+ $title = get_the_archive_title();
92
+ }
93
+
94
+ // Description
95
+ if (is_category() || is_tag() || is_tax()) {
96
+ $description = wp_strip_all_tags(term_description());
97
+ } else if (is_singular()) {
98
+ $description = wp_strip_all_tags(blocksy_entry_excerpt(40));
99
+ }
100
+
101
+ // Image
102
+ $image = '';
103
+ $has_img = false;
104
+
105
+ if (function_exists('is_product_category') && is_product_category()) {
106
+ global $wp_query;
107
+
108
+ $cat = $wp_query->get_queried_object();
109
+ $thumbnail_id = get_term_meta($cat->term_id, 'thumbnail_id', true);
110
+ $get_image = wp_get_attachment_url($thumbnail_id);
111
+
112
+ if ($get_image) {
113
+ $image = $get_image;
114
+ $has_img = true;
115
+ }
116
+ } else if (is_singular()) {
117
+ $get_image = wp_get_attachment_image_src(
118
+ get_post_thumbnail_id(get_the_ID()),
119
+ 'full'
120
+ );
121
+
122
+ if ($get_image) {
123
+ $image = $get_image[0];
124
+ }
125
+ $has_img = true;
126
+ }
127
+
128
+ // Post author
129
+ if ($facebook_url) {
130
+ $author = $facebook_url;
131
+ }
132
+
133
+ // Facebook publisher URL
134
+ if (! empty($facebook_url)) {
135
+ $publisher = $facebook_url;
136
+ }
137
+
138
+ $fb_app_id = get_theme_mod('opengraph_facebook_app_id', '');
139
+
140
+ $twitter_handle = '@' . str_replace('@', '', get_theme_mod('opengraph_twitter_username'));
141
+
142
+ $output = $this->get_open_graph_tag('property', 'og:type', trim($type));
143
+ $output .= $this->get_open_graph_tag('property', 'og:title', trim($title));
144
+
145
+ if (isset($description) && ! empty($description)) {
146
+ $output .= $this->get_open_graph_tag('property', 'og:description', trim($description));
147
+ }
148
+
149
+ if ($has_img && $get_image) {
150
+ $output .= $this->get_open_graph_tag('property', 'og:image', trim($image));
151
+ $output .= $this->get_open_graph_tag('property', 'og:image:width', absint($get_image[1]));
152
+ $output .= $this->get_open_graph_tag('property', 'og:image:height', absint($get_image[2]));
153
+ }
154
+
155
+ $output .= $this->get_open_graph_tag('property', 'og:url', trim(get_permalink()));
156
+ $output .= $this->get_open_graph_tag('property', 'og:site_name', trim(get_bloginfo('name')));
157
+
158
+ if (is_singular() && ! is_front_page()) {
159
+ if (isset($author) && !empty($author)) {
160
+ $output .= $this->get_open_graph_tag('property', 'article:author', trim($author));
161
+ }
162
+
163
+ if (is_singular('post')) {
164
+ $output .= $this->get_open_graph_tag('property', 'article:published_time', trim(get_post_time('c')));
165
+ $output .= $this->get_open_graph_tag('property', 'article:modified_time', trim(get_post_modified_time('c')));
166
+ $output .= $this->get_open_graph_tag('property', 'og:updated_time', trim(get_post_modified_time('c')));
167
+ }
168
+ }
169
+
170
+ if (is_singular()) {
171
+ $tags = get_the_tags();
172
+
173
+ if (! is_wp_error($tags) && (is_array($tags) && $tags !== [])) {
174
+ foreach ($tags as $tag) {
175
+ $output .= $this->get_open_graph_tag('property', 'article:tag', trim($tag->name));
176
+ }
177
+ }
178
+
179
+ $terms = get_the_category();
180
+
181
+ if (! is_wp_error($terms) && (is_array($terms) && $terms !== array())) {
182
+ // We can only show one section here, so we take the first one.
183
+ $output .= $this->get_open_graph_tag('property', 'article:section', trim($terms[0]->name));
184
+ }
185
+ }
186
+
187
+ if (isset($publisher) && ! empty($publisher)) {
188
+ $output .= $this->get_open_graph_tag('property', 'article:publisher', trim($publisher));
189
+ }
190
+
191
+ if (isset($fb_app_id) && ! empty($fb_app_id)) {
192
+ $output .= $this->get_open_graph_tag('property', 'fb:app_id', trim($fb_app_id));
193
+ }
194
+
195
+ // Twitter
196
+ $output .= $this->get_open_graph_tag('name', 'twitter:title', trim($title));
197
+
198
+ if (isset($description) && !empty($description)) {
199
+ $output .= $this->get_open_graph_tag('name', 'twitter:description', trim($description));
200
+ }
201
+
202
+ if ($has_img) {
203
+ $output .= $this->get_open_graph_tag('name', 'twitter:card', 'summary_large_image');
204
+ $output .= $this->get_open_graph_tag('name', 'twitter:image', trim($image));
205
+ }
206
+
207
+ if (isset($twitter_handle) && ! empty($twitter_handle) && strlen($twitter_handle) > 1) {
208
+ $output .= $this->get_open_graph_tag('name', 'twitter:site', trim($twitter_handle));
209
+ $output .= $this->get_open_graph_tag('name', 'twitter:creator', trim($twitter_handle));
210
+ }
211
+
212
+ echo $output;
213
+ }
214
+
215
+ private function get_open_graph_tag($attr, $property, $content) {
216
+ return blocksy_html_tag(
217
+ 'meta',
218
+ [
219
+ $attr => $property,
220
+ 'content' => $content
221
+ ]
222
+ ) . "\n";
223
+ }
224
+ }
trunk/framework/helpers/blocksy-integration.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_call_fn($args = [], ...$params) {
4
+ $args = wp_parse_args(
5
+ $args,
6
+ [
7
+ 'fn' => null,
8
+
9
+ // string | null | array
10
+ 'default' => ''
11
+ ]
12
+ );
13
+
14
+ if (! $args['fn']) {
15
+ throw new Error('$fn must be specified!');
16
+ }
17
+
18
+ if (! function_exists($args['fn'])) {
19
+ return $args['default'];
20
+ }
21
+
22
+ return call_user_func($args['fn'], ...$params);
23
+ }
24
+
25
+ /**
26
+ * Recursively find a key's value in array
27
+ *
28
+ * @param string $keys 'a/b/c' path.
29
+ * @param array|object $array_or_object array to extract from.
30
+ * @param null|mixed $default_value defualt value.
31
+ *
32
+ * @return null|mixed
33
+ */
34
+ if (! function_exists('blocksy_akg')) {
35
+ function blocksy_akg($keys, $array_or_object, $default_value = null) {
36
+ if (! is_array($keys)) {
37
+ $keys = explode('/', (string) $keys);
38
+ }
39
+
40
+ $array_or_object = $array_or_object;
41
+ $key_or_property = array_shift($keys);
42
+
43
+ if (is_null($key_or_property)) {
44
+ return $default_value;
45
+ }
46
+
47
+ $is_object = is_object($array_or_object);
48
+
49
+ if ($is_object) {
50
+ if (! property_exists($array_or_object, $key_or_property)) {
51
+ return $default_value;
52
+ }
53
+ } else {
54
+ if (! is_array($array_or_object) || ! array_key_exists($key_or_property, $array_or_object)) {
55
+ return $default_value;
56
+ }
57
+ }
58
+
59
+ if (isset($keys[0])) { // not used count() for performance reasons.
60
+ if ($is_object) {
61
+ return blocksy_akg($keys, $array_or_object->{$key_or_property}, $default_value);
62
+ } else {
63
+ return blocksy_akg($keys, $array_or_object[$key_or_property], $default_value);
64
+ }
65
+ } else {
66
+ if ($is_object) {
67
+ return $array_or_object->{$key_or_property};
68
+ } else {
69
+ return $array_or_object[ $key_or_property ];
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Generate a random ID.
77
+ */
78
+ if (! function_exists('blocksy_rand_md5')) {
79
+ function blocksy_rand_md5() {
80
+ return md5(time() . '-' . uniqid(wp_rand(), true) . '-' . wp_rand());
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Transform key-value pairs into ordered arrays.
86
+ *
87
+ * @param array $choices key-value pairs.
88
+ */
89
+ if (! function_exists('blocksy_ordered_keys')) {
90
+ function blocksy_ordered_keys($choices, $args = []) {
91
+ if (isset($choices[0])) {
92
+ return $choices;
93
+ }
94
+
95
+ $args = wp_parse_args(
96
+ $args,
97
+ [
98
+ 'additional' => []
99
+ ]
100
+ );
101
+
102
+ $result = [];
103
+
104
+ foreach ($choices as $key => $val) {
105
+ $result[] = array_merge([
106
+ 'key' => $key,
107
+ 'value' => $val,
108
+ ], $args['additional']);
109
+ }
110
+
111
+ return $result;
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Extract a key from an array with defaults.
117
+ *
118
+ * @param string $keys 'a/b/c' path.
119
+ * @param array|object $array_or_object array to extract from.
120
+ * @param null|mixed $default_value defualt value.
121
+ */
122
+ if (! function_exists('blocksy_default_akg')) {
123
+ function blocksy_default_akg($keys, $array_or_object, $default_value) {
124
+ return blocksy_akg($keys, $array_or_object, $default_value);
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Generate html tag
130
+ *
131
+ * @param string $tag Tag name.
132
+ * @param array $attr Tag attributes.
133
+ * @param bool|string $end Append closing tag. Also accepts body content.
134
+ *
135
+ * @return string The tag's html
136
+ */
137
+ if (! function_exists('blocksy_html_tag')) {
138
+ function blocksy_html_tag($tag, $attr = [], $end = false) {
139
+ $html = '<' . $tag . ' ' . blocksy_attr_to_html($attr);
140
+
141
+ if (true === $end) {
142
+ // <script></script>
143
+ $html .= '></' . $tag . '>';
144
+ } elseif (false === $end) {
145
+ // <br/>
146
+ $html .= '/>';
147
+ } else {
148
+ // <div>content</div>
149
+ $html .= '>' . $end . '</' . $tag . '>';
150
+ }
151
+
152
+ return $html;
153
+ }
154
+ }
155
+
156
+ /**
157
+ * Generate attributes string for html tag
158
+ *
159
+ * @param array $attr_array array('href' => '/', 'title' => 'Test').
160
+ *
161
+ * @return string 'href="/" title="Test"'
162
+ */
163
+ if (! function_exists('blocksy_attr_to_html')) {
164
+ function blocksy_attr_to_html(array $attr_array) {
165
+ $html_attr = '';
166
+
167
+ foreach ($attr_array as $attr_name => $attr_val) {
168
+ if (false === $attr_val) {
169
+ continue;
170
+ }
171
+
172
+ $html_attr .= $attr_name . '="' . htmlspecialchars($attr_val) . '" ';
173
+ }
174
+
175
+ return $html_attr;
176
+ }
177
+ }
trunk/framework/helpers/helpers.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_get_ext($id) {
4
+ return \Blocksy\Plugin::instance()->extensions->get($id);
5
+ }
6
+
7
+ function blc_get_contacts_output($args = []) {
8
+ $args = wp_parse_args($args, [
9
+ 'data' => [],
10
+ 'link_target' => 'no',
11
+ 'type' => 'rounded',
12
+ 'fill' => 'outline',
13
+ 'size' => ''
14
+ ]);
15
+
16
+ $has_enabled_layer = false;
17
+
18
+ foreach ($args['data'] as $single_layer) {
19
+ if ($single_layer['enabled']) {
20
+ $has_enabled_layer = true;
21
+ break;
22
+ }
23
+ }
24
+
25
+ if (! $has_enabled_layer) {
26
+ return '';
27
+ }
28
+
29
+ $data_target = '';
30
+
31
+ if ($args['link_target'] !== 'no') {
32
+ $data_target = 'target="_blank"';
33
+ }
34
+
35
+ $svgs = [
36
+ 'address' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C6.1,0,3,3.1,3,7c0,4.5,6,11.8,6.2,12.1L10,20l0.8-0.9C11,18.8,17,11.5,17,7C17,3.1,13.9,0,10,0z M10,2c2.8,0,5,2.2,5,5c0,2.7-3.1,7.4-5,9.8C8.1,14.4,5,9.7,5,7C5,4.2,7.2,2,10,2zM10,4.5C8.6,4.5,7.5,5.6,7.5,7S8.6,9.5,10,9.5s2.5-1.1,2.5-2.5S11.4,4.5,10,4.5z"/></svg>',
37
+
38
+ 'phone' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M4.4,0C4,0,3.6,0.2,3.2,0.4l0,0l0,0L0.8,2.9l0,0C0,3.6-0.2,4.7,0.1,5.6c0,0,0,0,0,0c0.7,1.9,2.3,5.5,5.6,8.7c3.3,3.3,6.9,4.9,8.7,5.6h0c0.9,0.3,1.9,0.1,2.7-0.5l2.4-2.4c0.6-0.6,0.6-1.7,0-2.4l-3.1-3.1l0,0c-0.6-0.6-1.8-0.6-2.4,0l-1.5,1.5c-0.6-0.3-1.9-1-3.1-2.2C8,9.5,7.4,8.2,7.2,7.6l1.5-1.5c0.6-0.6,0.7-1.7,0-2.4l0,0L8.6,3.6L5.6,0.5l0,0l0,0C5.2,0.2,4.8,0,4.4,0zM4.4,1.5c0.1,0,0.1,0,0.2,0.1l3.1,3.1l0.1,0.1c0,0,0,0.1,0,0.2L5.7,6.9L5.3,7.3l0.2,0.5c0,0,0.9,2.4,2.7,4.1L8.4,12c1.8,1.6,3.9,2.5,3.9,2.5l0.5,0.2l2.3-2.3c0.1-0.1,0.1-0.1,0.2,0l3.1,3.1c0.1,0.1,0.1,0.1,0,0.2l-2.4,2.4c-0.4,0.3-0.7,0.4-1.2,0.2c-1.7-0.7-5.1-2.2-8.1-5.2c-3-3-4.6-6.5-5.2-8.2c-0.1-0.3,0-0.8,0.2-1l0,0l2.3-2.4C4.2,1.6,4.3,1.5,4.4,1.5z"/></svg>',
39
+
40
+ 'mobile' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M13.5,20H6.5c-1.6,0-2.9-1.3-2.9-2.9V2.9C3.5,1.3,4.8,0,6.5,0h7.1c1.6,0,2.9,1.3,2.9,2.9v14.1C16.5,18.7,15.2,20,13.5,20zM6.7,1.7C5.8,1.7,5,2.5,5,3.4v13.2c0,0.9,0.7,1.7,1.7,1.7h6.6c0.9,0,1.7-0.7,1.7-1.7V3.4c0-0.9-0.7-1.7-1.7-1.7H6.7z"/><path d="M11.2,4.4H8.8c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h2.4c0.3,0,0.6,0.3,0.6,0.6S11.5,4.4,11.2,4.4z"/><circle cx="10" cy="15.7" r="1.2"/></svg>',
41
+
42
+ 'hours' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10s10-4.5,10-10S15.5,0,10,0z M10,18.2c-4.5,0-8.2-3.7-8.2-8.2c0-4.5,3.7-8.2,8.2-8.2c4.5,0,8.2,3.7,8.2,8.2C18.2,14.5,14.5,18.2,10,18.2z M14.4,12.2c-0.2,0.3-0.5,0.5-0.8,0.5c-0.1,0-0.3,0-0.4-0.1l-3.6-1.8c-0.3-0.2-0.5-0.5-0.5-0.8V4.5C9.1,4,9.5,3.6,10,3.6s0.9,0.4,0.9,0.9v4.9L14,11C14.5,11.2,14.7,11.8,14.4,12.2z"/></svg>',
43
+
44
+ 'fax' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M17.5,5.8h-1.7v-4V0h-1.7H5.8H4.2v1.8v4H2.5C1.1,5.8,0,7,0,8.3v8.3h4.2V20h11.7v-3.3H20V8.3C20,7,18.9,5.8,17.5,5.8zM5.8,1.8h8.3v4H5.8V1.8zM14.2,18.3H5.8v-5h8.3V18.3zM18.3,15h-2.5v-3.3H4.2V15H1.7V8.3c0-0.5,0.4-0.8,0.8-0.8h15c0.5,0,0.8,0.4,0.8,0.8V15zM4.2,9.2c0,0.5-0.4,0.8-0.8,0.8S2.5,9.6,2.5,9.2s0.4-0.8,0.8-0.8S4.2,8.7,4.2,9.2z"/></svg>',
45
+
46
+ 'email' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10h5v-2h-5c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8v1.5c0,0.8-0.7,1.5-1.5,1.5S15,12.3,15,11.5V10c0-2.7-2.3-5-5-5s-5,2.3-5,5s2.3,5,5,5c1.4,0,2.7-0.6,3.6-1.6c0.6,0.9,1.7,1.6,2.9,1.6c1.9,0,3.5-1.6,3.5-3.5V10C20,4.5,15.5,0,10,0zM10,7c1.7,0,3,1.3,3,3s-1.3,3-3,3s-3-1.3-3-3S8.3,7,10,7z"/></svg>',
47
+
48
+ 'website' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M9.3,0C4.4,0,0.4,4,0.4,8.9s4,8.9,8.9,8.9c0.8,0,1.5-0.1,2.2-0.3v-3.9c-0.6,1.7-1.4,2.7-2.2,2.7c-0.9,0-2-1.5-2.5-3.7h4.8
49
+ v-1.5h-5c-0.1-0.7-0.1-1.4-0.1-2.2c0-0.8,0.1-1.5,0.2-2.2h5.6c0.1,0.7,0.2,1.4,0.2,2.2c0,0.2,0,0.4,0,0.6c0.4-0.4,0.9-0.6,1.5-0.6c0-0.8,0-1.5-0.1-2.2h2.8c0.2,0.7,0.3,1.4,0.3,2.2c0,0.5-0.1,1-0.2,1.5l1.3,0.9c0.2-0.8,0.3-1.6,0.3-2.4C18.1,4,14.2,0,9.3,0zM9.3,1.5c0.9,0,2,1.5,2.5,3.7h-5C7.3,2.9,8.3,1.5,9.3,1.5zM6.3,2.1C5.9,2.9,5.5,4,5.2,5.2H2.8C3.6,3.8,4.9,2.7,6.3,2.1zM12.2,2.1c1.5,0.6,2.7,1.7,3.5,3.1h-2.3C13.1,4,12.7,2.9,12.2,2.1zM2.2,6.7h2.8C4.9,7.4,4.8,8.1,4.8,8.9c0,0.8,0.1,1.5,0.1,2.2H2.2C2,10.4,1.9,9.7,1.9,8.9C1.9,8.1,2,7.4,2.2,6.7z M13.7,10.4c-0.4,0-0.7,0.3-0.8,0.7c0,0,0,0.1,0,0.1v6.6c0,0.4,0.3,0.7,0.7,0.7c0.2,0,0.4-0.1,0.5-0.2l0,0l1.4-1.6l1.5,3c0.2,0.4,0.6,0.5,1,0.3c0.4-0.2,0.5-0.6,0.3-1l-1.5-3l2.2-0.4l0,0c0.3-0.1,0.5-0.4,0.5-0.7c0-0.3-0.1-0.5-0.3-0.6l0,0l-5.1-3.6C14.1,10.4,13.9,10.4,13.7,10.4zM2.9,12.6h2.3c0.3,1.2,0.7,2.3,1.1,3.1C4.9,15.1,3.7,14,2.9,12.6z"/></svg>',
50
+ ];
51
+
52
+ $attr = [];
53
+
54
+ // if ($args['type'] !== 'simple') {
55
+ $attr['data-icons-type'] = $args['type'];
56
+ // }
57
+
58
+ if ($args['type'] !== 'simple' && ! empty($args['fill'])) {
59
+ $attr['data-icons-type'] .= ':' . $args['fill'];
60
+ }
61
+
62
+ if (! empty($args['size'])) {
63
+ $attr['data-icon-size'] = $args['size'];
64
+ }
65
+
66
+ ob_start(); ?>
67
+
68
+ <ul <?php echo blocksy_attr_to_html($attr) ?>>
69
+ <?php foreach ($args['data'] as $single_layer) { ?>
70
+ <li>
71
+ <span class="ct-icon-container">
72
+ <?php echo $svgs[$single_layer['id']] ?>
73
+ </span>
74
+
75
+ <div class="contact-info">
76
+ <?php if (! empty(blocksy_akg('title', $single_layer, ''))) { ?>
77
+ <span class="contact-title">
78
+ <?php echo esc_html(blocksy_akg('title', $single_layer, '')) ?>
79
+ </span>
80
+ <?php } ?>
81
+
82
+ <?php if (! empty(blocksy_akg('content', $single_layer, ''))) { ?>
83
+ <span class="contact-text">
84
+ <?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
85
+ <a href="<?php echo blocksy_akg('link', $single_layer, '') ?>" <?php echo $data_target ?>>
86
+ <?php } ?>
87
+
88
+ <?php echo blocksy_akg('content', $single_layer, '') ?>
89
+
90
+ <?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
91
+ </a>
92
+ <?php } ?>
93
+ </span>
94
+ <?php } ?>
95
+ </div>
96
+ </li>
97
+ <?php } ?>
98
+ </ul>
99
+
100
+ <?php
101
+ return ob_get_clean();
102
+ }
trunk/framework/theme-integration.php ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class ThemeIntegration {
6
+ public function __construct() {
7
+ add_shortcode('blocksy_posts', function ($args, $content) {
8
+ $args = wp_parse_args(
9
+ $args,
10
+ [
11
+ 'post_type' => 'post',
12
+ 'limit' => 5,
13
+
14
+ // post_date | comment_count
15
+ 'orderby' => 'post_date',
16
+ 'order' => 'DESC',
17
+
18
+ // yes | no
19
+ 'has_pagination' => 'yes',
20
+
21
+ // yes | no
22
+ 'ignore_sticky_posts' => 'no',
23
+
24
+ 'term_ids' => null,
25
+ 'exclude_term_ids' => null,
26
+ 'post_ids' => null,
27
+
28
+ // archive | slider
29
+ 'view' => 'archive',
30
+ 'slider_image_ratio' => '2/1',
31
+ 'slider_autoplay' => 'no',
32
+ ]
33
+ );
34
+
35
+ $file_path = dirname(__FILE__) . '/views/blocksy-posts.php';
36
+
37
+ return blc_call_fn(
38
+ ['fn' => 'blocksy_render_view'],
39
+ $file_path,
40
+ [
41
+ 'args' => $args
42
+ ]
43
+ );
44
+ });
45
+
46
+ add_action('wp_ajax_blocksy_conditions_get_all_taxonomies', function () {
47
+ if (! current_user_can('manage_options')) {
48
+ wp_send_json_error();
49
+ }
50
+
51
+ $cpts = blocksy_manager()->post_types->get_supported_post_types();
52
+
53
+ $cpts[] = 'post';
54
+ $cpts[] = 'page';
55
+ $cpts[] = 'product';
56
+
57
+ $taxonomies = [];
58
+
59
+ foreach ($cpts as $cpt) {
60
+ $taxonomies = array_merge($taxonomies, array_values(array_diff(
61
+ get_object_taxonomies($cpt),
62
+ ['post_format']
63
+ )));
64
+ }
65
+
66
+ $terms = [];
67
+
68
+ foreach ($taxonomies as $taxonomy) {
69
+ $local_terms = array_map(function ($tax) {
70
+ return [
71
+ 'id' => $tax->term_id,
72
+ 'name' => $tax->name
73
+ ];
74
+ }, get_terms(['taxonomy' => $taxonomy]));
75
+
76
+ if (empty($local_terms)) {
77
+ continue;
78
+ }
79
+
80
+ $terms[] = [
81
+ 'id' => $taxonomy,
82
+ 'name' => $taxonomy,
83
+ 'group' => get_taxonomy($taxonomy)->label
84
+ ];
85
+
86
+ $terms = array_merge($terms, $local_terms);
87
+ }
88
+
89
+ wp_send_json_success([
90
+ 'taxonomies' => $terms
91
+ ]);
92
+ });
93
+
94
+ add_filter(
95
+ 'blocksy_add_menu_page',
96
+ function ($res, $options) {
97
+ add_menu_page(
98
+ $options['title'],
99
+ $options['menu-title'],
100
+ $options['permision'],
101
+ $options['top-level-handle'],
102
+ $options['callback'],
103
+ $options['icon-url'],
104
+ 2
105
+ );
106
+
107
+ return true;
108
+ },
109
+ 10, 2
110
+ );
111
+
112
+ add_action('rest_api_init', function () {
113
+ return;
114
+
115
+ register_rest_field('post', 'images', [
116
+ 'get_callback' => function () {
117
+ return wp_prepare_attachment_for_js($object->id);
118
+ },
119
+ 'update_callback' => null,
120
+ 'schema' => null,
121
+ ]);
122
+ });
123
+
124
+ add_filter(
125
+ 'user_contactmethods',
126
+ function ( $field ) {
127
+ $fields['facebook'] = __( 'Facebook', 'blc' );
128
+ $fields['twitter'] = __( 'Twitter', 'blc' );
129
+ $fields['linkedin'] = __( 'LinkedIn', 'blc' );
130
+ $fields['dribbble'] = __( 'Dribbble', 'blc' );
131
+ $fields['instagram'] = __( 'Instagram', 'blc' );
132
+ $fields['pinterest'] = __( 'Pinterest', 'blc' );
133
+ $fields['wordpress'] = __( 'WordPress', 'blc' );
134
+ $fields['github'] = __( 'GitHub', 'blc' );
135
+ $fields['medium'] = __( 'Medium', 'blc' );
136
+ $fields['youtube'] = __( 'YouTube', 'blc' );
137
+ $fields['vimeo'] = __( 'Vimeo', 'blc' );
138
+ $fields['vkontakte'] = __( 'VKontakte', 'blc' );
139
+ $fields['odnoklassniki'] = __( 'Odnoklassniki', 'blc' );
140
+ $fields['tiktok'] = __( 'TikTok', 'blc' );
141
+
142
+ return $fields;
143
+ }
144
+ );
145
+
146
+ add_filter(
147
+ 'wp_check_filetype_and_ext',
148
+ function ($data=null, $file=null, $filename=null, $mimes=null) {
149
+ if (strpos($filename, '.svg') !== false) {
150
+ $data['type'] = 'image/svg+xml';
151
+ $data['ext'] = 'svg';
152
+ }
153
+
154
+ return $data;
155
+ },
156
+ 75, 4
157
+ );
158
+
159
+ add_filter('upload_mimes', function ($mimes) {
160
+ $mimes['svg'] = 'image/svg+xml';
161
+ return $mimes;
162
+ });
163
+
164
+ add_filter('wp_get_attachment_image_attributes', function ($attr, $attachment, $size = 'thumbnail') {
165
+ if (! isset($attachment->ID)) {
166
+ return $attr;
167
+ }
168
+
169
+ $mime = get_post_mime_type($attachment->ID);
170
+
171
+ if ('image/svg+xml' === $mime) {
172
+ $default_height = 100;
173
+ $default_width = 100;
174
+
175
+ $dimensions = $this->svg_dimensions(get_attached_file($attachment->ID));
176
+
177
+ if ($dimensions) {
178
+ $default_height = $dimensions['height'];
179
+ $default_width = $dimensions['width'];
180
+ }
181
+
182
+ $attr['height'] = $default_height;
183
+ $attr['width'] = $default_width;
184
+ }
185
+
186
+ return $attr;
187
+ }, 10, 3);
188
+
189
+ add_filter('blocksy_changelogs_list', function ($changelogs) {
190
+ $changelog = null;
191
+ $access_type = get_filesystem_method();
192
+
193
+ if ($access_type === 'direct') {
194
+ $creds = request_filesystem_credentials(
195
+ site_url() . '/wp-admin/',
196
+ '', false, false,
197
+ []
198
+ );
199
+
200
+ if ( WP_Filesystem($creds) ) {
201
+ global $wp_filesystem;
202
+
203
+ $readme = $wp_filesystem->get_contents(
204
+ BLOCKSY_PATH . '/readme.txt'
205
+ );
206
+
207
+ if ($readme) {
208
+ $readme = explode('== Changelog ==', $readme);
209
+
210
+ if (isset($readme[1])) {
211
+ $changelogs[] = [
212
+ 'title' => __('Companion', 'blc'),
213
+ 'changelog' => trim($readme[1])
214
+ ];
215
+ }
216
+ }
217
+
218
+ if (
219
+ blc_fs()->is__premium_only()
220
+ &&
221
+ BLOCKSY_PATH . '/framework/premium/changelog.txt'
222
+ ) {
223
+ $pro_changelog = $wp_filesystem->get_contents(
224
+ BLOCKSY_PATH . '/framework/premium/changelog.txt'
225
+ );
226
+
227
+ $changelogs[] = [
228
+ 'title' => __('PRO', 'blc'),
229
+ 'changelog' => trim($pro_changelog)
230
+ ];
231
+ }
232
+ }
233
+ }
234
+
235
+ return $changelogs;
236
+ });
237
+
238
+ add_action('wp_enqueue_scripts', function () {
239
+ if (! function_exists('get_plugin_data')){
240
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
241
+ }
242
+
243
+ $data = get_plugin_data(BLOCKSY__FILE__);
244
+
245
+ if (is_admin()) return;
246
+
247
+ /*
248
+ wp_enqueue_style(
249
+ 'blocksy-companion-styles',
250
+ BLOCKSY_URL . 'static/bundle/main.css',
251
+ ['ct-main-styles'],
252
+ $data['Version']
253
+ );
254
+ */
255
+
256
+ wp_enqueue_script(
257
+ 'blocksy-companion-scripts',
258
+ BLOCKSY_URL . 'static/bundle/main.js',
259
+ ['ct-scripts'],
260
+ $data['Version'],
261
+ true
262
+ );
263
+
264
+ $data = [
265
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
266
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/',
267
+ ];
268
+
269
+ wp_localize_script(
270
+ 'blocksy-ext-instagram-scripts',
271
+ 'blocksy_ext_instagram_localization',
272
+ $data
273
+ );
274
+ });
275
+
276
+ add_action(
277
+ 'customize_preview_init',
278
+ function () {
279
+ $data = get_plugin_data(BLOCKSY__FILE__);
280
+
281
+ wp_enqueue_script(
282
+ 'blocksy-companion-sync-scripts',
283
+ BLOCKSY_URL . 'static/bundle/sync.js',
284
+ ['customize-preview', 'wp-date', 'ct-events', 'ct-customizer'],
285
+ $data['Version'],
286
+ true
287
+ );
288
+ }
289
+ );
290
+
291
+ if (get_theme_mod('emoji_scripts', 'no') !== 'yes') {
292
+ remove_action('wp_head', 'print_emoji_detection_script', 7);
293
+ remove_action('admin_print_scripts', 'print_emoji_detection_script');
294
+ remove_action('wp_print_styles', 'print_emoji_styles');
295
+ remove_action('admin_print_styles', 'print_emoji_styles');
296
+ remove_filter('the_content_feed', 'wp_staticize_emoji');
297
+ remove_filter('comment_text_rss', 'wp_staticize_emoji');
298
+ remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
299
+
300
+ add_filter('tiny_mce_plugins', function ($plugins) {
301
+ if (is_array($plugins)) {
302
+ return array_diff($plugins, array('wpemoji'));
303
+ } else {
304
+ return array();
305
+ }
306
+ });
307
+
308
+ add_filter('wp_resource_hints', function ($urls, $relation_type) {
309
+ if ('dns-prefetch' === $relation_type) {
310
+ /** This filter is documented in wp-includes/formatting.php */
311
+ $emoji_svg_url = apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/');
312
+
313
+ $urls = array_diff($urls, array($emoji_svg_url));
314
+ }
315
+
316
+ return $urls;
317
+ }, 10, 2);
318
+ }
319
+ }
320
+
321
+ protected function svg_dimensions($svg) {
322
+ $svg = @simplexml_load_file($svg);
323
+ $width = 0;
324
+ $height = 0;
325
+
326
+ if ($svg) {
327
+ $attributes = $svg->attributes();
328
+
329
+ if (
330
+ isset($attributes->width, $attributes->height)
331
+ &&
332
+ is_numeric($attributes->width)
333
+ &&
334
+ is_numeric($attributes->height)
335
+ ) {
336
+ $width = floatval($attributes->width);
337
+ $height = floatval($attributes->height);
338
+ } elseif (isset($attributes->viewBox)) {
339
+ $sizes = explode(' ', $attributes->viewBox);
340
+
341
+ if (isset($sizes[2], $sizes[3])) {
342
+ $width = floatval($sizes[2]);
343
+ $height = floatval($sizes[3]);
344
+ }
345
+ } else {
346
+ return false;
347
+ }
348
+ }
349
+
350
+ return array(
351
+ 'width' => $width,
352
+ 'height' => $height,
353
+ 'orientation' => ($width > $height) ? 'landscape' : 'portrait'
354
+ );
355
+ }
356
+ }
trunk/framework/views/blocksy-posts.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (! function_exists('blocksy_render_archive_cards')) {
4
+ return;
5
+ }
6
+
7
+ if (get_query_var('paged')) {
8
+ $paged = get_query_var('paged');
9
+ } elseif (get_query_var('page')) {
10
+ $paged = get_query_var('page');
11
+ } else {
12
+ $paged = 1;
13
+ }
14
+
15
+ $query_args = [
16
+ 'order' => $args['order'],
17
+ 'ignore_sticky_posts' => true,
18
+ 'post_type' => explode(',', $args['post_type']),
19
+ 'orderby' => $args['orderby'],
20
+ 'posts_per_page' => $args['limit'],
21
+ 'paged' => $paged,
22
+ 'ignore_sticky_posts' => $args['ignore_sticky_posts'] === 'yes'
23
+ ];
24
+
25
+ if (isset($args['post_ids']) && $args['post_ids']) {
26
+ $query_args['post__in'] = explode(',', $args['post_ids']);
27
+ }
28
+
29
+ if (
30
+ isset($args['term_ids']) && $args['term_ids']
31
+ ||
32
+ isset($args['exclude_term_ids']) && $args['exclude_term_ids']
33
+ ) {
34
+ $tax_query = [];
35
+
36
+ $to_include = [
37
+ 'relation' => 'OR'
38
+ ];
39
+
40
+ $to_exclude = [
41
+ 'relation' => 'AND'
42
+ ];
43
+
44
+ if (
45
+ isset($args['term_ids']) && $args['term_ids']
46
+ &&
47
+ isset($args['exclude_term_ids']) && $args['exclude_term_ids']
48
+ ) {
49
+ $tax_query['relation'] = 'AND';
50
+ }
51
+
52
+ if ($args['term_ids']) {
53
+ foreach (explode(',', $args['term_ids']) as $internal_term_id) {
54
+ $term_id = trim($internal_term_id);
55
+ $term = get_term($term_id);
56
+
57
+ if (! $term) {
58
+ continue;
59
+ }
60
+
61
+ $to_include[] = [
62
+ 'field' => 'term_id',
63
+ 'taxonomy' => $term->taxonomy,
64
+ 'terms' => [$term_id]
65
+ ];
66
+ }
67
+ }
68
+
69
+ if ($args['exclude_term_ids']) {
70
+ foreach (explode(',', $args['exclude_term_ids']) as $internal_term_id) {
71
+ $term_id = trim($internal_term_id);
72
+ $term = get_term($term_id);
73
+
74
+ if (! $term) {
75
+ continue;
76
+ }
77
+
78
+ $to_exclude[] = [
79
+ 'field' => 'term_id',
80
+ 'taxonomy' => $term->taxonomy,
81
+ 'terms' => [$term_id],
82
+ 'operator' => 'NOT IN'
83
+ ];
84
+ }
85
+ }
86
+
87
+ if (count($to_include) > 1) {
88
+ $tax_query[] = $to_include;
89
+ }
90
+ if (count($to_exclude) > 1) {
91
+ $tax_query[] = $to_exclude;
92
+ }
93
+
94
+ $query_args['tax_query'] = $tax_query;
95
+ }
96
+
97
+ $query = new WP_Query($query_args);
98
+
99
+ if ($args['view'] === 'slider') {
100
+ $items = '';
101
+
102
+ $posts_to_render = [];
103
+ $images = [];
104
+
105
+ foreach ($query->posts as $single_post) {
106
+ $attachment_id = get_post_thumbnail_id($single_post);
107
+
108
+ if (! $attachment_id) {
109
+ continue;
110
+ }
111
+
112
+ $posts_to_render[] = $single_post;
113
+ $images[] = $attachment_id;
114
+ }
115
+
116
+ $slider_args = [];
117
+
118
+ if (intval($args['slider_autoplay'])) {
119
+ $slider_args['autoplay'] = intval($args['slider_autoplay']);
120
+ }
121
+
122
+ echo blocksy_flexy(array_merge([
123
+ 'class' => 'ct-posts-shortcode',
124
+ 'images' => $images,
125
+ 'slide_image_args' => function ($index, $args) use ($posts_to_render) {
126
+ $post = $posts_to_render[$index];
127
+ $args['html_atts']['href'] = get_permalink($post);
128
+
129
+ return $args;
130
+ },
131
+ 'images_ratio' => $args['slider_image_ratio']
132
+ ], $slider_args));
133
+ } else {
134
+ $prefix = 'blog';
135
+
136
+ $custom_post_types = blocksy_manager()->post_types->get_supported_post_types();
137
+
138
+ foreach ($custom_post_types as $cpt) {
139
+ if ($cpt === explode(',', $args['post_type'])[0]) {
140
+ $prefix = $cpt . '_archive';
141
+ }
142
+ }
143
+
144
+ echo '<div class="ct-posts-shortcode" data-prefix="' . $prefix . '">';
145
+
146
+ echo blocksy_render_archive_cards([
147
+ 'prefix' => $prefix,
148
+ 'query' => $query,
149
+ 'has_pagination' => $args['has_pagination'] === 'yes'
150
+ ]);
151
+
152
+ wp_reset_postdata();
153
+
154
+ echo '</div>';
155
+ }
156
+
trunk/framework/views/optin.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="blocksy-fs-optin-wrapper">
2
+
3
+ <div class="ct-optin-svg">
4
+ <svg viewBox="0 0 1697 1036" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M328.96 166.92S291 43.03 237.11 16.03c-83.8-42-149.21 9.06-180.29 43.46C41.2 76.78 0 133.36 0 133.36l162.77 99.48 60.12-73.36 40.37 70.34 150.37 63.91 28.18-75.5-112.85-51.31z" id="a"/><path id="c" d="M44.24 0l12.11 45.4 40.22 4.62-15.53 33.36-35.01 28.91-35.23-2.86L.58 80.75l5.67-35.48z"/></defs><g fill="none" fill-rule="evenodd"><path fill="#F9D796" fill-rule="nonzero" d="M1500.63 698.82h112.48v269.02h-112.48z"/><path d="M342.03 347.82c82.467 0 149.32 66.853 149.32 149.32s-66.853 149.32-149.32 149.32" fill="#EAB874" fill-rule="nonzero"/><path d="M1265.19 329.71c0-92.375 74.885-167.26 167.26-167.26 92.375 0 167.26 74.885 167.26 167.26" fill="#F9D796" fill-rule="nonzero"/><path d="M722.1 779.25c0-92.375 74.885-167.26 167.26-167.26 92.375 0 167.26 74.885 167.26 167.26M909.6 337.69L765.95 122.3 622.3 337.69zM306.28 843.19L191.07 670.45 75.87 843.19zM1110.16 18.68l127.24 190.78 127.24-190.78z" fill="#EAB874" fill-rule="nonzero"/><path fill="#F9D796" fill-rule="nonzero" d="M284.07 0h112.48v269.02H284.07z"/><path d="M191.07 494.29c-81.988-.671-148.098-67.325-148.098-149.315s66.11-148.644 148.098-149.315" fill="#EAB874" fill-rule="nonzero"/><path stroke="#F7D99C" stroke-width="14" d="M610.6 40.91l-82.46 82.46M955.53 129.34l82.46 82.46M4.95 606.68l82.46 82.46M1580.64 415.49l82.46 82.46M756.87 405.89l82.46 82.46M99.41 5.29l82.45 82.46M725.44 866.39l-82.46 82.45M1576.35 5.29l-82.46 82.46"/><g transform="translate(44 264)"><ellipse fill="#AB8660" fill-rule="nonzero" cx="809.97" cy="763.18" rx="809.13" ry="7.83"/><path fill="#E09B8C" fill-rule="nonzero" d="M1652.78 422.57L1289 762.18h-139.44l363.79-339.61z"/><path fill="#FFF" fill-rule="nonzero" d="M1515.31 418.07L1134.48 10.14h127.13l380.81 407.93z"/><path d="M1259.65 14.64l372.41 398.93h-114.8L1144.84 14.64h114.82m3.91-9h-139.45l389.23 416.93h139.43L1263.56 5.64h.01z" fill="#F9D0B5" fill-rule="nonzero"/><path d="M745.54 315.39s30.79 12.91 44.3 28.14c13.51 15.23 22 48 22 48s-82 10.35-89.89-64" fill="#3361C2" fill-rule="nonzero"/><path fill="#162C56" fill-rule="nonzero" d="M70.97 679.93l-52.28 53.13 48.59 29.12h149.79l-79.75-42.44zM365.76 695.49l-33.45 66.69h191.46l-79.75-42.44z"/><path d="M158.72 731.57l179.92-179.82a108 108 0 0030.33-59.72l15.39-98.69 67.33 98.17-105.64 202.52 114.79 34 108.57-174.9c20.29-32.698 19.02-74.367-3.22-105.77l-91.13-128.52-162.78-99.48-35.07 55a145.45 145.45 0 00-22.52 69.21l-7.57 122.46L43.41 675.67l115.31 55.9z" fill="#72A065" fill-rule="nonzero"/><g transform="translate(312.21 86)"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#FFBA5F" fill-rule="nonzero" xlink:href="#a"/><g mask="url(#b)" fill="#EA6F57" fill-rule="nonzero"><path d="M86.88 100.83l-30.01-45-30.01 45zM203.17 100.83l-30.01-45-30.01 45zM320.29 100.83l-30.01-45-30.01 45zM203.17 262.06l-30.01-45-30.01 45zM436.59 262.06l-30.01-45-30.01 45zM203.17 141.6l30.01 45 30.01-45zM86.46 141.6l30.01 45 30.01-45zM86.46-4l30.01 45 30.01-45z"/></g></g><path stroke="#3361C2" stroke-width="65" stroke-linecap="round" stroke-linejoin="round" d="M624.08 47.83l-80.96 67.74"/><path d="M569.19 131.42l4.89 2.76a44.45 44.45 0 0063.9-24.41l10.41-30.62c6.946-20.417-1.77-42.874-20.67-53.26-21.512-11.814-48.528-3.958-60.35 17.55l-15.31 27.87c-11.725 21.346-4.086 48.152 17.13 60.11z" fill="#3361C2" fill-rule="nonzero"/><rect fill="#3361C2" fill-rule="nonzero" transform="rotate(171.38 555.62 69.08)" x="539.28" y="48.106" width="32.68" height="41.95" rx="15.57"/><path stroke="#FFF" stroke-width="3" stroke-linecap="square" d="M549.21 60.75l6.66 17.86M624.69 81.93l-7.19 24.92-8.88-2.51"/><path d="M566.23 81.03l29.76-38.22 7.06-9.08a36.9 36.9 0 006 10.56c9.27 11.56 46.57 24.34 62.35 1.08 12.87-19-14.16-16.39-24.87-22.46-16.82-9.54-24.7-25.16-54.45-22.34-35.65 3.33-38.24 47.57-38.24 47.57s14.87.47 12.39 32.89zM572.63 133.41l-11.35-12.29.49 21.21z" fill="#24272D" fill-rule="nonzero"/><circle fill="#FFF" fill-rule="nonzero" cx="610.55" cy="79.94" r="4.57"/><circle fill="#FFF" fill-rule="nonzero" cx="635.64" cy="91.01" r="4.57"/><path stroke="#FFF" stroke-width="14" stroke-linecap="square" d="M482.28 316.25l-168.09-99.5"/><path d="M560.74 307.44s12.5-6.53 31.82-5l20.76 7.81s18.43 14.78-6.84 40.92-73.09 6.38-73.09 6.38" fill="#3361C2" fill-rule="nonzero"/><path d="M383.08 222.78l7.85 61.31a52 52 0 0033.4 42.13l114 42.53 28.24-79.09-87.83-33 2.46-73.63" fill="#FFBA5F" fill-rule="nonzero"/><path fill="#F9D0B5" fill-rule="nonzero" d="M1513.35 422.57l-363.79 339.61-389.22-416.92L1124.12 5.64z"/><path stroke="#1F2128" stroke-width="8" stroke-linecap="round" d="M609.44 291.27l-15.56 22.14"/><g transform="translate(597.74 183.12)"><mask id="d" fill="#fff"><use xlink:href="#c"/></mask><use fill="#FFBA5F" fill-rule="nonzero" xlink:href="#c"/><path fill="#EA6F57" fill-rule="nonzero" mask="url(#d)" d="M-15 27.85l52.21 78.28 52.2-78.28z"/></g><ellipse stroke="#1F2128" stroke-width="8" transform="rotate(-56.98 649.702 233.917)" cx="649.702" cy="233.917" rx="70.11" ry="41.03"/><path fill="#EA6F57" fill-rule="nonzero" d="M726.43 762.18l-35.1-52.64-35.11 52.64z"/><path fill="#3361C2" fill-rule="nonzero" d="M1044.84 762.18l-92.08-138.07-92.09 138.07z"/><path fill="#FFBA5F" fill-rule="nonzero" d="M792.91 582.42h75.16v179.76h-75.16z"/><path d="M771.2 762.18c0-56.952 46.168-103.12 103.12-103.12 56.952 0 103.12 46.168 103.12 103.12" fill="#72A065" fill-rule="nonzero"/><path d="M590.53 101.53s-2.35 9.23 7.31 13.78" fill="#FFF" fill-rule="nonzero"/><path stroke="#FFF" stroke-width="3" stroke-linecap="square" d="M515.21 268.68l-37.54-14.66-1.03-82.26M385.91 252.69l-3.82-57.64M257.28 490.34l-8.67-23.39 21.31-3.31M473.21 509.5l-19.87-17.8 27.53-13.77M387.38 364.73L376.5 434.5"/></g><g fill="#2B292D" fill-rule="nonzero"><path d="M1174.34 671.16l13.55-56.28-57.16 9.12zM1192.298 690.546l35.36-32.697 78.199 84.565-35.36 32.698zM1112.38 604.16a48.152 48.152 0 00-65.38-70.71l65.38 70.71z"/></g></g>
5
+ </svg>
6
+ </div>
trunk/framework/widgets-manager.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyWidgetFactory extends WP_Widget {
4
+ /**
5
+ * Options for the widget.
6
+ *
7
+ * @var array $options options.
8
+ */
9
+ public $options;
10
+
11
+ /**
12
+ * Widget prefix for the path.
13
+ *
14
+ * @var string $prefix
15
+ */
16
+ public $prefix = 'ct_default_widget';
17
+
18
+ public function get_path() {
19
+ throw new Error('Implement get_path()');
20
+ }
21
+
22
+ /**
23
+ * Loop through all the folders and treat each folder as a separated widget.
24
+ * Based on the folder name, instantiate a specific class, treat this
25
+ * as convention over configuration.
26
+ */
27
+ public static function register_all_widgets() {
28
+ $all_widgets = apply_filters('blocksy_widgets_paths', []);
29
+
30
+ foreach ($all_widgets as $widget) {
31
+ $prefix = basename($widget);
32
+
33
+ include_once $widget . '/widget.php';
34
+
35
+ $class_name = explode('-', $prefix);
36
+ $class_name = array_map('ucfirst', $class_name);
37
+ $class_name = implode('_', $class_name);
38
+
39
+ register_widget('Blocksy_Widget_' . $class_name);
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Extract widget path based on the class name.
45
+ */
46
+ /*
47
+ public function get_path() {
48
+ $widget_path = strtolower( get_class( $this ) );
49
+ $widget_path = str_replace( '_', '-', str_replace( 'blocksy_widget_', '', $widget_path ) );
50
+
51
+ return get_template_directory() . '/inc/widgets-manager/widgets/' . $widget_path;
52
+ }
53
+ */
54
+
55
+ /**
56
+ * Construct the widget
57
+ */
58
+ public function __construct() {
59
+ $prefix = basename( $this->get_path() );
60
+
61
+ $config = [
62
+ 'name' => $this->blocksy_id_to_title( $prefix ),
63
+ 'description' => __( 'Default widget description', 'blocksy' ),
64
+ ];
65
+
66
+ $options = null;
67
+
68
+ if ($this->get_config()) {
69
+ $config = array_merge( $config, $this->get_config() );
70
+ }
71
+
72
+ $name = blocksy_akg(
73
+ 'name',
74
+ $config,
75
+ __('Default widget name', 'blc')
76
+ );
77
+
78
+ $description = blocksy_akg(
79
+ 'description',
80
+ $config,
81
+ __('Display online support infomation', 'blc')
82
+ );
83
+
84
+ unset($config['name']);
85
+ unset($config['description']);
86
+
87
+ $this->prefix = $prefix;
88
+
89
+ parent::__construct(
90
+ false,
91
+ '&#10;' . $name,
92
+ array_merge([
93
+ 'description' => $description,
94
+ 'classname' => $prefix . '-widget',
95
+ ], $config)
96
+ );
97
+ }
98
+
99
+ public function widget( $args, $instance ) {
100
+ $file_path = $this->get_path() . '/view.php';
101
+
102
+ if ( ! file_exists( $file_path ) ) {
103
+ echo '<p>Default widget view. Please create a <i>view.php</i> file.</p>';
104
+ return;
105
+ }
106
+
107
+ $instance = blocksy_akg('ct_options', $instance, []);
108
+
109
+ if (! $instance) {
110
+ $instance = [];
111
+ }
112
+
113
+ // @codingStandardsIgnoreLine
114
+ echo blc_call_fn(
115
+ ['fn' => 'blocksy_render_view'],
116
+ $file_path,
117
+ array_merge(
118
+ [ 'atts' => $instance ],
119
+ $args
120
+ )
121
+ );
122
+ }
123
+
124
+ public function read_options() {
125
+ $options = null;
126
+
127
+ if ( file_exists( $this->get_path() . '/options.php' ) ) {
128
+ $options = blocksy_akg(
129
+ 'options',
130
+ blc_call_fn(
131
+ ['fn' => 'blocksy_get_variables_from_file'],
132
+ $this->get_path() . '/options.php',
133
+ ['options' => []]
134
+ )
135
+ );
136
+ }
137
+
138
+ if ( $options ) {
139
+ $this->options = $options;
140
+ } else {
141
+ $this->options = [
142
+ 'title' => [
143
+ 'type' => 'text',
144
+ 'label' => __( 'Widget Title', 'blc' ),
145
+ 'field_attr' => [ 'id' => 'widget-title' ],
146
+ ],
147
+ ];
148
+ }
149
+ }
150
+
151
+ /**
152
+ * Save widget values, if available.
153
+ *
154
+ * @param array $new_instance new widget values.
155
+ * @param array $old_instance old widget values.
156
+ */
157
+ public function update( $new_instance, $old_instance ) {
158
+ $new_instance[ $this->prefix ][ 'ct_options' ] = json_decode(
159
+ $new_instance[ $this->prefix ][ 'ct_options' ],
160
+ true
161
+ );
162
+
163
+ return $new_instance[ $this->prefix ];
164
+ }
165
+
166
+ public function form( $values ) {
167
+ $this->read_options();
168
+
169
+ echo blc_call_fn(
170
+ ['fn' => 'blocksy_output_options_panel'],
171
+ [
172
+ 'options' => $this->options,
173
+ 'values' => blocksy_akg('ct_options', $values),
174
+ 'id_prefix' => 'ct-widget-options-' . $this->get_field_id(
175
+ $this->prefix
176
+ ),
177
+ 'name_prefix' => $this->get_field_name( $this->prefix ),
178
+ 'attr' => [
179
+ 'data-disable-reverse-button' => ''
180
+ ]
181
+ ]
182
+ );
183
+
184
+ return $values;
185
+ }
186
+
187
+ private function blocksy_id_to_title( $id ) {
188
+ if ( function_exists( 'mb_strtoupper' ) && function_exists( 'mb_substr' ) && function_exists( 'mb_strlen' ) ) {
189
+ $id = mb_strtoupper( mb_substr( $id, 0, 1, 'UTF-8' ), 'UTF-8' ) . mb_substr(
190
+ $id,
191
+ 1,
192
+ mb_strlen( $id, 'UTF-8' ),
193
+ 'UTF-8'
194
+ );
195
+ } else {
196
+ $id = strtoupper( substr( $id, 0, 1 ) ) . substr( $id, 1, strlen( $id ) );
197
+ }
198
+
199
+ return str_replace( array( '_', '-' ), ' ', $id );
200
+ }
201
+ }
trunk/freemius-pricing/178afa6030e76635dbe835e111d2c507.png ADDED
Binary file
trunk/freemius-pricing/27b5a722a5553d9de0170325267fccec.png ADDED
Binary file
trunk/freemius-pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png ADDED
Binary file
trunk/freemius-pricing/5480ed23b199531a8cbc05924f26952b.png ADDED
Binary file
trunk/freemius-pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ width="250px" height="115.3px" viewBox="0 0 250 115.3" style="enable-background:new 0 0 250 115.3;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#969696;}
7
+ .st1{fill:#999999;}
8
+ .st2{fill:#FFFFFF;}
9
+ .st3{fill:#CCCCCC;}
10
+ .st4{fill:#72AF00;}
11
+ .st5{fill:#29ABE2;}
12
+ .st6{fill:#D4145A;}
13
+ .st7{fill:#333333;}
14
+ .st8{fill:#009ADE;}
15
+ .st9{fill:#002F87;}
16
+ .st10{fill-rule:evenodd;clip-rule:evenodd;fill:#FBB231;}
17
+ .st11{fill-rule:evenodd;clip-rule:evenodd;fill:#EC1B2E;}
18
+ .st12{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
19
+ .st13{fill:#2FABF7;}
20
+ .st14{fill:#228FE0;}
21
+ .st15{fill:#0571C1;}
22
+ .st16{fill:#1174CE;}
23
+ .st17{fill:#1BCC38;}
24
+ .st18{fill:#E20E37;}
25
+ .st19{fill:#00579F;}
26
+ .st20{fill:#FAA61A;}
27
+ .st21{fill:#F4F4F4;}
28
+ .st22{fill:none;stroke:#969696;stroke-width:7;stroke-miterlimit:10;}
29
+ </style>
30
+ <g>
31
+ <g>
32
+ <path class="st4" d="M225.4,36c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
33
+ c-0.2,1.1-0.8,1.6-1.9,1.6H225.4z"/>
34
+ <path class="st4" d="M218.3,70.4c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
35
+ c-0.2,1.1-0.8,1.6-1.9,1.6H218.3z"/>
36
+ <path class="st7" d="M187.1,38h-3c-1,0-1.9,0.7-2,1.7l-2.8,15.9h-3l2.1-11.8c0.7-3.9-0.9-5.8-4.7-5.8h-21.5
37
+ c-3.8,0-6.1,1.9-6.7,5.8l-2.1,11.8h-6.6h-5.7c-0.9,0-1.2-0.4-1-1.2l0.3-1.8c0.3,0.2,0.8,0.3,1.2,0.3h5.3c3.6,0,6.1-1.9,6.7-5.7
38
+ l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-8.5c-3.8,0-6,1.9-6.7,5.8l-2.1,11.9h-11.4c-0.9,0-1.2-0.4-1-1.2l0.3-1.8
39
+ c0.3,0.2,0.8,0.3,1.2,0.3h4.9c3.6,0,5.7-1.9,6.4-5.7l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-7.1h-0.7h-6.8h-7.1H85.6l0.1-0.3
40
+ c0.2-1.1,0.9-1.7,1.9-1.7h3.1c1,0,1.8-0.7,1.9-1.6l0.8-4.3h-7.9c-1.8,0-3.3,0.5-4.5,1.5c-1.2,1-1.9,2.4-2.3,4.3l-4.7,26.6h7.2
41
+ l3.1-17.8h6.4l-3.1,17.8h7.2l3-16.6c0.1-0.8,0.5-1.2,1.2-1.2h4.3l0,0h1.4l-2.2,12.1c-0.5,3.2,1.6,5.8,4.8,5.8h19.9h8.2h6.6h1.8
42
+ h2.9c1.4,0,2.6-1,2.8-2.4l2.4-13.6c0.2-0.9,0.6-1.2,1.5-1.2h4.5l-2.7,15.9c-0.1,0.7,0.4,1.3,1.2,1.3h4.7c0.6,0,1.1-0.4,1.2-1
43
+ l2.9-16.3h4.6c0.9,0,1.2,0.4,1,1.2l-2.4,13.4c-0.2,1.1,0.5,2.2,1.6,2.5v0.1h0.6h4.4h5.4h3h0.4v-0.1c0.9-0.2,1.5-0.8,1.7-1.7
44
+ l3.6-20.3C189.3,39.2,188.4,38,187.1,38z M131.3,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h3c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7
45
+ c-0.1,0.5-0.4,0.8-1,0.8h-3C131.4,48.1,131.2,47.8,131.3,47.3z M111.5,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h2.6
46
+ c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7c-0.1,0.5-0.4,0.8-1,0.8h-2.6C111.6,48.1,111.4,47.8,111.5,47.3z"/>
47
+ <path class="st7" d="M214,38l-3.3,18.8c-0.6,3.8-2.9,5.7-6.6,5.7h-10.3c-3.9,0-5.5-1.8-4.8-5.5l3.3-19h7.2l-2.8,15.9
48
+ c-0.2,0.9,0.2,1.3,1,1.3h4.9c0.9,0,1.3-0.4,1.5-1.2l2.9-16H214z"/>
49
+ <path class="st5" d="M183,34.4l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
50
+ h-4.1C183.2,36,182.8,35.5,183,34.4z"/>
51
+ <path class="st6" d="M68.7,42.9l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
52
+ h-4.1C68.9,44.5,68.6,43.9,68.7,42.9z"/>
53
+ <path class="st7" d="M212.1,62.6l1.2-6.8h13.8c0.5,0,0.8-0.3,0.9-0.8l0.3-1.5c0.1-0.4-0.1-0.6-0.6-0.6h-9.2
54
+ c-1.9,0-3.1-0.4-3.7-1.3c-0.5-0.9-0.7-2.2-0.4-4l0.6-3.7c0.6-3.8,2.9-5.7,6.7-5.7h15.8l-1.2,6.8h-13.7c-0.5,0-0.8,0.3-0.9,0.8
55
+ l-0.3,1.5c-0.1,0.4,0.1,0.6,0.6,0.6h9.2c3.4,0,4.8,1.8,4.3,5.3l-0.6,3.8c-0.7,3.8-2.7,5.8-6.2,5.8L212.1,62.6L212.1,62.6z"/>
56
+ </g>
57
+ <g>
58
+ <path class="st0" d="M244.4,115.2H5.6c-3.1,0-5.6-2.5-5.6-5.6V14.1C0,11,2.5,8.5,5.6,8.5h34.7v0.7H5.6c-2.7,0-4.8,2.2-4.8,4.8
59
+ v95.6c0,2.7,2.2,4.8,4.8,4.8h238.9c2.7,0,4.8-2.2,4.8-4.8V14.1c0-2.7-2.2-4.8-4.8-4.8h-35.9V8.5h35.9c3.1,0,5.6,2.5,5.6,5.6v95.6
60
+ C250,112.7,247.5,115.2,244.4,115.2z"/>
61
+ </g>
62
+ <g>
63
+ <path class="st0" d="M51.3,13.2c-0.7-0.2-1.3-0.5-1.8-0.8l0.8-1.7c0.4,0.3,0.9,0.6,1.5,0.8c0.6,0.2,1.2,0.3,1.8,0.3
64
+ c0.7,0,1.1-0.1,1.4-0.3c0.3-0.2,0.5-0.5,0.5-0.8c0-0.2-0.1-0.4-0.3-0.6c-0.2-0.2-0.4-0.3-0.7-0.4c-0.3-0.1-0.7-0.2-1.2-0.3
65
+ c-0.8-0.2-1.4-0.4-1.9-0.5c-0.5-0.2-0.9-0.5-1.2-0.9C50,7.5,49.8,7,49.8,6.3c0-0.6,0.2-1.1,0.5-1.6c0.3-0.5,0.8-0.8,1.4-1.1
66
+ c0.6-0.3,1.4-0.4,2.3-0.4c0.6,0,1.3,0.1,1.9,0.2c0.6,0.2,1.1,0.4,1.6,0.7l-0.7,1.7c-0.9-0.5-1.8-0.8-2.8-0.8
67
+ c-0.6,0-1.1,0.1-1.4,0.3c-0.3,0.2-0.5,0.5-0.5,0.8c0,0.3,0.2,0.6,0.5,0.8c0.4,0.2,0.9,0.3,1.6,0.5C55,7.6,55.6,7.8,56.1,8
68
+ c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.5,0.9,0.5,1.6c0,0.6-0.2,1.1-0.5,1.6c-0.3,0.5-0.8,0.8-1.4,1.1c-0.6,0.3-1.4,0.4-2.3,0.4
69
+ C52.8,13.5,52.1,13.4,51.3,13.2z"/>
70
+ <path class="st0" d="M66.7,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
71
+ c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
72
+ c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
73
+ c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C66.8,9.6,66.7,9.8,66.7,10.1z M61.5,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
74
+ C64.6,8.3,64.4,8,64,7.7c-0.3-0.3-0.8-0.4-1.2-0.4C62.3,7.2,61.9,7.4,61.5,7.7z"/>
75
+ <path class="st0" d="M69.7,12.9c-0.6-0.3-1.2-0.8-1.5-1.4c-0.4-0.6-0.5-1.3-0.5-2c0-0.8,0.2-1.4,0.5-2c0.4-0.6,0.9-1.1,1.5-1.4
76
+ c0.6-0.3,1.4-0.5,2.2-0.5c0.8,0,1.5,0.2,2.1,0.5c0.6,0.3,1,0.8,1.3,1.4l-1.7,0.9c-0.4-0.7-1-1.1-1.7-1.1c-0.6,0-1.1,0.2-1.4,0.6
77
+ c-0.4,0.4-0.6,0.9-0.6,1.5c0,0.7,0.2,1.2,0.6,1.5c0.4,0.4,0.9,0.6,1.4,0.6c0.8,0,1.3-0.4,1.7-1.1l1.7,0.9
78
+ c-0.3,0.6-0.7,1.1-1.3,1.4c-0.6,0.3-1.3,0.5-2.1,0.5C71.1,13.4,70.4,13.3,69.7,12.9z"/>
79
+ <path class="st0" d="M84.3,5.7v7.6h-2.1v-0.9c-0.3,0.3-0.6,0.6-1.1,0.8c-0.4,0.2-0.8,0.3-1.3,0.3c-1,0-1.8-0.3-2.4-0.9
80
+ c-0.6-0.6-0.9-1.4-0.9-2.6V5.7h2.2v4c0,1.2,0.5,1.8,1.5,1.8c0.5,0,1-0.2,1.3-0.5c0.3-0.3,0.5-0.9,0.5-1.5V5.7H84.3z"/>
81
+ <path class="st0" d="M89.6,5.8c0.4-0.2,1-0.3,1.6-0.3v2c-0.2,0-0.4,0-0.5,0c-0.6,0-1.1,0.2-1.5,0.5c-0.4,0.4-0.5,0.9-0.5,1.6v3.6
82
+ h-2.2V5.7h2.1v1C88.8,6.3,89.1,6,89.6,5.8z"/>
83
+ <path class="st0" d="M99.8,10.1H94c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
84
+ c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
85
+ c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
86
+ c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C99.9,9.6,99.8,9.8,99.8,10.1z M94.6,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
87
+ c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C95.4,7.2,95,7.4,94.6,7.7z"/>
88
+ <path class="st0" d="M111.8,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
89
+ s-1.2,0.5-1.9,0.5c-1,0-1.7-0.3-2.3-0.9v3.6h-2.2V5.7h2.1v0.9c0.5-0.7,1.3-1,2.4-1C110.6,5.6,111.2,5.7,111.8,6.1z M110.9,11
90
+ c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6c-0.6,0-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
91
+ c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6C110.1,11.6,110.5,11.4,110.9,11z"/>
92
+ <path class="st0" d="M120.8,6.4c0.6,0.6,1,1.4,1,2.5v4.4h-2.1v-1c-0.4,0.7-1.2,1.1-2.3,1.1c-0.6,0-1.1-0.1-1.5-0.3
93
+ c-0.4-0.2-0.8-0.5-1-0.8c-0.2-0.4-0.3-0.7-0.3-1.2c0-0.7,0.3-1.3,0.8-1.7c0.5-0.4,1.4-0.6,2.5-0.6h1.8c0-0.5-0.1-0.9-0.4-1.1
94
+ c-0.3-0.3-0.7-0.4-1.3-0.4c-0.4,0-0.8,0.1-1.2,0.2c-0.4,0.1-0.7,0.3-1,0.5l-0.8-1.5c0.4-0.3,0.9-0.5,1.5-0.7
95
+ c0.6-0.2,1.2-0.2,1.8-0.2C119.3,5.6,120.2,5.8,120.8,6.4z M118.9,11.7c0.3-0.2,0.5-0.4,0.6-0.8v-0.8h-1.5c-0.9,0-1.4,0.3-1.4,0.9
96
+ c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.5,0.2,0.9,0.2C118.3,11.9,118.7,11.9,118.9,11.7z"/>
97
+ <path class="st0" d="M131.2,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
98
+ c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
99
+ l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H131.2z"/>
100
+ <path class="st0" d="M144.2,6.4c0.6,0.6,0.8,1.4,0.8,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.1-0.4
101
+ c-0.5,0-0.9,0.2-1.2,0.5c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2v-4c0-1.2-0.5-1.8-1.4-1.8c-0.5,0-0.9,0.2-1.2,0.5
102
+ c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.6-0.6,1-0.7c0.4-0.2,0.9-0.3,1.4-0.3c0.5,0,1,0.1,1.5,0.3
103
+ c0.4,0.2,0.8,0.5,1.1,0.9c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1-0.3,1.6-0.3C142.9,5.6,143.6,5.8,144.2,6.4z"/>
104
+ <path class="st0" d="M154.6,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
105
+ c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
106
+ c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
107
+ c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C154.6,9.6,154.6,9.8,154.6,10.1z M149.4,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
108
+ c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C150.1,7.2,149.7,7.4,149.4,7.7z"/>
109
+ <path class="st0" d="M163,6.4c0.6,0.6,0.9,1.4,0.9,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.2-0.4
110
+ c-0.6,0-1,0.2-1.3,0.5c-0.3,0.3-0.5,0.9-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.7-0.6,1.1-0.7c0.4-0.2,0.9-0.3,1.4-0.3
111
+ C161.7,5.6,162.4,5.8,163,6.4z"/>
112
+ <path class="st0" d="M170.8,12.9c-0.2,0.2-0.5,0.3-0.8,0.4c-0.3,0.1-0.7,0.1-1,0.1c-0.9,0-1.6-0.2-2.1-0.7c-0.5-0.5-0.7-1.1-0.7-2
113
+ V7.6H165V5.8h1.2V4h2.2v1.9h1.9v1.7h-1.9v3.1c0,0.3,0.1,0.6,0.2,0.7c0.2,0.2,0.4,0.3,0.7,0.3c0.4,0,0.6-0.1,0.9-0.3L170.8,12.9z"
114
+ />
115
+ <path class="st0" d="M172.8,13.2c-0.6-0.2-1.1-0.4-1.4-0.6l0.7-1.6c0.3,0.2,0.8,0.4,1.2,0.5c0.5,0.1,1,0.2,1.4,0.2
116
+ c0.9,0,1.4-0.2,1.4-0.7c0-0.2-0.1-0.4-0.4-0.5c-0.3-0.1-0.6-0.2-1.2-0.2c-0.6-0.1-1.1-0.2-1.5-0.3c-0.4-0.1-0.8-0.3-1.1-0.7
117
+ c-0.3-0.3-0.4-0.8-0.4-1.3c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1.2-0.3,1.9-0.3c0.5,0,1.1,0.1,1.6,0.2
118
+ c0.5,0.1,1,0.3,1.3,0.5l-0.7,1.6c-0.7-0.4-1.4-0.6-2.2-0.6c-0.5,0-0.8,0.1-1.1,0.2c-0.2,0.1-0.4,0.3-0.4,0.5
119
+ c0,0.2,0.1,0.4,0.4,0.5c0.3,0.1,0.7,0.2,1.2,0.3c0.6,0.1,1.1,0.2,1.5,0.3c0.4,0.1,0.7,0.3,1,0.6c0.3,0.3,0.4,0.7,0.4,1.3
120
+ c0,0.5-0.1,0.9-0.4,1.3c-0.3,0.4-0.7,0.7-1.2,0.9c-0.5,0.2-1.2,0.3-1.9,0.3C174,13.4,173.4,13.4,172.8,13.2z"/>
121
+ <path class="st0" d="M190.1,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
122
+ c-0.6,0.3-1.2,0.5-1.9,0.5c-1.1,0-1.9-0.3-2.4-1v0.9h-2.1V2.8h2.2v3.7c0.6-0.6,1.3-0.9,2.3-0.9C188.9,5.6,189.5,5.7,190.1,6.1z
123
+ M189.2,11c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6s-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
124
+ c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6S188.8,11.4,189.2,11z"/>
125
+ <path class="st0" d="M200.8,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
126
+ c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
127
+ l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H200.8z"/>
128
+ </g>
129
+ <path class="st4" d="M51,41.7h-2.3v-4.8c0-8.2-6.7-14.8-14.8-14.8S19,28.8,19,36.9v4.8h-2.3c-2.6,0-4.7,2.1-4.7,4.7v18.7
130
+ c0,2.6,2.1,4.7,4.7,4.7H51c2.6,0,4.7-2.1,4.7-4.7V46.4C55.7,43.8,53.6,41.7,51,41.7z M26.8,36.9c0-3.9,3.2-7,7-7s7,3.2,7,7v4.8
131
+ H26.8V36.9z M44.1,51L31.9,63.2c-0.4,0.4-1.1,0.4-1.5,0l-6.9-6.9c-0.4-0.4-0.4-1.1,0-1.5l1.5-1.5c0.4-0.4,1.1-0.4,1.5,0l4.6,4.6
132
+ l10-10c0.4-0.4,1.1-0.4,1.5,0l1.5,1.5C44.6,49.9,44.6,50.6,44.1,51z"/>
133
+ <g>
134
+ <g>
135
+ <g>
136
+ <g>
137
+ <path class="st8" d="M53.9,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.5c0.2,0,0.4-0.2,0.5-0.4l0.6-3.5
138
+ c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C56.7,87.4,55.5,87,53.9,87z M54.5,91.5
139
+ c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C54.5,90.5,54.5,90.9,54.5,91.5z"/>
140
+ <path class="st9" d="M19.4,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.3c0.3,0,0.6-0.2,0.7-0.6l0.5-3.3
141
+ c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C22.3,87.4,21,87,19.4,87z M20,91.5
142
+ c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C20,90.5,20.1,90.9,20,91.5z"/>
143
+ <path class="st9" d="M33.9,91.5h-2.3c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
144
+ c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
145
+ c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C34.3,91.7,34.1,91.5,33.9,91.5z M30.6,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
146
+ c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C30.6,94.7,30.8,95.3,30.6,96z"/>
147
+ <path class="st8" d="M68.3,91.5H66c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
148
+ c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
149
+ c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C68.8,91.7,68.6,91.5,68.3,91.5z M65.1,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
150
+ c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C65.1,94.7,65.2,95.3,65.1,96z"/>
151
+ <path class="st9" d="M46.2,91.5h-2.3c-0.2,0-0.4,0.1-0.6,0.3l-3.2,4.7l-1.4-4.5c-0.1-0.3-0.3-0.5-0.6-0.5h-2.3
152
+ c-0.3,0-0.5,0.3-0.4,0.5l2.6,7.5l-2.4,3.4c-0.2,0.3,0,0.6,0.3,0.6h2.3c0.2,0,0.4-0.1,0.6-0.3l7.7-11.2
153
+ C46.7,91.8,46.5,91.5,46.2,91.5z"/>
154
+ <path class="st8" d="M71.1,87.3l-2,12.6c0,0.2,0.2,0.5,0.4,0.5h2c0.3,0,0.6-0.2,0.7-0.6l2-12.4c0-0.2-0.2-0.5-0.4-0.5h-2.2
155
+ C71.3,87,71.1,87.1,71.1,87.3z"/>
156
+ </g>
157
+ </g>
158
+ </g>
159
+ </g>
160
+ <g>
161
+ <polygon class="st10" points="150.3,102.3 150.8,102.2 151.3,102.2 151.7,102.1 152.2,102.1 152.6,102 153,101.8 153.4,101.7
162
+ 153.8,101.5 154.2,101.4 154.6,101.2 155,100.9 155.4,100.7 155.7,100.5 156.1,100.2 156.4,99.9 156.7,99.6 157,99.3 157.3,99
163
+ 157.6,98.6 157.8,98.3 158,97.9 158.3,97.5 158.5,97.2 158.6,96.8 158.8,96.3 158.9,95.9 159.1,95.5 159.2,95.1 159.2,94.6
164
+ 159.3,94.2 159.3,93.7 159.3,93.2 159.3,92.8 159.3,92.3 159.2,91.9 159.2,91.4 159.1,91 158.9,90.6 158.8,90.2 158.6,89.8
165
+ 158.5,89.4 158.3,89 158,88.6 157.8,88.2 157.6,87.9 157.3,87.5 157,87.2 156.7,86.9 156.4,86.6 156.1,86.3 155.7,86.1
166
+ 155.4,85.8 155,85.6 154.6,85.4 154.2,85.2 153.8,85 153.4,84.8 153,84.7 152.6,84.6 152.2,84.5 151.7,84.4 151.3,84.3
167
+ 150.8,84.3 150.3,84.3 149.9,84.3 149.4,84.3 149,84.4 148.5,84.5 148.1,84.6 147.7,84.7 147.3,84.8 146.8,85 146.4,85.2
168
+ 146.1,85.4 145.7,85.6 145.3,85.8 145,86.1 144.6,86.3 144.3,86.6 144,86.9 143.7,87.2 143.4,87.5 143.1,87.9 142.9,88.2
169
+ 142.7,88.6 142.4,89 142.2,89.4 142.1,89.8 141.9,90.2 141.8,90.6 141.6,91 141.5,91.4 141.5,91.9 141.4,92.3 141.4,92.8
170
+ 141.4,93.2 141.4,93.7 141.4,94.2 141.5,94.6 141.5,95.1 141.6,95.5 141.8,95.9 141.9,96.3 142.1,96.8 142.2,97.2 142.4,97.5
171
+ 142.7,97.9 142.9,98.3 143.1,98.6 143.4,99 143.7,99.3 144,99.6 144.3,99.9 144.6,100.2 145,100.5 145.3,100.7 145.7,100.9
172
+ 146.1,101.2 146.4,101.4 146.8,101.5 147.3,101.7 147.7,101.8 148.1,102 148.5,102.1 149,102.1 149.4,102.2 149.9,102.2
173
+ 150.3,102.3 150.3,102.3 "/>
174
+ <polygon class="st11" points="138.3,102.3 138.8,102.2 139.2,102.2 139.7,102.1 140.1,102.1 140.6,102 141,101.8 141.4,101.7
175
+ 141.8,101.5 142.2,101.4 142.6,101.2 143,100.9 143.3,100.7 143.7,100.5 144,100.2 144.3,99.9 144.7,99.6 145,99.3 145.2,99
176
+ 145.5,98.6 145.8,98.3 146,97.9 146.2,97.5 146.4,97.2 146.6,96.8 146.7,96.3 146.9,95.9 147,95.5 147.1,95.1 147.2,94.6
177
+ 147.2,94.2 147.3,93.7 147.3,93.2 147.3,92.8 147.2,92.3 147.2,91.9 147.1,91.4 147,91 146.9,90.6 146.7,90.2 146.6,89.8
178
+ 146.4,89.4 146.2,89 146,88.6 145.8,88.2 145.5,87.9 145.2,87.5 145,87.2 144.7,86.9 144.3,86.6 144,86.3 143.7,86.1 143.3,85.8
179
+ 143,85.6 142.6,85.4 142.2,85.2 141.8,85 141.4,84.8 141,84.7 140.6,84.6 140.1,84.5 139.7,84.4 139.2,84.3 138.8,84.3
180
+ 138.3,84.3 137.8,84.3 137.4,84.3 136.9,84.4 136.5,84.5 136.1,84.6 135.6,84.7 135.2,84.8 134.8,85 134.4,85.2 134,85.4
181
+ 133.6,85.6 133.3,85.8 132.9,86.1 132.6,86.3 132.3,86.6 131.9,86.9 131.6,87.2 131.4,87.5 131.1,87.9 130.8,88.2 130.6,88.6
182
+ 130.4,89 130.2,89.4 130,89.8 129.9,90.2 129.7,90.6 129.6,91 129.5,91.4 129.4,91.9 129.3,92.3 129.3,92.8 129.3,93.2
183
+ 129.3,93.7 129.3,94.2 129.4,94.6 129.5,95.1 129.6,95.5 129.7,95.9 129.9,96.3 130,96.8 130.2,97.2 130.4,97.5 130.6,97.9
184
+ 130.8,98.3 131.1,98.6 131.4,99 131.6,99.3 131.9,99.6 132.3,99.9 132.6,100.2 132.9,100.5 133.3,100.7 133.6,100.9 134,101.2
185
+ 134.4,101.4 134.8,101.5 135.2,101.7 135.6,101.8 136.1,102 136.5,102.1 136.9,102.1 137.4,102.2 137.8,102.2 138.3,102.3
186
+ 138.3,102.3 "/>
187
+ <polygon class="st10" points="143.3,87.7 148,87.7 148,87.2 143.7,87.2 143.3,87.7 143.3,87.7 "/>
188
+ <polygon class="st10" points="142.6,88.8 148,88.8 148,88.3 142.8,88.3 142.6,88.8 142.6,88.8 "/>
189
+ <polygon class="st10" points="142,89.9 148,89.9 148,89.4 142.2,89.4 142,89.9 142,89.9 "/>
190
+ <polygon class="st10" points="141.7,91 148,91 148,90.5 141.8,90.5 141.7,91 141.7,91 "/>
191
+ <polygon class="st10" points="141.9,96.2 148.1,96.2 148.1,95.7 141.7,95.7 141.9,96.2 141.9,96.2 "/>
192
+ <polygon class="st10" points="142.3,97.3 148.1,97.3 148.1,96.8 142.1,96.8 142.3,97.3 142.3,97.3 "/>
193
+ <polygon class="st10" points="143,98.4 148.1,98.4 148.1,97.9 142.7,97.9 143,98.4 143,98.4 "/>
194
+ <polygon class="st10" points="143.9,99.5 148.1,99.5 148.1,99 143.4,99 143.9,99.5 143.9,99.5 "/>
195
+ <polygon class="st10" points="141.4,92.1 148,92.1 148,91.6 141.5,91.6 141.4,92.1 141.4,92.1 "/>
196
+ <polygon class="st10" points="145.5,95.1 148,95.1 148,94.6 145.6,94.6 145.5,95.1 145.5,95.1 "/>
197
+ <polygon class="st10" points="145.7,94.1 148,94.1 148,93.6 145.8,93.6 145.7,94.1 145.7,94.1 "/>
198
+ <polygon class="st10" points="141.3,93.6 141.9,93.6 141.9,94.1 141.3,94.1 141.3,93.6 141.3,93.6 "/>
199
+ <g>
200
+ <polygon class="st12" points="140.1,93 140,93 140,93 139.9,93 139.9,93 139.9,92.9 139.8,92.9 139.8,92.9 139.7,92.9
201
+ 139.7,92.9 139.6,92.9 139.6,92.9 139.5,92.9 139.5,92.9 139.4,92.9 139.3,92.9 139.2,92.9 139.2,92.9 139.1,92.9 139.1,93
202
+ 139,93 139,93 138.9,93 138.9,93.1 138.9,93.1 138.9,93.1 138.8,93.2 138.8,93.2 138.8,93.2 138.8,93.3 138.9,93.3 138.9,93.3
203
+ 138.9,93.4 139,93.4 139,93.5 139.1,93.5 139.2,93.6 139.3,93.6 139.4,93.6 139.5,93.7 139.6,93.7 139.7,93.7 139.8,93.8
204
+ 139.9,93.9 139.9,94 140,94.1 140,94.2 140,94.4 140,94.6 140,94.7 139.9,94.9 139.9,95 139.8,95.1 139.8,95.2 139.7,95.2
205
+ 139.6,95.3 139.5,95.4 139.4,95.4 139.3,95.4 139.2,95.5 139.1,95.5 139,95.5 138.9,95.5 138.8,95.5 138.7,95.5 138.6,95.5
206
+ 138.5,95.5 138.4,95.5 138.3,95.5 138.2,95.5 138.1,95.5 138,95.5 137.9,95.5 137.9,95.5 137.8,95.5 137.8,95.5 137.7,95.5
207
+ 137.7,95.4 137.6,95.4 137.6,95.4 137.5,95.4 137.6,94.7 137.7,94.7 137.7,94.7 137.7,94.8 137.8,94.8 137.9,94.8 137.9,94.8
208
+ 138,94.8 138.1,94.8 138.1,94.8 138.2,94.8 138.3,94.8 138.4,94.9 138.5,94.9 138.5,94.9 138.6,94.9 138.7,94.9 138.8,94.8
209
+ 138.9,94.8 138.9,94.8 139,94.7 139,94.7 139,94.7 139,94.6 139.1,94.6 139.1,94.5 139,94.4 139,94.3 138.9,94.3 138.8,94.2
210
+ 138.7,94.2 138.6,94.1 138.5,94.1 138.4,94 138.2,94 138.1,93.9 138,93.8 138,93.7 137.9,93.6 137.9,93.4 137.9,93.2 137.9,93.1
211
+ 137.9,93 138,92.9 138,92.8 138,92.7 138.1,92.6 138.2,92.5 138.2,92.5 138.3,92.4 138.4,92.4 138.5,92.3 138.6,92.3 138.8,92.2
212
+ 138.9,92.2 139.1,92.2 139.3,92.2 139.4,92.2 139.5,92.2 139.6,92.2 139.7,92.2 139.7,92.2 139.8,92.2 139.9,92.2 139.9,92.2
213
+ 140,92.2 140,92.3 140.1,92.3 140.1,92.3 140.1,92.3 140.2,92.3 140.2,92.3 140.2,92.3 140.1,93 140.1,93 "/>
214
+ <polygon class="st12" points="140.8,91.5 141.6,91.5 141.5,92.3 142,92.3 141.9,93 141.3,92.9 141.1,94.6 141.1,94.7 141.1,94.7
215
+ 141.1,94.8 141.1,94.8 141.2,94.8 141.3,94.9 141.3,94.9 141.4,94.9 141.5,94.9 141.5,94.9 141.6,94.9 141.6,94.8 141.7,94.8
216
+ 141.7,94.8 141.7,94.8 141.7,94.8 141.6,95.4 141.6,95.4 141.6,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.5
217
+ 141.4,95.5 141.4,95.5 141.4,95.5 141.3,95.5 141.3,95.5 141.3,95.5 141.2,95.5 141.2,95.5 141.1,95.5 140.9,95.5 140.8,95.5
218
+ 140.6,95.5 140.6,95.5 140.5,95.5 140.4,95.4 140.3,95.4 140.3,95.4 140.3,95.3 140.2,95.3 140.2,95.2 140.2,95.2 140.2,95.1
219
+ 140.2,95.1 140.2,95 140.2,94.9 140.2,94.8 140.8,91.5 140.8,91.5 "/>
220
+ <polygon class="st12" points="149.9,92.5 149.9,92.4 149.8,92.4 149.8,92.4 149.7,92.4 149.7,92.4 149.6,92.3 149.6,92.3
221
+ 149.5,92.3 149.5,92.3 149.4,92.3 149.3,92.3 149.3,92.3 149.2,92.2 149.1,92.2 149.1,92.2 149,92.2 148.9,92.2 148.8,92.2
222
+ 148.8,92.3 148.7,92.3 148.6,92.3 148.5,92.3 148.4,92.4 148.3,92.4 148.3,92.5 148.2,92.6 148.1,92.7 148,92.8 148,92.9
223
+ 147.9,93.1 147.8,93.2 147.8,93.4 147.8,93.5 147.8,93.6 147.8,93.7 147.8,93.9 147.8,94 147.8,94.1 147.8,94.1 147.8,94.2
224
+ 147.9,94.3 147.9,94.4 148,94.5 148.1,94.5 148.2,94.6 148.3,94.6 148.4,94.7 148.5,94.7 148.5,94.7 148.6,94.7 148.6,94.7
225
+ 148.7,94.7 148.7,94.7 148.8,94.7 148.9,94.7 149,94.7 149,94.7 149.1,94.7 149.2,94.7 149.3,94.7 149.3,94.6 149.4,94.6
226
+ 149.5,94.5 149.5,94.5 149.4,95.3 149.4,95.3 149.4,95.3 149.3,95.3 149.3,95.4 149.3,95.4 149.2,95.4 149.2,95.4 149.1,95.4
227
+ 149.1,95.5 149,95.5 148.9,95.5 148.8,95.5 148.7,95.5 148.5,95.5 148.4,95.5 148.2,95.5 148.1,95.5 147.9,95.5 147.8,95.4
228
+ 147.7,95.4 147.5,95.3 147.4,95.2 147.3,95.1 147.2,95 147.1,94.8 147,94.7 146.9,94.5 146.9,94.3 146.8,94.1 146.8,93.9
229
+ 146.8,93.7 146.8,93.4 146.9,93.3 146.9,93.2 146.9,93 147,92.9 147,92.8 147,92.7 147.1,92.6 147.1,92.5 147.2,92.4 147.2,92.3
230
+ 147.3,92.3 147.3,92.2 147.4,92.1 147.4,92 147.5,92 147.5,91.9 147.6,91.8 147.7,91.8 147.8,91.7 147.8,91.7 147.9,91.6
231
+ 148,91.6 148.1,91.6 148.2,91.5 148.3,91.5 148.4,91.5 148.5,91.5 148.6,91.4 148.7,91.4 148.8,91.4 148.9,91.4 149,91.4
232
+ 149.1,91.4 149.2,91.4 149.3,91.4 149.4,91.4 149.5,91.4 149.5,91.5 149.6,91.5 149.7,91.5 149.8,91.5 149.8,91.5 149.9,91.5
233
+ 149.9,91.6 150,91.6 150,91.6 150,91.6 150,91.6 149.9,92.5 149.9,92.5 "/>
234
+ <path class="st12" d="M157.2,91.6l-0.2,1.2l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
235
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
236
+ l-0.1,0.2l-0.1,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.1l0,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1
237
+ l0.1,0l0.2,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1-0.1l0-0.1v0l-0.1,0.3h0.8
238
+ l0.7-4H157.2z M156.8,93.8L156.8,93.8l0,0.2l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l-0.1,0.1l-0.1,0.1l-0.1,0l-0.1,0
239
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1-0.1l-0.1-0.1l-0.1-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1
240
+ l0-0.1l0-0.1l0.1-0.1l0.1-0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1
241
+ l0,0.1l0,0.1L156.8,93.8L156.8,93.8z"/>
242
+ <path class="st12" d="M137.7,92.9L137.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
243
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
244
+ l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
245
+ l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0
246
+ l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
247
+ l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
248
+ l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0.1l0,0.1
249
+ l0,0.1h0.8l0.1-0.7l0.3-1.6l0-0.1V93L137.7,92.9z M136.6,94.1L136.6,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
250
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
251
+ l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0,0h0h0l0,0l0,0l0,0l0,0V94.1L136.6,94.1L136.6,94.1z"/>
252
+ <polygon class="st12" points="131,95.5 130.2,95.5 130.8,91.5 132.3,91.5 132.4,93.9 133.4,91.5 134.9,91.5 134.2,95.5
253
+ 133.4,95.5 133.9,92.5 133.9,92.5 132.6,95.5 131.7,95.5 131.7,95.4 131.7,95.1 131.6,94.6 131.6,94.1 131.6,93.5 131.6,93
254
+ 131.5,92.7 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131,95.5 131,95.5 "/>
255
+ <path class="st12" d="M152.7,92.9L152.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
256
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
257
+ l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
258
+ l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l-0.1,0l-0.1,0
259
+ l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
260
+ l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
261
+ l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0v0.1l0,0.1l0,0.1
262
+ h0.8l0.1-0.7l0.3-1.6l0-0.1V93L152.7,92.9z M151.7,94.1L151.7,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0
263
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0
264
+ l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l0,0l0,0l0,0l0,0L151.7,94.1L151.7,94.1L151.7,94.1z"/>
265
+ <polygon class="st12" points="152.6,95.5 153.5,95.5 153.5,95.5 153.8,93.8 153.8,93.7 153.8,93.7 153.9,93.6 153.9,93.5
266
+ 153.9,93.5 153.9,93.4 154,93.3 154,93.3 154.1,93.2 154.1,93.2 154.2,93.1 154.3,93.1 154.4,93.1 154.5,93 154.6,93 154.7,93
267
+ 154.7,93 154.8,93 154.8,93 154.8,93 154.9,92.2 154.8,92.2 154.8,92.3 154.7,92.3 154.6,92.3 154.5,92.3 154.5,92.3 154.4,92.4
268
+ 154.4,92.4 154.3,92.5 154.2,92.5 154.2,92.5 154.2,92.6 154.1,92.6 154.1,92.7 154,92.8 154,92.8 154.1,92.3 153.2,92.3
269
+ 152.6,95.5 152.6,95.5 152.6,95.5 "/>
270
+ <polygon class="st12" points="144.6,95.5 145.5,95.5 145.5,95.5 145.8,93.8 145.8,93.7 145.8,93.7 145.8,93.6 145.8,93.5
271
+ 145.9,93.5 145.9,93.4 145.9,93.4 146,93.3 146,93.3 146.1,93.2 146.1,93.2 146.2,93.2 146.3,93.1 146.4,93.1 146.5,93.1
272
+ 146.6,93.1 146.6,93.1 146.6,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93
273
+ 146.7,93 146.7,92.9 146.8,92.8 146.8,92.8 146.8,92.7 146.8,92.6 146.9,92.5 146.9,92.5 146.9,92.4 147,92.4 147,92.3 147,92.3
274
+ 147,92.3 147,92.3 147,92.3 147,92.3 147,92.2 147,92.2 147,92.2 146.9,92.2 146.9,92.2 146.9,92.2 146.8,92.2 146.7,92.3
275
+ 146.6,92.3 146.6,92.3 146.5,92.3 146.4,92.3 146.4,92.4 146.3,92.4 146.3,92.4 146.2,92.5 146.2,92.5 146.1,92.6 146.1,92.6
276
+ 146,92.7 146,92.8 145.9,92.8 146.1,92.3 145.2,92.3 144.6,95.5 144.6,95.5 144.6,95.5 "/>
277
+ <path class="st12" d="M144.7,93.2l0-0.2l0-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
278
+ l-0.1,0l-0.1,0l-0.2,0l-0.2,0l-0.2,0.1l-0.2,0.1l-0.2,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l0,0.1l0,0.1
279
+ l0,0.1l0,0.1l0,0.1l0,0.2l0,0.2l0,0.2l0.1,0.2l0.1,0.2l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0l0.2,0l0.2,0l0.2,0
280
+ l0.1,0h0.1l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1-0.7l-0.1,0.1l-0.1,0l-0.1,0l-0.1,0
281
+ l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0
282
+ l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0h0.5v0h1.4l0-0.2l0-0.3l0-0.2L144.7,93.2z M143.9,93.5h-0.7l0,0h-0.4
283
+ l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0
284
+ l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1L143.9,93.5L143.9,93.5z"/>
285
+ </g>
286
+ </g>
287
+ <g>
288
+ <polygon class="st13" points="168.8,89.4 170.4,89.4 169.6,87.5 "/>
289
+ <path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
290
+ C188,88,187.8,87.8,187.7,87.8z"/>
291
+ <path class="st15" d="M202.4,85.7v0.8l-0.4-0.8h-3.2v0.8l-0.4-0.8H194c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3.1v0.4
292
+ c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1l-0.8,1.7l-0.8-1.7h-3.5v0.8l-0.4-0.8h-3l-1.4,3.2l-1.6,3.6h1.6h1.9l0.4-1.1h1l0.4,1.1h4v-0.8
293
+ l0.3,0.8h2l0.3-0.8v0.8h9.6v-1.8h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-1l0.6,1h3.2
294
+ v-6.8H202.4L202.4,85.7z M179.1,91.5H178v-3.8l-1.7,3.8h-1l-1.7-3.8v3.8h-2.3l-0.5-1h-2.3l-0.4,1.1h-1.3l2.1-4.9h1.7l1.9,4.6v-4.6
295
+ h1.9l1.5,3.3l1.4-3.3h1.9V91.5z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M189,89.7c0.1,0.3,0.2,0.5,0.2,0.9v1
296
+ H188V91c0-0.3,0-0.7-0.2-1c-0.2-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
297
+ c0,0.8-0.5,1.2-0.8,1.3C188.6,89.4,188.9,89.6,189,89.7z M191.1,91.5h-1.2v-4.9h1.2V91.5z M204.7,91.5H203l-2.2-3.7v3.7h-2.3
298
+ l-0.4-1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9c0.3-0.4,1-0.6,1.7-0.6h1.1v1
299
+ H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h1.7l1.9,4.6
300
+ v-4.6h1.7l2,3.4v-3.4h1.2v4.8H204.7L204.7,91.5z"/>
301
+ <g>
302
+ <polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
303
+ <polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
304
+ </g>
305
+ <polygon class="st13" points="176.9,95.9 176.9,96.8 179.5,96.8 179.5,97.8 176.9,97.8 176.9,98.8 179.7,98.8 181.1,97.4
306
+ 179.8,95.9 "/>
307
+ <path id="SVGCleanerId_0_3_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z"
308
+ />
309
+ <path class="st15" d="M208.2,97.1V94h-0.8h-2.1c-0.6,0-1.1,0.1-1.4,0.4V94h-3.2c-0.5,0-1.1,0.1-1.4,0.4V94h-5.6v0.4
310
+ c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-6.2v6.8h6.1l1-1l0.9,1h3.7v-1.6h0.5
311
+ c0.5,0,1.1,0,1.6-0.2v1.9h3.1V99h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4c0.6,0,1.2-0.1,1.6-0.4v0.4h3c0.6,0,1.2-0.1,1.7-0.3l0,0
312
+ c0.7-0.4,1.1-1.2,1.1-2.1C208.6,97.9,208.5,97.4,208.2,97.1z M186.9,98.2h-1.4v1.7h-2.2l-1.4-1.6l-1.4,1.6h-4.6V95h4.6l1.4,1.6
313
+ l1.4-1.6h3.7c0.9,0,1.9,0.3,1.9,1.6C188.9,97.9,187.9,98.2,186.9,98.2z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
314
+ c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
315
+ c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
316
+ M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
317
+ c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3c0,0.2,0.1,0.3,0.3,0.3
318
+ c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1C203.2,99.3,202.6,99.8,201.4,99.8z M207.3,99.3
319
+ c-0.3,0.3-0.8,0.5-1.4,0.5h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3
320
+ c-0.1-0.1-0.2-0.1-0.4-0.1c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1s-0.1,0.2-0.1,0.3
321
+ c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.1,0,0.1,0.1,0.1,0.1c0.2,0.3,0.3,0.6,0.3,1
322
+ C207.8,98.7,207.6,99,207.3,99.3z"/>
323
+ <path id="SVGCleanerId_1_3_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
324
+ s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
325
+ <g>
326
+ <path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
327
+ C188,88,187.8,87.8,187.7,87.8z"/>
328
+ <polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
329
+ <polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
330
+ </g>
331
+ <g>
332
+ <path id="SVGCleanerId_0_2_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z
333
+ "/>
334
+ </g>
335
+ <g>
336
+ <path id="SVGCleanerId_1_2_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
337
+ s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
338
+ </g>
339
+ <g>
340
+ <polygon class="st13" points="186.4,99.6 185.5,98.6 185.5,99.8 183.2,99.8 181.8,98.2 180.3,99.8 175.7,99.8 175.7,95 180.4,95
341
+ 181.8,96.5 182.5,95.7 180.8,94 174.7,94 174.7,100.7 180.8,100.7 181.8,99.7 182.7,100.7 186.4,100.7 "/>
342
+ <polygon class="st13" points="179.3,92.5 178.4,91.5 178,91.5 178,91.1 176.9,90.1 176.2,91.5 175.3,91.5 173.6,87.7 173.6,91.5
343
+ 171.3,91.5 170.8,90.5 168.4,90.5 168,91.5 166.7,91.5 168.8,86.7 170.5,86.7 172.4,91.3 172.4,86.7 173.5,86.7 172.5,85.7
344
+ 171.5,85.7 171.5,86.5 171.1,85.7 168.1,85.7 166.7,88.9 165.1,92.5 166.7,92.5 168.7,92.5 169.1,91.4 170.1,91.4 170.6,92.5
345
+ 174.4,92.5 174.4,91.6 174.8,92.5 176.8,92.5 177.1,91.6 177.1,92.5 "/>
346
+ <polygon class="st13" points="176.1,89.3 175,88.2 175.8,90 "/>
347
+ </g>
348
+ <g>
349
+ <path class="st14" d="M207.5,100.4c0.6-0.4,1-1.1,1.1-1.9l-1-1c0.1,0.2,0.1,0.4,0.1,0.7c0,0.4-0.1,0.8-0.4,1s-0.8,0.5-1.4,0.5
350
+ h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
351
+ c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.3,1.4-1.4l-0.8-0.8c-0.1,0.1-0.2,0.1-0.3,0.1v-0.4h-3.2c-0.5,0-1.1,0.1-1.4,0.4v-0.4h-5.7
352
+ v0.4c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-0.8l2.1,2.1l1-1.1h3.7
353
+ c0.9,0,1.9,0.3,1.9,1.6c0,1.4-1,1.7-2,1.7h-1.4v1l1,1v-1h0.3c0.5,0,1.1,0,1.6-0.2v1.9h3.1v-1.8h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4
354
+ c0.6,0,1.2-0.1,1.6-0.4v0.4h3C206.4,100.7,207,100.7,207.5,100.4L207.5,100.4z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
355
+ c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
356
+ c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
357
+ M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
358
+ c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3
359
+ c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1
360
+ C203.2,99.3,202.6,99.8,201.4,99.8z"/>
361
+ <path class="st14" d="M204.7,96.4c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.4,0,0.7,0.1,1,0.2l-1-1h-0.6
362
+ c-0.2,0-0.3,0-0.5,0.1C204.8,96.1,204.7,96.3,204.7,96.4z"/>
363
+ <polygon class="st14" points="202.3,92.3 202.4,92.5 202.5,92.5 "/>
364
+ <polygon class="st14" points="198.5,88.5 199.7,91.3 199.7,89.6 "/>
365
+ <path class="st14" d="M186.7,90.7h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-0.7l-1-1
366
+ v0.8h-2.3l-0.3-1.1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9
367
+ c0.3-0.4,1-0.6,1.7-0.6h1.1v1H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2
368
+ c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h0.7l-1-1h-1.8c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3v0.4c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1
369
+ l-0.8,1.7l-0.8-1.7h-3l1,1h1.4l1.2,2.6l0.4,0.4l1.2-3h1.9v4.9h-1.2v-3.8l-1.2,2.8l2,2h7.9L186.7,90.7z M189.9,86.7h1.2v4.9h-1.2
370
+ V86.7z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M185.8,91.5h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2
371
+ c0.3,0.2,0.6,0.6,0.6,1.1c0,0.8-0.5,1.2-0.8,1.3c0.3,0.1,0.5,0.3,0.6,0.4c0.1,0.3,0.2,0.5,0.2,0.9v1h-1.2v-0.6c0-0.3,0-0.7-0.2-1
372
+ c-0.1-0.1-0.3-0.1-0.7-0.1h-1.2V91.5L185.8,91.5z"/>
373
+ </g>
374
+ </g>
375
+ <g>
376
+ <path class="st16" d="M217.5,85c-1.8,0-3.1,1.1-3.1,3.1v5.7c0.1,0.7,0.9,1.2,1.7,1.2c0.9,0,1.6-0.7,1.6-1.5v-2.9h2.5v2.9
377
+ c0,1.6-2,2.4-3.5,2.4c-0.9,0-1.7-0.3-2.3-0.7v6.3h4c1.4,0,3-1.3,3-3V85L217.5,85L217.5,85z"/>
378
+ <path class="st17" d="M231.5,95h1.7c0.4,0,0.9-0.4,0.9-0.9s-0.4-0.9-0.9-0.9h-1.7V95z"/>
379
+ <path class="st17" d="M233.5,85c-1.8,0-3.1,1.1-3.1,3.1v2.6h4.7c0.7,0,1.2,0.6,1.2,1.2s-0.6,1.2-1.2,1.2c0.7,0,1.3,0.5,1.3,1.2
380
+ s-0.6,1.2-1.3,1.2h-4.7v6h4c1.4,0,3-1.3,3-3V85L233.5,85L233.5,85z"/>
381
+ <g>
382
+ <path class="st17" d="M234.1,92.1c0-0.4-0.4-0.9-0.9-0.9h-1.7v1.7h1.7C233.7,92.9,234.1,92.5,234.1,92.1z"/>
383
+ </g>
384
+ <path class="st18" d="M225.4,85c-1.8,0-3.1,1.1-3.1,3.1v3.2c0.4-0.4,1-0.6,1.6-0.6h4.2v0.9c-1-0.2-2-0.3-2.4-0.3
385
+ c-1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9c0.5,0,1.4-0.1,2.4-0.3v0.8h-4.2c-0.6,0-1.2-0.2-1.6-0.6v6.7h4c1.4,0,3-1.3,3-3V85L225.4,85
386
+ L225.4,85z"/>
387
+ </g>
388
+ <g>
389
+ <g>
390
+ <g>
391
+ <path class="st19" d="M97.6,86.4L95.4,100h3.5l2.2-13.7H97.6z M108.2,91.9c-1.2-0.6-2-1-2-1.6c0-0.6,0.6-1.1,2-1.1
392
+ c1.1,0,2,0.2,2.6,0.5l0.3,0.1l0.5-2.9c-0.7-0.3-1.8-0.6-3.1-0.6c-3.5,0-5.9,1.8-5.9,4.4c0,1.9,1.7,3,3.1,3.6
393
+ c1.4,0.6,1.8,1.1,1.8,1.6c0,0.9-1.1,1.3-2.1,1.3c-1.4,0-2.2-0.2-3.3-0.7l-0.5-0.2l-0.5,3c0.8,0.4,2.3,0.7,3.9,0.7
394
+ c3.7,0,6.1-1.8,6.1-4.5C111.2,94,110.2,92.9,108.2,91.9z M120.6,86.4h-2.7c-0.8,0-1.5,0.2-1.8,1.1l-5.2,12.5h3.7l1-2.7h4.1
395
+ l0.5,2.7h3.2L120.6,86.4z M116.6,94.6c0.1,0,1.4-4.4,1.4-4.4l1.1,4.4C119.1,94.6,117.3,94.6,116.6,94.6z M92.5,86.4l-3.4,9.3
396
+ l-0.4-1.8c-0.6-2.1-2.6-4.4-4.8-5.5L87,100h3.7l5.5-13.6L92.5,86.4L92.5,86.4z"/>
397
+ </g>
398
+ </g>
399
+ <path class="st20" d="M87.5,88.1c-0.3-1-1.1-1.7-2.3-1.8h-5.4l-0.1,0.3c4.2,1,7.8,4.3,9,7.3L87.5,88.1z"/>
400
+ </g>
401
+ </g>
402
+ </svg>
trunk/freemius-pricing/c03f665db27af43971565560adfba594.png ADDED
Binary file
trunk/freemius-pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png ADDED
Binary file
trunk/freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png ADDED
Binary file
trunk/freemius-pricing/e366d70661d8ad2493bd6afbd779f125.png ADDED
Binary file
trunk/freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png ADDED
Binary file
trunk/freemius-pricing/f928f1be99776af83e8e6be4baf8ffe7.svg ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{opacity:0.25;}
7
+ .st1{fill:#1FBC99;}
8
+ </style>
9
+ <g class="st0">
10
+ <g>
11
+ <path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
12
+ C930.2,519.6,931.8,518,934.5,517.1z"/>
13
+ <polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
14
+ <path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
15
+ c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
16
+ l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
17
+ <path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
18
+ c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
19
+ c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
20
+ c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
21
+ c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
22
+ c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
23
+ c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
24
+ c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
25
+ c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
26
+ c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
27
+ c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
28
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
29
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
30
+ c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
31
+ c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
32
+ C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
33
+ C790.8,820.5,790.5,818.6,791.2,818.1z"/>
34
+ </g>
35
+ <g>
36
+ <path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
37
+ C451.6,718.2,451,717.7,450.7,717.7z"/>
38
+ <path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
39
+ c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
40
+ </g>
41
+ <g>
42
+ <polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
43
+ <path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
44
+ l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
45
+ c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
46
+ l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
47
+ l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
48
+ c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
49
+ M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
50
+ />
51
+ </g>
52
+ <path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
53
+ c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
54
+ M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
55
+ l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
56
+ c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
57
+ <path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
58
+ c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
59
+ c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
60
+ c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
61
+ c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
62
+ c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
63
+ <path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
64
+ c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
65
+ c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
66
+ l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
67
+ c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
68
+ c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
69
+ <path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
70
+ c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
71
+ M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
72
+ l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
73
+ c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
74
+ c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
75
+ l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
76
+ c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
77
+ c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
78
+ c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
79
+ C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
80
+ <path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
81
+ c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
82
+ c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
83
+ c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
84
+ c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
85
+ c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
86
+ c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
87
+ l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
88
+ C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
89
+ C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
90
+ c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
91
+ c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
92
+ c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
93
+ c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
94
+ c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
95
+ L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
96
+ c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
97
+ <path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
98
+ c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
99
+ l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
100
+ c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
101
+ c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
102
+ c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
103
+ c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
104
+ l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
105
+ C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
106
+ c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
107
+ c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
108
+ c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
109
+ c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
110
+ c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
111
+ c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
112
+ c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
113
+ c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
114
+ />
115
+ <path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
116
+ c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
117
+ c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
118
+ c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
119
+ c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
120
+ C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
121
+ C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
122
+ C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
123
+ c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
124
+ c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
125
+ c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
126
+ C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
127
+ C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
128
+ C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
129
+ l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
130
+ c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
131
+ <path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
132
+ L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
133
+ c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
134
+ c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
135
+ l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
136
+ l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
137
+ C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
138
+ v0L745.1,378L745.1,378z"/>
139
+ <g>
140
+ <path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
141
+ l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
142
+ l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
143
+ M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
144
+ c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
145
+ c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
146
+ <path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
147
+ </g>
148
+ <polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
149
+ 934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
150
+ <path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
151
+ c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
152
+ c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
153
+ c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
154
+ l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
155
+ C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
156
+ C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
157
+ C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
158
+ C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
159
+ C415.1,266.7,415.2,266.4,415.3,266z"/>
160
+ <path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
161
+ L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
162
+ z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
163
+ <path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
164
+ c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
165
+ l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
166
+ c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
167
+ c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
168
+ C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
169
+ c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
170
+ c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
171
+ l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
172
+ c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
173
+ c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
174
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
175
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
176
+ c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
177
+ <g>
178
+ <path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
179
+ c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
180
+ c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
181
+ c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
182
+ c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
183
+ c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
184
+ <path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
185
+ c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
186
+ c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
187
+ c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
188
+ l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
189
+ v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
190
+ </g>
191
+ <path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
192
+ c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
193
+ c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
194
+ c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
195
+ c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
196
+ l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
197
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
198
+ c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
199
+ c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
200
+ l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
201
+ C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
202
+ c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
203
+ c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
204
+ M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
205
+ L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
206
+ <path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
207
+ c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
208
+ c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
209
+ c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
210
+ c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
211
+ C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
212
+ c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
213
+ C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
214
+ c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
215
+ c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
216
+ C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
217
+ c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
218
+ c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
219
+ c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
220
+ c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
221
+ l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
222
+ l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
223
+ M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
224
+ l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
225
+ c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
226
+ </g>
227
+ </svg>
trunk/freemius-pricing/fde48e4609a6ddc11d639fc2421f2afd.png ADDED
Binary file
trunk/freemius-pricing/freemius-pricing.js ADDED
@@ -0,0 +1,15857 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !(function (e, n) {
2
+ 'object' == typeof exports && 'object' == typeof module
3
+ ? (module.exports = n())
4
+ : 'function' == typeof define && define.amd
5
+ ? define([], n)
6
+ : 'object' == typeof exports
7
+ ? (exports.Freemius = n())
8
+ : (e.Freemius = n())
9
+ })(window, function () {
10
+ return (function (e) {
11
+ var n = {}
12
+ function t(a) {
13
+ if (n[a]) return n[a].exports
14
+ var i = (n[a] = { i: a, l: !1, exports: {} })
15
+ return e[a].call(i.exports, i, i.exports, t), (i.l = !0), i.exports
16
+ }
17
+ return (
18
+ (t.m = e),
19
+ (t.c = n),
20
+ (t.d = function (e, n, a) {
21
+ t.o(e, n) ||
22
+ Object.defineProperty(e, n, { enumerable: !0, get: a })
23
+ }),
24
+ (t.r = function (e) {
25
+ 'undefined' != typeof Symbol &&
26
+ Symbol.toStringTag &&
27
+ Object.defineProperty(e, Symbol.toStringTag, {
28
+ value: 'Module',
29
+ }),
30
+ Object.defineProperty(e, '__esModule', { value: !0 })
31
+ }),
32
+ (t.t = function (e, n) {
33
+ if ((1 & n && (e = t(e)), 8 & n)) return e
34
+ if (4 & n && 'object' == typeof e && e && e.__esModule) return e
35
+ var a = Object.create(null)
36
+ if (
37
+ (t.r(a),
38
+ Object.defineProperty(a, 'default', {
39
+ enumerable: !0,
40
+ value: e,
41
+ }),
42
+ 2 & n && 'string' != typeof e)
43
+ )
44
+ for (var i in e)
45
+ t.d(
46
+ a,
47
+ i,
48
+ function (n) {
49
+ return e[n]
50
+ }.bind(null, i)
51
+ )
52
+ return a
53
+ }),
54
+ (t.n = function (e) {
55
+ var n =
56
+ e && e.__esModule
57
+ ? function () {
58
+ return e.default
59
+ }
60
+ : function () {
61
+ return e
62
+ }
63
+ return t.d(n, 'a', n), n
64
+ }),
65
+ (t.o = function (e, n) {
66
+ return Object.prototype.hasOwnProperty.call(e, n)
67
+ }),
68
+ (t.p = ''),
69
+ t((t.s = 35))
70
+ )
71
+ })([
72
+ function (e, n, t) {
73
+ 'use strict'
74
+ e.exports = t(20)
75
+ },
76
+ function (e, n, t) {
77
+ e.exports = t(30)()
78
+ },
79
+ function (e, n, t) {
80
+ 'use strict'
81
+ ;(function (e, a) {
82
+ /*!
83
+ * Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com
84
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
85
+ */
86
+ function i(e) {
87
+ return (i =
88
+ 'function' == typeof Symbol &&
89
+ 'symbol' == typeof Symbol.iterator
90
+ ? function (e) {
91
+ return typeof e
92
+ }
93
+ : function (e) {
94
+ return e &&
95
+ 'function' == typeof Symbol &&
96
+ e.constructor === Symbol &&
97
+ e !== Symbol.prototype
98
+ ? 'symbol'
99
+ : typeof e
100
+ })(e)
101
+ }
102
+ function s(e, n) {
103
+ for (var t = 0; t < n.length; t++) {
104
+ var a = n[t]
105
+ ;(a.enumerable = a.enumerable || !1),
106
+ (a.configurable = !0),
107
+ 'value' in a && (a.writable = !0),
108
+ Object.defineProperty(e, a.key, a)
109
+ }
110
+ }
111
+ function r(e, n, t) {
112
+ return (
113
+ n in e
114
+ ? Object.defineProperty(e, n, {
115
+ value: t,
116
+ enumerable: !0,
117
+ configurable: !0,
118
+ writable: !0,
119
+ })
120
+ : (e[n] = t),
121
+ e
122
+ )
123
+ }
124
+ function o(e) {
125
+ for (var n = 1; n < arguments.length; n++) {
126
+ var t = null != arguments[n] ? arguments[n] : {},
127
+ a = Object.keys(t)
128
+ 'function' == typeof Object.getOwnPropertySymbols &&
129
+ (a = a.concat(
130
+ Object.getOwnPropertySymbols(t).filter(
131
+ function (e) {
132
+ return Object.getOwnPropertyDescriptor(
133
+ t,
134
+ e
135
+ ).enumerable
136
+ }
137
+ )
138
+ )),
139
+ a.forEach(function (n) {
140
+ r(e, n, t[n])
141
+ })
142
+ }
143
+ return e
144
+ }
145
+ function c(e, n) {
146
+ return (
147
+ (function (e) {
148
+ if (Array.isArray(e)) return e
149
+ })(e) ||
150
+ (function (e, n) {
151
+ var t = [],
152
+ a = !0,
153
+ i = !1,
154
+ s = void 0
155
+ try {
156
+ for (
157
+ var r, o = e[Symbol.iterator]();
158
+ !(a = (r = o.next()).done) &&
159
+ (t.push(r.value), !n || t.length !== n);
160
+ a = !0
161
+ );
162
+ } catch (e) {
163
+ ;(i = !0), (s = e)
164
+ } finally {
165
+ try {
166
+ a || null == o.return || o.return()
167
+ } finally {
168
+ if (i) throw s
169
+ }
170
+ }
171
+ return t
172
+ })(e, n) ||
173
+ (function () {
174
+ throw new TypeError(
175
+ 'Invalid attempt to destructure non-iterable instance'
176
+ )
177
+ })()
178
+ )
179
+ }
180
+ t.d(n, 'a', function () {
181
+ return Ee
182
+ }),
183
+ t.d(n, 'b', function () {
184
+ return _e
185
+ }),
186
+ t.d(n, 'c', function () {
187
+ return we
188
+ })
189
+ var l = function () {},
190
+ p = {},
191
+ f = {},
192
+ u = { mark: l, measure: l }
193
+ try {
194
+ 'undefined' != typeof window && (p = window),
195
+ 'undefined' != typeof document && (f = document),
196
+ 'undefined' != typeof MutationObserver &&
197
+ MutationObserver,
198
+ 'undefined' != typeof performance && (u = performance)
199
+ } catch (e) {}
200
+ var d = (p.navigator || {}).userAgent,
201
+ g = void 0 === d ? '' : d,
202
+ m = p,
203
+ h = f,
204
+ A = u,
205
+ k =
206
+ (m.document,
207
+ !!h.documentElement &&
208
+ !!h.head &&
209
+ 'function' == typeof h.addEventListener &&
210
+ 'function' == typeof h.createElement),
211
+ y =
212
+ (~g.indexOf('MSIE') || g.indexOf('Trident/'),
213
+ (function () {
214
+ try {
215
+ } catch (e) {
216
+ return !1
217
+ }
218
+ })(),
219
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
220
+ b = y.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
221
+ _ = {
222
+ GROUP: 'group',
223
+ SWAP_OPACITY: 'swap-opacity',
224
+ PRIMARY: 'primary',
225
+ SECONDARY: 'secondary',
226
+ },
227
+ v =
228
+ ([
229
+ 'xs',
230
+ 'sm',
231
+ 'lg',
232
+ 'fw',
233
+ 'ul',
234
+ 'li',
235
+ 'border',
236
+ 'pull-left',
237
+ 'pull-right',
238
+ 'spin',
239
+ 'pulse',
240
+ 'rotate-90',
241
+ 'rotate-180',
242
+ 'rotate-270',
243
+ 'flip-horizontal',
244
+ 'flip-vertical',
245
+ 'flip-both',
246
+ 'stack',
247
+ 'stack-1x',
248
+ 'stack-2x',
249
+ 'inverse',
250
+ 'layers',
251
+ 'layers-text',
252
+ 'layers-counter',
253
+ _.GROUP,
254
+ _.SWAP_OPACITY,
255
+ _.PRIMARY,
256
+ _.SECONDARY,
257
+ ]
258
+ .concat(
259
+ y.map(function (e) {
260
+ return ''.concat(e, 'x')
261
+ })
262
+ )
263
+ .concat(
264
+ b.map(function (e) {
265
+ return 'w-'.concat(e)
266
+ })
267
+ ),
268
+ m.FontAwesomeConfig || {})
269
+ if (h && 'function' == typeof h.querySelector) {
270
+ ;[
271
+ ['data-family-prefix', 'familyPrefix'],
272
+ ['data-replacement-class', 'replacementClass'],
273
+ ['data-auto-replace-svg', 'autoReplaceSvg'],
274
+ ['data-auto-add-css', 'autoAddCss'],
275
+ ['data-auto-a11y', 'autoA11y'],
276
+ ['data-search-pseudo-elements', 'searchPseudoElements'],
277
+ ['data-observe-mutations', 'observeMutations'],
278
+ ['data-mutate-approach', 'mutateApproach'],
279
+ ['data-keep-original-source', 'keepOriginalSource'],
280
+ ['data-measure-performance', 'measurePerformance'],
281
+ ['data-show-missing-icons', 'showMissingIcons'],
282
+ ].forEach(function (e) {
283
+ var n = c(e, 2),
284
+ t = n[0],
285
+ a = n[1],
286
+ i = (function (e) {
287
+ return (
288
+ '' === e ||
289
+ ('false' !== e && ('true' === e || e))
290
+ )
291
+ })(
292
+ (function (e) {
293
+ var n = h.querySelector('script[' + e + ']')
294
+ if (n) return n.getAttribute(e)
295
+ })(t)
296
+ )
297
+ null != i && (v[a] = i)
298
+ })
299
+ }
300
+ var w = o(
301
+ {},
302
+ {
303
+ familyPrefix: 'fa',
304
+ replacementClass: 'svg-inline--fa',
305
+ autoReplaceSvg: !0,
306
+ autoAddCss: !0,
307
+ autoA11y: !0,
308
+ searchPseudoElements: !1,
309
+ observeMutations: !0,
310
+ mutateApproach: 'async',
311
+ keepOriginalSource: !0,
312
+ measurePerformance: !1,
313
+ showMissingIcons: !0,
314
+ },
315
+ v
316
+ )
317
+ w.autoReplaceSvg || (w.observeMutations = !1)
318
+ var E = o({}, w)
319
+ m.FontAwesomeConfig = E
320
+ var C = m || {}
321
+ C.___FONT_AWESOME___ || (C.___FONT_AWESOME___ = {}),
322
+ C.___FONT_AWESOME___.styles ||
323
+ (C.___FONT_AWESOME___.styles = {}),
324
+ C.___FONT_AWESOME___.hooks ||
325
+ (C.___FONT_AWESOME___.hooks = {}),
326
+ C.___FONT_AWESOME___.shims ||
327
+ (C.___FONT_AWESOME___.shims = [])
328
+ var x = C.___FONT_AWESOME___,
329
+ B = []
330
+ k &&
331
+ ((h.documentElement.doScroll
332
+ ? /^loaded|^c/
333
+ : /^loaded|^i|^c/
334
+ ).test(h.readyState) ||
335
+ h.addEventListener('DOMContentLoaded', function e() {
336
+ h.removeEventListener('DOMContentLoaded', e),
337
+ 1,
338
+ B.map(function (e) {
339
+ return e()
340
+ })
341
+ }))
342
+ var S,
343
+ T = function () {},
344
+ P =
345
+ void 0 !== e &&
346
+ void 0 !== e.process &&
347
+ 'function' == typeof e.process.emit,
348
+ N = void 0 === a ? setTimeout : a,
349
+ M = []
350
+ function q() {
351
+ for (var e = 0; e < M.length; e++) M[e][0](M[e][1])
352
+ ;(M = []), (S = !1)
353
+ }
354
+ function I(e, n) {
355
+ M.push([e, n]), S || ((S = !0), N(q, 0))
356
+ }
357
+ function O(e) {
358
+ var n = e.owner,
359
+ t = n._state,
360
+ a = n._data,
361
+ i = e[t],
362
+ s = e.then
363
+ if ('function' == typeof i) {
364
+ t = 'fulfilled'
365
+ try {
366
+ a = i(a)
367
+ } catch (e) {
368
+ j(s, e)
369
+ }
370
+ }
371
+ z(s, a) ||
372
+ ('fulfilled' === t && L(s, a),
373
+ 'rejected' === t && j(s, a))
374
+ }
375
+ function z(e, n) {
376
+ var t
377
+ try {
378
+ if (e === n)
379
+ throw new TypeError(
380
+ 'A promises callback cannot return that same promise.'
381
+ )
382
+ if (
383
+ n &&
384
+ ('function' == typeof n || 'object' === i(n))
385
+ ) {
386
+ var a = n.then
387
+ if ('function' == typeof a)
388
+ return (
389
+ a.call(
390
+ n,
391
+ function (a) {
392
+ t ||
393
+ ((t = !0),
394
+ n === a ? U(e, a) : L(e, a))
395
+ },
396
+ function (n) {
397
+ t || ((t = !0), j(e, n))
398
+ }
399
+ ),
400
+ !0
401
+ )
402
+ }
403
+ } catch (n) {
404
+ return t || j(e, n), !0
405
+ }
406
+ return !1
407
+ }
408
+ function L(e, n) {
409
+ ;(e !== n && z(e, n)) || U(e, n)
410
+ }
411
+ function U(e, n) {
412
+ 'pending' === e._state &&
413
+ ((e._state = 'settled'), (e._data = n), I(F, e))
414
+ }
415
+ function j(e, n) {
416
+ 'pending' === e._state &&
417
+ ((e._state = 'settled'), (e._data = n), I(R, e))
418
+ }
419
+ function D(e) {
420
+ e._then = e._then.forEach(O)
421
+ }
422
+ function F(e) {
423
+ ;(e._state = 'fulfilled'), D(e)
424
+ }
425
+ function R(n) {
426
+ ;(n._state = 'rejected'),
427
+ D(n),
428
+ !n._handled &&
429
+ P &&
430
+ e.process.emit('unhandledRejection', n._data, n)
431
+ }
432
+ function Y(n) {
433
+ e.process.emit('rejectionHandled', n)
434
+ }
435
+ function Q(e) {
436
+ if ('function' != typeof e)
437
+ throw new TypeError(
438
+ 'Promise resolver ' + e + ' is not a function'
439
+ )
440
+ if (this instanceof Q == !1)
441
+ throw new TypeError(
442
+ "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."
443
+ )
444
+ ;(this._then = []),
445
+ (function (e, n) {
446
+ function t(e) {
447
+ j(n, e)
448
+ }
449
+ try {
450
+ e(function (e) {
451
+ L(n, e)
452
+ }, t)
453
+ } catch (e) {
454
+ t(e)
455
+ }
456
+ })(e, this)
457
+ }
458
+ ;(Q.prototype = {
459
+ constructor: Q,
460
+ _state: 'pending',
461
+ _then: null,
462
+ _data: void 0,
463
+ _handled: !1,
464
+ then: function (e, n) {
465
+ var t = {
466
+ owner: this,
467
+ then: new this.constructor(T),
468
+ fulfilled: e,
469
+ rejected: n,
470
+ }
471
+ return (
472
+ (!n && !e) ||
473
+ this._handled ||
474
+ ((this._handled = !0),
475
+ 'rejected' === this._state && P && I(Y, this)),
476
+ 'fulfilled' === this._state ||
477
+ 'rejected' === this._state
478
+ ? I(O, t)
479
+ : this._then.push(t),
480
+ t.then
481
+ )
482
+ },
483
+ catch: function (e) {
484
+ return this.then(null, e)
485
+ },
486
+ }),
487
+ (Q.all = function (e) {
488
+ if (!Array.isArray(e))
489
+ throw new TypeError(
490
+ 'You must pass an array to Promise.all().'
491
+ )
492
+ return new Q(function (n, t) {
493
+ var a = [],
494
+ i = 0
495
+ function s(e) {
496
+ return (
497
+ i++,
498
+ function (t) {
499
+ ;(a[e] = t), --i || n(a)
500
+ }
501
+ )
502
+ }
503
+ for (var r, o = 0; o < e.length; o++)
504
+ (r = e[o]) && 'function' == typeof r.then
505
+ ? r.then(s(o), t)
506
+ : (a[o] = r)
507
+ i || n(a)
508
+ })
509
+ }),
510
+ (Q.race = function (e) {
511
+ if (!Array.isArray(e))
512
+ throw new TypeError(
513
+ 'You must pass an array to Promise.race().'
514
+ )
515
+ return new Q(function (n, t) {
516
+ for (var a, i = 0; i < e.length; i++)
517
+ (a = e[i]) && 'function' == typeof a.then
518
+ ? a.then(n, t)
519
+ : n(a)
520
+ })
521
+ }),
522
+ (Q.resolve = function (e) {
523
+ return e && 'object' === i(e) && e.constructor === Q
524
+ ? e
525
+ : new Q(function (n) {
526
+ n(e)
527
+ })
528
+ }),
529
+ (Q.reject = function (e) {
530
+ return new Q(function (n, t) {
531
+ t(e)
532
+ })
533
+ })
534
+ var W = {
535
+ size: 16,
536
+ x: 0,
537
+ y: 0,
538
+ rotate: 0,
539
+ flipX: !1,
540
+ flipY: !1,
541
+ }
542
+ function V(e) {
543
+ if (e && k) {
544
+ var n = h.createElement('style')
545
+ n.setAttribute('type', 'text/css'), (n.innerHTML = e)
546
+ for (
547
+ var t = h.head.childNodes,
548
+ a = null,
549
+ i = t.length - 1;
550
+ i > -1;
551
+ i--
552
+ ) {
553
+ var s = t[i],
554
+ r = (s.tagName || '').toUpperCase()
555
+ ;['STYLE', 'LINK'].indexOf(r) > -1 && (a = s)
556
+ }
557
+ return h.head.insertBefore(n, a), e
558
+ }
559
+ }
560
+ function H() {
561
+ for (var e = 12, n = ''; e-- > 0; )
562
+ n += '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'[
563
+ (62 * Math.random()) | 0
564
+ ]
565
+ return n
566
+ }
567
+ function $(e) {
568
+ return ''
569
+ .concat(e)
570
+ .replace(/&/g, '&amp;')
571
+ .replace(/"/g, '&quot;')
572
+ .replace(/'/g, '&#39;')
573
+ .replace(/</g, '&lt;')
574
+ .replace(/>/g, '&gt;')
575
+ }
576
+ function X(e) {
577
+ return Object.keys(e || {}).reduce(function (n, t) {
578
+ return n + ''.concat(t, ': ').concat(e[t], ';')
579
+ }, '')
580
+ }
581
+ function K(e) {
582
+ return (
583
+ e.size !== W.size ||
584
+ e.x !== W.x ||
585
+ e.y !== W.y ||
586
+ e.rotate !== W.rotate ||
587
+ e.flipX ||
588
+ e.flipY
589
+ )
590
+ }
591
+ function Z(e) {
592
+ var n = e.transform,
593
+ t = e.containerWidth,
594
+ a = e.iconWidth,
595
+ i = { transform: 'translate('.concat(t / 2, ' 256)') },
596
+ s = 'translate('
597
+ .concat(32 * n.x, ', ')
598
+ .concat(32 * n.y, ') '),
599
+ r = 'scale('
600
+ .concat((n.size / 16) * (n.flipX ? -1 : 1), ', ')
601
+ .concat((n.size / 16) * (n.flipY ? -1 : 1), ') '),
602
+ o = 'rotate('.concat(n.rotate, ' 0 0)')
603
+ return {
604
+ outer: i,
605
+ inner: {
606
+ transform: ''
607
+ .concat(s, ' ')
608
+ .concat(r, ' ')
609
+ .concat(o),
610
+ },
611
+ path: {
612
+ transform: 'translate('.concat(
613
+ (a / 2) * -1,
614
+ ' -256)'
615
+ ),
616
+ },
617
+ }
618
+ }
619
+ var G = { x: 0, y: 0, width: '100%', height: '100%' }
620
+ function J(e) {
621
+ var n =
622
+ !(arguments.length > 1 && void 0 !== arguments[1]) ||
623
+ arguments[1]
624
+ return (
625
+ e.attributes &&
626
+ (e.attributes.fill || n) &&
627
+ (e.attributes.fill = 'black'),
628
+ e
629
+ )
630
+ }
631
+ function ee(e) {
632
+ var n = e.icons,
633
+ t = n.main,
634
+ a = n.mask,
635
+ i = e.prefix,
636
+ s = e.iconName,
637
+ r = e.transform,
638
+ c = e.symbol,
639
+ l = e.title,
640
+ p = e.maskId,
641
+ f = e.titleId,
642
+ u = e.extra,
643
+ d = e.watchable,
644
+ g = void 0 !== d && d,
645
+ m = a.found ? a : t,
646
+ h = m.width,
647
+ A = m.height,
648
+ k = 'fak' === i,
649
+ y = k ? '' : 'fa-w-'.concat(Math.ceil((h / A) * 16)),
650
+ b = [
651
+ E.replacementClass,
652
+ s ? ''.concat(E.familyPrefix, '-').concat(s) : '',
653
+ y,
654
+ ]
655
+ .filter(function (e) {
656
+ return -1 === u.classes.indexOf(e)
657
+ })
658
+ .filter(function (e) {
659
+ return '' !== e || !!e
660
+ })
661
+ .concat(u.classes)
662
+ .join(' '),
663
+ _ = {
664
+ children: [],
665
+ attributes: o({}, u.attributes, {
666
+ 'data-prefix': i,
667
+ 'data-icon': s,
668
+ class: b,
669
+ role: u.attributes.role || 'img',
670
+ xmlns: 'http://www.w3.org/2000/svg',
671
+ viewBox: '0 0 '.concat(h, ' ').concat(A),
672
+ }),
673
+ },
674
+ v =
675
+ k && !~u.classes.indexOf('fa-fw')
676
+ ? {
677
+ width: ''.concat(
678
+ (h / A) * 16 * 0.0625,
679
+ 'em'
680
+ ),
681
+ }
682
+ : {}
683
+ g && (_.attributes['data-fa-i2svg'] = ''),
684
+ l &&
685
+ _.children.push({
686
+ tag: 'title',
687
+ attributes: {
688
+ id:
689
+ _.attributes['aria-labelledby'] ||
690
+ 'title-'.concat(f || H()),
691
+ },
692
+ children: [l],
693
+ })
694
+ var w = o({}, _, {
695
+ prefix: i,
696
+ iconName: s,
697
+ main: t,
698
+ mask: a,
699
+ maskId: p,
700
+ transform: r,
701
+ symbol: c,
702
+ styles: o({}, v, u.styles),
703
+ }),
704
+ C =
705
+ a.found && t.found
706
+ ? (function (e) {
707
+ var n,
708
+ t = e.children,
709
+ a = e.attributes,
710
+ i = e.main,
711
+ s = e.mask,
712
+ r = e.maskId,
713
+ c = e.transform,
714
+ l = i.width,
715
+ p = i.icon,
716
+ f = s.width,
717
+ u = s.icon,
718
+ d = Z({
719
+ transform: c,
720
+ containerWidth: f,
721
+ iconWidth: l,
722
+ }),
723
+ g = {
724
+ tag: 'rect',
725
+ attributes: o({}, G, {
726
+ fill: 'white',
727
+ }),
728
+ },
729
+ m = p.children
730
+ ? {
731
+ children: p.children.map(
732
+ J
733
+ ),
734
+ }
735
+ : {},
736
+ h = {
737
+ tag: 'g',
738
+ attributes: o({}, d.inner),
739
+ children: [
740
+ J(
741
+ o(
742
+ {
743
+ tag: p.tag,
744
+ attributes: o(
745
+ {},
746
+ p.attributes,
747
+ d.path
748
+ ),
749
+ },
750
+ m
751
+ )
752
+ ),
753
+ ],
754
+ },
755
+ A = {
756
+ tag: 'g',
757
+ attributes: o({}, d.outer),
758
+ children: [h],
759
+ },
760
+ k = 'mask-'.concat(r || H()),
761
+ y = 'clip-'.concat(r || H()),
762
+ b = {
763
+ tag: 'mask',
764
+ attributes: o({}, G, {
765
+ id: k,
766
+ maskUnits: 'userSpaceOnUse',
767
+ maskContentUnits:
768
+ 'userSpaceOnUse',
769
+ }),
770
+ children: [g, A],
771
+ },
772
+ _ = {
773
+ tag: 'defs',
774
+ children: [
775
+ {
776
+ tag: 'clipPath',
777
+ attributes: { id: y },
778
+ children:
779
+ ((n = u),
780
+ 'g' === n.tag
781
+ ? n.children
782
+ : [n]),
783
+ },
784
+ b,
785
+ ],
786
+ }
787
+ return (
788
+ t.push(_, {
789
+ tag: 'rect',
790
+ attributes: o(
791
+ {
792
+ fill: 'currentColor',
793
+ 'clip-path': 'url(#'.concat(
794
+ y,
795
+ ')'
796
+ ),
797
+ mask: 'url(#'.concat(
798
+ k,
799
+ ')'
800
+ ),
801
+ },
802
+ G
803
+ ),
804
+ }),
805
+ { children: t, attributes: a }
806
+ )
807
+ })(w)
808
+ : (function (e) {
809
+ var n = e.children,
810
+ t = e.attributes,
811
+ a = e.main,
812
+ i = e.transform,
813
+ s = X(e.styles)
814
+ if (
815
+ (s.length > 0 && (t.style = s),
816
+ K(i))
817
+ ) {
818
+ var r = Z({
819
+ transform: i,
820
+ containerWidth: a.width,
821
+ iconWidth: a.width,
822
+ })
823
+ n.push({
824
+ tag: 'g',
825
+ attributes: o({}, r.outer),
826
+ children: [
827
+ {
828
+ tag: 'g',
829
+ attributes: o(
830
+ {},
831
+ r.inner
832
+ ),
833
+ children: [
834
+ {
835
+ tag: a.icon.tag,
836
+ children:
837
+ a.icon
838
+ .children,
839
+ attributes: o(
840
+ {},
841
+ a.icon
842
+ .attributes,
843
+ r.path
844
+ ),
845
+ },
846
+ ],
847
+ },
848
+ ],
849
+ })
850
+ } else n.push(a.icon)
851
+ return { children: n, attributes: t }
852
+ })(w),
853
+ x = C.children,
854
+ B = C.attributes
855
+ return (
856
+ (w.children = x),
857
+ (w.attributes = B),
858
+ c
859
+ ? (function (e) {
860
+ var n = e.prefix,
861
+ t = e.iconName,
862
+ a = e.children,
863
+ i = e.attributes,
864
+ s = e.symbol
865
+ return [
866
+ {
867
+ tag: 'svg',
868
+ attributes: {
869
+ style: 'display: none;',
870
+ },
871
+ children: [
872
+ {
873
+ tag: 'symbol',
874
+ attributes: o({}, i, {
875
+ id:
876
+ !0 === s
877
+ ? ''
878
+ .concat(
879
+ n,
880
+ '-'
881
+ )
882
+ .concat(
883
+ E.familyPrefix,
884
+ '-'
885
+ )
886
+ .concat(
887
+ t
888
+ )
889
+ : s,
890
+ }),
891
+ children: a,
892
+ },
893
+ ],
894
+ },
895
+ ]
896
+ })(w)
897
+ : (function (e) {
898
+ var n = e.children,
899
+ t = e.main,
900
+ a = e.mask,
901
+ i = e.attributes,
902
+ s = e.styles,
903
+ r = e.transform
904
+ if (K(r) && t.found && !a.found) {
905
+ var c = {
906
+ x: t.width / t.height / 2,
907
+ y: 0.5,
908
+ }
909
+ i.style = X(
910
+ o({}, s, {
911
+ 'transform-origin': ''
912
+ .concat(
913
+ c.x + r.x / 16,
914
+ 'em '
915
+ )
916
+ .concat(
917
+ c.y + r.y / 16,
918
+ 'em'
919
+ ),
920
+ })
921
+ )
922
+ }
923
+ return [
924
+ {
925
+ tag: 'svg',
926
+ attributes: i,
927
+ children: n,
928
+ },
929
+ ]
930
+ })(w)
931
+ )
932
+ }
933
+ var ne = function () {},
934
+ te =
935
+ (E.measurePerformance && A && A.mark && A.measure,
936
+ function (e, n, t, a) {
937
+ var i,
938
+ s,
939
+ r,
940
+ o = Object.keys(e),
941
+ c = o.length,
942
+ l =
943
+ void 0 !== a
944
+ ? (function (e, n) {
945
+ return function (t, a, i, s) {
946
+ return e.call(n, t, a, i, s)
947
+ }
948
+ })(n, a)
949
+ : n
950
+ for (
951
+ void 0 === t
952
+ ? ((i = 1), (r = e[o[0]]))
953
+ : ((i = 0), (r = t));
954
+ i < c;
955
+ i++
956
+ )
957
+ r = l(r, e[(s = o[i])], s, e)
958
+ return r
959
+ })
960
+ function ae(e, n) {
961
+ var t =
962
+ arguments.length > 2 && void 0 !== arguments[2]
963
+ ? arguments[2]
964
+ : {},
965
+ a = t.skipHooks,
966
+ i = void 0 !== a && a,
967
+ s = Object.keys(n).reduce(function (e, t) {
968
+ var a = n[t]
969
+ return (
970
+ !!a.icon
971
+ ? (e[a.iconName] = a.icon)
972
+ : (e[t] = a),
973
+ e
974
+ )
975
+ }, {})
976
+ 'function' != typeof x.hooks.addPack || i
977
+ ? (x.styles[e] = o({}, x.styles[e] || {}, s))
978
+ : x.hooks.addPack(e, s),
979
+ 'fas' === e && ae('fa', n)
980
+ }
981
+ var ie = x.styles,
982
+ se = x.shims,
983
+ re = function () {
984
+ var e = function (e) {
985
+ return te(
986
+ ie,
987
+ function (n, t, a) {
988
+ return (n[a] = te(t, e, {})), n
989
+ },
990
+ {}
991
+ )
992
+ }
993
+ e(function (e, n, t) {
994
+ return n[3] && (e[n[3]] = t), e
995
+ }),
996
+ e(function (e, n, t) {
997
+ var a = n[2]
998
+ return (
999
+ (e[t] = t),
1000
+ a.forEach(function (n) {
1001
+ e[n] = t
1002
+ }),
1003
+ e
1004
+ )
1005
+ })
1006
+ var n = 'far' in ie
1007
+ te(
1008
+ se,
1009
+ function (e, t) {
1010
+ var a = t[0],
1011
+ i = t[1],
1012
+ s = t[2]
1013
+ return (
1014
+ 'far' !== i || n || (i = 'fas'),
1015
+ (e[a] = { prefix: i, iconName: s }),
1016
+ e
1017
+ )
1018
+ },
1019
+ {}
1020
+ )
1021
+ }
1022
+ re()
1023
+ x.styles
1024
+ function oe(e, n, t) {
1025
+ if (e && e[n] && e[n][t])
1026
+ return { prefix: n, iconName: t, icon: e[n][t] }
1027
+ }
1028
+ function ce(e) {
1029
+ var n = e.tag,
1030
+ t = e.attributes,
1031
+ a = void 0 === t ? {} : t,
1032
+ i = e.children,
1033
+ s = void 0 === i ? [] : i
1034
+ return 'string' == typeof e
1035
+ ? $(e)
1036
+ : '<'
1037
+ .concat(n, ' ')
1038
+ .concat(
1039
+ (function (e) {
1040
+ return Object.keys(e || {})
1041
+ .reduce(function (n, t) {
1042
+ return (
1043
+ n +
1044
+ ''
1045
+ .concat(t, '="')
1046
+ .concat($(e[t]), '" ')
1047
+ )
1048
+ }, '')
1049
+ .trim()
1050
+ })(a),
1051
+ '>'
1052
+ )
1053
+ .concat(s.map(ce).join(''), '</')
1054
+ .concat(n, '>')
1055
+ }
1056
+ var le = function (e) {
1057
+ var n = {
1058
+ size: 16,
1059
+ x: 0,
1060
+ y: 0,
1061
+ flipX: !1,
1062
+ flipY: !1,
1063
+ rotate: 0,
1064
+ }
1065
+ return e
1066
+ ? e
1067
+ .toLowerCase()
1068
+ .split(' ')
1069
+ .reduce(function (e, n) {
1070
+ var t = n.toLowerCase().split('-'),
1071
+ a = t[0],
1072
+ i = t.slice(1).join('-')
1073
+ if (a && 'h' === i) return (e.flipX = !0), e
1074
+ if (a && 'v' === i) return (e.flipY = !0), e
1075
+ if (((i = parseFloat(i)), isNaN(i)))
1076
+ return e
1077
+ switch (a) {
1078
+ case 'grow':
1079
+ e.size = e.size + i
1080
+ break
1081
+ case 'shrink':
1082
+ e.size = e.size - i
1083
+ break
1084
+ case 'left':
1085
+ e.x = e.x - i
1086
+ break
1087
+ case 'right':
1088
+ e.x = e.x + i
1089
+ break
1090
+ case 'up':
1091
+ e.y = e.y - i
1092
+ break
1093
+ case 'down':
1094
+ e.y = e.y + i
1095
+ break
1096
+ case 'rotate':
1097
+ e.rotate = e.rotate + i
1098
+ }
1099
+ return e
1100
+ }, n)
1101
+ : n
1102
+ }
1103
+ function pe(e) {
1104
+ ;(this.name = 'MissingIcon'),
1105
+ (this.message = e || 'Icon unavailable'),
1106
+ (this.stack = new Error().stack)
1107
+ }
1108
+ ;(pe.prototype = Object.create(Error.prototype)),
1109
+ (pe.prototype.constructor = pe)
1110
+ var fe = { fill: 'currentColor' },
1111
+ ue = {
1112
+ attributeType: 'XML',
1113
+ repeatCount: 'indefinite',
1114
+ dur: '2s',
1115
+ },
1116
+ de = {
1117
+ tag: 'path',
1118
+ attributes: o({}, fe, {
1119
+ d:
1120
+ 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z',
1121
+ }),
1122
+ },
1123
+ ge = o({}, ue, { attributeName: 'opacity' })
1124
+ o({}, fe, { cx: '256', cy: '364', r: '28' }),
1125
+ o({}, ue, {
1126
+ attributeName: 'r',
1127
+ values: '28;14;28;28;14;28;',
1128
+ }),
1129
+ o({}, ge, { values: '1;0;1;1;0;1;' }),
1130
+ o({}, fe, {
1131
+ opacity: '1',
1132
+ d:
1133
+ 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z',
1134
+ }),
1135
+ o({}, ge, { values: '1;0;0;0;0;1;' }),
1136
+ o({}, fe, {
1137
+ opacity: '0',
1138
+ d:
1139
+ 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z',
1140
+ }),
1141
+ o({}, ge, { values: '0;0;1;1;0;0;' }),
1142
+ x.styles
1143
+ function me(e) {
1144
+ var n = e[0],
1145
+ t = e[1],
1146
+ a = c(e.slice(4), 1)[0]
1147
+ return {
1148
+ found: !0,
1149
+ width: n,
1150
+ height: t,
1151
+ icon: Array.isArray(a)
1152
+ ? {
1153
+ tag: 'g',
1154
+ attributes: {
1155
+ class: ''
1156
+ .concat(E.familyPrefix, '-')
1157
+ .concat(_.GROUP),
1158
+ },
1159
+ children: [
1160
+ {
1161
+ tag: 'path',
1162
+ attributes: {
1163
+ class: ''
1164
+ .concat(E.familyPrefix, '-')
1165
+ .concat(_.SECONDARY),
1166
+ fill: 'currentColor',
1167
+ d: a[0],
1168
+ },
1169
+ },
1170
+ {
1171
+ tag: 'path',
1172
+ attributes: {
1173
+ class: ''
1174
+ .concat(E.familyPrefix, '-')
1175
+ .concat(_.PRIMARY),
1176
+ fill: 'currentColor',
1177
+ d: a[1],
1178
+ },
1179
+ },
1180
+ ],
1181
+ }
1182
+ : {
1183
+ tag: 'path',
1184
+ attributes: { fill: 'currentColor', d: a },
1185
+ },
1186
+ }
1187
+ }
1188
+ x.styles
1189
+ function he() {
1190
+ var e = 'svg-inline--fa',
1191
+ n = E.familyPrefix,
1192
+ t = E.replacementClass,
1193
+ a =
1194
+ 'svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}'
1195
+ if ('fa' !== n || t !== e) {
1196
+ var i = new RegExp('\\.'.concat('fa', '\\-'), 'g'),
1197
+ s = new RegExp('\\--'.concat('fa', '\\-'), 'g'),
1198
+ r = new RegExp('\\.'.concat(e), 'g')
1199
+ a = a
1200
+ .replace(i, '.'.concat(n, '-'))
1201
+ .replace(s, '--'.concat(n, '-'))
1202
+ .replace(r, '.'.concat(t))
1203
+ }
1204
+ return a
1205
+ }
1206
+ function Ae() {
1207
+ E.autoAddCss && !ve && (V(he()), (ve = !0))
1208
+ }
1209
+ function ke(e, n) {
1210
+ return (
1211
+ Object.defineProperty(e, 'abstract', { get: n }),
1212
+ Object.defineProperty(e, 'html', {
1213
+ get: function () {
1214
+ return e.abstract.map(function (e) {
1215
+ return ce(e)
1216
+ })
1217
+ },
1218
+ }),
1219
+ Object.defineProperty(e, 'node', {
1220
+ get: function () {
1221
+ if (k) {
1222
+ var n = h.createElement('div')
1223
+ return (n.innerHTML = e.html), n.children
1224
+ }
1225
+ },
1226
+ }),
1227
+ e
1228
+ )
1229
+ }
1230
+ function ye(e) {
1231
+ var n = e.prefix,
1232
+ t = void 0 === n ? 'fa' : n,
1233
+ a = e.iconName
1234
+ if (a) return oe(_e.definitions, t, a) || oe(x.styles, t, a)
1235
+ }
1236
+ var be,
1237
+ _e = new ((function () {
1238
+ function e() {
1239
+ !(function (e, n) {
1240
+ if (!(e instanceof n))
1241
+ throw new TypeError(
1242
+ 'Cannot call a class as a function'
1243
+ )
1244
+ })(this, e),
1245
+ (this.definitions = {})
1246
+ }
1247
+ var n, t, a
1248
+ return (
1249
+ (n = e),
1250
+ (t = [
1251
+ {
1252
+ key: 'add',
1253
+ value: function () {
1254
+ for (
1255
+ var e = this,
1256
+ n = arguments.length,
1257
+ t = new Array(n),
1258
+ a = 0;
1259
+ a < n;
1260
+ a++
1261
+ )
1262
+ t[a] = arguments[a]
1263
+ var i = t.reduce(
1264
+ this._pullDefinitions,
1265
+ {}
1266
+ )
1267
+ Object.keys(i).forEach(function (n) {
1268
+ ;(e.definitions[n] = o(
1269
+ {},
1270
+ e.definitions[n] || {},
1271
+ i[n]
1272
+ )),
1273
+ ae(n, i[n]),
1274
+ re()
1275
+ })
1276
+ },
1277
+ },
1278
+ {
1279
+ key: 'reset',
1280
+ value: function () {
1281
+ this.definitions = {}
1282
+ },
1283
+ },
1284
+ {
1285
+ key: '_pullDefinitions',
1286
+ value: function (e, n) {
1287
+ var t =
1288
+ n.prefix && n.iconName && n.icon
1289
+ ? { 0: n }
1290
+ : n
1291
+ return (
1292
+ Object.keys(t).map(function (n) {
1293
+ var a = t[n],
1294
+ i = a.prefix,
1295
+ s = a.iconName,
1296
+ r = a.icon
1297
+ e[i] || (e[i] = {}),
1298
+ (e[i][s] = r)
1299
+ }),
1300
+ e
1301
+ )
1302
+ },
1303
+ },
1304
+ ]) && s(n.prototype, t),
1305
+ a && s(n, a),
1306
+ e
1307
+ )
1308
+ })())(),
1309
+ ve = !1,
1310
+ we = {
1311
+ transform: function (e) {
1312
+ return le(e)
1313
+ },
1314
+ },
1315
+ Ee =
1316
+ ((be = function (e) {
1317
+ var n =
1318
+ arguments.length > 1 &&
1319
+ void 0 !== arguments[1]
1320
+ ? arguments[1]
1321
+ : {},
1322
+ t = n.transform,
1323
+ a = void 0 === t ? W : t,
1324
+ i = n.symbol,
1325
+ s = void 0 !== i && i,
1326
+ r = n.mask,
1327
+ c = void 0 === r ? null : r,
1328
+ l = n.maskId,
1329
+ p = void 0 === l ? null : l,
1330
+ f = n.title,
1331
+ u = void 0 === f ? null : f,
1332
+ d = n.titleId,
1333
+ g = void 0 === d ? null : d,
1334
+ m = n.classes,
1335
+ h = void 0 === m ? [] : m,
1336
+ A = n.attributes,
1337
+ k = void 0 === A ? {} : A,
1338
+ y = n.styles,
1339
+ b = void 0 === y ? {} : y
1340
+ if (e) {
1341
+ var _ = e.prefix,
1342
+ v = e.iconName,
1343
+ w = e.icon
1344
+ return ke(o({ type: 'icon' }, e), function () {
1345
+ return (
1346
+ Ae(),
1347
+ E.autoA11y &&
1348
+ (u
1349
+ ? (k[
1350
+ 'aria-labelledby'
1351
+ ] = ''
1352
+ .concat(
1353
+ E.replacementClass,
1354
+ '-title-'
1355
+ )
1356
+ .concat(g || H()))
1357
+ : ((k['aria-hidden'] = 'true'),
1358
+ (k.focusable = 'false'))),
1359
+ ee({
1360
+ icons: {
1361
+ main: me(w),
1362
+ mask: c
1363
+ ? me(c.icon)
1364
+ : {
1365
+ found: !1,
1366
+ width: null,
1367
+ height: null,
1368
+ icon: {},
1369
+ },
1370
+ },
1371
+ prefix: _,
1372
+ iconName: v,
1373
+ transform: o({}, W, a),
1374
+ symbol: s,
1375
+ title: u,
1376
+ maskId: p,
1377
+ titleId: g,
1378
+ extra: {
1379
+ attributes: k,
1380
+ styles: b,
1381
+ classes: h,
1382
+ },
1383
+ })
1384
+ )
1385
+ })
1386
+ }
1387
+ }),
1388
+ function (e) {
1389
+ var n =
1390
+ arguments.length > 1 &&
1391
+ void 0 !== arguments[1]
1392
+ ? arguments[1]
1393
+ : {},
1394
+ t = (e || {}).icon ? e : ye(e || {}),
1395
+ a = n.mask
1396
+ return (
1397
+ a && (a = (a || {}).icon ? a : ye(a || {})),
1398
+ be(t, o({}, n, { mask: a }))
1399
+ )
1400
+ })
1401
+ }.call(this, t(3), t(27).setImmediate))
1402
+ },
1403
+ function (e, n) {
1404
+ var t
1405
+ t = (function () {
1406
+ return this
1407
+ })()
1408
+ try {
1409
+ t = t || new Function('return this')()
1410
+ } catch (e) {
1411
+ 'object' == typeof window && (t = window)
1412
+ }
1413
+ e.exports = t
1414
+ },
1415
+ function (e, n, t) {
1416
+ 'use strict'
1417
+ /*
1418
+ object-assign
1419
+ (c) Sindre Sorhus
1420
+ @license MIT
1421
+ */ var a =
1422
+ Object.getOwnPropertySymbols,
1423
+ i = Object.prototype.hasOwnProperty,
1424
+ s = Object.prototype.propertyIsEnumerable
1425
+ function r(e) {
1426
+ if (null == e)
1427
+ throw new TypeError(
1428
+ 'Object.assign cannot be called with null or undefined'
1429
+ )
1430
+ return Object(e)
1431
+ }
1432
+ e.exports = (function () {
1433
+ try {
1434
+ if (!Object.assign) return !1
1435
+ var e = new String('abc')
1436
+ if (
1437
+ ((e[5] = 'de'),
1438
+ '5' === Object.getOwnPropertyNames(e)[0])
1439
+ )
1440
+ return !1
1441
+ for (var n = {}, t = 0; t < 10; t++)
1442
+ n['_' + String.fromCharCode(t)] = t
1443
+ if (
1444
+ '0123456789' !==
1445
+ Object.getOwnPropertyNames(n)
1446
+ .map(function (e) {
1447
+ return n[e]
1448
+ })
1449
+ .join('')
1450
+ )
1451
+ return !1
1452
+ var a = {}
1453
+ return (
1454
+ 'abcdefghijklmnopqrst'.split('').forEach(function (e) {
1455
+ a[e] = e
1456
+ }),
1457
+ 'abcdefghijklmnopqrst' ===
1458
+ Object.keys(Object.assign({}, a)).join('')
1459
+ )
1460
+ } catch (e) {
1461
+ return !1
1462
+ }
1463
+ })()
1464
+ ? Object.assign
1465
+ : function (e, n) {
1466
+ for (
1467
+ var t, o, c = r(e), l = 1;
1468
+ l < arguments.length;
1469
+ l++
1470
+ ) {
1471
+ for (var p in (t = Object(arguments[l])))
1472
+ i.call(t, p) && (c[p] = t[p])
1473
+ if (a) {
1474
+ o = a(t)
1475
+ for (var f = 0; f < o.length; f++)
1476
+ s.call(t, o[f]) && (c[o[f]] = t[o[f]])
1477
+ }
1478
+ }
1479
+ return c
1480
+ }
1481
+ },
1482
+ function (e, n) {
1483
+ var t = {
1484
+ utf8: {
1485
+ stringToBytes: function (e) {
1486
+ return t.bin.stringToBytes(
1487
+ unescape(encodeURIComponent(e))
1488
+ )
1489
+ },
1490
+ bytesToString: function (e) {
1491
+ return decodeURIComponent(
1492
+ escape(t.bin.bytesToString(e))
1493
+ )
1494
+ },
1495
+ },
1496
+ bin: {
1497
+ stringToBytes: function (e) {
1498
+ for (var n = [], t = 0; t < e.length; t++)
1499
+ n.push(255 & e.charCodeAt(t))
1500
+ return n
1501
+ },
1502
+ bytesToString: function (e) {
1503
+ for (var n = [], t = 0; t < e.length; t++)
1504
+ n.push(String.fromCharCode(e[t]))
1505
+ return n.join('')
1506
+ },
1507
+ },
1508
+ }
1509
+ e.exports = t
1510
+ },
1511
+ function (e, n, t) {
1512
+ 'use strict'
1513
+ !(function e() {
1514
+ if (
1515
+ 'undefined' != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1516
+ 'function' == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE
1517
+ ) {
1518
+ 0
1519
+ try {
1520
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)
1521
+ } catch (e) {
1522
+ console.error(e)
1523
+ }
1524
+ }
1525
+ })(),
1526
+ (e.exports = t(21))
1527
+ },
1528
+ function (e, n, t) {
1529
+ 'use strict'
1530
+ e.exports = function (e) {
1531
+ var n = []
1532
+ return (
1533
+ (n.toString = function () {
1534
+ return this.map(function (n) {
1535
+ var t = (function (e, n) {
1536
+ var t = e[1] || '',
1537
+ a = e[3]
1538
+ if (!a) return t
1539
+ if (n && 'function' == typeof btoa) {
1540
+ var i =
1541
+ ((r = a),
1542
+ (o = btoa(
1543
+ unescape(
1544
+ encodeURIComponent(
1545
+ JSON.stringify(r)
1546
+ )
1547
+ )
1548
+ )),
1549
+ (c = 'sourceMappingURL=data:application/json;charset=utf-8;base64,'.concat(
1550
+ o
1551
+ )),
1552
+ '/*# '.concat(c, ' */')),
1553
+ s = a.sources.map(function (e) {
1554
+ return '/*# sourceURL='
1555
+ .concat(a.sourceRoot || '')
1556
+ .concat(e, ' */')
1557
+ })
1558
+ return [t].concat(s).concat([i]).join('\n')
1559
+ }
1560
+ var r, o, c
1561
+ return [t].join('\n')
1562
+ })(n, e)
1563
+ return n[2]
1564
+ ? '@media '.concat(n[2], ' {').concat(t, '}')
1565
+ : t
1566
+ }).join('')
1567
+ }),
1568
+ (n.i = function (e, t, a) {
1569
+ 'string' == typeof e && (e = [[null, e, '']])
1570
+ var i = {}
1571
+ if (a)
1572
+ for (var s = 0; s < this.length; s++) {
1573
+ var r = this[s][0]
1574
+ null != r && (i[r] = !0)
1575
+ }
1576
+ for (var o = 0; o < e.length; o++) {
1577
+ var c = [].concat(e[o])
1578
+ ;(a && i[c[0]]) ||
1579
+ (t &&
1580
+ (c[2]
1581
+ ? (c[2] = ''
1582
+ .concat(t, ' and ')
1583
+ .concat(c[2]))
1584
+ : (c[2] = t)),
1585
+ n.push(c))
1586
+ }
1587
+ }),
1588
+ n
1589
+ )
1590
+ }
1591
+ },
1592
+ function (e, n, t) {
1593
+ var a, i, s, r, o
1594
+ ;(a = t(32)),
1595
+ (i = t(5).utf8),
1596
+ (s = t(33)),
1597
+ (r = t(5).bin),
1598
+ ((o = function (e, n) {
1599
+ e.constructor == String
1600
+ ? (e =
1601
+ n && 'binary' === n.encoding
1602
+ ? r.stringToBytes(e)
1603
+ : i.stringToBytes(e))
1604
+ : s(e)
1605
+ ? (e = Array.prototype.slice.call(e, 0))
1606
+ : Array.isArray(e) ||
1607
+ e.constructor === Uint8Array ||
1608
+ (e = e.toString())
1609
+ for (
1610
+ var t = a.bytesToWords(e),
1611
+ c = 8 * e.length,
1612
+ l = 1732584193,
1613
+ p = -271733879,
1614
+ f = -1732584194,
1615
+ u = 271733878,
1616
+ d = 0;
1617
+ d < t.length;
1618
+ d++
1619
+ )
1620
+ t[d] =
1621
+ (16711935 & ((t[d] << 8) | (t[d] >>> 24))) |
1622
+ (4278255360 & ((t[d] << 24) | (t[d] >>> 8)))
1623
+ ;(t[c >>> 5] |= 128 << c % 32),
1624
+ (t[14 + (((c + 64) >>> 9) << 4)] = c)
1625
+ var g = o._ff,
1626
+ m = o._gg,
1627
+ h = o._hh,
1628
+ A = o._ii
1629
+ for (d = 0; d < t.length; d += 16) {
1630
+ var k = l,
1631
+ y = p,
1632
+ b = f,
1633
+ _ = u
1634
+ ;(l = g(l, p, f, u, t[d + 0], 7, -680876936)),
1635
+ (u = g(u, l, p, f, t[d + 1], 12, -389564586)),
1636
+ (f = g(f, u, l, p, t[d + 2], 17, 606105819)),
1637
+ (p = g(p, f, u, l, t[d + 3], 22, -1044525330)),
1638
+ (l = g(l, p, f, u, t[d + 4], 7, -176418897)),
1639
+ (u = g(u, l, p, f, t[d + 5], 12, 1200080426)),
1640
+ (f = g(f, u, l, p, t[d + 6], 17, -1473231341)),
1641
+ (p = g(p, f, u, l, t[d + 7], 22, -45705983)),
1642
+ (l = g(l, p, f, u, t[d + 8], 7, 1770035416)),
1643
+ (u = g(u, l, p, f, t[d + 9], 12, -1958414417)),
1644
+ (f = g(f, u, l, p, t[d + 10], 17, -42063)),
1645
+ (p = g(p, f, u, l, t[d + 11], 22, -1990404162)),
1646
+ (l = g(l, p, f, u, t[d + 12], 7, 1804603682)),
1647
+ (u = g(u, l, p, f, t[d + 13], 12, -40341101)),
1648
+ (f = g(f, u, l, p, t[d + 14], 17, -1502002290)),
1649
+ (l = m(
1650
+ l,
1651
+ (p = g(p, f, u, l, t[d + 15], 22, 1236535329)),
1652
+ f,
1653
+ u,
1654
+ t[d + 1],
1655
+ 5,
1656
+ -165796510
1657
+ )),
1658
+ (u = m(u, l, p, f, t[d + 6], 9, -1069501632)),
1659
+ (f = m(f, u, l, p, t[d + 11], 14, 643717713)),
1660
+ (p = m(p, f, u, l, t[d + 0], 20, -373897302)),
1661
+ (l = m(l, p, f, u, t[d + 5], 5, -701558691)),
1662
+ (u = m(u, l, p, f, t[d + 10], 9, 38016083)),
1663
+ (f = m(f, u, l, p, t[d + 15], 14, -660478335)),
1664
+ (p = m(p, f, u, l, t[d + 4], 20, -405537848)),
1665
+ (l = m(l, p, f, u, t[d + 9], 5, 568446438)),
1666
+ (u = m(u, l, p, f, t[d + 14], 9, -1019803690)),
1667
+ (f = m(f, u, l, p, t[d + 3], 14, -187363961)),
1668
+ (p = m(p, f, u, l, t[d + 8], 20, 1163531501)),
1669
+ (l = m(l, p, f, u, t[d + 13], 5, -1444681467)),
1670
+ (u = m(u, l, p, f, t[d + 2], 9, -51403784)),
1671
+ (f = m(f, u, l, p, t[d + 7], 14, 1735328473)),
1672
+ (l = h(
1673
+ l,
1674
+ (p = m(p, f, u, l, t[d + 12], 20, -1926607734)),
1675
+ f,
1676
+ u,
1677
+ t[d + 5],
1678
+ 4,
1679
+ -378558
1680
+ )),
1681
+ (u = h(u, l, p, f, t[d + 8], 11, -2022574463)),
1682
+ (f = h(f, u, l, p, t[d + 11], 16, 1839030562)),
1683
+ (p = h(p, f, u, l, t[d + 14], 23, -35309556)),
1684
+ (l = h(l, p, f, u, t[d + 1], 4, -1530992060)),
1685
+ (u = h(u, l, p, f, t[d + 4], 11, 1272893353)),
1686
+ (f = h(f, u, l, p, t[d + 7], 16, -155497632)),
1687
+ (p = h(p, f, u, l, t[d + 10], 23, -1094730640)),
1688
+ (l = h(l, p, f, u, t[d + 13], 4, 681279174)),
1689
+ (u = h(u, l, p, f, t[d + 0], 11, -358537222)),
1690
+ (f = h(f, u, l, p, t[d + 3], 16, -722521979)),
1691
+ (p = h(p, f, u, l, t[d + 6], 23, 76029189)),
1692
+ (l = h(l, p, f, u, t[d + 9], 4, -640364487)),
1693
+ (u = h(u, l, p, f, t[d + 12], 11, -421815835)),
1694
+ (f = h(f, u, l, p, t[d + 15], 16, 530742520)),
1695
+ (l = A(
1696
+ l,
1697
+ (p = h(p, f, u, l, t[d + 2], 23, -995338651)),
1698
+ f,
1699
+ u,
1700
+ t[d + 0],
1701
+ 6,
1702
+ -198630844
1703
+ )),
1704
+ (u = A(u, l, p, f, t[d + 7], 10, 1126891415)),
1705
+ (f = A(f, u, l, p, t[d + 14], 15, -1416354905)),
1706
+ (p = A(p, f, u, l, t[d + 5], 21, -57434055)),
1707
+ (l = A(l, p, f, u, t[d + 12], 6, 1700485571)),
1708
+ (u = A(u, l, p, f, t[d + 3], 10, -1894986606)),
1709
+ (f = A(f, u, l, p, t[d + 10], 15, -1051523)),
1710
+ (p = A(p, f, u, l, t[d + 1], 21, -2054922799)),
1711
+ (l = A(l, p, f, u, t[d + 8], 6, 1873313359)),
1712
+ (u = A(u, l, p, f, t[d + 15], 10, -30611744)),
1713
+ (f = A(f, u, l, p, t[d + 6], 15, -1560198380)),
1714
+ (p = A(p, f, u, l, t[d + 13], 21, 1309151649)),
1715
+ (l = A(l, p, f, u, t[d + 4], 6, -145523070)),
1716
+ (u = A(u, l, p, f, t[d + 11], 10, -1120210379)),
1717
+ (f = A(f, u, l, p, t[d + 2], 15, 718787259)),
1718
+ (p = A(p, f, u, l, t[d + 9], 21, -343485551)),
1719
+ (l = (l + k) >>> 0),
1720
+ (p = (p + y) >>> 0),
1721
+ (f = (f + b) >>> 0),
1722
+ (u = (u + _) >>> 0)
1723
+ }
1724
+ return a.endian([l, p, f, u])
1725
+ })._ff = function (e, n, t, a, i, s, r) {
1726
+ var o = e + ((n & t) | (~n & a)) + (i >>> 0) + r
1727
+ return ((o << s) | (o >>> (32 - s))) + n
1728
+ }),
1729
+ (o._gg = function (e, n, t, a, i, s, r) {
1730
+ var o = e + ((n & a) | (t & ~a)) + (i >>> 0) + r
1731
+ return ((o << s) | (o >>> (32 - s))) + n
1732
+ }),
1733
+ (o._hh = function (e, n, t, a, i, s, r) {
1734
+ var o = e + (n ^ t ^ a) + (i >>> 0) + r
1735
+ return ((o << s) | (o >>> (32 - s))) + n
1736
+ }),
1737
+ (o._ii = function (e, n, t, a, i, s, r) {
1738
+ var o = e + (t ^ (n | ~a)) + (i >>> 0) + r
1739
+ return ((o << s) | (o >>> (32 - s))) + n
1740
+ }),
1741
+ (o._blocksize = 16),
1742
+ (o._digestsize = 16),
1743
+ (e.exports = function (e, n) {
1744
+ if (null == e) throw new Error('Illegal argument ' + e)
1745
+ var t = a.wordsToBytes(o(e, n))
1746
+ return n && n.asBytes
1747
+ ? t
1748
+ : n && n.asString
1749
+ ? r.bytesToString(t)
1750
+ : a.bytesToHex(t)
1751
+ })
1752
+ },
1753
+ function (e, n, t) {
1754
+ 'use strict'
1755
+ Object.defineProperty(n, '__esModule', { value: !0 })
1756
+ var a = [],
1757
+ i =
1758
+ 'M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z'
1759
+ ;(n.definition = {
1760
+ prefix: 'fas',
1761
+ iconName: 'arrow-left',
1762
+ icon: [448, 512, a, 'f060', i],
1763
+ }),
1764
+ (n.faArrowLeft = n.definition),
1765
+ (n.prefix = 'fas'),
1766
+ (n.iconName = 'arrow-left'),
1767
+ (n.width = 448),
1768
+ (n.height = 512),
1769
+ (n.ligatures = a),
1770
+ (n.unicode = 'f060'),
1771
+ (n.svgPathData = i)
1772
+ },
1773
+ function (e, n, t) {
1774
+ 'use strict'
1775
+ Object.defineProperty(n, '__esModule', { value: !0 })
1776
+ var a = [],
1777
+ i =
1778
+ 'M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z'
1779
+ ;(n.definition = {
1780
+ prefix: 'fas',
1781
+ iconName: 'chevron-left',
1782
+ icon: [320, 512, a, 'f053', i],
1783
+ }),
1784
+ (n.faChevronLeft = n.definition),
1785
+ (n.prefix = 'fas'),
1786
+ (n.iconName = 'chevron-left'),
1787
+ (n.width = 320),
1788
+ (n.height = 512),
1789
+ (n.ligatures = a),
1790
+ (n.unicode = 'f053'),
1791
+ (n.svgPathData = i)
1792
+ },
1793
+ function (e, n, t) {
1794
+ 'use strict'
1795
+ Object.defineProperty(n, '__esModule', { value: !0 })
1796
+ var a = [],
1797
+ i =
1798
+ 'M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z'
1799
+ ;(n.definition = {
1800
+ prefix: 'fas',
1801
+ iconName: 'arrow-right',
1802
+ icon: [448, 512, a, 'f061', i],
1803
+ }),
1804
+ (n.faArrowRight = n.definition),
1805
+ (n.prefix = 'fas'),
1806
+ (n.iconName = 'arrow-right'),
1807
+ (n.width = 448),
1808
+ (n.height = 512),
1809
+ (n.ligatures = a),
1810
+ (n.unicode = 'f061'),
1811
+ (n.svgPathData = i)
1812
+ },
1813
+ function (e, n, t) {
1814
+ 'use strict'
1815
+ Object.defineProperty(n, '__esModule', { value: !0 })
1816
+ var a = [],
1817
+ i =
1818
+ 'M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'
1819
+ ;(n.definition = {
1820
+ prefix: 'fas',
1821
+ iconName: 'chevron-right',
1822
+ icon: [320, 512, a, 'f054', i],
1823
+ }),
1824
+ (n.faChevronRight = n.definition),
1825
+ (n.prefix = 'fas'),
1826
+ (n.iconName = 'chevron-right'),
1827
+ (n.width = 320),
1828
+ (n.height = 512),
1829
+ (n.ligatures = a),
1830
+ (n.unicode = 'f054'),
1831
+ (n.svgPathData = i)
1832
+ },
1833
+ function (e, n, t) {
1834
+ 'use strict'
1835
+ Object.defineProperty(n, '__esModule', { value: !0 })
1836
+ var a = [],
1837
+ i =
1838
+ 'M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z'
1839
+ ;(n.definition = {
1840
+ prefix: 'fas',
1841
+ iconName: 'check',
1842
+ icon: [512, 512, a, 'f00c', i],
1843
+ }),
1844
+ (n.faCheck = n.definition),
1845
+ (n.prefix = 'fas'),
1846
+ (n.iconName = 'check'),
1847
+ (n.width = 512),
1848
+ (n.height = 512),
1849
+ (n.ligatures = a),
1850
+ (n.unicode = 'f00c'),
1851
+ (n.svgPathData = i)
1852
+ },
1853
+ function (e, n, t) {
1854
+ 'use strict'
1855
+ Object.defineProperty(n, '__esModule', { value: !0 })
1856
+ var a = [],
1857
+ i =
1858
+ 'M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z'
1859
+ ;(n.definition = {
1860
+ prefix: 'far',
1861
+ iconName: 'circle',
1862
+ icon: [512, 512, a, 'f111', i],
1863
+ }),
1864
+ (n.faCircle = n.definition),
1865
+ (n.prefix = 'far'),
1866
+ (n.iconName = 'circle'),
1867
+ (n.width = 512),
1868
+ (n.height = 512),
1869
+ (n.ligatures = a),
1870
+ (n.unicode = 'f111'),
1871
+ (n.svgPathData = i)
1872
+ },
1873
+ function (e, n, t) {
1874
+ 'use strict'
1875
+ Object.defineProperty(n, '__esModule', { value: !0 })
1876
+ var a = [],
1877
+ i =
1878
+ 'M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z'
1879
+ ;(n.definition = {
1880
+ prefix: 'fas',
1881
+ iconName: 'question-circle',
1882
+ icon: [512, 512, a, 'f059', i],
1883
+ }),
1884
+ (n.faQuestionCircle = n.definition),
1885
+ (n.prefix = 'fas'),
1886
+ (n.iconName = 'question-circle'),
1887
+ (n.width = 512),
1888
+ (n.height = 512),
1889
+ (n.ligatures = a),
1890
+ (n.unicode = 'f059'),
1891
+ (n.svgPathData = i)
1892
+ },
1893
+ function (e, n, t) {
1894
+ 'use strict'
1895
+ Object.defineProperty(n, '__esModule', { value: !0 })
1896
+ var a = [],
1897
+ i =
1898
+ 'M464 256h-80v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8c-88.4 0-160 71.6-160 160v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48zm-288 0H96v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8C71.6 32 0 103.6 0 192v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z'
1899
+ ;(n.definition = {
1900
+ prefix: 'fas',
1901
+ iconName: 'quote-left',
1902
+ icon: [512, 512, a, 'f10d', i],
1903
+ }),
1904
+ (n.faQuoteLeft = n.definition),
1905
+ (n.prefix = 'fas'),
1906
+ (n.iconName = 'quote-left'),
1907
+ (n.width = 512),
1908
+ (n.height = 512),
1909
+ (n.ligatures = a),
1910
+ (n.unicode = 'f10d'),
1911
+ (n.svgPathData = i)
1912
+ },
1913
+ function (e, n, t) {
1914
+ 'use strict'
1915
+ Object.defineProperty(n, '__esModule', { value: !0 })
1916
+ var a = [],
1917
+ i =
1918
+ 'M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z'
1919
+ ;(n.definition = {
1920
+ prefix: 'fas',
1921
+ iconName: 'star',
1922
+ icon: [576, 512, a, 'f005', i],
1923
+ }),
1924
+ (n.faStar = n.definition),
1925
+ (n.prefix = 'fas'),
1926
+ (n.iconName = 'star'),
1927
+ (n.width = 576),
1928
+ (n.height = 512),
1929
+ (n.ligatures = a),
1930
+ (n.unicode = 'f005'),
1931
+ (n.svgPathData = i)
1932
+ },
1933
+ function (e, n, t) {
1934
+ 'use strict'
1935
+ Object.defineProperty(n, '__esModule', { value: !0 })
1936
+ var a = [],
1937
+ i =
1938
+ 'M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z'
1939
+ ;(n.definition = {
1940
+ prefix: 'fas',
1941
+ iconName: 'times-circle',
1942
+ icon: [512, 512, a, 'f057', i],
1943
+ }),
1944
+ (n.faTimesCircle = n.definition),
1945
+ (n.prefix = 'fas'),
1946
+ (n.iconName = 'times-circle'),
1947
+ (n.width = 512),
1948
+ (n.height = 512),
1949
+ (n.ligatures = a),
1950
+ (n.unicode = 'f057'),
1951
+ (n.svgPathData = i)
1952
+ },
1953
+ function (e, n, t) {
1954
+ let a = document.getElementById('fs_pricing_wrapper')
1955
+ a && a.dataset && a.dataset.publicUrl && (t.p = a.dataset.publicUrl)
1956
+ },
1957
+ function (e, n, t) {
1958
+ 'use strict'
1959
+ /** @license React v16.14.0
1960
+ * react.production.min.js
1961
+ *
1962
+ * Copyright (c) Facebook, Inc. and its affiliates.
1963
+ *
1964
+ * This source code is licensed under the MIT license found in the
1965
+ * LICENSE file in the root directory of this source tree.
1966
+ */ var a = t(4),
1967
+ i = 'function' == typeof Symbol && Symbol.for,
1968
+ s = i ? Symbol.for('react.element') : 60103,
1969
+ r = i ? Symbol.for('react.portal') : 60106,
1970
+ o = i ? Symbol.for('react.fragment') : 60107,
1971
+ c = i ? Symbol.for('react.strict_mode') : 60108,
1972
+ l = i ? Symbol.for('react.profiler') : 60114,
1973
+ p = i ? Symbol.for('react.provider') : 60109,
1974
+ f = i ? Symbol.for('react.context') : 60110,
1975
+ u = i ? Symbol.for('react.forward_ref') : 60112,
1976
+ d = i ? Symbol.for('react.suspense') : 60113,
1977
+ g = i ? Symbol.for('react.memo') : 60115,
1978
+ m = i ? Symbol.for('react.lazy') : 60116,
1979
+ h = 'function' == typeof Symbol && Symbol.iterator
1980
+ function A(e) {
1981
+ for (
1982
+ var n =
1983
+ 'https://reactjs.org/docs/error-decoder.html?invariant=' +
1984
+ e,
1985
+ t = 1;
1986
+ t < arguments.length;
1987
+ t++
1988
+ )
1989
+ n += '&args[]=' + encodeURIComponent(arguments[t])
1990
+ return (
1991
+ 'Minified React error #' +
1992
+ e +
1993
+ '; visit ' +
1994
+ n +
1995
+ ' for the full message or use the non-minified dev environment for full errors and additional helpful warnings.'
1996
+ )
1997
+ }
1998
+ var k = {
1999
+ isMounted: function () {
2000
+ return !1
2001
+ },
2002
+ enqueueForceUpdate: function () {},
2003
+ enqueueReplaceState: function () {},
2004
+ enqueueSetState: function () {},
2005
+ },
2006
+ y = {}
2007
+ function b(e, n, t) {
2008
+ ;(this.props = e),
2009
+ (this.context = n),
2010
+ (this.refs = y),
2011
+ (this.updater = t || k)
2012
+ }
2013
+ function _() {}
2014
+ function v(e, n, t) {
2015
+ ;(this.props = e),
2016
+ (this.context = n),
2017
+ (this.refs = y),
2018
+ (this.updater = t || k)
2019
+ }
2020
+ ;(b.prototype.isReactComponent = {}),
2021
+ (b.prototype.setState = function (e, n) {
2022
+ if (
2023
+ 'object' != typeof e &&
2024
+ 'function' != typeof e &&
2025
+ null != e
2026
+ )
2027
+ throw Error(A(85))
2028
+ this.updater.enqueueSetState(this, e, n, 'setState')
2029
+ }),
2030
+ (b.prototype.forceUpdate = function (e) {
2031
+ this.updater.enqueueForceUpdate(this, e, 'forceUpdate')
2032
+ }),
2033
+ (_.prototype = b.prototype)
2034
+ var w = (v.prototype = new _())
2035
+ ;(w.constructor = v),
2036
+ a(w, b.prototype),
2037
+ (w.isPureReactComponent = !0)
2038
+ var E = { current: null },
2039
+ C = Object.prototype.hasOwnProperty,
2040
+ x = { key: !0, ref: !0, __self: !0, __source: !0 }
2041
+ function B(e, n, t) {
2042
+ var a,
2043
+ i = {},
2044
+ r = null,
2045
+ o = null
2046
+ if (null != n)
2047
+ for (a in (void 0 !== n.ref && (o = n.ref),
2048
+ void 0 !== n.key && (r = '' + n.key),
2049
+ n))
2050
+ C.call(n, a) && !x.hasOwnProperty(a) && (i[a] = n[a])
2051
+ var c = arguments.length - 2
2052
+ if (1 === c) i.children = t
2053
+ else if (1 < c) {
2054
+ for (var l = Array(c), p = 0; p < c; p++)
2055
+ l[p] = arguments[p + 2]
2056
+ i.children = l
2057
+ }
2058
+ if (e && e.defaultProps)
2059
+ for (a in (c = e.defaultProps))
2060
+ void 0 === i[a] && (i[a] = c[a])
2061
+ return {
2062
+ $$typeof: s,
2063
+ type: e,
2064
+ key: r,
2065
+ ref: o,
2066
+ props: i,
2067
+ _owner: E.current,
2068
+ }
2069
+ }
2070
+ function S(e) {
2071
+ return 'object' == typeof e && null !== e && e.$$typeof === s
2072
+ }
2073
+ var T = /\/+/g,
2074
+ P = []
2075
+ function N(e, n, t, a) {
2076
+ if (P.length) {
2077
+ var i = P.pop()
2078
+ return (
2079
+ (i.result = e),
2080
+ (i.keyPrefix = n),
2081
+ (i.func = t),
2082
+ (i.context = a),
2083
+ (i.count = 0),
2084
+ i
2085
+ )
2086
+ }
2087
+ return {
2088
+ result: e,
2089
+ keyPrefix: n,
2090
+ func: t,
2091
+ context: a,
2092
+ count: 0,
2093
+ }
2094
+ }
2095
+ function M(e) {
2096
+ ;(e.result = null),
2097
+ (e.keyPrefix = null),
2098
+ (e.func = null),
2099
+ (e.context = null),
2100
+ (e.count = 0),
2101
+ 10 > P.length && P.push(e)
2102
+ }
2103
+ function q(e, n, t) {
2104
+ return null == e
2105
+ ? 0
2106
+ : (function e(n, t, a, i) {
2107
+ var o = typeof n
2108
+ ;('undefined' !== o && 'boolean' !== o) ||
2109
+ (n = null)
2110
+ var c = !1
2111
+ if (null === n) c = !0
2112
+ else
2113
+ switch (o) {
2114
+ case 'string':
2115
+ case 'number':
2116
+ c = !0
2117
+ break
2118
+ case 'object':
2119
+ switch (n.$$typeof) {
2120
+ case s:
2121
+ case r:
2122
+ c = !0
2123
+ }
2124
+ }
2125
+ if (c)
2126
+ return a(i, n, '' === t ? '.' + I(n, 0) : t), 1
2127
+ if (
2128
+ ((c = 0),
2129
+ (t = '' === t ? '.' : t + ':'),
2130
+ Array.isArray(n))
2131
+ )
2132
+ for (var l = 0; l < n.length; l++) {
2133
+ var p = t + I((o = n[l]), l)
2134
+ c += e(o, p, a, i)
2135
+ }
2136
+ else if (
2137
+ (null === n || 'object' != typeof n
2138
+ ? (p = null)
2139
+ : (p =
2140
+ 'function' ==
2141
+ typeof (p =
2142
+ (h && n[h]) || n['@@iterator'])
2143
+ ? p
2144
+ : null),
2145
+ 'function' == typeof p)
2146
+ )
2147
+ for (
2148
+ n = p.call(n), l = 0;
2149
+ !(o = n.next()).done;
2150
+
2151
+ )
2152
+ c += e(
2153
+ (o = o.value),
2154
+ (p = t + I(o, l++)),
2155
+ a,
2156
+ i
2157
+ )
2158
+ else if ('object' === o)
2159
+ throw (
2160
+ ((a = '' + n),
2161
+ Error(
2162
+ A(
2163
+ 31,
2164
+ '[object Object]' === a
2165
+ ? 'object with keys {' +
2166
+ Object.keys(n).join(
2167
+ ', '
2168
+ ) +
2169
+ '}'
2170
+ : a,
2171
+ ''
2172
+ )
2173
+ ))
2174
+ )
2175
+ return c
2176
+ })(e, '', n, t)
2177
+ }
2178
+ function I(e, n) {
2179
+ return 'object' == typeof e && null !== e && null != e.key
2180
+ ? (function (e) {
2181
+ var n = { '=': '=0', ':': '=2' }
2182
+ return (
2183
+ '$' +
2184
+ ('' + e).replace(/[=:]/g, function (e) {
2185
+ return n[e]
2186
+ })
2187
+ )
2188
+ })(e.key)
2189
+ : n.toString(36)
2190
+ }
2191
+ function O(e, n) {
2192
+ e.func.call(e.context, n, e.count++)
2193
+ }
2194
+ function z(e, n, t) {
2195
+ var a = e.result,
2196
+ i = e.keyPrefix
2197
+ ;(e = e.func.call(e.context, n, e.count++)),
2198
+ Array.isArray(e)
2199
+ ? L(e, a, t, function (e) {
2200
+ return e
2201
+ })
2202
+ : null != e &&
2203
+ (S(e) &&
2204
+ (e = (function (e, n) {
2205
+ return {
2206
+ $$typeof: s,
2207
+ type: e.type,
2208
+ key: n,
2209
+ ref: e.ref,
2210
+ props: e.props,
2211
+ _owner: e._owner,
2212
+ }
2213
+ })(
2214
+ e,
2215
+ i +
2216
+ (!e.key || (n && n.key === e.key)
2217
+ ? ''
2218
+ : ('' + e.key).replace(T, '$&/') +
2219
+ '/') +
2220
+ t
2221
+ )),
2222
+ a.push(e))
2223
+ }
2224
+ function L(e, n, t, a, i) {
2225
+ var s = ''
2226
+ null != t && (s = ('' + t).replace(T, '$&/') + '/'),
2227
+ q(e, z, (n = N(n, s, a, i))),
2228
+ M(n)
2229
+ }
2230
+ var U = { current: null }
2231
+ function j() {
2232
+ var e = U.current
2233
+ if (null === e) throw Error(A(321))
2234
+ return e
2235
+ }
2236
+ var D = {
2237
+ ReactCurrentDispatcher: U,
2238
+ ReactCurrentBatchConfig: { suspense: null },
2239
+ ReactCurrentOwner: E,
2240
+ IsSomeRendererActing: { current: !1 },
2241
+ assign: a,
2242
+ }
2243
+ ;(n.Children = {
2244
+ map: function (e, n, t) {
2245
+ if (null == e) return e
2246
+ var a = []
2247
+ return L(e, a, null, n, t), a
2248
+ },
2249
+ forEach: function (e, n, t) {
2250
+ if (null == e) return e
2251
+ q(e, O, (n = N(null, null, n, t))), M(n)
2252
+ },
2253
+ count: function (e) {
2254
+ return q(
2255
+ e,
2256
+ function () {
2257
+ return null
2258
+ },
2259
+ null
2260
+ )
2261
+ },
2262
+ toArray: function (e) {
2263
+ var n = []
2264
+ return (
2265
+ L(e, n, null, function (e) {
2266
+ return e
2267
+ }),
2268
+ n
2269
+ )
2270
+ },
2271
+ only: function (e) {
2272
+ if (!S(e)) throw Error(A(143))
2273
+ return e
2274
+ },
2275
+ }),
2276
+ (n.Component = b),
2277
+ (n.Fragment = o),
2278
+ (n.Profiler = l),
2279
+ (n.PureComponent = v),
2280
+ (n.StrictMode = c),
2281
+ (n.Suspense = d),
2282
+ (n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = D),
2283
+ (n.cloneElement = function (e, n, t) {
2284
+ if (null == e) throw Error(A(267, e))
2285
+ var i = a({}, e.props),
2286
+ r = e.key,
2287
+ o = e.ref,
2288
+ c = e._owner
2289
+ if (null != n) {
2290
+ if (
2291
+ (void 0 !== n.ref && ((o = n.ref), (c = E.current)),
2292
+ void 0 !== n.key && (r = '' + n.key),
2293
+ e.type && e.type.defaultProps)
2294
+ )
2295
+ var l = e.type.defaultProps
2296
+ for (p in n)
2297
+ C.call(n, p) &&
2298
+ !x.hasOwnProperty(p) &&
2299
+ (i[p] =
2300
+ void 0 === n[p] && void 0 !== l
2301
+ ? l[p]
2302
+ : n[p])
2303
+ }
2304
+ var p = arguments.length - 2
2305
+ if (1 === p) i.children = t
2306
+ else if (1 < p) {
2307
+ l = Array(p)
2308
+ for (var f = 0; f < p; f++) l[f] = arguments[f + 2]
2309
+ i.children = l
2310
+ }
2311
+ return {
2312
+ $$typeof: s,
2313
+ type: e.type,
2314
+ key: r,
2315
+ ref: o,
2316
+ props: i,
2317
+ _owner: c,
2318
+ }
2319
+ }),
2320
+ (n.createContext = function (e, n) {
2321
+ return (
2322
+ void 0 === n && (n = null),
2323
+ ((e = {
2324
+ $$typeof: f,
2325
+ _calculateChangedBits: n,
2326
+ _currentValue: e,
2327
+ _currentValue2: e,
2328
+ _threadCount: 0,
2329
+ Provider: null,
2330
+ Consumer: null,
2331
+ }).Provider = { $$typeof: p, _context: e }),
2332
+ (e.Consumer = e)
2333
+ )
2334
+ }),
2335
+ (n.createElement = B),
2336
+ (n.createFactory = function (e) {
2337
+ var n = B.bind(null, e)
2338
+ return (n.type = e), n
2339
+ }),
2340
+ (n.createRef = function () {
2341
+ return { current: null }
2342
+ }),
2343
+ (n.forwardRef = function (e) {
2344
+ return { $$typeof: u, render: e }
2345
+ }),
2346
+ (n.isValidElement = S),
2347
+ (n.lazy = function (e) {
2348
+ return { $$typeof: m, _ctor: e, _status: -1, _result: null }
2349
+ }),
2350
+ (n.memo = function (e, n) {
2351
+ return {
2352
+ $$typeof: g,
2353
+ type: e,
2354
+ compare: void 0 === n ? null : n,
2355
+ }
2356
+ }),
2357
+ (n.useCallback = function (e, n) {
2358
+ return j().useCallback(e, n)
2359
+ }),
2360
+ (n.useContext = function (e, n) {
2361
+ return j().useContext(e, n)
2362
+ }),
2363
+ (n.useDebugValue = function () {}),
2364
+ (n.useEffect = function (e, n) {
2365
+ return j().useEffect(e, n)
2366
+ }),
2367
+ (n.useImperativeHandle = function (e, n, t) {
2368
+ return j().useImperativeHandle(e, n, t)
2369
+ }),
2370
+ (n.useLayoutEffect = function (e, n) {
2371
+ return j().useLayoutEffect(e, n)
2372
+ }),
2373
+ (n.useMemo = function (e, n) {
2374
+ return j().useMemo(e, n)
2375
+ }),
2376
+ (n.useReducer = function (e, n, t) {
2377
+ return j().useReducer(e, n, t)
2378
+ }),
2379
+ (n.useRef = function (e) {
2380
+ return j().useRef(e)
2381
+ }),
2382
+ (n.useState = function (e) {
2383
+ return j().useState(e)
2384
+ }),
2385
+ (n.version = '16.14.0')
2386
+ },
2387
+ function (e, n, t) {
2388
+ 'use strict'
2389
+ /** @license React v16.14.0
2390
+ * react-dom.production.min.js
2391
+ *
2392
+ * Copyright (c) Facebook, Inc. and its affiliates.
2393
+ *
2394
+ * This source code is licensed under the MIT license found in the
2395
+ * LICENSE file in the root directory of this source tree.
2396
+ */ var a = t(0),
2397
+ i = t(4),
2398
+ s = t(22)
2399
+ function r(e) {
2400
+ for (
2401
+ var n =
2402
+ 'https://reactjs.org/docs/error-decoder.html?invariant=' +
2403
+ e,
2404
+ t = 1;
2405
+ t < arguments.length;
2406
+ t++
2407
+ )
2408
+ n += '&args[]=' + encodeURIComponent(arguments[t])
2409
+ return (
2410
+ 'Minified React error #' +
2411
+ e +
2412
+ '; visit ' +
2413
+ n +
2414
+ ' for the full message or use the non-minified dev environment for full errors and additional helpful warnings.'
2415
+ )
2416
+ }
2417
+ if (!a) throw Error(r(227))
2418
+ function o(e, n, t, a, i, s, r, o, c) {
2419
+ var l = Array.prototype.slice.call(arguments, 3)
2420
+ try {
2421
+ n.apply(t, l)
2422
+ } catch (e) {
2423
+ this.onError(e)
2424
+ }
2425
+ }
2426
+ var c = !1,
2427
+ l = null,
2428
+ p = !1,
2429
+ f = null,
2430
+ u = {
2431
+ onError: function (e) {
2432
+ ;(c = !0), (l = e)
2433
+ },
2434
+ }
2435
+ function d(e, n, t, a, i, s, r, p, f) {
2436
+ ;(c = !1), (l = null), o.apply(u, arguments)
2437
+ }
2438
+ var g = null,
2439
+ m = null,
2440
+ h = null
2441
+ function A(e, n, t) {
2442
+ var a = e.type || 'unknown-event'
2443
+ ;(e.currentTarget = h(t)),
2444
+ (function (e, n, t, a, i, s, o, u, g) {
2445
+ if ((d.apply(this, arguments), c)) {
2446
+ if (!c) throw Error(r(198))
2447
+ var m = l
2448
+ ;(c = !1), (l = null), p || ((p = !0), (f = m))
2449
+ }
2450
+ })(a, n, void 0, e),
2451
+ (e.currentTarget = null)
2452
+ }
2453
+ var k = null,
2454
+ y = {}
2455
+ function b() {
2456
+ if (k)
2457
+ for (var e in y) {
2458
+ var n = y[e],
2459
+ t = k.indexOf(e)
2460
+ if (!(-1 < t)) throw Error(r(96, e))
2461
+ if (!v[t]) {
2462
+ if (!n.extractEvents) throw Error(r(97, e))
2463
+ for (var a in ((v[t] = n), (t = n.eventTypes))) {
2464
+ var i = void 0,
2465
+ s = t[a],
2466
+ o = n,
2467
+ c = a
2468
+ if (w.hasOwnProperty(c)) throw Error(r(99, c))
2469
+ w[c] = s
2470
+ var l = s.phasedRegistrationNames
2471
+ if (l) {
2472
+ for (i in l)
2473
+ l.hasOwnProperty(i) && _(l[i], o, c)
2474
+ i = !0
2475
+ } else
2476
+ s.registrationName
2477
+ ? (_(s.registrationName, o, c),
2478
+ (i = !0))
2479
+ : (i = !1)
2480
+ if (!i) throw Error(r(98, a, e))
2481
+ }
2482
+ }
2483
+ }
2484
+ }
2485
+ function _(e, n, t) {
2486
+ if (E[e]) throw Error(r(100, e))
2487
+ ;(E[e] = n), (C[e] = n.eventTypes[t].dependencies)
2488
+ }
2489
+ var v = [],
2490
+ w = {},
2491
+ E = {},
2492
+ C = {}
2493
+ function x(e) {
2494
+ var n,
2495
+ t = !1
2496
+ for (n in e)
2497
+ if (e.hasOwnProperty(n)) {
2498
+ var a = e[n]
2499
+ if (!y.hasOwnProperty(n) || y[n] !== a) {
2500
+ if (y[n]) throw Error(r(102, n))
2501
+ ;(y[n] = a), (t = !0)
2502
+ }
2503
+ }
2504
+ t && b()
2505
+ }
2506
+ var B = !(
2507
+ 'undefined' == typeof window ||
2508
+ void 0 === window.document ||
2509
+ void 0 === window.document.createElement
2510
+ ),
2511
+ S = null,
2512
+ T = null,
2513
+ P = null
2514
+ function N(e) {
2515
+ if ((e = m(e))) {
2516
+ if ('function' != typeof S) throw Error(r(280))
2517
+ var n = e.stateNode
2518
+ n && ((n = g(n)), S(e.stateNode, e.type, n))
2519
+ }
2520
+ }
2521
+ function M(e) {
2522
+ T ? (P ? P.push(e) : (P = [e])) : (T = e)
2523
+ }
2524
+ function q() {
2525
+ if (T) {
2526
+ var e = T,
2527
+ n = P
2528
+ if (((P = T = null), N(e), n))
2529
+ for (e = 0; e < n.length; e++) N(n[e])
2530
+ }
2531
+ }
2532
+ function I(e, n) {
2533
+ return e(n)
2534
+ }
2535
+ function O(e, n, t, a, i) {
2536
+ return e(n, t, a, i)
2537
+ }
2538
+ function z() {}
2539
+ var L = I,
2540
+ U = !1,
2541
+ j = !1
2542
+ function D() {
2543
+ ;(null === T && null === P) || (z(), q())
2544
+ }
2545
+ function F(e, n, t) {
2546
+ if (j) return e(n, t)
2547
+ j = !0
2548
+ try {
2549
+ return L(e, n, t)
2550
+ } finally {
2551
+ ;(j = !1), D()
2552
+ }
2553
+ }
2554
+ var R = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
2555
+ Y = Object.prototype.hasOwnProperty,
2556
+ Q = {},
2557
+ W = {}
2558
+ function V(e, n, t, a, i, s) {
2559
+ ;(this.acceptsBooleans = 2 === n || 3 === n || 4 === n),
2560
+ (this.attributeName = a),
2561
+ (this.attributeNamespace = i),
2562
+ (this.mustUseProperty = t),
2563
+ (this.propertyName = e),
2564
+ (this.type = n),
2565
+ (this.sanitizeURL = s)
2566
+ }
2567
+ var H = {}
2568
+ 'children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style'
2569
+ .split(' ')
2570
+ .forEach(function (e) {
2571
+ H[e] = new V(e, 0, !1, e, null, !1)
2572
+ }),
2573
+ [
2574
+ ['acceptCharset', 'accept-charset'],
2575
+ ['className', 'class'],
2576
+ ['htmlFor', 'for'],
2577
+ ['httpEquiv', 'http-equiv'],
2578
+ ].forEach(function (e) {
2579
+ var n = e[0]
2580
+ H[n] = new V(n, 1, !1, e[1], null, !1)
2581
+ }),
2582
+ ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(
2583
+ function (e) {
2584
+ H[e] = new V(e, 2, !1, e.toLowerCase(), null, !1)
2585
+ }
2586
+ ),
2587
+ [
2588
+ 'autoReverse',
2589
+ 'externalResourcesRequired',
2590
+ 'focusable',
2591
+ 'preserveAlpha',
2592
+ ].forEach(function (e) {
2593
+ H[e] = new V(e, 2, !1, e, null, !1)
2594
+ }),
2595
+ 'allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope'
2596
+ .split(' ')
2597
+ .forEach(function (e) {
2598
+ H[e] = new V(e, 3, !1, e.toLowerCase(), null, !1)
2599
+ }),
2600
+ ['checked', 'multiple', 'muted', 'selected'].forEach(function (
2601
+ e
2602
+ ) {
2603
+ H[e] = new V(e, 3, !0, e, null, !1)
2604
+ }),
2605
+ ['capture', 'download'].forEach(function (e) {
2606
+ H[e] = new V(e, 4, !1, e, null, !1)
2607
+ }),
2608
+ ['cols', 'rows', 'size', 'span'].forEach(function (e) {
2609
+ H[e] = new V(e, 6, !1, e, null, !1)
2610
+ }),
2611
+ ['rowSpan', 'start'].forEach(function (e) {
2612
+ H[e] = new V(e, 5, !1, e.toLowerCase(), null, !1)
2613
+ })
2614
+ var $ = /[\-:]([a-z])/g
2615
+ function X(e) {
2616
+ return e[1].toUpperCase()
2617
+ }
2618
+ 'accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height'
2619
+ .split(' ')
2620
+ .forEach(function (e) {
2621
+ var n = e.replace($, X)
2622
+ H[n] = new V(n, 1, !1, e, null, !1)
2623
+ }),
2624
+ 'xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type'
2625
+ .split(' ')
2626
+ .forEach(function (e) {
2627
+ var n = e.replace($, X)
2628
+ H[n] = new V(
2629
+ n,
2630
+ 1,
2631
+ !1,
2632
+ e,
2633
+ 'http://www.w3.org/1999/xlink',
2634
+ !1
2635
+ )
2636
+ }),
2637
+ ['xml:base', 'xml:lang', 'xml:space'].forEach(function (e) {
2638
+ var n = e.replace($, X)
2639
+ H[n] = new V(
2640
+ n,
2641
+ 1,
2642
+ !1,
2643
+ e,
2644
+ 'http://www.w3.org/XML/1998/namespace',
2645
+ !1
2646
+ )
2647
+ }),
2648
+ ['tabIndex', 'crossOrigin'].forEach(function (e) {
2649
+ H[e] = new V(e, 1, !1, e.toLowerCase(), null, !1)
2650
+ }),
2651
+ (H.xlinkHref = new V(
2652
+ 'xlinkHref',
2653
+ 1,
2654
+ !1,
2655
+ 'xlink:href',
2656
+ 'http://www.w3.org/1999/xlink',
2657
+ !0
2658
+ )),
2659
+ ['src', 'href', 'action', 'formAction'].forEach(function (e) {
2660
+ H[e] = new V(e, 1, !1, e.toLowerCase(), null, !0)
2661
+ })
2662
+ var K = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
2663
+ function Z(e, n, t, a) {
2664
+ var i = H.hasOwnProperty(n) ? H[n] : null
2665
+ ;(null !== i
2666
+ ? 0 === i.type
2667
+ : !a &&
2668
+ 2 < n.length &&
2669
+ ('o' === n[0] || 'O' === n[0]) &&
2670
+ ('n' === n[1] || 'N' === n[1])) ||
2671
+ ((function (e, n, t, a) {
2672
+ if (
2673
+ null == n ||
2674
+ (function (e, n, t, a) {
2675
+ if (null !== t && 0 === t.type) return !1
2676
+ switch (typeof n) {
2677
+ case 'function':
2678
+ case 'symbol':
2679
+ return !0
2680
+ case 'boolean':
2681
+ return (
2682
+ !a &&
2683
+ (null !== t
2684
+ ? !t.acceptsBooleans
2685
+ : 'data-' !==
2686
+ (e = e
2687
+ .toLowerCase()
2688
+ .slice(0, 5)) &&
2689
+ 'aria-' !== e)
2690
+ )
2691
+ default:
2692
+ return !1
2693
+ }
2694
+ })(e, n, t, a)
2695
+ )
2696
+ return !0
2697
+ if (a) return !1
2698
+ if (null !== t)
2699
+ switch (t.type) {
2700
+ case 3:
2701
+ return !n
2702
+ case 4:
2703
+ return !1 === n
2704
+ case 5:
2705
+ return isNaN(n)
2706
+ case 6:
2707
+ return isNaN(n) || 1 > n
2708
+ }
2709
+ return !1
2710
+ })(n, t, i, a) && (t = null),
2711
+ a || null === i
2712
+ ? (function (e) {
2713
+ return (
2714
+ !!Y.call(W, e) ||
2715
+ (!Y.call(Q, e) &&
2716
+ (R.test(e)
2717
+ ? (W[e] = !0)
2718
+ : ((Q[e] = !0), !1)))
2719
+ )
2720
+ })(n) &&
2721
+ (null === t
2722
+ ? e.removeAttribute(n)
2723
+ : e.setAttribute(n, '' + t))
2724
+ : i.mustUseProperty
2725
+ ? (e[i.propertyName] =
2726
+ null === t ? 3 !== i.type && '' : t)
2727
+ : ((n = i.attributeName),
2728
+ (a = i.attributeNamespace),
2729
+ null === t
2730
+ ? e.removeAttribute(n)
2731
+ : ((t =
2732
+ 3 === (i = i.type) ||
2733
+ (4 === i && !0 === t)
2734
+ ? ''
2735
+ : '' + t),
2736
+ a
2737
+ ? e.setAttributeNS(a, n, t)
2738
+ : e.setAttribute(n, t))))
2739
+ }
2740
+ K.hasOwnProperty('ReactCurrentDispatcher') ||
2741
+ (K.ReactCurrentDispatcher = { current: null }),
2742
+ K.hasOwnProperty('ReactCurrentBatchConfig') ||
2743
+ (K.ReactCurrentBatchConfig = { suspense: null })
2744
+ var G = /^(.*)[\\\/]/,
2745
+ J = 'function' == typeof Symbol && Symbol.for,
2746
+ ee = J ? Symbol.for('react.element') : 60103,
2747
+ ne = J ? Symbol.for('react.portal') : 60106,
2748
+ te = J ? Symbol.for('react.fragment') : 60107,
2749
+ ae = J ? Symbol.for('react.strict_mode') : 60108,
2750
+ ie = J ? Symbol.for('react.profiler') : 60114,
2751
+ se = J ? Symbol.for('react.provider') : 60109,
2752
+ re = J ? Symbol.for('react.context') : 60110,
2753
+ oe = J ? Symbol.for('react.concurrent_mode') : 60111,
2754
+ ce = J ? Symbol.for('react.forward_ref') : 60112,
2755
+ le = J ? Symbol.for('react.suspense') : 60113,
2756
+ pe = J ? Symbol.for('react.suspense_list') : 60120,
2757
+ fe = J ? Symbol.for('react.memo') : 60115,
2758
+ ue = J ? Symbol.for('react.lazy') : 60116,
2759
+ de = J ? Symbol.for('react.block') : 60121,
2760
+ ge = 'function' == typeof Symbol && Symbol.iterator
2761
+ function me(e) {
2762
+ return null === e || 'object' != typeof e
2763
+ ? null
2764
+ : 'function' ==
2765
+ typeof (e = (ge && e[ge]) || e['@@iterator'])
2766
+ ? e
2767
+ : null
2768
+ }
2769
+ function he(e) {
2770
+ if (null == e) return null
2771
+ if ('function' == typeof e)
2772
+ return e.displayName || e.name || null
2773
+ if ('string' == typeof e) return e
2774
+ switch (e) {
2775
+ case te:
2776
+ return 'Fragment'
2777
+ case ne:
2778
+ return 'Portal'
2779
+ case ie:
2780
+ return 'Profiler'
2781
+ case ae:
2782
+ return 'StrictMode'
2783
+ case le:
2784
+ return 'Suspense'
2785
+ case pe:
2786
+ return 'SuspenseList'
2787
+ }
2788
+ if ('object' == typeof e)
2789
+ switch (e.$$typeof) {
2790
+ case re:
2791
+ return 'Context.Consumer'
2792
+ case se:
2793
+ return 'Context.Provider'
2794
+ case ce:
2795
+ var n = e.render
2796
+ return (
2797
+ (n = n.displayName || n.name || ''),
2798
+ e.displayName ||
2799
+ ('' !== n
2800
+ ? 'ForwardRef(' + n + ')'
2801
+ : 'ForwardRef')
2802
+ )
2803
+ case fe:
2804
+ return he(e.type)
2805
+ case de:
2806
+ return he(e.render)
2807
+ case ue:
2808
+ if ((e = 1 === e._status ? e._result : null))
2809
+ return he(e)
2810
+ }
2811
+ return null
2812
+ }
2813
+ function Ae(e) {
2814
+ var n = ''
2815
+ do {
2816
+ e: switch (e.tag) {
2817
+ case 3:
2818
+ case 4:
2819
+ case 6:
2820
+ case 7:
2821
+ case 10:
2822
+ case 9:
2823
+ var t = ''
2824
+ break e
2825
+ default:
2826
+ var a = e._debugOwner,
2827
+ i = e._debugSource,
2828
+ s = he(e.type)
2829
+ ;(t = null),
2830
+ a && (t = he(a.type)),
2831
+ (a = s),
2832
+ (s = ''),
2833
+ i
2834
+ ? (s =
2835
+ ' (at ' +
2836
+ i.fileName.replace(G, '') +
2837
+ ':' +
2838
+ i.lineNumber +
2839
+ ')')
2840
+ : t && (s = ' (created by ' + t + ')'),
2841
+ (t = '\n in ' + (a || 'Unknown') + s)
2842
+ }
2843
+ ;(n += t), (e = e.return)
2844
+ } while (e)
2845
+ return n
2846
+ }
2847
+ function ke(e) {
2848
+ switch (typeof e) {
2849
+ case 'boolean':
2850
+ case 'number':
2851
+ case 'object':
2852
+ case 'string':
2853
+ case 'undefined':
2854
+ return e
2855
+ default:
2856
+ return ''
2857
+ }
2858
+ }
2859
+ function ye(e) {
2860
+ var n = e.type
2861
+ return (
2862
+ (e = e.nodeName) &&
2863
+ 'input' === e.toLowerCase() &&
2864
+ ('checkbox' === n || 'radio' === n)
2865
+ )
2866
+ }
2867
+ function be(e) {
2868
+ e._valueTracker ||
2869
+ (e._valueTracker = (function (e) {
2870
+ var n = ye(e) ? 'checked' : 'value',
2871
+ t = Object.getOwnPropertyDescriptor(
2872
+ e.constructor.prototype,
2873
+ n
2874
+ ),
2875
+ a = '' + e[n]
2876
+ if (
2877
+ !e.hasOwnProperty(n) &&
2878
+ void 0 !== t &&
2879
+ 'function' == typeof t.get &&
2880
+ 'function' == typeof t.set
2881
+ ) {
2882
+ var i = t.get,
2883
+ s = t.set
2884
+ return (
2885
+ Object.defineProperty(e, n, {
2886
+ configurable: !0,
2887
+ get: function () {
2888
+ return i.call(this)
2889
+ },
2890
+ set: function (e) {
2891
+ ;(a = '' + e), s.call(this, e)
2892
+ },
2893
+ }),
2894
+ Object.defineProperty(e, n, {
2895
+ enumerable: t.enumerable,
2896
+ }),
2897
+ {
2898
+ getValue: function () {
2899
+ return a
2900
+ },
2901
+ setValue: function (e) {
2902
+ a = '' + e
2903
+ },
2904
+ stopTracking: function () {
2905
+ ;(e._valueTracker = null), delete e[n]
2906
+ },
2907
+ }
2908
+ )
2909
+ }
2910
+ })(e))
2911
+ }
2912
+ function _e(e) {
2913
+ if (!e) return !1
2914
+ var n = e._valueTracker
2915
+ if (!n) return !0
2916
+ var t = n.getValue(),
2917
+ a = ''
2918
+ return (
2919
+ e && (a = ye(e) ? (e.checked ? 'true' : 'false') : e.value),
2920
+ (e = a) !== t && (n.setValue(e), !0)
2921
+ )
2922
+ }
2923
+ function ve(e, n) {
2924
+ var t = n.checked
2925
+ return i({}, n, {
2926
+ defaultChecked: void 0,
2927
+ defaultValue: void 0,
2928
+ value: void 0,
2929
+ checked: null != t ? t : e._wrapperState.initialChecked,
2930
+ })
2931
+ }
2932
+ function we(e, n) {
2933
+ var t = null == n.defaultValue ? '' : n.defaultValue,
2934
+ a = null != n.checked ? n.checked : n.defaultChecked
2935
+ ;(t = ke(null != n.value ? n.value : t)),
2936
+ (e._wrapperState = {
2937
+ initialChecked: a,
2938
+ initialValue: t,
2939
+ controlled:
2940
+ 'checkbox' === n.type || 'radio' === n.type
2941
+ ? null != n.checked
2942
+ : null != n.value,
2943
+ })
2944
+ }
2945
+ function Ee(e, n) {
2946
+ null != (n = n.checked) && Z(e, 'checked', n, !1)
2947
+ }
2948
+ function Ce(e, n) {
2949
+ Ee(e, n)
2950
+ var t = ke(n.value),
2951
+ a = n.type
2952
+ if (null != t)
2953
+ 'number' === a
2954
+ ? ((0 === t && '' === e.value) || e.value != t) &&
2955
+ (e.value = '' + t)
2956
+ : e.value !== '' + t && (e.value = '' + t)
2957
+ else if ('submit' === a || 'reset' === a)
2958
+ return void e.removeAttribute('value')
2959
+ n.hasOwnProperty('value')
2960
+ ? Be(e, n.type, t)
2961
+ : n.hasOwnProperty('defaultValue') &&
2962
+ Be(e, n.type, ke(n.defaultValue)),
2963
+ null == n.checked &&
2964
+ null != n.defaultChecked &&
2965
+ (e.defaultChecked = !!n.defaultChecked)
2966
+ }
2967
+ function xe(e, n, t) {
2968
+ if (
2969
+ n.hasOwnProperty('value') ||
2970
+ n.hasOwnProperty('defaultValue')
2971
+ ) {
2972
+ var a = n.type
2973
+ if (
2974
+ !(
2975
+ ('submit' !== a && 'reset' !== a) ||
2976
+ (void 0 !== n.value && null !== n.value)
2977
+ )
2978
+ )
2979
+ return
2980
+ ;(n = '' + e._wrapperState.initialValue),
2981
+ t || n === e.value || (e.value = n),
2982
+ (e.defaultValue = n)
2983
+ }
2984
+ '' !== (t = e.name) && (e.name = ''),
2985
+ (e.defaultChecked = !!e._wrapperState.initialChecked),
2986
+ '' !== t && (e.name = t)
2987
+ }
2988
+ function Be(e, n, t) {
2989
+ ;('number' === n && e.ownerDocument.activeElement === e) ||
2990
+ (null == t
2991
+ ? (e.defaultValue = '' + e._wrapperState.initialValue)
2992
+ : e.defaultValue !== '' + t &&
2993
+ (e.defaultValue = '' + t))
2994
+ }
2995
+ function Se(e, n) {
2996
+ return (
2997
+ (e = i({ children: void 0 }, n)),
2998
+ (n = (function (e) {
2999
+ var n = ''
3000
+ return (
3001
+ a.Children.forEach(e, function (e) {
3002
+ null != e && (n += e)
3003
+ }),
3004
+ n
3005
+ )
3006
+ })(n.children)) && (e.children = n),
3007
+ e
3008
+ )
3009
+ }
3010
+ function Te(e, n, t, a) {
3011
+ if (((e = e.options), n)) {
3012
+ n = {}
3013
+ for (var i = 0; i < t.length; i++) n['$' + t[i]] = !0
3014
+ for (t = 0; t < e.length; t++)
3015
+ (i = n.hasOwnProperty('$' + e[t].value)),
3016
+ e[t].selected !== i && (e[t].selected = i),
3017
+ i && a && (e[t].defaultSelected = !0)
3018
+ } else {
3019
+ for (t = '' + ke(t), n = null, i = 0; i < e.length; i++) {
3020
+ if (e[i].value === t)
3021
+ return (
3022
+ (e[i].selected = !0),
3023
+ void (a && (e[i].defaultSelected = !0))
3024
+ )
3025
+ null !== n || e[i].disabled || (n = e[i])
3026
+ }
3027
+ null !== n && (n.selected = !0)
3028
+ }
3029
+ }
3030
+ function Pe(e, n) {
3031
+ if (null != n.dangerouslySetInnerHTML) throw Error(r(91))
3032
+ return i({}, n, {
3033
+ value: void 0,
3034
+ defaultValue: void 0,
3035
+ children: '' + e._wrapperState.initialValue,
3036
+ })
3037
+ }
3038
+ function Ne(e, n) {
3039
+ var t = n.value
3040
+ if (null == t) {
3041
+ if (((t = n.children), (n = n.defaultValue), null != t)) {
3042
+ if (null != n) throw Error(r(92))
3043
+ if (Array.isArray(t)) {
3044
+ if (!(1 >= t.length)) throw Error(r(93))
3045
+ t = t[0]
3046
+ }
3047
+ n = t
3048
+ }
3049
+ null == n && (n = ''), (t = n)
3050
+ }
3051
+ e._wrapperState = { initialValue: ke(t) }
3052
+ }
3053
+ function Me(e, n) {
3054
+ var t = ke(n.value),
3055
+ a = ke(n.defaultValue)
3056
+ null != t &&
3057
+ ((t = '' + t) !== e.value && (e.value = t),
3058
+ null == n.defaultValue &&
3059
+ e.defaultValue !== t &&
3060
+ (e.defaultValue = t)),
3061
+ null != a && (e.defaultValue = '' + a)
3062
+ }
3063
+ function qe(e) {
3064
+ var n = e.textContent
3065
+ n === e._wrapperState.initialValue &&
3066
+ '' !== n &&
3067
+ null !== n &&
3068
+ (e.value = n)
3069
+ }
3070
+ var Ie = 'http://www.w3.org/1999/xhtml',
3071
+ Oe = 'http://www.w3.org/2000/svg'
3072
+ function ze(e) {
3073
+ switch (e) {
3074
+ case 'svg':
3075
+ return 'http://www.w3.org/2000/svg'
3076
+ case 'math':
3077
+ return 'http://www.w3.org/1998/Math/MathML'
3078
+ default:
3079
+ return 'http://www.w3.org/1999/xhtml'
3080
+ }
3081
+ }
3082
+ function Le(e, n) {
3083
+ return null == e || 'http://www.w3.org/1999/xhtml' === e
3084
+ ? ze(n)
3085
+ : 'http://www.w3.org/2000/svg' === e &&
3086
+ 'foreignObject' === n
3087
+ ? 'http://www.w3.org/1999/xhtml'
3088
+ : e
3089
+ }
3090
+ var Ue,
3091
+ je = (function (e) {
3092
+ return 'undefined' != typeof MSApp &&
3093
+ MSApp.execUnsafeLocalFunction
3094
+ ? function (n, t, a, i) {
3095
+ MSApp.execUnsafeLocalFunction(function () {
3096
+ return e(n, t)
3097
+ })
3098
+ }
3099
+ : e
3100
+ })(function (e, n) {
3101
+ if (e.namespaceURI !== Oe || 'innerHTML' in e)
3102
+ e.innerHTML = n
3103
+ else {
3104
+ for (
3105
+ (Ue =
3106
+ Ue || document.createElement('div')).innerHTML =
3107
+ '<svg>' + n.valueOf().toString() + '</svg>',
3108
+ n = Ue.firstChild;
3109
+ e.firstChild;
3110
+
3111
+ )
3112
+ e.removeChild(e.firstChild)
3113
+ for (; n.firstChild; ) e.appendChild(n.firstChild)
3114
+ }
3115
+ })
3116
+ function De(e, n) {
3117
+ if (n) {
3118
+ var t = e.firstChild
3119
+ if (t && t === e.lastChild && 3 === t.nodeType)
3120
+ return void (t.nodeValue = n)
3121
+ }
3122
+ e.textContent = n
3123
+ }
3124
+ function Fe(e, n) {
3125
+ var t = {}
3126
+ return (
3127
+ (t[e.toLowerCase()] = n.toLowerCase()),
3128
+ (t['Webkit' + e] = 'webkit' + n),
3129
+ (t['Moz' + e] = 'moz' + n),
3130
+ t
3131
+ )
3132
+ }
3133
+ var Re = {
3134
+ animationend: Fe('Animation', 'AnimationEnd'),
3135
+ animationiteration: Fe('Animation', 'AnimationIteration'),
3136
+ animationstart: Fe('Animation', 'AnimationStart'),
3137
+ transitionend: Fe('Transition', 'TransitionEnd'),
3138
+ },
3139
+ Ye = {},
3140
+ Qe = {}
3141
+ function We(e) {
3142
+ if (Ye[e]) return Ye[e]
3143
+ if (!Re[e]) return e
3144
+ var n,
3145
+ t = Re[e]
3146
+ for (n in t)
3147
+ if (t.hasOwnProperty(n) && n in Qe) return (Ye[e] = t[n])
3148
+ return e
3149
+ }
3150
+ B &&
3151
+ ((Qe = document.createElement('div').style),
3152
+ 'AnimationEvent' in window ||
3153
+ (delete Re.animationend.animation,
3154
+ delete Re.animationiteration.animation,
3155
+ delete Re.animationstart.animation),
3156
+ 'TransitionEvent' in window ||
3157
+ delete Re.transitionend.transition)
3158
+ var Ve = We('animationend'),
3159
+ He = We('animationiteration'),
3160
+ $e = We('animationstart'),
3161
+ Xe = We('transitionend'),
3162
+ Ke = 'abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting'.split(
3163
+ ' '
3164
+ ),
3165
+ Ze = new ('function' == typeof WeakMap ? WeakMap : Map)()
3166
+ function Ge(e) {
3167
+ var n = Ze.get(e)
3168
+ return void 0 === n && ((n = new Map()), Ze.set(e, n)), n
3169
+ }
3170
+ function Je(e) {
3171
+ var n = e,
3172
+ t = e
3173
+ if (e.alternate) for (; n.return; ) n = n.return
3174
+ else {
3175
+ e = n
3176
+ do {
3177
+ 0 != (1026 & (n = e).effectTag) && (t = n.return),
3178
+ (e = n.return)
3179
+ } while (e)
3180
+ }
3181
+ return 3 === n.tag ? t : null
3182
+ }
3183
+ function en(e) {
3184
+ if (13 === e.tag) {
3185
+ var n = e.memoizedState
3186
+ if (
3187
+ (null === n &&
3188
+ null !== (e = e.alternate) &&
3189
+ (n = e.memoizedState),
3190
+ null !== n)
3191
+ )
3192
+ return n.dehydrated
3193
+ }
3194
+ return null
3195
+ }
3196
+ function nn(e) {
3197
+ if (Je(e) !== e) throw Error(r(188))
3198
+ }
3199
+ function tn(e) {
3200
+ if (
3201
+ !(e = (function (e) {
3202
+ var n = e.alternate
3203
+ if (!n) {
3204
+ if (null === (n = Je(e))) throw Error(r(188))
3205
+ return n !== e ? null : e
3206
+ }
3207
+ for (var t = e, a = n; ; ) {
3208
+ var i = t.return
3209
+ if (null === i) break
3210
+ var s = i.alternate
3211
+ if (null === s) {
3212
+ if (null !== (a = i.return)) {
3213
+ t = a
3214
+ continue
3215
+ }
3216
+ break
3217
+ }
3218
+ if (i.child === s.child) {
3219
+ for (s = i.child; s; ) {
3220
+ if (s === t) return nn(i), e
3221
+ if (s === a) return nn(i), n
3222
+ s = s.sibling
3223
+ }
3224
+ throw Error(r(188))
3225
+ }
3226
+ if (t.return !== a.return) (t = i), (a = s)
3227
+ else {
3228
+ for (var o = !1, c = i.child; c; ) {
3229
+ if (c === t) {
3230
+ ;(o = !0), (t = i), (a = s)
3231
+ break
3232
+ }
3233
+ if (c === a) {
3234
+ ;(o = !0), (a = i), (t = s)
3235
+ break
3236
+ }
3237
+ c = c.sibling
3238
+ }
3239
+ if (!o) {
3240
+ for (c = s.child; c; ) {
3241
+ if (c === t) {
3242
+ ;(o = !0), (t = s), (a = i)
3243
+ break
3244
+ }
3245
+ if (c === a) {
3246
+ ;(o = !0), (a = s), (t = i)
3247
+ break
3248
+ }
3249
+ c = c.sibling
3250
+ }
3251
+ if (!o) throw Error(r(189))
3252
+ }
3253
+ }
3254
+ if (t.alternate !== a) throw Error(r(190))
3255
+ }
3256
+ if (3 !== t.tag) throw Error(r(188))
3257
+ return t.stateNode.current === t ? e : n
3258
+ })(e))
3259
+ )
3260
+ return null
3261
+ for (var n = e; ; ) {
3262
+ if (5 === n.tag || 6 === n.tag) return n
3263
+ if (n.child) (n.child.return = n), (n = n.child)
3264
+ else {
3265
+ if (n === e) break
3266
+ for (; !n.sibling; ) {
3267
+ if (!n.return || n.return === e) return null
3268
+ n = n.return
3269
+ }
3270
+ ;(n.sibling.return = n.return), (n = n.sibling)
3271
+ }
3272
+ }
3273
+ return null
3274
+ }
3275
+ function an(e, n) {
3276
+ if (null == n) throw Error(r(30))
3277
+ return null == e
3278
+ ? n
3279
+ : Array.isArray(e)
3280
+ ? Array.isArray(n)
3281
+ ? (e.push.apply(e, n), e)
3282
+ : (e.push(n), e)
3283
+ : Array.isArray(n)
3284
+ ? [e].concat(n)
3285
+ : [e, n]
3286
+ }
3287
+ function sn(e, n, t) {
3288
+ Array.isArray(e) ? e.forEach(n, t) : e && n.call(t, e)
3289
+ }
3290
+ var rn = null
3291
+ function on(e) {
3292
+ if (e) {
3293
+ var n = e._dispatchListeners,
3294
+ t = e._dispatchInstances
3295
+ if (Array.isArray(n))
3296
+ for (
3297
+ var a = 0;
3298
+ a < n.length && !e.isPropagationStopped();
3299
+ a++
3300
+ )
3301
+ A(e, n[a], t[a])
3302
+ else n && A(e, n, t)
3303
+ ;(e._dispatchListeners = null),
3304
+ (e._dispatchInstances = null),
3305
+ e.isPersistent() || e.constructor.release(e)
3306
+ }
3307
+ }
3308
+ function cn(e) {
3309
+ if (
3310
+ (null !== e && (rn = an(rn, e)), (e = rn), (rn = null), e)
3311
+ ) {
3312
+ if ((sn(e, on), rn)) throw Error(r(95))
3313
+ if (p) throw ((e = f), (p = !1), (f = null), e)
3314
+ }
3315
+ }
3316
+ function ln(e) {
3317
+ return (
3318
+ (e = e.target || e.srcElement || window)
3319
+ .correspondingUseElement &&
3320
+ (e = e.correspondingUseElement),
3321
+ 3 === e.nodeType ? e.parentNode : e
3322
+ )
3323
+ }
3324
+ function pn(e) {
3325
+ if (!B) return !1
3326
+ var n = (e = 'on' + e) in document
3327
+ return (
3328
+ n ||
3329
+ ((n = document.createElement('div')).setAttribute(
3330
+ e,
3331
+ 'return;'
3332
+ ),
3333
+ (n = 'function' == typeof n[e])),
3334
+ n
3335
+ )
3336
+ }
3337
+ var fn = []
3338
+ function un(e) {
3339
+ ;(e.topLevelType = null),
3340
+ (e.nativeEvent = null),
3341
+ (e.targetInst = null),
3342
+ (e.ancestors.length = 0),
3343
+ 10 > fn.length && fn.push(e)
3344
+ }
3345
+ function dn(e, n, t, a) {
3346
+ if (fn.length) {
3347
+ var i = fn.pop()
3348
+ return (
3349
+ (i.topLevelType = e),
3350
+ (i.eventSystemFlags = a),
3351
+ (i.nativeEvent = n),
3352
+ (i.targetInst = t),
3353
+ i
3354
+ )
3355
+ }
3356
+ return {
3357
+ topLevelType: e,
3358
+ eventSystemFlags: a,
3359
+ nativeEvent: n,
3360
+ targetInst: t,
3361
+ ancestors: [],
3362
+ }
3363
+ }
3364
+ function gn(e) {
3365
+ var n = e.targetInst,
3366
+ t = n
3367
+ do {
3368
+ if (!t) {
3369
+ e.ancestors.push(t)
3370
+ break
3371
+ }
3372
+ var a = t
3373
+ if (3 === a.tag) a = a.stateNode.containerInfo
3374
+ else {
3375
+ for (; a.return; ) a = a.return
3376
+ a = 3 !== a.tag ? null : a.stateNode.containerInfo
3377
+ }
3378
+ if (!a) break
3379
+ ;(5 !== (n = t.tag) && 6 !== n) || e.ancestors.push(t),
3380
+ (t = Bt(a))
3381
+ } while (t)
3382
+ for (t = 0; t < e.ancestors.length; t++) {
3383
+ n = e.ancestors[t]
3384
+ var i = ln(e.nativeEvent)
3385
+ a = e.topLevelType
3386
+ var s = e.nativeEvent,
3387
+ r = e.eventSystemFlags
3388
+ 0 === t && (r |= 64)
3389
+ for (var o = null, c = 0; c < v.length; c++) {
3390
+ var l = v[c]
3391
+ l &&
3392
+ (l = l.extractEvents(a, n, s, i, r)) &&
3393
+ (o = an(o, l))
3394
+ }
3395
+ cn(o)
3396
+ }
3397
+ }
3398
+ function mn(e, n, t) {
3399
+ if (!t.has(e)) {
3400
+ switch (e) {
3401
+ case 'scroll':
3402
+ Xn(n, 'scroll', !0)
3403
+ break
3404
+ case 'focus':
3405
+ case 'blur':
3406
+ Xn(n, 'focus', !0),
3407
+ Xn(n, 'blur', !0),
3408
+ t.set('blur', null),
3409
+ t.set('focus', null)
3410
+ break
3411
+ case 'cancel':
3412
+ case 'close':
3413
+ pn(e) && Xn(n, e, !0)
3414
+ break
3415
+ case 'invalid':
3416
+ case 'submit':
3417
+ case 'reset':
3418
+ break
3419
+ default:
3420
+ ;-1 === Ke.indexOf(e) && $n(e, n)
3421
+ }
3422
+ t.set(e, null)
3423
+ }
3424
+ }
3425
+ var hn,
3426
+ An,
3427
+ kn,
3428
+ yn = !1,
3429
+ bn = [],
3430
+ _n = null,
3431
+ vn = null,
3432
+ wn = null,
3433
+ En = new Map(),
3434
+ Cn = new Map(),
3435
+ xn = [],
3436
+ Bn = 'mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit'.split(
3437
+ ' '
3438
+ ),
3439
+ Sn = 'focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture'.split(
3440
+ ' '
3441
+ )
3442
+ function Tn(e, n, t, a, i) {
3443
+ return {
3444
+ blockedOn: e,
3445
+ topLevelType: n,
3446
+ eventSystemFlags: 32 | t,
3447
+ nativeEvent: i,
3448
+ container: a,
3449
+ }
3450
+ }
3451
+ function Pn(e, n) {
3452
+ switch (e) {
3453
+ case 'focus':
3454
+ case 'blur':
3455
+ _n = null
3456
+ break
3457
+ case 'dragenter':
3458
+ case 'dragleave':
3459
+ vn = null
3460
+ break
3461
+ case 'mouseover':
3462
+ case 'mouseout':
3463
+ wn = null
3464
+ break
3465
+ case 'pointerover':
3466
+ case 'pointerout':
3467
+ En.delete(n.pointerId)
3468
+ break
3469
+ case 'gotpointercapture':
3470
+ case 'lostpointercapture':
3471
+ Cn.delete(n.pointerId)
3472
+ }
3473
+ }
3474
+ function Nn(e, n, t, a, i, s) {
3475
+ return null === e || e.nativeEvent !== s
3476
+ ? ((e = Tn(n, t, a, i, s)),
3477
+ null !== n && null !== (n = St(n)) && An(n),
3478
+ e)
3479
+ : ((e.eventSystemFlags |= a), e)
3480
+ }
3481
+ function Mn(e) {
3482
+ var n = Bt(e.target)
3483
+ if (null !== n) {
3484
+ var t = Je(n)
3485
+ if (null !== t)
3486
+ if (13 === (n = t.tag)) {
3487
+ if (null !== (n = en(t)))
3488
+ return (
3489
+ (e.blockedOn = n),
3490
+ void s.unstable_runWithPriority(
3491
+ e.priority,
3492
+ function () {
3493
+ kn(t)
3494
+ }
3495
+ )
3496
+ )
3497
+ } else if (3 === n && t.stateNode.hydrate)
3498
+ return void (e.blockedOn =
3499
+ 3 === t.tag ? t.stateNode.containerInfo : null)
3500
+ }
3501
+ e.blockedOn = null
3502
+ }
3503
+ function qn(e) {
3504
+ if (null !== e.blockedOn) return !1
3505
+ var n = Jn(
3506
+ e.topLevelType,
3507
+ e.eventSystemFlags,
3508
+ e.container,
3509
+ e.nativeEvent
3510
+ )
3511
+ if (null !== n) {
3512
+ var t = St(n)
3513
+ return null !== t && An(t), (e.blockedOn = n), !1
3514
+ }
3515
+ return !0
3516
+ }
3517
+ function In(e, n, t) {
3518
+ qn(e) && t.delete(n)
3519
+ }
3520
+ function On() {
3521
+ for (yn = !1; 0 < bn.length; ) {
3522
+ var e = bn[0]
3523
+ if (null !== e.blockedOn) {
3524
+ null !== (e = St(e.blockedOn)) && hn(e)
3525
+ break
3526
+ }
3527
+ var n = Jn(
3528
+ e.topLevelType,
3529
+ e.eventSystemFlags,
3530
+ e.container,
3531
+ e.nativeEvent
3532
+ )
3533
+ null !== n ? (e.blockedOn = n) : bn.shift()
3534
+ }
3535
+ null !== _n && qn(_n) && (_n = null),
3536
+ null !== vn && qn(vn) && (vn = null),
3537
+ null !== wn && qn(wn) && (wn = null),
3538
+ En.forEach(In),
3539
+ Cn.forEach(In)
3540
+ }
3541
+ function zn(e, n) {
3542
+ e.blockedOn === n &&
3543
+ ((e.blockedOn = null),
3544
+ yn ||
3545
+ ((yn = !0),
3546
+ s.unstable_scheduleCallback(
3547
+ s.unstable_NormalPriority,
3548
+ On
3549
+ )))
3550
+ }
3551
+ function Ln(e) {
3552
+ function n(n) {
3553
+ return zn(n, e)
3554
+ }
3555
+ if (0 < bn.length) {
3556
+ zn(bn[0], e)
3557
+ for (var t = 1; t < bn.length; t++) {
3558
+ var a = bn[t]
3559
+ a.blockedOn === e && (a.blockedOn = null)
3560
+ }
3561
+ }
3562
+ for (
3563
+ null !== _n && zn(_n, e),
3564
+ null !== vn && zn(vn, e),
3565
+ null !== wn && zn(wn, e),
3566
+ En.forEach(n),
3567
+ Cn.forEach(n),
3568
+ t = 0;
3569
+ t < xn.length;
3570
+ t++
3571
+ )
3572
+ (a = xn[t]).blockedOn === e && (a.blockedOn = null)
3573
+ for (; 0 < xn.length && null === (t = xn[0]).blockedOn; )
3574
+ Mn(t), null === t.blockedOn && xn.shift()
3575
+ }
3576
+ var Un = {},
3577
+ jn = new Map(),
3578
+ Dn = new Map(),
3579
+ Fn = [
3580
+ 'abort',
3581
+ 'abort',
3582
+ Ve,
3583
+ 'animationEnd',
3584
+ He,
3585
+ 'animationIteration',
3586
+ $e,
3587
+ 'animationStart',
3588
+ 'canplay',
3589
+ 'canPlay',
3590
+ 'canplaythrough',
3591
+ 'canPlayThrough',
3592
+ 'durationchange',
3593
+ 'durationChange',
3594
+ 'emptied',
3595
+ 'emptied',
3596
+ 'encrypted',
3597
+ 'encrypted',
3598
+ 'ended',
3599
+ 'ended',
3600
+ 'error',
3601
+ 'error',
3602
+ 'gotpointercapture',
3603
+ 'gotPointerCapture',
3604
+ 'load',
3605
+ 'load',
3606
+ 'loadeddata',
3607
+ 'loadedData',
3608
+ 'loadedmetadata',
3609
+ 'loadedMetadata',
3610
+ 'loadstart',
3611
+ 'loadStart',
3612
+ 'lostpointercapture',
3613
+ 'lostPointerCapture',
3614
+ 'playing',
3615
+ 'playing',
3616
+ 'progress',
3617
+ 'progress',
3618
+ 'seeking',
3619
+ 'seeking',
3620
+ 'stalled',
3621
+ 'stalled',
3622
+ 'suspend',
3623
+ 'suspend',
3624
+ 'timeupdate',
3625
+ 'timeUpdate',
3626
+ Xe,
3627
+ 'transitionEnd',
3628
+ 'waiting',
3629
+ 'waiting',
3630
+ ]
3631
+ function Rn(e, n) {
3632
+ for (var t = 0; t < e.length; t += 2) {
3633
+ var a = e[t],
3634
+ i = e[t + 1],
3635
+ s = 'on' + (i[0].toUpperCase() + i.slice(1))
3636
+ ;(s = {
3637
+ phasedRegistrationNames: {
3638
+ bubbled: s,
3639
+ captured: s + 'Capture',
3640
+ },
3641
+ dependencies: [a],
3642
+ eventPriority: n,
3643
+ }),
3644
+ Dn.set(a, n),
3645
+ jn.set(a, s),
3646
+ (Un[i] = s)
3647
+ }
3648
+ }
3649
+ Rn(
3650
+ 'blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange'.split(
3651
+ ' '
3652
+ ),
3653
+ 0
3654
+ ),
3655
+ Rn(
3656
+ 'drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel'.split(
3657
+ ' '
3658
+ ),
3659
+ 1
3660
+ ),
3661
+ Rn(Fn, 2)
3662
+ for (
3663
+ var Yn = 'change selectionchange textInput compositionstart compositionend compositionupdate'.split(
3664
+ ' '
3665
+ ),
3666
+ Qn = 0;
3667
+ Qn < Yn.length;
3668
+ Qn++
3669
+ )
3670
+ Dn.set(Yn[Qn], 0)
3671
+ var Wn = s.unstable_UserBlockingPriority,
3672
+ Vn = s.unstable_runWithPriority,
3673
+ Hn = !0
3674
+ function $n(e, n) {
3675
+ Xn(n, e, !1)
3676
+ }
3677
+ function Xn(e, n, t) {
3678
+ var a = Dn.get(n)
3679
+ switch (void 0 === a ? 2 : a) {
3680
+ case 0:
3681
+ a = Kn.bind(null, n, 1, e)
3682
+ break
3683
+ case 1:
3684
+ a = Zn.bind(null, n, 1, e)
3685
+ break
3686
+ default:
3687
+ a = Gn.bind(null, n, 1, e)
3688
+ }
3689
+ t ? e.addEventListener(n, a, !0) : e.addEventListener(n, a, !1)
3690
+ }
3691
+ function Kn(e, n, t, a) {
3692
+ U || z()
3693
+ var i = Gn,
3694
+ s = U
3695
+ U = !0
3696
+ try {
3697
+ O(i, e, n, t, a)
3698
+ } finally {
3699
+ ;(U = s) || D()
3700
+ }
3701
+ }
3702
+ function Zn(e, n, t, a) {
3703
+ Vn(Wn, Gn.bind(null, e, n, t, a))
3704
+ }
3705
+ function Gn(e, n, t, a) {
3706
+ if (Hn)
3707
+ if (0 < bn.length && -1 < Bn.indexOf(e))
3708
+ (e = Tn(null, e, n, t, a)), bn.push(e)
3709
+ else {
3710
+ var i = Jn(e, n, t, a)
3711
+ if (null === i) Pn(e, a)
3712
+ else if (-1 < Bn.indexOf(e))
3713
+ (e = Tn(i, e, n, t, a)), bn.push(e)
3714
+ else if (
3715
+ !(function (e, n, t, a, i) {
3716
+ switch (n) {
3717
+ case 'focus':
3718
+ return (_n = Nn(_n, e, n, t, a, i)), !0
3719
+ case 'dragenter':
3720
+ return (vn = Nn(vn, e, n, t, a, i)), !0
3721
+ case 'mouseover':
3722
+ return (wn = Nn(wn, e, n, t, a, i)), !0
3723
+ case 'pointerover':
3724
+ var s = i.pointerId
3725
+ return (
3726
+ En.set(
3727
+ s,
3728
+ Nn(
3729
+ En.get(s) || null,
3730
+ e,
3731
+ n,
3732
+ t,
3733
+ a,
3734
+ i
3735
+ )
3736
+ ),
3737
+ !0
3738
+ )
3739
+ case 'gotpointercapture':
3740
+ return (
3741
+ (s = i.pointerId),
3742
+ Cn.set(
3743
+ s,
3744
+ Nn(
3745
+ Cn.get(s) || null,
3746
+ e,
3747
+ n,
3748
+ t,
3749
+ a,
3750
+ i
3751
+ )
3752
+ ),
3753
+ !0
3754
+ )
3755
+ }
3756
+ return !1
3757
+ })(i, e, n, t, a)
3758
+ ) {
3759
+ Pn(e, a), (e = dn(e, a, null, n))
3760
+ try {
3761
+ F(gn, e)
3762
+ } finally {
3763
+ un(e)
3764
+ }
3765
+ }
3766
+ }
3767
+ }
3768
+ function Jn(e, n, t, a) {
3769
+ if (null !== (t = Bt((t = ln(a))))) {
3770
+ var i = Je(t)
3771
+ if (null === i) t = null
3772
+ else {
3773
+ var s = i.tag
3774
+ if (13 === s) {
3775
+ if (null !== (t = en(i))) return t
3776
+ t = null
3777
+ } else if (3 === s) {
3778
+ if (i.stateNode.hydrate)
3779
+ return 3 === i.tag
3780
+ ? i.stateNode.containerInfo
3781
+ : null
3782
+ t = null
3783
+ } else i !== t && (t = null)
3784
+ }
3785
+ }
3786
+ e = dn(e, a, t, n)
3787
+ try {
3788
+ F(gn, e)
3789
+ } finally {
3790
+ un(e)
3791
+ }
3792
+ return null
3793
+ }
3794
+ var et = {
3795
+ animationIterationCount: !0,
3796
+ borderImageOutset: !0,
3797
+ borderImageSlice: !0,
3798
+ borderImageWidth: !0,
3799
+ boxFlex: !0,
3800
+ boxFlexGroup: !0,
3801
+ boxOrdinalGroup: !0,
3802
+ columnCount: !0,
3803
+ columns: !0,
3804
+ flex: !0,
3805
+ flexGrow: !0,
3806
+ flexPositive: !0,
3807
+ flexShrink: !0,
3808
+ flexNegative: !0,
3809
+ flexOrder: !0,
3810
+ gridArea: !0,
3811
+ gridRow: !0,
3812
+ gridRowEnd: !0,
3813
+ gridRowSpan: !0,
3814
+ gridRowStart: !0,
3815
+ gridColumn: !0,
3816
+ gridColumnEnd: !0,
3817
+ gridColumnSpan: !0,
3818
+ gridColumnStart: !0,
3819
+ fontWeight: !0,
3820
+ lineClamp: !0,
3821
+ lineHeight: !0,
3822
+ opacity: !0,
3823
+ order: !0,
3824
+ orphans: !0,
3825
+ tabSize: !0,
3826
+ widows: !0,
3827
+ zIndex: !0,
3828
+ zoom: !0,
3829
+ fillOpacity: !0,
3830
+ floodOpacity: !0,
3831
+ stopOpacity: !0,
3832
+ strokeDasharray: !0,
3833
+ strokeDashoffset: !0,
3834
+ strokeMiterlimit: !0,
3835
+ strokeOpacity: !0,
3836
+ strokeWidth: !0,
3837
+ },
3838
+ nt = ['Webkit', 'ms', 'Moz', 'O']
3839
+ function tt(e, n, t) {
3840
+ return null == n || 'boolean' == typeof n || '' === n
3841
+ ? ''
3842
+ : t ||
3843
+ 'number' != typeof n ||
3844
+ 0 === n ||
3845
+ (et.hasOwnProperty(e) && et[e])
3846
+ ? ('' + n).trim()
3847
+ : n + 'px'
3848
+ }
3849
+ function at(e, n) {
3850
+ for (var t in ((e = e.style), n))
3851
+ if (n.hasOwnProperty(t)) {
3852
+ var a = 0 === t.indexOf('--'),
3853
+ i = tt(t, n[t], a)
3854
+ 'float' === t && (t = 'cssFloat'),
3855
+ a ? e.setProperty(t, i) : (e[t] = i)
3856
+ }
3857
+ }
3858
+ Object.keys(et).forEach(function (e) {
3859
+ nt.forEach(function (n) {
3860
+ ;(n = n + e.charAt(0).toUpperCase() + e.substring(1)),
3861
+ (et[n] = et[e])
3862
+ })
3863
+ })
3864
+ var it = i(
3865
+ { menuitem: !0 },
3866
+ {
3867
+ area: !0,
3868
+ base: !0,
3869
+ br: !0,
3870
+ col: !0,
3871
+ embed: !0,
3872
+ hr: !0,
3873
+ img: !0,
3874
+ input: !0,
3875
+ keygen: !0,
3876
+ link: !0,
3877
+ meta: !0,
3878
+ param: !0,
3879
+ source: !0,
3880
+ track: !0,
3881
+ wbr: !0,
3882
+ }
3883
+ )
3884
+ function st(e, n) {
3885
+ if (n) {
3886
+ if (
3887
+ it[e] &&
3888
+ (null != n.children ||
3889
+ null != n.dangerouslySetInnerHTML)
3890
+ )
3891
+ throw Error(r(137, e, ''))
3892
+ if (null != n.dangerouslySetInnerHTML) {
3893
+ if (null != n.children) throw Error(r(60))
3894
+ if (
3895
+ 'object' != typeof n.dangerouslySetInnerHTML ||
3896
+ !('__html' in n.dangerouslySetInnerHTML)
3897
+ )
3898
+ throw Error(r(61))
3899
+ }
3900
+ if (null != n.style && 'object' != typeof n.style)
3901
+ throw Error(r(62, ''))
3902
+ }
3903
+ }
3904
+ function rt(e, n) {
3905
+ if (-1 === e.indexOf('-')) return 'string' == typeof n.is
3906
+ switch (e) {
3907
+ case 'annotation-xml':
3908
+ case 'color-profile':
3909
+ case 'font-face':
3910
+ case 'font-face-src':
3911
+ case 'font-face-uri':
3912
+ case 'font-face-format':
3913
+ case 'font-face-name':
3914
+ case 'missing-glyph':
3915
+ return !1
3916
+ default:
3917
+ return !0
3918
+ }
3919
+ }
3920
+ var ot = Ie
3921
+ function ct(e, n) {
3922
+ var t = Ge(
3923
+ (e =
3924
+ 9 === e.nodeType || 11 === e.nodeType
3925
+ ? e
3926
+ : e.ownerDocument)
3927
+ )
3928
+ n = C[n]
3929
+ for (var a = 0; a < n.length; a++) mn(n[a], e, t)
3930
+ }
3931
+ function lt() {}
3932
+ function pt(e) {
3933
+ if (
3934
+ void 0 ===
3935
+ (e =
3936
+ e ||
3937
+ ('undefined' != typeof document ? document : void 0))
3938
+ )
3939
+ return null
3940
+ try {
3941
+ return e.activeElement || e.body
3942
+ } catch (n) {
3943
+ return e.body
3944
+ }
3945
+ }
3946
+ function ft(e) {
3947
+ for (; e && e.firstChild; ) e = e.firstChild
3948
+ return e
3949
+ }
3950
+ function ut(e, n) {
3951
+ var t,
3952
+ a = ft(e)
3953
+ for (e = 0; a; ) {
3954
+ if (3 === a.nodeType) {
3955
+ if (((t = e + a.textContent.length), e <= n && t >= n))
3956
+ return { node: a, offset: n - e }
3957
+ e = t
3958
+ }
3959
+ e: {
3960
+ for (; a; ) {
3961
+ if (a.nextSibling) {
3962
+ a = a.nextSibling
3963
+ break e
3964
+ }
3965
+ a = a.parentNode
3966
+ }
3967
+ a = void 0
3968
+ }
3969
+ a = ft(a)
3970
+ }
3971
+ }
3972
+ function dt() {
3973
+ for (
3974
+ var e = window, n = pt();
3975
+ n instanceof e.HTMLIFrameElement;
3976
+
3977
+ ) {
3978
+ try {
3979
+ var t = 'string' == typeof n.contentWindow.location.href
3980
+ } catch (e) {
3981
+ t = !1
3982
+ }
3983
+ if (!t) break
3984
+ n = pt((e = n.contentWindow).document)
3985
+ }
3986
+ return n
3987
+ }
3988
+ function gt(e) {
3989
+ var n = e && e.nodeName && e.nodeName.toLowerCase()
3990
+ return (
3991
+ n &&
3992
+ (('input' === n &&
3993
+ ('text' === e.type ||
3994
+ 'search' === e.type ||
3995
+ 'tel' === e.type ||
3996
+ 'url' === e.type ||
3997
+ 'password' === e.type)) ||
3998
+ 'textarea' === n ||
3999
+ 'true' === e.contentEditable)
4000
+ )
4001
+ }
4002
+ var mt = null,
4003
+ ht = null
4004
+ function At(e, n) {
4005
+ switch (e) {
4006
+ case 'button':
4007
+ case 'input':
4008
+ case 'select':
4009
+ case 'textarea':
4010
+ return !!n.autoFocus
4011
+ }
4012
+ return !1
4013
+ }
4014
+ function kt(e, n) {
4015
+ return (
4016
+ 'textarea' === e ||
4017
+ 'option' === e ||
4018
+ 'noscript' === e ||
4019
+ 'string' == typeof n.children ||
4020
+ 'number' == typeof n.children ||
4021
+ ('object' == typeof n.dangerouslySetInnerHTML &&
4022
+ null !== n.dangerouslySetInnerHTML &&
4023
+ null != n.dangerouslySetInnerHTML.__html)
4024
+ )
4025
+ }
4026
+ var yt = 'function' == typeof setTimeout ? setTimeout : void 0,
4027
+ bt = 'function' == typeof clearTimeout ? clearTimeout : void 0
4028
+ function _t(e) {
4029
+ for (; null != e; e = e.nextSibling) {
4030
+ var n = e.nodeType
4031
+ if (1 === n || 3 === n) break
4032
+ }
4033
+ return e
4034
+ }
4035
+ function vt(e) {
4036
+ e = e.previousSibling
4037
+ for (var n = 0; e; ) {
4038
+ if (8 === e.nodeType) {
4039
+ var t = e.data
4040
+ if ('$' === t || '$!' === t || '$?' === t) {
4041
+ if (0 === n) return e
4042
+ n--
4043
+ } else '/$' === t && n++
4044
+ }
4045
+ e = e.previousSibling
4046
+ }
4047
+ return null
4048
+ }
4049
+ var wt = Math.random().toString(36).slice(2),
4050
+ Et = '__reactInternalInstance$' + wt,
4051
+ Ct = '__reactEventHandlers$' + wt,
4052
+ xt = '__reactContainere$' + wt
4053
+ function Bt(e) {
4054
+ var n = e[Et]
4055
+ if (n) return n
4056
+ for (var t = e.parentNode; t; ) {
4057
+ if ((n = t[xt] || t[Et])) {
4058
+ if (
4059
+ ((t = n.alternate),
4060
+ null !== n.child ||
4061
+ (null !== t && null !== t.child))
4062
+ )
4063
+ for (e = vt(e); null !== e; ) {
4064
+ if ((t = e[Et])) return t
4065
+ e = vt(e)
4066
+ }
4067
+ return n
4068
+ }
4069
+ t = (e = t).parentNode
4070
+ }
4071
+ return null
4072
+ }
4073
+ function St(e) {
4074
+ return !(e = e[Et] || e[xt]) ||
4075
+ (5 !== e.tag && 6 !== e.tag && 13 !== e.tag && 3 !== e.tag)
4076
+ ? null
4077
+ : e
4078
+ }
4079
+ function Tt(e) {
4080
+ if (5 === e.tag || 6 === e.tag) return e.stateNode
4081
+ throw Error(r(33))
4082
+ }
4083
+ function Pt(e) {
4084
+ return e[Ct] || null
4085
+ }
4086
+ function Nt(e) {
4087
+ do {
4088
+ e = e.return
4089
+ } while (e && 5 !== e.tag)
4090
+ return e || null
4091
+ }
4092
+ function Mt(e, n) {
4093
+ var t = e.stateNode
4094
+ if (!t) return null
4095
+ var a = g(t)
4096
+ if (!a) return null
4097
+ t = a[n]
4098
+ e: switch (n) {
4099
+ case 'onClick':
4100
+ case 'onClickCapture':
4101
+ case 'onDoubleClick':
4102
+ case 'onDoubleClickCapture':
4103
+ case 'onMouseDown':
4104
+ case 'onMouseDownCapture':
4105
+ case 'onMouseMove':
4106
+ case 'onMouseMoveCapture':
4107
+ case 'onMouseUp':
4108
+ case 'onMouseUpCapture':
4109
+ case 'onMouseEnter':
4110
+ ;(a = !a.disabled) ||
4111
+ (a = !(
4112
+ 'button' === (e = e.type) ||
4113
+ 'input' === e ||
4114
+ 'select' === e ||
4115
+ 'textarea' === e
4116
+ )),
4117
+ (e = !a)
4118
+ break e
4119
+ default:
4120
+ e = !1
4121
+ }
4122
+ if (e) return null
4123
+ if (t && 'function' != typeof t)
4124
+ throw Error(r(231, n, typeof t))
4125
+ return t
4126
+ }
4127
+ function qt(e, n, t) {
4128
+ ;(n = Mt(e, t.dispatchConfig.phasedRegistrationNames[n])) &&
4129
+ ((t._dispatchListeners = an(t._dispatchListeners, n)),
4130
+ (t._dispatchInstances = an(t._dispatchInstances, e)))
4131
+ }
4132
+ function It(e) {
4133
+ if (e && e.dispatchConfig.phasedRegistrationNames) {
4134
+ for (var n = e._targetInst, t = []; n; )
4135
+ t.push(n), (n = Nt(n))
4136
+ for (n = t.length; 0 < n--; ) qt(t[n], 'captured', e)
4137
+ for (n = 0; n < t.length; n++) qt(t[n], 'bubbled', e)
4138
+ }
4139
+ }
4140
+ function Ot(e, n, t) {
4141
+ e &&
4142
+ t &&
4143
+ t.dispatchConfig.registrationName &&
4144
+ (n = Mt(e, t.dispatchConfig.registrationName)) &&
4145
+ ((t._dispatchListeners = an(t._dispatchListeners, n)),
4146
+ (t._dispatchInstances = an(t._dispatchInstances, e)))
4147
+ }
4148
+ function zt(e) {
4149
+ e &&
4150
+ e.dispatchConfig.registrationName &&
4151
+ Ot(e._targetInst, null, e)
4152
+ }
4153
+ function Lt(e) {
4154
+ sn(e, It)
4155
+ }
4156
+ var Ut = null,
4157
+ jt = null,
4158
+ Dt = null
4159
+ function Ft() {
4160
+ if (Dt) return Dt
4161
+ var e,
4162
+ n,
4163
+ t = jt,
4164
+ a = t.length,
4165
+ i = 'value' in Ut ? Ut.value : Ut.textContent,
4166
+ s = i.length
4167
+ for (e = 0; e < a && t[e] === i[e]; e++);
4168
+ var r = a - e
4169
+ for (n = 1; n <= r && t[a - n] === i[s - n]; n++);
4170
+ return (Dt = i.slice(e, 1 < n ? 1 - n : void 0))
4171
+ }
4172
+ function Rt() {
4173
+ return !0
4174
+ }
4175
+ function Yt() {
4176
+ return !1
4177
+ }
4178
+ function Qt(e, n, t, a) {
4179
+ for (var i in ((this.dispatchConfig = e),
4180
+ (this._targetInst = n),
4181
+ (this.nativeEvent = t),
4182
+ (e = this.constructor.Interface)))
4183
+ e.hasOwnProperty(i) &&
4184
+ ((n = e[i])
4185
+ ? (this[i] = n(t))
4186
+ : 'target' === i
4187
+ ? (this.target = a)
4188
+ : (this[i] = t[i]))
4189
+ return (
4190
+ (this.isDefaultPrevented = (
4191
+ null != t.defaultPrevented
4192
+ ? t.defaultPrevented
4193
+ : !1 === t.returnValue
4194
+ )
4195
+ ? Rt
4196
+ : Yt),
4197
+ (this.isPropagationStopped = Yt),
4198
+ this
4199
+ )
4200
+ }
4201
+ function Wt(e, n, t, a) {
4202
+ if (this.eventPool.length) {
4203
+ var i = this.eventPool.pop()
4204
+ return this.call(i, e, n, t, a), i
4205
+ }
4206
+ return new this(e, n, t, a)
4207
+ }
4208
+ function Vt(e) {
4209
+ if (!(e instanceof this)) throw Error(r(279))
4210
+ e.destructor(),
4211
+ 10 > this.eventPool.length && this.eventPool.push(e)
4212
+ }
4213
+ function Ht(e) {
4214
+ ;(e.eventPool = []), (e.getPooled = Wt), (e.release = Vt)
4215
+ }
4216
+ i(Qt.prototype, {
4217
+ preventDefault: function () {
4218
+ this.defaultPrevented = !0
4219
+ var e = this.nativeEvent
4220
+ e &&
4221
+ (e.preventDefault
4222
+ ? e.preventDefault()
4223
+ : 'unknown' != typeof e.returnValue &&
4224
+ (e.returnValue = !1),
4225
+ (this.isDefaultPrevented = Rt))
4226
+ },
4227
+ stopPropagation: function () {
4228
+ var e = this.nativeEvent
4229
+ e &&
4230
+ (e.stopPropagation
4231
+ ? e.stopPropagation()
4232
+ : 'unknown' != typeof e.cancelBubble &&
4233
+ (e.cancelBubble = !0),
4234
+ (this.isPropagationStopped = Rt))
4235
+ },
4236
+ persist: function () {
4237
+ this.isPersistent = Rt
4238
+ },
4239
+ isPersistent: Yt,
4240
+ destructor: function () {
4241
+ var e,
4242
+ n = this.constructor.Interface
4243
+ for (e in n) this[e] = null
4244
+ ;(this.nativeEvent = this._targetInst = this.dispatchConfig = null),
4245
+ (this.isPropagationStopped = this.isDefaultPrevented = Yt),
4246
+ (this._dispatchInstances = this._dispatchListeners = null)
4247
+ },
4248
+ }),
4249
+ (Qt.Interface = {
4250
+ type: null,
4251
+ target: null,
4252
+ currentTarget: function () {
4253
+ return null
4254
+ },
4255
+ eventPhase: null,
4256
+ bubbles: null,
4257
+ cancelable: null,
4258
+ timeStamp: function (e) {
4259
+ return e.timeStamp || Date.now()
4260
+ },
4261
+ defaultPrevented: null,
4262
+ isTrusted: null,
4263
+ }),
4264
+ (Qt.extend = function (e) {
4265
+ function n() {}
4266
+ function t() {
4267
+ return a.apply(this, arguments)
4268
+ }
4269
+ var a = this
4270
+ n.prototype = a.prototype
4271
+ var s = new n()
4272
+ return (
4273
+ i(s, t.prototype),
4274
+ (t.prototype = s),
4275
+ (t.prototype.constructor = t),
4276
+ (t.Interface = i({}, a.Interface, e)),
4277
+ (t.extend = a.extend),
4278
+ Ht(t),
4279
+ t
4280
+ )
4281
+ }),
4282
+ Ht(Qt)
4283
+ var $t = Qt.extend({ data: null }),
4284
+ Xt = Qt.extend({ data: null }),
4285
+ Kt = [9, 13, 27, 32],
4286
+ Zt = B && 'CompositionEvent' in window,
4287
+ Gt = null
4288
+ B && 'documentMode' in document && (Gt = document.documentMode)
4289
+ var Jt = B && 'TextEvent' in window && !Gt,
4290
+ ea = B && (!Zt || (Gt && 8 < Gt && 11 >= Gt)),
4291
+ na = String.fromCharCode(32),
4292
+ ta = {
4293
+ beforeInput: {
4294
+ phasedRegistrationNames: {
4295
+ bubbled: 'onBeforeInput',
4296
+ captured: 'onBeforeInputCapture',
4297
+ },
4298
+ dependencies: [
4299
+ 'compositionend',
4300
+ 'keypress',
4301
+ 'textInput',
4302
+ 'paste',
4303
+ ],
4304
+ },
4305
+ compositionEnd: {
4306
+ phasedRegistrationNames: {
4307
+ bubbled: 'onCompositionEnd',
4308
+ captured: 'onCompositionEndCapture',
4309
+ },
4310
+ dependencies: 'blur compositionend keydown keypress keyup mousedown'.split(
4311
+ ' '
4312
+ ),
4313
+ },
4314
+ compositionStart: {
4315
+ phasedRegistrationNames: {
4316
+ bubbled: 'onCompositionStart',
4317
+ captured: 'onCompositionStartCapture',
4318
+ },
4319
+ dependencies: 'blur compositionstart keydown keypress keyup mousedown'.split(
4320
+ ' '
4321
+ ),
4322
+ },
4323
+ compositionUpdate: {
4324
+ phasedRegistrationNames: {
4325
+ bubbled: 'onCompositionUpdate',
4326
+ captured: 'onCompositionUpdateCapture',
4327
+ },
4328
+ dependencies: 'blur compositionupdate keydown keypress keyup mousedown'.split(
4329
+ ' '
4330
+ ),
4331
+ },
4332
+ },
4333
+ aa = !1
4334
+ function ia(e, n) {
4335
+ switch (e) {
4336
+ case 'keyup':
4337
+ return -1 !== Kt.indexOf(n.keyCode)
4338
+ case 'keydown':
4339
+ return 229 !== n.keyCode
4340
+ case 'keypress':
4341
+ case 'mousedown':
4342
+ case 'blur':
4343
+ return !0
4344
+ default:
4345
+ return !1
4346
+ }
4347
+ }
4348
+ function sa(e) {
4349
+ return 'object' == typeof (e = e.detail) && 'data' in e
4350
+ ? e.data
4351
+ : null
4352
+ }
4353
+ var ra = !1
4354
+ var oa = {
4355
+ eventTypes: ta,
4356
+ extractEvents: function (e, n, t, a) {
4357
+ var i
4358
+ if (Zt)
4359
+ e: {
4360
+ switch (e) {
4361
+ case 'compositionstart':
4362
+ var s = ta.compositionStart
4363
+ break e
4364
+ case 'compositionend':
4365
+ s = ta.compositionEnd
4366
+ break e
4367
+ case 'compositionupdate':
4368
+ s = ta.compositionUpdate
4369
+ break e
4370
+ }
4371
+ s = void 0
4372
+ }
4373
+ else
4374
+ ra
4375
+ ? ia(e, t) && (s = ta.compositionEnd)
4376
+ : 'keydown' === e &&
4377
+ 229 === t.keyCode &&
4378
+ (s = ta.compositionStart)
4379
+ return (
4380
+ s
4381
+ ? (ea &&
4382
+ 'ko' !== t.locale &&
4383
+ (ra || s !== ta.compositionStart
4384
+ ? s === ta.compositionEnd &&
4385
+ ra &&
4386
+ (i = Ft())
4387
+ : ((jt =
4388
+ 'value' in (Ut = a)
4389
+ ? Ut.value
4390
+ : Ut.textContent),
4391
+ (ra = !0))),
4392
+ (s = $t.getPooled(s, n, t, a)),
4393
+ i
4394
+ ? (s.data = i)
4395
+ : null !== (i = sa(t)) && (s.data = i),
4396
+ Lt(s),
4397
+ (i = s))
4398
+ : (i = null),
4399
+ (e = Jt
4400
+ ? (function (e, n) {
4401
+ switch (e) {
4402
+ case 'compositionend':
4403
+ return sa(n)
4404
+ case 'keypress':
4405
+ return 32 !== n.which
4406
+ ? null
4407
+ : ((aa = !0), na)
4408
+ case 'textInput':
4409
+ return (e = n.data) === na && aa
4410
+ ? null
4411
+ : e
4412
+ default:
4413
+ return null
4414
+ }
4415
+ })(e, t)
4416
+ : (function (e, n) {
4417
+ if (ra)
4418
+ return 'compositionend' === e ||
4419
+ (!Zt && ia(e, n))
4420
+ ? ((e = Ft()),
4421
+ (Dt = jt = Ut = null),
4422
+ (ra = !1),
4423
+ e)
4424
+ : null
4425
+ switch (e) {
4426
+ case 'paste':
4427
+ return null
4428
+ case 'keypress':
4429
+ if (
4430
+ !(
4431
+ n.ctrlKey ||
4432
+ n.altKey ||
4433
+ n.metaKey
4434
+ ) ||
4435
+ (n.ctrlKey && n.altKey)
4436
+ ) {
4437
+ if (
4438
+ n.char &&
4439
+ 1 < n.char.length
4440
+ )
4441
+ return n.char
4442
+ if (n.which)
4443
+ return String.fromCharCode(
4444
+ n.which
4445
+ )
4446
+ }
4447
+ return null
4448
+ case 'compositionend':
4449
+ return ea && 'ko' !== n.locale
4450
+ ? null
4451
+ : n.data
4452
+ default:
4453
+ return null
4454
+ }
4455
+ })(e, t))
4456
+ ? (((n = Xt.getPooled(
4457
+ ta.beforeInput,
4458
+ n,
4459
+ t,
4460
+ a
4461
+ )).data = e),
4462
+ Lt(n))
4463
+ : (n = null),
4464
+ null === i ? n : null === n ? i : [i, n]
4465
+ )
4466
+ },
4467
+ },
4468
+ ca = {
4469
+ color: !0,
4470
+ date: !0,
4471
+ datetime: !0,
4472
+ 'datetime-local': !0,
4473
+ email: !0,
4474
+ month: !0,
4475
+ number: !0,
4476
+ password: !0,
4477
+ range: !0,
4478
+ search: !0,
4479
+ tel: !0,
4480
+ text: !0,
4481
+ time: !0,
4482
+ url: !0,
4483
+ week: !0,
4484
+ }
4485
+ function la(e) {
4486
+ var n = e && e.nodeName && e.nodeName.toLowerCase()
4487
+ return 'input' === n ? !!ca[e.type] : 'textarea' === n
4488
+ }
4489
+ var pa = {
4490
+ change: {
4491
+ phasedRegistrationNames: {
4492
+ bubbled: 'onChange',
4493
+ captured: 'onChangeCapture',
4494
+ },
4495
+ dependencies: 'blur change click focus input keydown keyup selectionchange'.split(
4496
+ ' '
4497
+ ),
4498
+ },
4499
+ }
4500
+ function fa(e, n, t) {
4501
+ return (
4502
+ ((e = Qt.getPooled(pa.change, e, n, t)).type = 'change'),
4503
+ M(t),
4504
+ Lt(e),
4505
+ e
4506
+ )
4507
+ }
4508
+ var ua = null,
4509
+ da = null
4510
+ function ga(e) {
4511
+ cn(e)
4512
+ }
4513
+ function ma(e) {
4514
+ if (_e(Tt(e))) return e
4515
+ }
4516
+ function ha(e, n) {
4517
+ if ('change' === e) return n
4518
+ }
4519
+ var Aa = !1
4520
+ function ka() {
4521
+ ua && (ua.detachEvent('onpropertychange', ya), (da = ua = null))
4522
+ }
4523
+ function ya(e) {
4524
+ if ('value' === e.propertyName && ma(da))
4525
+ if (((e = fa(da, e, ln(e))), U)) cn(e)
4526
+ else {
4527
+ U = !0
4528
+ try {
4529
+ I(ga, e)
4530
+ } finally {
4531
+ ;(U = !1), D()
4532
+ }
4533
+ }
4534
+ }
4535
+ function ba(e, n, t) {
4536
+ 'focus' === e
4537
+ ? (ka(),
4538
+ (da = t),
4539
+ (ua = n).attachEvent('onpropertychange', ya))
4540
+ : 'blur' === e && ka()
4541
+ }
4542
+ function _a(e) {
4543
+ if ('selectionchange' === e || 'keyup' === e || 'keydown' === e)
4544
+ return ma(da)
4545
+ }
4546
+ function va(e, n) {
4547
+ if ('click' === e) return ma(n)
4548
+ }
4549
+ function wa(e, n) {
4550
+ if ('input' === e || 'change' === e) return ma(n)
4551
+ }
4552
+ B &&
4553
+ (Aa =
4554
+ pn('input') &&
4555
+ (!document.documentMode || 9 < document.documentMode))
4556
+ var Ea = {
4557
+ eventTypes: pa,
4558
+ _isInputEventSupported: Aa,
4559
+ extractEvents: function (e, n, t, a) {
4560
+ var i = n ? Tt(n) : window,
4561
+ s = i.nodeName && i.nodeName.toLowerCase()
4562
+ if (
4563
+ 'select' === s ||
4564
+ ('input' === s && 'file' === i.type)
4565
+ )
4566
+ var r = ha
4567
+ else if (la(i))
4568
+ if (Aa) r = wa
4569
+ else {
4570
+ r = _a
4571
+ var o = ba
4572
+ }
4573
+ else
4574
+ (s = i.nodeName) &&
4575
+ 'input' === s.toLowerCase() &&
4576
+ ('checkbox' === i.type || 'radio' === i.type) &&
4577
+ (r = va)
4578
+ if (r && (r = r(e, n))) return fa(r, t, a)
4579
+ o && o(e, i, n),
4580
+ 'blur' === e &&
4581
+ (e = i._wrapperState) &&
4582
+ e.controlled &&
4583
+ 'number' === i.type &&
4584
+ Be(i, 'number', i.value)
4585
+ },
4586
+ },
4587
+ Ca = Qt.extend({ view: null, detail: null }),
4588
+ xa = {
4589
+ Alt: 'altKey',
4590
+ Control: 'ctrlKey',
4591
+ Meta: 'metaKey',
4592
+ Shift: 'shiftKey',
4593
+ }
4594
+ function Ba(e) {
4595
+ var n = this.nativeEvent
4596
+ return n.getModifierState
4597
+ ? n.getModifierState(e)
4598
+ : !!(e = xa[e]) && !!n[e]
4599
+ }
4600
+ function Sa() {
4601
+ return Ba
4602
+ }
4603
+ var Ta = 0,
4604
+ Pa = 0,
4605
+ Na = !1,
4606
+ Ma = !1,
4607
+ qa = Ca.extend({
4608
+ screenX: null,
4609
+ screenY: null,
4610
+ clientX: null,
4611
+ clientY: null,
4612
+ pageX: null,
4613
+ pageY: null,
4614
+ ctrlKey: null,
4615
+ shiftKey: null,
4616
+ altKey: null,
4617
+ metaKey: null,
4618
+ getModifierState: Sa,
4619
+ button: null,
4620
+ buttons: null,
4621
+ relatedTarget: function (e) {
4622
+ return (
4623
+ e.relatedTarget ||
4624
+ (e.fromElement === e.srcElement
4625
+ ? e.toElement
4626
+ : e.fromElement)
4627
+ )
4628
+ },
4629
+ movementX: function (e) {
4630
+ if ('movementX' in e) return e.movementX
4631
+ var n = Ta
4632
+ return (
4633
+ (Ta = e.screenX),
4634
+ Na
4635
+ ? 'mousemove' === e.type
4636
+ ? e.screenX - n
4637
+ : 0
4638
+ : ((Na = !0), 0)
4639
+ )
4640
+ },
4641
+ movementY: function (e) {
4642
+ if ('movementY' in e) return e.movementY
4643
+ var n = Pa
4644
+ return (
4645
+ (Pa = e.screenY),
4646
+ Ma
4647
+ ? 'mousemove' === e.type
4648
+ ? e.screenY - n
4649
+ : 0
4650
+ : ((Ma = !0), 0)
4651
+ )
4652
+ },
4653
+ }),
4654
+ Ia = qa.extend({
4655
+ pointerId: null,
4656
+ width: null,
4657
+ height: null,
4658
+ pressure: null,
4659
+ tangentialPressure: null,
4660
+ tiltX: null,
4661
+ tiltY: null,
4662
+ twist: null,
4663
+ pointerType: null,
4664
+ isPrimary: null,
4665
+ }),
4666
+ Oa = {
4667
+ mouseEnter: {
4668
+ registrationName: 'onMouseEnter',
4669
+ dependencies: ['mouseout', 'mouseover'],
4670
+ },
4671
+ mouseLeave: {
4672
+ registrationName: 'onMouseLeave',
4673
+ dependencies: ['mouseout', 'mouseover'],
4674
+ },
4675
+ pointerEnter: {
4676
+ registrationName: 'onPointerEnter',
4677
+ dependencies: ['pointerout', 'pointerover'],
4678
+ },
4679
+ pointerLeave: {
4680
+ registrationName: 'onPointerLeave',
4681
+ dependencies: ['pointerout', 'pointerover'],
4682
+ },
4683
+ },
4684
+ za = {
4685
+ eventTypes: Oa,
4686
+ extractEvents: function (e, n, t, a, i) {
4687
+ var s = 'mouseover' === e || 'pointerover' === e,
4688
+ r = 'mouseout' === e || 'pointerout' === e
4689
+ if (
4690
+ (s &&
4691
+ 0 == (32 & i) &&
4692
+ (t.relatedTarget || t.fromElement)) ||
4693
+ (!r && !s)
4694
+ )
4695
+ return null
4696
+ ;((s =
4697
+ a.window === a
4698
+ ? a
4699
+ : (s = a.ownerDocument)
4700
+ ? s.defaultView || s.parentWindow
4701
+ : window),
4702
+ r)
4703
+ ? ((r = n),
4704
+ null !==
4705
+ (n = (n = t.relatedTarget || t.toElement)
4706
+ ? Bt(n)
4707
+ : null) &&
4708
+ (n !== Je(n) ||
4709
+ (5 !== n.tag && 6 !== n.tag)) &&
4710
+ (n = null))
4711
+ : (r = null)
4712
+ if (r === n) return null
4713
+ if ('mouseout' === e || 'mouseover' === e)
4714
+ var o = qa,
4715
+ c = Oa.mouseLeave,
4716
+ l = Oa.mouseEnter,
4717
+ p = 'mouse'
4718
+ else
4719
+ ('pointerout' !== e && 'pointerover' !== e) ||
4720
+ ((o = Ia),
4721
+ (c = Oa.pointerLeave),
4722
+ (l = Oa.pointerEnter),
4723
+ (p = 'pointer'))
4724
+ if (
4725
+ ((e = null == r ? s : Tt(r)),
4726
+ (s = null == n ? s : Tt(n)),
4727
+ ((c = o.getPooled(c, r, t, a)).type = p + 'leave'),
4728
+ (c.target = e),
4729
+ (c.relatedTarget = s),
4730
+ ((t = o.getPooled(l, n, t, a)).type = p + 'enter'),
4731
+ (t.target = s),
4732
+ (t.relatedTarget = e),
4733
+ (p = n),
4734
+ (a = r) && p)
4735
+ )
4736
+ e: {
4737
+ for (l = p, r = 0, e = o = a; e; e = Nt(e)) r++
4738
+ for (e = 0, n = l; n; n = Nt(n)) e++
4739
+ for (; 0 < r - e; ) (o = Nt(o)), r--
4740
+ for (; 0 < e - r; ) (l = Nt(l)), e--
4741
+ for (; r--; ) {
4742
+ if (o === l || o === l.alternate) break e
4743
+ ;(o = Nt(o)), (l = Nt(l))
4744
+ }
4745
+ o = null
4746
+ }
4747
+ else o = null
4748
+ for (
4749
+ l = o, o = [];
4750
+ a &&
4751
+ a !== l &&
4752
+ (null === (r = a.alternate) || r !== l);
4753
+
4754
+ )
4755
+ o.push(a), (a = Nt(a))
4756
+ for (
4757
+ a = [];
4758
+ p &&
4759
+ p !== l &&
4760
+ (null === (r = p.alternate) || r !== l);
4761
+
4762
+ )
4763
+ a.push(p), (p = Nt(p))
4764
+ for (p = 0; p < o.length; p++) Ot(o[p], 'bubbled', c)
4765
+ for (p = a.length; 0 < p--; ) Ot(a[p], 'captured', t)
4766
+ return 0 == (64 & i) ? [c] : [c, t]
4767
+ },
4768
+ }
4769
+ var La =
4770
+ 'function' == typeof Object.is
4771
+ ? Object.is
4772
+ : function (e, n) {
4773
+ return (
4774
+ (e === n && (0 !== e || 1 / e == 1 / n)) ||
4775
+ (e != e && n != n)
4776
+ )
4777
+ },
4778
+ Ua = Object.prototype.hasOwnProperty
4779
+ function ja(e, n) {
4780
+ if (La(e, n)) return !0
4781
+ if (
4782
+ 'object' != typeof e ||
4783
+ null === e ||
4784
+ 'object' != typeof n ||
4785
+ null === n
4786
+ )
4787
+ return !1
4788
+ var t = Object.keys(e),
4789
+ a = Object.keys(n)
4790
+ if (t.length !== a.length) return !1
4791
+ for (a = 0; a < t.length; a++)
4792
+ if (!Ua.call(n, t[a]) || !La(e[t[a]], n[t[a]])) return !1
4793
+ return !0
4794
+ }
4795
+ var Da =
4796
+ B &&
4797
+ 'documentMode' in document &&
4798
+ 11 >= document.documentMode,
4799
+ Fa = {
4800
+ select: {
4801
+ phasedRegistrationNames: {
4802
+ bubbled: 'onSelect',
4803
+ captured: 'onSelectCapture',
4804
+ },
4805
+ dependencies: 'blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange'.split(
4806
+ ' '
4807
+ ),
4808
+ },
4809
+ },
4810
+ Ra = null,
4811
+ Ya = null,
4812
+ Qa = null,
4813
+ Wa = !1
4814
+ function Va(e, n) {
4815
+ var t =
4816
+ n.window === n
4817
+ ? n.document
4818
+ : 9 === n.nodeType
4819
+ ? n
4820
+ : n.ownerDocument
4821
+ return Wa || null == Ra || Ra !== pt(t)
4822
+ ? null
4823
+ : ('selectionStart' in (t = Ra) && gt(t)
4824
+ ? (t = {
4825
+ start: t.selectionStart,
4826
+ end: t.selectionEnd,
4827
+ })
4828
+ : (t = {
4829
+ anchorNode: (t = (
4830
+ (t.ownerDocument &&
4831
+ t.ownerDocument.defaultView) ||
4832
+ window
4833
+ ).getSelection()).anchorNode,
4834
+ anchorOffset: t.anchorOffset,
4835
+ focusNode: t.focusNode,
4836
+ focusOffset: t.focusOffset,
4837
+ }),
4838
+ Qa && ja(Qa, t)
4839
+ ? null
4840
+ : ((Qa = t),
4841
+ ((e = Qt.getPooled(Fa.select, Ya, e, n)).type =
4842
+ 'select'),
4843
+ (e.target = Ra),
4844
+ Lt(e),
4845
+ e))
4846
+ }
4847
+ var Ha = {
4848
+ eventTypes: Fa,
4849
+ extractEvents: function (e, n, t, a, i, s) {
4850
+ if (
4851
+ !(s = !(i =
4852
+ s ||
4853
+ (a.window === a
4854
+ ? a.document
4855
+ : 9 === a.nodeType
4856
+ ? a
4857
+ : a.ownerDocument)))
4858
+ ) {
4859
+ e: {
4860
+ ;(i = Ge(i)), (s = C.onSelect)
4861
+ for (var r = 0; r < s.length; r++)
4862
+ if (!i.has(s[r])) {
4863
+ i = !1
4864
+ break e
4865
+ }
4866
+ i = !0
4867
+ }
4868
+ s = !i
4869
+ }
4870
+ if (s) return null
4871
+ switch (((i = n ? Tt(n) : window), e)) {
4872
+ case 'focus':
4873
+ ;(la(i) || 'true' === i.contentEditable) &&
4874
+ ((Ra = i), (Ya = n), (Qa = null))
4875
+ break
4876
+ case 'blur':
4877
+ Qa = Ya = Ra = null
4878
+ break
4879
+ case 'mousedown':
4880
+ Wa = !0
4881
+ break
4882
+ case 'contextmenu':
4883
+ case 'mouseup':
4884
+ case 'dragend':
4885
+ return (Wa = !1), Va(t, a)
4886
+ case 'selectionchange':
4887
+ if (Da) break
4888
+ case 'keydown':
4889
+ case 'keyup':
4890
+ return Va(t, a)
4891
+ }
4892
+ return null
4893
+ },
4894
+ },
4895
+ $a = Qt.extend({
4896
+ animationName: null,
4897
+ elapsedTime: null,
4898
+ pseudoElement: null,
4899
+ }),
4900
+ Xa = Qt.extend({
4901
+ clipboardData: function (e) {
4902
+ return 'clipboardData' in e
4903
+ ? e.clipboardData
4904
+ : window.clipboardData
4905
+ },
4906
+ }),
4907
+ Ka = Ca.extend({ relatedTarget: null })
4908
+ function Za(e) {
4909
+ var n = e.keyCode
4910
+ return (
4911
+ 'charCode' in e
4912
+ ? 0 === (e = e.charCode) && 13 === n && (e = 13)
4913
+ : (e = n),
4914
+ 10 === e && (e = 13),
4915
+ 32 <= e || 13 === e ? e : 0
4916
+ )
4917
+ }
4918
+ var Ga = {
4919
+ Esc: 'Escape',
4920
+ Spacebar: ' ',
4921
+ Left: 'ArrowLeft',
4922
+ Up: 'ArrowUp',
4923
+ Right: 'ArrowRight',
4924
+ Down: 'ArrowDown',
4925
+ Del: 'Delete',
4926
+ Win: 'OS',
4927
+ Menu: 'ContextMenu',
4928
+ Apps: 'ContextMenu',
4929
+ Scroll: 'ScrollLock',
4930
+ MozPrintableKey: 'Unidentified',
4931
+ },
4932
+ Ja = {
4933
+ 8: 'Backspace',
4934
+ 9: 'Tab',
4935
+ 12: 'Clear',
4936
+ 13: 'Enter',
4937
+ 16: 'Shift',
4938
+ 17: 'Control',
4939
+ 18: 'Alt',
4940
+ 19: 'Pause',
4941
+ 20: 'CapsLock',
4942
+ 27: 'Escape',
4943
+ 32: ' ',
4944
+ 33: 'PageUp',
4945
+ 34: 'PageDown',
4946
+ 35: 'End',
4947
+ 36: 'Home',
4948
+ 37: 'ArrowLeft',
4949
+ 38: 'ArrowUp',
4950
+ 39: 'ArrowRight',
4951
+ 40: 'ArrowDown',
4952
+ 45: 'Insert',
4953
+ 46: 'Delete',
4954
+ 112: 'F1',
4955
+ 113: 'F2',
4956
+ 114: 'F3',
4957
+ 115: 'F4',
4958
+ 116: 'F5',
4959
+ 117: 'F6',
4960
+ 118: 'F7',
4961
+ 119: 'F8',
4962
+ 120: 'F9',
4963
+ 121: 'F10',
4964
+ 122: 'F11',
4965
+ 123: 'F12',
4966
+ 144: 'NumLock',
4967
+ 145: 'ScrollLock',
4968
+ 224: 'Meta',
4969
+ },
4970
+ ei = Ca.extend({
4971
+ key: function (e) {
4972
+ if (e.key) {
4973
+ var n = Ga[e.key] || e.key
4974
+ if ('Unidentified' !== n) return n
4975
+ }
4976
+ return 'keypress' === e.type
4977
+ ? 13 === (e = Za(e))
4978
+ ? 'Enter'
4979
+ : String.fromCharCode(e)
4980
+ : 'keydown' === e.type || 'keyup' === e.type
4981
+ ? Ja[e.keyCode] || 'Unidentified'
4982
+ : ''
4983
+ },
4984
+ location: null,
4985
+ ctrlKey: null,
4986
+ shiftKey: null,
4987
+ altKey: null,
4988
+ metaKey: null,
4989
+ repeat: null,
4990
+ locale: null,
4991
+ getModifierState: Sa,
4992
+ charCode: function (e) {
4993
+ return 'keypress' === e.type ? Za(e) : 0
4994
+ },
4995
+ keyCode: function (e) {
4996
+ return 'keydown' === e.type || 'keyup' === e.type
4997
+ ? e.keyCode
4998
+ : 0
4999
+ },
5000
+ which: function (e) {
5001
+ return 'keypress' === e.type
5002
+ ? Za(e)
5003
+ : 'keydown' === e.type || 'keyup' === e.type
5004
+ ? e.keyCode
5005
+ : 0
5006
+ },
5007
+ }),
5008
+ ni = qa.extend({ dataTransfer: null }),
5009
+ ti = Ca.extend({
5010
+ touches: null,
5011
+ targetTouches: null,
5012
+ changedTouches: null,
5013
+ altKey: null,
5014
+ metaKey: null,
5015
+ ctrlKey: null,
5016
+ shiftKey: null,
5017
+ getModifierState: Sa,
5018
+ }),
5019
+ ai = Qt.extend({
5020
+ propertyName: null,
5021
+ elapsedTime: null,
5022
+ pseudoElement: null,
5023
+ }),
5024
+ ii = qa.extend({
5025
+ deltaX: function (e) {
5026
+ return 'deltaX' in e
5027
+ ? e.deltaX
5028
+ : 'wheelDeltaX' in e
5029
+ ? -e.wheelDeltaX
5030
+ : 0
5031
+ },
5032
+ deltaY: function (e) {
5033
+ return 'deltaY' in e
5034
+ ? e.deltaY
5035
+ : 'wheelDeltaY' in e
5036
+ ? -e.wheelDeltaY
5037
+ : 'wheelDelta' in e
5038
+ ? -e.wheelDelta
5039
+ : 0
5040
+ },
5041
+ deltaZ: null,
5042
+ deltaMode: null,
5043
+ }),
5044
+ si = {
5045
+ eventTypes: Un,
5046
+ extractEvents: function (e, n, t, a) {
5047
+ var i = jn.get(e)
5048
+ if (!i) return null
5049
+ switch (e) {
5050
+ case 'keypress':
5051
+ if (0 === Za(t)) return null
5052
+ case 'keydown':
5053
+ case 'keyup':
5054
+ e = ei
5055
+ break
5056
+ case 'blur':
5057
+ case 'focus':
5058
+ e = Ka
5059
+ break
5060
+ case 'click':
5061
+ if (2 === t.button) return null
5062
+ case 'auxclick':
5063
+ case 'dblclick':
5064
+ case 'mousedown':
5065
+ case 'mousemove':
5066
+ case 'mouseup':
5067
+ case 'mouseout':
5068
+ case 'mouseover':
5069
+ case 'contextmenu':
5070
+ e = qa
5071
+ break
5072
+ case 'drag':
5073
+ case 'dragend':
5074
+ case 'dragenter':
5075
+ case 'dragexit':
5076
+ case 'dragleave':
5077
+ case 'dragover':
5078
+ case 'dragstart':
5079
+ case 'drop':
5080
+ e = ni
5081
+ break
5082
+ case 'touchcancel':
5083
+ case 'touchend':
5084
+ case 'touchmove':
5085
+ case 'touchstart':
5086
+ e = ti
5087
+ break
5088
+ case Ve:
5089
+ case He:
5090
+ case $e:
5091
+ e = $a
5092
+ break
5093
+ case Xe:
5094
+ e = ai
5095
+ break
5096
+ case 'scroll':
5097
+ e = Ca
5098
+ break
5099
+ case 'wheel':
5100
+ e = ii
5101
+ break
5102
+ case 'copy':
5103
+ case 'cut':
5104
+ case 'paste':
5105
+ e = Xa
5106
+ break
5107
+ case 'gotpointercapture':
5108
+ case 'lostpointercapture':
5109
+ case 'pointercancel':
5110
+ case 'pointerdown':
5111
+ case 'pointermove':
5112
+ case 'pointerout':
5113
+ case 'pointerover':
5114
+ case 'pointerup':
5115
+ e = Ia
5116
+ break
5117
+ default:
5118
+ e = Qt
5119
+ }
5120
+ return Lt((n = e.getPooled(i, n, t, a))), n
5121
+ },
5122
+ }
5123
+ if (k) throw Error(r(101))
5124
+ ;(k = Array.prototype.slice.call(
5125
+ 'ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin'.split(
5126
+ ' '
5127
+ )
5128
+ )),
5129
+ b(),
5130
+ (g = Pt),
5131
+ (m = St),
5132
+ (h = Tt),
5133
+ x({
5134
+ SimpleEventPlugin: si,
5135
+ EnterLeaveEventPlugin: za,
5136
+ ChangeEventPlugin: Ea,
5137
+ SelectEventPlugin: Ha,
5138
+ BeforeInputEventPlugin: oa,
5139
+ })
5140
+ var ri = [],
5141
+ oi = -1
5142
+ function ci(e) {
5143
+ 0 > oi || ((e.current = ri[oi]), (ri[oi] = null), oi--)
5144
+ }
5145
+ function li(e, n) {
5146
+ oi++, (ri[oi] = e.current), (e.current = n)
5147
+ }
5148
+ var pi = {},
5149
+ fi = { current: pi },
5150
+ ui = { current: !1 },
5151
+ di = pi
5152
+ function gi(e, n) {
5153
+ var t = e.type.contextTypes
5154
+ if (!t) return pi
5155
+ var a = e.stateNode
5156
+ if (a && a.__reactInternalMemoizedUnmaskedChildContext === n)
5157
+ return a.__reactInternalMemoizedMaskedChildContext
5158
+ var i,
5159
+ s = {}
5160
+ for (i in t) s[i] = n[i]
5161
+ return (
5162
+ a &&
5163
+ (((e =
5164
+ e.stateNode).__reactInternalMemoizedUnmaskedChildContext = n),
5165
+ (e.__reactInternalMemoizedMaskedChildContext = s)),
5166
+ s
5167
+ )
5168
+ }
5169
+ function mi(e) {
5170
+ return null != (e = e.childContextTypes)
5171
+ }
5172
+ function hi() {
5173
+ ci(ui), ci(fi)
5174
+ }
5175
+ function Ai(e, n, t) {
5176
+ if (fi.current !== pi) throw Error(r(168))
5177
+ li(fi, n), li(ui, t)
5178
+ }
5179
+ function ki(e, n, t) {
5180
+ var a = e.stateNode
5181
+ if (
5182
+ ((e = n.childContextTypes),
5183
+ 'function' != typeof a.getChildContext)
5184
+ )
5185
+ return t
5186
+ for (var s in (a = a.getChildContext()))
5187
+ if (!(s in e)) throw Error(r(108, he(n) || 'Unknown', s))
5188
+ return i({}, t, {}, a)
5189
+ }
5190
+ function yi(e) {
5191
+ return (
5192
+ (e =
5193
+ ((e = e.stateNode) &&
5194
+ e.__reactInternalMemoizedMergedChildContext) ||
5195
+ pi),
5196
+ (di = fi.current),
5197
+ li(fi, e),
5198
+ li(ui, ui.current),
5199
+ !0
5200
+ )
5201
+ }
5202
+ function bi(e, n, t) {
5203
+ var a = e.stateNode
5204
+ if (!a) throw Error(r(169))
5205
+ t
5206
+ ? ((e = ki(e, n, di)),
5207
+ (a.__reactInternalMemoizedMergedChildContext = e),
5208
+ ci(ui),
5209
+ ci(fi),
5210
+ li(fi, e))
5211
+ : ci(ui),
5212
+ li(ui, t)
5213
+ }
5214
+ var _i = s.unstable_runWithPriority,
5215
+ vi = s.unstable_scheduleCallback,
5216
+ wi = s.unstable_cancelCallback,
5217
+ Ei = s.unstable_requestPaint,
5218
+ Ci = s.unstable_now,
5219
+ xi = s.unstable_getCurrentPriorityLevel,
5220
+ Bi = s.unstable_ImmediatePriority,
5221
+ Si = s.unstable_UserBlockingPriority,
5222
+ Ti = s.unstable_NormalPriority,
5223
+ Pi = s.unstable_LowPriority,
5224
+ Ni = s.unstable_IdlePriority,
5225
+ Mi = {},
5226
+ qi = s.unstable_shouldYield,
5227
+ Ii = void 0 !== Ei ? Ei : function () {},
5228
+ Oi = null,
5229
+ zi = null,
5230
+ Li = !1,
5231
+ Ui = Ci(),
5232
+ ji =
5233
+ 1e4 > Ui
5234
+ ? Ci
5235
+ : function () {
5236
+ return Ci() - Ui
5237
+ }
5238
+ function Di() {
5239
+ switch (xi()) {
5240
+ case Bi:
5241
+ return 99
5242
+ case Si:
5243
+ return 98
5244
+ case Ti:
5245
+ return 97
5246
+ case Pi:
5247
+ return 96
5248
+ case Ni:
5249
+ return 95
5250
+ default:
5251
+ throw Error(r(332))
5252
+ }
5253
+ }
5254
+ function Fi(e) {
5255
+ switch (e) {
5256
+ case 99:
5257
+ return Bi
5258
+ case 98:
5259
+ return Si
5260
+ case 97:
5261
+ return Ti
5262
+ case 96:
5263
+ return Pi
5264
+ case 95:
5265
+ return Ni
5266
+ default:
5267
+ throw Error(r(332))
5268
+ }
5269
+ }
5270
+ function Ri(e, n) {
5271
+ return (e = Fi(e)), _i(e, n)
5272
+ }
5273
+ function Yi(e, n, t) {
5274
+ return (e = Fi(e)), vi(e, n, t)
5275
+ }
5276
+ function Qi(e) {
5277
+ return (
5278
+ null === Oi ? ((Oi = [e]), (zi = vi(Bi, Vi))) : Oi.push(e),
5279
+ Mi
5280
+ )
5281
+ }
5282
+ function Wi() {
5283
+ if (null !== zi) {
5284
+ var e = zi
5285
+ ;(zi = null), wi(e)
5286
+ }
5287
+ Vi()
5288
+ }
5289
+ function Vi() {
5290
+ if (!Li && null !== Oi) {
5291
+ Li = !0
5292
+ var e = 0
5293
+ try {
5294
+ var n = Oi
5295
+ Ri(99, function () {
5296
+ for (; e < n.length; e++) {
5297
+ var t = n[e]
5298
+ do {
5299
+ t = t(!0)
5300
+ } while (null !== t)
5301
+ }
5302
+ }),
5303
+ (Oi = null)
5304
+ } catch (n) {
5305
+ throw (
5306
+ (null !== Oi && (Oi = Oi.slice(e + 1)),
5307
+ vi(Bi, Wi),
5308
+ n)
5309
+ )
5310
+ } finally {
5311
+ Li = !1
5312
+ }
5313
+ }
5314
+ }
5315
+ function Hi(e, n, t) {
5316
+ return (
5317
+ 1073741821 -
5318
+ (1 + (((1073741821 - e + n / 10) / (t /= 10)) | 0)) * t
5319
+ )
5320
+ }
5321
+ function $i(e, n) {
5322
+ if (e && e.defaultProps)
5323
+ for (var t in ((n = i({}, n)), (e = e.defaultProps)))
5324
+ void 0 === n[t] && (n[t] = e[t])
5325
+ return n
5326
+ }
5327
+ var Xi = { current: null },
5328
+ Ki = null,
5329
+ Zi = null,
5330
+ Gi = null
5331
+ function Ji() {
5332
+ Gi = Zi = Ki = null
5333
+ }
5334
+ function es(e) {
5335
+ var n = Xi.current
5336
+ ci(Xi), (e.type._context._currentValue = n)
5337
+ }
5338
+ function ns(e, n) {
5339
+ for (; null !== e; ) {
5340
+ var t = e.alternate
5341
+ if (e.childExpirationTime < n)
5342
+ (e.childExpirationTime = n),
5343
+ null !== t &&
5344
+ t.childExpirationTime < n &&
5345
+ (t.childExpirationTime = n)
5346
+ else {
5347
+ if (!(null !== t && t.childExpirationTime < n)) break
5348
+ t.childExpirationTime = n
5349
+ }
5350
+ e = e.return
5351
+ }
5352
+ }
5353
+ function ts(e, n) {
5354
+ ;(Ki = e),
5355
+ (Gi = Zi = null),
5356
+ null !== (e = e.dependencies) &&
5357
+ null !== e.firstContext &&
5358
+ (e.expirationTime >= n && (Tr = !0),
5359
+ (e.firstContext = null))
5360
+ }
5361
+ function as(e, n) {
5362
+ if (Gi !== e && !1 !== n && 0 !== n)
5363
+ if (
5364
+ (('number' == typeof n && 1073741823 !== n) ||
5365
+ ((Gi = e), (n = 1073741823)),
5366
+ (n = { context: e, observedBits: n, next: null }),
5367
+ null === Zi)
5368
+ ) {
5369
+ if (null === Ki) throw Error(r(308))
5370
+ ;(Zi = n),
5371
+ (Ki.dependencies = {
5372
+ expirationTime: 0,
5373
+ firstContext: n,
5374
+ responders: null,
5375
+ })
5376
+ } else Zi = Zi.next = n
5377
+ return e._currentValue
5378
+ }
5379
+ var is = !1
5380
+ function ss(e) {
5381
+ e.updateQueue = {
5382
+ baseState: e.memoizedState,
5383
+ baseQueue: null,
5384
+ shared: { pending: null },
5385
+ effects: null,
5386
+ }
5387
+ }
5388
+ function rs(e, n) {
5389
+ ;(e = e.updateQueue),
5390
+ n.updateQueue === e &&
5391
+ (n.updateQueue = {
5392
+ baseState: e.baseState,
5393
+ baseQueue: e.baseQueue,
5394
+ shared: e.shared,
5395
+ effects: e.effects,
5396
+ })
5397
+ }
5398
+ function os(e, n) {
5399
+ return ((e = {
5400
+ expirationTime: e,
5401
+ suspenseConfig: n,
5402
+ tag: 0,
5403
+ payload: null,
5404
+ callback: null,
5405
+ next: null,
5406
+ }).next = e)
5407
+ }
5408
+ function cs(e, n) {
5409
+ if (null !== (e = e.updateQueue)) {
5410
+ var t = (e = e.shared).pending
5411
+ null === t
5412
+ ? (n.next = n)
5413
+ : ((n.next = t.next), (t.next = n)),
5414
+ (e.pending = n)
5415
+ }
5416
+ }
5417
+ function ls(e, n) {
5418
+ var t = e.alternate
5419
+ null !== t && rs(t, e),
5420
+ null === (t = (e = e.updateQueue).baseQueue)
5421
+ ? ((e.baseQueue = n.next = n), (n.next = n))
5422
+ : ((n.next = t.next), (t.next = n))
5423
+ }
5424
+ function ps(e, n, t, a) {
5425
+ var s = e.updateQueue
5426
+ is = !1
5427
+ var r = s.baseQueue,
5428
+ o = s.shared.pending
5429
+ if (null !== o) {
5430
+ if (null !== r) {
5431
+ var c = r.next
5432
+ ;(r.next = o.next), (o.next = c)
5433
+ }
5434
+ ;(r = o),
5435
+ (s.shared.pending = null),
5436
+ null !== (c = e.alternate) &&
5437
+ null !== (c = c.updateQueue) &&
5438
+ (c.baseQueue = o)
5439
+ }
5440
+ if (null !== r) {
5441
+ c = r.next
5442
+ var l = s.baseState,
5443
+ p = 0,
5444
+ f = null,
5445
+ u = null,
5446
+ d = null
5447
+ if (null !== c)
5448
+ for (var g = c; ; ) {
5449
+ if ((o = g.expirationTime) < a) {
5450
+ var m = {
5451
+ expirationTime: g.expirationTime,
5452
+ suspenseConfig: g.suspenseConfig,
5453
+ tag: g.tag,
5454
+ payload: g.payload,
5455
+ callback: g.callback,
5456
+ next: null,
5457
+ }
5458
+ null === d
5459
+ ? ((u = d = m), (f = l))
5460
+ : (d = d.next = m),
5461
+ o > p && (p = o)
5462
+ } else {
5463
+ null !== d &&
5464
+ (d = d.next = {
5465
+ expirationTime: 1073741823,
5466
+ suspenseConfig: g.suspenseConfig,
5467
+ tag: g.tag,
5468
+ payload: g.payload,
5469
+ callback: g.callback,
5470
+ next: null,
5471
+ }),
5472
+ sc(o, g.suspenseConfig)
5473
+ e: {
5474
+ var h = e,
5475
+ A = g
5476
+ switch (((o = n), (m = t), A.tag)) {
5477
+ case 1:
5478
+ if (
5479
+ 'function' ==
5480
+ typeof (h = A.payload)
5481
+ ) {
5482
+ l = h.call(m, l, o)
5483
+ break e
5484
+ }
5485
+ l = h
5486
+ break e
5487
+ case 3:
5488
+ h.effectTag =
5489
+ (-4097 & h.effectTag) | 64
5490
+ case 0:
5491
+ if (
5492
+ null ==
5493
+ (o =
5494
+ 'function' ==
5495
+ typeof (h = A.payload)
5496
+ ? h.call(m, l, o)
5497
+ : h)
5498
+ )
5499
+ break e
5500
+ l = i({}, l, o)
5501
+ break e
5502
+ case 2:
5503
+ is = !0
5504
+ }
5505
+ }
5506
+ null !== g.callback &&
5507
+ ((e.effectTag |= 32),
5508
+ null === (o = s.effects)
5509
+ ? (s.effects = [g])
5510
+ : o.push(g))
5511
+ }
5512
+ if (null === (g = g.next) || g === c) {
5513
+ if (null === (o = s.shared.pending)) break
5514
+ ;(g = r.next = o.next),
5515
+ (o.next = c),
5516
+ (s.baseQueue = r = o),
5517
+ (s.shared.pending = null)
5518
+ }
5519
+ }
5520
+ null === d ? (f = l) : (d.next = u),
5521
+ (s.baseState = f),
5522
+ (s.baseQueue = d),
5523
+ rc(p),
5524
+ (e.expirationTime = p),
5525
+ (e.memoizedState = l)
5526
+ }
5527
+ }
5528
+ function fs(e, n, t) {
5529
+ if (((e = n.effects), (n.effects = null), null !== e))
5530
+ for (n = 0; n < e.length; n++) {
5531
+ var a = e[n],
5532
+ i = a.callback
5533
+ if (null !== i) {
5534
+ if (
5535
+ ((a.callback = null),
5536
+ (a = i),
5537
+ (i = t),
5538
+ 'function' != typeof a)
5539
+ )
5540
+ throw Error(r(191, a))
5541
+ a.call(i)
5542
+ }
5543
+ }
5544
+ }
5545
+ var us = K.ReactCurrentBatchConfig,
5546
+ ds = new a.Component().refs
5547
+ function gs(e, n, t, a) {
5548
+ ;(t =
5549
+ null == (t = t(a, (n = e.memoizedState)))
5550
+ ? n
5551
+ : i({}, n, t)),
5552
+ (e.memoizedState = t),
5553
+ 0 === e.expirationTime && (e.updateQueue.baseState = t)
5554
+ }
5555
+ var ms = {
5556
+ isMounted: function (e) {
5557
+ return !!(e = e._reactInternalFiber) && Je(e) === e
5558
+ },
5559
+ enqueueSetState: function (e, n, t) {
5560
+ e = e._reactInternalFiber
5561
+ var a = Vo(),
5562
+ i = us.suspense
5563
+ ;((i = os((a = Ho(a, e, i)), i)).payload = n),
5564
+ null != t && (i.callback = t),
5565
+ cs(e, i),
5566
+ $o(e, a)
5567
+ },
5568
+ enqueueReplaceState: function (e, n, t) {
5569
+ e = e._reactInternalFiber
5570
+ var a = Vo(),
5571
+ i = us.suspense
5572
+ ;((i = os((a = Ho(a, e, i)), i)).tag = 1),
5573
+ (i.payload = n),
5574
+ null != t && (i.callback = t),
5575
+ cs(e, i),
5576
+ $o(e, a)
5577
+ },
5578
+ enqueueForceUpdate: function (e, n) {
5579
+ e = e._reactInternalFiber
5580
+ var t = Vo(),
5581
+ a = us.suspense
5582
+ ;((a = os((t = Ho(t, e, a)), a)).tag = 2),
5583
+ null != n && (a.callback = n),
5584
+ cs(e, a),
5585
+ $o(e, t)
5586
+ },
5587
+ }
5588
+ function hs(e, n, t, a, i, s, r) {
5589
+ return 'function' ==
5590
+ typeof (e = e.stateNode).shouldComponentUpdate
5591
+ ? e.shouldComponentUpdate(a, s, r)
5592
+ : !n.prototype ||
5593
+ !n.prototype.isPureReactComponent ||
5594
+ !ja(t, a) ||
5595
+ !ja(i, s)
5596
+ }
5597
+ function As(e, n, t) {
5598
+ var a = !1,
5599
+ i = pi,
5600
+ s = n.contextType
5601
+ return (
5602
+ 'object' == typeof s && null !== s
5603
+ ? (s = as(s))
5604
+ : ((i = mi(n) ? di : fi.current),
5605
+ (s = (a = null != (a = n.contextTypes))
5606
+ ? gi(e, i)
5607
+ : pi)),
5608
+ (n = new n(t, s)),
5609
+ (e.memoizedState =
5610
+ null !== n.state && void 0 !== n.state
5611
+ ? n.state
5612
+ : null),
5613
+ (n.updater = ms),
5614
+ (e.stateNode = n),
5615
+ (n._reactInternalFiber = e),
5616
+ a &&
5617
+ (((e =
5618
+ e.stateNode).__reactInternalMemoizedUnmaskedChildContext = i),
5619
+ (e.__reactInternalMemoizedMaskedChildContext = s)),
5620
+ n
5621
+ )
5622
+ }
5623
+ function ks(e, n, t, a) {
5624
+ ;(e = n.state),
5625
+ 'function' == typeof n.componentWillReceiveProps &&
5626
+ n.componentWillReceiveProps(t, a),
5627
+ 'function' == typeof n.UNSAFE_componentWillReceiveProps &&
5628
+ n.UNSAFE_componentWillReceiveProps(t, a),
5629
+ n.state !== e && ms.enqueueReplaceState(n, n.state, null)
5630
+ }
5631
+ function ys(e, n, t, a) {
5632
+ var i = e.stateNode
5633
+ ;(i.props = t),
5634
+ (i.state = e.memoizedState),
5635
+ (i.refs = ds),
5636
+ ss(e)
5637
+ var s = n.contextType
5638
+ 'object' == typeof s && null !== s
5639
+ ? (i.context = as(s))
5640
+ : ((s = mi(n) ? di : fi.current), (i.context = gi(e, s))),
5641
+ ps(e, t, i, a),
5642
+ (i.state = e.memoizedState),
5643
+ 'function' == typeof (s = n.getDerivedStateFromProps) &&
5644
+ (gs(e, n, s, t), (i.state = e.memoizedState)),
5645
+ 'function' == typeof n.getDerivedStateFromProps ||
5646
+ 'function' == typeof i.getSnapshotBeforeUpdate ||
5647
+ ('function' != typeof i.UNSAFE_componentWillMount &&
5648
+ 'function' != typeof i.componentWillMount) ||
5649
+ ((n = i.state),
5650
+ 'function' == typeof i.componentWillMount &&
5651
+ i.componentWillMount(),
5652
+ 'function' == typeof i.UNSAFE_componentWillMount &&
5653
+ i.UNSAFE_componentWillMount(),
5654
+ n !== i.state &&
5655
+ ms.enqueueReplaceState(i, i.state, null),
5656
+ ps(e, t, i, a),
5657
+ (i.state = e.memoizedState)),
5658
+ 'function' == typeof i.componentDidMount &&
5659
+ (e.effectTag |= 4)
5660
+ }
5661
+ var bs = Array.isArray
5662
+ function _s(e, n, t) {
5663
+ if (
5664
+ null !== (e = t.ref) &&
5665
+ 'function' != typeof e &&
5666
+ 'object' != typeof e
5667
+ ) {
5668
+ if (t._owner) {
5669
+ if ((t = t._owner)) {
5670
+ if (1 !== t.tag) throw Error(r(309))
5671
+ var a = t.stateNode
5672
+ }
5673
+ if (!a) throw Error(r(147, e))
5674
+ var i = '' + e
5675
+ return null !== n &&
5676
+ null !== n.ref &&
5677
+ 'function' == typeof n.ref &&
5678
+ n.ref._stringRef === i
5679
+ ? n.ref
5680
+ : (((n = function (e) {
5681
+ var n = a.refs
5682
+ n === ds && (n = a.refs = {}),
5683
+ null === e ? delete n[i] : (n[i] = e)
5684
+ })._stringRef = i),
5685
+ n)
5686
+ }
5687
+ if ('string' != typeof e) throw Error(r(284))
5688
+ if (!t._owner) throw Error(r(290, e))
5689
+ }
5690
+ return e
5691
+ }
5692
+ function vs(e, n) {
5693
+ if ('textarea' !== e.type)
5694
+ throw Error(
5695
+ r(
5696
+ 31,
5697
+ '[object Object]' ===
5698
+ Object.prototype.toString.call(n)
5699
+ ? 'object with keys {' +
5700
+ Object.keys(n).join(', ') +
5701
+ '}'
5702
+ : n,
5703
+ ''
5704
+ )
5705
+ )
5706
+ }
5707
+ function ws(e) {
5708
+ function n(n, t) {
5709
+ if (e) {
5710
+ var a = n.lastEffect
5711
+ null !== a
5712
+ ? ((a.nextEffect = t), (n.lastEffect = t))
5713
+ : (n.firstEffect = n.lastEffect = t),
5714
+ (t.nextEffect = null),
5715
+ (t.effectTag = 8)
5716
+ }
5717
+ }
5718
+ function t(t, a) {
5719
+ if (!e) return null
5720
+ for (; null !== a; ) n(t, a), (a = a.sibling)
5721
+ return null
5722
+ }
5723
+ function a(e, n) {
5724
+ for (e = new Map(); null !== n; )
5725
+ null !== n.key ? e.set(n.key, n) : e.set(n.index, n),
5726
+ (n = n.sibling)
5727
+ return e
5728
+ }
5729
+ function i(e, n) {
5730
+ return ((e = xc(e, n)).index = 0), (e.sibling = null), e
5731
+ }
5732
+ function s(n, t, a) {
5733
+ return (
5734
+ (n.index = a),
5735
+ e
5736
+ ? null !== (a = n.alternate)
5737
+ ? (a = a.index) < t
5738
+ ? ((n.effectTag = 2), t)
5739
+ : a
5740
+ : ((n.effectTag = 2), t)
5741
+ : t
5742
+ )
5743
+ }
5744
+ function o(n) {
5745
+ return e && null === n.alternate && (n.effectTag = 2), n
5746
+ }
5747
+ function c(e, n, t, a) {
5748
+ return null === n || 6 !== n.tag
5749
+ ? (((n = Tc(t, e.mode, a)).return = e), n)
5750
+ : (((n = i(n, t)).return = e), n)
5751
+ }
5752
+ function l(e, n, t, a) {
5753
+ return null !== n && n.elementType === t.type
5754
+ ? (((a = i(n, t.props)).ref = _s(e, n, t)),
5755
+ (a.return = e),
5756
+ a)
5757
+ : (((a = Bc(
5758
+ t.type,
5759
+ t.key,
5760
+ t.props,
5761
+ null,
5762
+ e.mode,
5763
+ a
5764
+ )).ref = _s(e, n, t)),
5765
+ (a.return = e),
5766
+ a)
5767
+ }
5768
+ function p(e, n, t, a) {
5769
+ return null === n ||
5770
+ 4 !== n.tag ||
5771
+ n.stateNode.containerInfo !== t.containerInfo ||
5772
+ n.stateNode.implementation !== t.implementation
5773
+ ? (((n = Pc(t, e.mode, a)).return = e), n)
5774
+ : (((n = i(n, t.children || [])).return = e), n)
5775
+ }
5776
+ function f(e, n, t, a, s) {
5777
+ return null === n || 7 !== n.tag
5778
+ ? (((n = Sc(t, e.mode, a, s)).return = e), n)
5779
+ : (((n = i(n, t)).return = e), n)
5780
+ }
5781
+ function u(e, n, t) {
5782
+ if ('string' == typeof n || 'number' == typeof n)
5783
+ return ((n = Tc('' + n, e.mode, t)).return = e), n
5784
+ if ('object' == typeof n && null !== n) {
5785
+ switch (n.$$typeof) {
5786
+ case ee:
5787
+ return (
5788
+ ((t = Bc(
5789
+ n.type,
5790
+ n.key,
5791
+ n.props,
5792
+ null,
5793
+ e.mode,
5794
+ t
5795
+ )).ref = _s(e, null, n)),
5796
+ (t.return = e),
5797
+ t
5798
+ )
5799
+ case ne:
5800
+ return ((n = Pc(n, e.mode, t)).return = e), n
5801
+ }
5802
+ if (bs(n) || me(n))
5803
+ return ((n = Sc(n, e.mode, t, null)).return = e), n
5804
+ vs(e, n)
5805
+ }
5806
+ return null
5807
+ }
5808
+ function d(e, n, t, a) {
5809
+ var i = null !== n ? n.key : null
5810
+ if ('string' == typeof t || 'number' == typeof t)
5811
+ return null !== i ? null : c(e, n, '' + t, a)
5812
+ if ('object' == typeof t && null !== t) {
5813
+ switch (t.$$typeof) {
5814
+ case ee:
5815
+ return t.key === i
5816
+ ? t.type === te
5817
+ ? f(e, n, t.props.children, a, i)
5818
+ : l(e, n, t, a)
5819
+ : null
5820
+ case ne:
5821
+ return t.key === i ? p(e, n, t, a) : null
5822
+ }
5823
+ if (bs(t) || me(t))
5824
+ return null !== i ? null : f(e, n, t, a, null)
5825
+ vs(e, t)
5826
+ }
5827
+ return null
5828
+ }
5829
+ function g(e, n, t, a, i) {
5830
+ if ('string' == typeof a || 'number' == typeof a)
5831
+ return c(n, (e = e.get(t) || null), '' + a, i)
5832
+ if ('object' == typeof a && null !== a) {
5833
+ switch (a.$$typeof) {
5834
+ case ee:
5835
+ return (
5836
+ (e =
5837
+ e.get(null === a.key ? t : a.key) ||
5838
+ null),
5839
+ a.type === te
5840
+ ? f(n, e, a.props.children, i, a.key)
5841
+ : l(n, e, a, i)
5842
+ )
5843
+ case ne:
5844
+ return p(
5845
+ n,
5846
+ (e =
5847
+ e.get(null === a.key ? t : a.key) ||
5848
+ null),
5849
+ a,
5850
+ i
5851
+ )
5852
+ }
5853
+ if (bs(a) || me(a))
5854
+ return f(n, (e = e.get(t) || null), a, i, null)
5855
+ vs(n, a)
5856
+ }
5857
+ return null
5858
+ }
5859
+ function m(i, r, o, c) {
5860
+ for (
5861
+ var l = null, p = null, f = r, m = (r = 0), h = null;
5862
+ null !== f && m < o.length;
5863
+ m++
5864
+ ) {
5865
+ f.index > m ? ((h = f), (f = null)) : (h = f.sibling)
5866
+ var A = d(i, f, o[m], c)
5867
+ if (null === A) {
5868
+ null === f && (f = h)
5869
+ break
5870
+ }
5871
+ e && f && null === A.alternate && n(i, f),
5872
+ (r = s(A, r, m)),
5873
+ null === p ? (l = A) : (p.sibling = A),
5874
+ (p = A),
5875
+ (f = h)
5876
+ }
5877
+ if (m === o.length) return t(i, f), l
5878
+ if (null === f) {
5879
+ for (; m < o.length; m++)
5880
+ null !== (f = u(i, o[m], c)) &&
5881
+ ((r = s(f, r, m)),
5882
+ null === p ? (l = f) : (p.sibling = f),
5883
+ (p = f))
5884
+ return l
5885
+ }
5886
+ for (f = a(i, f); m < o.length; m++)
5887
+ null !== (h = g(f, i, m, o[m], c)) &&
5888
+ (e &&
5889
+ null !== h.alternate &&
5890
+ f.delete(null === h.key ? m : h.key),
5891
+ (r = s(h, r, m)),
5892
+ null === p ? (l = h) : (p.sibling = h),
5893
+ (p = h))
5894
+ return (
5895
+ e &&
5896
+ f.forEach(function (e) {
5897
+ return n(i, e)
5898
+ }),
5899
+ l
5900
+ )
5901
+ }
5902
+ function h(i, o, c, l) {
5903
+ var p = me(c)
5904
+ if ('function' != typeof p) throw Error(r(150))
5905
+ if (null == (c = p.call(c))) throw Error(r(151))
5906
+ for (
5907
+ var f = (p = null),
5908
+ m = o,
5909
+ h = (o = 0),
5910
+ A = null,
5911
+ k = c.next();
5912
+ null !== m && !k.done;
5913
+ h++, k = c.next()
5914
+ ) {
5915
+ m.index > h ? ((A = m), (m = null)) : (A = m.sibling)
5916
+ var y = d(i, m, k.value, l)
5917
+ if (null === y) {
5918
+ null === m && (m = A)
5919
+ break
5920
+ }
5921
+ e && m && null === y.alternate && n(i, m),
5922
+ (o = s(y, o, h)),
5923
+ null === f ? (p = y) : (f.sibling = y),
5924
+ (f = y),
5925
+ (m = A)
5926
+ }
5927
+ if (k.done) return t(i, m), p
5928
+ if (null === m) {
5929
+ for (; !k.done; h++, k = c.next())
5930
+ null !== (k = u(i, k.value, l)) &&
5931
+ ((o = s(k, o, h)),
5932
+ null === f ? (p = k) : (f.sibling = k),
5933
+ (f = k))
5934
+ return p
5935
+ }
5936
+ for (m = a(i, m); !k.done; h++, k = c.next())
5937
+ null !== (k = g(m, i, h, k.value, l)) &&
5938
+ (e &&
5939
+ null !== k.alternate &&
5940
+ m.delete(null === k.key ? h : k.key),
5941
+ (o = s(k, o, h)),
5942
+ null === f ? (p = k) : (f.sibling = k),
5943
+ (f = k))
5944
+ return (
5945
+ e &&
5946
+ m.forEach(function (e) {
5947
+ return n(i, e)
5948
+ }),
5949
+ p
5950
+ )
5951
+ }
5952
+ return function (e, a, s, c) {
5953
+ var l =
5954
+ 'object' == typeof s &&
5955
+ null !== s &&
5956
+ s.type === te &&
5957
+ null === s.key
5958
+ l && (s = s.props.children)
5959
+ var p = 'object' == typeof s && null !== s
5960
+ if (p)
5961
+ switch (s.$$typeof) {
5962
+ case ee:
5963
+ e: {
5964
+ for (p = s.key, l = a; null !== l; ) {
5965
+ if (l.key === p) {
5966
+ switch (l.tag) {
5967
+ case 7:
5968
+ if (s.type === te) {
5969
+ t(e, l.sibling),
5970
+ ((a = i(
5971
+ l,
5972
+ s.props.children
5973
+ )).return = e),
5974
+ (e = a)
5975
+ break e
5976
+ }
5977
+ break
5978
+ default:
5979
+ if (
5980
+ l.elementType === s.type
5981
+ ) {
5982
+ t(e, l.sibling),
5983
+ ((a = i(
5984
+ l,
5985
+ s.props
5986
+ )).ref = _s(
5987
+ e,
5988
+ l,
5989
+ s
5990
+ )),
5991
+ (a.return = e),
5992
+ (e = a)
5993
+ break e
5994
+ }
5995
+ }
5996
+ t(e, l)
5997
+ break
5998
+ }
5999
+ n(e, l), (l = l.sibling)
6000
+ }
6001
+ s.type === te
6002
+ ? (((a = Sc(
6003
+ s.props.children,
6004
+ e.mode,
6005
+ c,
6006
+ s.key
6007
+ )).return = e),
6008
+ (e = a))
6009
+ : (((c = Bc(
6010
+ s.type,
6011
+ s.key,
6012
+ s.props,
6013
+ null,
6014
+ e.mode,
6015
+ c
6016
+ )).ref = _s(e, a, s)),
6017
+ (c.return = e),
6018
+ (e = c))
6019
+ }
6020
+ return o(e)
6021
+ case ne:
6022
+ e: {
6023
+ for (l = s.key; null !== a; ) {
6024
+ if (a.key === l) {
6025
+ if (
6026
+ 4 === a.tag &&
6027
+ a.stateNode.containerInfo ===
6028
+ s.containerInfo &&
6029
+ a.stateNode.implementation ===
6030
+ s.implementation
6031
+ ) {
6032
+ t(e, a.sibling),
6033
+ ((a = i(
6034
+ a,
6035
+ s.children || []
6036
+ )).return = e),
6037
+ (e = a)
6038
+ break e
6039
+ }
6040
+ t(e, a)
6041
+ break
6042
+ }
6043
+ n(e, a), (a = a.sibling)
6044
+ }
6045
+ ;((a = Pc(s, e.mode, c)).return = e),
6046
+ (e = a)
6047
+ }
6048
+ return o(e)
6049
+ }
6050
+ if ('string' == typeof s || 'number' == typeof s)
6051
+ return (
6052
+ (s = '' + s),
6053
+ null !== a && 6 === a.tag
6054
+ ? (t(e, a.sibling),
6055
+ ((a = i(a, s)).return = e),
6056
+ (e = a))
6057
+ : (t(e, a),
6058
+ ((a = Tc(s, e.mode, c)).return = e),
6059
+ (e = a)),
6060
+ o(e)
6061
+ )
6062
+ if (bs(s)) return m(e, a, s, c)
6063
+ if (me(s)) return h(e, a, s, c)
6064
+ if ((p && vs(e, s), void 0 === s && !l))
6065
+ switch (e.tag) {
6066
+ case 1:
6067
+ case 0:
6068
+ throw (
6069
+ ((e = e.type),
6070
+ Error(
6071
+ r(
6072
+ 152,
6073
+ e.displayName ||
6074
+ e.name ||
6075
+ 'Component'
6076
+ )
6077
+ ))
6078
+ )
6079
+ }
6080
+ return t(e, a)
6081
+ }
6082
+ }
6083
+ var Es = ws(!0),
6084
+ Cs = ws(!1),
6085
+ xs = {},
6086
+ Bs = { current: xs },
6087
+ Ss = { current: xs },
6088
+ Ts = { current: xs }
6089
+ function Ps(e) {
6090
+ if (e === xs) throw Error(r(174))
6091
+ return e
6092
+ }
6093
+ function Ns(e, n) {
6094
+ switch ((li(Ts, n), li(Ss, e), li(Bs, xs), (e = n.nodeType))) {
6095
+ case 9:
6096
+ case 11:
6097
+ n = (n = n.documentElement)
6098
+ ? n.namespaceURI
6099
+ : Le(null, '')
6100
+ break
6101
+ default:
6102
+ n = Le(
6103
+ (n =
6104
+ (e = 8 === e ? n.parentNode : n).namespaceURI ||
6105
+ null),
6106
+ (e = e.tagName)
6107
+ )
6108
+ }
6109
+ ci(Bs), li(Bs, n)
6110
+ }
6111
+ function Ms() {
6112
+ ci(Bs), ci(Ss), ci(Ts)
6113
+ }
6114
+ function qs(e) {
6115
+ Ps(Ts.current)
6116
+ var n = Ps(Bs.current),
6117
+ t = Le(n, e.type)
6118
+ n !== t && (li(Ss, e), li(Bs, t))
6119
+ }
6120
+ function Is(e) {
6121
+ Ss.current === e && (ci(Bs), ci(Ss))
6122
+ }
6123
+ var Os = { current: 0 }
6124
+ function zs(e) {
6125
+ for (var n = e; null !== n; ) {
6126
+ if (13 === n.tag) {
6127
+ var t = n.memoizedState
6128
+ if (
6129
+ null !== t &&
6130
+ (null === (t = t.dehydrated) ||
6131
+ '$?' === t.data ||
6132
+ '$!' === t.data)
6133
+ )
6134
+ return n
6135
+ } else if (
6136
+ 19 === n.tag &&
6137
+ void 0 !== n.memoizedProps.revealOrder
6138
+ ) {
6139
+ if (0 != (64 & n.effectTag)) return n
6140
+ } else if (null !== n.child) {
6141
+ ;(n.child.return = n), (n = n.child)
6142
+ continue
6143
+ }
6144
+ if (n === e) break
6145
+ for (; null === n.sibling; ) {
6146
+ if (null === n.return || n.return === e) return null
6147
+ n = n.return
6148
+ }
6149
+ ;(n.sibling.return = n.return), (n = n.sibling)
6150
+ }
6151
+ return null
6152
+ }
6153
+ function Ls(e, n) {
6154
+ return { responder: e, props: n }
6155
+ }
6156
+ var Us = K.ReactCurrentDispatcher,
6157
+ js = K.ReactCurrentBatchConfig,
6158
+ Ds = 0,
6159
+ Fs = null,
6160
+ Rs = null,
6161
+ Ys = null,
6162
+ Qs = !1
6163
+ function Ws() {
6164
+ throw Error(r(321))
6165
+ }
6166
+ function Vs(e, n) {
6167
+ if (null === n) return !1
6168
+ for (var t = 0; t < n.length && t < e.length; t++)
6169
+ if (!La(e[t], n[t])) return !1
6170
+ return !0
6171
+ }
6172
+ function Hs(e, n, t, a, i, s) {
6173
+ if (
6174
+ ((Ds = s),
6175
+ (Fs = n),
6176
+ (n.memoizedState = null),
6177
+ (n.updateQueue = null),
6178
+ (n.expirationTime = 0),
6179
+ (Us.current =
6180
+ null === e || null === e.memoizedState ? hr : Ar),
6181
+ (e = t(a, i)),
6182
+ n.expirationTime === Ds)
6183
+ ) {
6184
+ s = 0
6185
+ do {
6186
+ if (((n.expirationTime = 0), !(25 > s)))
6187
+ throw Error(r(301))
6188
+ ;(s += 1),
6189
+ (Ys = Rs = null),
6190
+ (n.updateQueue = null),
6191
+ (Us.current = kr),
6192
+ (e = t(a, i))
6193
+ } while (n.expirationTime === Ds)
6194
+ }
6195
+ if (
6196
+ ((Us.current = mr),
6197
+ (n = null !== Rs && null !== Rs.next),
6198
+ (Ds = 0),
6199
+ (Ys = Rs = Fs = null),
6200
+ (Qs = !1),
6201
+ n)
6202
+ )
6203
+ throw Error(r(300))
6204
+ return e
6205
+ }
6206
+ function $s() {
6207
+ var e = {
6208
+ memoizedState: null,
6209
+ baseState: null,
6210
+ baseQueue: null,
6211
+ queue: null,
6212
+ next: null,
6213
+ }
6214
+ return (
6215
+ null === Ys
6216
+ ? (Fs.memoizedState = Ys = e)
6217
+ : (Ys = Ys.next = e),
6218
+ Ys
6219
+ )
6220
+ }
6221
+ function Xs() {
6222
+ if (null === Rs) {
6223
+ var e = Fs.alternate
6224
+ e = null !== e ? e.memoizedState : null
6225
+ } else e = Rs.next
6226
+ var n = null === Ys ? Fs.memoizedState : Ys.next
6227
+ if (null !== n) (Ys = n), (Rs = e)
6228
+ else {
6229
+ if (null === e) throw Error(r(310))
6230
+ ;(e = {
6231
+ memoizedState: (Rs = e).memoizedState,
6232
+ baseState: Rs.baseState,
6233
+ baseQueue: Rs.baseQueue,
6234
+ queue: Rs.queue,
6235
+ next: null,
6236
+ }),
6237
+ null === Ys
6238
+ ? (Fs.memoizedState = Ys = e)
6239
+ : (Ys = Ys.next = e)
6240
+ }
6241
+ return Ys
6242
+ }
6243
+ function Ks(e, n) {
6244
+ return 'function' == typeof n ? n(e) : n
6245
+ }
6246
+ function Zs(e) {
6247
+ var n = Xs(),
6248
+ t = n.queue
6249
+ if (null === t) throw Error(r(311))
6250
+ t.lastRenderedReducer = e
6251
+ var a = Rs,
6252
+ i = a.baseQueue,
6253
+ s = t.pending
6254
+ if (null !== s) {
6255
+ if (null !== i) {
6256
+ var o = i.next
6257
+ ;(i.next = s.next), (s.next = o)
6258
+ }
6259
+ ;(a.baseQueue = i = s), (t.pending = null)
6260
+ }
6261
+ if (null !== i) {
6262
+ ;(i = i.next), (a = a.baseState)
6263
+ var c = (o = s = null),
6264
+ l = i
6265
+ do {
6266
+ var p = l.expirationTime
6267
+ if (p < Ds) {
6268
+ var f = {
6269
+ expirationTime: l.expirationTime,
6270
+ suspenseConfig: l.suspenseConfig,
6271
+ action: l.action,
6272
+ eagerReducer: l.eagerReducer,
6273
+ eagerState: l.eagerState,
6274
+ next: null,
6275
+ }
6276
+ null === c
6277
+ ? ((o = c = f), (s = a))
6278
+ : (c = c.next = f),
6279
+ p > Fs.expirationTime &&
6280
+ ((Fs.expirationTime = p), rc(p))
6281
+ } else
6282
+ null !== c &&
6283
+ (c = c.next = {
6284
+ expirationTime: 1073741823,
6285
+ suspenseConfig: l.suspenseConfig,
6286
+ action: l.action,
6287
+ eagerReducer: l.eagerReducer,
6288
+ eagerState: l.eagerState,
6289
+ next: null,
6290
+ }),
6291
+ sc(p, l.suspenseConfig),
6292
+ (a =
6293
+ l.eagerReducer === e
6294
+ ? l.eagerState
6295
+ : e(a, l.action))
6296
+ l = l.next
6297
+ } while (null !== l && l !== i)
6298
+ null === c ? (s = a) : (c.next = o),
6299
+ La(a, n.memoizedState) || (Tr = !0),
6300
+ (n.memoizedState = a),
6301
+ (n.baseState = s),
6302
+ (n.baseQueue = c),
6303
+ (t.lastRenderedState = a)
6304
+ }
6305
+ return [n.memoizedState, t.dispatch]
6306
+ }
6307
+ function Gs(e) {
6308
+ var n = Xs(),
6309
+ t = n.queue
6310
+ if (null === t) throw Error(r(311))
6311
+ t.lastRenderedReducer = e
6312
+ var a = t.dispatch,
6313
+ i = t.pending,
6314
+ s = n.memoizedState
6315
+ if (null !== i) {
6316
+ t.pending = null
6317
+ var o = (i = i.next)
6318
+ do {
6319
+ ;(s = e(s, o.action)), (o = o.next)
6320
+ } while (o !== i)
6321
+ La(s, n.memoizedState) || (Tr = !0),
6322
+ (n.memoizedState = s),
6323
+ null === n.baseQueue && (n.baseState = s),
6324
+ (t.lastRenderedState = s)
6325
+ }
6326
+ return [s, a]
6327
+ }
6328
+ function Js(e) {
6329
+ var n = $s()
6330
+ return (
6331
+ 'function' == typeof e && (e = e()),
6332
+ (n.memoizedState = n.baseState = e),
6333
+ (e = (e = n.queue = {
6334
+ pending: null,
6335
+ dispatch: null,
6336
+ lastRenderedReducer: Ks,
6337
+ lastRenderedState: e,
6338
+ }).dispatch = gr.bind(null, Fs, e)),
6339
+ [n.memoizedState, e]
6340
+ )
6341
+ }
6342
+ function er(e, n, t, a) {
6343
+ return (
6344
+ (e = {
6345
+ tag: e,
6346
+ create: n,
6347
+ destroy: t,
6348
+ deps: a,
6349
+ next: null,
6350
+ }),
6351
+ null === (n = Fs.updateQueue)
6352
+ ? ((n = { lastEffect: null }),
6353
+ (Fs.updateQueue = n),
6354
+ (n.lastEffect = e.next = e))
6355
+ : null === (t = n.lastEffect)
6356
+ ? (n.lastEffect = e.next = e)
6357
+ : ((a = t.next),
6358
+ (t.next = e),
6359
+ (e.next = a),
6360
+ (n.lastEffect = e)),
6361
+ e
6362
+ )
6363
+ }
6364
+ function nr() {
6365
+ return Xs().memoizedState
6366
+ }
6367
+ function tr(e, n, t, a) {
6368
+ var i = $s()
6369
+ ;(Fs.effectTag |= e),
6370
+ (i.memoizedState = er(
6371
+ 1 | n,
6372
+ t,
6373
+ void 0,
6374
+ void 0 === a ? null : a
6375
+ ))
6376
+ }
6377
+ function ar(e, n, t, a) {
6378
+ var i = Xs()
6379
+ a = void 0 === a ? null : a
6380
+ var s = void 0
6381
+ if (null !== Rs) {
6382
+ var r = Rs.memoizedState
6383
+ if (((s = r.destroy), null !== a && Vs(a, r.deps)))
6384
+ return void er(n, t, s, a)
6385
+ }
6386
+ ;(Fs.effectTag |= e), (i.memoizedState = er(1 | n, t, s, a))
6387
+ }
6388
+ function ir(e, n) {
6389
+ return tr(516, 4, e, n)
6390
+ }
6391
+ function sr(e, n) {
6392
+ return ar(516, 4, e, n)
6393
+ }
6394
+ function rr(e, n) {
6395
+ return ar(4, 2, e, n)
6396
+ }
6397
+ function or(e, n) {
6398
+ return 'function' == typeof n
6399
+ ? ((e = e()),
6400
+ n(e),
6401
+ function () {
6402
+ n(null)
6403
+ })
6404
+ : null != n
6405
+ ? ((e = e()),
6406
+ (n.current = e),
6407
+ function () {
6408
+ n.current = null
6409
+ })
6410
+ : void 0
6411
+ }
6412
+ function cr(e, n, t) {
6413
+ return (
6414
+ (t = null != t ? t.concat([e]) : null),
6415
+ ar(4, 2, or.bind(null, n, e), t)
6416
+ )
6417
+ }
6418
+ function lr() {}
6419
+ function pr(e, n) {
6420
+ return ($s().memoizedState = [e, void 0 === n ? null : n]), e
6421
+ }
6422
+ function fr(e, n) {
6423
+ var t = Xs()
6424
+ n = void 0 === n ? null : n
6425
+ var a = t.memoizedState
6426
+ return null !== a && null !== n && Vs(n, a[1])
6427
+ ? a[0]
6428
+ : ((t.memoizedState = [e, n]), e)
6429
+ }
6430
+ function ur(e, n) {
6431
+ var t = Xs()
6432
+ n = void 0 === n ? null : n
6433
+ var a = t.memoizedState
6434
+ return null !== a && null !== n && Vs(n, a[1])
6435
+ ? a[0]
6436
+ : ((e = e()), (t.memoizedState = [e, n]), e)
6437
+ }
6438
+ function dr(e, n, t) {
6439
+ var a = Di()
6440
+ Ri(98 > a ? 98 : a, function () {
6441
+ e(!0)
6442
+ }),
6443
+ Ri(97 < a ? 97 : a, function () {
6444
+ var a = js.suspense
6445
+ js.suspense = void 0 === n ? null : n
6446
+ try {
6447
+ e(!1), t()
6448
+ } finally {
6449
+ js.suspense = a
6450
+ }
6451
+ })
6452
+ }
6453
+ function gr(e, n, t) {
6454
+ var a = Vo(),
6455
+ i = us.suspense
6456
+ i = {
6457
+ expirationTime: (a = Ho(a, e, i)),
6458
+ suspenseConfig: i,
6459
+ action: t,
6460
+ eagerReducer: null,
6461
+ eagerState: null,
6462
+ next: null,
6463
+ }
6464
+ var s = n.pending
6465
+ if (
6466
+ (null === s
6467
+ ? (i.next = i)
6468
+ : ((i.next = s.next), (s.next = i)),
6469
+ (n.pending = i),
6470
+ (s = e.alternate),
6471
+ e === Fs || (null !== s && s === Fs))
6472
+ )
6473
+ (Qs = !0), (i.expirationTime = Ds), (Fs.expirationTime = Ds)
6474
+ else {
6475
+ if (
6476
+ 0 === e.expirationTime &&
6477
+ (null === s || 0 === s.expirationTime) &&
6478
+ null !== (s = n.lastRenderedReducer)
6479
+ )
6480
+ try {
6481
+ var r = n.lastRenderedState,
6482
+ o = s(r, t)
6483
+ if (
6484
+ ((i.eagerReducer = s),
6485
+ (i.eagerState = o),
6486
+ La(o, r))
6487
+ )
6488
+ return
6489
+ } catch (e) {}
6490
+ $o(e, a)
6491
+ }
6492
+ }
6493
+ var mr = {
6494
+ readContext: as,
6495
+ useCallback: Ws,
6496
+ useContext: Ws,
6497
+ useEffect: Ws,
6498
+ useImperativeHandle: Ws,
6499
+ useLayoutEffect: Ws,
6500
+ useMemo: Ws,
6501
+ useReducer: Ws,
6502
+ useRef: Ws,
6503
+ useState: Ws,
6504
+ useDebugValue: Ws,
6505
+ useResponder: Ws,
6506
+ useDeferredValue: Ws,
6507
+ useTransition: Ws,
6508
+ },
6509
+ hr = {
6510
+ readContext: as,
6511
+ useCallback: pr,
6512
+ useContext: as,
6513
+ useEffect: ir,
6514
+ useImperativeHandle: function (e, n, t) {
6515
+ return (
6516
+ (t = null != t ? t.concat([e]) : null),
6517
+ tr(4, 2, or.bind(null, n, e), t)
6518
+ )
6519
+ },
6520
+ useLayoutEffect: function (e, n) {
6521
+ return tr(4, 2, e, n)
6522
+ },
6523
+ useMemo: function (e, n) {
6524
+ var t = $s()
6525
+ return (
6526
+ (n = void 0 === n ? null : n),
6527
+ (e = e()),
6528
+ (t.memoizedState = [e, n]),
6529
+ e
6530
+ )
6531
+ },
6532
+ useReducer: function (e, n, t) {
6533
+ var a = $s()
6534
+ return (
6535
+ (n = void 0 !== t ? t(n) : n),
6536
+ (a.memoizedState = a.baseState = n),
6537
+ (e = (e = a.queue = {
6538
+ pending: null,
6539
+ dispatch: null,
6540
+ lastRenderedReducer: e,
6541
+ lastRenderedState: n,
6542
+ }).dispatch = gr.bind(null, Fs, e)),
6543
+ [a.memoizedState, e]
6544
+ )
6545
+ },
6546
+ useRef: function (e) {
6547
+ return (e = { current: e }), ($s().memoizedState = e)
6548
+ },
6549
+ useState: Js,
6550
+ useDebugValue: lr,
6551
+ useResponder: Ls,
6552
+ useDeferredValue: function (e, n) {
6553
+ var t = Js(e),
6554
+ a = t[0],
6555
+ i = t[1]
6556
+ return (
6557
+ ir(
6558
+ function () {
6559
+ var t = js.suspense
6560
+ js.suspense = void 0 === n ? null : n
6561
+ try {
6562
+ i(e)
6563
+ } finally {
6564
+ js.suspense = t
6565
+ }
6566
+ },
6567
+ [e, n]
6568
+ ),
6569
+ a
6570
+ )
6571
+ },
6572
+ useTransition: function (e) {
6573
+ var n = Js(!1),
6574
+ t = n[0]
6575
+ return (n = n[1]), [pr(dr.bind(null, n, e), [n, e]), t]
6576
+ },
6577
+ },
6578
+ Ar = {
6579
+ readContext: as,
6580
+ useCallback: fr,
6581
+ useContext: as,
6582
+ useEffect: sr,
6583
+ useImperativeHandle: cr,
6584
+ useLayoutEffect: rr,
6585
+ useMemo: ur,
6586
+ useReducer: Zs,
6587
+ useRef: nr,
6588
+ useState: function () {
6589
+ return Zs(Ks)
6590
+ },
6591
+ useDebugValue: lr,
6592
+ useResponder: Ls,
6593
+ useDeferredValue: function (e, n) {
6594
+ var t = Zs(Ks),
6595
+ a = t[0],
6596
+ i = t[1]
6597
+ return (
6598
+ sr(
6599
+ function () {
6600
+ var t = js.suspense
6601
+ js.suspense = void 0 === n ? null : n
6602
+ try {
6603
+ i(e)
6604
+ } finally {
6605
+ js.suspense = t
6606
+ }
6607
+ },
6608
+ [e, n]
6609
+ ),
6610
+ a
6611
+ )
6612
+ },
6613
+ useTransition: function (e) {
6614
+ var n = Zs(Ks),
6615
+ t = n[0]
6616
+ return (n = n[1]), [fr(dr.bind(null, n, e), [n, e]), t]
6617
+ },
6618
+ },
6619
+ kr = {
6620
+ readContext: as,
6621
+ useCallback: fr,
6622
+ useContext: as,
6623
+ useEffect: sr,
6624
+ useImperativeHandle: cr,
6625
+ useLayoutEffect: rr,
6626
+ useMemo: ur,
6627
+ useReducer: Gs,
6628
+ useRef: nr,
6629
+ useState: function () {
6630
+ return Gs(Ks)
6631
+ },
6632
+ useDebugValue: lr,
6633
+ useResponder: Ls,
6634
+ useDeferredValue: function (e, n) {
6635
+ var t = Gs(Ks),
6636
+ a = t[0],
6637
+ i = t[1]
6638
+ return (
6639
+ sr(
6640
+ function () {
6641
+ var t = js.suspense
6642
+ js.suspense = void 0 === n ? null : n
6643
+ try {
6644
+ i(e)
6645
+ } finally {
6646
+ js.suspense = t
6647
+ }
6648
+ },
6649
+ [e, n]
6650
+ ),
6651
+ a
6652
+ )
6653
+ },
6654
+ useTransition: function (e) {
6655
+ var n = Gs(Ks),
6656
+ t = n[0]
6657
+ return (n = n[1]), [fr(dr.bind(null, n, e), [n, e]), t]
6658
+ },
6659
+ },
6660
+ yr = null,
6661
+ br = null,
6662
+ _r = !1
6663
+ function vr(e, n) {
6664
+ var t = Ec(5, null, null, 0)
6665
+ ;(t.elementType = 'DELETED'),
6666
+ (t.type = 'DELETED'),
6667
+ (t.stateNode = n),
6668
+ (t.return = e),
6669
+ (t.effectTag = 8),
6670
+ null !== e.lastEffect
6671
+ ? ((e.lastEffect.nextEffect = t), (e.lastEffect = t))
6672
+ : (e.firstEffect = e.lastEffect = t)
6673
+ }
6674
+ function wr(e, n) {
6675
+ switch (e.tag) {
6676
+ case 5:
6677
+ var t = e.type
6678
+ return (
6679
+ null !==
6680
+ (n =
6681
+ 1 !== n.nodeType ||
6682
+ t.toLowerCase() !== n.nodeName.toLowerCase()
6683
+ ? null
6684
+ : n) && ((e.stateNode = n), !0)
6685
+ )
6686
+ case 6:
6687
+ return (
6688
+ null !==
6689
+ (n =
6690
+ '' === e.pendingProps || 3 !== n.nodeType
6691
+ ? null
6692
+ : n) && ((e.stateNode = n), !0)
6693
+ )
6694
+ case 13:
6695
+ default:
6696
+ return !1
6697
+ }
6698
+ }
6699
+ function Er(e) {
6700
+ if (_r) {
6701
+ var n = br
6702
+ if (n) {
6703
+ var t = n
6704
+ if (!wr(e, n)) {
6705
+ if (!(n = _t(t.nextSibling)) || !wr(e, n))
6706
+ return (
6707
+ (e.effectTag = (-1025 & e.effectTag) | 2),
6708
+ (_r = !1),
6709
+ void (yr = e)
6710
+ )
6711
+ vr(yr, t)
6712
+ }
6713
+ ;(yr = e), (br = _t(n.firstChild))
6714
+ } else
6715
+ (e.effectTag = (-1025 & e.effectTag) | 2),
6716
+ (_r = !1),
6717
+ (yr = e)
6718
+ }
6719
+ }
6720
+ function Cr(e) {
6721
+ for (
6722
+ e = e.return;
6723
+ null !== e && 5 !== e.tag && 3 !== e.tag && 13 !== e.tag;
6724
+
6725
+ )
6726
+ e = e.return
6727
+ yr = e
6728
+ }
6729
+ function xr(e) {
6730
+ if (e !== yr) return !1
6731
+ if (!_r) return Cr(e), (_r = !0), !1
6732
+ var n = e.type
6733
+ if (
6734
+ 5 !== e.tag ||
6735
+ ('head' !== n && 'body' !== n && !kt(n, e.memoizedProps))
6736
+ )
6737
+ for (n = br; n; ) vr(e, n), (n = _t(n.nextSibling))
6738
+ if ((Cr(e), 13 === e.tag)) {
6739
+ if (
6740
+ !(e =
6741
+ null !== (e = e.memoizedState)
6742
+ ? e.dehydrated
6743
+ : null)
6744
+ )
6745
+ throw Error(r(317))
6746
+ e: {
6747
+ for (e = e.nextSibling, n = 0; e; ) {
6748
+ if (8 === e.nodeType) {
6749
+ var t = e.data
6750
+ if ('/$' === t) {
6751
+ if (0 === n) {
6752
+ br = _t(e.nextSibling)
6753
+ break e
6754
+ }
6755
+ n--
6756
+ } else
6757
+ ('$' !== t && '$!' !== t && '$?' !== t) ||
6758
+ n++
6759
+ }
6760
+ e = e.nextSibling
6761
+ }
6762
+ br = null
6763
+ }
6764
+ } else br = yr ? _t(e.stateNode.nextSibling) : null
6765
+ return !0
6766
+ }
6767
+ function Br() {
6768
+ ;(br = yr = null), (_r = !1)
6769
+ }
6770
+ var Sr = K.ReactCurrentOwner,
6771
+ Tr = !1
6772
+ function Pr(e, n, t, a) {
6773
+ n.child = null === e ? Cs(n, null, t, a) : Es(n, e.child, t, a)
6774
+ }
6775
+ function Nr(e, n, t, a, i) {
6776
+ t = t.render
6777
+ var s = n.ref
6778
+ return (
6779
+ ts(n, i),
6780
+ (a = Hs(e, n, t, a, s, i)),
6781
+ null === e || Tr
6782
+ ? ((n.effectTag |= 1), Pr(e, n, a, i), n.child)
6783
+ : ((n.updateQueue = e.updateQueue),
6784
+ (n.effectTag &= -517),
6785
+ e.expirationTime <= i && (e.expirationTime = 0),
6786
+ Hr(e, n, i))
6787
+ )
6788
+ }
6789
+ function Mr(e, n, t, a, i, s) {
6790
+ if (null === e) {
6791
+ var r = t.type
6792
+ return 'function' != typeof r ||
6793
+ Cc(r) ||
6794
+ void 0 !== r.defaultProps ||
6795
+ null !== t.compare ||
6796
+ void 0 !== t.defaultProps
6797
+ ? (((e = Bc(t.type, null, a, null, n.mode, s)).ref =
6798
+ n.ref),
6799
+ (e.return = n),
6800
+ (n.child = e))
6801
+ : ((n.tag = 15), (n.type = r), qr(e, n, r, a, i, s))
6802
+ }
6803
+ return (
6804
+ (r = e.child),
6805
+ i < s &&
6806
+ ((i = r.memoizedProps),
6807
+ (t = null !== (t = t.compare) ? t : ja)(i, a) &&
6808
+ e.ref === n.ref)
6809
+ ? Hr(e, n, s)
6810
+ : ((n.effectTag |= 1),
6811
+ ((e = xc(r, a)).ref = n.ref),
6812
+ (e.return = n),
6813
+ (n.child = e))
6814
+ )
6815
+ }
6816
+ function qr(e, n, t, a, i, s) {
6817
+ return null !== e &&
6818
+ ja(e.memoizedProps, a) &&
6819
+ e.ref === n.ref &&
6820
+ ((Tr = !1), i < s)
6821
+ ? ((n.expirationTime = e.expirationTime), Hr(e, n, s))
6822
+ : Or(e, n, t, a, s)
6823
+ }
6824
+ function Ir(e, n) {
6825
+ var t = n.ref
6826
+ ;((null === e && null !== t) || (null !== e && e.ref !== t)) &&
6827
+ (n.effectTag |= 128)
6828
+ }
6829
+ function Or(e, n, t, a, i) {
6830
+ var s = mi(t) ? di : fi.current
6831
+ return (
6832
+ (s = gi(n, s)),
6833
+ ts(n, i),
6834
+ (t = Hs(e, n, t, a, s, i)),
6835
+ null === e || Tr
6836
+ ? ((n.effectTag |= 1), Pr(e, n, t, i), n.child)
6837
+ : ((n.updateQueue = e.updateQueue),
6838
+ (n.effectTag &= -517),
6839
+ e.expirationTime <= i && (e.expirationTime = 0),
6840
+ Hr(e, n, i))
6841
+ )
6842
+ }
6843
+ function zr(e, n, t, a, i) {
6844
+ if (mi(t)) {
6845
+ var s = !0
6846
+ yi(n)
6847
+ } else s = !1
6848
+ if ((ts(n, i), null === n.stateNode))
6849
+ null !== e &&
6850
+ ((e.alternate = null),
6851
+ (n.alternate = null),
6852
+ (n.effectTag |= 2)),
6853
+ As(n, t, a),
6854
+ ys(n, t, a, i),
6855
+ (a = !0)
6856
+ else if (null === e) {
6857
+ var r = n.stateNode,
6858
+ o = n.memoizedProps
6859
+ r.props = o
6860
+ var c = r.context,
6861
+ l = t.contextType
6862
+ 'object' == typeof l && null !== l
6863
+ ? (l = as(l))
6864
+ : (l = gi(n, (l = mi(t) ? di : fi.current)))
6865
+ var p = t.getDerivedStateFromProps,
6866
+ f =
6867
+ 'function' == typeof p ||
6868
+ 'function' == typeof r.getSnapshotBeforeUpdate
6869
+ f ||
6870
+ ('function' !=
6871
+ typeof r.UNSAFE_componentWillReceiveProps &&
6872
+ 'function' != typeof r.componentWillReceiveProps) ||
6873
+ ((o !== a || c !== l) && ks(n, r, a, l)),
6874
+ (is = !1)
6875
+ var u = n.memoizedState
6876
+ ;(r.state = u),
6877
+ ps(n, a, r, i),
6878
+ (c = n.memoizedState),
6879
+ o !== a || u !== c || ui.current || is
6880
+ ? ('function' == typeof p &&
6881
+ (gs(n, t, p, a), (c = n.memoizedState)),
6882
+ (o = is || hs(n, t, o, a, u, c, l))
6883
+ ? (f ||
6884
+ ('function' !=
6885
+ typeof r.UNSAFE_componentWillMount &&
6886
+ 'function' !=
6887
+ typeof r.componentWillMount) ||
6888
+ ('function' ==
6889
+ typeof r.componentWillMount &&
6890
+ r.componentWillMount(),
6891
+ 'function' ==
6892
+ typeof r.UNSAFE_componentWillMount &&
6893
+ r.UNSAFE_componentWillMount()),
6894
+ 'function' ==
6895
+ typeof r.componentDidMount &&
6896
+ (n.effectTag |= 4))
6897
+ : ('function' ==
6898
+ typeof r.componentDidMount &&
6899
+ (n.effectTag |= 4),
6900
+ (n.memoizedProps = a),
6901
+ (n.memoizedState = c)),
6902
+ (r.props = a),
6903
+ (r.state = c),
6904
+ (r.context = l),
6905
+ (a = o))
6906
+ : ('function' == typeof r.componentDidMount &&
6907
+ (n.effectTag |= 4),
6908
+ (a = !1))
6909
+ } else
6910
+ (r = n.stateNode),
6911
+ rs(e, n),
6912
+ (o = n.memoizedProps),
6913
+ (r.props =
6914
+ n.type === n.elementType ? o : $i(n.type, o)),
6915
+ (c = r.context),
6916
+ 'object' == typeof (l = t.contextType) && null !== l
6917
+ ? (l = as(l))
6918
+ : (l = gi(n, (l = mi(t) ? di : fi.current))),
6919
+ (f =
6920
+ 'function' ==
6921
+ typeof (p = t.getDerivedStateFromProps) ||
6922
+ 'function' == typeof r.getSnapshotBeforeUpdate) ||
6923
+ ('function' !=
6924
+ typeof r.UNSAFE_componentWillReceiveProps &&
6925
+ 'function' !=
6926
+ typeof r.componentWillReceiveProps) ||
6927
+ ((o !== a || c !== l) && ks(n, r, a, l)),
6928
+ (is = !1),
6929
+ (c = n.memoizedState),
6930
+ (r.state = c),
6931
+ ps(n, a, r, i),
6932
+ (u = n.memoizedState),
6933
+ o !== a || c !== u || ui.current || is
6934
+ ? ('function' == typeof p &&
6935
+ (gs(n, t, p, a), (u = n.memoizedState)),
6936
+ (p = is || hs(n, t, o, a, c, u, l))
6937
+ ? (f ||
6938
+ ('function' !=
6939
+ typeof r.UNSAFE_componentWillUpdate &&
6940
+ 'function' !=
6941
+ typeof r.componentWillUpdate) ||
6942
+ ('function' ==
6943
+ typeof r.componentWillUpdate &&
6944
+ r.componentWillUpdate(a, u, l),
6945
+ 'function' ==
6946
+ typeof r.UNSAFE_componentWillUpdate &&
6947
+ r.UNSAFE_componentWillUpdate(
6948
+ a,
6949
+ u,
6950
+ l
6951
+ )),
6952
+ 'function' ==
6953
+ typeof r.componentDidUpdate &&
6954
+ (n.effectTag |= 4),
6955
+ 'function' ==
6956
+ typeof r.getSnapshotBeforeUpdate &&
6957
+ (n.effectTag |= 256))
6958
+ : ('function' !=
6959
+ typeof r.componentDidUpdate ||
6960
+ (o === e.memoizedProps &&
6961
+ c === e.memoizedState) ||
6962
+ (n.effectTag |= 4),
6963
+ 'function' !=
6964
+ typeof r.getSnapshotBeforeUpdate ||
6965
+ (o === e.memoizedProps &&
6966
+ c === e.memoizedState) ||
6967
+ (n.effectTag |= 256),
6968
+ (n.memoizedProps = a),
6969
+ (n.memoizedState = u)),
6970
+ (r.props = a),
6971
+ (r.state = u),
6972
+ (r.context = l),
6973
+ (a = p))
6974
+ : ('function' != typeof r.componentDidUpdate ||
6975
+ (o === e.memoizedProps &&
6976
+ c === e.memoizedState) ||
6977
+ (n.effectTag |= 4),
6978
+ 'function' != typeof r.getSnapshotBeforeUpdate ||
6979
+ (o === e.memoizedProps &&
6980
+ c === e.memoizedState) ||
6981
+ (n.effectTag |= 256),
6982
+ (a = !1))
6983
+ return Lr(e, n, t, a, s, i)
6984
+ }
6985
+ function Lr(e, n, t, a, i, s) {
6986
+ Ir(e, n)
6987
+ var r = 0 != (64 & n.effectTag)
6988
+ if (!a && !r) return i && bi(n, t, !1), Hr(e, n, s)
6989
+ ;(a = n.stateNode), (Sr.current = n)
6990
+ var o =
6991
+ r && 'function' != typeof t.getDerivedStateFromError
6992
+ ? null
6993
+ : a.render()
6994
+ return (
6995
+ (n.effectTag |= 1),
6996
+ null !== e && r
6997
+ ? ((n.child = Es(n, e.child, null, s)),
6998
+ (n.child = Es(n, null, o, s)))
6999
+ : Pr(e, n, o, s),
7000
+ (n.memoizedState = a.state),
7001
+ i && bi(n, t, !0),
7002
+ n.child
7003
+ )
7004
+ }
7005
+ function Ur(e) {
7006
+ var n = e.stateNode
7007
+ n.pendingContext
7008
+ ? Ai(0, n.pendingContext, n.pendingContext !== n.context)
7009
+ : n.context && Ai(0, n.context, !1),
7010
+ Ns(e, n.containerInfo)
7011
+ }
7012
+ var jr,
7013
+ Dr,
7014
+ Fr,
7015
+ Rr = { dehydrated: null, retryTime: 0 }
7016
+ function Yr(e, n, t) {
7017
+ var a,
7018
+ i = n.mode,
7019
+ s = n.pendingProps,
7020
+ r = Os.current,
7021
+ o = !1
7022
+ if (
7023
+ ((a = 0 != (64 & n.effectTag)) ||
7024
+ (a =
7025
+ 0 != (2 & r) &&
7026
+ (null === e || null !== e.memoizedState)),
7027
+ a
7028
+ ? ((o = !0), (n.effectTag &= -65))
7029
+ : (null !== e && null === e.memoizedState) ||
7030
+ void 0 === s.fallback ||
7031
+ !0 === s.unstable_avoidThisFallback ||
7032
+ (r |= 1),
7033
+ li(Os, 1 & r),
7034
+ null === e)
7035
+ ) {
7036
+ if ((void 0 !== s.fallback && Er(n), o)) {
7037
+ if (
7038
+ ((o = s.fallback),
7039
+ ((s = Sc(null, i, 0, null)).return = n),
7040
+ 0 == (2 & n.mode))
7041
+ )
7042
+ for (
7043
+ e =
7044
+ null !== n.memoizedState
7045
+ ? n.child.child
7046
+ : n.child,
7047
+ s.child = e;
7048
+ null !== e;
7049
+
7050
+ )
7051
+ (e.return = s), (e = e.sibling)
7052
+ return (
7053
+ ((t = Sc(o, i, t, null)).return = n),
7054
+ (s.sibling = t),
7055
+ (n.memoizedState = Rr),
7056
+ (n.child = s),
7057
+ t
7058
+ )
7059
+ }
7060
+ return (
7061
+ (i = s.children),
7062
+ (n.memoizedState = null),
7063
+ (n.child = Cs(n, null, i, t))
7064
+ )
7065
+ }
7066
+ if (null !== e.memoizedState) {
7067
+ if (((i = (e = e.child).sibling), o)) {
7068
+ if (
7069
+ ((s = s.fallback),
7070
+ ((t = xc(e, e.pendingProps)).return = n),
7071
+ 0 == (2 & n.mode) &&
7072
+ (o =
7073
+ null !== n.memoizedState
7074
+ ? n.child.child
7075
+ : n.child) !== e.child)
7076
+ )
7077
+ for (t.child = o; null !== o; )
7078
+ (o.return = t), (o = o.sibling)
7079
+ return (
7080
+ ((i = xc(i, s)).return = n),
7081
+ (t.sibling = i),
7082
+ (t.childExpirationTime = 0),
7083
+ (n.memoizedState = Rr),
7084
+ (n.child = t),
7085
+ i
7086
+ )
7087
+ }
7088
+ return (
7089
+ (t = Es(n, e.child, s.children, t)),
7090
+ (n.memoizedState = null),
7091
+ (n.child = t)
7092
+ )
7093
+ }
7094
+ if (((e = e.child), o)) {
7095
+ if (
7096
+ ((o = s.fallback),
7097
+ ((s = Sc(null, i, 0, null)).return = n),
7098
+ (s.child = e),
7099
+ null !== e && (e.return = s),
7100
+ 0 == (2 & n.mode))
7101
+ )
7102
+ for (
7103
+ e =
7104
+ null !== n.memoizedState
7105
+ ? n.child.child
7106
+ : n.child,
7107
+ s.child = e;
7108
+ null !== e;
7109
+
7110
+ )
7111
+ (e.return = s), (e = e.sibling)
7112
+ return (
7113
+ ((t = Sc(o, i, t, null)).return = n),
7114
+ (s.sibling = t),
7115
+ (t.effectTag |= 2),
7116
+ (s.childExpirationTime = 0),
7117
+ (n.memoizedState = Rr),
7118
+ (n.child = s),
7119
+ t
7120
+ )
7121
+ }
7122
+ return (
7123
+ (n.memoizedState = null),
7124
+ (n.child = Es(n, e, s.children, t))
7125
+ )
7126
+ }
7127
+ function Qr(e, n) {
7128
+ e.expirationTime < n && (e.expirationTime = n)
7129
+ var t = e.alternate
7130
+ null !== t && t.expirationTime < n && (t.expirationTime = n),
7131
+ ns(e.return, n)
7132
+ }
7133
+ function Wr(e, n, t, a, i, s) {
7134
+ var r = e.memoizedState
7135
+ null === r
7136
+ ? (e.memoizedState = {
7137
+ isBackwards: n,
7138
+ rendering: null,
7139
+ renderingStartTime: 0,
7140
+ last: a,
7141
+ tail: t,
7142
+ tailExpiration: 0,
7143
+ tailMode: i,
7144
+ lastEffect: s,
7145
+ })
7146
+ : ((r.isBackwards = n),
7147
+ (r.rendering = null),
7148
+ (r.renderingStartTime = 0),
7149
+ (r.last = a),
7150
+ (r.tail = t),
7151
+ (r.tailExpiration = 0),
7152
+ (r.tailMode = i),
7153
+ (r.lastEffect = s))
7154
+ }
7155
+ function Vr(e, n, t) {
7156
+ var a = n.pendingProps,
7157
+ i = a.revealOrder,
7158
+ s = a.tail
7159
+ if ((Pr(e, n, a.children, t), 0 != (2 & (a = Os.current))))
7160
+ (a = (1 & a) | 2), (n.effectTag |= 64)
7161
+ else {
7162
+ if (null !== e && 0 != (64 & e.effectTag))
7163
+ e: for (e = n.child; null !== e; ) {
7164
+ if (13 === e.tag)
7165
+ null !== e.memoizedState && Qr(e, t)
7166
+ else if (19 === e.tag) Qr(e, t)
7167
+ else if (null !== e.child) {
7168
+ ;(e.child.return = e), (e = e.child)
7169
+ continue
7170
+ }
7171
+ if (e === n) break e
7172
+ for (; null === e.sibling; ) {
7173
+ if (null === e.return || e.return === n) break e
7174
+ e = e.return
7175
+ }
7176
+ ;(e.sibling.return = e.return), (e = e.sibling)
7177
+ }
7178
+ a &= 1
7179
+ }
7180
+ if ((li(Os, a), 0 == (2 & n.mode))) n.memoizedState = null
7181
+ else
7182
+ switch (i) {
7183
+ case 'forwards':
7184
+ for (t = n.child, i = null; null !== t; )
7185
+ null !== (e = t.alternate) &&
7186
+ null === zs(e) &&
7187
+ (i = t),
7188
+ (t = t.sibling)
7189
+ null === (t = i)
7190
+ ? ((i = n.child), (n.child = null))
7191
+ : ((i = t.sibling), (t.sibling = null)),
7192
+ Wr(n, !1, i, t, s, n.lastEffect)
7193
+ break
7194
+ case 'backwards':
7195
+ for (
7196
+ t = null, i = n.child, n.child = null;
7197
+ null !== i;
7198
+
7199
+ ) {
7200
+ if (
7201
+ null !== (e = i.alternate) &&
7202
+ null === zs(e)
7203
+ ) {
7204
+ n.child = i
7205
+ break
7206
+ }
7207
+ ;(e = i.sibling),
7208
+ (i.sibling = t),
7209
+ (t = i),
7210
+ (i = e)
7211
+ }
7212
+ Wr(n, !0, t, null, s, n.lastEffect)
7213
+ break
7214
+ case 'together':
7215
+ Wr(n, !1, null, null, void 0, n.lastEffect)
7216
+ break
7217
+ default:
7218
+ n.memoizedState = null
7219
+ }
7220
+ return n.child
7221
+ }
7222
+ function Hr(e, n, t) {
7223
+ null !== e && (n.dependencies = e.dependencies)
7224
+ var a = n.expirationTime
7225
+ if ((0 !== a && rc(a), n.childExpirationTime < t)) return null
7226
+ if (null !== e && n.child !== e.child) throw Error(r(153))
7227
+ if (null !== n.child) {
7228
+ for (
7229
+ t = xc((e = n.child), e.pendingProps),
7230
+ n.child = t,
7231
+ t.return = n;
7232
+ null !== e.sibling;
7233
+
7234
+ )
7235
+ (e = e.sibling),
7236
+ ((t = t.sibling = xc(e, e.pendingProps)).return = n)
7237
+ t.sibling = null
7238
+ }
7239
+ return n.child
7240
+ }
7241
+ function $r(e, n) {
7242
+ switch (e.tailMode) {
7243
+ case 'hidden':
7244
+ n = e.tail
7245
+ for (var t = null; null !== n; )
7246
+ null !== n.alternate && (t = n), (n = n.sibling)
7247
+ null === t ? (e.tail = null) : (t.sibling = null)
7248
+ break
7249
+ case 'collapsed':
7250
+ t = e.tail
7251
+ for (var a = null; null !== t; )
7252
+ null !== t.alternate && (a = t), (t = t.sibling)
7253
+ null === a
7254
+ ? n || null === e.tail
7255
+ ? (e.tail = null)
7256
+ : (e.tail.sibling = null)
7257
+ : (a.sibling = null)
7258
+ }
7259
+ }
7260
+ function Xr(e, n, t) {
7261
+ var a = n.pendingProps
7262
+ switch (n.tag) {
7263
+ case 2:
7264
+ case 16:
7265
+ case 15:
7266
+ case 0:
7267
+ case 11:
7268
+ case 7:
7269
+ case 8:
7270
+ case 12:
7271
+ case 9:
7272
+ case 14:
7273
+ return null
7274
+ case 1:
7275
+ return mi(n.type) && hi(), null
7276
+ case 3:
7277
+ return (
7278
+ Ms(),
7279
+ ci(ui),
7280
+ ci(fi),
7281
+ (t = n.stateNode).pendingContext &&
7282
+ ((t.context = t.pendingContext),
7283
+ (t.pendingContext = null)),
7284
+ (null !== e && null !== e.child) ||
7285
+ !xr(n) ||
7286
+ (n.effectTag |= 4),
7287
+ null
7288
+ )
7289
+ case 5:
7290
+ Is(n), (t = Ps(Ts.current))
7291
+ var s = n.type
7292
+ if (null !== e && null != n.stateNode)
7293
+ Dr(e, n, s, a, t),
7294
+ e.ref !== n.ref && (n.effectTag |= 128)
7295
+ else {
7296
+ if (!a) {
7297
+ if (null === n.stateNode) throw Error(r(166))
7298
+ return null
7299
+ }
7300
+ if (((e = Ps(Bs.current)), xr(n))) {
7301
+ ;(a = n.stateNode), (s = n.type)
7302
+ var o = n.memoizedProps
7303
+ switch (((a[Et] = n), (a[Ct] = o), s)) {
7304
+ case 'iframe':
7305
+ case 'object':
7306
+ case 'embed':
7307
+ $n('load', a)
7308
+ break
7309
+ case 'video':
7310
+ case 'audio':
7311
+ for (e = 0; e < Ke.length; e++)
7312
+ $n(Ke[e], a)
7313
+ break
7314
+ case 'source':
7315
+ $n('error', a)
7316
+ break
7317
+ case 'img':
7318
+ case 'image':
7319
+ case 'link':
7320
+ $n('error', a), $n('load', a)
7321
+ break
7322
+ case 'form':
7323
+ $n('reset', a), $n('submit', a)
7324
+ break
7325
+ case 'details':
7326
+ $n('toggle', a)
7327
+ break
7328
+ case 'input':
7329
+ we(a, o),
7330
+ $n('invalid', a),
7331
+ ct(t, 'onChange')
7332
+ break
7333
+ case 'select':
7334
+ ;(a._wrapperState = {
7335
+ wasMultiple: !!o.multiple,
7336
+ }),
7337
+ $n('invalid', a),
7338
+ ct(t, 'onChange')
7339
+ break
7340
+ case 'textarea':
7341
+ Ne(a, o),
7342
+ $n('invalid', a),
7343
+ ct(t, 'onChange')
7344
+ }
7345
+ for (var c in (st(s, o), (e = null), o))
7346
+ if (o.hasOwnProperty(c)) {
7347
+ var l = o[c]
7348
+ 'children' === c
7349
+ ? 'string' == typeof l
7350
+ ? a.textContent !== l &&
7351
+ (e = ['children', l])
7352
+ : 'number' == typeof l &&
7353
+ a.textContent !== '' + l &&
7354
+ (e = ['children', '' + l])
7355
+ : E.hasOwnProperty(c) &&
7356
+ null != l &&
7357
+ ct(t, c)
7358
+ }
7359
+ switch (s) {
7360
+ case 'input':
7361
+ be(a), xe(a, o, !0)
7362
+ break
7363
+ case 'textarea':
7364
+ be(a), qe(a)
7365
+ break
7366
+ case 'select':
7367
+ case 'option':
7368
+ break
7369
+ default:
7370
+ 'function' == typeof o.onClick &&
7371
+ (a.onclick = lt)
7372
+ }
7373
+ ;(t = e),
7374
+ (n.updateQueue = t),
7375
+ null !== t && (n.effectTag |= 4)
7376
+ } else {
7377
+ switch (
7378
+ ((c =
7379
+ 9 === t.nodeType ? t : t.ownerDocument),
7380
+ e === ot && (e = ze(s)),
7381
+ e === ot
7382
+ ? 'script' === s
7383
+ ? (((e = c.createElement(
7384
+ 'div'
7385
+ )).innerHTML =
7386
+ '<script></script>'),
7387
+ (e = e.removeChild(e.firstChild)))
7388
+ : 'string' == typeof a.is
7389
+ ? (e = c.createElement(s, {
7390
+ is: a.is,
7391
+ }))
7392
+ : ((e = c.createElement(s)),
7393
+ 'select' === s &&
7394
+ ((c = e),
7395
+ a.multiple
7396
+ ? (c.multiple = !0)
7397
+ : a.size &&
7398
+ (c.size = a.size)))
7399
+ : (e = c.createElementNS(e, s)),
7400
+ (e[Et] = n),
7401
+ (e[Ct] = a),
7402
+ jr(e, n),
7403
+ (n.stateNode = e),
7404
+ (c = rt(s, a)),
7405
+ s)
7406
+ ) {
7407
+ case 'iframe':
7408
+ case 'object':
7409
+ case 'embed':
7410
+ $n('load', e), (l = a)
7411
+ break
7412
+ case 'video':
7413
+ case 'audio':
7414
+ for (l = 0; l < Ke.length; l++)
7415
+ $n(Ke[l], e)
7416
+ l = a
7417
+ break
7418
+ case 'source':
7419
+ $n('error', e), (l = a)
7420
+ break
7421
+ case 'img':
7422
+ case 'image':
7423
+ case 'link':
7424
+ $n('error', e), $n('load', e), (l = a)
7425
+ break
7426
+ case 'form':
7427
+ $n('reset', e), $n('submit', e), (l = a)
7428
+ break
7429
+ case 'details':
7430
+ $n('toggle', e), (l = a)
7431
+ break
7432
+ case 'input':
7433
+ we(e, a),
7434
+ (l = ve(e, a)),
7435
+ $n('invalid', e),
7436
+ ct(t, 'onChange')
7437
+ break
7438
+ case 'option':
7439
+ l = Se(e, a)
7440
+ break
7441
+ case 'select':
7442
+ ;(e._wrapperState = {
7443
+ wasMultiple: !!a.multiple,
7444
+ }),
7445
+ (l = i({}, a, { value: void 0 })),
7446
+ $n('invalid', e),
7447
+ ct(t, 'onChange')
7448
+ break
7449
+ case 'textarea':
7450
+ Ne(e, a),
7451
+ (l = Pe(e, a)),
7452
+ $n('invalid', e),
7453
+ ct(t, 'onChange')
7454
+ break
7455
+ default:
7456
+ l = a
7457
+ }
7458
+ st(s, l)
7459
+ var p = l
7460
+ for (o in p)
7461
+ if (p.hasOwnProperty(o)) {
7462
+ var f = p[o]
7463
+ 'style' === o
7464
+ ? at(e, f)
7465
+ : 'dangerouslySetInnerHTML' === o
7466
+ ? null !=
7467
+ (f = f
7468
+ ? f.__html
7469
+ : void 0) && je(e, f)
7470
+ : 'children' === o
7471
+ ? 'string' == typeof f
7472
+ ? ('textarea' !== s ||
7473
+ '' !== f) &&
7474
+ De(e, f)
7475
+ : 'number' == typeof f &&
7476
+ De(e, '' + f)
7477
+ : 'suppressContentEditableWarning' !==
7478
+ o &&
7479
+ 'suppressHydrationWarning' !==
7480
+ o &&
7481
+ 'autoFocus' !== o &&
7482
+ (E.hasOwnProperty(o)
7483
+ ? null != f && ct(t, o)
7484
+ : null != f &&
7485
+ Z(e, o, f, c))
7486
+ }
7487
+ switch (s) {
7488
+ case 'input':
7489
+ be(e), xe(e, a, !1)
7490
+ break
7491
+ case 'textarea':
7492
+ be(e), qe(e)
7493
+ break
7494
+ case 'option':
7495
+ null != a.value &&
7496
+ e.setAttribute(
7497
+ 'value',
7498
+ '' + ke(a.value)
7499
+ )
7500
+ break
7501
+ case 'select':
7502
+ ;(e.multiple = !!a.multiple),
7503
+ null != (t = a.value)
7504
+ ? Te(e, !!a.multiple, t, !1)
7505
+ : null != a.defaultValue &&
7506
+ Te(
7507
+ e,
7508
+ !!a.multiple,
7509
+ a.defaultValue,
7510
+ !0
7511
+ )
7512
+ break
7513
+ default:
7514
+ 'function' == typeof l.onClick &&
7515
+ (e.onclick = lt)
7516
+ }
7517
+ At(s, a) && (n.effectTag |= 4)
7518
+ }
7519
+ null !== n.ref && (n.effectTag |= 128)
7520
+ }
7521
+ return null
7522
+ case 6:
7523
+ if (e && null != n.stateNode)
7524
+ Fr(0, n, e.memoizedProps, a)
7525
+ else {
7526
+ if ('string' != typeof a && null === n.stateNode)
7527
+ throw Error(r(166))
7528
+ ;(t = Ps(Ts.current)),
7529
+ Ps(Bs.current),
7530
+ xr(n)
7531
+ ? ((t = n.stateNode),
7532
+ (a = n.memoizedProps),
7533
+ (t[Et] = n),
7534
+ t.nodeValue !== a && (n.effectTag |= 4))
7535
+ : (((t = (9 === t.nodeType
7536
+ ? t
7537
+ : t.ownerDocument
7538
+ ).createTextNode(a))[Et] = n),
7539
+ (n.stateNode = t))
7540
+ }
7541
+ return null
7542
+ case 13:
7543
+ return (
7544
+ ci(Os),
7545
+ (a = n.memoizedState),
7546
+ 0 != (64 & n.effectTag)
7547
+ ? ((n.expirationTime = t), n)
7548
+ : ((t = null !== a),
7549
+ (a = !1),
7550
+ null === e
7551
+ ? void 0 !== n.memoizedProps.fallback &&
7552
+ xr(n)
7553
+ : ((a = null !== (s = e.memoizedState)),
7554
+ t ||
7555
+ null === s ||
7556
+ (null !==
7557
+ (s = e.child.sibling) &&
7558
+ (null !==
7559
+ (o = n.firstEffect)
7560
+ ? ((n.firstEffect = s),
7561
+ (s.nextEffect = o))
7562
+ : ((n.firstEffect = n.lastEffect = s),
7563
+ (s.nextEffect = null)),
7564
+ (s.effectTag = 8)))),
7565
+ t &&
7566
+ !a &&
7567
+ 0 != (2 & n.mode) &&
7568
+ ((null === e &&
7569
+ !0 !==
7570
+ n.memoizedProps
7571
+ .unstable_avoidThisFallback) ||
7572
+ 0 != (1 & Os.current)
7573
+ ? Bo === bo && (Bo = _o)
7574
+ : ((Bo !== bo && Bo !== _o) ||
7575
+ (Bo = vo),
7576
+ 0 !== Mo &&
7577
+ null !== Eo &&
7578
+ (qc(Eo, xo), Ic(Eo, Mo)))),
7579
+ (t || a) && (n.effectTag |= 4),
7580
+ null)
7581
+ )
7582
+ case 4:
7583
+ return Ms(), null
7584
+ case 10:
7585
+ return es(n), null
7586
+ case 17:
7587
+ return mi(n.type) && hi(), null
7588
+ case 19:
7589
+ if ((ci(Os), null === (a = n.memoizedState)))
7590
+ return null
7591
+ if (
7592
+ ((s = 0 != (64 & n.effectTag)),
7593
+ null === (o = a.rendering))
7594
+ ) {
7595
+ if (s) $r(a, !1)
7596
+ else if (
7597
+ Bo !== bo ||
7598
+ (null !== e && 0 != (64 & e.effectTag))
7599
+ )
7600
+ for (o = n.child; null !== o; ) {
7601
+ if (null !== (e = zs(o))) {
7602
+ for (
7603
+ n.effectTag |= 64,
7604
+ $r(a, !1),
7605
+ null !== (s = e.updateQueue) &&
7606
+ ((n.updateQueue = s),
7607
+ (n.effectTag |= 4)),
7608
+ null === a.lastEffect &&
7609
+ (n.firstEffect = null),
7610
+ n.lastEffect = a.lastEffect,
7611
+ a = n.child;
7612
+ null !== a;
7613
+
7614
+ )
7615
+ (o = t),
7616
+ ((s = a).effectTag &= 2),
7617
+ (s.nextEffect = null),
7618
+ (s.firstEffect = null),
7619
+ (s.lastEffect = null),
7620
+ null === (e = s.alternate)
7621
+ ? ((s.childExpirationTime = 0),
7622
+ (s.expirationTime = o),
7623
+ (s.child = null),
7624
+ (s.memoizedProps = null),
7625
+ (s.memoizedState = null),
7626
+ (s.updateQueue = null),
7627
+ (s.dependencies = null))
7628
+ : ((s.childExpirationTime =
7629
+ e.childExpirationTime),
7630
+ (s.expirationTime =
7631
+ e.expirationTime),
7632
+ (s.child = e.child),
7633
+ (s.memoizedProps =
7634
+ e.memoizedProps),
7635
+ (s.memoizedState =
7636
+ e.memoizedState),
7637
+ (s.updateQueue =
7638
+ e.updateQueue),
7639
+ (o = e.dependencies),
7640
+ (s.dependencies =
7641
+ null === o
7642
+ ? null
7643
+ : {
7644
+ expirationTime:
7645
+ o.expirationTime,
7646
+ firstContext:
7647
+ o.firstContext,
7648
+ responders:
7649
+ o.responders,
7650
+ })),
7651
+ (a = a.sibling)
7652
+ return (
7653
+ li(Os, (1 & Os.current) | 2),
7654
+ n.child
7655
+ )
7656
+ }
7657
+ o = o.sibling
7658
+ }
7659
+ } else {
7660
+ if (!s)
7661
+ if (null !== (e = zs(o))) {
7662
+ if (
7663
+ ((n.effectTag |= 64),
7664
+ (s = !0),
7665
+ null !== (t = e.updateQueue) &&
7666
+ ((n.updateQueue = t),
7667
+ (n.effectTag |= 4)),
7668
+ $r(a, !0),
7669
+ null === a.tail &&
7670
+ 'hidden' === a.tailMode &&
7671
+ !o.alternate)
7672
+ )
7673
+ return (
7674
+ null !==
7675
+ (n = n.lastEffect =
7676
+ a.lastEffect) &&
7677
+ (n.nextEffect = null),
7678
+ null
7679
+ )
7680
+ } else
7681
+ 2 * ji() - a.renderingStartTime >
7682
+ a.tailExpiration &&
7683
+ 1 < t &&
7684
+ ((n.effectTag |= 64),
7685
+ (s = !0),
7686
+ $r(a, !1),
7687
+ (n.expirationTime = n.childExpirationTime =
7688
+ t - 1))
7689
+ a.isBackwards
7690
+ ? ((o.sibling = n.child), (n.child = o))
7691
+ : (null !== (t = a.last)
7692
+ ? (t.sibling = o)
7693
+ : (n.child = o),
7694
+ (a.last = o))
7695
+ }
7696
+ return null !== a.tail
7697
+ ? (0 === a.tailExpiration &&
7698
+ (a.tailExpiration = ji() + 500),
7699
+ (t = a.tail),
7700
+ (a.rendering = t),
7701
+ (a.tail = t.sibling),
7702
+ (a.lastEffect = n.lastEffect),
7703
+ (a.renderingStartTime = ji()),
7704
+ (t.sibling = null),
7705
+ (n = Os.current),
7706
+ li(Os, s ? (1 & n) | 2 : 1 & n),
7707
+ t)
7708
+ : null
7709
+ }
7710
+ throw Error(r(156, n.tag))
7711
+ }
7712
+ function Kr(e) {
7713
+ switch (e.tag) {
7714
+ case 1:
7715
+ mi(e.type) && hi()
7716
+ var n = e.effectTag
7717
+ return 4096 & n
7718
+ ? ((e.effectTag = (-4097 & n) | 64), e)
7719
+ : null
7720
+ case 3:
7721
+ if (
7722
+ (Ms(),
7723
+ ci(ui),
7724
+ ci(fi),
7725
+ 0 != (64 & (n = e.effectTag)))
7726
+ )
7727
+ throw Error(r(285))
7728
+ return (e.effectTag = (-4097 & n) | 64), e
7729
+ case 5:
7730
+ return Is(e), null
7731
+ case 13:
7732
+ return (
7733
+ ci(Os),
7734
+ 4096 & (n = e.effectTag)
7735
+ ? ((e.effectTag = (-4097 & n) | 64), e)
7736
+ : null
7737
+ )
7738
+ case 19:
7739
+ return ci(Os), null
7740
+ case 4:
7741
+ return Ms(), null
7742
+ case 10:
7743
+ return es(e), null
7744
+ default:
7745
+ return null
7746
+ }
7747
+ }
7748
+ function Zr(e, n) {
7749
+ return { value: e, source: n, stack: Ae(n) }
7750
+ }
7751
+ ;(jr = function (e, n) {
7752
+ for (var t = n.child; null !== t; ) {
7753
+ if (5 === t.tag || 6 === t.tag) e.appendChild(t.stateNode)
7754
+ else if (4 !== t.tag && null !== t.child) {
7755
+ ;(t.child.return = t), (t = t.child)
7756
+ continue
7757
+ }
7758
+ if (t === n) break
7759
+ for (; null === t.sibling; ) {
7760
+ if (null === t.return || t.return === n) return
7761
+ t = t.return
7762
+ }
7763
+ ;(t.sibling.return = t.return), (t = t.sibling)
7764
+ }
7765
+ }),
7766
+ (Dr = function (e, n, t, a, s) {
7767
+ var r = e.memoizedProps
7768
+ if (r !== a) {
7769
+ var o,
7770
+ c,
7771
+ l = n.stateNode
7772
+ switch ((Ps(Bs.current), (e = null), t)) {
7773
+ case 'input':
7774
+ ;(r = ve(l, r)), (a = ve(l, a)), (e = [])
7775
+ break
7776
+ case 'option':
7777
+ ;(r = Se(l, r)), (a = Se(l, a)), (e = [])
7778
+ break
7779
+ case 'select':
7780
+ ;(r = i({}, r, { value: void 0 })),
7781
+ (a = i({}, a, { value: void 0 })),
7782
+ (e = [])
7783
+ break
7784
+ case 'textarea':
7785
+ ;(r = Pe(l, r)), (a = Pe(l, a)), (e = [])
7786
+ break
7787
+ default:
7788
+ 'function' != typeof r.onClick &&
7789
+ 'function' == typeof a.onClick &&
7790
+ (l.onclick = lt)
7791
+ }
7792
+ for (o in (st(t, a), (t = null), r))
7793
+ if (
7794
+ !a.hasOwnProperty(o) &&
7795
+ r.hasOwnProperty(o) &&
7796
+ null != r[o]
7797
+ )
7798
+ if ('style' === o)
7799
+ for (c in (l = r[o]))
7800
+ l.hasOwnProperty(c) &&
7801
+ (t || (t = {}), (t[c] = ''))
7802
+ else
7803
+ 'dangerouslySetInnerHTML' !== o &&
7804
+ 'children' !== o &&
7805
+ 'suppressContentEditableWarning' !==
7806
+ o &&
7807
+ 'suppressHydrationWarning' !== o &&
7808
+ 'autoFocus' !== o &&
7809
+ (E.hasOwnProperty(o)
7810
+ ? e || (e = [])
7811
+ : (e = e || []).push(o, null))
7812
+ for (o in a) {
7813
+ var p = a[o]
7814
+ if (
7815
+ ((l = null != r ? r[o] : void 0),
7816
+ a.hasOwnProperty(o) &&
7817
+ p !== l &&
7818
+ (null != p || null != l))
7819
+ )
7820
+ if ('style' === o)
7821
+ if (l) {
7822
+ for (c in l)
7823
+ !l.hasOwnProperty(c) ||
7824
+ (p && p.hasOwnProperty(c)) ||
7825
+ (t || (t = {}), (t[c] = ''))
7826
+ for (c in p)
7827
+ p.hasOwnProperty(c) &&
7828
+ l[c] !== p[c] &&
7829
+ (t || (t = {}), (t[c] = p[c]))
7830
+ } else
7831
+ t || (e || (e = []), e.push(o, t)),
7832
+ (t = p)
7833
+ else
7834
+ 'dangerouslySetInnerHTML' === o
7835
+ ? ((p = p ? p.__html : void 0),
7836
+ (l = l ? l.__html : void 0),
7837
+ null != p &&
7838
+ l !== p &&
7839
+ (e = e || []).push(o, p))
7840
+ : 'children' === o
7841
+ ? l === p ||
7842
+ ('string' != typeof p &&
7843
+ 'number' != typeof p) ||
7844
+ (e = e || []).push(o, '' + p)
7845
+ : 'suppressContentEditableWarning' !==
7846
+ o &&
7847
+ 'suppressHydrationWarning' !== o &&
7848
+ (E.hasOwnProperty(o)
7849
+ ? (null != p && ct(s, o),
7850
+ e || l === p || (e = []))
7851
+ : (e = e || []).push(o, p))
7852
+ }
7853
+ t && (e = e || []).push('style', t),
7854
+ (s = e),
7855
+ (n.updateQueue = s) && (n.effectTag |= 4)
7856
+ }
7857
+ }),
7858
+ (Fr = function (e, n, t, a) {
7859
+ t !== a && (n.effectTag |= 4)
7860
+ })
7861
+ var Gr = 'function' == typeof WeakSet ? WeakSet : Set
7862
+ function Jr(e, n) {
7863
+ var t = n.source,
7864
+ a = n.stack
7865
+ null === a && null !== t && (a = Ae(t)),
7866
+ null !== t && he(t.type),
7867
+ (n = n.value),
7868
+ null !== e && 1 === e.tag && he(e.type)
7869
+ try {
7870
+ console.error(n)
7871
+ } catch (e) {
7872
+ setTimeout(function () {
7873
+ throw e
7874
+ })
7875
+ }
7876
+ }
7877
+ function eo(e) {
7878
+ var n = e.ref
7879
+ if (null !== n)
7880
+ if ('function' == typeof n)
7881
+ try {
7882
+ n(null)
7883
+ } catch (n) {
7884
+ kc(e, n)
7885
+ }
7886
+ else n.current = null
7887
+ }
7888
+ function no(e, n) {
7889
+ switch (n.tag) {
7890
+ case 0:
7891
+ case 11:
7892
+ case 15:
7893
+ case 22:
7894
+ return
7895
+ case 1:
7896
+ if (256 & n.effectTag && null !== e) {
7897
+ var t = e.memoizedProps,
7898
+ a = e.memoizedState
7899
+ ;(n = (e = n.stateNode).getSnapshotBeforeUpdate(
7900
+ n.elementType === n.type ? t : $i(n.type, t),
7901
+ a
7902
+ )),
7903
+ (e.__reactInternalSnapshotBeforeUpdate = n)
7904
+ }
7905
+ return
7906
+ case 3:
7907
+ case 5:
7908
+ case 6:
7909
+ case 4:
7910
+ case 17:
7911
+ return
7912
+ }
7913
+ throw Error(r(163))
7914
+ }
7915
+ function to(e, n) {
7916
+ if (
7917
+ null !==
7918
+ (n = null !== (n = n.updateQueue) ? n.lastEffect : null)
7919
+ ) {
7920
+ var t = (n = n.next)
7921
+ do {
7922
+ if ((t.tag & e) === e) {
7923
+ var a = t.destroy
7924
+ ;(t.destroy = void 0), void 0 !== a && a()
7925
+ }
7926
+ t = t.next
7927
+ } while (t !== n)
7928
+ }
7929
+ }
7930
+ function ao(e, n) {
7931
+ if (
7932
+ null !==
7933
+ (n = null !== (n = n.updateQueue) ? n.lastEffect : null)
7934
+ ) {
7935
+ var t = (n = n.next)
7936
+ do {
7937
+ if ((t.tag & e) === e) {
7938
+ var a = t.create
7939
+ t.destroy = a()
7940
+ }
7941
+ t = t.next
7942
+ } while (t !== n)
7943
+ }
7944
+ }
7945
+ function io(e, n, t) {
7946
+ switch (t.tag) {
7947
+ case 0:
7948
+ case 11:
7949
+ case 15:
7950
+ case 22:
7951
+ return void ao(3, t)
7952
+ case 1:
7953
+ if (((e = t.stateNode), 4 & t.effectTag))
7954
+ if (null === n) e.componentDidMount()
7955
+ else {
7956
+ var a =
7957
+ t.elementType === t.type
7958
+ ? n.memoizedProps
7959
+ : $i(t.type, n.memoizedProps)
7960
+ e.componentDidUpdate(
7961
+ a,
7962
+ n.memoizedState,
7963
+ e.__reactInternalSnapshotBeforeUpdate
7964
+ )
7965
+ }
7966
+ return void (
7967
+ null !== (n = t.updateQueue) && fs(t, n, e)
7968
+ )
7969
+ case 3:
7970
+ if (null !== (n = t.updateQueue)) {
7971
+ if (((e = null), null !== t.child))
7972
+ switch (t.child.tag) {
7973
+ case 5:
7974
+ e = t.child.stateNode
7975
+ break
7976
+ case 1:
7977
+ e = t.child.stateNode
7978
+ }
7979
+ fs(t, n, e)
7980
+ }
7981
+ return
7982
+ case 5:
7983
+ return (
7984
+ (e = t.stateNode),
7985
+ void (
7986
+ null === n &&
7987
+ 4 & t.effectTag &&
7988
+ At(t.type, t.memoizedProps) &&
7989
+ e.focus()
7990
+ )
7991
+ )
7992
+ case 6:
7993
+ case 4:
7994
+ case 12:
7995
+ return
7996
+ case 13:
7997
+ return void (
7998
+ null === t.memoizedState &&
7999
+ ((t = t.alternate),
8000
+ null !== t &&
8001
+ ((t = t.memoizedState),
8002
+ null !== t &&
8003
+ ((t = t.dehydrated), null !== t && Ln(t))))
8004
+ )
8005
+ case 19:
8006
+ case 17:
8007
+ case 20:
8008
+ case 21:
8009
+ return
8010
+ }
8011
+ throw Error(r(163))
8012
+ }
8013
+ function so(e, n, t) {
8014
+ switch (('function' == typeof vc && vc(n), n.tag)) {
8015
+ case 0:
8016
+ case 11:
8017
+ case 14:
8018
+ case 15:
8019
+ case 22:
8020
+ if (
8021
+ null !== (e = n.updateQueue) &&
8022
+ null !== (e = e.lastEffect)
8023
+ ) {
8024
+ var a = e.next
8025
+ Ri(97 < t ? 97 : t, function () {
8026
+ var e = a
8027
+ do {
8028
+ var t = e.destroy
8029
+ if (void 0 !== t) {
8030
+ var i = n
8031
+ try {
8032
+ t()
8033
+ } catch (e) {
8034
+ kc(i, e)
8035
+ }
8036
+ }
8037
+ e = e.next
8038
+ } while (e !== a)
8039
+ })
8040
+ }
8041
+ break
8042
+ case 1:
8043
+ eo(n),
8044
+ 'function' ==
8045
+ typeof (t = n.stateNode).componentWillUnmount &&
8046
+ (function (e, n) {
8047
+ try {
8048
+ ;(n.props = e.memoizedProps),
8049
+ (n.state = e.memoizedState),
8050
+ n.componentWillUnmount()
8051
+ } catch (n) {
8052
+ kc(e, n)
8053
+ }
8054
+ })(n, t)
8055
+ break
8056
+ case 5:
8057
+ eo(n)
8058
+ break
8059
+ case 4:
8060
+ lo(e, n, t)
8061
+ }
8062
+ }
8063
+ function ro(e) {
8064
+ var n = e.alternate
8065
+ ;(e.return = null),
8066
+ (e.child = null),
8067
+ (e.memoizedState = null),
8068
+ (e.updateQueue = null),
8069
+ (e.dependencies = null),
8070
+ (e.alternate = null),
8071
+ (e.firstEffect = null),
8072
+ (e.lastEffect = null),
8073
+ (e.pendingProps = null),
8074
+ (e.memoizedProps = null),
8075
+ (e.stateNode = null),
8076
+ null !== n && ro(n)
8077
+ }
8078
+ function oo(e) {
8079
+ return 5 === e.tag || 3 === e.tag || 4 === e.tag
8080
+ }
8081
+ function co(e) {
8082
+ e: {
8083
+ for (var n = e.return; null !== n; ) {
8084
+ if (oo(n)) {
8085
+ var t = n
8086
+ break e
8087
+ }
8088
+ n = n.return
8089
+ }
8090
+ throw Error(r(160))
8091
+ }
8092
+ switch (((n = t.stateNode), t.tag)) {
8093
+ case 5:
8094
+ var a = !1
8095
+ break
8096
+ case 3:
8097
+ case 4:
8098
+ ;(n = n.containerInfo), (a = !0)
8099
+ break
8100
+ default:
8101
+ throw Error(r(161))
8102
+ }
8103
+ 16 & t.effectTag && (De(n, ''), (t.effectTag &= -17))
8104
+ e: n: for (t = e; ; ) {
8105
+ for (; null === t.sibling; ) {
8106
+ if (null === t.return || oo(t.return)) {
8107
+ t = null
8108
+ break e
8109
+ }
8110
+ t = t.return
8111
+ }
8112
+ for (
8113
+ t.sibling.return = t.return, t = t.sibling;
8114
+ 5 !== t.tag && 6 !== t.tag && 18 !== t.tag;
8115
+
8116
+ ) {
8117
+ if (2 & t.effectTag) continue n
8118
+ if (null === t.child || 4 === t.tag) continue n
8119
+ ;(t.child.return = t), (t = t.child)
8120
+ }
8121
+ if (!(2 & t.effectTag)) {
8122
+ t = t.stateNode
8123
+ break e
8124
+ }
8125
+ }
8126
+ a
8127
+ ? (function e(n, t, a) {
8128
+ var i = n.tag,
8129
+ s = 5 === i || 6 === i
8130
+ if (s)
8131
+ (n = s ? n.stateNode : n.stateNode.instance),
8132
+ t
8133
+ ? 8 === a.nodeType
8134
+ ? a.parentNode.insertBefore(n, t)
8135
+ : a.insertBefore(n, t)
8136
+ : (8 === a.nodeType
8137
+ ? (t =
8138
+ a.parentNode).insertBefore(
8139
+ n,
8140
+ a
8141
+ )
8142
+ : (t = a).appendChild(n),
8143
+ (null !==
8144
+ (a = a._reactRootContainer) &&
8145
+ void 0 !== a) ||
8146
+ null !== t.onclick ||
8147
+ (t.onclick = lt))
8148
+ else if (4 !== i && null !== (n = n.child))
8149
+ for (e(n, t, a), n = n.sibling; null !== n; )
8150
+ e(n, t, a), (n = n.sibling)
8151
+ })(e, t, n)
8152
+ : (function e(n, t, a) {
8153
+ var i = n.tag,
8154
+ s = 5 === i || 6 === i
8155
+ if (s)
8156
+ (n = s ? n.stateNode : n.stateNode.instance),
8157
+ t ? a.insertBefore(n, t) : a.appendChild(n)
8158
+ else if (4 !== i && null !== (n = n.child))
8159
+ for (e(n, t, a), n = n.sibling; null !== n; )
8160
+ e(n, t, a), (n = n.sibling)
8161
+ })(e, t, n)
8162
+ }
8163
+ function lo(e, n, t) {
8164
+ for (var a, i, s = n, o = !1; ; ) {
8165
+ if (!o) {
8166
+ o = s.return
8167
+ e: for (;;) {
8168
+ if (null === o) throw Error(r(160))
8169
+ switch (((a = o.stateNode), o.tag)) {
8170
+ case 5:
8171
+ i = !1
8172
+ break e
8173
+ case 3:
8174
+ case 4:
8175
+ ;(a = a.containerInfo), (i = !0)
8176
+ break e
8177
+ }
8178
+ o = o.return
8179
+ }
8180
+ o = !0
8181
+ }
8182
+ if (5 === s.tag || 6 === s.tag) {
8183
+ e: for (var c = e, l = s, p = t, f = l; ; )
8184
+ if ((so(c, f, p), null !== f.child && 4 !== f.tag))
8185
+ (f.child.return = f), (f = f.child)
8186
+ else {
8187
+ if (f === l) break e
8188
+ for (; null === f.sibling; ) {
8189
+ if (null === f.return || f.return === l)
8190
+ break e
8191
+ f = f.return
8192
+ }
8193
+ ;(f.sibling.return = f.return), (f = f.sibling)
8194
+ }
8195
+ i
8196
+ ? ((c = a),
8197
+ (l = s.stateNode),
8198
+ 8 === c.nodeType
8199
+ ? c.parentNode.removeChild(l)
8200
+ : c.removeChild(l))
8201
+ : a.removeChild(s.stateNode)
8202
+ } else if (4 === s.tag) {
8203
+ if (null !== s.child) {
8204
+ ;(a = s.stateNode.containerInfo),
8205
+ (i = !0),
8206
+ (s.child.return = s),
8207
+ (s = s.child)
8208
+ continue
8209
+ }
8210
+ } else if ((so(e, s, t), null !== s.child)) {
8211
+ ;(s.child.return = s), (s = s.child)
8212
+ continue
8213
+ }
8214
+ if (s === n) break
8215
+ for (; null === s.sibling; ) {
8216
+ if (null === s.return || s.return === n) return
8217
+ 4 === (s = s.return).tag && (o = !1)
8218
+ }
8219
+ ;(s.sibling.return = s.return), (s = s.sibling)
8220
+ }
8221
+ }
8222
+ function po(e, n) {
8223
+ switch (n.tag) {
8224
+ case 0:
8225
+ case 11:
8226
+ case 14:
8227
+ case 15:
8228
+ case 22:
8229
+ return void to(3, n)
8230
+ case 1:
8231
+ return
8232
+ case 5:
8233
+ var t = n.stateNode
8234
+ if (null != t) {
8235
+ var a = n.memoizedProps,
8236
+ i = null !== e ? e.memoizedProps : a
8237
+ e = n.type
8238
+ var s = n.updateQueue
8239
+ if (((n.updateQueue = null), null !== s)) {
8240
+ for (
8241
+ t[Ct] = a,
8242
+ 'input' === e &&
8243
+ 'radio' === a.type &&
8244
+ null != a.name &&
8245
+ Ee(t, a),
8246
+ rt(e, i),
8247
+ n = rt(e, a),
8248
+ i = 0;
8249
+ i < s.length;
8250
+ i += 2
8251
+ ) {
8252
+ var o = s[i],
8253
+ c = s[i + 1]
8254
+ 'style' === o
8255
+ ? at(t, c)
8256
+ : 'dangerouslySetInnerHTML' === o
8257
+ ? je(t, c)
8258
+ : 'children' === o
8259
+ ? De(t, c)
8260
+ : Z(t, o, c, n)
8261
+ }
8262
+ switch (e) {
8263
+ case 'input':
8264
+ Ce(t, a)
8265
+ break
8266
+ case 'textarea':
8267
+ Me(t, a)
8268
+ break
8269
+ case 'select':
8270
+ ;(n = t._wrapperState.wasMultiple),
8271
+ (t._wrapperState.wasMultiple = !!a.multiple),
8272
+ null != (e = a.value)
8273
+ ? Te(t, !!a.multiple, e, !1)
8274
+ : n !== !!a.multiple &&
8275
+ (null != a.defaultValue
8276
+ ? Te(
8277
+ t,
8278
+ !!a.multiple,
8279
+ a.defaultValue,
8280
+ !0
8281
+ )
8282
+ : Te(
8283
+ t,
8284
+ !!a.multiple,
8285
+ a.multiple
8286
+ ? []
8287
+ : '',
8288
+ !1
8289
+ ))
8290
+ }
8291
+ }
8292
+ }
8293
+ return
8294
+ case 6:
8295
+ if (null === n.stateNode) throw Error(r(162))
8296
+ return void (n.stateNode.nodeValue = n.memoizedProps)
8297
+ case 3:
8298
+ return void (
8299
+ (n = n.stateNode).hydrate &&
8300
+ ((n.hydrate = !1), Ln(n.containerInfo))
8301
+ )
8302
+ case 12:
8303
+ return
8304
+ case 13:
8305
+ if (
8306
+ ((t = n),
8307
+ null === n.memoizedState
8308
+ ? (a = !1)
8309
+ : ((a = !0), (t = n.child), (Io = ji())),
8310
+ null !== t)
8311
+ )
8312
+ e: for (e = t; ; ) {
8313
+ if (5 === e.tag)
8314
+ (s = e.stateNode),
8315
+ a
8316
+ ? 'function' ==
8317
+ typeof (s = s.style).setProperty
8318
+ ? s.setProperty(
8319
+ 'display',
8320
+ 'none',
8321
+ 'important'
8322
+ )
8323
+ : (s.display = 'none')
8324
+ : ((s = e.stateNode),
8325
+ (i =
8326
+ null !=
8327
+ (i =
8328
+ e.memoizedProps
8329
+ .style) &&
8330
+ i.hasOwnProperty('display')
8331
+ ? i.display
8332
+ : null),
8333
+ (s.style.display = tt(
8334
+ 'display',
8335
+ i
8336
+ )))
8337
+ else if (6 === e.tag)
8338
+ e.stateNode.nodeValue = a
8339
+ ? ''
8340
+ : e.memoizedProps
8341
+ else {
8342
+ if (
8343
+ 13 === e.tag &&
8344
+ null !== e.memoizedState &&
8345
+ null === e.memoizedState.dehydrated
8346
+ ) {
8347
+ ;((s = e.child.sibling).return = e),
8348
+ (e = s)
8349
+ continue
8350
+ }
8351
+ if (null !== e.child) {
8352
+ ;(e.child.return = e), (e = e.child)
8353
+ continue
8354
+ }
8355
+ }
8356
+ if (e === t) break
8357
+ for (; null === e.sibling; ) {
8358
+ if (null === e.return || e.return === t)
8359
+ break e
8360
+ e = e.return
8361
+ }
8362
+ ;(e.sibling.return = e.return), (e = e.sibling)
8363
+ }
8364
+ return void fo(n)
8365
+ case 19:
8366
+ return void fo(n)
8367
+ case 17:
8368
+ return
8369
+ }
8370
+ throw Error(r(163))
8371
+ }
8372
+ function fo(e) {
8373
+ var n = e.updateQueue
8374
+ if (null !== n) {
8375
+ e.updateQueue = null
8376
+ var t = e.stateNode
8377
+ null === t && (t = e.stateNode = new Gr()),
8378
+ n.forEach(function (n) {
8379
+ var a = bc.bind(null, e, n)
8380
+ t.has(n) || (t.add(n), n.then(a, a))
8381
+ })
8382
+ }
8383
+ }
8384
+ var uo = 'function' == typeof WeakMap ? WeakMap : Map
8385
+ function go(e, n, t) {
8386
+ ;((t = os(t, null)).tag = 3), (t.payload = { element: null })
8387
+ var a = n.value
8388
+ return (
8389
+ (t.callback = function () {
8390
+ zo || ((zo = !0), (Lo = a)), Jr(e, n)
8391
+ }),
8392
+ t
8393
+ )
8394
+ }
8395
+ function mo(e, n, t) {
8396
+ ;(t = os(t, null)).tag = 3
8397
+ var a = e.type.getDerivedStateFromError
8398
+ if ('function' == typeof a) {
8399
+ var i = n.value
8400
+ t.payload = function () {
8401
+ return Jr(e, n), a(i)
8402
+ }
8403
+ }
8404
+ var s = e.stateNode
8405
+ return (
8406
+ null !== s &&
8407
+ 'function' == typeof s.componentDidCatch &&
8408
+ (t.callback = function () {
8409
+ 'function' != typeof a &&
8410
+ (null === Uo
8411
+ ? (Uo = new Set([this]))
8412
+ : Uo.add(this),
8413
+ Jr(e, n))
8414
+ var t = n.stack
8415
+ this.componentDidCatch(n.value, {
8416
+ componentStack: null !== t ? t : '',
8417
+ })
8418
+ }),
8419
+ t
8420
+ )
8421
+ }
8422
+ var ho,
8423
+ Ao = Math.ceil,
8424
+ ko = K.ReactCurrentDispatcher,
8425
+ yo = K.ReactCurrentOwner,
8426
+ bo = 0,
8427
+ _o = 3,
8428
+ vo = 4,
8429
+ wo = 0,
8430
+ Eo = null,
8431
+ Co = null,
8432
+ xo = 0,
8433
+ Bo = bo,
8434
+ So = null,
8435
+ To = 1073741823,
8436
+ Po = 1073741823,
8437
+ No = null,
8438
+ Mo = 0,
8439
+ qo = !1,
8440
+ Io = 0,
8441
+ Oo = null,
8442
+ zo = !1,
8443
+ Lo = null,
8444
+ Uo = null,
8445
+ jo = !1,
8446
+ Do = null,
8447
+ Fo = 90,
8448
+ Ro = null,
8449
+ Yo = 0,
8450
+ Qo = null,
8451
+ Wo = 0
8452
+ function Vo() {
8453
+ return 0 != (48 & wo)
8454
+ ? 1073741821 - ((ji() / 10) | 0)
8455
+ : 0 !== Wo
8456
+ ? Wo
8457
+ : (Wo = 1073741821 - ((ji() / 10) | 0))
8458
+ }
8459
+ function Ho(e, n, t) {
8460
+ if (0 == (2 & (n = n.mode))) return 1073741823
8461
+ var a = Di()
8462
+ if (0 == (4 & n)) return 99 === a ? 1073741823 : 1073741822
8463
+ if (0 != (16 & wo)) return xo
8464
+ if (null !== t) e = Hi(e, 0 | t.timeoutMs || 5e3, 250)
8465
+ else
8466
+ switch (a) {
8467
+ case 99:
8468
+ e = 1073741823
8469
+ break
8470
+ case 98:
8471
+ e = Hi(e, 150, 100)
8472
+ break
8473
+ case 97:
8474
+ case 96:
8475
+ e = Hi(e, 5e3, 250)
8476
+ break
8477
+ case 95:
8478
+ e = 2
8479
+ break
8480
+ default:
8481
+ throw Error(r(326))
8482
+ }
8483
+ return null !== Eo && e === xo && --e, e
8484
+ }
8485
+ function $o(e, n) {
8486
+ if (50 < Yo) throw ((Yo = 0), (Qo = null), Error(r(185)))
8487
+ if (null !== (e = Xo(e, n))) {
8488
+ var t = Di()
8489
+ 1073741823 === n
8490
+ ? 0 != (8 & wo) && 0 == (48 & wo)
8491
+ ? Jo(e)
8492
+ : (Zo(e), 0 === wo && Wi())
8493
+ : Zo(e),
8494
+ 0 == (4 & wo) ||
8495
+ (98 !== t && 99 !== t) ||
8496
+ (null === Ro
8497
+ ? (Ro = new Map([[e, n]]))
8498
+ : (void 0 === (t = Ro.get(e)) || t > n) &&
8499
+ Ro.set(e, n))
8500
+ }
8501
+ }
8502
+ function Xo(e, n) {
8503
+ e.expirationTime < n && (e.expirationTime = n)
8504
+ var t = e.alternate
8505
+ null !== t && t.expirationTime < n && (t.expirationTime = n)
8506
+ var a = e.return,
8507
+ i = null
8508
+ if (null === a && 3 === e.tag) i = e.stateNode
8509
+ else
8510
+ for (; null !== a; ) {
8511
+ if (
8512
+ ((t = a.alternate),
8513
+ a.childExpirationTime < n &&
8514
+ (a.childExpirationTime = n),
8515
+ null !== t &&
8516
+ t.childExpirationTime < n &&
8517
+ (t.childExpirationTime = n),
8518
+ null === a.return && 3 === a.tag)
8519
+ ) {
8520
+ i = a.stateNode
8521
+ break
8522
+ }
8523
+ a = a.return
8524
+ }
8525
+ return (
8526
+ null !== i &&
8527
+ (Eo === i && (rc(n), Bo === vo && qc(i, xo)), Ic(i, n)),
8528
+ i
8529
+ )
8530
+ }
8531
+ function Ko(e) {
8532
+ var n = e.lastExpiredTime
8533
+ if (0 !== n) return n
8534
+ if (!Mc(e, (n = e.firstPendingTime))) return n
8535
+ var t = e.lastPingedTime
8536
+ return 2 >= (e = t > (e = e.nextKnownPendingLevel) ? t : e) &&
8537
+ n !== e
8538
+ ? 0
8539
+ : e
8540
+ }
8541
+ function Zo(e) {
8542
+ if (0 !== e.lastExpiredTime)
8543
+ (e.callbackExpirationTime = 1073741823),
8544
+ (e.callbackPriority = 99),
8545
+ (e.callbackNode = Qi(Jo.bind(null, e)))
8546
+ else {
8547
+ var n = Ko(e),
8548
+ t = e.callbackNode
8549
+ if (0 === n)
8550
+ null !== t &&
8551
+ ((e.callbackNode = null),
8552
+ (e.callbackExpirationTime = 0),
8553
+ (e.callbackPriority = 90))
8554
+ else {
8555
+ var a = Vo()
8556
+ if (
8557
+ (1073741823 === n
8558
+ ? (a = 99)
8559
+ : 1 === n || 2 === n
8560
+ ? (a = 95)
8561
+ : (a =
8562
+ 0 >=
8563
+ (a =
8564
+ 10 * (1073741821 - n) -
8565
+ 10 * (1073741821 - a))
8566
+ ? 99
8567
+ : 250 >= a
8568
+ ? 98
8569
+ : 5250 >= a
8570
+ ? 97
8571
+ : 95),
8572
+ null !== t)
8573
+ ) {
8574
+ var i = e.callbackPriority
8575
+ if (e.callbackExpirationTime === n && i >= a) return
8576
+ t !== Mi && wi(t)
8577
+ }
8578
+ ;(e.callbackExpirationTime = n),
8579
+ (e.callbackPriority = a),
8580
+ (n =
8581
+ 1073741823 === n
8582
+ ? Qi(Jo.bind(null, e))
8583
+ : Yi(a, Go.bind(null, e), {
8584
+ timeout:
8585
+ 10 * (1073741821 - n) - ji(),
8586
+ })),
8587
+ (e.callbackNode = n)
8588
+ }
8589
+ }
8590
+ }
8591
+ function Go(e, n) {
8592
+ if (((Wo = 0), n)) return Oc(e, (n = Vo())), Zo(e), null
8593
+ var t = Ko(e)
8594
+ if (0 !== t) {
8595
+ if (((n = e.callbackNode), 0 != (48 & wo)))
8596
+ throw Error(r(327))
8597
+ if (
8598
+ (mc(), (e === Eo && t === xo) || tc(e, t), null !== Co)
8599
+ ) {
8600
+ var a = wo
8601
+ wo |= 16
8602
+ for (var i = ic(); ; )
8603
+ try {
8604
+ cc()
8605
+ break
8606
+ } catch (n) {
8607
+ ac(e, n)
8608
+ }
8609
+ if ((Ji(), (wo = a), (ko.current = i), 1 === Bo))
8610
+ throw ((n = So), tc(e, t), qc(e, t), Zo(e), n)
8611
+ if (null === Co)
8612
+ switch (
8613
+ ((i = e.finishedWork = e.current.alternate),
8614
+ (e.finishedExpirationTime = t),
8615
+ (a = Bo),
8616
+ (Eo = null),
8617
+ a)
8618
+ ) {
8619
+ case bo:
8620
+ case 1:
8621
+ throw Error(r(345))
8622
+ case 2:
8623
+ Oc(e, 2 < t ? 2 : t)
8624
+ break
8625
+ case _o:
8626
+ if (
8627
+ (qc(e, t),
8628
+ t === (a = e.lastSuspendedTime) &&
8629
+ (e.nextKnownPendingLevel = fc(i)),
8630
+ 1073741823 === To &&
8631
+ 10 < (i = Io + 500 - ji()))
8632
+ ) {
8633
+ if (qo) {
8634
+ var s = e.lastPingedTime
8635
+ if (0 === s || s >= t) {
8636
+ ;(e.lastPingedTime = t),
8637
+ tc(e, t)
8638
+ break
8639
+ }
8640
+ }
8641
+ if (0 !== (s = Ko(e)) && s !== t) break
8642
+ if (0 !== a && a !== t) {
8643
+ e.lastPingedTime = a
8644
+ break
8645
+ }
8646
+ e.timeoutHandle = yt(
8647
+ uc.bind(null, e),
8648
+ i
8649
+ )
8650
+ break
8651
+ }
8652
+ uc(e)
8653
+ break
8654
+ case vo:
8655
+ if (
8656
+ (qc(e, t),
8657
+ t === (a = e.lastSuspendedTime) &&
8658
+ (e.nextKnownPendingLevel = fc(i)),
8659
+ qo &&
8660
+ (0 === (i = e.lastPingedTime) ||
8661
+ i >= t))
8662
+ ) {
8663
+ ;(e.lastPingedTime = t), tc(e, t)
8664
+ break
8665
+ }
8666
+ if (0 !== (i = Ko(e)) && i !== t) break
8667
+ if (0 !== a && a !== t) {
8668
+ e.lastPingedTime = a
8669
+ break
8670
+ }
8671
+ if (
8672
+ (1073741823 !== Po
8673
+ ? (a =
8674
+ 10 * (1073741821 - Po) -
8675
+ ji())
8676
+ : 1073741823 === To
8677
+ ? (a = 0)
8678
+ : ((a =
8679
+ 10 * (1073741821 - To) -
8680
+ 5e3),
8681
+ 0 > (a = (i = ji()) - a) &&
8682
+ (a = 0),
8683
+ (t = 10 * (1073741821 - t) - i) <
8684
+ (a =
8685
+ (120 > a
8686
+ ? 120
8687
+ : 480 > a
8688
+ ? 480
8689
+ : 1080 > a
8690
+ ? 1080
8691
+ : 1920 > a
8692
+ ? 1920
8693
+ : 3e3 > a
8694
+ ? 3e3
8695
+ : 4320 > a
8696
+ ? 4320
8697
+ : 1960 *
8698
+ Ao(a / 1960)) -
8699
+ a) && (a = t)),
8700
+ 10 < a)
8701
+ ) {
8702
+ e.timeoutHandle = yt(
8703
+ uc.bind(null, e),
8704
+ a
8705
+ )
8706
+ break
8707
+ }
8708
+ uc(e)
8709
+ break
8710
+ case 5:
8711
+ if (1073741823 !== To && null !== No) {
8712
+ s = To
8713
+ var o = No
8714
+ if (
8715
+ (0 >= (a = 0 | o.busyMinDurationMs)
8716
+ ? (a = 0)
8717
+ : ((i = 0 | o.busyDelayMs),
8718
+ (a =
8719
+ (s =
8720
+ ji() -
8721
+ (10 *
8722
+ (1073741821 -
8723
+ s) -
8724
+ (0 |
8725
+ o.timeoutMs ||
8726
+ 5e3))) <= i
8727
+ ? 0
8728
+ : i + a - s)),
8729
+ 10 < a)
8730
+ ) {
8731
+ qc(e, t),
8732
+ (e.timeoutHandle = yt(
8733
+ uc.bind(null, e),
8734
+ a
8735
+ ))
8736
+ break
8737
+ }
8738
+ }
8739
+ uc(e)
8740
+ break
8741
+ default:
8742
+ throw Error(r(329))
8743
+ }
8744
+ if ((Zo(e), e.callbackNode === n))
8745
+ return Go.bind(null, e)
8746
+ }
8747
+ }
8748
+ return null
8749
+ }
8750
+ function Jo(e) {
8751
+ var n = e.lastExpiredTime
8752
+ if (((n = 0 !== n ? n : 1073741823), 0 != (48 & wo)))
8753
+ throw Error(r(327))
8754
+ if ((mc(), (e === Eo && n === xo) || tc(e, n), null !== Co)) {
8755
+ var t = wo
8756
+ wo |= 16
8757
+ for (var a = ic(); ; )
8758
+ try {
8759
+ oc()
8760
+ break
8761
+ } catch (n) {
8762
+ ac(e, n)
8763
+ }
8764
+ if ((Ji(), (wo = t), (ko.current = a), 1 === Bo))
8765
+ throw ((t = So), tc(e, n), qc(e, n), Zo(e), t)
8766
+ if (null !== Co) throw Error(r(261))
8767
+ ;(e.finishedWork = e.current.alternate),
8768
+ (e.finishedExpirationTime = n),
8769
+ (Eo = null),
8770
+ uc(e),
8771
+ Zo(e)
8772
+ }
8773
+ return null
8774
+ }
8775
+ function ec(e, n) {
8776
+ var t = wo
8777
+ wo |= 1
8778
+ try {
8779
+ return e(n)
8780
+ } finally {
8781
+ 0 === (wo = t) && Wi()
8782
+ }
8783
+ }
8784
+ function nc(e, n) {
8785
+ var t = wo
8786
+ ;(wo &= -2), (wo |= 8)
8787
+ try {
8788
+ return e(n)
8789
+ } finally {
8790
+ 0 === (wo = t) && Wi()
8791
+ }
8792
+ }
8793
+ function tc(e, n) {
8794
+ ;(e.finishedWork = null), (e.finishedExpirationTime = 0)
8795
+ var t = e.timeoutHandle
8796
+ if ((-1 !== t && ((e.timeoutHandle = -1), bt(t)), null !== Co))
8797
+ for (t = Co.return; null !== t; ) {
8798
+ var a = t
8799
+ switch (a.tag) {
8800
+ case 1:
8801
+ null != (a = a.type.childContextTypes) && hi()
8802
+ break
8803
+ case 3:
8804
+ Ms(), ci(ui), ci(fi)
8805
+ break
8806
+ case 5:
8807
+ Is(a)
8808
+ break
8809
+ case 4:
8810
+ Ms()
8811
+ break
8812
+ case 13:
8813
+ case 19:
8814
+ ci(Os)
8815
+ break
8816
+ case 10:
8817
+ es(a)
8818
+ }
8819
+ t = t.return
8820
+ }
8821
+ ;(Eo = e),
8822
+ (Co = xc(e.current, null)),
8823
+ (xo = n),
8824
+ (Bo = bo),
8825
+ (So = null),
8826
+ (Po = To = 1073741823),
8827
+ (No = null),
8828
+ (Mo = 0),
8829
+ (qo = !1)
8830
+ }
8831
+ function ac(e, n) {
8832
+ for (;;) {
8833
+ try {
8834
+ if ((Ji(), (Us.current = mr), Qs))
8835
+ for (var t = Fs.memoizedState; null !== t; ) {
8836
+ var a = t.queue
8837
+ null !== a && (a.pending = null), (t = t.next)
8838
+ }
8839
+ if (
8840
+ ((Ds = 0),
8841
+ (Ys = Rs = Fs = null),
8842
+ (Qs = !1),
8843
+ null === Co || null === Co.return)
8844
+ )
8845
+ return (Bo = 1), (So = n), (Co = null)
8846
+ e: {
8847
+ var i = e,
8848
+ s = Co.return,
8849
+ r = Co,
8850
+ o = n
8851
+ if (
8852
+ ((n = xo),
8853
+ (r.effectTag |= 2048),
8854
+ (r.firstEffect = r.lastEffect = null),
8855
+ null !== o &&
8856
+ 'object' == typeof o &&
8857
+ 'function' == typeof o.then)
8858
+ ) {
8859
+ var c = o
8860
+ if (0 == (2 & r.mode)) {
8861
+ var l = r.alternate
8862
+ l
8863
+ ? ((r.updateQueue = l.updateQueue),
8864
+ (r.memoizedState = l.memoizedState),
8865
+ (r.expirationTime = l.expirationTime))
8866
+ : ((r.updateQueue = null),
8867
+ (r.memoizedState = null))
8868
+ }
8869
+ var p = 0 != (1 & Os.current),
8870
+ f = s
8871
+ do {
8872
+ var u
8873
+ if ((u = 13 === f.tag)) {
8874
+ var d = f.memoizedState
8875
+ if (null !== d)
8876
+ u = null !== d.dehydrated
8877
+ else {
8878
+ var g = f.memoizedProps
8879
+ u =
8880
+ void 0 !== g.fallback &&
8881
+ (!0 !==
8882
+ g.unstable_avoidThisFallback ||
8883
+ !p)
8884
+ }
8885
+ }
8886
+ if (u) {
8887
+ var m = f.updateQueue
8888
+ if (null === m) {
8889
+ var h = new Set()
8890
+ h.add(c), (f.updateQueue = h)
8891
+ } else m.add(c)
8892
+ if (0 == (2 & f.mode)) {
8893
+ if (
8894
+ ((f.effectTag |= 64),
8895
+ (r.effectTag &= -2981),
8896
+ 1 === r.tag)
8897
+ )
8898
+ if (null === r.alternate)
8899
+ r.tag = 17
8900
+ else {
8901
+ var A = os(1073741823, null)
8902
+ ;(A.tag = 2), cs(r, A)
8903
+ }
8904
+ r.expirationTime = 1073741823
8905
+ break e
8906
+ }
8907
+ ;(o = void 0), (r = n)
8908
+ var k = i.pingCache
8909
+ if (
8910
+ (null === k
8911
+ ? ((k = i.pingCache = new uo()),
8912
+ (o = new Set()),
8913
+ k.set(c, o))
8914
+ : voi