Gutenberg Blocks – ACF Blocks Suite - Version 2.6.5

Version Description

  • Improved: Library
Download this release

Release Info

Developer munirkamal
Plugin Icon 128x128 Gutenberg Blocks – ACF Blocks Suite
Version 2.6.5
Comparing to
See all releases

Code changes from version 2.6.4 to 2.6.5

acf-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
- * Version: 2.6.4
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
+ * Version: 2.6.5
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
extendify-sdk/bootstrap.php CHANGED
@@ -20,6 +20,7 @@ if (is_readable(EXTENDIFYSDK_PATH . 'vendor/autoload.php')) {
20
  $extendifysdkAdmin = new Admin();
21
 
22
  require EXTENDIFYSDK_PATH . 'routes/api.php';
 
23
 
24
 
25
  \add_action(
20
  $extendifysdkAdmin = new Admin();
21
 
22
  require EXTENDIFYSDK_PATH . 'routes/api.php';
23
+ require EXTENDIFYSDK_PATH . 'editorplus/EditorPlus.php';
24
 
25
 
26
  \add_action(
extendify-sdk/editorplus/EditorPlus.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles editor related changes.
4
+ */
5
+
6
+ if (!class_exists('edpl__EditorPlus')) {
7
+ // phpcs:ignore Squiz.Classes.ClassFileName.NoMatch,Squiz.Commenting.ClassComment.Missing,PEAR.Commenting.ClassComment.Missing
8
+ final class ExtendifySdkEditorPlus
9
+ {
10
+
11
+ /**
12
+ * A reference to an instance of this class.
13
+ *
14
+ * @var $instance
15
+ */
16
+ public static $instance;
17
+
18
+ /**
19
+ * The array of templates that this plugin tracks.
20
+ *
21
+ * @var array $templates
22
+ */
23
+ protected $templates;
24
+
25
+ /**
26
+ * Returns an instance of this class.
27
+ *
28
+ * @return self
29
+ */
30
+ public static function getInstance()
31
+ {
32
+ if (is_null(self::$instance)) {
33
+ self::$instance = new ExtendifySdkEditorPlus();
34
+ }
35
+
36
+ return self::$instance;
37
+ }
38
+
39
+ /**
40
+ * Initializes the plugin by setting filters and administration functions.
41
+ */
42
+ public function __construct()
43
+ {
44
+ if ($this->isSupported()) {
45
+ $this->templates = [];
46
+
47
+ \add_action(
48
+ 'admin_enqueue_scripts',
49
+ function () {
50
+ // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion
51
+ \wp_enqueue_script(
52
+ 'extendifysdk-editorplus-scripts',
53
+ EXTENDIFYSDK_BASE_URL . 'public/editorplus/editorplus.min.js',
54
+ [],
55
+ false,
56
+ true
57
+ );
58
+ }
59
+ );
60
+
61
+ add_action('wp_head', [$this, 'enqueueStylesheet']);
62
+
63
+ add_filter(
64
+ 'theme_page_templates',
65
+ [
66
+ $this,
67
+ 'addNewTemplate',
68
+ ]
69
+ );
70
+
71
+ // Add a filter to the save post to inject out template into the page cache.
72
+ add_filter(
73
+ 'wp_insert_post_data',
74
+ [
75
+ $this,
76
+ 'registerProjectTemplates',
77
+ ]
78
+ );
79
+ // Add a filter to the template include to determine if the page has our template assigned and return it's path.
80
+ add_filter(
81
+ 'template_include',
82
+ [
83
+ $this,
84
+ 'viewProjectTemplate',
85
+ ]
86
+ );
87
+
88
+ $this->templates = ['editorplus-template.php' => 'Extendify Template'];
89
+ add_filter(
90
+ 'body_class',
91
+ function ($classes) {
92
+ $classes[] = 'eplus_styles';
93
+ return $classes;
94
+ }
95
+ );
96
+
97
+ // Registering meta data to store editorplus generated stylesheet of template.
98
+ $postTypes = get_post_types(['_builtin' => false], 'names', 'and');
99
+ $postTypes['post'] = 'post';
100
+ foreach ($postTypes as $postType) {
101
+ register_meta(
102
+ $postType,
103
+ 'extendify_custom_stylesheet',
104
+ [
105
+ 'show_in_rest' => true,
106
+ 'single' => true,
107
+ 'type' => 'string',
108
+ 'default' => '',
109
+ ]
110
+ );
111
+ }
112
+ }//end if
113
+ }
114
+
115
+ /**
116
+ * Used to echo out page template stylesheet if the page template is not active.
117
+ *
118
+ * @return void
119
+ */
120
+ public function enqueueStylesheet()
121
+ {
122
+ if (!isset($GLOBALS['post']) || !$GLOBALS['post']) {
123
+ return;
124
+ }
125
+
126
+ $post = $GLOBALS['post'];
127
+ $cssContent = apply_filters(
128
+ 'extendifysdk_template_css',
129
+ get_post_meta($post->ID, 'extendify_custom_stylesheet', true),
130
+ $post
131
+ );
132
+
133
+ // Note that esc_html() cannot be used because `div &gt; span` is not interpreted properly.
134
+ // See: https://github.com/WordPress/WordPress/blob/ccdb1766aead26d4cef79badb015bb2727fefd59/wp-includes/theme.php#L1824-L1833 for reference.
135
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
136
+ echo "<style id='extendify-custom-stylesheet' type='text/css'>" . wp_strip_all_tags($cssContent) . '</style>';
137
+ }
138
+
139
+ /**
140
+ * Will check if page templates are supported in the installed wp version.
141
+ *
142
+ * @return bool
143
+ */
144
+ public function isSupported()
145
+ {
146
+ return version_compare(floatval(get_bloginfo('version')), '4.7', '>');
147
+ }
148
+
149
+ /**
150
+ * Adds our template to the page dropdown for v4.7+
151
+ *
152
+ * @param array $postsTemplates - Array of page templates.
153
+ * @return array
154
+ */
155
+ public function addNewTemplate($postsTemplates)
156
+ {
157
+ return array_merge($postsTemplates, $this->templates);
158
+ }
159
+
160
+ /**
161
+ * Adds our template to the pages cache in order to trick WordPress,
162
+ * into thinking the template file exists where it doens't really exist.
163
+ *
164
+ * @param array $attributes - The attributes.
165
+ * @return array
166
+ */
167
+ public function registerProjectTemplates($attributes)
168
+ {
169
+ // Create the key used for the themes cache.
170
+ $cacheKey = 'page_templates-' . md5(get_theme_root() . '/' . get_stylesheet());
171
+ // Retrieve the cache list.
172
+ // If it doesn't exist, or it's empty prepare an array.
173
+ $templates = wp_get_theme()->get_page_templates();
174
+ if (empty($templates)) {
175
+ $templates = [];
176
+ }
177
+
178
+ // New cache, therefore remove the old one.
179
+ wp_cache_delete($cacheKey, 'themes');
180
+ // Now add our template to the list of templates by merging our templates.
181
+ // with the existing templates array from the cache.
182
+ $templates = array_merge($templates, $this->templates);
183
+ // Add the modified cache to allow WordPress to pick it up for listing available templates.
184
+ wp_cache_add($cacheKey, $templates, 'themes', 1800);
185
+ return $attributes;
186
+ }
187
+
188
+ /**
189
+ * Checks if the template is assigned to the page.
190
+ *
191
+ * @param string $template - The template.
192
+ * @return string
193
+ */
194
+ public function viewProjectTemplate($template)
195
+ {
196
+ $post = $GLOBALS['post'];
197
+ if (!$post) {
198
+ return $template;
199
+ }
200
+
201
+ // Return default template if we don't have a custom one defined.
202
+ if (!isset($this->templates[get_post_meta($post->ID, '_wp_page_template', true)])) {
203
+ return $template;
204
+ }
205
+
206
+ $file = plugin_dir_path(__FILE__) . get_post_meta(
207
+ $post->ID,
208
+ '_wp_page_template',
209
+ true
210
+ );
211
+
212
+ // Just to be safe, we check if the file exist first.
213
+ if (file_exists($file)) {
214
+ return $file;
215
+ }
216
+
217
+ return $template;
218
+ }
219
+ // phpcs:ignore Squiz.Classes.ClassDeclaration.SpaceBeforeCloseBrace
220
+ }
221
+
222
+ add_action('after_setup_theme', ['ExtendifySdkEditorPlus', 'getInstance']);
223
+ }//end if
extendify-sdk/editorplus/editorplus-template.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Name: Extendify Template
4
+ * Template Post Type: post, page
5
+ */
6
+
7
+ $extendifysdkCustomStyles = get_post_meta(
8
+ isset($GLOBALS['post']) ? $GLOBALS['post']->ID : 0,
9
+ 'extendify_custom_stylesheet',
10
+ true
11
+ );
12
+
13
+ ?>
14
+ <?php wp_head(); ?>
15
+ <body <?php body_class(); ?>>
16
+ <div class="ep-temp-container ep-container">
17
+
18
+ <div class="ep-temp-entry-content">
19
+ <?php
20
+ if (have_posts()) {
21
+ while (have_posts()) {
22
+ the_post();
23
+ the_content();
24
+ }
25
+ }
26
+ ?>
27
+
28
+ </div>
29
+
30
+
31
+ </div><!-- #site-content -->
32
+ <style>
33
+ .ep-temp-container {
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ min-width: 1280px;
37
+ }
38
+ .ep-temp-container .alignfull {
39
+ min-width: 1280px !important;
40
+ }
41
+ @media(min-width: 700px) {
42
+ .ep-temp-container [class*=extendify-] [class*=wp-block] > * {
43
+ margin-top: 0px;
44
+ }
45
+ .ep-temp-container [class*=wp-block] > * .wp-block-button__link {
46
+ border-radius: 0px !important;
47
+ }
48
+ .ep-temp-container .wp-block-image:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.aligncenter) {
49
+ margin-top:0px;
50
+ }
51
+ body {background-color: #fff;}
52
+ html, body {
53
+ font-size: 16px !important;
54
+ }
55
+ }
56
+ </style>
57
+ </body>
58
+
59
+ <?php
60
+ wp_footer();
extendify-sdk/editorplus/editorplus.js ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { select, dispatch } from '@wordpress/data'
2
+
3
+ /**
4
+ * Will check if the given CSSRule contains malicious 3rd party URL to secure against XSS
5
+ * @param {CSSRule} rule
6
+ * @return {boolean} isMalicious
7
+ */
8
+
9
+ function _hasMaliciousURL(rule) {
10
+
11
+ let isMalicious = false
12
+
13
+ if (!(rule instanceof CSSRule)) return false
14
+
15
+ // only allowing airtable API origin
16
+ let allowedOrigins = [ 'https://dl.airtable.com' ]
17
+
18
+ let urlRegex = /[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g
19
+
20
+ let matchedURLS = rule.cssText.match(urlRegex) ?? []
21
+
22
+ for (const requestURL of matchedURLS) {
23
+
24
+ try {
25
+ let parsedURL = new URL(requestURL)
26
+ let isNotAllowed = !allowedOrigins.includes(parsedURL.origin)
27
+
28
+ if (isNotAllowed) {
29
+ isMalicious = true
30
+ break
31
+ }
32
+ } catch (e) {
33
+
34
+ // verifying if the regex matched a URL, because regex can mess up due to URL in between other strings
35
+ let isUrl = ['https://', 'http://', '.com'].some(urlPart => requestURL.indexOf(urlPart) !== -1)
36
+ let isVerifiedOrigin = requestURL.indexOf(allowedOrigins[0]) !== -1
37
+
38
+ if (isUrl && !isVerifiedOrigin) {
39
+ isMalicious = true
40
+ break
41
+ }
42
+
43
+ }
44
+
45
+ }
46
+
47
+ return isMalicious
48
+ }
49
+
50
+ /**
51
+ * Will inject the given css as an stylesheet in the editor
52
+ * @param {string} css
53
+ * @return {void}
54
+ */
55
+
56
+ function injectStyleSheetInEditor(css = window.wp.data.select('core/editor').getEditedPostAttribute('meta')?.extendify_custom_stylesheet ?? '') {
57
+ if (typeof css !== 'string') return
58
+
59
+ css = css.replace(/(.eplus_styles)/g, '')
60
+
61
+ let extendifyRoot = document.querySelector('#extendify-root')
62
+ let styleID = 'extendify-custom-stylesheet'
63
+
64
+ if (document.getElementById(styleID)) {
65
+ // stylesheet already exists
66
+ document.getElementById(styleID).innerHTML = css
67
+ } else {
68
+ let styleElement = document.createElement('style')
69
+
70
+ styleElement.id = styleID
71
+ styleElement.type = 'text/css'
72
+
73
+ styleElement.appendChild(document.createTextNode(css))
74
+ extendifyRoot.appendChild(styleElement)
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Will provide filtered css from the given sheet
80
+ * @param {CSSStyleSheet} sheet
81
+ * @param {string[]} prefix
82
+ * @return {string} css - filtered css
83
+ */
84
+
85
+ function filterStylesheetWithPrefix(sheet, allowedPrefixes) {
86
+ let filteredCSS = ''
87
+
88
+ let isPrefixed = selector => {
89
+ return allowedPrefixes.some(allowedPrefix => selector.startsWith(allowedPrefix))
90
+ }
91
+
92
+ for (const rule of sheet?.cssRules ?? []) {
93
+ // if it's a media rule we need to also process the nested rule list
94
+ if (rule instanceof CSSMediaRule) {
95
+
96
+ if (_hasMaliciousURL(rule)) continue
97
+
98
+ let processedMediaRule = rule?.cssRules ?? []
99
+ let rulesToDelete = [] // because deleting them in the loop can disturb the index
100
+
101
+ for (const mediaRuleIndex of Object.keys(processedMediaRule)) {
102
+ let mediaRule = mediaRuleIndex in processedMediaRule
103
+ ? processedMediaRule[mediaRuleIndex]
104
+ : {}
105
+
106
+ if (!isPrefixed(mediaRule.selectorText)) {
107
+ rulesToDelete.push(mediaRuleIndex)
108
+ }
109
+ }
110
+
111
+ for (const mediaRuleIndexToDelete of rulesToDelete) {
112
+ rule.deleteRule(mediaRuleIndexToDelete)
113
+ }
114
+
115
+ filteredCSS += rule.cssText
116
+ }
117
+
118
+ if (rule instanceof CSSStyleRule) {
119
+ if (_hasMaliciousURL(rule)) continue
120
+
121
+ filteredCSS += isPrefixed(rule.selectorText)
122
+ ? rule.cssText
123
+ : ''
124
+ }
125
+ }
126
+
127
+ return filteredCSS
128
+ }
129
+
130
+ /**
131
+ * Listener to enable page template
132
+ */
133
+ window._wpLoadBlockEditor && window.addEventListener('extendify-sdk::template-inserted', (event) => {
134
+ const { template } = event.detail
135
+ const wpTemplateName = 'editorplus-template.php'
136
+
137
+ // check if the instruction has command to enable page
138
+ if (!template?.fields?.instructions?.includes('enable_page_template')) {
139
+ return
140
+ }
141
+
142
+ // Get a list of templates from the editor
143
+ const selector = select('core/editor')
144
+ const availablePageTemplates = selector.getEditorSettings()?.availableTemplates ?? {}
145
+ if (!Object.keys(availablePageTemplates).includes(wpTemplateName)) {
146
+ return
147
+ }
148
+
149
+ // Finally, set the template
150
+ dispatch('core/editor').editPost({
151
+ template: wpTemplateName,
152
+ })
153
+ })
154
+
155
+ /**
156
+ * Listener to inject stylesheet
157
+ */
158
+ window._wpLoadBlockEditor && window.addEventListener('extendify-sdk::template-inserted', async (event) => {
159
+
160
+ // TODO: use better approach which does not use require additional network request
161
+
162
+ const { template } = event.detail
163
+ const stylesheetURL = template?.fields?.stylesheet ?? ''
164
+
165
+ if (!stylesheetURL) {
166
+ return
167
+ }
168
+
169
+ try {
170
+ let generatedCSS = await (await fetch(stylesheetURL)).text()
171
+ let appendedCSS = select('core/editor').getEditedPostAttribute('meta')?.extendify_custom_stylesheet ?? ''
172
+
173
+ let createdStyleElement = document.createElement('style')
174
+ let createdStyleID = 'extendify-stylesheet'
175
+
176
+ // webkit hack: appending stylesheet to let DOM process rules
177
+
178
+ createdStyleElement.id = createdStyleID
179
+ createdStyleElement.type = 'text/css'
180
+ createdStyleElement.appendChild(document.createTextNode(generatedCSS))
181
+
182
+ document.querySelector('#extendify-root').appendChild(createdStyleElement)
183
+
184
+ let processedStyleSheet = document.getElementById(createdStyleID)
185
+
186
+ // disabling the stylesheet
187
+ processedStyleSheet.sheet.disable = true
188
+
189
+ // accessing processed CSSStyleSheet
190
+ let filteredCSS = filterStylesheetWithPrefix(processedStyleSheet?.sheet, ['.extendify-', '.eplus_styles', '.eplus-', '[class*="extendify-"]', '[class*="extendify"]'])
191
+
192
+ // merging existing styles
193
+ filteredCSS += appendedCSS
194
+
195
+ // deleting the generated stylesheet
196
+ processedStyleSheet.parentNode.removeChild(processedStyleSheet)
197
+
198
+ // injecting the stylesheet to style the editor view
199
+ injectStyleSheetInEditor(filteredCSS)
200
+
201
+ // finally, updating the metadata
202
+ await dispatch('core/editor').editPost({
203
+ meta: {
204
+ extendify_custom_stylesheet: filteredCSS,
205
+ },
206
+ })
207
+
208
+ } catch (error) {
209
+ console.error(error)
210
+ }
211
+ })
212
+
213
+ // loading stylesheet in the editor after page load
214
+ window._wpLoadBlockEditor && window.wp.domReady(() => {
215
+ setTimeout(() => injectStyleSheetInEditor(), 0)
216
+ })
217
+
218
+ // Quick method to hide the title if the template is active
219
+ let extendifyCurrentPageTemplate
220
+ window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
221
+ // Nothing changed
222
+ if (extendifyCurrentPageTemplate && extendifyCurrentPageTemplate === window.wp.data.select('core/editor').getEditedPostAttribute('template')) {
223
+ return
224
+ }
225
+ const epTemplateSelected = window.wp.data.select('core/editor').getEditedPostAttribute('template') === 'editorplus-template.php'
226
+ const title = document.querySelector('.edit-post-visual-editor__post-title-wrapper')
227
+ const wrapper = document.querySelector('.editor-styles-wrapper')
228
+
229
+ // Too early
230
+ if (!title || !wrapper) {
231
+ return
232
+ }
233
+
234
+ if (epTemplateSelected) {
235
+ // GB needs to compute the height first
236
+ Promise.resolve().then(() => title.style.display = 'none')
237
+ wrapper.style.paddingTop = '0'
238
+ wrapper.style.backgroundColor = '#ffffff'
239
+ } else {
240
+ title.style.removeProperty('display')
241
+ wrapper.style.removeProperty('padding-top')
242
+ wrapper.style.removeProperty('background-color')
243
+ }
244
+ })
extendify-sdk/package.json CHANGED
@@ -7,7 +7,7 @@
7
  "watch": "npx mix watch",
8
  "lint": "eslint src/**/*.js",
9
  "lint-fix": "eslint src/**/*.js --fix",
10
- "tailwind-config-viewer": "tailwind-config-viewer -o"
11
  },
12
  "devDependencies": {
13
  "@babel/preset-react": "^7.13.13",
7
  "watch": "npx mix watch",
8
  "lint": "eslint src/**/*.js",
9
  "lint-fix": "eslint src/**/*.js --fix",
10
+ "tailwind-config-viewer": "tailwind-config-viewer -o"
11
  },
12
  "devDependencies": {
13
  "@babel/preset-react": "^7.13.13",
extendify-sdk/public/build/extendify-sdk.css CHANGED
@@ -1 +1 @@
1
- .extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem*var(--tw-space-x-reverse));margin-left:calc(0.25rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem*var(--tw-space-x-reverse));margin-left:calc(0.75rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem*var(--tw-space-x-reverse));margin-left:calc(0.375rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.extendify-sdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.extendify-sdk .focus\:not-sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.extendify-sdk .bg-transparent{background-color:transparent}.extendify-sdk .bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.extendify-sdk .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-50{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(240,240,240,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(224,224,224,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-900{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-lightest{--tw-bg-opacity:1;background-color:rgba(248,255,254,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-light{--tw-bg-opacity:1;background-color:rgba(231,248,245,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.extendify-sdk .group:hover .group-hover\:bg-transparent{background-color:transparent}.extendify-sdk .active\:bg-gray-900:active,.extendify-sdk .hover\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-opacity-30{--tw-bg-opacity:0.3}.extendify-sdk .border-transparent{border-color:transparent}.extendify-sdk .border-black{--tw-border-opacity:1;border-color:rgba(0,0,0,var(--tw-border-opacity))}.extendify-sdk .border-gray-200{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .border-gray-300{--tw-border-opacity:1;border-color:rgba(221,221,221,var(--tw-border-opacity))}.extendify-sdk .border-gray-900{--tw-border-opacity:1;border-color:rgba(30,30,30,var(--tw-border-opacity))}.extendify-sdk .border-extendify-main{--tw-border-opacity:1;border-color:rgba(0,129,96,var(--tw-border-opacity))}.extendify-sdk .border-wp-alert-red{--tw-border-opacity:1;border-color:rgba(204,24,24,var(--tw-border-opacity))}.extendify-sdk .group:hover .group-hover\:border-wp-theme-500{border-color:var(--wp-admin-theme-color)}.extendify-sdk .border-solid{border-style:solid}.extendify-sdk .border-0{border-width:0}.extendify-sdk .border{border-width:1px}.extendify-sdk .border-t-0{border-top-width:0}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .cursor-pointer{cursor:pointer}.extendify-sdk .block{display:block}.extendify-sdk .inline-block{display:inline-block}.extendify-sdk .inline{display:inline}.extendify-sdk .flex{display:flex}.extendify-sdk .inline-flex{display:inline-flex}.extendify-sdk .table{display:table}.extendify-sdk .grid{display:grid}.extendify-sdk .hidden{display:none}.extendify-sdk .flex-col{flex-direction:column}.extendify-sdk .items-start{align-items:flex-start}.extendify-sdk .items-end{align-items:flex-end}.extendify-sdk .items-center{align-items:center}.extendify-sdk .justify-items-center{justify-items:center}.extendify-sdk .justify-start{justify-content:flex-start}.extendify-sdk .justify-end{justify-content:flex-end}.extendify-sdk .justify-center{justify-content:center}.extendify-sdk .justify-between{justify-content:space-between}.extendify-sdk .flex-grow{flex-grow:1}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .h-16{height:4rem}.extendify-sdk .h-80{height:20rem}.extendify-sdk .h-auto{height:auto}.extendify-sdk .h-px{height:1px}.extendify-sdk .h-full{height:100%}.extendify-sdk .h-screen{height:100vh}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.extendify-sdk .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .my-2{margin-top:.5rem;margin-bottom:.5rem}.extendify-sdk .my-4{margin-top:1rem;margin-bottom:1rem}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .mb-1{margin-bottom:.25rem}.extendify-sdk .mr-2{margin-right:.5rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .-mt-1{margin-top:-.25rem}.extendify-sdk .-mt-2{margin-top:-.5rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-ml-px{margin-left:-1px}.extendify-sdk .max-w-lg{max-width:32rem}.extendify-sdk .max-w-xl{max-width:36rem}.extendify-sdk .max-w-full{max-width:100%}.extendify-sdk .max-w-screen-xl{max-width:1280px}.extendify-sdk .max-w-screen-4xl{max-width:1920px}.extendify-sdk .min-h-screen{min-height:100vh}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.extendify-sdk .opacity-0{opacity:0}.extendify-sdk .focus\:opacity-100:focus,.extendify-sdk .group:hover .group-hover\:opacity-100,.extendify-sdk .opacity-100{opacity:1}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .p-0{padding:0}.extendify-sdk .p-1{padding:.25rem}.extendify-sdk .p-3{padding:.75rem}.extendify-sdk .p-4{padding:1rem}.extendify-sdk .p-6{padding:1.5rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.extendify-sdk .py-0{padding-top:0;padding-bottom:0}.extendify-sdk .py-1{padding-top:.25rem;padding-bottom:.25rem}.extendify-sdk .py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .px-3{padding-left:.75rem;padding-right:.75rem}.extendify-sdk .px-4{padding-left:1rem;padding-right:1rem}.extendify-sdk .py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.extendify-sdk .pt-1{padding-top:.25rem}.extendify-sdk .pr-2{padding-right:.5rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pr-4{padding-right:1rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pl-6{padding-left:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .pt-20{padding-top:5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .static{position:static}.extendify-sdk .fixed{position:fixed}.extendify-sdk .absolute{position:absolute}.extendify-sdk .relative{position:relative}.extendify-sdk .sticky{position:sticky}.extendify-sdk .inset-0{top:0;right:0;bottom:0;left:0}.extendify-sdk .top-0{top:0}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .top-16{top:4rem}*{--tw-shadow:0 0 transparent}.extendify-sdk .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}*{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.extendify-sdk .focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.extendify-sdk .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .text-gray-900{--tw-text-opacity:1;color:rgba(30,30,30,var(--tw-text-opacity))}.extendify-sdk .text-extendify-main{--tw-text-opacity:1;color:rgba(0,129,96,var(--tw-text-opacity))}.extendify-sdk .text-wp-theme-500{color:var(--wp-admin-theme-color)}.extendify-sdk .text-wp-alert-red{--tw-text-opacity:1;color:rgba(204,24,24,var(--tw-text-opacity))}.extendify-sdk .hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .hover\:text-wp-theme-500:hover{color:var(--wp-admin-theme-color)}.extendify-sdk .focus\:text-blue-500:focus{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.extendify-sdk .active\:text-white:active{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .no-underline{text-decoration:none}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.extendify-sdk .w-32{width:8rem}.extendify-sdk .w-72{width:18rem}.extendify-sdk .w-96{width:24rem}.extendify-sdk .w-full{width:100%}.extendify-sdk .w-screen{width:100vw}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-20{z-index:20}.extendify-sdk .z-30{z-index:30}.extendify-sdk .z-50{z-index:50}.extendify-sdk .z-high{z-index:1000000}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.extendify-sdk .rotate-180{--tw-rotate:180deg}.extendify-sdk .-translate-x-3{--tw-translate-x:-0.75rem}.extendify-sdk .translate-x-full{--tw-translate-x:100%}.extendify-sdk .-translate-x-full{--tw-translate-x:-100%}.extendify-sdk .translate-y-0{--tw-translate-y:0px}.extendify-sdk .translate-y-4{--tw-translate-y:1rem}.extendify-sdk .translate-y-0\.5{--tw-translate-y:0.125rem}.extendify-sdk .-translate-y-full{--tw-translate-y:-100%}.extendify-sdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.extendify-sdk .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{box-sizing:border-box;border:0 solid #e5e7eb}.extendify-sdk .button-focus{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-focus:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.extendify-sdk .button-focus:focus{--tw-ring-color:var(--wp-admin-theme-color)}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.button-extendify-main:active,.button-extendify-main:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.button-extendify-main{cursor:pointer;padding:.375rem .75rem}.button-extendify-main,.button-extendify-main:active,.button-extendify-main:focus,.button-extendify-main:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-extendify-main{text-decoration:none;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.extendify-sdk .button-extendify-main{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-extendify-main:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .button-extendify-main:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .components-panel__body>.components-panel__body-title{border-bottom:1px solid #e0e0e0!important}@media (min-width:600px){.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:block{display:block}.extendify-sdk .sm\:flex{display:flex}.extendify-sdk .sm\:hidden{display:none}.extendify-sdk .sm\:h-auto{height:auto}.extendify-sdk .sm\:text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .sm\:text-3xl{font-size:2rem;line-height:2.5rem}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-top:1.5rem;margin-bottom:1.5rem}.extendify-sdk .sm\:mr-1{margin-right:.25rem}.extendify-sdk .sm\:mb-6{margin-bottom:1.5rem}.extendify-sdk .sm\:mb-12{margin-bottom:3rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.extendify-sdk .sm\:ml-px{margin-left:1px}.extendify-sdk .sm\:min-h-0{min-height:0}.extendify-sdk .sm\:opacity-0{opacity:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pl-12{padding-left:3rem}.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:w-56{width:14rem}.extendify-sdk .sm\:w-auto{width:auto}.extendify-sdk .sm\:w-full{width:100%}.extendify-sdk .sm\:translate-x-8{--tw-translate-x:2rem}.extendify-sdk .sm\:translate-y-5{--tw-translate-y:1.25rem}}@media (min-width:782px){.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:-mt-32{margin-top:-8rem}}@media (min-width:1080px){.extendify-sdk .lg\:divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-right-width:calc(2px*var(--tw-divide-x-reverse));border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)))}.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:flex-row{flex-direction:row}.extendify-sdk .lg\:items-center{align-items:center}.extendify-sdk .lg\:justify-between{justify-content:space-between}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:leading-none{line-height:1}.extendify-sdk .lg\:-mx-2{margin-left:-.5rem;margin-right:-.5rem}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:p-10{padding:2.5rem}.extendify-sdk .lg\:px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .lg\:pt-5{padding-top:1.25rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:w-72{width:18rem}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1440px){.extendify-sdk .\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
1
+ .extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem*var(--tw-space-x-reverse));margin-left:calc(0.25rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem*var(--tw-space-x-reverse));margin-left:calc(0.75rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem*var(--tw-space-x-reverse));margin-left:calc(0.375rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.extendify-sdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.extendify-sdk .focus\:not-sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.extendify-sdk .bg-transparent{background-color:transparent}.extendify-sdk .bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.extendify-sdk .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-50{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(240,240,240,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(224,224,224,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-900{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-lightest{--tw-bg-opacity:1;background-color:rgba(248,255,254,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-light{--tw-bg-opacity:1;background-color:rgba(231,248,245,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.extendify-sdk .group:hover .group-hover\:bg-transparent{background-color:transparent}.extendify-sdk .active\:bg-gray-900:active,.extendify-sdk .hover\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-opacity-30{--tw-bg-opacity:0.3}.extendify-sdk .border-transparent{border-color:transparent}.extendify-sdk .border-black{--tw-border-opacity:1;border-color:rgba(0,0,0,var(--tw-border-opacity))}.extendify-sdk .border-gray-200{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .border-gray-300{--tw-border-opacity:1;border-color:rgba(221,221,221,var(--tw-border-opacity))}.extendify-sdk .border-gray-900{--tw-border-opacity:1;border-color:rgba(30,30,30,var(--tw-border-opacity))}.extendify-sdk .border-extendify-main{--tw-border-opacity:1;border-color:rgba(0,129,96,var(--tw-border-opacity))}.extendify-sdk .border-wp-alert-red{--tw-border-opacity:1;border-color:rgba(204,24,24,var(--tw-border-opacity))}.extendify-sdk .group:hover .group-hover\:border-wp-theme-500{border-color:var(--wp-admin-theme-color)}.extendify-sdk .border-solid{border-style:solid}.extendify-sdk .border-0{border-width:0}.extendify-sdk .border{border-width:1px}.extendify-sdk .border-t-0{border-top-width:0}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .cursor-pointer{cursor:pointer}.extendify-sdk .block{display:block}.extendify-sdk .inline-block{display:inline-block}.extendify-sdk .inline{display:inline}.extendify-sdk .flex{display:flex}.extendify-sdk .inline-flex{display:inline-flex}.extendify-sdk .table{display:table}.extendify-sdk .grid{display:grid}.extendify-sdk .hidden{display:none}.extendify-sdk .flex-col{flex-direction:column}.extendify-sdk .items-start{align-items:flex-start}.extendify-sdk .items-end{align-items:flex-end}.extendify-sdk .items-center{align-items:center}.extendify-sdk .justify-items-center{justify-items:center}.extendify-sdk .justify-start{justify-content:flex-start}.extendify-sdk .justify-end{justify-content:flex-end}.extendify-sdk .justify-center{justify-content:center}.extendify-sdk .justify-between{justify-content:space-between}.extendify-sdk .flex-grow{flex-grow:1}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .h-16{height:4rem}.extendify-sdk .h-80{height:20rem}.extendify-sdk .h-auto{height:auto}.extendify-sdk .h-px{height:1px}.extendify-sdk .h-full{height:100%}.extendify-sdk .h-screen{height:100vh}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.extendify-sdk .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .my-2{margin-top:.5rem;margin-bottom:.5rem}.extendify-sdk .my-4{margin-top:1rem;margin-bottom:1rem}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .mb-1{margin-bottom:.25rem}.extendify-sdk .mr-2{margin-right:.5rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .-mt-1{margin-top:-.25rem}.extendify-sdk .-mt-2{margin-top:-.5rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-ml-px{margin-left:-1px}.extendify-sdk .max-w-lg{max-width:32rem}.extendify-sdk .max-w-xl{max-width:36rem}.extendify-sdk .max-w-full{max-width:100%}.extendify-sdk .max-w-screen-xl{max-width:1280px}.extendify-sdk .max-w-screen-4xl{max-width:1920px}.extendify-sdk .min-h-screen{min-height:100vh}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.extendify-sdk .opacity-0{opacity:0}.extendify-sdk .focus\:opacity-100:focus,.extendify-sdk .group:hover .group-hover\:opacity-100,.extendify-sdk .opacity-100{opacity:1}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .p-0{padding:0}.extendify-sdk .p-1{padding:.25rem}.extendify-sdk .p-3{padding:.75rem}.extendify-sdk .p-4{padding:1rem}.extendify-sdk .p-6{padding:1.5rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.extendify-sdk .py-0{padding-top:0;padding-bottom:0}.extendify-sdk .py-1{padding-top:.25rem;padding-bottom:.25rem}.extendify-sdk .py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .px-3{padding-left:.75rem;padding-right:.75rem}.extendify-sdk .px-4{padding-left:1rem;padding-right:1rem}.extendify-sdk .py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.extendify-sdk .pt-1{padding-top:.25rem}.extendify-sdk .pr-2{padding-right:.5rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pr-4{padding-right:1rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pl-6{padding-left:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .pt-14{padding-top:3.5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .static{position:static}.extendify-sdk .fixed{position:fixed}.extendify-sdk .absolute{position:absolute}.extendify-sdk .relative{position:relative}.extendify-sdk .sticky{position:sticky}.extendify-sdk .inset-0{top:0;right:0;bottom:0;left:0}.extendify-sdk .top-0{top:0}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .top-16{top:4rem}*{--tw-shadow:0 0 transparent}.extendify-sdk .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}*{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.extendify-sdk .focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.extendify-sdk .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .text-gray-900{--tw-text-opacity:1;color:rgba(30,30,30,var(--tw-text-opacity))}.extendify-sdk .text-extendify-main{--tw-text-opacity:1;color:rgba(0,129,96,var(--tw-text-opacity))}.extendify-sdk .text-wp-theme-500{color:var(--wp-admin-theme-color)}.extendify-sdk .text-wp-alert-red{--tw-text-opacity:1;color:rgba(204,24,24,var(--tw-text-opacity))}.extendify-sdk .hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .hover\:text-wp-theme-500:hover{color:var(--wp-admin-theme-color)}.extendify-sdk .focus\:text-blue-500:focus{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.extendify-sdk .active\:text-white:active{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .no-underline{text-decoration:none}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.extendify-sdk .w-32{width:8rem}.extendify-sdk .w-72{width:18rem}.extendify-sdk .w-96{width:24rem}.extendify-sdk .w-full{width:100%}.extendify-sdk .w-screen{width:100vw}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-20{z-index:20}.extendify-sdk .z-30{z-index:30}.extendify-sdk .z-50{z-index:50}.extendify-sdk .z-high{z-index:1000000}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.extendify-sdk .rotate-180{--tw-rotate:180deg}.extendify-sdk .-translate-x-3{--tw-translate-x:-0.75rem}.extendify-sdk .translate-x-full{--tw-translate-x:100%}.extendify-sdk .-translate-x-full{--tw-translate-x:-100%}.extendify-sdk .translate-y-0{--tw-translate-y:0px}.extendify-sdk .translate-y-4{--tw-translate-y:1rem}.extendify-sdk .translate-y-0\.5{--tw-translate-y:0.125rem}.extendify-sdk .-translate-y-full{--tw-translate-y:-100%}.extendify-sdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.extendify-sdk .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{box-sizing:border-box;border:0 solid #e5e7eb}.extendify-sdk .button-focus{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-focus:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.extendify-sdk .button-focus:focus{--tw-ring-color:var(--wp-admin-theme-color)}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.button-extendify-main:active,.button-extendify-main:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.button-extendify-main{cursor:pointer;padding:.375rem .75rem}.button-extendify-main,.button-extendify-main:active,.button-extendify-main:focus,.button-extendify-main:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-extendify-main{text-decoration:none;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.extendify-sdk .button-extendify-main{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-extendify-main:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .button-extendify-main:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .components-panel__body>.components-panel__body-title{border-bottom:1px solid #e0e0e0!important}@media (min-width:600px){.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:block{display:block}.extendify-sdk .sm\:flex{display:flex}.extendify-sdk .sm\:hidden{display:none}.extendify-sdk .sm\:h-auto{height:auto}.extendify-sdk .sm\:text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .sm\:text-3xl{font-size:2rem;line-height:2.5rem}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-top:1.5rem;margin-bottom:1.5rem}.extendify-sdk .sm\:mr-1{margin-right:.25rem}.extendify-sdk .sm\:mb-6{margin-bottom:1.5rem}.extendify-sdk .sm\:mb-12{margin-bottom:3rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.extendify-sdk .sm\:ml-px{margin-left:1px}.extendify-sdk .sm\:min-h-0{min-height:0}.extendify-sdk .sm\:opacity-0{opacity:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pl-12{padding-left:3rem}.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:w-56{width:14rem}.extendify-sdk .sm\:w-auto{width:auto}.extendify-sdk .sm\:w-full{width:100%}.extendify-sdk .sm\:translate-x-8{--tw-translate-x:2rem}.extendify-sdk .sm\:translate-y-5{--tw-translate-y:1.25rem}}@media (min-width:782px){.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:-mt-32{margin-top:-8rem}}@media (min-width:1080px){.extendify-sdk .lg\:divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-right-width:calc(2px*var(--tw-divide-x-reverse));border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)))}.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:flex-row{flex-direction:row}.extendify-sdk .lg\:items-center{align-items:center}.extendify-sdk .lg\:justify-between{justify-content:space-between}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:leading-none{line-height:1}.extendify-sdk .lg\:-mx-2{margin-left:-.5rem;margin-right:-.5rem}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:p-10{padding:2.5rem}.extendify-sdk .lg\:px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .lg\:pt-5{padding-top:1.25rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:w-72{width:18rem}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1440px){.extendify-sdk .\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
extendify-sdk/public/build/extendify-sdk.js CHANGED
@@ -1,2 +1,2 @@
1
  /*! For license information please see extendify-sdk.js.LICENSE.txt */
2
- (()=>{var e,t={135:(e,t,n)=>{e.exports=n(248)},206:(e,t,n)=>{e.exports=n(57)},387:(e,t,n)=>{"use strict";var r=n(485),o=n(570),i=n(940),a=n(581),u=n(574),s=n(845),c=n(338),l=n(524);e.exports=function(e){return new Promise((function(t,n){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+v)}var h=u(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(h,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||c(h))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),f||(f=null),p.send(f)}))}},57:(e,t,n)=>{"use strict";var r=n(485),o=n(875),i=n(29),a=n(941);function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var s=u(n(141));s.Axios=i,s.create=function(e){return u(a(s.defaults,e))},s.Cancel=n(132),s.CancelToken=n(603),s.isCancel=n(475),s.all=function(e){return Promise.all(e)},s.spread=n(739),s.isAxiosError=n(835),e.exports=s,e.exports.default=s},132:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},603:(e,t,n)=>{"use strict";var r=n(132);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},475:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},29:(e,t,n)=>{"use strict";var r=n(485),o=n(581),i=n(96),a=n(9),u=n(941);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(u(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(u(r||{},{method:e,url:t,data:n}))}})),e.exports=s},96:(e,t,n)=>{"use strict";var r=n(485);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},574:(e,t,n)=>{"use strict";var r=n(642),o=n(288);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},524:(e,t,n)=>{"use strict";var r=n(953);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},9:(e,t,n)=>{"use strict";var r=n(485),o=n(212),i=n(475),a=n(141);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},953:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},941:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(u,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var l=o.concat(i).concat(a).concat(u),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},570:(e,t,n)=>{"use strict";var r=n(524);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},212:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},141:(e,t,n)=>{"use strict";var r=n(61),o=n(485),i=n(446),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(s=n(387)),s),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(u(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){c.headers[e]=o.merge(a)})),e.exports=c},875:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},581:(e,t,n)=>{"use strict";var r=n(485);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},288:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},940:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},642:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},835:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},338:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},446:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},845:(e,t,n)=>{"use strict";var r=n(485),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},739:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},485:(e,t,n)=>{"use strict";var r=n(875),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:s,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){s(t[r])&&s(n)?t[r]=e(t[r],n):s(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},501:(e,t,n)=>{"use strict";const r=wp.element;var o=n(804),i=n.n(o);function a(e){let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(o!==t){const e=t;t=r?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:(e,r,i)=>r||i?((e,r=o,i=Object.is)=>{let a=r(t);function u(){const n=r(t);if(!i(a,n)){const t=a;e(a=n,t)}}return n.add(u),()=>n.delete(u)})(e,r,i):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,o,i),i}const u="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?o.useEffect:o.useLayoutEffect;const s=function(e){const t="function"==typeof e?a(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,o.useReducer)((e=>e+1),0),i=t.getState(),a=(0,o.useRef)(i),s=(0,o.useRef)(e),c=(0,o.useRef)(n),l=(0,o.useRef)(!1),f=(0,o.useRef)();let d;void 0===f.current&&(f.current=e(i));let p=!1;(a.current!==i||s.current!==e||c.current!==n||l.current)&&(d=e(i),p=!n(f.current,d)),u((()=>{p&&(f.current=d),a.current=i,s.current=e,c.current=n,l.current=!1}));const m=(0,o.useRef)(i);return u((()=>{const e=()=>{try{const e=t.getState(),n=s.current(e);c.current(f.current,n)||(a.current=e,f.current=n,r())}catch(e){l.current=!0,r()}},n=t.subscribe(e);return t.getState()!==m.current&&e(),n}),[]),p?d:f.current};return Object.assign(n,t),n[Symbol.iterator]=function*(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),yield n,yield t},n};var c="pattern",l=12;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(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 d(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 d(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 p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=window.wp.blocks.createBlock;return e.map((function(e){var n=f(Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],3),r=n[0],o=n[1],i=n[2];return t(r,o,p(void 0===i?[]:i))}))}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 v(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){h(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 h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||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)||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 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 g=s((function(e,t){return{templates:[],fetchToken:null,activeTemplate:{},activeTemplateBlocks:{},taxonomyDefaultState:{},searchParams:{taxonomies:{},type:c,search:""},nextPage:"",removeTemplates:function(){return e({nextPage:"",templates:[]})},appendTemplates:function(n){return e({templates:y(new Map([].concat(y(t().templates),y(n)).map((function(e){return[e.id,e]}))).values())})},setupDefaultTaxonomies:function(n){var r=Object.keys(n).reduce((function(e,n){return e[n]=function(e){return function(e,t){return"pattern"===e&&"tax_categories"===t?"Default":""}(t().searchParams.type,e)}(n),e}),{}),o={};o.taxonomies=r,e({taxonomyDefaultState:r,searchParams:v({},Object.assign(t().searchParams,o))})},setActive:function(t){var n;if(e({activeTemplate:t}),null!=t&&null!==(n=t.fields)&&void 0!==n&&n.code){var r=window.wp.blocks.parse;e({activeTemplateBlocks:p(r(t.fields.code))})}},resetTaxonomies:function(){var e={tax_categories:"pattern"===t().searchParams.type?"Default":""};t().updateSearchParams({taxonomies:Object.assign(t().taxonomyDefaultState,e)})},updateTaxonomies:function(e){var n={};n.taxonomies=Object.assign({},t().searchParams.taxonomies,e),t().updateSearchParams(n)},updateSearchParams:function(n){null!=n&&n.taxonomies&&!Object.keys(n.taxonomies).length&&(n.taxonomies=t().taxonomyDefaultState),e({templates:[],nextPage:"",searchParams:v({},Object.assign(t().searchParams,n))})}}})),x=s((function(e){return{open:!1,currentPage:"content",setOpen:function(t){e({open:t}),t&&g.getState().removeTemplates()}}})),w=n(135),S=n.n(w),k=Object.defineProperty,j=Object.prototype.hasOwnProperty,O=Object.getOwnPropertySymbols,C=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))j.call(t,n)&&E(e,n,t[n]);if(O)for(var n of O(t))C.call(t,n)&&E(e,n,t[n]);return e};const I=(e,t)=>(n,r,o)=>{const{name:i,getStorage:a=(()=>localStorage),serialize:u=JSON.stringify,deserialize:s=JSON.parse,blacklist:c,whitelist:l,onRehydrateStorage:f,version:d=0,migrate:p}=t||{};let m;try{m=a()}catch(e){}if(!m)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${i}, the given storage is currently unavailable.`),n(...e)}),r,o);const v=async()=>{const e=P({},r());return l&&Object.keys(e).forEach((t=>{!l.includes(t)&&delete e[t]})),c&&c.forEach((t=>delete e[t])),null==m?void 0:m.setItem(i,await u({state:e,version:d}))},h=o.setState;return o.setState=(e,t)=>{h(e,t),v()},(async()=>{const e=(null==f?void 0:f(r()))||void 0;try{const e=await m.getItem(i);if(e){const t=await s(e);if(t.version!==d){const e=await(null==p?void 0:p(t.state,t.version));e&&(n(e),await v())}else n(t.state)}}catch(t){return void(null==e||e(void 0,t))}null==e||e(r(),void 0)})(),e(((...e)=>{n(...e),v()}),r,o)};var N=n(206),T=n.n(N)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function R(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}T.interceptors.response.use((function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"soft_error")&&window.dispatchEvent(new CustomEvent("extendify-sdk::softerror-encountered",{detail:e.soft_error,bubbles:!0})),e}(R(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(R(e.response))}(e)})),T.interceptors.request.use((function(e){return function(e){return e.headers["X-Extendify-Dev-Mode"]=window.location.search.indexOf("DEVMODE")>-1,e.headers["X-Extendify-Local-Mode"]=window.location.search.indexOf("LOCALMODE")>-1,e}(function(e){return e.data&&(e.data.remaining_imports=G.getState().remainingImports(),e.data.entry_point=G.getState().entryPoint,e.data.total_imports=G.getState().imports),e}(e))}),(function(e){return e}));var _=function(){return T.get("user")},A=function(e){return T.get("user-meta",{params:{key:e}})},L=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),T.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},D=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),T.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function F(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){F(i,r,o,a,u,"next",e)}function u(e){F(i,r,o,a,u,"throw",e)}a(void 0)}))}}var B,U,V={getItem:(U=M(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return U.apply(this,arguments)}),setItem:(B=M(S().mark((function e(t,n){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return B.apply(this,arguments)})},G=s(I((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",enabled:!0,incrementImports:function(){return e({imports:t().imports+1})},canImport:function(){return!!t().apiKey||Number(t().imports)<Number(t().allowedImports)},remainingImports:function(){if(t().apiKey)return"unlimited";var e=Number(t().allowedImports)-Number(t().imports);return e>0?e:0}}}),{name:"extendify-user",getStorage:function(){return V}}));const H=ReactDOM;function q(){return(q=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 K(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 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}function z(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return W(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)?W(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function $(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(a,$),a}var Q,Y,J;function X(e){var t=e.props,n=e.slot,r=e.defaultTag,o=e.features,i=e.visible,a=void 0===i||i,u=e.name;if(a)return Z(t,n,r,u);var s=null!=o?o:Q.None;if(s&Q.Static){var c=t.static,l=void 0!==c&&c,f=K(t,["static"]);if(l)return Z(f,n,r,u)}if(s&Q.RenderStrategy){var d,p=t.unmount,m=void 0===p||p,v=K(t,["unmount"]);return $(m?Y.Unmount:Y.Hidden,((d={})[Y.Unmount]=function(){return null},d[Y.Hidden]=function(){return Z(q({},v,{hidden:!0,style:{display:"none"}}),n,r,u)},d))}return Z(t,n,r,u)}function Z(e,t,n,r){var i;void 0===t&&(t={});var a=te(e,["unmount","static"]),u=a.as,s=void 0===u?n:u,c=a.children,l=a.refName,f=void 0===l?"ref":l,d=K(a,["as","children","refName"]),p=void 0!==e.ref?((i={})[f]=e.ref,i):{},m="function"==typeof c?c(t):c;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),s===o.Fragment&&Object.keys(d).length>0){if(!(0,o.isValidElement)(m)||Array.isArray(m)&&m.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+r+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,o.cloneElement)(m,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},a=z(n);!(r=a()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(te(d,["ref"])),m.props,["onClick"]),p))}return(0,o.createElement)(s,Object.assign({},te(d,["ref"]),s!==o.Fragment&&p),m)}function ee(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function te(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=z(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=(0,o.useRef)(t);return(0,o.useEffect)((function(){r.current=t}),[t]),(0,o.useCallback)((function(e){for(var t,n=z(r.current);!(t=n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}),[r])}function re(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;var t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(Q||(Q={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(Y||(Y={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(J||(J={}));var oe="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ie={serverHandoffComplete:!1};function ae(){var e=(0,o.useState)(ie.serverHandoffComplete),t=e[0],n=e[1];return(0,o.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,o.useEffect)((function(){!1===ie.serverHandoffComplete&&(ie.serverHandoffComplete=!0)}),[]),t}var ue=0;function se(){return++ue}function ce(){var e=ae(),t=(0,o.useState)(e?se:null),n=t[0],r=t[1];return oe((function(){null===n&&r(se())}),[n]),null!=n?""+n:void 0}var le,fe,de,pe,me,ve=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function he(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(ve))}function ye(e,t){var n;return void 0===t&&(t=pe.Strict),e!==document.body&&$(t,((n={})[pe.Strict]=function(){return e.matches(ve)},n[pe.Loose]=function(){for(var t=e;null!==t;){if(t.matches(ve))return!0;t=t.parentElement}return!1},n))}function be(e){null==e||e.focus({preventScroll:!0})}function ge(e,t){var n=Array.isArray(e)?e:he(e),r=document.activeElement,o=function(){if(t&(le.First|le.Next))return de.Next;if(t&(le.Previous|le.Last))return de.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&le.First)return 0;if(t&le.Previous)return Math.max(0,n.indexOf(r))-1;if(t&le.Next)return Math.max(0,n.indexOf(r))+1;if(t&le.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&le.NoScroll?{preventScroll:!0}:{},u=0,s=n.length,c=void 0;do{var l;if(u>=s||u+s<=0)return fe.Error;var f=i+u;if(t&le.WrapAround)f=(f+s)%s;else{if(f<0)return fe.Underflow;if(f>=s)return fe.Overflow}null==(l=c=n[f])||l.focus(a),u+=o}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),fe.Success}function xe(e,t,n){var r=(0,o.useRef)(t);r.current=t,(0,o.useEffect)((function(){function t(e){r.current.call(window,e)}return window.addEventListener(e,t,n),function(){return window.removeEventListener(e,t,n)}}),[e,n])}function we(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Se(e,t,n){void 0===t&&(t=me.All);var r=void 0===n?{}:n,i=r.initialFocus,a=r.containers,u=(0,o.useRef)("undefined"!=typeof window?document.activeElement:null),s=(0,o.useRef)(null),c=we(),l=Boolean(t&me.RestoreFocus),f=Boolean(t&me.InitialFocus);(0,o.useEffect)((function(){l&&(u.current=document.activeElement)}),[l]),(0,o.useEffect)((function(){if(l)return function(){be(u.current),u.current=null}}),[l]),(0,o.useEffect)((function(){if(f&&e.current){var t=document.activeElement;if(null==i?void 0:i.current){if((null==i?void 0:i.current)===t)return void(s.current=t)}else if(e.current.contains(t))return void(s.current=t);if(null==i?void 0:i.current)be(i.current);else if(ge(e.current,le.First)===fe.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");s.current=document.activeElement}}),[e,i,f]),xe("keydown",(function(n){t&me.TabLock&&e.current&&n.key===J.Tab&&(n.preventDefault(),ge(e.current,(n.shiftKey?le.Previous:le.Next)|le.WrapAround)===fe.Success&&(s.current=document.activeElement))})),xe("focus",(function(n){if(t&me.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var o=s.current;if(o&&c.current){var i=n.target;i&&i instanceof HTMLElement?!function(e,t){for(var n,r=z(e);!(n=r()).done;){var o;if(null==(o=n.value.current)?void 0:o.contains(t))return!0}return!1}(r,i)?(n.preventDefault(),n.stopPropagation(),be(o)):(s.current=i,be(i)):be(s.current)}}}}),!0)}!function(e){e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll"}(le||(le={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(fe||(fe={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(de||(de={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(pe||(pe={})),function(e){e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All"}(me||(me={}));var ke=new Set,je=new Map;function Oe(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Ce(e){var t=je.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var Ee=(0,o.createContext)(!1);function Pe(e){return i().createElement(Ee.Provider,{value:e.force},e.children)}function Ie(){var e=(0,o.useContext)(Ee),t=(0,o.useContext)(_e),n=(0,o.useState)((function(){if(!e&&null!==t)return null;if("undefined"==typeof window)return null;var n=document.getElementById("headlessui-portal-root");if(n)return n;var r=document.createElement("div");return r.setAttribute("id","headlessui-portal-root"),document.body.appendChild(r)})),r=n[0],i=n[1];return(0,o.useEffect)((function(){e||null!==t&&i(t.current)}),[t,i,e]),r}var Ne=o.Fragment;function Te(e){var t=e,n=Ie(),r=(0,o.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],i=ae();return oe((function(){if(n&&r)return n.appendChild(r),function(){var e;n&&(r&&(n.removeChild(r),n.childNodes.length<=0&&(null==(e=n.parentElement)||e.removeChild(n))))}}),[n,r]),i&&n&&r?(0,H.createPortal)(X({props:t,defaultTag:Ne,name:"Portal"}),r):null}var Re=o.Fragment,_e=(0,o.createContext)(null);Te.Group=function(e){var t=e.target,n=K(e,["target"]);return i().createElement(_e.Provider,{value:t},X({props:n,defaultTag:Re,name:"Popover.Group"}))};var Ae=(0,o.createContext)(null);function Le(){var e=(0,o.useContext)(Ae);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return e}function De(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(Ae.Provider,{value:r},e.children)}}),[n])]}function Fe(e){var t=Le(),n="headlessui-description-"+ce();oe((function(){return t.register(n)}),[n,t.register]);var r=e,o=q({},t.props,{id:n});return X({props:q({},r,o),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}var Me,Be=(0,o.createContext)(null);function Ue(){return(0,o.useContext)(Be)}function Ve(e){var t=e.value,n=e.children;return i().createElement(Be.Provider,{value:t},n)}Be.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Me||(Me={}));var Ge,He,qe,Ke,We=(0,o.createContext)((function(){}));function ze(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,u=(0,o.useContext)(We),s=(0,o.useCallback)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n.apply(void 0,t),u.apply(void 0,t)}),[u,n]);return oe((function(){return s(Ge.Add,r,a),function(){return s(Ge.Remove,r,a)}}),[s,r,a]),i().createElement(We.Provider,{value:s},t)}We.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(Ge||(Ge={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(qe||(qe={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(Ke||(Ke={}));var $e=((He={})[Ke.SetTitleId]=function(e,t){return e.titleId===t.id?e:q({},e,{titleId:t.id})},He),Qe=(0,o.createContext)(null);function Ye(e){var t=(0,o.useContext)(Qe);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ot.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ye),n}return t}function Je(e,t){return $(t.type,$e,e,t)}Qe.displayName="DialogContext";var Xe=Q.RenderStrategy|Q.Static,Ze=ee((function(e,t){var n,r=e.open,a=e.onClose,u=e.initialFocus,s=K(e,["open","onClose","initialFocus"]),c=(0,o.useState)(0),l=c[0],f=c[1],d=Ue();void 0===r&&null!==d&&(r=$(d,((n={})[Me.Open]=!0,n[Me.Closed]=!1,n)));var p=(0,o.useRef)(new Set),m=(0,o.useRef)(null),v=ne(m,t),h=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!h&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+r);if("function"!=typeof a)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+a);var b=r?qe.Open:qe.Closed,g=null!==d?d===Me.Open:b===qe.Open,x=(0,o.useReducer)(Je,{titleId:null,descriptionId:null}),w=x[0],S=x[1],k=(0,o.useCallback)((function(){return a(!1)}),[a]),j=(0,o.useCallback)((function(e){return S({type:Ke.SetTitleId,id:e})}),[S]),O=ae()&&b===qe.Open,C=l>1,E=null!==(0,o.useContext)(Qe);Se(m,O?$(C?"parent":"leaf",{parent:me.RestoreFocus,leaf:me.All}):me.None,{initialFocus:u,containers:p}),function(e,t){void 0===t&&(t=!0),oe((function(){if(t&&e.current){var n=e.current;ke.add(n);for(var r,o=z(je.keys());!(r=o()).done;){var i=r.value;i.contains(n)&&(Ce(i),je.delete(i))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===ke.size&&(je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e))}})),function(){if(ke.delete(n),ke.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!je.has(e)){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e)}}));else for(var e,t=z(je.keys());!(e=t()).done;){var r=e.value;Ce(r),je.delete(r)}}}}),[t])}(m,!!C&&O),xe("mousedown",(function(e){var t,n=e.target;b===qe.Open&&(C||(null==(t=m.current)?void 0:t.contains(n))||k())})),(0,o.useEffect)((function(){if(b===qe.Open&&!E){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[b,E]),(0,o.useEffect)((function(){if(b===qe.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=z(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(m.current),function(){return e.disconnect()}}}),[b,m,k]);var P=De(),I=P[0],N=P[1],T="headlessui-dialog-"+ce(),R=(0,o.useMemo)((function(){return[{dialogState:b,close:k,setTitleId:j},w]}),[b,w,k,j]),_=(0,o.useMemo)((function(){return{open:b===qe.Open}}),[b]),A={ref:v,id:T,role:"dialog","aria-modal":b===qe.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":I,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===J.Escape&&b===qe.Open&&(C||(e.preventDefault(),e.stopPropagation(),k()))}},L=s;return i().createElement(ze,{type:"Dialog",element:m,onUpdate:(0,o.useCallback)((function(e,t,n){var r;"Dialog"===t&&$(e,((r={})[Ge.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[Ge.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},i().createElement(Pe,{force:!0},i().createElement(Te,null,i().createElement(Qe.Provider,{value:R},i().createElement(Te.Group,{target:m},i().createElement(Pe,{force:!1},i().createElement(N,{slot:_,name:"Dialog.Description"},X({props:q({},L,A),slot:_,defaultTag:"div",features:Xe,visible:g,name:"Dialog"}))))))))})),et=ee((function e(t,n){var r=Ye([ot.displayName,e.name].join("."))[0],i=r.dialogState,a=r.close,u=ne(n),s="headlessui-dialog-overlay-"+ce(),c=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),l=(0,o.useMemo)((function(){return{open:i===qe.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:c}),slot:l,defaultTag:"div",name:"Dialog.Overlay"})}));var tt,nt,rt,ot=Object.assign(Ze,{Overlay:et,Title:function e(t){var n=Ye([ot.displayName,e.name].join("."))[0],r=n.dialogState,i=n.setTitleId,a="headlessui-dialog-title-"+ce();(0,o.useEffect)((function(){return i(a),function(){return i(null)}}),[a,i]);var u=(0,o.useMemo)((function(){return{open:r===qe.Open}}),[r]);return X({props:q({},t,{id:a}),slot:u,defaultTag:"h2",name:"Dialog.Title"})},Description:Fe});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(nt||(nt={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(rt||(rt={}));var it=((tt={})[rt.ToggleDisclosure]=function(e){var t;return q({},e,{disclosureState:$(e.disclosureState,(t={},t[nt.Open]=nt.Closed,t[nt.Closed]=nt.Open,t))})},tt[rt.LinkPanel]=function(e){return!0===e.linkedPanel?e:q({},e,{linkedPanel:!0})},tt[rt.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:q({},e,{linkedPanel:!1})},tt[rt.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},tt[rt.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},tt),at=(0,o.createContext)(null);function ut(e){var t=(0,o.useContext)(at);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+lt.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ut),n}return t}function st(e,t){return $(t.type,it,e,t)}at.displayName="DisclosureContext";var ct=o.Fragment;function lt(e){var t,n=e.defaultOpen,r=void 0!==n&&n,a=K(e,["defaultOpen"]),u="headlessui-disclosure-button-"+ce(),s="headlessui-disclosure-panel-"+ce(),c=(0,o.useReducer)(st,{disclosureState:r?nt.Open:nt.Closed,linkedPanel:!1,buttonId:u,panelId:s}),l=c[0].disclosureState,f=c[1];(0,o.useEffect)((function(){return f({type:rt.SetButtonId,buttonId:u})}),[u,f]),(0,o.useEffect)((function(){return f({type:rt.SetPanelId,panelId:s})}),[s,f]);var d=(0,o.useMemo)((function(){return{open:l===nt.Open}}),[l]);return i().createElement(at.Provider,{value:c},i().createElement(Ve,{value:$(l,(t={},t[nt.Open]=Me.Open,t[nt.Closed]=Me.Closed,t))},X({props:a,slot:d,defaultTag:ct,name:"Disclosure"})))}var ft=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n),s=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:rt.ToggleDisclosure})}}),[a]),c=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),l=(0,o.useCallback)((function(e){re(e.currentTarget)||t.disabled||a({type:rt.ToggleDisclosure})}),[a,t.disabled]),f=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]);return X({props:q({},t,{ref:u,id:i.buttonId,type:"button","aria-expanded":i.disclosureState===nt.Open||void 0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:s,onKeyUp:c,onClick:l}),slot:f,defaultTag:"button",name:"Disclosure.Button"})})),dt=Q.RenderStrategy|Q.Static,pt=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n,(function(){i.linkedPanel||a({type:rt.LinkPanel})})),s=Ue(),c=null!==s?s===Me.Open:i.disclosureState===nt.Open;(0,o.useEffect)((function(){return function(){return a({type:rt.UnlinkPanel})}}),[a]),(0,o.useEffect)((function(){var e;i.disclosureState!==nt.Closed||null!=(e=t.unmount)&&!e||a({type:rt.UnlinkPanel})}),[i.disclosureState,t.unmount,a]);var l=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]),f={ref:u,id:i.panelId};return X({props:q({},t,f),slot:l,defaultTag:"div",features:dt,visible:c,name:"Disclosure.Panel"})}));lt.Button=ft,lt.Panel=pt;var mt,vt,ht,yt;function bt(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=z(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function gt(){var e=(0,o.useState)(bt)[0];return(0,o.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}function xt(e,t){var n=(0,o.useState)(e),r=n[0],i=n[1],a=(0,o.useRef)(e);return oe((function(){a.current=e}),[e]),oe((function(){return i(a.current)}),[a,i].concat(t)),r}function wt(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case mt.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case mt.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)}));return-1===r?r:n.length-1-r;case mt.Next:return n.findIndex((function(e,n){return!(n<=o)&&!t.resolveDisabled(e)}));case mt.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case mt.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case mt.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}!function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(mt||(mt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ht||(ht={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(yt||(yt={}));var St=((vt={})[yt.CloseListbox]=function(e){return e.disabled||e.listboxState===ht.Closed?e:q({},e,{activeOptionIndex:null,listboxState:ht.Closed})},vt[yt.OpenListbox]=function(e){return e.disabled||e.listboxState===ht.Open?e:q({},e,{listboxState:ht.Open})},vt[yt.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:q({},e,{disabled:t.disabled})},vt[yt.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=wt(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:q({},e,{searchQuery:"",activeOptionIndex:n})},vt[yt.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=e.searchQuery+t.value.toLowerCase(),r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return-1===r||r===e.activeOptionIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeOptionIndex:r})},vt[yt.ClearSearch]=function(e){return e.disabled||e.listboxState===ht.Closed||""===e.searchQuery?e:q({},e,{searchQuery:""})},vt[yt.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},vt[yt.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},vt),kt=(0,o.createContext)(null);function jt(e){var t=(0,o.useContext)(kt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Et.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,jt),n}return t}function Ot(e,t){return $(t.type,St,e,t)}kt.displayName="ListboxContext";var Ct=o.Fragment;function Et(e){var t,n=e.value,r=e.onChange,a=e.disabled,u=void 0!==a&&a,s=K(e,["value","onChange","disabled"]),c=(0,o.useReducer)(Ot,{listboxState:ht.Closed,propsRef:{current:{value:n,onChange:r}},labelRef:(0,o.createRef)(),buttonRef:(0,o.createRef)(),optionsRef:(0,o.createRef)(),disabled:u,options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,p=l.optionsRef,m=l.buttonRef,v=c[1];oe((function(){d.current.value=n}),[n,d]),oe((function(){d.current.onChange=r}),[r,d]),oe((function(){return v({type:yt.SetDisabled,disabled:u})}),[u]),xe("mousedown",(function(e){var t,n,r,o=e.target;f===ht.Open&&((null==(t=m.current)?void 0:t.contains(o))||(null==(n=p.current)?void 0:n.contains(o))||(v({type:yt.CloseListbox}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=m.current)||r.focus())))}));var h=(0,o.useMemo)((function(){return{open:f===ht.Open,disabled:u}}),[f,u]);return i().createElement(kt.Provider,{value:c},i().createElement(Ve,{value:$(f,(t={},t[ht.Open]=Me.Open,t[ht.Closed]=Me.Closed,t))},X({props:s,slot:h,defaultTag:Ct,name:"Listbox"})))}var Pt=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-listbox-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.Last})}))}}),[u,a,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a.listboxState===ht.Open?(u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),u({type:yt.OpenListbox}))}),[u,l,a]),m=xt((function(){if(a.labelRef.current)return[a.labelRef.current.id,c].join(" ")}),[a.labelRef.current,c]),v=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open,disabled:a.disabled}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.optionsRef.current)?void 0:r.id,"aria-expanded":a.listboxState===ht.Open||void 0,"aria-labelledby":m,disabled:a.disabled,onKeyDown:f,onKeyUp:d,onClick:p}),slot:v,defaultTag:"button",name:"Listbox.Button"})}));var It,Nt,Tt,Rt=Q.RenderStrategy|Q.Static,_t=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.optionsRef,n),c="headlessui-listbox-options-"+ce(),l=gt(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:a.listboxState===ht.Open;oe((function(){var e=a.optionsRef.current;e&&a.listboxState===ht.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[a.listboxState,a.optionsRef]);var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:yt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),null!==a.activeOptionIndex){var t=a.options[a.activeOptionIndex].dataRef;a.propsRef.current.onChange(t.current.value)}bt().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Last});case J.Escape:return e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(u({type:yt.Search,value:e.key}),f.setTimeout((function(){return u({type:yt.ClearSearch})}),350))}}),[l,u,f,a]),v=xt((function(){var e,t,n;return null!=(e=null==(t=a.labelRef.current)?void 0:t.id)?e:null==(n=a.buttonRef.current)?void 0:n.id}),[a.labelRef.current,a.buttonRef.current]),h=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open}}),[a]);return X({props:q({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(r=a.options[a.activeOptionIndex])?void 0:r.id,"aria-labelledby":v,id:c,onKeyDown:m,role:"listbox",tabIndex:0,ref:s}),slot:h,defaultTag:"ul",features:Rt,visible:p,name:"Listbox.Options"})}));function At(e){var t=e.container,n=e.accept,r=e.walk,i=e.enabled,a=void 0===i||i,u=(0,o.useRef)(n),s=(0,o.useRef)(r);(0,o.useEffect)((function(){u.current=n,s.current=r}),[n,r]),oe((function(){if(t&&a)for(var e=u.current,n=s.current,r=Object.assign((function(t){return e(t)}),{acceptNode:e}),o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,r,!1);o.nextNode();)n(o.currentNode)}),[t,a,u,s])}Et.Button=Pt,Et.Label=function e(t){var n=jt([Et.name,e.name].join("."))[0],r="headlessui-listbox-label-"+ce(),i=(0,o.useCallback)((function(){var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[n.buttonRef]),a=(0,o.useMemo)((function(){return{open:n.listboxState===ht.Open,disabled:n.disabled}}),[n]);return X({props:q({},t,{ref:n.labelRef,id:r,onClick:i}),slot:a,defaultTag:"label",name:"Listbox.Label"})},Et.Options=_t,Et.Option=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.value,a=K(t,["disabled","value"]),u=jt([Et.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-listbox-option-"+ce(),f=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===l,d=s.propsRef.current.value===i,p=(0,o.useRef)({disabled:r,value:i});oe((function(){p.current.disabled=r}),[p,r]),oe((function(){p.current.value=i}),[p,i]),oe((function(){var e,t;p.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[p,l]);var m=(0,o.useCallback)((function(){return s.propsRef.current.onChange(i)}),[s.propsRef,i]);oe((function(){return c({type:yt.RegisterOption,id:l,dataRef:p}),function(){return c({type:yt.UnregisterOption,id:l})}}),[p,l]),oe((function(){var e;s.listboxState===ht.Open&&d&&(c({type:yt.GoToOption,focus:mt.Specific,id:l}),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),[s.listboxState]),oe((function(){if(s.listboxState===ht.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.listboxState]);var v=(0,o.useCallback)((function(e){if(r)return e.preventDefault();m(),c({type:yt.CloseListbox}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[c,s.buttonRef,r,m]),h=(0,o.useCallback)((function(){if(r)return c({type:yt.GoToOption,focus:mt.Nothing});c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,l,c]),y=(0,o.useCallback)((function(){r||f||c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,f,l,c]),b=(0,o.useCallback)((function(){r||f&&c({type:yt.GoToOption,focus:mt.Nothing})}),[r,f,c]),g=(0,o.useMemo)((function(){return{active:f,selected:d,disabled:r}}),[f,d,r]);return X({props:q({},a,{id:l,role:"option",tabIndex:-1,"aria-disabled":!0===r||void 0,"aria-selected":!0===d||void 0,onClick:v,onFocus:h,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b}),slot:g,defaultTag:"li",name:"Listbox.Option"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Nt||(Nt={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Tt||(Tt={}));var Lt=((It={})[Tt.CloseMenu]=function(e){return e.menuState===Nt.Closed?e:q({},e,{activeItemIndex:null,menuState:Nt.Closed})},It[Tt.OpenMenu]=function(e){return e.menuState===Nt.Open?e:q({},e,{menuState:Nt.Open})},It[Tt.GoToItem]=function(e,t){var n=wt(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:q({},e,{searchQuery:"",activeItemIndex:n})},It[Tt.Search]=function(e,t){var n=e.searchQuery+t.value.toLowerCase(),r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return-1===r||r===e.activeItemIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeItemIndex:r})},It[Tt.ClearSearch]=function(e){return""===e.searchQuery?e:q({},e,{searchQuery:""})},It[Tt.RegisterItem]=function(e,t){return q({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},It[Tt.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},It),Dt=(0,o.createContext)(null);function Ft(e){var t=(0,o.useContext)(Dt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Ut.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ft),n}return t}function Mt(e,t){return $(t.type,Lt,e,t)}Dt.displayName="MenuContext";var Bt=o.Fragment;function Ut(e){var t,n=(0,o.useReducer)(Mt,{menuState:Nt.Closed,buttonRef:(0,o.createRef)(),itemsRef:(0,o.createRef)(),items:[],searchQuery:"",activeItemIndex:null}),r=n[0],a=r.menuState,u=r.itemsRef,s=r.buttonRef,c=n[1];xe("mousedown",(function(e){var t,n,r,o=e.target;a===Nt.Open&&((null==(t=s.current)?void 0:t.contains(o))||(null==(n=u.current)?void 0:n.contains(o))||(c({type:Tt.CloseMenu}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=s.current)||r.focus())))}));var l=(0,o.useMemo)((function(){return{open:a===Nt.Open}}),[a]);return i().createElement(Dt.Provider,{value:n},i().createElement(Ve,{value:$(a,(t={},t[Nt.Open]=Me.Open,t[Nt.Closed]=Me.Closed,t))},X({props:e,slot:l,defaultTag:Bt,name:"Menu"})))}var Vt,Gt,Ht,qt=ee((function e(t,n){var r,i=Ft([Ut.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-menu-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.Last})}))}}),[u,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===Nt.Open?(u({type:Tt.CloseMenu}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu})))}),[u,l,a,t.disabled]),m=(0,o.useMemo)((function(){return{open:a.menuState===Nt.Open}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.itemsRef.current)?void 0:r.id,"aria-expanded":a.menuState===Nt.Open||void 0,onKeyDown:f,onKeyUp:d,onClick:p}),slot:m,defaultTag:"button",name:"Menu.Button"})})),Kt=Q.RenderStrategy|Q.Static,Wt=ee((function e(t,n){var r,i,a=Ft([Ut.name,e.name].join(".")),u=a[0],s=a[1],c=ne(u.itemsRef,n),l="headlessui-menu-items-"+ce(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:u.menuState===Nt.Open;(0,o.useEffect)((function(){var e=u.itemsRef.current;e&&u.menuState===Nt.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[u.menuState,u.itemsRef]),At({container:u.itemsRef.current,enabled:u.menuState===Nt.Open,accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==u.searchQuery)return e.preventDefault(),e.stopPropagation(),s({type:Tt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),null!==u.activeItemIndex){var t,n=u.items[u.activeItemIndex].id;null==(t=document.getElementById(n))||t.click()}bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Last});case J.Escape:e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(s({type:Tt.Search,value:e.key}),f.setTimeout((function(){return s({type:Tt.ClearSearch})}),350))}}),[s,f,u]),v=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),h=(0,o.useMemo)((function(){return{open:u.menuState===Nt.Open}}),[u]);return X({props:q({},t,{"aria-activedescendant":null===u.activeItemIndex||null==(r=u.items[u.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(i=u.buttonRef.current)?void 0:i.id,id:l,onKeyDown:m,onKeyUp:v,role:"menu",tabIndex:0,ref:c}),slot:h,defaultTag:"div",features:Kt,visible:p,name:"Menu.Items"})})),zt=o.Fragment;Ut.Button=qt,Ut.Items=Wt,Ut.Item=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.onClick,a=K(t,["disabled","onClick"]),u=Ft([Ut.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-menu-item-"+ce(),f=null!==s.activeItemIndex&&s.items[s.activeItemIndex].id===l;oe((function(){if(s.menuState===Nt.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.menuState]);var d=(0,o.useRef)({disabled:r});oe((function(){d.current.disabled=r}),[d,r]),oe((function(){var e,t;d.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[d,l]),oe((function(){return c({type:Tt.RegisterItem,id:l,dataRef:d}),function(){return c({type:Tt.UnregisterItem,id:l})}}),[d,l]);var p=(0,o.useCallback)((function(e){return r?e.preventDefault():(c({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),i?i(e):void 0)}),[c,s.buttonRef,r,i]),m=(0,o.useCallback)((function(){if(r)return c({type:Tt.GoToItem,focus:mt.Nothing});c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,l,c]),v=(0,o.useCallback)((function(){r||f||c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,f,l,c]),h=(0,o.useCallback)((function(){r||f&&c({type:Tt.GoToItem,focus:mt.Nothing})}),[r,f,c]),y=(0,o.useMemo)((function(){return{active:f,disabled:r}}),[f,r]);return X({props:q({},a,{id:l,role:"menuitem",tabIndex:-1,"aria-disabled":!0===r||void 0,onClick:p,onFocus:m,onPointerMove:v,onMouseMove:v,onPointerLeave:h,onMouseLeave:h}),slot:y,defaultTag:zt,name:"Menu.Item"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Gt||(Gt={})),function(e){e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId"}(Ht||(Ht={}));var $t=((Vt={})[Ht.TogglePopover]=function(e){var t;return q({},e,{popoverState:$(e.popoverState,(t={},t[Gt.Open]=Gt.Closed,t[Gt.Closed]=Gt.Open,t))})},Vt[Ht.ClosePopover]=function(e){return e.popoverState===Gt.Closed?e:q({},e,{popoverState:Gt.Closed})},Vt[Ht.SetButton]=function(e,t){return e.button===t.button?e:q({},e,{button:t.button})},Vt[Ht.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},Vt[Ht.SetPanel]=function(e,t){return e.panel===t.panel?e:q({},e,{panel:t.panel})},Vt[Ht.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},Vt),Qt=(0,o.createContext)(null);function Yt(e){var t=(0,o.useContext)(Qt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+tn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Yt),n}return t}Qt.displayName="PopoverContext";var Jt=(0,o.createContext)(null);function Xt(){return(0,o.useContext)(Jt)}Jt.displayName="PopoverGroupContext";var Zt=(0,o.createContext)(null);function en(e,t){return $(t.type,$t,e,t)}Zt.displayName="PopoverPanelContext";function tn(e){var t,n="headlessui-popover-button-"+ce(),r="headlessui-popover-panel-"+ce(),a=(0,o.useReducer)(en,{popoverState:Gt.Closed,button:null,buttonId:n,panel:null,panelId:r}),u=a[0],s=u.popoverState,c=u.button,l=u.panel,f=a[1];(0,o.useEffect)((function(){return f({type:Ht.SetButtonId,buttonId:n})}),[n,f]),(0,o.useEffect)((function(){return f({type:Ht.SetPanelId,panelId:r})}),[r,f]);var d=(0,o.useMemo)((function(){return{buttonId:n,panelId:r,close:function(){return f({type:Ht.ClosePopover})}}}),[n,r,f]),p=Xt(),m=null==p?void 0:p.registerPopover,v=(0,o.useCallback)((function(){var e;return null!=(e=null==p?void 0:p.isFocusWithinPopoverGroup())?e:(null==c?void 0:c.contains(document.activeElement))||(null==l?void 0:l.contains(document.activeElement))}),[p,c,l]);(0,o.useEffect)((function(){return null==m?void 0:m(d)}),[m,d]),xe("focus",(function(){s===Gt.Open&&(v()||c&&l&&f({type:Ht.ClosePopover}))}),!0),xe("mousedown",(function(e){var t=e.target;s===Gt.Open&&((null==c?void 0:c.contains(t))||(null==l?void 0:l.contains(t))||(f({type:Ht.ClosePopover}),ye(t,pe.Loose)||(e.preventDefault(),null==c||c.focus())))}));var h=(0,o.useMemo)((function(){return{open:s===Gt.Open}}),[s]);return i().createElement(Qt.Provider,{value:a},i().createElement(Ve,{value:$(s,(t={},t[Gt.Open]=Me.Open,t[Gt.Closed]=Me.Closed,t))},X({props:e,slot:h,defaultTag:"div",name:"Popover"})))}var nn=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0],a=r[1],u=(0,o.useRef)(null),s=Xt(),c=null==s?void 0:s.closeOthers,l=(0,o.useContext)(Zt),f=null!==l&&l===i.panelId,d=ne(u,n,f?null:function(e){return a({type:Ht.SetButton,button:e})}),p=(0,o.useRef)(null),m=(0,o.useRef)("undefined"==typeof window?null:document.activeElement);xe("focus",(function(){m.current=p.current,p.current=document.activeElement}),!0);var v=(0,o.useCallback)((function(e){var t;if(f){if(i.popoverState===Gt.Closed)return;switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:Ht.ClosePopover}),null==(t=i.button)||t.focus()}}else switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),a({type:Ht.TogglePopover});break;case J.Escape:if(i.popoverState!==Gt.Open)return null==c?void 0:c(i.buttonId);if(!u.current)return;if(!u.current.contains(document.activeElement))return;a({type:Ht.ClosePopover});break;case J.Tab:if(i.popoverState!==Gt.Open)return;if(!i.panel)return;if(!i.button)return;if(e.shiftKey){var n;if(!m.current)return;if(null==(n=i.button)?void 0:n.contains(m.current))return;if(i.panel.contains(m.current))return;var r=he(),o=r.indexOf(m.current);if(r.indexOf(i.button)>o)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}else e.preventDefault(),e.stopPropagation(),ge(i.panel,le.First)}}),[a,i.popoverState,i.buttonId,i.button,i.panel,u,c,f]),h=(0,o.useCallback)((function(e){var t;if(!f&&(e.key===J.Space&&e.preventDefault(),i.popoverState===Gt.Open&&i.panel&&i.button))switch(e.key){case J.Tab:if(!m.current)return;if(null==(t=i.button)?void 0:t.contains(m.current))return;if(i.panel.contains(m.current))return;var n=he(),r=n.indexOf(m.current);if(n.indexOf(i.button)>r)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}}),[i.popoverState,i.panel,i.button,f]),y=(0,o.useCallback)((function(e){var n,r;re(e.currentTarget)||(t.disabled||(f?(a({type:Ht.ClosePopover}),null==(n=i.button)||n.focus()):(i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),null==(r=i.button)||r.focus(),a({type:Ht.TogglePopover}))))}),[a,i.button,i.popoverState,i.buttonId,t.disabled,c,f]),b=(0,o.useMemo)((function(){return{open:i.popoverState===Gt.Open}}),[i]);return X({props:q({},t,f?{type:"button",onKeyDown:v,onClick:y}:{ref:d,id:i.buttonId,type:"button","aria-expanded":i.popoverState===Gt.Open||void 0,"aria-controls":i.panel?i.panelId:void 0,onKeyDown:v,onKeyUp:h,onClick:y}),slot:b,defaultTag:"button",name:"Popover.Button"})})),rn=Q.RenderStrategy|Q.Static,on=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0].popoverState,a=r[1],u=ne(n),s="headlessui-popover-overlay-"+ce(),c=Ue(),l=null!==c?c===Me.Open:i===Gt.Open,f=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a({type:Ht.ClosePopover})}),[a]),d=(0,o.useMemo)((function(){return{open:i===Gt.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:f}),slot:d,defaultTag:"div",features:rn,visible:l,name:"Popover.Overlay"})})),an=Q.RenderStrategy|Q.Static,un=ee((function e(t,n){var r=t.focus,a=void 0!==r&&r,u=K(t,["focus"]),s=Yt([tn.name,e.name].join(".")),c=s[0],l=s[1],f=(0,o.useRef)(null),d=ne(f,n,(function(e){l({type:Ht.SetPanel,panel:e})})),p=Ue(),m=null!==p?p===Me.Open:c.popoverState===Gt.Open,v=(0,o.useCallback)((function(e){var t;switch(e.key){case J.Escape:if(c.popoverState!==Gt.Open)return;if(!f.current)return;if(!f.current.contains(document.activeElement))return;e.preventDefault(),l({type:Ht.ClosePopover}),null==(t=c.button)||t.focus()}}),[c,f,l]);(0,o.useEffect)((function(){return function(){return l({type:Ht.SetPanel,panel:null})}}),[l]),(0,o.useEffect)((function(){var e;c.popoverState!==Gt.Closed||null!=(e=t.unmount)&&!e||l({type:Ht.SetPanel,panel:null})}),[c.popoverState,t.unmount,l]),(0,o.useEffect)((function(){if(a&&c.popoverState===Gt.Open&&f.current){var e=document.activeElement;f.current.contains(e)||ge(f.current,le.First)}}),[a,f,c.popoverState]),xe("keydown",(function(e){if(c.popoverState===Gt.Open&&f.current&&e.key===J.Tab&&document.activeElement&&f.current&&f.current.contains(document.activeElement)){e.preventDefault();var t,n=ge(f.current,e.shiftKey?le.Previous:le.Next);if(n===fe.Underflow)return null==(t=c.button)?void 0:t.focus();if(n===fe.Overflow){if(!c.button)return;var r=he(),o=r.indexOf(c.button);ge(r.splice(o+1).filter((function(e){var t;return!(null==(t=f.current)?void 0:t.contains(e))})),le.First)===fe.Error&&ge(document.body,le.First)}}})),xe("focus",(function(){var e;a&&c.popoverState===Gt.Open&&f.current&&((null==(e=f.current)?void 0:e.contains(document.activeElement))||l({type:Ht.ClosePopover}))}),!0);var h=(0,o.useMemo)((function(){return{open:c.popoverState===Gt.Open}}),[c]),y={ref:d,id:c.panelId,onKeyDown:v};return i().createElement(Zt.Provider,{value:c.panelId},X({props:q({},u,y),slot:h,defaultTag:"div",features:an,visible:m,name:"Popover.Panel"}))}));tn.Button=nn,tn.Overlay=on,tn.Panel=un,tn.Group=function(e){var t=(0,o.useRef)(null),n=(0,o.useState)([]),r=n[0],a=n[1],u=(0,o.useCallback)((function(e){a((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[a]),s=(0,o.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return u(e)}}),[a,u]),c=(0,o.useCallback)((function(){var e,n=document.activeElement;return!!(null==(e=t.current)?void 0:e.contains(n))||r.some((function(e){var t,r;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(n))||(null==(r=document.getElementById(e.panelId))?void 0:r.contains(n))}))}),[t,r]),l=(0,o.useCallback)((function(e){for(var t,n=z(r);!(t=n()).done;){var o=t.value;o.buttonId!==e&&o.close()}}),[r]),f=(0,o.useMemo)((function(){return{registerPopover:s,unregisterPopover:u,isFocusWithinPopoverGroup:c,closeOthers:l}}),[s,u,c,l]),d=(0,o.useMemo)((function(){return{}}),[]),p={ref:t},m=e;return i().createElement(Jt.Provider,{value:f},X({props:q({},m,p),slot:d,defaultTag:"div",name:"Popover.Group"}))};var sn=(0,o.createContext)(null);function cn(){var e=(0,o.useContext)(sn);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return e}function ln(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(sn.Provider,{value:r},e.children)}}),[n])]}var fn,dn;function pn(e){var t=e.passive,n=void 0!==t&&t,r=K(e,["passive"]),o=cn(),i="headlessui-label-"+ce();oe((function(){return o.register(i)}),[i,o.register]);var a=q({},o.props,{id:i}),u=q({},r,a);return n&&delete u.onClick,X({props:u,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}!function(e){e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption"}(dn||(dn={}));var mn=((fn={})[dn.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,element:t.element,propsRef:t.propsRef}])})},fn[dn.UnregisterOption]=function(e,t){var n=e.options.slice(),r=e.options.findIndex((function(e){return e.id===t.id}));return-1===r?e:(n.splice(r,1),q({},e,{options:n}))},fn),vn=(0,o.createContext)(null);function hn(e){var t=(0,o.useContext)(vn);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+gn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,hn),n}return t}function yn(e,t){return $(t.type,mn,e,t)}vn.displayName="RadioGroupContext";var bn;function gn(e){var t=e.value,n=e.onChange,r=e.disabled,a=void 0!==r&&r,u=K(e,["value","onChange","disabled"]),s=(0,o.useReducer)(yn,{options:[]}),c=s[0].options,l=s[1],f=ln(),d=f[0],p=f[1],m=De(),v=m[0],h=m[1],y="headlessui-radiogroup-"+ce(),b=(0,o.useRef)(null),g=(0,o.useMemo)((function(){return c.find((function(e){return!e.propsRef.current.disabled}))}),[c]),x=(0,o.useMemo)((function(){return c.some((function(e){return e.propsRef.current.value===t}))}),[c,t]),w=(0,o.useCallback)((function(e){var r;if(a)return!1;if(e===t)return!1;var o=null==(r=c.find((function(t){return t.propsRef.current.value===e})))?void 0:r.propsRef.current;return!(null==o?void 0:o.disabled)&&(n(e),!0)}),[n,t,a,c]);At({container:b.current,accept:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var S=(0,o.useCallback)((function(e){if(b.current){var t=c.filter((function(e){return!1===e.propsRef.current.disabled})).map((function(e){return e.element.current}));switch(e.key){case J.ArrowLeft:case J.ArrowUp:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Previous|le.WrapAround)===fe.Success){var n=c.find((function(e){return e.element.current===document.activeElement}));n&&w(n.propsRef.current.value)}break;case J.ArrowRight:case J.ArrowDown:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Next|le.WrapAround)===fe.Success){var r=c.find((function(e){return e.element.current===document.activeElement}));r&&w(r.propsRef.current.value)}break;case J.Space:e.preventDefault(),e.stopPropagation();var o=c.find((function(e){return e.element.current===document.activeElement}));o&&w(o.propsRef.current.value)}}}),[b,c,w]),k=(0,o.useCallback)((function(e){return l(q({type:dn.RegisterOption},e)),function(){return l({type:dn.UnregisterOption,id:e.id})}}),[l]),j=(0,o.useMemo)((function(){return{registerOption:k,firstOption:g,containsCheckedOption:x,change:w,disabled:a,value:t}}),[k,g,x,w,a,t]),O={ref:b,id:y,role:"radiogroup","aria-labelledby":d,"aria-describedby":v,onKeyDown:S};return i().createElement(h,{name:"RadioGroup.Description"},i().createElement(p,{name:"RadioGroup.Label"},i().createElement(vn.Provider,{value:j},X({props:q({},u,O),defaultTag:"div",name:"RadioGroup"}))))}!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(bn||(bn={}));gn.Option=function e(t){var n=(0,o.useRef)(null),r="headlessui-radiogroup-option-"+ce(),a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=function(e){void 0===e&&(e=0);var t=(0,o.useState)(e),n=t[0],r=t[1];return{addFlag:(0,o.useCallback)((function(e){return r((function(t){return t|e}))}),[r]),hasFlag:(0,o.useCallback)((function(e){return Boolean(n&e)}),[n]),removeFlag:(0,o.useCallback)((function(e){return r((function(t){return t&~e}))}),[r]),toggleFlag:(0,o.useCallback)((function(e){return r((function(t){return t^e}))}),[r])}}(bn.Empty),p=d.addFlag,m=d.removeFlag,v=d.hasFlag,h=t.value,y=t.disabled,b=void 0!==y&&y,g=K(t,["value","disabled"]),x=(0,o.useRef)({value:h,disabled:b});oe((function(){x.current.value=h}),[h,x]),oe((function(){x.current.disabled=b}),[b,x]);var w=hn([gn.name,e.name].join(".")),S=w.registerOption,k=w.disabled,j=w.change,O=w.firstOption,C=w.containsCheckedOption,E=w.value;oe((function(){return S({id:r,element:n,propsRef:x})}),[r,S,n,t]);var P=(0,o.useCallback)((function(){var e;j(h)&&(p(bn.Active),null==(e=n.current)||e.focus())}),[p,j,h]),I=(0,o.useCallback)((function(){return p(bn.Active)}),[p]),N=(0,o.useCallback)((function(){return m(bn.Active)}),[m]),T=(null==O?void 0:O.id)===r,R=k||b,_=E===h,A={ref:n,id:r,role:"radio","aria-checked":_?"true":"false","aria-labelledby":u,"aria-describedby":l,tabIndex:R?-1:_||!C&&T?0:-1,onClick:R?void 0:P,onFocus:R?void 0:I,onBlur:R?void 0:N},L=(0,o.useMemo)((function(){return{checked:_,disabled:R,active:v(bn.Active)}}),[_,R,v]);return i().createElement(f,{name:"RadioGroup.Description"},i().createElement(s,{name:"RadioGroup.Label"},X({props:q({},g,A),slot:L,defaultTag:"div",name:"RadioGroup.Option"})))},gn.Label=pn,gn.Description=Fe;var xn=(0,o.createContext)(null);xn.displayName="GroupContext";var wn=o.Fragment;var Sn;function kn(e){var t=e.checked,n=e.onChange,r=K(e,["checked","onChange"]),i="headlessui-switch-"+ce(),a=(0,o.useContext)(xn),u=(0,o.useCallback)((function(){return n(!t)}),[n,t]),s=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),u()}),[u]),c=(0,o.useCallback)((function(e){e.key!==J.Tab&&e.preventDefault(),e.key===J.Space&&u()}),[u]),l=(0,o.useCallback)((function(e){return e.preventDefault()}),[]),f=(0,o.useMemo)((function(){return{checked:t}}),[t]),d={id:i,ref:null===a?void 0:a.setSwitch,role:"switch",tabIndex:0,"aria-checked":t,"aria-labelledby":null==a?void 0:a.labelledby,"aria-describedby":null==a?void 0:a.describedby,onClick:s,onKeyUp:c,onKeyPress:l};return"button"===r.as&&Object.assign(d,{type:"button"}),X({props:q({},r,d),slot:f,defaultTag:"button",name:"Switch"})}function jn(){var e=(0,o.useRef)(!0);return(0,o.useEffect)((function(){e.current=!1}),[]),e.current}function On(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function Cn(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function En(e,t,n,r,o){var i=bt(),a=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return On.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){Cn.apply(void 0,[e].concat(n)),On.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=bt();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0],a=o[1];return 0!==i?n.setTimeout((function(){t(Sn.Finished)}),i+a):t(Sn.Finished),n.add((function(){return t(Sn.Cancelled)})),n.dispose}(e,(function(n){return Cn.apply(void 0,[e].concat(r,t)),a(n)})))})),i.add((function(){return Cn.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return a(Sn.Cancelled)})),i.dispose}function Pn(e){return void 0===e&&(e=""),(0,o.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}kn.Group=function(e){var t=(0,o.useState)(null),n=t[0],r=t[1],a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=(0,o.useMemo)((function(){return{switch:n,setSwitch:r,labelledby:u,describedby:l}}),[n,r,u,l]);return i().createElement(f,{name:"Switch.Description"},i().createElement(s,{name:"Switch.Label",props:{onClick:function(){n&&(n.click(),n.focus({preventScroll:!0}))}}},i().createElement(xn.Provider,{value:d},X({props:e,defaultTag:wn,name:"Switch.Group"}))))},kn.Label=pn,kn.Description=Fe,function(e){e.Finished="finished",e.Cancelled="cancelled"}(Sn||(Sn={}));var In,Nn=(0,o.createContext)(null);Nn.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(In||(In={}));var Tn=(0,o.createContext)(null);function Rn(e){return"children"in e?Rn(e.children):e.current.filter((function(e){return e.state===In.Visible})).length>0}function _n(e){var t=(0,o.useRef)(e),n=(0,o.useRef)([]),r=we();(0,o.useEffect)((function(){t.current=e}),[e]);var i=(0,o.useCallback)((function(e,o){var i;void 0===o&&(o=Y.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&($(o,((i={})[Y.Unmount]=function(){n.current.splice(a,1)},i[Y.Hidden]=function(){n.current[a].state=In.Hidden},i)),!Rn(n)&&r.current&&(null==t.current||t.current()))}),[t,r,n]),a=(0,o.useCallback)((function(e){var t=n.current.find((function(t){return t.id===e}));return t?t.state!==In.Visible&&(t.state=In.Visible):n.current.push({id:e,state:In.Visible}),function(){return i(e,Y.Unmount)}}),[n,i]);return(0,o.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function An(){}Tn.displayName="NestingContext";var Ln=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Dn(e){for(var t,n={},r=z(Ln);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:An}return n}var Fn=Q.RenderStrategy;function Mn(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,u=e.afterLeave,s=e.enter,c=e.enterFrom,l=e.enterTo,f=e.leave,d=e.leaveFrom,p=e.leaveTo,m=K(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),v=(0,o.useRef)(null),h=(0,o.useState)(In.Visible),y=h[0],b=h[1],g=m.unmount?Y.Unmount:Y.Hidden,x=function(){var e=(0,o.useContext)(Nn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),w=x.show,S=x.appear,k=function(){var e=(0,o.useContext)(Tn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=k.register,O=k.unregister,C=jn(),E=ce(),P=(0,o.useRef)(!1),I=_n((function(){P.current||(b(In.Hidden),O(E),D.current.afterLeave())}));oe((function(){if(E)return j(E)}),[j,E]),oe((function(){var e;g===Y.Hidden&&E&&(w&&y!==In.Visible?b(In.Visible):$(y,((e={})[In.Hidden]=function(){return O(E)},e[In.Visible]=function(){return j(E)},e)))}),[y,E,j,O,w,g]);var N=Pn(s),T=Pn(c),R=Pn(l),_=Pn(f),A=Pn(d),L=Pn(p),D=function(e){var t=(0,o.useRef)(Dn(e));return(0,o.useEffect)((function(){t.current=Dn(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:u}),F=ae();(0,o.useEffect)((function(){if(F&&y===In.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,y,F]);var M=C&&!S;oe((function(){var e=v.current;if(e&&!M)return P.current=!0,w&&D.current.beforeEnter(),w||D.current.beforeLeave(),w?En(e,N,T,R,(function(e){P.current=!1,e===Sn.Finished&&D.current.afterEnter()})):En(e,_,A,L,(function(e){P.current=!1,e===Sn.Finished&&(Rn(I)||(b(In.Hidden),O(E),D.current.afterLeave()))}))}),[D,E,P,O,I,v,M,w,N,T,R,_,A,L]);var B={ref:v},U=m;return i().createElement(Tn.Provider,{value:I},i().createElement(Ve,{value:$(y,(t={},t[In.Visible]=Me.Open,t[In.Hidden]=Me.Closed,t))},X({props:q({},U,B),defaultTag:"div",features:Fn,visible:y===In.Visible,name:"Transition.Child"})))}function Bn(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,u=e.unmount,s=K(e,["show","appear","unmount"]),c=Ue();void 0===n&&null!==c&&(n=$(c,((t={})[Me.Open]=!0,t[Me.Closed]=!1,t)));if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var l=(0,o.useState)(n?In.Visible:In.Hidden),f=l[0],d=l[1],p=_n((function(){d(In.Hidden)})),m=jn(),v=(0,o.useMemo)((function(){return{show:n,appear:a||!m}}),[n,a,m]);(0,o.useEffect)((function(){n?d(In.Visible):Rn(p)||d(In.Hidden)}),[n,p]);var h={unmount:u};return i().createElement(Tn.Provider,{value:p},i().createElement(Nn.Provider,{value:v},X({props:q({},h,{as:o.Fragment,children:i().createElement(Mn,Object.assign({},h,s))}),defaultTag:o.Fragment,features:Fn,visible:f===In.Visible,name:"Transition"})))}Bn.Child=Mn,Bn.Root=Bn;const Un=wp.i18n;var Vn=n(246);function Gn(e){var t=e.className,n=e.hideLibrary,r=e.initialFocus,o=G((function(e){return e.remainingImports})),i=G((function(e){return e.apiKey})),a=G((function(e){return e.allowedImports}));return(0,Vn.jsx)("div",{className:t,children:(0,Vn.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,Vn.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,Vn.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,Vn.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Vn.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,Un.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,Vn.jsx)(Vn.Fragment,{children:(0,Vn.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,Vn.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up","extendify-sdk")}),(0,Vn.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"m-0 p-0 px-6 text-sm bg-gray-50 border-r border-gray-300 h-full flex items-center",children:(0,Un.sprintf)((0,Un.__)("Imports left: %s / %s"),o(),Number(a))})]})})]}),(0,Vn.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,Vn.jsxs)("button",{ref:r,type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,Vn.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",size:"24",role:"img","aria-hidden":"true",focusable:"false",children:(0,Vn.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})}),(0,Vn.jsx)("span",{className:"sr-only",children:(0,Un.__)("Close library","extendify-sdk")})]})})]})})}const Hn=wp.blockEditor,qn=lodash;var Kn=function(){return T.get("taxonomies")};const Wn=wp.components;var zn=n(42),$n=n.n(zn);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jn(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 Jn(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 Jn(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 Xn(e){var t=Yn(e.taxonomy,2),n=t[0],o=t[1],i=e.open,a=g((function(e){return e.updateTaxonomies})),u=g((function(e){return e.resetTaxonomies})),s=g((function(e){return e.searchParams})),c=Yn((0,r.useState)({}),2),l=c[0],f=c[1],d=Yn((0,r.useState)({}),2),p=d[0],m=d[1],v=(0,r.useRef)(),h=(0,r.useRef)(),y=(0,r.useRef)(),b=(0,r.useRef)(!0),x=function(e){var t;return(null==s?void 0:s.taxonomies[n])===e.term||(null===(t=e.children)||void 0===t?void 0:t.filter((function(e){return e.term===(null==s?void 0:s.taxonomies[n])})).length)>0},w=function(e){var t;return Object.prototype.hasOwnProperty.call(e,"children")?e.children.filter((function(e){return null==e?void 0:e.type.includes(s.type)})).length:null==e||null===(t=e.type)||void 0===t?void 0:t.includes(s.type)};if((0,r.useEffect)((function(){b.current?b.current=!1:(f({}),u())}),[s.type,u]),(0,r.useEffect)((function(){Object.keys(l).length?setTimeout((function(){requestAnimationFrame((function(){m(v.current.clientHeight),y.current.focus()}))}),200):m("auto")}),[l]),!Object.keys(o).length||!Object.values(o).filter((function(e){return w(e)})).length)return"";var S=n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}));return(0,Vn.jsx)(Wn.PanelBody,{title:S,initialOpen:i,children:(0,Vn.jsx)(Wn.PanelRow,{children:(0,Vn.jsxs)("div",{className:"overflow-hidden w-full relative",style:{height:p},children:[(0,Vn.jsxs)("ul",{className:$n()("p-1 m-0 w-full transform transition duration-200",{"-translate-x-full":Object.keys(l).length}),children:[(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:h,onClick:function(){a(Qn({},n,"pattern"===s.type&&"tax_categories"===n?"Default":""))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":!s.taxonomies[n].length||"Default"===(null==s?void 0:s.taxonomies[n])}),children:"pattern"===s.type&&"tax_categories"===n?(0,Un.__)("Default","extendify-sdk"):(0,Un.__)("All","extendify-sdk")})})}),Object.values(o).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 w-full",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){Object.prototype.hasOwnProperty.call(e,"children")?f(e):a(Qn({},n,e.term))},children:[(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term}),Object.prototype.hasOwnProperty.call(e,"children")&&(0,Vn.jsx)("span",{className:"text-black",children:(0,Vn.jsx)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",className:"stroke-current",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})})})]})},e.term)}))]}),(0,Vn.jsxs)("ul",{ref:v,className:$n()("p-1 m-0 w-full transform transition duration-200 absolute top-0 right-0",{"translate-x-full":!Object.keys(l).length}),children:[Object.values(l).length>0&&(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer font-bold flex space-x-4 items-center py-2 pr-4 m-0leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:y,onClick:function(){f({}),h.current.focus()},children:[(0,Vn.jsx)("svg",{className:"stroke-current transform rotate-180",width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})}),(0,Vn.jsx)("span",{children:l.term})]})}),Object.values(l).length&&Object.values(l.children).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 pl-6 w-full flex justify-between items-center",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){a(Qn({},n,e.term))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term})})},e.term)}))]})]})})})}function Zn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function er(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function tr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nr(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 nr(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 nr(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 rr(){var e,t=g((function(e){return e.updateSearchParams})),n=g((function(e){return e.setupDefaultTaxonomies})),o=g((function(e){return e.searchParams})),i=(0,qn.debounce)((function(e){return t({taxonomies:{},search:e})}),500),a=tr((0,r.useState)(null!==(e=null==o?void 0:o.search)&&void 0!==e?e:""),2),u=a[0],s=a[1],c=tr((0,r.useState)({}),2),l=c[0],f=c[1],d=(0,r.useCallback)(er(S().mark((function e(){var t;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kn();case 2:t=e.sent,n(t),f(t);case 5:case"end":return e.stop()}}),e)}))),[n]);return(0,r.useEffect)((function(){d()}),[d]),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"pt-1 -mt-1 mb-1 bg-white",children:(0,Vn.jsx)(Hn.__experimentalSearchForm,{placeholder:(0,Un.__)("What are you looking for?","extendify-sdk"),onChange:function(e){g.setState({nextPage:""}),s(e),i(e)},value:u,className:"sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"})}),(0,Vn.jsx)("div",{className:"flex-grow hidden overflow-y-auto pb-32 pr-2 sm:block",children:(0,Vn.jsx)(Wn.Panel,{children:Object.entries(l).map((function(e,t){return(0,Vn.jsx)(Xn,{open:!1,taxonomy:e},t)}))})})]})}function or(e){var t=e.taxonomies,n=e.search,r=e.type,o=[],i=Object.entries(t).filter((function(e){return Boolean(e[1].length)})).map((function(e){return"".concat(e[0],' = "').concat(e[1],'"')})).join(", ");return i.length&&o.push(i),n.length&&o.push('OR(FIND(LOWER("'.concat(n,'"), LOWER(title))!= 0, FIND(LOWER("').concat(n,'"), LOWER({tax_categories})) != 0)')),r.length&&o.push('{type}="'.concat(r,'"')),o.length?"AND(".concat(o.join(", "),")").replace(/\r?\n|\r/g,""):""}function ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var ar=0,ur=function(e,t){return(n=S().mark((function n(){var r,o,i;return S().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return ar++,o=N.CancelToken.source(),null!==(r=g.getState().fetchToken)&&void 0!==r&&r.cancel&&g.getState().fetchToken.cancel(),g.setState({fetchToken:o}),n.next=6,T.post("templates",{filterByFormula:or(e),pageSize:l,categories:e.taxonomies,search:e.search,type:e.type,offset:t,initial:1===ar,request_count:ar},{cancelToken:o.token});case 6:return i=n.sent,g.setState({fetchToken:null}),n.abrupt("return",i);case 9:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){ir(i,r,o,a,u,"next",e)}function u(e){ir(i,r,o,a,u,"throw",e)}a(void 0)}))})();var n},sr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,maybe_import:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},cr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,single:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},lr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,imported:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})};function fr(){return(fr=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)}var dr=new Map,pr=new WeakMap,mr=0;function vr(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(pr.has(n)||(mr+=1,pr.set(n,mr.toString())),pr.get(n)):"0":e[t]);var n})).toString()}function hr(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=vr(e),n=dr.get(t);if(!n){var r,o=new Map,i=new IntersectionObserver((function(t){t.forEach((function(t){var n,i=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=o.get(t.target))||n.forEach((function(e){e(i,t)}))}))}),e);r=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:o},dr.set(t,n)}return n}(n),o=r.id,i=r.observer,a=r.elements,u=a.get(e)||[];return a.has(e)||a.set(e,u),u.push(t),i.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(a.delete(e),i.unobserve(e)),0===a.size&&(i.disconnect(),dr.delete(o))}}function yr(e){return"function"!=typeof e.children}var br=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),yr(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},i.componentWillUnmount=function(){this.unobserve(),this.node=null},i.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,o=e.trackVisibility,i=e.delay;this._unobserveCb=hr(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:o,delay:i})}},i.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},i.render=function(){if(!yr(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var r=this.props,i=r.children,a=r.as,u=r.tag,s=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}(r,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"]);return(0,o.createElement)(a||u||"div",fr({ref:this.handleNode},s),i)},r}(o.Component);br.displayName="InView",br.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function gr(e){return function(e){if(Array.isArray(e))return jr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||kr(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 xr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xr(i,r,o,a,u,"next",e)}function u(e){xr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||kr(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 kr(e,t){if(e){if("string"==typeof e)return jr(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)?jr(e,t):void 0}}function jr(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 Or(e){var t=e.templates,n=g((function(e){return e.setActive})),i=g((function(e){return e.activeTemplate})),a=g((function(e){return e.appendTemplates})),u=Sr((0,r.useState)(""),2),s=u[0],c=u[1],l=Sr((0,r.useState)(!1),2),f=l[0],d=l[1],p=Sr((0,r.useState)([]),2),m=p[0],v=p[1],h=Sr(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,i=t.trackVisibility,a=t.rootMargin,u=t.root,s=t.triggerOnce,c=t.skip,l=t.initialInView,f=(0,o.useRef)(),d=(0,o.useState)({inView:!!l}),p=d[0],m=d[1],v=(0,o.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),c||e&&(f.current=hr(e,(function(e,t){m({inView:e,entry:t}),t.isIntersecting&&s&&f.current&&(f.current(),f.current=void 0)}),{root:u,rootMargin:a,threshold:n,trackVisibility:i,delay:r}))}),[Array.isArray(n)?n.toString():n,u,a,s,c,i,r]);(0,o.useEffect)((function(){f.current||!p.entry||s||c||m({inView:!!l})}));var h=[v,p.inView,p.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}(),2),y=h[0],b=h[1],x=g((function(e){return e.updateSearchParams})),w=g((function(e){return e.searchParams})),k=(0,r.useRef)(g.getState().nextPage),j=(0,r.useRef)(g.getState().searchParams);(0,r.useEffect)((function(){return g.subscribe((function(e){return k.current=e}),(function(e){return e.nextPage}))}),[]),(0,r.useEffect)((function(){return g.subscribe((function(e){return j.current=e}),(function(e){return e.searchParams}))}),[]);var O=(0,r.useCallback)(wr(S().mark((function e(){var t,n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(""),d(!1),e.next=4,ur(j.current,k.current).catch((function(e){console.error(e),c(e&&e.message?e.message:(0,Un.__)("Unknown error occured. Check browser console or contact support.","extendify-sdk"))}));case 4:null!=(n=e.sent)&&null!==(t=n.error)&&void 0!==t&&t.length&&c(null==n?void 0:n.error),null!=n&&n.records&&w===j.current&&(a(n.records),d(n.records.length<=0),g.setState({nextPage:n.offset}));case 7:case"end":return e.stop()}}),e)}))),[w,a]);return(0,r.useEffect)((function(){Object.keys(j.current.taxonomies).length&&(v([]),O())}),[O,j]),(0,r.useEffect)((function(){b&&O()}),[b,O]),s.length?(0,Vn.jsxs)("div",{className:"text-left",children:[(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("Server error","extendify-sdk")}),(0,Vn.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:s}),(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:function(){v([]),x({taxonomies:{},search:""}),O()},children:(0,Un.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.sprintf)((0,Un.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("No results found.","extendify-sdk")}):t.length?(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("ul",{className:"flex-grow gap-6 grid xl:grid-cols-2 2xl:grid-cols-3 pb-32 m-0",children:t.map((function(e,t){var r,o,a,u,s,c,l,f,d;return(0,Vn.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,Vn.jsx)("div",{className:"flex justify-items-center flex-grow h-80 border-gray-200 bg-white border border-b-0 group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",onClick:function(){return n(e)},children:(0,Vn.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return v([].concat(gr(m),[t]))},src:null!==(r=null==e||null===(o=e.fields)||void 0===o||null===(a=o.screenshot[0])||void 0===a||null===(u=a.thumbnails)||void 0===u||null===(s=u.large)||void 0===s?void 0:s.url)&&void 0!==r?r:null==e||null===(c=e.fields)||void 0===c||null===(l=c.screenshot[0])||void 0===l?void 0:l.url})}),(0,Vn.jsx)("span",{role:"img","aria-hidden":"true",className:"h-px w-full bg-gray-200 border group-hover:bg-transparent border-t-0 border-b-0 border-gray-200 group-hover:border-wp-theme-500 transition duration-150"}),(0,Vn.jsxs)("div",{className:"bg-transparent text-left bg-white flex items-center justify-between p-4 border border-t-0 border-transparent group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",role:"button",onClick:function(){return n(e)},children:[(0,Vn.jsxs)("div",{children:[(0,Vn.jsx)("h4",{className:"m-0 font-bold",children:e.fields.title}),(0,Vn.jsx)("p",{className:"m-0",children:null==e||null===(f=e.fields)||void 0===f||null===(d=f.tax_categories)||void 0===d?void 0:d.filter((function(e){return"default"!==e.toLowerCase()})).join(", ")})]}),(0,Vn.jsx)(Wn.Button,{isSecondary:!0,tabIndex:Object.keys(i).length?"-1":"0",className:"sm:opacity-0 group-hover:opacity-100 transition duration-150 focus:opacity-100",onClick:function(t){t.stopPropagation(),n(e)},children:(0,Un.__)("View","extendify-sdk")})]})]},e.id)}))}),g.getState().nextPage&&!!m.length&&m.length===t.length&&(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"-translate-y-full flex flex-col h-80 items-end justify-end my-2 relative transform z-0 text",ref:y,style:{zIndex:-1}}),(0,Vn.jsx)("div",{className:"my-4",children:(0,Vn.jsx)(Wn.Spinner,{})})]})]}):(0,Vn.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,Vn.jsx)(Wn.Spinner,{})})}var Cr=function(){return T.get("plugins")},Er=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),T.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},Pr=function(){return T.get("active-plugins")};function Ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Nr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ir(i,r,o,a,u,"next",e)}function u(e){Ir(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Tr(e){return Rr.apply(this,arguments)}function Rr(){return(Rr=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,Cr();case 6:return e.t1=e.sent,o=e.t0.keys.call(e.t0,e.t1),i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})),e.abrupt("return",i.length);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _r(e){return Ar.apply(this,arguments)}function Ar(){return(Ar=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,Pr();case 6:if(e.t1=e.sent,o=e.t0.values.call(e.t0,e.t1),!(i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})))){e.next=14;break}return e.next=12,Tr(t);case 12:if(!e.sent){e.next=14;break}return e.abrupt("return",!1);case 14:return e.abrupt("return",i.length);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Lr=s(I((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function Dr(e){var t=e.msg;return(0,Vn.jsxs)(Wn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Wn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Wr,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}const Fr=wp.data;function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Br(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 Br(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 Br(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 Ur(){var e=Mr((0,r.useState)(!1),2),t=e[0],n=e[1],o=function(){location.reload()};return(0,(0,Fr.select)("core/editor").isEditedPostDirty)()?(0,Vn.jsxs)(Wn.Modal,{title:(0,Un.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:(0,Un.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:o,disabled:t,children:(0,Un.__)("Reload page","extendify-sdk")}),(0,Vn.jsx)(Wn.Button,{isSecondary:!0,onClick:function(){n(!0),(0,Fr.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,Un.__)("Save changes","extendify-sdk")})]})]}):(o(),null)}function Vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gr(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 Gr(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 Gr(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 Hr(){var e,t=Vr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Lr.setState({importOnLoad:!0}),(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;o(t)})),n?(0,Vn.jsx)(Dr,{msg:n}):(0,Vn.jsx)(Wn.Modal,{title:(0,Un.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Wn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Installing...","extendify-sdk")})})}var qr=function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"broken-event",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";G.setState({entryPoint:e}),window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0}))}(e,"open")};function Kr(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Wr(e){var t,n,o,i,a,u,s,c=Lr((function(e){return e.wantedTemplate})),l=function(){e.forceOpen||(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},f=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Wn.Modal,{title:null!==(n=e.title)&&void 0!==n?n:(0,Un.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, take me back","extendify-sdk"),onRequestClose:l,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following to be automatically installed and activated:",null!==(i=null==c||null===(a=c.fields)||void 0===a?void 0:a.type)&&void 0!==i?i:"template"),"extendify-sdk")}),(null===(u=e.message)||void 0===u?void 0:u.length)>0||(0,Vn.jsx)("ul",{children:f.map((function(e){return(0,Vn.jsx)("li",{children:Kr(e)},e)}))}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Hr,{}),document.getElementById("extendify-root"))},children:null!==(s=e.buttonLabel)&&void 0!==s?s:(0,Un.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:l,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, take me back","extendify-sdk")})]})]})}function zr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zr(i,r,o,a,u,"next",e)}function u(e){zr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var Qr=function(){var e=$r(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tr(t);case 2:return e.t0=!e.sent,e.t1=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(Wr,{}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasRequiredPlugins",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Yr(e){var t=e.msg;return(0,Vn.jsxs)(Wn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Wn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,Vn.jsx)(no,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}function Jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jr(i,r,o,a,u,"next",e)}function u(e){Jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Zr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eo(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 eo(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 eo(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 to(){var e,t=Zr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Lr.setState({importOnLoad:!0})})).then(Xr(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout(e,1e3)}));case 2:(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"));case 3:case"end":return e.stop()}}),e)})))).catch((function(e){var t=e.response;o(t.data.message)})),n?(0,Vn.jsx)(Yr,{msg:n}):(0,Vn.jsx)(Wn.Modal,{title:(0,Un.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Wn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Activating...","extendify-sdk")})})}function no(e){var t,n,o,i,a=Lr((function(e){return e.wantedTemplate})),u=function(){return(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},s=(null==a||null===(t=a.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Wn.Modal,{title:(0,Un.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, return to library","extendify-sdk"),onRequestClose:u,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(n=e.message)&&void 0!==n?n:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following plugins to be installed and activated:",null!==(o=null==a||null===(i=a.fields)||void 0===i?void 0:i.type)&&void 0!==o?o:"template"),"extendify-sdk")}),(0,Vn.jsx)("ul",{children:s.map((function(e){return(0,Vn.jsx)("li",{children:Kr(e)},e)}))}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(to,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:u,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, return to library","extendify-sdk")})]})]})}function ro(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,u,"next",e)}function u(e){ro(i,r,o,a,u,"throw",e)}a(void 0)}))}}var io=function(){var e=oo(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_r(t);case 2:return e.t0=!e.sent,e.t1=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(no,{showClose:!0}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasPluginsActivated",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ao(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return uo(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 uo(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uo(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 so(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function co(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){so(i,r,o,a,u,"next",e)}function u(e){so(i,r,o,a,u,"throw",e)}a(void 0)}))}}function lo(e){return function(){return new fo(e.apply(this,arguments))}}function fo(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,u=a instanceof po;Promise.resolve(u?a.wrapped:a).then((function(e){u?r("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(i,a){var u={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=u:(t=n=u,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function po(e){this.wrapped=e}fo.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fo.prototype.next=function(e){return this._invoke("next",e)},fo.prototype.throw=function(e){return this._invoke("throw",e)},fo.prototype.return=function(e){return this._invoke("return",e)};function mo(){return(mo=co(S().mark((function e(t){var n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=vo(t);case 1:return e.next=4,n.next();case 4:if(!e.sent.done){e.next=7;break}return e.abrupt("break",9);case 7:e.next=1;break;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vo(e){return ho.apply(this,arguments)}function ho(){return(ho=lo(S().mark((function e(t){var n,r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ao(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)}function yo(e,t){return(0,(0,Fr.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function bo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return go(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 go(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 go(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 xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:Qr,hasPluginsActivated:io,stack:[],check:function(t){var n=this;return co(S().mark((function r(){var o,i,a;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=ao(e),r.prev=1,a=S().mark((function e(){var r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.value,e.next=3,n["".concat(r)](t);case 3:o=e.sent,setTimeout((function(){n.stack.push(o.pass?o.allow:o.deny)}),0);case 5:case"end":return e.stop()}}),e)})),o.s();case 4:if((i=o.n()).done){r.next=8;break}return r.delegateYield(a(),"t0",6);case 6:r.next=4;break;case 8:r.next=13;break;case 10:r.prev=10,r.t1=r.catch(1),o.e(r.t1);case 13:return r.prev=13,o.f(),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},reset:function(){this.stack=[]}}}(["hasRequiredPlugins","hasPluginsActivated"]);function wo(e){var t=e.template,n=g((function(e){return e.activeTemplateBlocks})),o=G((function(e){return e.canImport})),i=G((function(e){return e.apiKey})),a=x((function(e){return e.setOpen})),u=bo((0,r.useState)(!1),2),s=u[0],c=u[1],l=bo((0,r.useState)(!1),2),f=l[0],d=l[1],p=Lr((function(e){return e.setWanted})),m=function(){(function(e){return mo.apply(this,arguments)})(xo.stack).then((function(){setTimeout((function(){yo(n,t).then((function(){return a(!1)}))}),100)}))};(0,r.useEffect)((function(){return xo.check(t).then((function(){return d(!0)})),function(){return xo.reset()&&d(!1)}}),[t]),(0,r.useEffect)((function(){s&&sr(t)}),[s,t]);return f&&Object.keys(n).length?i||o()?s?(0,Vn.jsx)("button",{type:"button",disabled:!0,className:"components-button is-secondary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){},children:(0,Un.__)("Importing...","extendify-sdk")}):(0,Vn.jsx)("button",{type:"button",className:"components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){return c(!0),p(t),void m()},children:(0,Un.sprintf)((0,Un.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,Vn.jsx)("a",{className:"button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up now","extendify-sdk")}):""}function So(e){var t,n,o,i,a,u,s,c=e.template,l=c.fields.tax_categories,f=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){cr(c)}),[c]),(0,Vn.jsxs)("div",{className:"flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px",children:[(0,Vn.jsxs)("div",{className:"flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl",children:[(0,Vn.jsxs)("div",{className:"text-left m-0 sm:mb-6 p-6 sm:p-0",children:[(0,Vn.jsx)("h1",{className:"leading-tight text-left mb-2.5 sm:text-3xl font-normal",children:c.fields.title}),(0,Vn.jsx)(Wn.ExternalLink,{href:c.fields.url,children:(0,Un.__)("Demo","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:$n()({"inline-flex absolute sm:static sm:top-auto right-0 m-6 sm:m-0 sm:my-6 space-x-3":!0,"top-16 mt-5":!f.length,"top-0":f.length>0}),children:(0,Vn.jsx)(wo,{template:c})})]}),(0,Vn.jsx)("div",{className:"max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46",children:(0,Vn.jsx)("img",{className:"max-w-full w-full",src:null!==(t=null==c||null===(n=c.fields)||void 0===n||null===(o=n.screenshot[0])||void 0===o||null===(i=o.thumbnails)||void 0===i||null===(a=i.full)||void 0===a?void 0:a.url)&&void 0!==t?t:null==c||null===(u=c.fields)||void 0===u||null===(s=u.screenshot[0])||void 0===s?void 0:s.url})}),(0,Vn.jsxs)("div",{className:"text-xs text-left p-6 w-full block sm:hidden",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:l.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]})]})}function ko(){return 0===G((function(e){return e.apiKey})).length?(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log into account","extendify-sdk")}):(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return G.setState({apiKey:""})},children:(0,Un.__)("Log out","extendify-sdk")})}function jo(e){var t=e.children;return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,Vn.jsx)("div",{className:"sm:w-56 lg:w-72 sticky flex flex-col h-full",children:t[0]}),(0,Vn.jsxs)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:[(0,Vn.jsx)("div",{children:(0,Vn.jsx)(Wn.Button,{isSecondary:!0,target:"_blank",href:"https://extendify.com/feedback",children:(0,Un.__)("Send us your feedback","extendify-sdk")})}),(0,Vn.jsx)("div",{className:"border-t border-gray-300",children:(0,Vn.jsx)(ko,{})})]})]}),(0,Vn.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smp:l-12 sm:pt-6 h-full",children:t[1]})]})}function Oo(){var e=g((function(e){return e.updateSearchParams})),t=g((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,Vn.jsxs)("div",{className:"text-left w-full bg-white px-6 sm:px-0 pb-4 sm:pb-6 mt-px border-b sm:border-0",children:[(0,Vn.jsx)("h4",{className:"sr-only",children:(0,Un.__)("Type select","extendify-sdk")}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 space-x-2 inline-flex items-center border border-black button-focus":!0,"bg-gray-900 text-white":"pattern"===t.type,"bg-transparent text-black":"pattern"!==t.type}),onClick:function(){return n("pattern")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H1C0.45 7 0 7.45 0 8V12C0 12.55 0.45 13 1 13ZM0 1V5C0 5.55 0.45 6 1 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H1C0.45 0 0 0.45 0 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Patterns","extendify-sdk")})]}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 px-4 space-x-2 inline-flex items-center border border-black focus:ring-2 focus:ring-wp-theme-500 ring-offset-1 outline-none -ml-px":!0,"bg-gray-900 text-white":"template"===t.type,"bg-transparent text-black":"template"!==t.type}),onClick:function(){return n("template")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M7 13H10C10.55 13 11 12.55 11 12V8C11 7.45 10.55 7 10 7H7C6.45 7 6 7.45 6 8V12C6 12.55 6.45 13 7 13ZM1 13H4C4.55 13 5 12.55 5 12V1C5 0.45 4.55 0 4 0H1C0.45 0 0 0.45 0 1V12C0 12.55 0.45 13 1 13ZM13 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H13C12.45 7 12 7.45 12 8V12C12 12.55 12.45 13 13 13ZM6 1V5C6 5.55 6.45 6 7 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H7C6.45 0 6 0.45 6 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Page templates","extendify-sdk")})]})]})}function Co(e){var t=e.template,n=g((function(e){return e.setActive})),o=(0,r.useRef)(null),i=t.fields,a=i.tax_categories,u=i.required_plugins,s=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){o.current.focus()}),[]),(0,Vn.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!s.length&&(0,Vn.jsxs)("div",{className:"h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")}),(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log in","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"p-6 sm:p-0",children:(0,Vn.jsxs)("button",{ref:o,type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return n({})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsxs)("div",{className:"text-xs text-left pt-20 divide-y w-full hidden sm:block",children:[(0,Vn.jsxs)("div",{className:"w-full",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:a.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]}),(0,Vn.jsxs)("div",{className:"pt-4 w-full",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Required Plugins","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:u.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-extendify-light",children:Kr(e)},e)}))})]})]})]})}function Eo(){var e=g((function(e){return e.searchParams}));return(0,Vn.jsx)("div",{className:"hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none",children:Object.entries(e.taxonomies).map((function(t){return"template"===e.type&&"tax_pattern_types"===t[0]||"pattern"===e.type&&"tax_page_types"===t[0]?"":(0,Vn.jsxs)("div",{className:"lg:px-2 text-left",children:[(0,Vn.jsx)("span",{className:"font-bold",children:(n=t[0],n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})))}),": ",(0,Vn.jsx)("span",{children:t[1]?t[1]:"All"})]},t[0]);var n}))})}function Po(e){var t=e.className,n=e.initialFocus,r=g((function(e){return e.templates})),o=g((function(e){return e.activeTemplate}));return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsxs)("div",{className:"sm:flex sm:space-x-12 relative bg-white mx-auto max-w-screen-4xl h-full",children:[!!Object.keys(o).length&&(0,Vn.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(Co,{template:o}),(0,Vn.jsx)(So,{template:o})]})}),(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(rr,{initialFocus:n}),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)(Oo,{}),(0,Vn.jsx)(Eo,{}),(0,Vn.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,Vn.jsx)("div",{className:"absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8",children:(0,Vn.jsx)(Or,{templates:r})})})]})]})]})]})}function Io(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function No(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return To(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 To(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 To(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 Ro(){var e=No((0,r.useState)(G.getState().apiKey),2),t=e[0],n=e[1],o=No((0,r.useState)(G.getState().email),2),i=o[0],a=o[1],u=No((0,r.useState)(""),2),s=u[0],c=u[1],l=No((0,r.useState)("info"),2),f=l[0],d=l[1],p=No((0,r.useState)(""),2),m=p[0],v=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var h=function(){var e,n=(e=S().mark((function e(n){var r,o,a,u,s,l;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),c(""),r=i.length?i:m,e.next=5,L(r,t);case 5:if(o=e.sent,a=o.token,u=o.error,s=o.exception,void 0===(l=o.message)){e.next=13;break}return d("error"),e.abrupt("return",c(l.length?l:"Error: Are you interacting with the wrong server?"));case 13:if(!u&&!s){e.next=16;break}return d("error"),e.abrupt("return",c(u.length?u:s));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",c((0,Un.__)("Something went wrong","extendify-sdk")));case 19:return d("success"),c("Success!"),e.next=23,new Promise((function(e){return setTimeout(e,1500)}));case 23:G.setState({apiKey:a}),x.setState({currentPage:"content"});case 25:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Io(i,r,o,a,u,"next",e)}function u(e){Io(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){i||A("user_email").then((function(e){return v(e)}))}),[i]),(0,Vn.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,Vn.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,Un.__)("Welcome","extendify-sdk")}),s&&(0,Vn.jsx)("div",{className:$n()({"border-b pb-6 mb-6 -mt-6":!0,"border-gray-900 text-gray-900":"info"===f,"border-wp-alert-red text-wp-alert-red":"error"===f,"border-extendify-main text-extendify-main":"success"===f}),children:s}),(0,Vn.jsxs)("form",{onSubmit:h,className:" space-y-6",children:[(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,Un.__)("Email:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-email",name:"extendifysdk-login-email",type:"email",className:"border px-2 w-full",placeholder:"Email",value:i.length?i:m,onChange:function(e){return a(e.target.value)}})]}),(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,Un.__)("License:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-license",name:"extendifysdk-login-email",type:"text",className:"border px-2 w-full",placeholder:"License key",value:t,onChange:function(e){return n(e.target.value)}})]}),(0,Vn.jsx)("div",{className:"flex justify-end",children:(0,Vn.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,Un.__)("Sign in","extendify-sdk")})})]})]})}function _o(e){var t=e.className;return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,Vn.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,Vn.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,Vn.jsxs)("button",{type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return x.setState({currentPage:"content"})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsx)("div",{className:"flex justify-center",children:(0,Vn.jsx)(Ro,{})})]})})]})}function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lo(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 Lo(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 Lo(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 Do(){var e=Ao((0,r.useState)(!1),2),t=e[0],n=e[1],o=(0,r.useRef)(null),i=x((function(e){return e.open})),a=x((function(e){return e.setOpen})),u=x((function(e){return e.currentPage}));return(0,Vn.jsx)(Bn.Root,{show:i,as:r.Fragment,children:(0,Vn.jsx)(ot,{as:"div",static:!0,className:"extendify-sdk",initialFocus:o,onClose:function(){},children:(0,Vn.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,Vn.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,Vn.jsx)(ot.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-5",enterTo:"opacity-100 translate-y-0",children:(0,Vn.jsx)("div",{className:$n()({"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all":!0,"lg:pt-5 lg:p-10":!t}),children:(0,Vn.jsxs)("div",{className:$n()({"bg-white h-full flex flex-col items-center relative shadow-xl":!0,"max-w-screen-4xl mx-auto":!t}),children:[(0,Vn.jsx)(Gn,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",toggleFullScreen:function(){return n(!t)},initialFocus:o,hideLibrary:function(){return a(!1)}}),"content"===u&&(0,Vn.jsx)(Po,{className:"w-full flex-grow overflow-hidden"}),"login"===u&&(0,Vn.jsx)(_o,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]})})})]})})})})}function Fo(e){var t=e.show,n=void 0!==t&&t,o=x((function(e){return e.setOpen})),i=(0,r.useCallback)((function(){return o(!0)}),[o]),a=(0,r.useCallback)((function(){o(!1)}),[o]);return(0,r.useEffect)((function(){n&&o(!0)}),[n,o]),(0,r.useEffect)((function(){return window.localStorage.getItem("etfy_library__key")&&G.setState({apiKey:"any-key-will-work-during-beta"}),function(){return window.localStorage.removeItem("etfy_library__key")}}),[]),(0,r.useEffect)((function(){return window.addEventListener("extendify-sdk::open-library",i),window.addEventListener("extendify-sdk::close-library",a),function(){window.removeEventListener("extendify-sdk::open-library",i),window.removeEventListener("extendify-sdk::close-library",a)}}),[a,i]),(0,Vn.jsx)(Do,{})}const Mo=wp.plugins,Bo=wp.editPost;var Uo=function(e){var t,n;qr(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},Vo=(0,Vn.jsx)("div",{id:"extendify-templates-inserter",children:(0,Vn.jsxs)("button",{style:"background:#D9F1EE;color:#1e1e1e;border:1px solid #949494;font-weight:bold;font-size:14px;padding:8px;margin-right:8px",type:"button","data-extendify-identifier":"main-button",id:"extendify-templates-inserter-btn",className:"components-button",children:[(0,Vn.jsxs)("svg",{style:"margin-right:0.5rem",width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Un.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){G.getState().enabled&&(document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Vo)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",Uo)))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(G.getState().enabled&&document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,Vn.jsx)("div",{children:(0,Vn.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,Un.__)("Discover more patterns in Extendify Library","extendify-sdk")})});document.querySelector("[id$=patterns-view]").insertAdjacentHTML("afterbegin",(0,r.renderToString)(e)),document.getElementById("extendify-cta-button").addEventListener("click",Uo)}}),0)}));window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return G.getState().enabled&&(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:Uo,icon:(0,Vn.jsx)("span",{className:"components-menu-items__item-icon",children:(0,Vn.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,Un.__)("Library","extendify-sdk")})}});window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-settings-enable-disable",{render:function(){return(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{onClick:function(){G.setState({enabled:!G.getState().enabled}),requestAnimationFrame((function(){return location.reload()}))},icon:(0,Vn.jsx)(Vn.Fragment,{}),children:G.getState().enabled?(0,Un.__)("Disable Extendify","extendify-sdk"):(0,Un.__)("Enable Extendify","extendify-sdk")})}});var Go={register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,qn.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,Vn.jsx)(Wr,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}};(function(){var e=(0,Fr.dispatch)("core/notices").createNotice,t=G.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){e("info",(0,Un.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),setTimeout((function(){var e;t(),lr(null===(e=n.detail)||void 0===e?void 0:e.template)}),0)}))})(),Go.register(),window._wpLoadBlockEditor&&window.wp.domReady((function(){var e=document.createElement("div");if(e.id="extendify-root",document.body.append(e),(0,r.render)((0,Vn.jsx)(Fo,{}),e),Lr.getState().importOnLoad){var t=Lr.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");yo(p((0,window.wp.blocks.parse)((0,qn.get)(e,"fields.code"))),e)}(t)}),0)}Lr.setState({importOnLoad:!1,wantedTemplate:{}})}))},42:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var u in n)r.call(n,u)&&n[u]&&e.push(u);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},602:()=>{},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,u,s=o(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))n.call(a,l)&&(s[l]=a[l]);if(t){u=t(a);for(var f=0;f<u.length;f++)r.call(a,u[f])&&(s[u[f]]=a[u[f]])}}return s}},61:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=s.length;t;){for(u=s,s=[];++l<t;)u&&u[l].run();l=-1,t=s.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new p(e,t)),1!==s.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},426:(e,t,n)=>{"use strict";n(525);var r=n(804),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)u.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},246:(e,t,n)=>{"use strict";e.exports=n(426)},248:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return N()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?m:d,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=m,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function h(){}function y(){}function b(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,i)&&(g=w);var S=b.prototype=h.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,i,a,u){var s=l(e[o],e,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:N}}function N(){return{value:t,done:!0}}return y.prototype=S.constructor=b,b.constructor=y,y.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},k(j.prototype),j.prototype[a]=function(){return this},e.AsyncIterator=j,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new j(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),s(S,u,"Generator"),S[i]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},804:e=>{"use strict";e.exports=React}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var a=1/0;for(c=0;c<e.length;c++){for(var[n,o,i]=e[c],u=!0,s=0;s<n.length;s++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(u=!1,i<a&&(a=i));u&&(e.splice(c--,1),t=o())}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={172:0,106:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[a,u,s]=n,c=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(s)var l=s(r);for(t&&t(n);c<a.length;c++)i=a[c],r.o(e,i)&&e[i]&&e[i][0](),e[a[c]]=0;return r.O(l)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.O(void 0,[106],(()=>r(501)));var o=r.O(void 0,[106],(()=>r(602)));o=r.O(o)})();
1
  /*! For license information please see extendify-sdk.js.LICENSE.txt */
2
+ (()=>{var e,t={135:(e,t,n)=>{e.exports=n(248)},206:(e,t,n)=>{e.exports=n(57)},387:(e,t,n)=>{"use strict";var r=n(485),o=n(570),i=n(940),a=n(581),u=n(574),s=n(845),c=n(338),l=n(524);e.exports=function(e){return new Promise((function(t,n){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+v)}var h=u(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(h,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||c(h))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),f||(f=null),p.send(f)}))}},57:(e,t,n)=>{"use strict";var r=n(485),o=n(875),i=n(29),a=n(941);function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var s=u(n(141));s.Axios=i,s.create=function(e){return u(a(s.defaults,e))},s.Cancel=n(132),s.CancelToken=n(603),s.isCancel=n(475),s.all=function(e){return Promise.all(e)},s.spread=n(739),s.isAxiosError=n(835),e.exports=s,e.exports.default=s},132:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},603:(e,t,n)=>{"use strict";var r=n(132);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},475:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},29:(e,t,n)=>{"use strict";var r=n(485),o=n(581),i=n(96),a=n(9),u=n(941);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(u(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(u(r||{},{method:e,url:t,data:n}))}})),e.exports=s},96:(e,t,n)=>{"use strict";var r=n(485);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},574:(e,t,n)=>{"use strict";var r=n(642),o=n(288);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},524:(e,t,n)=>{"use strict";var r=n(953);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},9:(e,t,n)=>{"use strict";var r=n(485),o=n(212),i=n(475),a=n(141);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},953:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},941:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(u,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var l=o.concat(i).concat(a).concat(u),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},570:(e,t,n)=>{"use strict";var r=n(524);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},212:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},141:(e,t,n)=>{"use strict";var r=n(61),o=n(485),i=n(446),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(s=n(387)),s),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(u(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){c.headers[e]=o.merge(a)})),e.exports=c},875:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},581:(e,t,n)=>{"use strict";var r=n(485);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},288:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},940:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},642:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},835:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},338:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},446:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},845:(e,t,n)=>{"use strict";var r=n(485),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},739:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},485:(e,t,n)=>{"use strict";var r=n(875),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:s,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){s(t[r])&&s(n)?t[r]=e(t[r],n):s(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},473:(e,t,n)=>{"use strict";const r=wp.element;var o=n(804),i=n.n(o);function a(e){let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(o!==t){const e=t;t=r?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:(e,r,i)=>r||i?((e,r=o,i=Object.is)=>{let a=r(t);function u(){const n=r(t);if(!i(a,n)){const t=a;e(a=n,t)}}return n.add(u),()=>n.delete(u)})(e,r,i):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,o,i),i}const u="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?o.useEffect:o.useLayoutEffect;const s=function(e){const t="function"==typeof e?a(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,o.useReducer)((e=>e+1),0),i=t.getState(),a=(0,o.useRef)(i),s=(0,o.useRef)(e),c=(0,o.useRef)(n),l=(0,o.useRef)(!1),f=(0,o.useRef)();let d;void 0===f.current&&(f.current=e(i));let p=!1;(a.current!==i||s.current!==e||c.current!==n||l.current)&&(d=e(i),p=!n(f.current,d)),u((()=>{p&&(f.current=d),a.current=i,s.current=e,c.current=n,l.current=!1}));const m=(0,o.useRef)(i);return u((()=>{const e=()=>{try{const e=t.getState(),n=s.current(e);c.current(f.current,n)||(a.current=e,f.current=n,r())}catch(e){l.current=!0,r()}},n=t.subscribe(e);return t.getState()!==m.current&&e(),n}),[]),p?d:f.current};return Object.assign(n,t),n[Symbol.iterator]=function*(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),yield n,yield t},n};var c="pattern",l=12;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(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 d(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 d(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 p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=window.wp.blocks.createBlock;return e.map((function(e){var n=f(Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],3),r=n[0],o=n[1],i=n[2];return t(r,o,p(void 0===i?[]:i))}))}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 v(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){h(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 h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||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)||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 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 g=s((function(e,t){return{templates:[],fetchToken:null,activeTemplate:{},activeTemplateBlocks:{},taxonomyDefaultState:{},searchParams:{taxonomies:{},type:c,search:""},nextPage:"",removeTemplates:function(){return e({nextPage:"",templates:[]})},appendTemplates:function(n){return e({templates:y(new Map([].concat(y(t().templates),y(n)).map((function(e){return[e.id,e]}))).values())})},setupDefaultTaxonomies:function(n){var r=Object.keys(n).reduce((function(e,n){return e[n]=function(e){return function(e,t){return"pattern"===e&&"tax_categories"===t?"Default":""}(t().searchParams.type,e)}(n),e}),{}),o={};o.taxonomies=r,e({taxonomyDefaultState:r,searchParams:v({},Object.assign(t().searchParams,o))})},setActive:function(t){var n;if(e({activeTemplate:t}),null!=t&&null!==(n=t.fields)&&void 0!==n&&n.code){var r=window.wp.blocks.parse;e({activeTemplateBlocks:p(r(t.fields.code))})}},resetTaxonomies:function(){var e={tax_categories:"pattern"===t().searchParams.type?"Default":""};t().updateSearchParams({taxonomies:Object.assign(t().taxonomyDefaultState,e)})},updateTaxonomies:function(e){var n={};n.taxonomies=Object.assign({},t().searchParams.taxonomies,e),t().updateSearchParams(n)},updateSearchParams:function(n){null!=n&&n.taxonomies&&!Object.keys(n.taxonomies).length&&(n.taxonomies=t().taxonomyDefaultState),e({templates:[],nextPage:"",searchParams:v({},Object.assign(t().searchParams,n))})}}})),x=s((function(e){return{open:!1,currentPage:"content",setOpen:function(t){e({open:t}),t&&g.getState().removeTemplates()}}})),w=n(135),S=n.n(w),k=Object.defineProperty,j=Object.prototype.hasOwnProperty,O=Object.getOwnPropertySymbols,C=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))j.call(t,n)&&E(e,n,t[n]);if(O)for(var n of O(t))C.call(t,n)&&E(e,n,t[n]);return e};const I=(e,t)=>(n,r,o)=>{const{name:i,getStorage:a=(()=>localStorage),serialize:u=JSON.stringify,deserialize:s=JSON.parse,blacklist:c,whitelist:l,onRehydrateStorage:f,version:d=0,migrate:p}=t||{};let m;try{m=a()}catch(e){}if(!m)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${i}, the given storage is currently unavailable.`),n(...e)}),r,o);const v=async()=>{const e=P({},r());return l&&Object.keys(e).forEach((t=>{!l.includes(t)&&delete e[t]})),c&&c.forEach((t=>delete e[t])),null==m?void 0:m.setItem(i,await u({state:e,version:d}))},h=o.setState;return o.setState=(e,t)=>{h(e,t),v()},(async()=>{const e=(null==f?void 0:f(r()))||void 0;try{const e=await m.getItem(i);if(e){const t=await s(e);if(t.version!==d){const e=await(null==p?void 0:p(t.state,t.version));e&&(n(e),await v())}else n(t.state)}}catch(t){return void(null==e||e(void 0,t))}null==e||e(r(),void 0)})(),e(((...e)=>{n(...e),v()}),r,o)};var N=n(206),T=n.n(N)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function _(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}T.interceptors.response.use((function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"soft_error")&&window.dispatchEvent(new CustomEvent("extendify-sdk::softerror-encountered",{detail:e.soft_error,bubbles:!0})),e}(_(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(_(e.response))}(e)})),T.interceptors.request.use((function(e){return function(e){return e.headers["X-Extendify-Dev-Mode"]=window.location.search.indexOf("DEVMODE")>-1,e.headers["X-Extendify-Local-Mode"]=window.location.search.indexOf("LOCALMODE")>-1,e}(function(e){return e.data&&(e.data.remaining_imports=G.getState().remainingImports(),e.data.entry_point=G.getState().entryPoint,e.data.total_imports=G.getState().imports),e}(e))}),(function(e){return e}));var R=function(){return T.get("user")},A=function(e){return T.get("user-meta",{params:{key:e}})},L=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),T.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},D=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),T.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function F(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){F(i,r,o,a,u,"next",e)}function u(e){F(i,r,o,a,u,"throw",e)}a(void 0)}))}}var B,U,V={getItem:(U=M(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return U.apply(this,arguments)}),setItem:(B=M(S().mark((function e(t,n){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return B.apply(this,arguments)})},G=s(I((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",enabled:!0,incrementImports:function(){return e({imports:t().imports+1})},canImport:function(){return!!t().apiKey||Number(t().imports)<Number(t().allowedImports)},remainingImports:function(){if(t().apiKey)return"unlimited";var e=Number(t().allowedImports)-Number(t().imports);return e>0?e:0}}}),{name:"extendify-user",getStorage:function(){return V}}));const H=ReactDOM;function q(){return(q=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 W(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(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 z(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return K(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)?K(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function $(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(a,$),a}var Q,Y,J;function X(e){var t=e.props,n=e.slot,r=e.defaultTag,o=e.features,i=e.visible,a=void 0===i||i,u=e.name;if(a)return Z(t,n,r,u);var s=null!=o?o:Q.None;if(s&Q.Static){var c=t.static,l=void 0!==c&&c,f=W(t,["static"]);if(l)return Z(f,n,r,u)}if(s&Q.RenderStrategy){var d,p=t.unmount,m=void 0===p||p,v=W(t,["unmount"]);return $(m?Y.Unmount:Y.Hidden,((d={})[Y.Unmount]=function(){return null},d[Y.Hidden]=function(){return Z(q({},v,{hidden:!0,style:{display:"none"}}),n,r,u)},d))}return Z(t,n,r,u)}function Z(e,t,n,r){var i;void 0===t&&(t={});var a=te(e,["unmount","static"]),u=a.as,s=void 0===u?n:u,c=a.children,l=a.refName,f=void 0===l?"ref":l,d=W(a,["as","children","refName"]),p=void 0!==e.ref?((i={})[f]=e.ref,i):{},m="function"==typeof c?c(t):c;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),s===o.Fragment&&Object.keys(d).length>0){if(!(0,o.isValidElement)(m)||Array.isArray(m)&&m.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+r+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,o.cloneElement)(m,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},a=z(n);!(r=a()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(te(d,["ref"])),m.props,["onClick"]),p))}return(0,o.createElement)(s,Object.assign({},te(d,["ref"]),s!==o.Fragment&&p),m)}function ee(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function te(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=z(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=(0,o.useRef)(t);return(0,o.useEffect)((function(){r.current=t}),[t]),(0,o.useCallback)((function(e){for(var t,n=z(r.current);!(t=n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}),[r])}function re(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;var t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(Q||(Q={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(Y||(Y={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(J||(J={}));var oe="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ie={serverHandoffComplete:!1};function ae(){var e=(0,o.useState)(ie.serverHandoffComplete),t=e[0],n=e[1];return(0,o.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,o.useEffect)((function(){!1===ie.serverHandoffComplete&&(ie.serverHandoffComplete=!0)}),[]),t}var ue=0;function se(){return++ue}function ce(){var e=ae(),t=(0,o.useState)(e?se:null),n=t[0],r=t[1];return oe((function(){null===n&&r(se())}),[n]),null!=n?""+n:void 0}var le,fe,de,pe,me,ve=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function he(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(ve))}function ye(e,t){var n;return void 0===t&&(t=pe.Strict),e!==document.body&&$(t,((n={})[pe.Strict]=function(){return e.matches(ve)},n[pe.Loose]=function(){for(var t=e;null!==t;){if(t.matches(ve))return!0;t=t.parentElement}return!1},n))}function be(e){null==e||e.focus({preventScroll:!0})}function ge(e,t){var n=Array.isArray(e)?e:he(e),r=document.activeElement,o=function(){if(t&(le.First|le.Next))return de.Next;if(t&(le.Previous|le.Last))return de.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&le.First)return 0;if(t&le.Previous)return Math.max(0,n.indexOf(r))-1;if(t&le.Next)return Math.max(0,n.indexOf(r))+1;if(t&le.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&le.NoScroll?{preventScroll:!0}:{},u=0,s=n.length,c=void 0;do{var l;if(u>=s||u+s<=0)return fe.Error;var f=i+u;if(t&le.WrapAround)f=(f+s)%s;else{if(f<0)return fe.Underflow;if(f>=s)return fe.Overflow}null==(l=c=n[f])||l.focus(a),u+=o}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),fe.Success}function xe(e,t,n){var r=(0,o.useRef)(t);r.current=t,(0,o.useEffect)((function(){function t(e){r.current.call(window,e)}return window.addEventListener(e,t,n),function(){return window.removeEventListener(e,t,n)}}),[e,n])}function we(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Se(e,t,n){void 0===t&&(t=me.All);var r=void 0===n?{}:n,i=r.initialFocus,a=r.containers,u=(0,o.useRef)("undefined"!=typeof window?document.activeElement:null),s=(0,o.useRef)(null),c=we(),l=Boolean(t&me.RestoreFocus),f=Boolean(t&me.InitialFocus);(0,o.useEffect)((function(){l&&(u.current=document.activeElement)}),[l]),(0,o.useEffect)((function(){if(l)return function(){be(u.current),u.current=null}}),[l]),(0,o.useEffect)((function(){if(f&&e.current){var t=document.activeElement;if(null==i?void 0:i.current){if((null==i?void 0:i.current)===t)return void(s.current=t)}else if(e.current.contains(t))return void(s.current=t);if(null==i?void 0:i.current)be(i.current);else if(ge(e.current,le.First)===fe.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");s.current=document.activeElement}}),[e,i,f]),xe("keydown",(function(n){t&me.TabLock&&e.current&&n.key===J.Tab&&(n.preventDefault(),ge(e.current,(n.shiftKey?le.Previous:le.Next)|le.WrapAround)===fe.Success&&(s.current=document.activeElement))})),xe("focus",(function(n){if(t&me.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var o=s.current;if(o&&c.current){var i=n.target;i&&i instanceof HTMLElement?!function(e,t){for(var n,r=z(e);!(n=r()).done;){var o;if(null==(o=n.value.current)?void 0:o.contains(t))return!0}return!1}(r,i)?(n.preventDefault(),n.stopPropagation(),be(o)):(s.current=i,be(i)):be(s.current)}}}}),!0)}!function(e){e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll"}(le||(le={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(fe||(fe={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(de||(de={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(pe||(pe={})),function(e){e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All"}(me||(me={}));var ke=new Set,je=new Map;function Oe(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Ce(e){var t=je.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var Ee=(0,o.createContext)(!1);function Pe(e){return i().createElement(Ee.Provider,{value:e.force},e.children)}function Ie(){var e=(0,o.useContext)(Ee),t=(0,o.useContext)(Re),n=(0,o.useState)((function(){if(!e&&null!==t)return null;if("undefined"==typeof window)return null;var n=document.getElementById("headlessui-portal-root");if(n)return n;var r=document.createElement("div");return r.setAttribute("id","headlessui-portal-root"),document.body.appendChild(r)})),r=n[0],i=n[1];return(0,o.useEffect)((function(){e||null!==t&&i(t.current)}),[t,i,e]),r}var Ne=o.Fragment;function Te(e){var t=e,n=Ie(),r=(0,o.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],i=ae();return oe((function(){if(n&&r)return n.appendChild(r),function(){var e;n&&(r&&(n.removeChild(r),n.childNodes.length<=0&&(null==(e=n.parentElement)||e.removeChild(n))))}}),[n,r]),i&&n&&r?(0,H.createPortal)(X({props:t,defaultTag:Ne,name:"Portal"}),r):null}var _e=o.Fragment,Re=(0,o.createContext)(null);Te.Group=function(e){var t=e.target,n=W(e,["target"]);return i().createElement(Re.Provider,{value:t},X({props:n,defaultTag:_e,name:"Popover.Group"}))};var Ae=(0,o.createContext)(null);function Le(){var e=(0,o.useContext)(Ae);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return e}function De(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(Ae.Provider,{value:r},e.children)}}),[n])]}function Fe(e){var t=Le(),n="headlessui-description-"+ce();oe((function(){return t.register(n)}),[n,t.register]);var r=e,o=q({},t.props,{id:n});return X({props:q({},r,o),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}var Me,Be=(0,o.createContext)(null);function Ue(){return(0,o.useContext)(Be)}function Ve(e){var t=e.value,n=e.children;return i().createElement(Be.Provider,{value:t},n)}Be.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Me||(Me={}));var Ge,He,qe,We,Ke=(0,o.createContext)((function(){}));function ze(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,u=(0,o.useContext)(Ke),s=(0,o.useCallback)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n.apply(void 0,t),u.apply(void 0,t)}),[u,n]);return oe((function(){return s(Ge.Add,r,a),function(){return s(Ge.Remove,r,a)}}),[s,r,a]),i().createElement(Ke.Provider,{value:s},t)}Ke.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(Ge||(Ge={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(qe||(qe={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(We||(We={}));var $e=((He={})[We.SetTitleId]=function(e,t){return e.titleId===t.id?e:q({},e,{titleId:t.id})},He),Qe=(0,o.createContext)(null);function Ye(e){var t=(0,o.useContext)(Qe);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ot.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ye),n}return t}function Je(e,t){return $(t.type,$e,e,t)}Qe.displayName="DialogContext";var Xe=Q.RenderStrategy|Q.Static,Ze=ee((function(e,t){var n,r=e.open,a=e.onClose,u=e.initialFocus,s=W(e,["open","onClose","initialFocus"]),c=(0,o.useState)(0),l=c[0],f=c[1],d=Ue();void 0===r&&null!==d&&(r=$(d,((n={})[Me.Open]=!0,n[Me.Closed]=!1,n)));var p=(0,o.useRef)(new Set),m=(0,o.useRef)(null),v=ne(m,t),h=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!h&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+r);if("function"!=typeof a)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+a);var b=r?qe.Open:qe.Closed,g=null!==d?d===Me.Open:b===qe.Open,x=(0,o.useReducer)(Je,{titleId:null,descriptionId:null}),w=x[0],S=x[1],k=(0,o.useCallback)((function(){return a(!1)}),[a]),j=(0,o.useCallback)((function(e){return S({type:We.SetTitleId,id:e})}),[S]),O=ae()&&b===qe.Open,C=l>1,E=null!==(0,o.useContext)(Qe);Se(m,O?$(C?"parent":"leaf",{parent:me.RestoreFocus,leaf:me.All}):me.None,{initialFocus:u,containers:p}),function(e,t){void 0===t&&(t=!0),oe((function(){if(t&&e.current){var n=e.current;ke.add(n);for(var r,o=z(je.keys());!(r=o()).done;){var i=r.value;i.contains(n)&&(Ce(i),je.delete(i))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===ke.size&&(je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e))}})),function(){if(ke.delete(n),ke.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!je.has(e)){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e)}}));else for(var e,t=z(je.keys());!(e=t()).done;){var r=e.value;Ce(r),je.delete(r)}}}}),[t])}(m,!!C&&O),xe("mousedown",(function(e){var t,n=e.target;b===qe.Open&&(C||(null==(t=m.current)?void 0:t.contains(n))||k())})),(0,o.useEffect)((function(){if(b===qe.Open&&!E){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[b,E]),(0,o.useEffect)((function(){if(b===qe.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=z(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(m.current),function(){return e.disconnect()}}}),[b,m,k]);var P=De(),I=P[0],N=P[1],T="headlessui-dialog-"+ce(),_=(0,o.useMemo)((function(){return[{dialogState:b,close:k,setTitleId:j},w]}),[b,w,k,j]),R=(0,o.useMemo)((function(){return{open:b===qe.Open}}),[b]),A={ref:v,id:T,role:"dialog","aria-modal":b===qe.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":I,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===J.Escape&&b===qe.Open&&(C||(e.preventDefault(),e.stopPropagation(),k()))}},L=s;return i().createElement(ze,{type:"Dialog",element:m,onUpdate:(0,o.useCallback)((function(e,t,n){var r;"Dialog"===t&&$(e,((r={})[Ge.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[Ge.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},i().createElement(Pe,{force:!0},i().createElement(Te,null,i().createElement(Qe.Provider,{value:_},i().createElement(Te.Group,{target:m},i().createElement(Pe,{force:!1},i().createElement(N,{slot:R,name:"Dialog.Description"},X({props:q({},L,A),slot:R,defaultTag:"div",features:Xe,visible:g,name:"Dialog"}))))))))})),et=ee((function e(t,n){var r=Ye([ot.displayName,e.name].join("."))[0],i=r.dialogState,a=r.close,u=ne(n),s="headlessui-dialog-overlay-"+ce(),c=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),l=(0,o.useMemo)((function(){return{open:i===qe.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:c}),slot:l,defaultTag:"div",name:"Dialog.Overlay"})}));var tt,nt,rt,ot=Object.assign(Ze,{Overlay:et,Title:function e(t){var n=Ye([ot.displayName,e.name].join("."))[0],r=n.dialogState,i=n.setTitleId,a="headlessui-dialog-title-"+ce();(0,o.useEffect)((function(){return i(a),function(){return i(null)}}),[a,i]);var u=(0,o.useMemo)((function(){return{open:r===qe.Open}}),[r]);return X({props:q({},t,{id:a}),slot:u,defaultTag:"h2",name:"Dialog.Title"})},Description:Fe});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(nt||(nt={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(rt||(rt={}));var it=((tt={})[rt.ToggleDisclosure]=function(e){var t;return q({},e,{disclosureState:$(e.disclosureState,(t={},t[nt.Open]=nt.Closed,t[nt.Closed]=nt.Open,t))})},tt[rt.LinkPanel]=function(e){return!0===e.linkedPanel?e:q({},e,{linkedPanel:!0})},tt[rt.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:q({},e,{linkedPanel:!1})},tt[rt.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},tt[rt.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},tt),at=(0,o.createContext)(null);function ut(e){var t=(0,o.useContext)(at);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+lt.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ut),n}return t}function st(e,t){return $(t.type,it,e,t)}at.displayName="DisclosureContext";var ct=o.Fragment;function lt(e){var t,n=e.defaultOpen,r=void 0!==n&&n,a=W(e,["defaultOpen"]),u="headlessui-disclosure-button-"+ce(),s="headlessui-disclosure-panel-"+ce(),c=(0,o.useReducer)(st,{disclosureState:r?nt.Open:nt.Closed,linkedPanel:!1,buttonId:u,panelId:s}),l=c[0].disclosureState,f=c[1];(0,o.useEffect)((function(){return f({type:rt.SetButtonId,buttonId:u})}),[u,f]),(0,o.useEffect)((function(){return f({type:rt.SetPanelId,panelId:s})}),[s,f]);var d=(0,o.useMemo)((function(){return{open:l===nt.Open}}),[l]);return i().createElement(at.Provider,{value:c},i().createElement(Ve,{value:$(l,(t={},t[nt.Open]=Me.Open,t[nt.Closed]=Me.Closed,t))},X({props:a,slot:d,defaultTag:ct,name:"Disclosure"})))}var ft=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n),s=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:rt.ToggleDisclosure})}}),[a]),c=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),l=(0,o.useCallback)((function(e){re(e.currentTarget)||t.disabled||a({type:rt.ToggleDisclosure})}),[a,t.disabled]),f=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]);return X({props:q({},t,{ref:u,id:i.buttonId,type:"button","aria-expanded":i.disclosureState===nt.Open||void 0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:s,onKeyUp:c,onClick:l}),slot:f,defaultTag:"button",name:"Disclosure.Button"})})),dt=Q.RenderStrategy|Q.Static,pt=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n,(function(){i.linkedPanel||a({type:rt.LinkPanel})})),s=Ue(),c=null!==s?s===Me.Open:i.disclosureState===nt.Open;(0,o.useEffect)((function(){return function(){return a({type:rt.UnlinkPanel})}}),[a]),(0,o.useEffect)((function(){var e;i.disclosureState!==nt.Closed||null!=(e=t.unmount)&&!e||a({type:rt.UnlinkPanel})}),[i.disclosureState,t.unmount,a]);var l=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]),f={ref:u,id:i.panelId};return X({props:q({},t,f),slot:l,defaultTag:"div",features:dt,visible:c,name:"Disclosure.Panel"})}));lt.Button=ft,lt.Panel=pt;var mt,vt,ht,yt;function bt(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=z(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function gt(){var e=(0,o.useState)(bt)[0];return(0,o.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}function xt(e,t){var n=(0,o.useState)(e),r=n[0],i=n[1],a=(0,o.useRef)(e);return oe((function(){a.current=e}),[e]),oe((function(){return i(a.current)}),[a,i].concat(t)),r}function wt(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case mt.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case mt.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)}));return-1===r?r:n.length-1-r;case mt.Next:return n.findIndex((function(e,n){return!(n<=o)&&!t.resolveDisabled(e)}));case mt.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case mt.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case mt.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}!function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(mt||(mt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ht||(ht={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(yt||(yt={}));var St=((vt={})[yt.CloseListbox]=function(e){return e.disabled||e.listboxState===ht.Closed?e:q({},e,{activeOptionIndex:null,listboxState:ht.Closed})},vt[yt.OpenListbox]=function(e){return e.disabled||e.listboxState===ht.Open?e:q({},e,{listboxState:ht.Open})},vt[yt.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:q({},e,{disabled:t.disabled})},vt[yt.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=wt(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:q({},e,{searchQuery:"",activeOptionIndex:n})},vt[yt.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=e.searchQuery+t.value.toLowerCase(),r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return-1===r||r===e.activeOptionIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeOptionIndex:r})},vt[yt.ClearSearch]=function(e){return e.disabled||e.listboxState===ht.Closed||""===e.searchQuery?e:q({},e,{searchQuery:""})},vt[yt.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},vt[yt.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},vt),kt=(0,o.createContext)(null);function jt(e){var t=(0,o.useContext)(kt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Et.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,jt),n}return t}function Ot(e,t){return $(t.type,St,e,t)}kt.displayName="ListboxContext";var Ct=o.Fragment;function Et(e){var t,n=e.value,r=e.onChange,a=e.disabled,u=void 0!==a&&a,s=W(e,["value","onChange","disabled"]),c=(0,o.useReducer)(Ot,{listboxState:ht.Closed,propsRef:{current:{value:n,onChange:r}},labelRef:(0,o.createRef)(),buttonRef:(0,o.createRef)(),optionsRef:(0,o.createRef)(),disabled:u,options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,p=l.optionsRef,m=l.buttonRef,v=c[1];oe((function(){d.current.value=n}),[n,d]),oe((function(){d.current.onChange=r}),[r,d]),oe((function(){return v({type:yt.SetDisabled,disabled:u})}),[u]),xe("mousedown",(function(e){var t,n,r,o=e.target;f===ht.Open&&((null==(t=m.current)?void 0:t.contains(o))||(null==(n=p.current)?void 0:n.contains(o))||(v({type:yt.CloseListbox}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=m.current)||r.focus())))}));var h=(0,o.useMemo)((function(){return{open:f===ht.Open,disabled:u}}),[f,u]);return i().createElement(kt.Provider,{value:c},i().createElement(Ve,{value:$(f,(t={},t[ht.Open]=Me.Open,t[ht.Closed]=Me.Closed,t))},X({props:s,slot:h,defaultTag:Ct,name:"Listbox"})))}var Pt=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-listbox-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.Last})}))}}),[u,a,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a.listboxState===ht.Open?(u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),u({type:yt.OpenListbox}))}),[u,l,a]),m=xt((function(){if(a.labelRef.current)return[a.labelRef.current.id,c].join(" ")}),[a.labelRef.current,c]),v=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open,disabled:a.disabled}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.optionsRef.current)?void 0:r.id,"aria-expanded":a.listboxState===ht.Open||void 0,"aria-labelledby":m,disabled:a.disabled,onKeyDown:f,onKeyUp:d,onClick:p}),slot:v,defaultTag:"button",name:"Listbox.Button"})}));var It,Nt,Tt,_t=Q.RenderStrategy|Q.Static,Rt=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.optionsRef,n),c="headlessui-listbox-options-"+ce(),l=gt(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:a.listboxState===ht.Open;oe((function(){var e=a.optionsRef.current;e&&a.listboxState===ht.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[a.listboxState,a.optionsRef]);var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:yt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),null!==a.activeOptionIndex){var t=a.options[a.activeOptionIndex].dataRef;a.propsRef.current.onChange(t.current.value)}bt().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Last});case J.Escape:return e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(u({type:yt.Search,value:e.key}),f.setTimeout((function(){return u({type:yt.ClearSearch})}),350))}}),[l,u,f,a]),v=xt((function(){var e,t,n;return null!=(e=null==(t=a.labelRef.current)?void 0:t.id)?e:null==(n=a.buttonRef.current)?void 0:n.id}),[a.labelRef.current,a.buttonRef.current]),h=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open}}),[a]);return X({props:q({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(r=a.options[a.activeOptionIndex])?void 0:r.id,"aria-labelledby":v,id:c,onKeyDown:m,role:"listbox",tabIndex:0,ref:s}),slot:h,defaultTag:"ul",features:_t,visible:p,name:"Listbox.Options"})}));function At(e){var t=e.container,n=e.accept,r=e.walk,i=e.enabled,a=void 0===i||i,u=(0,o.useRef)(n),s=(0,o.useRef)(r);(0,o.useEffect)((function(){u.current=n,s.current=r}),[n,r]),oe((function(){if(t&&a)for(var e=u.current,n=s.current,r=Object.assign((function(t){return e(t)}),{acceptNode:e}),o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,r,!1);o.nextNode();)n(o.currentNode)}),[t,a,u,s])}Et.Button=Pt,Et.Label=function e(t){var n=jt([Et.name,e.name].join("."))[0],r="headlessui-listbox-label-"+ce(),i=(0,o.useCallback)((function(){var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[n.buttonRef]),a=(0,o.useMemo)((function(){return{open:n.listboxState===ht.Open,disabled:n.disabled}}),[n]);return X({props:q({},t,{ref:n.labelRef,id:r,onClick:i}),slot:a,defaultTag:"label",name:"Listbox.Label"})},Et.Options=Rt,Et.Option=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.value,a=W(t,["disabled","value"]),u=jt([Et.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-listbox-option-"+ce(),f=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===l,d=s.propsRef.current.value===i,p=(0,o.useRef)({disabled:r,value:i});oe((function(){p.current.disabled=r}),[p,r]),oe((function(){p.current.value=i}),[p,i]),oe((function(){var e,t;p.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[p,l]);var m=(0,o.useCallback)((function(){return s.propsRef.current.onChange(i)}),[s.propsRef,i]);oe((function(){return c({type:yt.RegisterOption,id:l,dataRef:p}),function(){return c({type:yt.UnregisterOption,id:l})}}),[p,l]),oe((function(){var e;s.listboxState===ht.Open&&d&&(c({type:yt.GoToOption,focus:mt.Specific,id:l}),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),[s.listboxState]),oe((function(){if(s.listboxState===ht.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.listboxState]);var v=(0,o.useCallback)((function(e){if(r)return e.preventDefault();m(),c({type:yt.CloseListbox}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[c,s.buttonRef,r,m]),h=(0,o.useCallback)((function(){if(r)return c({type:yt.GoToOption,focus:mt.Nothing});c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,l,c]),y=(0,o.useCallback)((function(){r||f||c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,f,l,c]),b=(0,o.useCallback)((function(){r||f&&c({type:yt.GoToOption,focus:mt.Nothing})}),[r,f,c]),g=(0,o.useMemo)((function(){return{active:f,selected:d,disabled:r}}),[f,d,r]);return X({props:q({},a,{id:l,role:"option",tabIndex:-1,"aria-disabled":!0===r||void 0,"aria-selected":!0===d||void 0,onClick:v,onFocus:h,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b}),slot:g,defaultTag:"li",name:"Listbox.Option"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Nt||(Nt={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Tt||(Tt={}));var Lt=((It={})[Tt.CloseMenu]=function(e){return e.menuState===Nt.Closed?e:q({},e,{activeItemIndex:null,menuState:Nt.Closed})},It[Tt.OpenMenu]=function(e){return e.menuState===Nt.Open?e:q({},e,{menuState:Nt.Open})},It[Tt.GoToItem]=function(e,t){var n=wt(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:q({},e,{searchQuery:"",activeItemIndex:n})},It[Tt.Search]=function(e,t){var n=e.searchQuery+t.value.toLowerCase(),r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return-1===r||r===e.activeItemIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeItemIndex:r})},It[Tt.ClearSearch]=function(e){return""===e.searchQuery?e:q({},e,{searchQuery:""})},It[Tt.RegisterItem]=function(e,t){return q({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},It[Tt.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},It),Dt=(0,o.createContext)(null);function Ft(e){var t=(0,o.useContext)(Dt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Ut.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ft),n}return t}function Mt(e,t){return $(t.type,Lt,e,t)}Dt.displayName="MenuContext";var Bt=o.Fragment;function Ut(e){var t,n=(0,o.useReducer)(Mt,{menuState:Nt.Closed,buttonRef:(0,o.createRef)(),itemsRef:(0,o.createRef)(),items:[],searchQuery:"",activeItemIndex:null}),r=n[0],a=r.menuState,u=r.itemsRef,s=r.buttonRef,c=n[1];xe("mousedown",(function(e){var t,n,r,o=e.target;a===Nt.Open&&((null==(t=s.current)?void 0:t.contains(o))||(null==(n=u.current)?void 0:n.contains(o))||(c({type:Tt.CloseMenu}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=s.current)||r.focus())))}));var l=(0,o.useMemo)((function(){return{open:a===Nt.Open}}),[a]);return i().createElement(Dt.Provider,{value:n},i().createElement(Ve,{value:$(a,(t={},t[Nt.Open]=Me.Open,t[Nt.Closed]=Me.Closed,t))},X({props:e,slot:l,defaultTag:Bt,name:"Menu"})))}var Vt,Gt,Ht,qt=ee((function e(t,n){var r,i=Ft([Ut.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-menu-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.Last})}))}}),[u,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===Nt.Open?(u({type:Tt.CloseMenu}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu})))}),[u,l,a,t.disabled]),m=(0,o.useMemo)((function(){return{open:a.menuState===Nt.Open}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.itemsRef.current)?void 0:r.id,"aria-expanded":a.menuState===Nt.Open||void 0,onKeyDown:f,onKeyUp:d,onClick:p}),slot:m,defaultTag:"button",name:"Menu.Button"})})),Wt=Q.RenderStrategy|Q.Static,Kt=ee((function e(t,n){var r,i,a=Ft([Ut.name,e.name].join(".")),u=a[0],s=a[1],c=ne(u.itemsRef,n),l="headlessui-menu-items-"+ce(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:u.menuState===Nt.Open;(0,o.useEffect)((function(){var e=u.itemsRef.current;e&&u.menuState===Nt.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[u.menuState,u.itemsRef]),At({container:u.itemsRef.current,enabled:u.menuState===Nt.Open,accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==u.searchQuery)return e.preventDefault(),e.stopPropagation(),s({type:Tt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),null!==u.activeItemIndex){var t,n=u.items[u.activeItemIndex].id;null==(t=document.getElementById(n))||t.click()}bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Last});case J.Escape:e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(s({type:Tt.Search,value:e.key}),f.setTimeout((function(){return s({type:Tt.ClearSearch})}),350))}}),[s,f,u]),v=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),h=(0,o.useMemo)((function(){return{open:u.menuState===Nt.Open}}),[u]);return X({props:q({},t,{"aria-activedescendant":null===u.activeItemIndex||null==(r=u.items[u.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(i=u.buttonRef.current)?void 0:i.id,id:l,onKeyDown:m,onKeyUp:v,role:"menu",tabIndex:0,ref:c}),slot:h,defaultTag:"div",features:Wt,visible:p,name:"Menu.Items"})})),zt=o.Fragment;Ut.Button=qt,Ut.Items=Kt,Ut.Item=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.onClick,a=W(t,["disabled","onClick"]),u=Ft([Ut.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-menu-item-"+ce(),f=null!==s.activeItemIndex&&s.items[s.activeItemIndex].id===l;oe((function(){if(s.menuState===Nt.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.menuState]);var d=(0,o.useRef)({disabled:r});oe((function(){d.current.disabled=r}),[d,r]),oe((function(){var e,t;d.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[d,l]),oe((function(){return c({type:Tt.RegisterItem,id:l,dataRef:d}),function(){return c({type:Tt.UnregisterItem,id:l})}}),[d,l]);var p=(0,o.useCallback)((function(e){return r?e.preventDefault():(c({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),i?i(e):void 0)}),[c,s.buttonRef,r,i]),m=(0,o.useCallback)((function(){if(r)return c({type:Tt.GoToItem,focus:mt.Nothing});c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,l,c]),v=(0,o.useCallback)((function(){r||f||c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,f,l,c]),h=(0,o.useCallback)((function(){r||f&&c({type:Tt.GoToItem,focus:mt.Nothing})}),[r,f,c]),y=(0,o.useMemo)((function(){return{active:f,disabled:r}}),[f,r]);return X({props:q({},a,{id:l,role:"menuitem",tabIndex:-1,"aria-disabled":!0===r||void 0,onClick:p,onFocus:m,onPointerMove:v,onMouseMove:v,onPointerLeave:h,onMouseLeave:h}),slot:y,defaultTag:zt,name:"Menu.Item"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Gt||(Gt={})),function(e){e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId"}(Ht||(Ht={}));var $t=((Vt={})[Ht.TogglePopover]=function(e){var t;return q({},e,{popoverState:$(e.popoverState,(t={},t[Gt.Open]=Gt.Closed,t[Gt.Closed]=Gt.Open,t))})},Vt[Ht.ClosePopover]=function(e){return e.popoverState===Gt.Closed?e:q({},e,{popoverState:Gt.Closed})},Vt[Ht.SetButton]=function(e,t){return e.button===t.button?e:q({},e,{button:t.button})},Vt[Ht.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},Vt[Ht.SetPanel]=function(e,t){return e.panel===t.panel?e:q({},e,{panel:t.panel})},Vt[Ht.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},Vt),Qt=(0,o.createContext)(null);function Yt(e){var t=(0,o.useContext)(Qt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+tn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Yt),n}return t}Qt.displayName="PopoverContext";var Jt=(0,o.createContext)(null);function Xt(){return(0,o.useContext)(Jt)}Jt.displayName="PopoverGroupContext";var Zt=(0,o.createContext)(null);function en(e,t){return $(t.type,$t,e,t)}Zt.displayName="PopoverPanelContext";function tn(e){var t,n="headlessui-popover-button-"+ce(),r="headlessui-popover-panel-"+ce(),a=(0,o.useReducer)(en,{popoverState:Gt.Closed,button:null,buttonId:n,panel:null,panelId:r}),u=a[0],s=u.popoverState,c=u.button,l=u.panel,f=a[1];(0,o.useEffect)((function(){return f({type:Ht.SetButtonId,buttonId:n})}),[n,f]),(0,o.useEffect)((function(){return f({type:Ht.SetPanelId,panelId:r})}),[r,f]);var d=(0,o.useMemo)((function(){return{buttonId:n,panelId:r,close:function(){return f({type:Ht.ClosePopover})}}}),[n,r,f]),p=Xt(),m=null==p?void 0:p.registerPopover,v=(0,o.useCallback)((function(){var e;return null!=(e=null==p?void 0:p.isFocusWithinPopoverGroup())?e:(null==c?void 0:c.contains(document.activeElement))||(null==l?void 0:l.contains(document.activeElement))}),[p,c,l]);(0,o.useEffect)((function(){return null==m?void 0:m(d)}),[m,d]),xe("focus",(function(){s===Gt.Open&&(v()||c&&l&&f({type:Ht.ClosePopover}))}),!0),xe("mousedown",(function(e){var t=e.target;s===Gt.Open&&((null==c?void 0:c.contains(t))||(null==l?void 0:l.contains(t))||(f({type:Ht.ClosePopover}),ye(t,pe.Loose)||(e.preventDefault(),null==c||c.focus())))}));var h=(0,o.useMemo)((function(){return{open:s===Gt.Open}}),[s]);return i().createElement(Qt.Provider,{value:a},i().createElement(Ve,{value:$(s,(t={},t[Gt.Open]=Me.Open,t[Gt.Closed]=Me.Closed,t))},X({props:e,slot:h,defaultTag:"div",name:"Popover"})))}var nn=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0],a=r[1],u=(0,o.useRef)(null),s=Xt(),c=null==s?void 0:s.closeOthers,l=(0,o.useContext)(Zt),f=null!==l&&l===i.panelId,d=ne(u,n,f?null:function(e){return a({type:Ht.SetButton,button:e})}),p=(0,o.useRef)(null),m=(0,o.useRef)("undefined"==typeof window?null:document.activeElement);xe("focus",(function(){m.current=p.current,p.current=document.activeElement}),!0);var v=(0,o.useCallback)((function(e){var t;if(f){if(i.popoverState===Gt.Closed)return;switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:Ht.ClosePopover}),null==(t=i.button)||t.focus()}}else switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),a({type:Ht.TogglePopover});break;case J.Escape:if(i.popoverState!==Gt.Open)return null==c?void 0:c(i.buttonId);if(!u.current)return;if(!u.current.contains(document.activeElement))return;a({type:Ht.ClosePopover});break;case J.Tab:if(i.popoverState!==Gt.Open)return;if(!i.panel)return;if(!i.button)return;if(e.shiftKey){var n;if(!m.current)return;if(null==(n=i.button)?void 0:n.contains(m.current))return;if(i.panel.contains(m.current))return;var r=he(),o=r.indexOf(m.current);if(r.indexOf(i.button)>o)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}else e.preventDefault(),e.stopPropagation(),ge(i.panel,le.First)}}),[a,i.popoverState,i.buttonId,i.button,i.panel,u,c,f]),h=(0,o.useCallback)((function(e){var t;if(!f&&(e.key===J.Space&&e.preventDefault(),i.popoverState===Gt.Open&&i.panel&&i.button))switch(e.key){case J.Tab:if(!m.current)return;if(null==(t=i.button)?void 0:t.contains(m.current))return;if(i.panel.contains(m.current))return;var n=he(),r=n.indexOf(m.current);if(n.indexOf(i.button)>r)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}}),[i.popoverState,i.panel,i.button,f]),y=(0,o.useCallback)((function(e){var n,r;re(e.currentTarget)||(t.disabled||(f?(a({type:Ht.ClosePopover}),null==(n=i.button)||n.focus()):(i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),null==(r=i.button)||r.focus(),a({type:Ht.TogglePopover}))))}),[a,i.button,i.popoverState,i.buttonId,t.disabled,c,f]),b=(0,o.useMemo)((function(){return{open:i.popoverState===Gt.Open}}),[i]);return X({props:q({},t,f?{type:"button",onKeyDown:v,onClick:y}:{ref:d,id:i.buttonId,type:"button","aria-expanded":i.popoverState===Gt.Open||void 0,"aria-controls":i.panel?i.panelId:void 0,onKeyDown:v,onKeyUp:h,onClick:y}),slot:b,defaultTag:"button",name:"Popover.Button"})})),rn=Q.RenderStrategy|Q.Static,on=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0].popoverState,a=r[1],u=ne(n),s="headlessui-popover-overlay-"+ce(),c=Ue(),l=null!==c?c===Me.Open:i===Gt.Open,f=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a({type:Ht.ClosePopover})}),[a]),d=(0,o.useMemo)((function(){return{open:i===Gt.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:f}),slot:d,defaultTag:"div",features:rn,visible:l,name:"Popover.Overlay"})})),an=Q.RenderStrategy|Q.Static,un=ee((function e(t,n){var r=t.focus,a=void 0!==r&&r,u=W(t,["focus"]),s=Yt([tn.name,e.name].join(".")),c=s[0],l=s[1],f=(0,o.useRef)(null),d=ne(f,n,(function(e){l({type:Ht.SetPanel,panel:e})})),p=Ue(),m=null!==p?p===Me.Open:c.popoverState===Gt.Open,v=(0,o.useCallback)((function(e){var t;switch(e.key){case J.Escape:if(c.popoverState!==Gt.Open)return;if(!f.current)return;if(!f.current.contains(document.activeElement))return;e.preventDefault(),l({type:Ht.ClosePopover}),null==(t=c.button)||t.focus()}}),[c,f,l]);(0,o.useEffect)((function(){return function(){return l({type:Ht.SetPanel,panel:null})}}),[l]),(0,o.useEffect)((function(){var e;c.popoverState!==Gt.Closed||null!=(e=t.unmount)&&!e||l({type:Ht.SetPanel,panel:null})}),[c.popoverState,t.unmount,l]),(0,o.useEffect)((function(){if(a&&c.popoverState===Gt.Open&&f.current){var e=document.activeElement;f.current.contains(e)||ge(f.current,le.First)}}),[a,f,c.popoverState]),xe("keydown",(function(e){if(c.popoverState===Gt.Open&&f.current&&e.key===J.Tab&&document.activeElement&&f.current&&f.current.contains(document.activeElement)){e.preventDefault();var t,n=ge(f.current,e.shiftKey?le.Previous:le.Next);if(n===fe.Underflow)return null==(t=c.button)?void 0:t.focus();if(n===fe.Overflow){if(!c.button)return;var r=he(),o=r.indexOf(c.button);ge(r.splice(o+1).filter((function(e){var t;return!(null==(t=f.current)?void 0:t.contains(e))})),le.First)===fe.Error&&ge(document.body,le.First)}}})),xe("focus",(function(){var e;a&&c.popoverState===Gt.Open&&f.current&&((null==(e=f.current)?void 0:e.contains(document.activeElement))||l({type:Ht.ClosePopover}))}),!0);var h=(0,o.useMemo)((function(){return{open:c.popoverState===Gt.Open}}),[c]),y={ref:d,id:c.panelId,onKeyDown:v};return i().createElement(Zt.Provider,{value:c.panelId},X({props:q({},u,y),slot:h,defaultTag:"div",features:an,visible:m,name:"Popover.Panel"}))}));tn.Button=nn,tn.Overlay=on,tn.Panel=un,tn.Group=function(e){var t=(0,o.useRef)(null),n=(0,o.useState)([]),r=n[0],a=n[1],u=(0,o.useCallback)((function(e){a((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[a]),s=(0,o.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return u(e)}}),[a,u]),c=(0,o.useCallback)((function(){var e,n=document.activeElement;return!!(null==(e=t.current)?void 0:e.contains(n))||r.some((function(e){var t,r;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(n))||(null==(r=document.getElementById(e.panelId))?void 0:r.contains(n))}))}),[t,r]),l=(0,o.useCallback)((function(e){for(var t,n=z(r);!(t=n()).done;){var o=t.value;o.buttonId!==e&&o.close()}}),[r]),f=(0,o.useMemo)((function(){return{registerPopover:s,unregisterPopover:u,isFocusWithinPopoverGroup:c,closeOthers:l}}),[s,u,c,l]),d=(0,o.useMemo)((function(){return{}}),[]),p={ref:t},m=e;return i().createElement(Jt.Provider,{value:f},X({props:q({},m,p),slot:d,defaultTag:"div",name:"Popover.Group"}))};var sn=(0,o.createContext)(null);function cn(){var e=(0,o.useContext)(sn);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return e}function ln(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(sn.Provider,{value:r},e.children)}}),[n])]}var fn,dn;function pn(e){var t=e.passive,n=void 0!==t&&t,r=W(e,["passive"]),o=cn(),i="headlessui-label-"+ce();oe((function(){return o.register(i)}),[i,o.register]);var a=q({},o.props,{id:i}),u=q({},r,a);return n&&delete u.onClick,X({props:u,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}!function(e){e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption"}(dn||(dn={}));var mn=((fn={})[dn.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,element:t.element,propsRef:t.propsRef}])})},fn[dn.UnregisterOption]=function(e,t){var n=e.options.slice(),r=e.options.findIndex((function(e){return e.id===t.id}));return-1===r?e:(n.splice(r,1),q({},e,{options:n}))},fn),vn=(0,o.createContext)(null);function hn(e){var t=(0,o.useContext)(vn);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+gn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,hn),n}return t}function yn(e,t){return $(t.type,mn,e,t)}vn.displayName="RadioGroupContext";var bn;function gn(e){var t=e.value,n=e.onChange,r=e.disabled,a=void 0!==r&&r,u=W(e,["value","onChange","disabled"]),s=(0,o.useReducer)(yn,{options:[]}),c=s[0].options,l=s[1],f=ln(),d=f[0],p=f[1],m=De(),v=m[0],h=m[1],y="headlessui-radiogroup-"+ce(),b=(0,o.useRef)(null),g=(0,o.useMemo)((function(){return c.find((function(e){return!e.propsRef.current.disabled}))}),[c]),x=(0,o.useMemo)((function(){return c.some((function(e){return e.propsRef.current.value===t}))}),[c,t]),w=(0,o.useCallback)((function(e){var r;if(a)return!1;if(e===t)return!1;var o=null==(r=c.find((function(t){return t.propsRef.current.value===e})))?void 0:r.propsRef.current;return!(null==o?void 0:o.disabled)&&(n(e),!0)}),[n,t,a,c]);At({container:b.current,accept:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var S=(0,o.useCallback)((function(e){if(b.current){var t=c.filter((function(e){return!1===e.propsRef.current.disabled})).map((function(e){return e.element.current}));switch(e.key){case J.ArrowLeft:case J.ArrowUp:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Previous|le.WrapAround)===fe.Success){var n=c.find((function(e){return e.element.current===document.activeElement}));n&&w(n.propsRef.current.value)}break;case J.ArrowRight:case J.ArrowDown:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Next|le.WrapAround)===fe.Success){var r=c.find((function(e){return e.element.current===document.activeElement}));r&&w(r.propsRef.current.value)}break;case J.Space:e.preventDefault(),e.stopPropagation();var o=c.find((function(e){return e.element.current===document.activeElement}));o&&w(o.propsRef.current.value)}}}),[b,c,w]),k=(0,o.useCallback)((function(e){return l(q({type:dn.RegisterOption},e)),function(){return l({type:dn.UnregisterOption,id:e.id})}}),[l]),j=(0,o.useMemo)((function(){return{registerOption:k,firstOption:g,containsCheckedOption:x,change:w,disabled:a,value:t}}),[k,g,x,w,a,t]),O={ref:b,id:y,role:"radiogroup","aria-labelledby":d,"aria-describedby":v,onKeyDown:S};return i().createElement(h,{name:"RadioGroup.Description"},i().createElement(p,{name:"RadioGroup.Label"},i().createElement(vn.Provider,{value:j},X({props:q({},u,O),defaultTag:"div",name:"RadioGroup"}))))}!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(bn||(bn={}));gn.Option=function e(t){var n=(0,o.useRef)(null),r="headlessui-radiogroup-option-"+ce(),a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=function(e){void 0===e&&(e=0);var t=(0,o.useState)(e),n=t[0],r=t[1];return{addFlag:(0,o.useCallback)((function(e){return r((function(t){return t|e}))}),[r]),hasFlag:(0,o.useCallback)((function(e){return Boolean(n&e)}),[n]),removeFlag:(0,o.useCallback)((function(e){return r((function(t){return t&~e}))}),[r]),toggleFlag:(0,o.useCallback)((function(e){return r((function(t){return t^e}))}),[r])}}(bn.Empty),p=d.addFlag,m=d.removeFlag,v=d.hasFlag,h=t.value,y=t.disabled,b=void 0!==y&&y,g=W(t,["value","disabled"]),x=(0,o.useRef)({value:h,disabled:b});oe((function(){x.current.value=h}),[h,x]),oe((function(){x.current.disabled=b}),[b,x]);var w=hn([gn.name,e.name].join(".")),S=w.registerOption,k=w.disabled,j=w.change,O=w.firstOption,C=w.containsCheckedOption,E=w.value;oe((function(){return S({id:r,element:n,propsRef:x})}),[r,S,n,t]);var P=(0,o.useCallback)((function(){var e;j(h)&&(p(bn.Active),null==(e=n.current)||e.focus())}),[p,j,h]),I=(0,o.useCallback)((function(){return p(bn.Active)}),[p]),N=(0,o.useCallback)((function(){return m(bn.Active)}),[m]),T=(null==O?void 0:O.id)===r,_=k||b,R=E===h,A={ref:n,id:r,role:"radio","aria-checked":R?"true":"false","aria-labelledby":u,"aria-describedby":l,tabIndex:_?-1:R||!C&&T?0:-1,onClick:_?void 0:P,onFocus:_?void 0:I,onBlur:_?void 0:N},L=(0,o.useMemo)((function(){return{checked:R,disabled:_,active:v(bn.Active)}}),[R,_,v]);return i().createElement(f,{name:"RadioGroup.Description"},i().createElement(s,{name:"RadioGroup.Label"},X({props:q({},g,A),slot:L,defaultTag:"div",name:"RadioGroup.Option"})))},gn.Label=pn,gn.Description=Fe;var xn=(0,o.createContext)(null);xn.displayName="GroupContext";var wn=o.Fragment;var Sn;function kn(e){var t=e.checked,n=e.onChange,r=W(e,["checked","onChange"]),i="headlessui-switch-"+ce(),a=(0,o.useContext)(xn),u=(0,o.useCallback)((function(){return n(!t)}),[n,t]),s=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),u()}),[u]),c=(0,o.useCallback)((function(e){e.key!==J.Tab&&e.preventDefault(),e.key===J.Space&&u()}),[u]),l=(0,o.useCallback)((function(e){return e.preventDefault()}),[]),f=(0,o.useMemo)((function(){return{checked:t}}),[t]),d={id:i,ref:null===a?void 0:a.setSwitch,role:"switch",tabIndex:0,"aria-checked":t,"aria-labelledby":null==a?void 0:a.labelledby,"aria-describedby":null==a?void 0:a.describedby,onClick:s,onKeyUp:c,onKeyPress:l};return"button"===r.as&&Object.assign(d,{type:"button"}),X({props:q({},r,d),slot:f,defaultTag:"button",name:"Switch"})}function jn(){var e=(0,o.useRef)(!0);return(0,o.useEffect)((function(){e.current=!1}),[]),e.current}function On(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function Cn(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function En(e,t,n,r,o){var i=bt(),a=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return On.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){Cn.apply(void 0,[e].concat(n)),On.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=bt();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0],a=o[1];return 0!==i?n.setTimeout((function(){t(Sn.Finished)}),i+a):t(Sn.Finished),n.add((function(){return t(Sn.Cancelled)})),n.dispose}(e,(function(n){return Cn.apply(void 0,[e].concat(r,t)),a(n)})))})),i.add((function(){return Cn.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return a(Sn.Cancelled)})),i.dispose}function Pn(e){return void 0===e&&(e=""),(0,o.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}kn.Group=function(e){var t=(0,o.useState)(null),n=t[0],r=t[1],a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=(0,o.useMemo)((function(){return{switch:n,setSwitch:r,labelledby:u,describedby:l}}),[n,r,u,l]);return i().createElement(f,{name:"Switch.Description"},i().createElement(s,{name:"Switch.Label",props:{onClick:function(){n&&(n.click(),n.focus({preventScroll:!0}))}}},i().createElement(xn.Provider,{value:d},X({props:e,defaultTag:wn,name:"Switch.Group"}))))},kn.Label=pn,kn.Description=Fe,function(e){e.Finished="finished",e.Cancelled="cancelled"}(Sn||(Sn={}));var In,Nn=(0,o.createContext)(null);Nn.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(In||(In={}));var Tn=(0,o.createContext)(null);function _n(e){return"children"in e?_n(e.children):e.current.filter((function(e){return e.state===In.Visible})).length>0}function Rn(e){var t=(0,o.useRef)(e),n=(0,o.useRef)([]),r=we();(0,o.useEffect)((function(){t.current=e}),[e]);var i=(0,o.useCallback)((function(e,o){var i;void 0===o&&(o=Y.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&($(o,((i={})[Y.Unmount]=function(){n.current.splice(a,1)},i[Y.Hidden]=function(){n.current[a].state=In.Hidden},i)),!_n(n)&&r.current&&(null==t.current||t.current()))}),[t,r,n]),a=(0,o.useCallback)((function(e){var t=n.current.find((function(t){return t.id===e}));return t?t.state!==In.Visible&&(t.state=In.Visible):n.current.push({id:e,state:In.Visible}),function(){return i(e,Y.Unmount)}}),[n,i]);return(0,o.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function An(){}Tn.displayName="NestingContext";var Ln=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Dn(e){for(var t,n={},r=z(Ln);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:An}return n}var Fn=Q.RenderStrategy;function Mn(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,u=e.afterLeave,s=e.enter,c=e.enterFrom,l=e.enterTo,f=e.leave,d=e.leaveFrom,p=e.leaveTo,m=W(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),v=(0,o.useRef)(null),h=(0,o.useState)(In.Visible),y=h[0],b=h[1],g=m.unmount?Y.Unmount:Y.Hidden,x=function(){var e=(0,o.useContext)(Nn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),w=x.show,S=x.appear,k=function(){var e=(0,o.useContext)(Tn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=k.register,O=k.unregister,C=jn(),E=ce(),P=(0,o.useRef)(!1),I=Rn((function(){P.current||(b(In.Hidden),O(E),D.current.afterLeave())}));oe((function(){if(E)return j(E)}),[j,E]),oe((function(){var e;g===Y.Hidden&&E&&(w&&y!==In.Visible?b(In.Visible):$(y,((e={})[In.Hidden]=function(){return O(E)},e[In.Visible]=function(){return j(E)},e)))}),[y,E,j,O,w,g]);var N=Pn(s),T=Pn(c),_=Pn(l),R=Pn(f),A=Pn(d),L=Pn(p),D=function(e){var t=(0,o.useRef)(Dn(e));return(0,o.useEffect)((function(){t.current=Dn(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:u}),F=ae();(0,o.useEffect)((function(){if(F&&y===In.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,y,F]);var M=C&&!S;oe((function(){var e=v.current;if(e&&!M)return P.current=!0,w&&D.current.beforeEnter(),w||D.current.beforeLeave(),w?En(e,N,T,_,(function(e){P.current=!1,e===Sn.Finished&&D.current.afterEnter()})):En(e,R,A,L,(function(e){P.current=!1,e===Sn.Finished&&(_n(I)||(b(In.Hidden),O(E),D.current.afterLeave()))}))}),[D,E,P,O,I,v,M,w,N,T,_,R,A,L]);var B={ref:v},U=m;return i().createElement(Tn.Provider,{value:I},i().createElement(Ve,{value:$(y,(t={},t[In.Visible]=Me.Open,t[In.Hidden]=Me.Closed,t))},X({props:q({},U,B),defaultTag:"div",features:Fn,visible:y===In.Visible,name:"Transition.Child"})))}function Bn(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,u=e.unmount,s=W(e,["show","appear","unmount"]),c=Ue();void 0===n&&null!==c&&(n=$(c,((t={})[Me.Open]=!0,t[Me.Closed]=!1,t)));if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var l=(0,o.useState)(n?In.Visible:In.Hidden),f=l[0],d=l[1],p=Rn((function(){d(In.Hidden)})),m=jn(),v=(0,o.useMemo)((function(){return{show:n,appear:a||!m}}),[n,a,m]);(0,o.useEffect)((function(){n?d(In.Visible):_n(p)||d(In.Hidden)}),[n,p]);var h={unmount:u};return i().createElement(Tn.Provider,{value:p},i().createElement(Nn.Provider,{value:v},X({props:q({},h,{as:o.Fragment,children:i().createElement(Mn,Object.assign({},h,s))}),defaultTag:o.Fragment,features:Fn,visible:f===In.Visible,name:"Transition"})))}Bn.Child=Mn,Bn.Root=Bn;const Un=wp.i18n;var Vn=n(246);function Gn(e){var t=e.className,n=e.hideLibrary,r=e.initialFocus,o=G((function(e){return e.remainingImports})),i=G((function(e){return e.apiKey})),a=G((function(e){return e.allowedImports}));return(0,Vn.jsx)("div",{className:t,children:(0,Vn.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,Vn.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,Vn.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,Vn.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Vn.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,Un.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,Vn.jsx)(Vn.Fragment,{children:(0,Vn.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,Vn.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up","extendify-sdk")}),(0,Vn.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"m-0 p-0 px-6 text-sm bg-gray-50 border-r border-gray-300 h-full flex items-center",children:(0,Un.sprintf)((0,Un.__)("Imports left: %s / %s"),o(),Number(a))})]})})]}),(0,Vn.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,Vn.jsxs)("button",{ref:r,type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,Vn.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",size:"24",role:"img","aria-hidden":"true",focusable:"false",children:(0,Vn.jsx)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})}),(0,Vn.jsx)("span",{className:"sr-only",children:(0,Un.__)("Close library","extendify-sdk")})]})})]})})}const Hn=wp.blockEditor,qn=lodash;var Wn=function(){return T.get("taxonomies")};const Kn=wp.components;var zn=n(42),$n=n.n(zn);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jn(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 Jn(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 Jn(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 Xn(e){var t=Yn(e.taxonomy,2),n=t[0],o=t[1],i=e.open,a=g((function(e){return e.updateTaxonomies})),u=g((function(e){return e.resetTaxonomies})),s=g((function(e){return e.searchParams})),c=Yn((0,r.useState)({}),2),l=c[0],f=c[1],d=Yn((0,r.useState)({}),2),p=d[0],m=d[1],v=(0,r.useRef)(),h=(0,r.useRef)(),y=(0,r.useRef)(),b=(0,r.useRef)(!0),x=function(e){var t;return(null==s?void 0:s.taxonomies[n])===e.term||(null===(t=e.children)||void 0===t?void 0:t.filter((function(e){return e.term===(null==s?void 0:s.taxonomies[n])})).length)>0},w=function(e){var t;return Object.prototype.hasOwnProperty.call(e,"children")?e.children.filter((function(e){return null==e?void 0:e.type.includes(s.type)})).length:null==e||null===(t=e.type)||void 0===t?void 0:t.includes(s.type)};if((0,r.useEffect)((function(){b.current?b.current=!1:(f({}),u())}),[s.type,u]),(0,r.useEffect)((function(){Object.keys(l).length?setTimeout((function(){requestAnimationFrame((function(){m(v.current.clientHeight),y.current.focus()}))}),200):m("auto")}),[l]),!Object.keys(o).length||!Object.values(o).filter((function(e){return w(e)})).length)return"";var S=n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}));return(0,Vn.jsx)(Kn.PanelBody,{title:S,initialOpen:i,children:(0,Vn.jsx)(Kn.PanelRow,{children:(0,Vn.jsxs)("div",{className:"overflow-hidden w-full relative",style:{height:p},children:[(0,Vn.jsxs)("ul",{className:$n()("p-1 m-0 w-full transform transition duration-200",{"-translate-x-full":Object.keys(l).length}),children:[(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:h,onClick:function(){a(Qn({},n,"pattern"===s.type&&"tax_categories"===n?"Default":""))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":!s.taxonomies[n].length||"Default"===(null==s?void 0:s.taxonomies[n])}),children:"pattern"===s.type&&"tax_categories"===n?(0,Un.__)("Default","extendify-sdk"):(0,Un.__)("All","extendify-sdk")})})}),Object.values(o).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 w-full",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){Object.prototype.hasOwnProperty.call(e,"children")?f(e):a(Qn({},n,e.term))},children:[(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term}),Object.prototype.hasOwnProperty.call(e,"children")&&(0,Vn.jsx)("span",{className:"text-black",children:(0,Vn.jsx)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",className:"stroke-current",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})})})]})},e.term)}))]}),(0,Vn.jsxs)("ul",{ref:v,className:$n()("p-1 m-0 w-full transform transition duration-200 absolute top-0 right-0",{"translate-x-full":!Object.keys(l).length}),children:[Object.values(l).length>0&&(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer font-bold flex space-x-4 items-center py-2 pr-4 m-0leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:y,onClick:function(){f({}),h.current.focus()},children:[(0,Vn.jsx)("svg",{className:"stroke-current transform rotate-180",width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})}),(0,Vn.jsx)("span",{children:l.term})]})}),Object.values(l).length&&Object.values(l.children).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 pl-6 w-full flex justify-between items-center",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){a(Qn({},n,e.term))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term})})},e.term)}))]})]})})})}function Zn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function er(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function tr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nr(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 nr(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 nr(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 rr(){var e,t=g((function(e){return e.updateSearchParams})),n=g((function(e){return e.setupDefaultTaxonomies})),o=g((function(e){return e.searchParams})),i=(0,qn.debounce)((function(e){return t({taxonomies:{},search:e})}),500),a=tr((0,r.useState)(null!==(e=null==o?void 0:o.search)&&void 0!==e?e:""),2),u=a[0],s=a[1],c=tr((0,r.useState)({}),2),l=c[0],f=c[1],d=(0,r.useCallback)(er(S().mark((function e(){var t;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wn();case 2:t=e.sent,t=Object.keys(t).filter((function(e){return e.startsWith("tax_")})).reduce((function(e,n){return e[n]=t[n],e}),{}),n(t),f(t);case 6:case"end":return e.stop()}}),e)}))),[n]);return(0,r.useEffect)((function(){d()}),[d]),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"pt-1 -mt-1 mb-1 bg-white",children:(0,Vn.jsx)(Hn.__experimentalSearchForm,{placeholder:(0,Un.__)("What are you looking for?","extendify-sdk"),onChange:function(e){g.setState({nextPage:""}),s(e),i(e)},value:u,className:"sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"})}),(0,Vn.jsx)("div",{className:"flex-grow hidden overflow-y-auto pb-32 pr-2 sm:block",children:(0,Vn.jsx)(Kn.Panel,{children:Object.entries(l).map((function(e,t){return(0,Vn.jsx)(Xn,{open:!1,taxonomy:e},t)}))})})]})}function or(e){var t=e.taxonomies,n=e.search,r=e.type,o=[],i=Object.entries(t).filter((function(e){return Boolean(e[1].length)})).map((function(e){return"".concat(e[0],' = "').concat(e[1],'"')})).join(", ");return i.length&&o.push(i),n.length&&o.push('OR(FIND(LOWER("'.concat(n,'"), LOWER(title))!= 0, FIND(LOWER("').concat(n,'"), LOWER({tax_categories})) != 0)')),r.length&&o.push('{type}="'.concat(r,'"')),o.length?"AND(".concat(o.join(", "),")").replace(/\r?\n|\r/g,""):""}function ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var ar=0,ur=function(e,t){return(n=S().mark((function n(){var r,o,i;return S().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return ar++,o=N.CancelToken.source(),null!==(r=g.getState().fetchToken)&&void 0!==r&&r.cancel&&g.getState().fetchToken.cancel(),g.setState({fetchToken:o}),n.next=6,T.post("templates",{filterByFormula:or(e),pageSize:l,categories:e.taxonomies,search:e.search,type:e.type,offset:t,initial:1===ar,request_count:ar},{cancelToken:o.token});case 6:return i=n.sent,g.setState({fetchToken:null}),n.abrupt("return",i);case 9:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){ir(i,r,o,a,u,"next",e)}function u(e){ir(i,r,o,a,u,"throw",e)}a(void 0)}))})();var n},sr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,maybe_import:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},cr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,single:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},lr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,imported:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})};function fr(){return(fr=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)}var dr=new Map,pr=new WeakMap,mr=0;function vr(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(pr.has(n)||(mr+=1,pr.set(n,mr.toString())),pr.get(n)):"0":e[t]);var n})).toString()}function hr(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=vr(e),n=dr.get(t);if(!n){var r,o=new Map,i=new IntersectionObserver((function(t){t.forEach((function(t){var n,i=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=o.get(t.target))||n.forEach((function(e){e(i,t)}))}))}),e);r=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:o},dr.set(t,n)}return n}(n),o=r.id,i=r.observer,a=r.elements,u=a.get(e)||[];return a.has(e)||a.set(e,u),u.push(t),i.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(a.delete(e),i.unobserve(e)),0===a.size&&(i.disconnect(),dr.delete(o))}}function yr(e){return"function"!=typeof e.children}var br=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),yr(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},i.componentWillUnmount=function(){this.unobserve(),this.node=null},i.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,o=e.trackVisibility,i=e.delay;this._unobserveCb=hr(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:o,delay:i})}},i.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},i.render=function(){if(!yr(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var r=this.props,i=r.children,a=r.as,u=r.tag,s=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}(r,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"]);return(0,o.createElement)(a||u||"div",fr({ref:this.handleNode},s),i)},r}(o.Component);br.displayName="InView",br.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function gr(e){return function(e){if(Array.isArray(e))return jr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||kr(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 xr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xr(i,r,o,a,u,"next",e)}function u(e){xr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||kr(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 kr(e,t){if(e){if("string"==typeof e)return jr(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)?jr(e,t):void 0}}function jr(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 Or(e){var t=e.templates,n=g((function(e){return e.setActive})),i=g((function(e){return e.activeTemplate})),a=g((function(e){return e.appendTemplates})),u=Sr((0,r.useState)(""),2),s=u[0],c=u[1],l=Sr((0,r.useState)(!1),2),f=l[0],d=l[1],p=Sr((0,r.useState)([]),2),m=p[0],v=p[1],h=Sr(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,i=t.trackVisibility,a=t.rootMargin,u=t.root,s=t.triggerOnce,c=t.skip,l=t.initialInView,f=(0,o.useRef)(),d=(0,o.useState)({inView:!!l}),p=d[0],m=d[1],v=(0,o.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),c||e&&(f.current=hr(e,(function(e,t){m({inView:e,entry:t}),t.isIntersecting&&s&&f.current&&(f.current(),f.current=void 0)}),{root:u,rootMargin:a,threshold:n,trackVisibility:i,delay:r}))}),[Array.isArray(n)?n.toString():n,u,a,s,c,i,r]);(0,o.useEffect)((function(){f.current||!p.entry||s||c||m({inView:!!l})}));var h=[v,p.inView,p.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}(),2),y=h[0],b=h[1],x=g((function(e){return e.updateSearchParams})),w=g((function(e){return e.searchParams})),k=(0,r.useRef)(g.getState().nextPage),j=(0,r.useRef)(g.getState().searchParams);(0,r.useEffect)((function(){return g.subscribe((function(e){return k.current=e}),(function(e){return e.nextPage}))}),[]),(0,r.useEffect)((function(){return g.subscribe((function(e){return j.current=e}),(function(e){return e.searchParams}))}),[]);var O=(0,r.useCallback)(wr(S().mark((function e(){var t,n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(""),d(!1),e.next=4,ur(j.current,k.current).catch((function(e){console.error(e),c(e&&e.message?e.message:(0,Un.__)("Unknown error occured. Check browser console or contact support.","extendify-sdk"))}));case 4:null!=(n=e.sent)&&null!==(t=n.error)&&void 0!==t&&t.length&&c(null==n?void 0:n.error),null!=n&&n.records&&w===j.current&&(a(n.records),d(n.records.length<=0),g.setState({nextPage:n.offset}));case 7:case"end":return e.stop()}}),e)}))),[w,a]);return(0,r.useEffect)((function(){Object.keys(j.current.taxonomies).length&&(v([]),O())}),[O,j]),(0,r.useEffect)((function(){b&&O()}),[b,O]),s.length?(0,Vn.jsxs)("div",{className:"text-left",children:[(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("Server error","extendify-sdk")}),(0,Vn.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:s}),(0,Vn.jsx)(Kn.Button,{isTertiary:!0,onClick:function(){v([]),x({taxonomies:{},search:""}),O()},children:(0,Un.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.sprintf)((0,Un.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("No results found.","extendify-sdk")}):t.length?(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("ul",{className:"flex-grow gap-6 grid xl:grid-cols-2 2xl:grid-cols-3 pb-32 m-0",children:t.map((function(e,t){var r,o,a,u,s,c,l,f,d;return(0,Vn.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,Vn.jsx)("div",{className:"flex justify-items-center flex-grow h-80 border-gray-200 bg-white border border-b-0 group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",onClick:function(){return n(e)},children:(0,Vn.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return v([].concat(gr(m),[t]))},src:null!==(r=null==e||null===(o=e.fields)||void 0===o||null===(a=o.screenshot[0])||void 0===a||null===(u=a.thumbnails)||void 0===u||null===(s=u.large)||void 0===s?void 0:s.url)&&void 0!==r?r:null==e||null===(c=e.fields)||void 0===c||null===(l=c.screenshot[0])||void 0===l?void 0:l.url})}),(0,Vn.jsx)("span",{role:"img","aria-hidden":"true",className:"h-px w-full bg-gray-200 border group-hover:bg-transparent border-t-0 border-b-0 border-gray-200 group-hover:border-wp-theme-500 transition duration-150"}),(0,Vn.jsxs)("div",{className:"bg-transparent text-left bg-white flex items-center justify-between p-4 border border-t-0 border-transparent group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",role:"button",onClick:function(){return n(e)},children:[(0,Vn.jsxs)("div",{children:[(0,Vn.jsx)("h4",{className:"m-0 font-bold",children:e.fields.title}),(0,Vn.jsx)("p",{className:"m-0",children:null==e||null===(f=e.fields)||void 0===f||null===(d=f.tax_categories)||void 0===d?void 0:d.filter((function(e){return"default"!==e.toLowerCase()})).join(", ")})]}),(0,Vn.jsx)(Kn.Button,{isSecondary:!0,tabIndex:Object.keys(i).length?"-1":"0",className:"sm:opacity-0 group-hover:opacity-100 transition duration-150 focus:opacity-100",onClick:function(t){t.stopPropagation(),n(e)},children:(0,Un.__)("View","extendify-sdk")})]})]},e.id)}))}),g.getState().nextPage&&!!m.length&&m.length===t.length&&(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"-translate-y-full flex flex-col h-80 items-end justify-end my-2 relative transform z-0 text",ref:y,style:{zIndex:-1}}),(0,Vn.jsx)("div",{className:"my-4",children:(0,Vn.jsx)(Kn.Spinner,{})})]})]}):(0,Vn.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,Vn.jsx)(Kn.Spinner,{})})}var Cr=function(){return T.get("plugins")},Er=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),T.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},Pr=function(){return T.get("active-plugins")};function Ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Nr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ir(i,r,o,a,u,"next",e)}function u(e){Ir(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Tr(e){return _r.apply(this,arguments)}function _r(){return(_r=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=(r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).filter((function(e){return"editorplus"!==e}))).length){e.next=4;break}return e.abrupt("return",!1);case 4:return e.t0=Object,e.next=7,Cr();case 7:return e.t1=e.sent,o=e.t0.keys.call(e.t0,e.t1),i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})),e.abrupt("return",i.length);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rr(e){return Ar.apply(this,arguments)}function Ar(){return(Ar=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=(r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).filter((function(e){return"editorplus"!==e}))).length){e.next=4;break}return e.abrupt("return",!1);case 4:return e.t0=Object,e.next=7,Pr();case 7:if(e.t1=e.sent,o=e.t0.values.call(e.t0,e.t1),!(i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})))){e.next=15;break}return e.next=13,Tr(t);case 13:if(!e.sent){e.next=15;break}return e.abrupt("return",!1);case 15:return e.abrupt("return",i.length);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Lr=s(I((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function Dr(e){var t=e.msg;return(0,Vn.jsxs)(Kn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Kn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Kn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Kr,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}const Fr=wp.data;function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Br(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 Br(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 Br(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 Ur(){var e=Mr((0,r.useState)(!1),2),t=e[0],n=e[1],o=function(){location.reload()};return(0,(0,Fr.select)("core/editor").isEditedPostDirty)()?(0,Vn.jsxs)(Kn.Modal,{title:(0,Un.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:(0,Un.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,Vn.jsxs)(Kn.ButtonGroup,{children:[(0,Vn.jsx)(Kn.Button,{isPrimary:!0,onClick:o,disabled:t,children:(0,Un.__)("Reload page","extendify-sdk")}),(0,Vn.jsx)(Kn.Button,{isSecondary:!0,onClick:function(){n(!0),(0,Fr.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,Un.__)("Save changes","extendify-sdk")})]})]}):(o(),null)}function Vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gr(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 Gr(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 Gr(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 Hr(){var e,t=Vr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins.filter((function(e){return"editorplus"!==e}))).then((function(){Lr.setState({importOnLoad:!0}),(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;o(t)})),n?(0,Vn.jsx)(Dr,{msg:n}):(0,Vn.jsx)(Kn.Modal,{title:(0,Un.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Kn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Installing...","extendify-sdk")})})}var qr=function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"broken-event",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";G.setState({entryPoint:e}),window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0}))}(e,"open")};function Wr(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Kr(e){var t,n,o,i,a,u,s,c=Lr((function(e){return e.wantedTemplate})),l=function(){e.forceOpen||(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},f=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Kn.Modal,{title:null!==(n=e.title)&&void 0!==n?n:(0,Un.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, take me back","extendify-sdk"),onRequestClose:l,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following to be automatically installed and activated:",null!==(i=null==c||null===(a=c.fields)||void 0===a?void 0:a.type)&&void 0!==i?i:"template"),"extendify-sdk")}),(null===(u=e.message)||void 0===u?void 0:u.length)>0||(0,Vn.jsx)("ul",{children:f.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,Vn.jsx)("li",{children:Wr(e)},e)}))}),(0,Vn.jsxs)(Kn.ButtonGroup,{children:[(0,Vn.jsx)(Kn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Hr,{}),document.getElementById("extendify-root"))},children:null!==(s=e.buttonLabel)&&void 0!==s?s:(0,Un.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,Vn.jsx)(Kn.Button,{isTertiary:!0,onClick:l,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, take me back","extendify-sdk")})]})]})}function zr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zr(i,r,o,a,u,"next",e)}function u(e){zr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var Qr=function(){var e=$r(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tr(t);case 2:return e.t0=!e.sent,e.t1=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(Kr,{}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasRequiredPlugins",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Yr(e){var t=e.msg;return(0,Vn.jsxs)(Kn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Kn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Kn.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,Vn.jsx)(no,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}function Jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jr(i,r,o,a,u,"next",e)}function u(e){Jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Zr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eo(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 eo(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 eo(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 to(){var e,t=Zr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins.filter((function(e){return"editorplus"!==e}))).then((function(){Lr.setState({importOnLoad:!0})})).then(Xr(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout(e,1e3)}));case 2:(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"));case 3:case"end":return e.stop()}}),e)})))).catch((function(e){var t=e.response;o(t.data.message)})),n?(0,Vn.jsx)(Yr,{msg:n}):(0,Vn.jsx)(Kn.Modal,{title:(0,Un.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Kn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Activating...","extendify-sdk")})})}function no(e){var t,n,o,i,a=Lr((function(e){return e.wantedTemplate})),u=function(){return(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},s=(null==a||null===(t=a.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Kn.Modal,{title:(0,Un.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, return to library","extendify-sdk"),onRequestClose:u,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(n=e.message)&&void 0!==n?n:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following plugins to be installed and activated:",null!==(o=null==a||null===(i=a.fields)||void 0===i?void 0:i.type)&&void 0!==o?o:"template"),"extendify-sdk")}),(0,Vn.jsx)("ul",{children:s.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,Vn.jsx)("li",{children:Wr(e)},e)}))}),(0,Vn.jsxs)(Kn.ButtonGroup,{children:[(0,Vn.jsx)(Kn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(to,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,Vn.jsx)(Kn.Button,{isTertiary:!0,onClick:u,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, return to library","extendify-sdk")})]})]})}function ro(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,u,"next",e)}function u(e){ro(i,r,o,a,u,"throw",e)}a(void 0)}))}}var io=function(){var e=oo(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rr(t);case 2:return e.t0=!e.sent,e.t1=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(no,{showClose:!0}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasPluginsActivated",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ao(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return uo(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 uo(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uo(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 so(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function co(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){so(i,r,o,a,u,"next",e)}function u(e){so(i,r,o,a,u,"throw",e)}a(void 0)}))}}function lo(e){return function(){return new fo(e.apply(this,arguments))}}function fo(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,u=a instanceof po;Promise.resolve(u?a.wrapped:a).then((function(e){u?r("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(i,a){var u={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=u:(t=n=u,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function po(e){this.wrapped=e}fo.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fo.prototype.next=function(e){return this._invoke("next",e)},fo.prototype.throw=function(e){return this._invoke("throw",e)},fo.prototype.return=function(e){return this._invoke("return",e)};function mo(){return(mo=co(S().mark((function e(t){var n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=vo(t);case 1:return e.next=4,n.next();case 4:if(!e.sent.done){e.next=7;break}return e.abrupt("break",9);case 7:e.next=1;break;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vo(e){return ho.apply(this,arguments)}function ho(){return(ho=lo(S().mark((function e(t){var n,r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ao(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)}function yo(e,t){return(0,(0,Fr.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function bo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return go(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 go(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 go(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 xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:Qr,hasPluginsActivated:io,stack:[],check:function(t){var n=this;return co(S().mark((function r(){var o,i,a;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=ao(e),r.prev=1,a=S().mark((function e(){var r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.value,e.next=3,n["".concat(r)](t);case 3:o=e.sent,setTimeout((function(){n.stack.push(o.pass?o.allow:o.deny)}),0);case 5:case"end":return e.stop()}}),e)})),o.s();case 4:if((i=o.n()).done){r.next=8;break}return r.delegateYield(a(),"t0",6);case 6:r.next=4;break;case 8:r.next=13;break;case 10:r.prev=10,r.t1=r.catch(1),o.e(r.t1);case 13:return r.prev=13,o.f(),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},reset:function(){this.stack=[]}}}(["hasRequiredPlugins","hasPluginsActivated"]);function wo(e){var t=e.template,n=g((function(e){return e.activeTemplateBlocks})),o=G((function(e){return e.canImport})),i=G((function(e){return e.apiKey})),a=x((function(e){return e.setOpen})),u=bo((0,r.useState)(!1),2),s=u[0],c=u[1],l=bo((0,r.useState)(!1),2),f=l[0],d=l[1],p=Lr((function(e){return e.setWanted})),m=function(){(function(e){return mo.apply(this,arguments)})(xo.stack).then((function(){setTimeout((function(){yo(n,t).then((function(){return a(!1)}))}),100)}))};(0,r.useEffect)((function(){return xo.check(t).then((function(){return d(!0)})),function(){return xo.reset()&&d(!1)}}),[t]),(0,r.useEffect)((function(){s&&sr(t)}),[s,t]);return f&&Object.keys(n).length?i||o()?s?(0,Vn.jsx)("button",{type:"button",disabled:!0,className:"components-button is-secondary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){},children:(0,Un.__)("Importing...","extendify-sdk")}):(0,Vn.jsx)("button",{type:"button",className:"components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){return c(!0),p(t),void m()},children:(0,Un.sprintf)((0,Un.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,Vn.jsx)("a",{className:"button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up now","extendify-sdk")}):""}function So(e){var t,n,o,i,a,u,s,c=e.template,l=c.fields.tax_categories,f=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){cr(c)}),[c]),(0,Vn.jsxs)("div",{className:"flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px",children:[(0,Vn.jsxs)("div",{className:"flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl",children:[(0,Vn.jsxs)("div",{className:"text-left m-0 sm:mb-6 p-6 sm:p-0",children:[(0,Vn.jsx)("h1",{className:"leading-tight text-left mb-2.5 sm:text-3xl font-normal",children:c.fields.title}),(0,Vn.jsx)(Kn.ExternalLink,{href:c.fields.url,children:(0,Un.__)("Demo","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:$n()({"inline-flex absolute sm:static sm:top-auto right-0 m-6 sm:m-0 sm:my-6 space-x-3":!0,"top-16 mt-5":!f.length,"top-0":f.length>0}),children:(0,Vn.jsx)(wo,{template:c})})]}),(0,Vn.jsx)("div",{className:"max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46",children:(0,Vn.jsx)("img",{className:"max-w-full w-full",src:null!==(t=null==c||null===(n=c.fields)||void 0===n||null===(o=n.screenshot[0])||void 0===o||null===(i=o.thumbnails)||void 0===i||null===(a=i.full)||void 0===a?void 0:a.url)&&void 0!==t?t:null==c||null===(u=c.fields)||void 0===u||null===(s=u.screenshot[0])||void 0===s?void 0:s.url})}),(0,Vn.jsxs)("div",{className:"text-xs text-left p-6 w-full block sm:hidden",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:l.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]})]})}function ko(){return 0===G((function(e){return e.apiKey})).length?(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log into account","extendify-sdk")}):(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return G.setState({apiKey:""})},children:(0,Un.__)("Log out","extendify-sdk")})}function jo(e){var t=e.children;return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,Vn.jsx)("div",{className:"sm:w-56 lg:w-72 sticky flex flex-col h-full",children:t[0]}),(0,Vn.jsxs)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:[(0,Vn.jsx)("div",{children:(0,Vn.jsx)(Kn.Button,{isSecondary:!0,target:"_blank",href:"https://extendify.com/feedback",children:(0,Un.__)("Send us your feedback","extendify-sdk")})}),(0,Vn.jsx)("div",{className:"border-t border-gray-300",children:(0,Vn.jsx)(ko,{})})]})]}),(0,Vn.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smp:l-12 sm:pt-6 h-full",children:t[1]})]})}function Oo(){var e=g((function(e){return e.updateSearchParams})),t=g((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,Vn.jsxs)("div",{className:"text-left w-full bg-white px-6 sm:px-0 pb-4 sm:pb-6 mt-px border-b sm:border-0",children:[(0,Vn.jsx)("h4",{className:"sr-only",children:(0,Un.__)("Type select","extendify-sdk")}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 space-x-2 inline-flex items-center border border-black button-focus":!0,"bg-gray-900 text-white":"pattern"===t.type,"bg-transparent text-black":"pattern"!==t.type}),onClick:function(){return n("pattern")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H1C0.45 7 0 7.45 0 8V12C0 12.55 0.45 13 1 13ZM0 1V5C0 5.55 0.45 6 1 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H1C0.45 0 0 0.45 0 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Patterns","extendify-sdk")})]}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 px-4 space-x-2 inline-flex items-center border border-black focus:ring-2 focus:ring-wp-theme-500 ring-offset-1 outline-none -ml-px":!0,"bg-gray-900 text-white":"template"===t.type,"bg-transparent text-black":"template"!==t.type}),onClick:function(){return n("template")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M7 13H10C10.55 13 11 12.55 11 12V8C11 7.45 10.55 7 10 7H7C6.45 7 6 7.45 6 8V12C6 12.55 6.45 13 7 13ZM1 13H4C4.55 13 5 12.55 5 12V1C5 0.45 4.55 0 4 0H1C0.45 0 0 0.45 0 1V12C0 12.55 0.45 13 1 13ZM13 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H13C12.45 7 12 7.45 12 8V12C12 12.55 12.45 13 13 13ZM6 1V5C6 5.55 6.45 6 7 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H7C6.45 0 6 0.45 6 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Page templates","extendify-sdk")})]})]})}function Co(e){var t=e.template,n=g((function(e){return e.setActive})),o=(0,r.useRef)(null),i=t.fields,a=i.tax_categories,u=i.required_plugins,s=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){o.current.focus()}),[]),(0,Vn.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!s.length&&(0,Vn.jsxs)("div",{className:"h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")}),(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log in","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"p-6 sm:p-0",children:(0,Vn.jsxs)("button",{ref:o,type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return n({})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsxs)("div",{className:"text-left pt-14 divide-y w-full hidden sm:block",children:[(0,Vn.jsxs)("div",{className:"w-full py-6",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm m-0",children:a.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]}),u.filter((function(e){return"editorplus"!==e})).length>0&&(0,Vn.jsxs)("div",{className:"pt-4 w-full",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Required Plugins","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:u.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-extendify-light",children:Wr(e)},e)}))})]}),(0,Vn.jsx)("div",{className:"py-6",children:(0,Vn.jsx)("a",{href:"https://extendify.com/what-happens-when-a-template-is-added",rel:"noreferrer",target:"_blank",children:(0,Un.__)("What happens when a template is added?","extendify-sdk")})})]})]})}function Eo(){var e=g((function(e){return e.searchParams}));return(0,Vn.jsx)("div",{className:"hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none",children:Object.entries(e.taxonomies).map((function(t){return"template"===e.type&&"tax_pattern_types"===t[0]||"pattern"===e.type&&"tax_page_types"===t[0]?"":(0,Vn.jsxs)("div",{className:"lg:px-2 text-left",children:[(0,Vn.jsx)("span",{className:"font-bold",children:(n=t[0],n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})))}),": ",(0,Vn.jsx)("span",{children:t[1]?t[1]:"All"})]},t[0]);var n}))})}function Po(e){var t=e.className,n=e.initialFocus,r=g((function(e){return e.templates})),o=g((function(e){return e.activeTemplate}));return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsxs)("div",{className:"sm:flex sm:space-x-12 relative bg-white mx-auto max-w-screen-4xl h-full",children:[!!Object.keys(o).length&&(0,Vn.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(Co,{template:o}),(0,Vn.jsx)(So,{template:o})]})}),(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(rr,{initialFocus:n}),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)(Oo,{}),(0,Vn.jsx)(Eo,{}),(0,Vn.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,Vn.jsx)("div",{className:"absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8",children:(0,Vn.jsx)(Or,{templates:r})})})]})]})]})]})}function Io(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function No(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return To(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 To(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 To(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 _o(){var e=No((0,r.useState)(G.getState().apiKey),2),t=e[0],n=e[1],o=No((0,r.useState)(G.getState().email),2),i=o[0],a=o[1],u=No((0,r.useState)(""),2),s=u[0],c=u[1],l=No((0,r.useState)("info"),2),f=l[0],d=l[1],p=No((0,r.useState)(""),2),m=p[0],v=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var h=function(){var e,n=(e=S().mark((function e(n){var r,o,a,u,s,l;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),c(""),r=i.length?i:m,e.next=5,L(r,t);case 5:if(o=e.sent,a=o.token,u=o.error,s=o.exception,void 0===(l=o.message)){e.next=13;break}return d("error"),e.abrupt("return",c(l.length?l:"Error: Are you interacting with the wrong server?"));case 13:if(!u&&!s){e.next=16;break}return d("error"),e.abrupt("return",c(u.length?u:s));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",c((0,Un.__)("Something went wrong","extendify-sdk")));case 19:return d("success"),c("Success!"),e.next=23,new Promise((function(e){return setTimeout(e,1500)}));case 23:G.setState({apiKey:a}),x.setState({currentPage:"content"});case 25:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Io(i,r,o,a,u,"next",e)}function u(e){Io(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){i||A("user_email").then((function(e){return v(e)}))}),[i]),(0,Vn.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,Vn.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,Un.__)("Welcome","extendify-sdk")}),s&&(0,Vn.jsx)("div",{className:$n()({"border-b pb-6 mb-6 -mt-6":!0,"border-gray-900 text-gray-900":"info"===f,"border-wp-alert-red text-wp-alert-red":"error"===f,"border-extendify-main text-extendify-main":"success"===f}),children:s}),(0,Vn.jsxs)("form",{onSubmit:h,className:" space-y-6",children:[(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,Un.__)("Email:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-email",name:"extendifysdk-login-email",type:"email",className:"border px-2 w-full",placeholder:"Email",value:i.length?i:m,onChange:function(e){return a(e.target.value)}})]}),(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,Un.__)("License:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-license",name:"extendifysdk-login-email",type:"text",className:"border px-2 w-full",placeholder:"License key",value:t,onChange:function(e){return n(e.target.value)}})]}),(0,Vn.jsx)("div",{className:"flex justify-end",children:(0,Vn.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,Un.__)("Sign in","extendify-sdk")})})]})]})}function Ro(e){var t=e.className;return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,Vn.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,Vn.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,Vn.jsxs)("button",{type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return x.setState({currentPage:"content"})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsx)("div",{className:"flex justify-center",children:(0,Vn.jsx)(_o,{})})]})})]})}function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lo(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 Lo(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 Lo(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 Do(){var e=Ao((0,r.useState)(!1),2),t=e[0],n=e[1],o=(0,r.useRef)(null),i=x((function(e){return e.open})),a=x((function(e){return e.setOpen})),u=x((function(e){return e.currentPage}));return(0,Vn.jsx)(Bn.Root,{show:i,as:r.Fragment,children:(0,Vn.jsx)(ot,{as:"div",static:!0,className:"extendify-sdk",initialFocus:o,onClose:function(){},children:(0,Vn.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,Vn.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,Vn.jsx)(ot.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-5",enterTo:"opacity-100 translate-y-0",children:(0,Vn.jsx)("div",{className:$n()({"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all":!0,"lg:pt-5 lg:p-10":!t}),children:(0,Vn.jsxs)("div",{className:$n()({"bg-white h-full flex flex-col items-center relative shadow-xl":!0,"max-w-screen-4xl mx-auto":!t}),children:[(0,Vn.jsx)(Gn,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",toggleFullScreen:function(){return n(!t)},initialFocus:o,hideLibrary:function(){return a(!1)}}),"content"===u&&(0,Vn.jsx)(Po,{className:"w-full flex-grow overflow-hidden"}),"login"===u&&(0,Vn.jsx)(Ro,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]})})})]})})})})}function Fo(e){var t=e.show,n=void 0!==t&&t,o=x((function(e){return e.setOpen})),i=(0,r.useCallback)((function(){return o(!0)}),[o]),a=(0,r.useCallback)((function(){o(!1)}),[o]);return(0,r.useEffect)((function(){n&&o(!0)}),[n,o]),(0,r.useEffect)((function(){return window.localStorage.getItem("etfy_library__key")&&G.setState({apiKey:"any-key-will-work-during-beta"}),function(){return window.localStorage.removeItem("etfy_library__key")}}),[]),(0,r.useEffect)((function(){return window.addEventListener("extendify-sdk::open-library",i),window.addEventListener("extendify-sdk::close-library",a),function(){window.removeEventListener("extendify-sdk::open-library",i),window.removeEventListener("extendify-sdk::close-library",a)}}),[a,i]),(0,Vn.jsx)(Do,{})}const Mo=wp.plugins,Bo=wp.editPost;var Uo=function(e){var t,n;qr(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},Vo=(0,Vn.jsx)("div",{id:"extendify-templates-inserter",children:(0,Vn.jsxs)("button",{style:"background:#D9F1EE;color:#1e1e1e;border:1px solid #949494;font-weight:bold;font-size:14px;padding:8px;margin-right:8px",type:"button","data-extendify-identifier":"main-button",id:"extendify-templates-inserter-btn",className:"components-button",children:[(0,Vn.jsxs)("svg",{style:"margin-right:0.5rem",width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Un.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){G.getState().enabled&&(document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Vo)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",Uo)))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(G.getState().enabled&&document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,Vn.jsx)("div",{children:(0,Vn.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,Un.__)("Discover more patterns in Extendify Library","extendify-sdk")})});document.querySelector("[id$=patterns-view]").insertAdjacentHTML("afterbegin",(0,r.renderToString)(e)),document.getElementById("extendify-cta-button").addEventListener("click",Uo)}}),0)}));window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return G.getState().enabled&&(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:Uo,icon:(0,Vn.jsx)("span",{className:"components-menu-items__item-icon",children:(0,Vn.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,Un.__)("Library","extendify-sdk")})}});window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-settings-enable-disable",{render:function(){return(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{onClick:function(){G.setState({enabled:!G.getState().enabled}),requestAnimationFrame((function(){return location.reload()}))},icon:(0,Vn.jsx)(Vn.Fragment,{}),children:G.getState().enabled?(0,Un.__)("Disable Extendify","extendify-sdk"):(0,Un.__)("Enable Extendify","extendify-sdk")})}}),[{register:function(){var e=(0,Fr.dispatch)("core/notices").createNotice,t=G.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){e("info",(0,Un.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),setTimeout((function(){var e;t(),lr(null===(e=n.detail)||void 0===e?void 0:e.template)}),0)}))}},{register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,qn.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,Vn.jsx)(Kr,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}}].forEach((function(e){return e.register()})),window._wpLoadBlockEditor&&window.wp.domReady((function(){var e=document.createElement("div");if(e.id="extendify-root",document.body.append(e),(0,r.render)((0,Vn.jsx)(Fo,{}),e),Lr.getState().importOnLoad){var t=Lr.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");yo(p((0,window.wp.blocks.parse)((0,qn.get)(e,"fields.code"))),e)}(t)}),0)}Lr.setState({importOnLoad:!1,wantedTemplate:{}})}))},42:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var u in n)r.call(n,u)&&n[u]&&e.push(u);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},716:()=>{},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,u,s=o(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))n.call(a,l)&&(s[l]=a[l]);if(t){u=t(a);for(var f=0;f<u.length;f++)r.call(a,u[f])&&(s[u[f]]=a[u[f]])}}return s}},61:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=s.length;t;){for(u=s,s=[];++l<t;)u&&u[l].run();l=-1,t=s.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new p(e,t)),1!==s.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},426:(e,t,n)=>{"use strict";n(525);var r=n(804),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)u.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},246:(e,t,n)=>{"use strict";e.exports=n(426)},248:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return N()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?m:d,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=m,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function h(){}function y(){}function b(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,i)&&(g=w);var S=b.prototype=h.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,i,a,u){var s=l(e[o],e,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:N}}function N(){return{value:t,done:!0}}return y.prototype=S.constructor=b,b.constructor=y,y.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},k(j.prototype),j.prototype[a]=function(){return this},e.AsyncIterator=j,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new j(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),s(S,u,"Generator"),S[i]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},804:e=>{"use strict";e.exports=React}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var a=1/0;for(c=0;c<e.length;c++){for(var[n,o,i]=e[c],u=!0,s=0;s<n.length;s++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(u=!1,i<a&&(a=i));u&&(e.splice(c--,1),t=o())}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={172:0,106:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[a,u,s]=n,c=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(s)var l=s(r);for(t&&t(n);c<a.length;c++)i=a[c],r.o(e,i)&&e[i]&&e[i][0](),e[a[c]]=0;return r.O(l)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.O(void 0,[106],(()=>r(473)));var o=r.O(void 0,[106],(()=>r(716)));o=r.O(o)})();
extendify-sdk/public/editorplus/editorplus.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (()=>{var t={135:(t,e,r)=>{t.exports=r(248)},248:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",y={};function v(){}function m(){}function w(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,b=x&&x(x(j([])));b&&b!==r&&n.call(b,i)&&(g=b);var E=w.prototype=v.prototype=Object.create(g);function L(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function j(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:T}}function T(){return{value:e,done:!0}}return m.prototype=E.constructor=w,w.constructor=m,m.displayName=u(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},L(_.prototype),_.prototype[a]=function(){return this},t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(E),u(E,c,"Generator"),E[i]=function(){return this},E.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(135),e=r.n(t);const n=wp.data;function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t){var e,r=!1;if(!(t instanceof CSSRule))return!1;var n,o=["https://dl.airtable.com"],a=i(null!==(e=t.cssText.match(/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g))&&void 0!==e?e:[]);try{var c=function(){var t=n.value;try{var e=new URL(t);if(!o.includes(e.origin))return r=!0,"break"}catch(e){var i=["https://","http://",".com"].some((function(e){return-1!==t.indexOf(e)})),a=-1!==t.indexOf(o[0]);if(i&&!a)return r=!0,"break"}};for(a.s();!(n=a.n()).done;){if("break"===c())break}}catch(t){a.e(t)}finally{a.f()}return r}function u(){var t,e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null!==(t=null===(e=window.wp.data.select("core/editor").getEditedPostAttribute("meta"))||void 0===e?void 0:e.extendify_custom_stylesheet)&&void 0!==t?t:"";if("string"==typeof r){r=r.replace(/(.eplus_styles)/g,"");var n=document.querySelector("#extendify-root"),o="extendify-custom-stylesheet";if(document.getElementById(o))document.getElementById(o).innerHTML=r;else{var i=document.createElement("style");i.id=o,i.type="text/css",i.appendChild(document.createTextNode(r)),n.appendChild(i)}}}function l(t,e){var r,n,o="",a=function(t){return e.some((function(e){return t.startsWith(e)}))},u=i(null!==(r=null==t?void 0:t.cssRules)&&void 0!==r?r:[]);try{for(u.s();!(n=u.n()).done;){var l=n.value;if(l instanceof CSSMediaRule){var s;if(c(l))continue;for(var f=null!==(s=null==l?void 0:l.cssRules)&&void 0!==s?s:[],d=[],h=0,p=Object.keys(f);h<p.length;h++){var y=p[h];a((y in f?f[y]:{}).selectorText)||d.push(y)}for(var v=0,m=d;v<m.length;v++){var w=m[v];l.deleteRule(w)}o+=l.cssText}if(l instanceof CSSStyleRule){if(c(l))continue;o+=a(l.selectorText)?l.cssText:""}}}catch(t){u.e(t)}finally{u.f()}return o}window._wpLoadBlockEditor&&window.addEventListener("extendify-sdk::template-inserted",(function(t){var e,r,o,i,a=t.detail.template,c="editorplus-template.php";if(null!=a&&null!==(e=a.fields)&&void 0!==e&&null!==(r=e.instructions)&&void 0!==r&&r.includes("enable_page_template")){var u=null!==(o=null===(i=(0,n.select)("core/editor").getEditorSettings())||void 0===i?void 0:i.availableTemplates)&&void 0!==o?o:{};Object.keys(u).includes(c)&&(0,n.dispatch)("core/editor").editPost({template:c})}})),window._wpLoadBlockEditor&&window.addEventListener("extendify-sdk::template-inserted",function(){var t,r=(t=e().mark((function t(r){var o,i,a,c,s,f,d,h,p,y,v,m;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r.detail.template,c=null!==(o=null==a||null===(i=a.fields)||void 0===i?void 0:i.stylesheet)&&void 0!==o?o:""){t.next=4;break}return t.abrupt("return");case 4:return t.prev=4,t.next=7,fetch(c);case 7:return t.next=9,t.sent.text();case 9:return d=t.sent,h=null!==(s=null===(f=(0,n.select)("core/editor").getEditedPostAttribute("meta"))||void 0===f?void 0:f.extendify_custom_stylesheet)&&void 0!==s?s:"",p=document.createElement("style"),y="extendify-stylesheet",p.id=y,p.type="text/css",p.appendChild(document.createTextNode(d)),document.querySelector("#extendify-root").appendChild(p),(v=document.getElementById(y)).sheet.disable=!0,m=l(null==v?void 0:v.sheet,[".extendify-",".eplus_styles",".eplus-",'[class*="extendify-"]','[class*="extendify"]']),m+=h,v.parentNode.removeChild(v),u(m),t.next=25,(0,n.dispatch)("core/editor").editPost({meta:{extendify_custom_stylesheet:m}});case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(4),console.error(t.t0);case 30:case"end":return t.stop()}}),t,null,[[4,27]])})),function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))});return function(t){return r.apply(this,arguments)}}()),window._wpLoadBlockEditor&&window.wp.domReady((function(){setTimeout((function(){return u()}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){var t="editorplus-template.php"===window.wp.data.select("core/editor").getEditedPostAttribute("template"),e=document.querySelector(".edit-post-visual-editor__post-title-wrapper"),r=document.querySelector(".editor-styles-wrapper");e&&r&&(t?(Promise.resolve().then((function(){return e.style.display="none"})),r.style.paddingTop="0",r.style.backgroundColor="#ffffff"):(e.style.removeProperty("display"),r.style.removeProperty("padding-top"),r.style.removeProperty("background-color")))}))})()})();
extendify-sdk/public/mix-manifest.json CHANGED
@@ -1,4 +1,5 @@
1
  {
2
  "/build/extendify-sdk.js": "/build/extendify-sdk.js",
 
3
  "/build/extendify-sdk.css": "/build/extendify-sdk.css"
4
  }
1
  {
2
  "/build/extendify-sdk.js": "/build/extendify-sdk.js",
3
+ "/editorplus/editorplus.min.js": "/editorplus/editorplus.min.js",
4
  "/build/extendify-sdk.css": "/build/extendify-sdk.css"
5
  }
extendify-sdk/readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
- Stable tag: 3.5
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
+ Stable tag: 3.6
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
extendify-sdk/src/components/Filtering.js CHANGED
@@ -21,7 +21,14 @@ export default function Filtering() {
21
  const [searchValue, setSearchValue] = useState(searchParams?.search ?? '')
22
  const [taxonomies, setTaxonomies] = useState({})
23
  const fetchTaxonomies = useCallback(async () => {
24
- const tax = await TaxonomiesApi.get()
 
 
 
 
 
 
 
25
  setupDefaultTaxonomies(tax)
26
  setTaxonomies(tax)
27
  }, [setupDefaultTaxonomies])
21
  const [searchValue, setSearchValue] = useState(searchParams?.search ?? '')
22
  const [taxonomies, setTaxonomies] = useState({})
23
  const fetchTaxonomies = useCallback(async () => {
24
+ let tax = await TaxonomiesApi.get()
25
+ // Only allow items that have the 'tax_' prefix
26
+ tax = Object.keys(tax)
27
+ .filter((t) => t.startsWith('tax_'))
28
+ .reduce((taxFiltered, key) => {
29
+ taxFiltered[key] = tax[key]
30
+ return taxFiltered
31
+ }, {})
32
  setupDefaultTaxonomies(tax)
33
  setTaxonomies(tax)
34
  }, [setupDefaultTaxonomies])
extendify-sdk/src/components/SidebarSingle.js CHANGED
@@ -45,24 +45,32 @@ export default function SidebarSingle({ template }) {
45
  </button>
46
  </div>
47
  {/* Hides on mobile and is repeated at the bottom of the single page too */}
48
- <div className="text-xs text-left pt-20 divide-y w-full hidden sm:block">
49
- <div className="w-full">
50
  <h3 className="m-0 mb-6">{__('Categories', 'extendify-sdk')}</h3>
51
- <ul className="text-sm">
52
  {categories.map((category) =>
53
  <li key={category} className="inline-block mr-2 px-4 py-2 bg-gray-100">
54
  {category}
55
  </li>)}
56
  </ul>
57
  </div>
58
- <div className="pt-4 w-full">
59
  <h3 className="m-0 mb-6">{__('Required Plugins', 'extendify-sdk')}</h3>
60
  <ul className="text-sm">
61
- {requiredPlugins.map((plugin) =>
62
- <li key={plugin} className="inline-block mr-2 px-4 py-2 bg-extendify-light">
63
- {getPluginDescription(plugin)}
64
- </li>)}
 
 
 
65
  </ul>
 
 
 
 
 
66
  </div>
67
  </div>
68
  </div>
45
  </button>
46
  </div>
47
  {/* Hides on mobile and is repeated at the bottom of the single page too */}
48
+ <div className="text-left pt-14 divide-y w-full hidden sm:block">
49
+ <div className="w-full py-6">
50
  <h3 className="m-0 mb-6">{__('Categories', 'extendify-sdk')}</h3>
51
+ <ul className="text-sm m-0">
52
  {categories.map((category) =>
53
  <li key={category} className="inline-block mr-2 px-4 py-2 bg-gray-100">
54
  {category}
55
  </li>)}
56
  </ul>
57
  </div>
58
+ {requiredPlugins.filter((p) => p !== 'editorplus').length > 0 && <div className="pt-4 w-full">
59
  <h3 className="m-0 mb-6">{__('Required Plugins', 'extendify-sdk')}</h3>
60
  <ul className="text-sm">
61
+ {
62
+ // Hardcoded temporarily to not force EP install
63
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
64
+ <li key={plugin} className="inline-block mr-2 px-4 py-2 bg-extendify-light">
65
+ {getPluginDescription(plugin)}
66
+ </li>)
67
+ }
68
  </ul>
69
+ </div>}
70
+ <div className="py-6">
71
+ <a href="https://extendify.com/what-happens-when-a-template-is-added" rel="noreferrer" target="_blank">
72
+ {__('What happens when a template is added?', 'extendify-sdk')}
73
+ </a>
74
  </div>
75
  </div>
76
  </div>
extendify-sdk/src/components/TaxonomyBreadcrumbs.js CHANGED
@@ -3,19 +3,20 @@ import { useTemplatesStore } from '../state/Templates'
3
  export default function TaxonomyBreadcrumbs() {
4
  const searchParams = useTemplatesStore(state => state.searchParams)
5
  const formatTitle = (title) => title.replace('tax_', '').replace('_' , ' ').replace(/\b\w/g, l => l.toUpperCase())
6
- return <div className="hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none">{Object.entries(searchParams.taxonomies).map((tax) => {
7
- // Special exception for page templates
8
- if (searchParams.type === 'template' && tax[0] === 'tax_pattern_types') {
9
- return ''
10
- }
11
- // Special exception for page types
12
- if (searchParams.type === 'pattern' && tax[0] === 'tax_page_types') {
13
- return ''
14
- }
15
- return <div key={tax[0]} className="lg:px-2 text-left">
16
- <span className="font-bold">{formatTitle(tax[0])}</span>: <span>{tax[1]
17
- ? tax[1]
18
- : 'All'}</span>
19
- </div>
20
- })}</div>
 
21
  }
3
  export default function TaxonomyBreadcrumbs() {
4
  const searchParams = useTemplatesStore(state => state.searchParams)
5
  const formatTitle = (title) => title.replace('tax_', '').replace('_' , ' ').replace(/\b\w/g, l => l.toUpperCase())
6
+ return <div className="hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none">
7
+ {Object.entries(searchParams.taxonomies).map((tax) => {
8
+ // Special exception for page templates
9
+ if (searchParams.type === 'template' && tax[0] === 'tax_pattern_types') {
10
+ return ''
11
+ }
12
+ // Special exception for page types
13
+ if (searchParams.type === 'pattern' && tax[0] === 'tax_page_types') {
14
+ return ''
15
+ }
16
+ return <div key={tax[0]} className="lg:px-2 text-left">
17
+ <span className="font-bold">{formatTitle(tax[0])}</span>: <span>{tax[1]
18
+ ? tax[1]
19
+ : 'All'}</span>
20
+ </div>
21
+ })}</div>
22
  }
extendify-sdk/src/layout/Content.js CHANGED
@@ -29,6 +29,7 @@ export default function Content({ className, initialFocus }) {
29
  <Filtering initialFocus={initialFocus}/>
30
  <>
31
  <TypeSelect/>
 
32
  <TaxonomyBreadcrumbs/>
33
  <div className="relative h-full z-30 bg-white">
34
  <div className="absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8">
29
  <Filtering initialFocus={initialFocus}/>
30
  <>
31
  <TypeSelect/>
32
+ {/* TODO: we may want to inject this as a portal so it can directly share state with Filtering.js */}
33
  <TaxonomyBreadcrumbs/>
34
  <div className="relative h-full z-30 bg-white">
35
  <div className="absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8">
extendify-sdk/src/listeners/index.js CHANGED
@@ -1,5 +1,7 @@
1
  import { templateHandler } from './template-inserted'
2
  import { softErrorHandler } from './softerror-encountered'
3
 
4
- templateHandler.register()
5
- softErrorHandler.register()
 
 
1
  import { templateHandler } from './template-inserted'
2
  import { softErrorHandler } from './softerror-encountered'
3
 
4
+ [
5
+ templateHandler,
6
+ softErrorHandler,
7
+ ].forEach(listener => listener.register())
extendify-sdk/src/middleware/hasPluginsActivated/ActivatePluginsModal.js CHANGED
@@ -27,10 +27,13 @@ export default function ActivatePluginsModal(props) {
27
  'extendify-sdk')}
28
  </p>
29
  <ul>
30
- {requiredPlugins.map((plugin) =>
31
- <li key={plugin}>
32
- {getPluginDescription(plugin)}
33
- </li>)}
 
 
 
34
  </ul>
35
  <ButtonGroup>
36
  <Button isPrimary onClick={installPlugins}>
27
  'extendify-sdk')}
28
  </p>
29
  <ul>
30
+ {
31
+ // Hardcoded temporarily to not force EP install
32
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
33
+ <li key={plugin}>
34
+ {getPluginDescription(plugin)}
35
+ </li>)
36
+ }
37
  </ul>
38
  <ButtonGroup>
39
  <Button isPrimary onClick={installPlugins}>
extendify-sdk/src/middleware/hasPluginsActivated/ActivatingModal.js CHANGED
@@ -10,15 +10,16 @@ export default function ActivatingModal() {
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
- Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins)
14
- .then(() => {
15
- useWantedTemplateStore.setState({
16
- importOnLoad: true,
17
- })
18
- }).then(async () => {
19
- await new Promise((resolve) => setTimeout(resolve, 1000))
20
- render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
21
  })
 
 
 
 
22
  .catch(({ response }) => {
23
  setErrorMessage(response.data.message)
24
  })
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
+ Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins
14
+ // Hardcoded temporarily to not force EP install
15
+ .filter(p => p !== 'editorplus')).then(() => {
16
+ useWantedTemplateStore.setState({
17
+ importOnLoad: true,
 
 
 
18
  })
19
+ }).then(async () => {
20
+ await new Promise((resolve) => setTimeout(resolve, 1000))
21
+ render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
22
+ })
23
  .catch(({ response }) => {
24
  setErrorMessage(response.data.message)
25
  })
extendify-sdk/src/middleware/hasRequiredPlugins/InstallingModal.js CHANGED
@@ -10,14 +10,15 @@ export default function InstallingModal() {
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
- Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins)
14
- .then(() => {
15
- useWantedTemplateStore.setState({
16
- importOnLoad: true,
17
- })
18
- render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
19
  })
20
- .catch(({message}) => {
 
 
21
  setErrorMessage(message)
22
  })
23
 
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
+ Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins
14
+ // Hardcoded temporarily to not force EP install
15
+ .filter(p => p !== 'editorplus')).then(() => {
16
+ useWantedTemplateStore.setState({
17
+ importOnLoad: true,
 
18
  })
19
+ render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
20
+ })
21
+ .catch(({ message }) => {
22
  setErrorMessage(message)
23
  })
24
 
extendify-sdk/src/middleware/hasRequiredPlugins/RequiredPluginsModal.js CHANGED
@@ -32,10 +32,13 @@ export default function RequiredPluginsModal(props) {
32
  'extendify-sdk')}
33
  </p>
34
  {props.message?.length > 0 || <ul>
35
- {requiredPlugins.map((plugin) =>
36
- <li key={plugin}>
37
- {getPluginDescription(plugin)}
38
- </li>)}
 
 
 
39
  </ul>}
40
  <ButtonGroup>
41
  <Button isPrimary onClick={installPlugins}>
32
  'extendify-sdk')}
33
  </p>
34
  {props.message?.length > 0 || <ul>
35
+ {
36
+ // Hardcoded temporarily to not force EP install
37
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
38
+ <li key={plugin}>
39
+ {getPluginDescription(plugin)}
40
+ </li>)
41
+ }
42
  </ul>}
43
  <ButtonGroup>
44
  <Button isPrimary onClick={installPlugins}>
extendify-sdk/src/middleware/helpers.js CHANGED
@@ -2,12 +2,14 @@ import { Plugins } from '../api/Plugins'
2
  import { get } from 'lodash'
3
  export async function checkIfUserNeedsToInstallPlugins(template) {
4
  // TODO: for now assume required plugins is valid data (from Airtable)!
5
- const required = get(template, 'fields.required_plugins') ?? []
 
 
6
  if (!required.length) {
7
  return false
8
  }
9
- let installed = Object.keys(await Plugins.getInstalled())
10
 
 
11
  // if no dependencies are required, then this will be false automatically
12
  const weNeedInstalls = required.length
13
  ? required.filter((plugin) => {
@@ -23,7 +25,10 @@ export async function checkIfUserNeedsToInstallPlugins(template) {
23
 
24
  export async function checkIfUserNeedsToActivatePlugins(template) {
25
  // TODO: for now assume required plugins is valid data (from Airtable)!
26
- const required = get(template, 'fields.required_plugins') ?? []
 
 
 
27
  if (!required.length) {
28
  return false
29
  }
2
  import { get } from 'lodash'
3
  export async function checkIfUserNeedsToInstallPlugins(template) {
4
  // TODO: for now assume required plugins is valid data (from Airtable)!
5
+ let required = get(template, 'fields.required_plugins') ?? []
6
+ // Hardcoded temporarily to not force EP install
7
+ required = required.filter((p) => p !== 'editorplus')
8
  if (!required.length) {
9
  return false
10
  }
 
11
 
12
+ let installed = Object.keys(await Plugins.getInstalled())
13
  // if no dependencies are required, then this will be false automatically
14
  const weNeedInstalls = required.length
15
  ? required.filter((plugin) => {
25
 
26
  export async function checkIfUserNeedsToActivatePlugins(template) {
27
  // TODO: for now assume required plugins is valid data (from Airtable)!
28
+ let required = get(template, 'fields.required_plugins') ?? []
29
+
30
+ // Hardcoded temporarily to not force EP install
31
+ required = required.filter((p) => p !== 'editorplus')
32
  if (!required.length) {
33
  return false
34
  }
extendify-sdk/webpack.mix.js CHANGED
@@ -1,5 +1,6 @@
1
  const path = require('path')
2
  const camelCaseDash = (string) => string.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase())
 
3
 
4
  // If you add additional WP imports, include them here (could we generate these?)
5
  const externals = [
@@ -27,9 +28,9 @@ const globals = externals.reduce((externals, name) => ({
27
  [`@wordpress/${name}`]: `wp.${camelCaseDash(name)}`,
28
  }), {})
29
 
30
- require('laravel-mix').js('src/app.js', 'public/build/extendify-sdk.js')
31
- .webpackConfig({
32
- context: path.resolve(__dirname, 'src'),
33
  externals: {
34
  wp: 'wp',
35
  lodash: 'lodash',
@@ -38,7 +39,11 @@ require('laravel-mix').js('src/app.js', 'public/build/extendify-sdk.js')
38
  'react-dom': 'ReactDOM',
39
  ...globals,
40
  },
41
- })
 
 
 
 
42
  .react()
43
  .setPublicPath('public')
44
  .postCss(
@@ -51,3 +56,7 @@ require('laravel-mix').js('src/app.js', 'public/build/extendify-sdk.js')
51
  open: false,
52
  files: ['src/**/*'],
53
  })
 
 
 
 
1
  const path = require('path')
2
  const camelCaseDash = (string) => string.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase())
3
+ const mix = require('laravel-mix')
4
 
5
  // If you add additional WP imports, include them here (could we generate these?)
6
  const externals = [
28
  [`@wordpress/${name}`]: `wp.${camelCaseDash(name)}`,
29
  }), {})
30
 
31
+ const webpackConfig = (context) => {
32
+ return {
33
+ context: context,
34
  externals: {
35
  wp: 'wp',
36
  lodash: 'lodash',
39
  'react-dom': 'ReactDOM',
40
  ...globals,
41
  },
42
+ }
43
+ }
44
+
45
+ mix.js('src/app.js', 'public/build/extendify-sdk.js')
46
+ .webpackConfig(webpackConfig(path.resolve(__dirname, 'src')))
47
  .react()
48
  .setPublicPath('public')
49
  .postCss(
56
  open: false,
57
  files: ['src/**/*'],
58
  })
59
+
60
+ mix.js('editorplus/editorplus.js', 'editorplus/editorplus.min.js')
61
+ .webpackConfig(webpackConfig(path.resolve(__dirname, 'editorplus')))
62
+ .react()
freemius/assets/img/acf-blocks.png ADDED
Binary file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: block, gutenberg block, acf block, gutenberg, acf, editor
4
  Requires at least: 5.0
5
  Requires PHP: 5.6
6
  Tested up to: 5.7
7
- Stable tag: 2.6.4
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -165,6 +165,9 @@ Absolutely! You can definitely use the ACF Blocks on yours as well as your clien
165
 
166
  == Changelog ==
167
 
 
 
 
168
  = 2.6.4 =
169
  * New: Toggle to enable/disable Extendify library
170
  * Improved: Updates to the pattern and template library
4
  Requires at least: 5.0
5
  Requires PHP: 5.6
6
  Tested up to: 5.7
7
+ Stable tag: 2.6.5
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
165
 
166
  == Changelog ==
167
 
168
+ = 2.6.5 =
169
+ * Improved: Library
170
+
171
  = 2.6.4 =
172
  * New: Toggle to enable/disable Extendify library
173
  * Improved: Updates to the pattern and template library